@elqnt/kg 2.0.7 → 2.1.1
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.
- package/dist/api/index.d.mts +110 -0
- package/dist/api/index.d.ts +110 -0
- package/dist/api/index.js +64 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +64 -0
- package/dist/chunk-3AS6C7FW.mjs +217 -0
- package/dist/chunk-3AS6C7FW.mjs.map +1 -0
- package/dist/chunk-4XIW5GLO.js +217 -0
- package/dist/chunk-4XIW5GLO.js.map +1 -0
- package/dist/{chunk-2OYIMLE4.js → chunk-67SUELDR.js} +4 -2
- package/dist/chunk-67SUELDR.js.map +1 -0
- package/dist/chunk-7HNJUCVW.js +577 -0
- package/dist/chunk-7HNJUCVW.js.map +1 -0
- package/dist/chunk-EW3NQGUZ.mjs +577 -0
- package/dist/chunk-EW3NQGUZ.mjs.map +1 -0
- package/dist/chunk-NJNBEGDB.mjs +2 -0
- package/dist/chunk-NJNBEGDB.mjs.map +1 -0
- package/dist/{chunk-IXLQ6ZMR.mjs → chunk-RDIQ7HTM.mjs} +3 -1
- package/dist/{chunk-IXLQ6ZMR.mjs.map → chunk-RDIQ7HTM.mjs.map} +1 -1
- package/dist/{chunk-WEMVDZJ3.js → chunk-UCKE66GB.js} +4 -2
- package/dist/chunk-UCKE66GB.js.map +1 -0
- package/dist/{chunk-EF7YJ7LL.mjs → chunk-VUSVP6OI.mjs} +3 -1
- package/dist/{chunk-EF7YJ7LL.mjs.map → chunk-VUSVP6OI.mjs.map} +1 -1
- package/dist/chunk-W4XVBGE7.js +2 -0
- package/dist/chunk-W4XVBGE7.js.map +1 -0
- package/dist/hooks/index.d.mts +89 -0
- package/dist/hooks/index.d.ts +89 -0
- package/dist/hooks/index.js +16 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +16 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +75 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -4
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.js +5 -4
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +4 -3
- package/dist/models/kg-designer.js +4 -3
- package/dist/models/kg-designer.js.map +1 -1
- package/dist/models/kg-designer.mjs +2 -1
- package/dist/models/kg.js +4 -3
- package/dist/models/kg.js.map +1 -1
- package/dist/models/kg.mjs +2 -1
- package/package.json +34 -20
- package/dist/chunk-2OYIMLE4.js.map +0 -1
- package/dist/chunk-J3XZF6JO.mjs +0 -1
- package/dist/chunk-RDWVE6B2.js +0 -1
- package/dist/chunk-RDWVE6B2.js.map +0 -1
- package/dist/chunk-WEMVDZJ3.js.map +0 -1
- /package/dist/{chunk-J3XZF6JO.mjs.map → api/index.mjs.map} +0 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cancelCrawlJobApi,
|
|
4
|
+
createDesignerEdgeApi,
|
|
5
|
+
createDesignerNodeApi,
|
|
6
|
+
createGraphApi,
|
|
7
|
+
deleteDesignerEdgeApi,
|
|
8
|
+
deleteDesignerNodeApi,
|
|
9
|
+
deleteGraphApi,
|
|
10
|
+
getCrawlJobStatusApi,
|
|
11
|
+
getCrawledPagesApi,
|
|
12
|
+
getDesignerNodeApi,
|
|
13
|
+
getGraphApi,
|
|
14
|
+
getGraphLabelsApi,
|
|
15
|
+
getKGNodeApi,
|
|
16
|
+
ingestKGNodeApi,
|
|
17
|
+
listCrawlJobsApi,
|
|
18
|
+
listDesignerEdgesApi,
|
|
19
|
+
listDesignerNodesApi,
|
|
20
|
+
listGraphsApi,
|
|
21
|
+
queryGraphApi,
|
|
22
|
+
startCrawlJobApi,
|
|
23
|
+
updateDesignerEdgeApi,
|
|
24
|
+
updateDesignerNodeApi,
|
|
25
|
+
updateGraphApi,
|
|
26
|
+
updateKGNodeApi
|
|
27
|
+
} from "./chunk-3AS6C7FW.mjs";
|
|
28
|
+
|
|
29
|
+
// hooks/index.ts
|
|
30
|
+
import { useState, useCallback, useMemo, useRef, useEffect } from "react";
|
|
31
|
+
function useGraphs(options) {
|
|
32
|
+
const [loading, setLoading] = useState(false);
|
|
33
|
+
const [error, setError] = useState(null);
|
|
34
|
+
const optionsRef = useRef(options);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
optionsRef.current = options;
|
|
37
|
+
}, [options]);
|
|
38
|
+
const listGraphs = useCallback(async () => {
|
|
39
|
+
setLoading(true);
|
|
40
|
+
setError(null);
|
|
41
|
+
try {
|
|
42
|
+
const response = await listGraphsApi(optionsRef.current);
|
|
43
|
+
if (response.error) {
|
|
44
|
+
setError(response.error);
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return response.data?.graphs || [];
|
|
48
|
+
} catch (err) {
|
|
49
|
+
const message = err instanceof Error ? err.message : "Failed to load graphs";
|
|
50
|
+
setError(message);
|
|
51
|
+
return [];
|
|
52
|
+
} finally {
|
|
53
|
+
setLoading(false);
|
|
54
|
+
}
|
|
55
|
+
}, []);
|
|
56
|
+
const getGraph = useCallback(async (graphId) => {
|
|
57
|
+
setLoading(true);
|
|
58
|
+
setError(null);
|
|
59
|
+
try {
|
|
60
|
+
const response = await getGraphApi(graphId, optionsRef.current);
|
|
61
|
+
if (response.error) {
|
|
62
|
+
setError(response.error);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return response.data?.graph || null;
|
|
66
|
+
} catch (err) {
|
|
67
|
+
const message = err instanceof Error ? err.message : "Failed to get graph";
|
|
68
|
+
setError(message);
|
|
69
|
+
return null;
|
|
70
|
+
} finally {
|
|
71
|
+
setLoading(false);
|
|
72
|
+
}
|
|
73
|
+
}, []);
|
|
74
|
+
const createGraph = useCallback(async (graph) => {
|
|
75
|
+
setLoading(true);
|
|
76
|
+
setError(null);
|
|
77
|
+
try {
|
|
78
|
+
const response = await createGraphApi(graph, optionsRef.current);
|
|
79
|
+
if (response.error) {
|
|
80
|
+
setError(response.error);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return response.data?.graph || null;
|
|
84
|
+
} catch (err) {
|
|
85
|
+
const message = err instanceof Error ? err.message : "Failed to create graph";
|
|
86
|
+
setError(message);
|
|
87
|
+
return null;
|
|
88
|
+
} finally {
|
|
89
|
+
setLoading(false);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
92
|
+
const updateGraph = useCallback(async (graphId, updates) => {
|
|
93
|
+
setLoading(true);
|
|
94
|
+
setError(null);
|
|
95
|
+
try {
|
|
96
|
+
const response = await updateGraphApi(graphId, updates, optionsRef.current);
|
|
97
|
+
if (response.error) {
|
|
98
|
+
setError(response.error);
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return response.data?.graph || null;
|
|
102
|
+
} catch (err) {
|
|
103
|
+
const message = err instanceof Error ? err.message : "Failed to update graph";
|
|
104
|
+
setError(message);
|
|
105
|
+
return null;
|
|
106
|
+
} finally {
|
|
107
|
+
setLoading(false);
|
|
108
|
+
}
|
|
109
|
+
}, []);
|
|
110
|
+
const deleteGraph = useCallback(async (graphId) => {
|
|
111
|
+
setLoading(true);
|
|
112
|
+
setError(null);
|
|
113
|
+
try {
|
|
114
|
+
const response = await deleteGraphApi(graphId, optionsRef.current);
|
|
115
|
+
if (response.error) {
|
|
116
|
+
setError(response.error);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return response.data?.success ?? true;
|
|
120
|
+
} catch (err) {
|
|
121
|
+
const message = err instanceof Error ? err.message : "Failed to delete graph";
|
|
122
|
+
setError(message);
|
|
123
|
+
return false;
|
|
124
|
+
} finally {
|
|
125
|
+
setLoading(false);
|
|
126
|
+
}
|
|
127
|
+
}, []);
|
|
128
|
+
return useMemo(
|
|
129
|
+
() => ({
|
|
130
|
+
loading,
|
|
131
|
+
error,
|
|
132
|
+
listGraphs,
|
|
133
|
+
getGraph,
|
|
134
|
+
createGraph,
|
|
135
|
+
updateGraph,
|
|
136
|
+
deleteGraph
|
|
137
|
+
}),
|
|
138
|
+
[loading, error, listGraphs, getGraph, createGraph, updateGraph, deleteGraph]
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
function useKGQuery(options) {
|
|
142
|
+
const [loading, setLoading] = useState(false);
|
|
143
|
+
const [error, setError] = useState(null);
|
|
144
|
+
const optionsRef = useRef(options);
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
optionsRef.current = options;
|
|
147
|
+
}, [options]);
|
|
148
|
+
const query = useCallback(async (queryParams) => {
|
|
149
|
+
setLoading(true);
|
|
150
|
+
setError(null);
|
|
151
|
+
try {
|
|
152
|
+
const response = await queryGraphApi(queryParams, optionsRef.current);
|
|
153
|
+
if (response.error) {
|
|
154
|
+
setError(response.error);
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
return response.data || null;
|
|
158
|
+
} catch (err) {
|
|
159
|
+
const message = err instanceof Error ? err.message : "Failed to query graph";
|
|
160
|
+
setError(message);
|
|
161
|
+
return null;
|
|
162
|
+
} finally {
|
|
163
|
+
setLoading(false);
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
166
|
+
const getLabels = useCallback(async () => {
|
|
167
|
+
setLoading(true);
|
|
168
|
+
setError(null);
|
|
169
|
+
try {
|
|
170
|
+
const response = await getGraphLabelsApi(optionsRef.current);
|
|
171
|
+
if (response.error) {
|
|
172
|
+
setError(response.error);
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
return response.data?.labels || [];
|
|
176
|
+
} catch (err) {
|
|
177
|
+
const message = err instanceof Error ? err.message : "Failed to get labels";
|
|
178
|
+
setError(message);
|
|
179
|
+
return [];
|
|
180
|
+
} finally {
|
|
181
|
+
setLoading(false);
|
|
182
|
+
}
|
|
183
|
+
}, []);
|
|
184
|
+
const getNode = useCallback(async (nodeId) => {
|
|
185
|
+
setLoading(true);
|
|
186
|
+
setError(null);
|
|
187
|
+
try {
|
|
188
|
+
const response = await getKGNodeApi(nodeId, optionsRef.current);
|
|
189
|
+
if (response.error) {
|
|
190
|
+
setError(response.error);
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
return response.data?.node || null;
|
|
194
|
+
} catch (err) {
|
|
195
|
+
const message = err instanceof Error ? err.message : "Failed to get node";
|
|
196
|
+
setError(message);
|
|
197
|
+
return null;
|
|
198
|
+
} finally {
|
|
199
|
+
setLoading(false);
|
|
200
|
+
}
|
|
201
|
+
}, []);
|
|
202
|
+
const ingestNode = useCallback(async (node) => {
|
|
203
|
+
setLoading(true);
|
|
204
|
+
setError(null);
|
|
205
|
+
try {
|
|
206
|
+
const response = await ingestKGNodeApi(node, optionsRef.current);
|
|
207
|
+
if (response.error) {
|
|
208
|
+
setError(response.error);
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
return response.data?.nodeId || null;
|
|
212
|
+
} catch (err) {
|
|
213
|
+
const message = err instanceof Error ? err.message : "Failed to ingest node";
|
|
214
|
+
setError(message);
|
|
215
|
+
return null;
|
|
216
|
+
} finally {
|
|
217
|
+
setLoading(false);
|
|
218
|
+
}
|
|
219
|
+
}, []);
|
|
220
|
+
const updateNode = useCallback(async (nodeId, updates) => {
|
|
221
|
+
setLoading(true);
|
|
222
|
+
setError(null);
|
|
223
|
+
try {
|
|
224
|
+
const response = await updateKGNodeApi(nodeId, updates, optionsRef.current);
|
|
225
|
+
if (response.error) {
|
|
226
|
+
setError(response.error);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
return response.data?.success ?? true;
|
|
230
|
+
} catch (err) {
|
|
231
|
+
const message = err instanceof Error ? err.message : "Failed to update node";
|
|
232
|
+
setError(message);
|
|
233
|
+
return false;
|
|
234
|
+
} finally {
|
|
235
|
+
setLoading(false);
|
|
236
|
+
}
|
|
237
|
+
}, []);
|
|
238
|
+
return useMemo(
|
|
239
|
+
() => ({
|
|
240
|
+
loading,
|
|
241
|
+
error,
|
|
242
|
+
query,
|
|
243
|
+
getLabels,
|
|
244
|
+
getNode,
|
|
245
|
+
ingestNode,
|
|
246
|
+
updateNode
|
|
247
|
+
}),
|
|
248
|
+
[loading, error, query, getLabels, getNode, ingestNode, updateNode]
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
function useKGDesigner(options) {
|
|
252
|
+
const [loading, setLoading] = useState(false);
|
|
253
|
+
const [error, setError] = useState(null);
|
|
254
|
+
const optionsRef = useRef(options);
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
optionsRef.current = options;
|
|
257
|
+
}, [options]);
|
|
258
|
+
const listNodes = useCallback(async () => {
|
|
259
|
+
setLoading(true);
|
|
260
|
+
setError(null);
|
|
261
|
+
try {
|
|
262
|
+
const response = await listDesignerNodesApi(optionsRef.current);
|
|
263
|
+
if (response.error) {
|
|
264
|
+
setError(response.error);
|
|
265
|
+
return [];
|
|
266
|
+
}
|
|
267
|
+
return response.data?.nodes || [];
|
|
268
|
+
} catch (err) {
|
|
269
|
+
const message = err instanceof Error ? err.message : "Failed to list nodes";
|
|
270
|
+
setError(message);
|
|
271
|
+
return [];
|
|
272
|
+
} finally {
|
|
273
|
+
setLoading(false);
|
|
274
|
+
}
|
|
275
|
+
}, []);
|
|
276
|
+
const getNode = useCallback(async (label) => {
|
|
277
|
+
setLoading(true);
|
|
278
|
+
setError(null);
|
|
279
|
+
try {
|
|
280
|
+
const response = await getDesignerNodeApi(label, optionsRef.current);
|
|
281
|
+
if (response.error) {
|
|
282
|
+
setError(response.error);
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
return response.data?.node || null;
|
|
286
|
+
} catch (err) {
|
|
287
|
+
const message = err instanceof Error ? err.message : "Failed to get node";
|
|
288
|
+
setError(message);
|
|
289
|
+
return null;
|
|
290
|
+
} finally {
|
|
291
|
+
setLoading(false);
|
|
292
|
+
}
|
|
293
|
+
}, []);
|
|
294
|
+
const createNode = useCallback(
|
|
295
|
+
async (node) => {
|
|
296
|
+
setLoading(true);
|
|
297
|
+
setError(null);
|
|
298
|
+
try {
|
|
299
|
+
const response = await createDesignerNodeApi(node, optionsRef.current);
|
|
300
|
+
if (response.error) {
|
|
301
|
+
setError(response.error);
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
return response.data?.node || null;
|
|
305
|
+
} catch (err) {
|
|
306
|
+
const message = err instanceof Error ? err.message : "Failed to create node";
|
|
307
|
+
setError(message);
|
|
308
|
+
return null;
|
|
309
|
+
} finally {
|
|
310
|
+
setLoading(false);
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
[]
|
|
314
|
+
);
|
|
315
|
+
const updateNode = useCallback(
|
|
316
|
+
async (label, updates) => {
|
|
317
|
+
setLoading(true);
|
|
318
|
+
setError(null);
|
|
319
|
+
try {
|
|
320
|
+
const response = await updateDesignerNodeApi(label, updates, optionsRef.current);
|
|
321
|
+
if (response.error) {
|
|
322
|
+
setError(response.error);
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
return response.data?.node || null;
|
|
326
|
+
} catch (err) {
|
|
327
|
+
const message = err instanceof Error ? err.message : "Failed to update node";
|
|
328
|
+
setError(message);
|
|
329
|
+
return null;
|
|
330
|
+
} finally {
|
|
331
|
+
setLoading(false);
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
[]
|
|
335
|
+
);
|
|
336
|
+
const deleteNode = useCallback(async (label) => {
|
|
337
|
+
setLoading(true);
|
|
338
|
+
setError(null);
|
|
339
|
+
try {
|
|
340
|
+
const response = await deleteDesignerNodeApi(label, optionsRef.current);
|
|
341
|
+
if (response.error) {
|
|
342
|
+
setError(response.error);
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
return response.data?.success ?? true;
|
|
346
|
+
} catch (err) {
|
|
347
|
+
const message = err instanceof Error ? err.message : "Failed to delete node";
|
|
348
|
+
setError(message);
|
|
349
|
+
return false;
|
|
350
|
+
} finally {
|
|
351
|
+
setLoading(false);
|
|
352
|
+
}
|
|
353
|
+
}, []);
|
|
354
|
+
const listEdges = useCallback(async () => {
|
|
355
|
+
setLoading(true);
|
|
356
|
+
setError(null);
|
|
357
|
+
try {
|
|
358
|
+
const response = await listDesignerEdgesApi(optionsRef.current);
|
|
359
|
+
if (response.error) {
|
|
360
|
+
setError(response.error);
|
|
361
|
+
return [];
|
|
362
|
+
}
|
|
363
|
+
return response.data?.edges || [];
|
|
364
|
+
} catch (err) {
|
|
365
|
+
const message = err instanceof Error ? err.message : "Failed to list edges";
|
|
366
|
+
setError(message);
|
|
367
|
+
return [];
|
|
368
|
+
} finally {
|
|
369
|
+
setLoading(false);
|
|
370
|
+
}
|
|
371
|
+
}, []);
|
|
372
|
+
const createEdge = useCallback(
|
|
373
|
+
async (edge) => {
|
|
374
|
+
setLoading(true);
|
|
375
|
+
setError(null);
|
|
376
|
+
try {
|
|
377
|
+
const response = await createDesignerEdgeApi(edge, optionsRef.current);
|
|
378
|
+
if (response.error) {
|
|
379
|
+
setError(response.error);
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
return response.data?.edge || null;
|
|
383
|
+
} catch (err) {
|
|
384
|
+
const message = err instanceof Error ? err.message : "Failed to create edge";
|
|
385
|
+
setError(message);
|
|
386
|
+
return null;
|
|
387
|
+
} finally {
|
|
388
|
+
setLoading(false);
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
[]
|
|
392
|
+
);
|
|
393
|
+
const updateEdge = useCallback(
|
|
394
|
+
async (label, updates) => {
|
|
395
|
+
setLoading(true);
|
|
396
|
+
setError(null);
|
|
397
|
+
try {
|
|
398
|
+
const response = await updateDesignerEdgeApi(label, updates, optionsRef.current);
|
|
399
|
+
if (response.error) {
|
|
400
|
+
setError(response.error);
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
return response.data?.edge || null;
|
|
404
|
+
} catch (err) {
|
|
405
|
+
const message = err instanceof Error ? err.message : "Failed to update edge";
|
|
406
|
+
setError(message);
|
|
407
|
+
return null;
|
|
408
|
+
} finally {
|
|
409
|
+
setLoading(false);
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
[]
|
|
413
|
+
);
|
|
414
|
+
const deleteEdge = useCallback(async (label) => {
|
|
415
|
+
setLoading(true);
|
|
416
|
+
setError(null);
|
|
417
|
+
try {
|
|
418
|
+
const response = await deleteDesignerEdgeApi(label, optionsRef.current);
|
|
419
|
+
if (response.error) {
|
|
420
|
+
setError(response.error);
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
return response.data?.success ?? true;
|
|
424
|
+
} catch (err) {
|
|
425
|
+
const message = err instanceof Error ? err.message : "Failed to delete edge";
|
|
426
|
+
setError(message);
|
|
427
|
+
return false;
|
|
428
|
+
} finally {
|
|
429
|
+
setLoading(false);
|
|
430
|
+
}
|
|
431
|
+
}, []);
|
|
432
|
+
return useMemo(
|
|
433
|
+
() => ({
|
|
434
|
+
loading,
|
|
435
|
+
error,
|
|
436
|
+
// Nodes
|
|
437
|
+
listNodes,
|
|
438
|
+
getNode,
|
|
439
|
+
createNode,
|
|
440
|
+
updateNode,
|
|
441
|
+
deleteNode,
|
|
442
|
+
// Edges
|
|
443
|
+
listEdges,
|
|
444
|
+
createEdge,
|
|
445
|
+
updateEdge,
|
|
446
|
+
deleteEdge
|
|
447
|
+
}),
|
|
448
|
+
[loading, error, listNodes, getNode, createNode, updateNode, deleteNode, listEdges, createEdge, updateEdge, deleteEdge]
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
function useCrawlJobs(options) {
|
|
452
|
+
const [loading, setLoading] = useState(false);
|
|
453
|
+
const [error, setError] = useState(null);
|
|
454
|
+
const optionsRef = useRef(options);
|
|
455
|
+
useEffect(() => {
|
|
456
|
+
optionsRef.current = options;
|
|
457
|
+
}, [options]);
|
|
458
|
+
const listJobs = useCallback(
|
|
459
|
+
async (params) => {
|
|
460
|
+
setLoading(true);
|
|
461
|
+
setError(null);
|
|
462
|
+
try {
|
|
463
|
+
const response = await listCrawlJobsApi({ ...optionsRef.current, ...params });
|
|
464
|
+
if (response.error) {
|
|
465
|
+
setError(response.error);
|
|
466
|
+
return { jobs: [], total: 0 };
|
|
467
|
+
}
|
|
468
|
+
return { jobs: response.data?.jobs || [], total: response.data?.total || 0 };
|
|
469
|
+
} catch (err) {
|
|
470
|
+
const message = err instanceof Error ? err.message : "Failed to list crawl jobs";
|
|
471
|
+
setError(message);
|
|
472
|
+
return { jobs: [], total: 0 };
|
|
473
|
+
} finally {
|
|
474
|
+
setLoading(false);
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
[]
|
|
478
|
+
);
|
|
479
|
+
const startJob = useCallback(
|
|
480
|
+
async (params) => {
|
|
481
|
+
setLoading(true);
|
|
482
|
+
setError(null);
|
|
483
|
+
try {
|
|
484
|
+
const response = await startCrawlJobApi(params, optionsRef.current);
|
|
485
|
+
if (response.error) {
|
|
486
|
+
setError(response.error);
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
return response.data?.jobId || null;
|
|
490
|
+
} catch (err) {
|
|
491
|
+
const message = err instanceof Error ? err.message : "Failed to start crawl job";
|
|
492
|
+
setError(message);
|
|
493
|
+
return null;
|
|
494
|
+
} finally {
|
|
495
|
+
setLoading(false);
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
[]
|
|
499
|
+
);
|
|
500
|
+
const getJobStatus = useCallback(async (jobId) => {
|
|
501
|
+
setLoading(true);
|
|
502
|
+
setError(null);
|
|
503
|
+
try {
|
|
504
|
+
const response = await getCrawlJobStatusApi(jobId, optionsRef.current);
|
|
505
|
+
if (response.error) {
|
|
506
|
+
setError(response.error);
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
return response.data?.job || null;
|
|
510
|
+
} catch (err) {
|
|
511
|
+
const message = err instanceof Error ? err.message : "Failed to get job status";
|
|
512
|
+
setError(message);
|
|
513
|
+
return null;
|
|
514
|
+
} finally {
|
|
515
|
+
setLoading(false);
|
|
516
|
+
}
|
|
517
|
+
}, []);
|
|
518
|
+
const cancelJob = useCallback(async (jobId) => {
|
|
519
|
+
setLoading(true);
|
|
520
|
+
setError(null);
|
|
521
|
+
try {
|
|
522
|
+
const response = await cancelCrawlJobApi(jobId, optionsRef.current);
|
|
523
|
+
if (response.error) {
|
|
524
|
+
setError(response.error);
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
return response.data?.success ?? true;
|
|
528
|
+
} catch (err) {
|
|
529
|
+
const message = err instanceof Error ? err.message : "Failed to cancel crawl job";
|
|
530
|
+
setError(message);
|
|
531
|
+
return false;
|
|
532
|
+
} finally {
|
|
533
|
+
setLoading(false);
|
|
534
|
+
}
|
|
535
|
+
}, []);
|
|
536
|
+
const getCrawledPages = useCallback(
|
|
537
|
+
async (jobId) => {
|
|
538
|
+
setLoading(true);
|
|
539
|
+
setError(null);
|
|
540
|
+
try {
|
|
541
|
+
const response = await getCrawledPagesApi(jobId, optionsRef.current);
|
|
542
|
+
if (response.error) {
|
|
543
|
+
setError(response.error);
|
|
544
|
+
return [];
|
|
545
|
+
}
|
|
546
|
+
return response.data?.pages || [];
|
|
547
|
+
} catch (err) {
|
|
548
|
+
const message = err instanceof Error ? err.message : "Failed to get crawled pages";
|
|
549
|
+
setError(message);
|
|
550
|
+
return [];
|
|
551
|
+
} finally {
|
|
552
|
+
setLoading(false);
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
[]
|
|
556
|
+
);
|
|
557
|
+
return useMemo(
|
|
558
|
+
() => ({
|
|
559
|
+
loading,
|
|
560
|
+
error,
|
|
561
|
+
listJobs,
|
|
562
|
+
startJob,
|
|
563
|
+
getJobStatus,
|
|
564
|
+
cancelJob,
|
|
565
|
+
getCrawledPages
|
|
566
|
+
}),
|
|
567
|
+
[loading, error, listJobs, startJob, getJobStatus, cancelJob, getCrawledPages]
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export {
|
|
572
|
+
useGraphs,
|
|
573
|
+
useKGQuery,
|
|
574
|
+
useKGDesigner,
|
|
575
|
+
useCrawlJobs
|
|
576
|
+
};
|
|
577
|
+
//# sourceMappingURL=chunk-EW3NQGUZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../hooks/index.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Knowledge Graph hooks for React applications\n *\n * Provides React hooks for KG operations with loading/error states.\n */\n\nimport { useState, useCallback, useMemo, useRef, useEffect } from \"react\";\nimport type { ApiClientOptions } from \"@elqnt/api-client\";\nimport type {\n Graph,\n CreateGraphRequest,\n KGNode,\n KGQuery,\n KGQueryResult,\n KGLabelInfo,\n KGNodeIngestRequest,\n GraphNodeDefinition,\n GraphEdgeDefinition,\n} from \"../models\";\nimport {\n listGraphsApi,\n getGraphApi,\n createGraphApi,\n updateGraphApi,\n deleteGraphApi,\n queryGraphApi,\n getGraphLabelsApi,\n getKGNodeApi,\n ingestKGNodeApi,\n updateKGNodeApi,\n listDesignerNodesApi,\n getDesignerNodeApi,\n createDesignerNodeApi,\n updateDesignerNodeApi,\n deleteDesignerNodeApi,\n listDesignerEdgesApi,\n createDesignerEdgeApi,\n updateDesignerEdgeApi,\n deleteDesignerEdgeApi,\n listCrawlJobsApi,\n startCrawlJobApi,\n getCrawlJobStatusApi,\n cancelCrawlJobApi,\n getCrawledPagesApi,\n type KGApiOptions,\n type CrawlJob,\n} from \"../api\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport type UseKGOptions = ApiClientOptions & { graphId?: string };\n\n// =============================================================================\n// USE GRAPHS HOOK\n// =============================================================================\n\n/**\n * Hook for knowledge graph CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listGraphs, createGraph } = useGraphs({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * });\n *\n * const graphs = await listGraphs();\n * ```\n */\nexport function useGraphs(options: ApiClientOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listGraphs = useCallback(async (): Promise<Graph[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listGraphsApi(optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.graphs || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to load graphs\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getGraph = useCallback(async (graphId: string): Promise<Graph | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getGraphApi(graphId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.graph || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get graph\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createGraph = useCallback(async (graph: CreateGraphRequest): Promise<Graph | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createGraphApi(graph, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.graph || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create graph\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const updateGraph = useCallback(async (graphId: string, updates: Partial<Graph>): Promise<Graph | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateGraphApi(graphId, updates, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.graph || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update graph\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const deleteGraph = useCallback(async (graphId: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await deleteGraphApi(graphId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to delete graph\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n return useMemo(\n () => ({\n loading,\n error,\n listGraphs,\n getGraph,\n createGraph,\n updateGraph,\n deleteGraph,\n }),\n [loading, error, listGraphs, getGraph, createGraph, updateGraph, deleteGraph]\n );\n}\n\n// =============================================================================\n// USE KG QUERY HOOK\n// =============================================================================\n\n/**\n * Hook for querying knowledge graph nodes\n */\nexport function useKGQuery(options: UseKGOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const query = useCallback(async (queryParams: KGQuery): Promise<KGQueryResult | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await queryGraphApi(queryParams, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to query graph\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getLabels = useCallback(async (): Promise<KGLabelInfo[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getGraphLabelsApi(optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.labels || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get labels\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getNode = useCallback(async (nodeId: string): Promise<KGNode | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getKGNodeApi(nodeId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.node || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const ingestNode = useCallback(async (node: KGNodeIngestRequest): Promise<string | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await ingestKGNodeApi(node, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.nodeId || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to ingest node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const updateNode = useCallback(async (nodeId: string, updates: Partial<KGNode>): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateKGNodeApi(nodeId, updates, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update node\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n return useMemo(\n () => ({\n loading,\n error,\n query,\n getLabels,\n getNode,\n ingestNode,\n updateNode,\n }),\n [loading, error, query, getLabels, getNode, ingestNode, updateNode]\n );\n}\n\n// =============================================================================\n// USE KG DESIGNER HOOK\n// =============================================================================\n\n/**\n * Hook for KG designer operations (node and edge definitions)\n */\nexport function useKGDesigner(options: UseKGOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n // Node operations\n const listNodes = useCallback(async (): Promise<GraphNodeDefinition[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listDesignerNodesApi(optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.nodes || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list nodes\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getNode = useCallback(async (label: string): Promise<GraphNodeDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getDesignerNodeApi(label, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.node || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createNode = useCallback(\n async (node: Omit<GraphNodeDefinition, \"createdAt\" | \"updatedAt\">): Promise<GraphNodeDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createDesignerNodeApi(node, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.node || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const updateNode = useCallback(\n async (label: string, updates: Partial<GraphNodeDefinition>): Promise<GraphNodeDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateDesignerNodeApi(label, updates, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.node || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update node\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const deleteNode = useCallback(async (label: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await deleteDesignerNodeApi(label, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to delete node\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n // Edge operations\n const listEdges = useCallback(async (): Promise<GraphEdgeDefinition[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listDesignerEdgesApi(optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.edges || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list edges\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, []);\n\n const createEdge = useCallback(\n async (edge: Omit<GraphEdgeDefinition, \"createdAt\" | \"updatedAt\">): Promise<GraphEdgeDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createDesignerEdgeApi(edge, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.edge || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create edge\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const updateEdge = useCallback(\n async (label: string, updates: Partial<GraphEdgeDefinition>): Promise<GraphEdgeDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateDesignerEdgeApi(label, updates, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.edge || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update edge\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const deleteEdge = useCallback(async (label: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await deleteDesignerEdgeApi(label, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to delete edge\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n return useMemo(\n () => ({\n loading,\n error,\n // Nodes\n listNodes,\n getNode,\n createNode,\n updateNode,\n deleteNode,\n // Edges\n listEdges,\n createEdge,\n updateEdge,\n deleteEdge,\n }),\n [loading, error, listNodes, getNode, createNode, updateNode, deleteNode, listEdges, createEdge, updateEdge, deleteEdge]\n );\n}\n\n// =============================================================================\n// USE CRAWL JOBS HOOK\n// =============================================================================\n\n/**\n * Hook for web crawl job operations\n */\nexport function useCrawlJobs(options: UseKGOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const optionsRef = useRef(options);\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n const listJobs = useCallback(\n async (params?: { limit?: number; offset?: number; status?: string }): Promise<{ jobs: CrawlJob[]; total: number }> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listCrawlJobsApi({ ...optionsRef.current, ...params });\n if (response.error) {\n setError(response.error);\n return { jobs: [], total: 0 };\n }\n return { jobs: response.data?.jobs || [], total: response.data?.total || 0 };\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to list crawl jobs\";\n setError(message);\n return { jobs: [], total: 0 };\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const startJob = useCallback(\n async (params: { baseUrl: string; depth: number; maxPages: number }): Promise<string | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await startCrawlJobApi(params, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.jobId || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to start crawl job\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n const getJobStatus = useCallback(async (jobId: string): Promise<CrawlJob | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getCrawlJobStatusApi(jobId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.job || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get job status\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const cancelJob = useCallback(async (jobId: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await cancelCrawlJobApi(jobId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return response.data?.success ?? true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to cancel crawl job\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n }, []);\n\n const getCrawledPages = useCallback(\n async (jobId: string): Promise<Array<{ url: string; title: string; status: string; processedAt: string }>> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getCrawledPagesApi(jobId, optionsRef.current);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.pages || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get crawled pages\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n },\n []\n );\n\n return useMemo(\n () => ({\n loading,\n error,\n listJobs,\n startJob,\n getJobStatus,\n cancelJob,\n getCrawledPages,\n }),\n [loading, error, listJobs, startJob, getJobStatus, cancelJob, getCrawledPages]\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS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,KAAK;AACvB,eAAO;AAAA,MACT;AACA,aAAO,SAAS,MAAM,WAAW;AAAA,IACnC,SAAS,KAAK;AACZ,YAAM,UAAU,eAAe,QAAQ,IAAI,UAAU;AACrD,eAAS,OAAO;AAChB,aAAO;AAAA,IACT,UAAE;AACA,iBAAW,KAAK;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,QAAM,kBAAkB;AAAA,IACtB,OAAO,UAAuG;AAC5G,iBAAW,IAAI;AACf,eAAS,IAAI;AACb,UAAI;AACF,cAAM,WAAW,MAAM,mBAAmB,OAAO,WAAW,OAAO;AACnE,YAAI,SAAS,OAAO;AAClB,mBAAS,SAAS,KAAK;AACvB,iBAAO,CAAC;AAAA,QACV;AACA,eAAO,SAAS,MAAM,SAAS,CAAC;AAAA,MAClC,SAAS,KAAK;AACZ,cAAM,UAAU,eAAe,QAAQ,IAAI,UAAU;AACrD,iBAAS,OAAO;AAChB,eAAO,CAAC;AAAA,MACV,UAAE;AACA,mBAAW,KAAK;AAAA,MAClB;AAAA,IACF;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,SAAS,OAAO,UAAU,UAAU,cAAc,WAAW,eAAe;AAAA,EAC/E;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
// models/kg-designer.ts
|
|
2
4
|
var KGGraphCreate = "kg.graph.create";
|
|
3
5
|
var KGGraphUpdate = "kg.graph.update.*";
|
|
@@ -46,4 +48,4 @@ export {
|
|
|
46
48
|
KGIngestNodeSync,
|
|
47
49
|
KGIngestBatchSync
|
|
48
50
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-RDIQ7HTM.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../models/kg-designer.ts"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\n\n//////////\n// source: designer-models.go\n\n/**\n * GraphNodeDefinition represents a node type in the knowledge graph\n */\nexport interface GraphNodeDefinition {\n label: string;\n description: string;\n schema: { [key: string]: any};\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n}\n/**\n * GraphEdgeDefinition represents an edge type in the knowledge graph\n */\nexport interface GraphEdgeDefinition {\n label: string;\n description: string;\n fromNode: string;\n toNode: string;\n schema: { [key: string]: any};\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n}\n/**\n * Request/Response types\n */\nexport interface GraphNodeRequest {\n node: GraphNodeDefinition;\n}\nexport interface GraphNodeResponse {\n node?: GraphNodeDefinition;\n nodes?: GraphNodeDefinition[];\n success: boolean;\n error?: string;\n}\nexport interface GraphEdgeRequest {\n edge: GraphEdgeDefinition;\n}\nexport interface GraphEdgeResponse {\n edge?: GraphEdgeDefinition;\n edges?: GraphEdgeDefinition[];\n success: boolean;\n error?: string;\n}\n\n//////////\n// source: subjects.go\n\n/**\n * KG Graph management subjects (multi-graph support)\n */\nexport const KGGraphCreate = \"kg.graph.create\";\nexport const KGGraphUpdate = \"kg.graph.update.*\";\nexport const KGGraphDelete = \"kg.graph.delete.*\";\nexport const KGGraphGet = \"kg.graph.get.*\";\nexport const KGGraphList = \"kg.graph.list\";\n/**\n * KG Designer Node subjects\n */\nexport const KGDesignerNodeCreate = \"kg.designer.node.create\";\nexport const KGDesignerNodeUpdate = \"kg.designer.node.update.*\";\nexport const KGDesignerNodeDelete = \"kg.designer.node.delete.*\";\nexport const KGDesignerNodeGet = \"kg.designer.node.get.*\";\nexport const KGDesignerNodeList = \"kg.designer.node.list\";\n/**\n * KG Designer Edge subjects\n */\nexport const KGDesignerEdgeCreate = \"kg.designer.edge.create\";\nexport const KGDesignerEdgeUpdate = \"kg.designer.edge.update.*\";\nexport const KGDesignerEdgeDelete = \"kg.designer.edge.delete.*\";\nexport const KGDesignerEdgeGet = \"kg.designer.edge.get.*\";\nexport const KGDesignerEdgeList = \"kg.designer.edge.list\";\n/**\n * KG Database subjects\n */\nexport const KGDBCreate = \"kg.db.create\";\n/**\n * KG Document subjects\n */\nexport const KGDocumentDelete = \"kg_ingest.document.delete\";\n/**\n * KG Sync Job subjects\n */\nexport const KGSyncJobUpdate = \"kg.sync.job.update\";\nexport const KGSyncJobList = \"kg.sync.job.list\";\n/**\n * KG Optimization subjects\n */\nexport const KGGraphOptimize = \"kg.graph.optimize\";\n/**\n * Synchronous ingest subjects (bypass JetStream for direct ClickHouse insertion)\n * Use kg.sync.* pattern to avoid overlap with kg.ingest.> JetStream stream\n */\nexport const KGIngestNodeSync = \"kg.sync.node\";\nexport const KGIngestBatchSync = \"kg.sync.batch\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../models/kg-designer.ts"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\n\n//////////\n// source: designer-models.go\n\n/**\n * GraphNodeDefinition represents a node type in the knowledge graph\n */\nexport interface GraphNodeDefinition {\n label: string;\n description: string;\n schema: { [key: string]: any};\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n}\n/**\n * GraphEdgeDefinition represents an edge type in the knowledge graph\n */\nexport interface GraphEdgeDefinition {\n label: string;\n description: string;\n fromNode: string;\n toNode: string;\n schema: { [key: string]: any};\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n}\n/**\n * Request/Response types\n */\nexport interface GraphNodeRequest {\n node: GraphNodeDefinition;\n}\nexport interface GraphNodeResponse {\n node?: GraphNodeDefinition;\n nodes?: GraphNodeDefinition[];\n success: boolean;\n error?: string;\n}\nexport interface GraphEdgeRequest {\n edge: GraphEdgeDefinition;\n}\nexport interface GraphEdgeResponse {\n edge?: GraphEdgeDefinition;\n edges?: GraphEdgeDefinition[];\n success: boolean;\n error?: string;\n}\n\n//////////\n// source: subjects.go\n\n/**\n * KG Graph management subjects (multi-graph support)\n */\nexport const KGGraphCreate = \"kg.graph.create\";\nexport const KGGraphUpdate = \"kg.graph.update.*\";\nexport const KGGraphDelete = \"kg.graph.delete.*\";\nexport const KGGraphGet = \"kg.graph.get.*\";\nexport const KGGraphList = \"kg.graph.list\";\n/**\n * KG Designer Node subjects\n */\nexport const KGDesignerNodeCreate = \"kg.designer.node.create\";\nexport const KGDesignerNodeUpdate = \"kg.designer.node.update.*\";\nexport const KGDesignerNodeDelete = \"kg.designer.node.delete.*\";\nexport const KGDesignerNodeGet = \"kg.designer.node.get.*\";\nexport const KGDesignerNodeList = \"kg.designer.node.list\";\n/**\n * KG Designer Edge subjects\n */\nexport const KGDesignerEdgeCreate = \"kg.designer.edge.create\";\nexport const KGDesignerEdgeUpdate = \"kg.designer.edge.update.*\";\nexport const KGDesignerEdgeDelete = \"kg.designer.edge.delete.*\";\nexport const KGDesignerEdgeGet = \"kg.designer.edge.get.*\";\nexport const KGDesignerEdgeList = \"kg.designer.edge.list\";\n/**\n * KG Database subjects\n */\nexport const KGDBCreate = \"kg.db.create\";\n/**\n * KG Document subjects\n */\nexport const KGDocumentDelete = \"kg_ingest.document.delete\";\n/**\n * KG Sync Job subjects\n */\nexport const KGSyncJobUpdate = \"kg.sync.job.update\";\nexport const KGSyncJobList = \"kg.sync.job.list\";\n/**\n * KG Optimization subjects\n */\nexport const KGGraphOptimize = \"kg.graph.optimize\";\n/**\n * Synchronous ingest subjects (bypass JetStream for direct ClickHouse insertion)\n * Use kg.sync.* pattern to avoid overlap with kg.ingest.> JetStream stream\n */\nexport const KGIngestNodeSync = \"kg.sync.node\";\nexport const KGIngestBatchSync = \"kg.sync.batch\";\n"],"mappings":";;;AAuDO,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;AACtB,IAAM,gBAAgB;AACtB,IAAM,aAAa;AACnB,IAAM,cAAc;AAIpB,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB;AAI3B,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB;AAC7B,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB;AAI3B,IAAM,aAAa;AAInB,IAAM,mBAAmB;AAIzB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AAItB,IAAM,kBAAkB;AAKxB,IAAM,mBAAmB;AACzB,IAAM,oBAAoB;","names":[]}
|