Skip to content

Commit 6fe4b0c

Browse files
committed
Add metadata to graph exploration OpenAPI spec.
1 parent 544c4a1 commit 6fe4b0c

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

packages/marble-api/openapis/marblecore-api/graph.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@
9191
required: true
9292
schema:
9393
type: string
94+
- name: types
95+
description: Comma-separated entity types to look for
96+
in: query
97+
schema:
98+
type: string
99+
- name: degrees
100+
description: Depth to walk the graph for
101+
in: query
102+
schema:
103+
type: integer
104+
minimum: 1
105+
maximum: 5
94106
responses:
95107
"200":
96108
description: Relationship graph
@@ -196,6 +208,17 @@ components:
196208
enum: [match, link]
197209
hypernode_count:
198210
type: integer
211+
metadata:
212+
type: object
213+
properties:
214+
risk_level:
215+
type: integer
216+
tags:
217+
type: array
218+
items:
219+
type: string
220+
format: uuid
221+
199222

200223
GraphEdge:
201224
type: object

packages/marble-api/src/generated/marblecore-api.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,6 +2175,10 @@ export type GraphNode = GraphNodeRef & {
21752175
connector?: boolean;
21762176
connector_kind?: "match" | "link";
21772177
hypernode_count?: number;
2178+
metadata?: {
2179+
risk_level?: number;
2180+
tags?: string[];
2181+
};
21782182
};
21792183
export type GraphEdge = {
21802184
kind: string;
@@ -7354,7 +7358,10 @@ export function deleteGraphRelation(relationId: string, opts?: Oazapfts.RequestO
73547358
/**
73557359
* Generate the relationship graph from a starting record
73567360
*/
7357-
export function generateRelationshipGraph(recordType: string, recordId: string, opts?: Oazapfts.RequestOpts) {
7361+
export function generateRelationshipGraph(recordType: string, recordId: string, { types, degrees }: {
7362+
types?: string;
7363+
degrees?: number;
7364+
} = {}, opts?: Oazapfts.RequestOpts) {
73587365
return oazapfts.ok(oazapfts.fetchJson<{
73597366
status: 200;
73607367
data: Graph;
@@ -7364,7 +7371,10 @@ export function generateRelationshipGraph(recordType: string, recordId: string,
73647371
} | {
73657372
status: 403;
73667373
data: string;
7367-
}>(`/graph/${encodeURIComponent(recordType)}/${encodeURIComponent(recordId)}`, {
7374+
}>(`/graph/${encodeURIComponent(recordType)}/${encodeURIComponent(recordId)}${QS.query(QS.explode({
7375+
types,
7376+
degrees
7377+
}))}`, {
73687378
...opts
73697379
}));
73707380
}

0 commit comments

Comments
 (0)