@robosystems/core 0.22.2 → 0.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -612,7 +612,7 @@ export function ConsoleContent({ config, variant = 'page', }) {
|
|
|
612
612
|
`Once connected, ask questions like:\n` +
|
|
613
613
|
`${exampleLines}\n\n` +
|
|
614
614
|
`Clients without HTTP transport support can use the stdio bridge\n` +
|
|
615
|
-
`in proxy mode: https://github.com/RoboFinSystems/robosystems-mcp-
|
|
615
|
+
`in proxy mode: https://github.com/RoboFinSystems/robosystems-mcp-bridge`, true);
|
|
616
616
|
return;
|
|
617
617
|
}
|
|
618
618
|
addSystemMessage('Creating graph-scoped API key...', true);
|
package/package.json
CHANGED
|
@@ -46,8 +46,8 @@ export declare function useGraphCreation(): {
|
|
|
46
46
|
instance_tier?: string;
|
|
47
47
|
schema_extensions?: string[];
|
|
48
48
|
/**
|
|
49
|
-
* Generic graphs only: the node/relationship
|
|
50
|
-
*
|
|
49
|
+
* Generic graphs only, and required for them: the node/relationship
|
|
50
|
+
* schema to apply, with at least one node.
|
|
51
51
|
*/
|
|
52
52
|
custom_schema?: Record<string, unknown>;
|
|
53
53
|
create_entity?: boolean;
|
|
@@ -76,7 +76,7 @@ export declare function useGraphCreation(): {
|
|
|
76
76
|
tags?: string[];
|
|
77
77
|
instance_tier?: string;
|
|
78
78
|
schema_extensions?: string[];
|
|
79
|
-
custom_schema
|
|
79
|
+
custom_schema: Record<string, unknown>;
|
|
80
80
|
org_id?: string;
|
|
81
81
|
}) => Promise<any>;
|
|
82
82
|
startMonitoring: (operationId: string, options?: {
|
|
@@ -126,17 +126,16 @@ export function useOperationMonitoring() {
|
|
|
126
126
|
reset });
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
|
-
* The schema
|
|
130
|
-
*
|
|
129
|
+
* The schema of a generic graph. A graph cannot be provisioned without a node
|
|
130
|
+
* table, so a missing schema or one with no nodes is refused before any request.
|
|
131
131
|
*/
|
|
132
132
|
function genericSchema(graphData) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
return { name, nodes: [], relationships: [] };
|
|
133
|
+
var _a;
|
|
134
|
+
const nodes = (_a = graphData.custom_schema) === null || _a === void 0 ? void 0 : _a.nodes;
|
|
135
|
+
if (!graphData.custom_schema || !Array.isArray(nodes) || nodes.length === 0) {
|
|
136
|
+
throw new Error('A generic graph needs a schema that defines at least one node.');
|
|
137
|
+
}
|
|
138
|
+
return graphData.custom_schema;
|
|
140
139
|
}
|
|
141
140
|
/**
|
|
142
141
|
* Hook for graph creation using the new unified endpoint
|
|
@@ -148,6 +147,9 @@ export function useGraphCreation() {
|
|
|
148
147
|
var _a, _b, _c, _d;
|
|
149
148
|
setIsCreating(true);
|
|
150
149
|
try {
|
|
150
|
+
const customSchema = graphData.graph_type === 'generic'
|
|
151
|
+
? genericSchema(graphData)
|
|
152
|
+
: undefined;
|
|
151
153
|
// Check if billing is enabled and user needs to complete checkout
|
|
152
154
|
let billingData = null;
|
|
153
155
|
if (graphData.org_id) {
|
|
@@ -176,9 +178,7 @@ export function useGraphCreation() {
|
|
|
176
178
|
description: graphData.description,
|
|
177
179
|
tags: graphData.tags,
|
|
178
180
|
schema_extensions: graphData.schema_extensions,
|
|
179
|
-
custom_schema:
|
|
180
|
-
? genericSchema(graphData)
|
|
181
|
-
: undefined,
|
|
181
|
+
custom_schema: customSchema,
|
|
182
182
|
create_entity: graphData.create_entity,
|
|
183
183
|
entity_name: graphData.entity_name,
|
|
184
184
|
entity_identifier: graphData.entity_identifier,
|
|
@@ -229,8 +229,8 @@ export function useGraphCreation() {
|
|
|
229
229
|
};
|
|
230
230
|
// A generic graph is defined by its schema; the API requires either
|
|
231
231
|
// a custom_schema or an initial_entity.
|
|
232
|
-
if (
|
|
233
|
-
requestBody.custom_schema =
|
|
232
|
+
if (customSchema) {
|
|
233
|
+
requestBody.custom_schema = customSchema;
|
|
234
234
|
}
|
|
235
235
|
// Add initial_entity for entity or company graphs
|
|
236
236
|
if (graphData.graph_type === 'entity' && graphData.entity_name) {
|