From db58a7b3f76c91293a24043728d16579d083efa1 Mon Sep 17 00:00:00 2001 From: tokebe <43009413+tokebe@users.noreply.github.com> Date: Tue, 24 Sep 2024 14:04:50 -0400 Subject: [PATCH] fix: use TrapiAttribute --- src/record.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/record.ts b/src/record.ts index 8450b2b..7d29294 100644 --- a/src/record.ts +++ b/src/record.ts @@ -1,6 +1,6 @@ import crypto from "crypto"; import _ from "lodash"; -import { TrapiSource } from "@biothings-explorer/types"; +import { TrapiAttribute, TrapiSource } from "@biothings-explorer/types"; function hash(string: string) { return crypto.createHash("md5").update(string).digest("hex"); @@ -400,9 +400,9 @@ export class Record { }; } - _getFlattenedEdgeAttributes(attributes: EdgeAttribute[]): EdgeAttribute[] { + _getFlattenedEdgeAttributes(attributes: TrapiAttribute[]): TrapiAttribute[] { return attributes - ? attributes.reduce((arr: EdgeAttribute[], attribute: EdgeAttribute) => { + ? attributes.reduce((arr: TrapiAttribute[], attribute: TrapiAttribute) => { attribute.attributes ? arr.push( attribute, @@ -629,7 +629,7 @@ export type RecordPackage = [apiEdges: any[], ...frozenRecords: FrozenRecord[]]; export interface MappedResponse { trapi_sources?: TrapiSource[]; - "edge-attributes"?: EdgeAttribute[]; + "edge-attributes"?: TrapiAttribute[]; [mappedItems: string]: any; } @@ -661,15 +661,6 @@ export interface QNode { [additionalProperties: string]: any; } -export interface EdgeAttribute { - attribute_source: string; - attribute_type_id: string; - value: any; - value_type_id: string; - attributes?: EdgeAttribute[]; - [additionalProperties: string]: any; -} - export interface Identifier { identifier: string; label?: string;