Skip to content

Commit

Permalink
fix: use TrapiAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Sep 24, 2024
1 parent 13c306d commit db58a7b
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/record.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit db58a7b

Please sign in to comment.