@elqnt/kg 2.0.7 → 2.1.0
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 +109 -0
- package/dist/api/index.d.ts +109 -0
- package/dist/api/index.js +62 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +62 -0
- package/dist/chunk-55R4PZ5A.mjs +210 -0
- package/dist/chunk-55R4PZ5A.mjs.map +1 -0
- package/dist/{chunk-2OYIMLE4.js → chunk-67SUELDR.js} +4 -2
- package/dist/chunk-67SUELDR.js.map +1 -0
- package/dist/chunk-BQZLJ5LD.mjs +577 -0
- package/dist/chunk-BQZLJ5LD.mjs.map +1 -0
- package/dist/chunk-JSMI4PFC.js +210 -0
- package/dist/chunk-JSMI4PFC.js.map +1 -0
- package/dist/chunk-KATHAUDG.js +577 -0
- package/dist/chunk-KATHAUDG.js.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 +73 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -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 +23 -11
- 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 strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunkJSMI4PFCjs = require('./chunk-JSMI4PFC.js');
|
|
28
|
+
|
|
29
|
+
// hooks/index.ts
|
|
30
|
+
var _react = require('react');
|
|
31
|
+
function useGraphs(options) {
|
|
32
|
+
const [loading, setLoading] = _react.useState.call(void 0, false);
|
|
33
|
+
const [error, setError] = _react.useState.call(void 0, null);
|
|
34
|
+
const optionsRef = _react.useRef.call(void 0, options);
|
|
35
|
+
_react.useEffect.call(void 0, () => {
|
|
36
|
+
optionsRef.current = options;
|
|
37
|
+
}, [options]);
|
|
38
|
+
const listGraphs = _react.useCallback.call(void 0, async () => {
|
|
39
|
+
setLoading(true);
|
|
40
|
+
setError(null);
|
|
41
|
+
try {
|
|
42
|
+
const response = await _chunkJSMI4PFCjs.listGraphsApi.call(void 0, optionsRef.current);
|
|
43
|
+
if (response.error) {
|
|
44
|
+
setError(response.error);
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return _optionalChain([response, 'access', _ => _.data, 'optionalAccess', _2 => _2.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 = _react.useCallback.call(void 0, async (graphId) => {
|
|
57
|
+
setLoading(true);
|
|
58
|
+
setError(null);
|
|
59
|
+
try {
|
|
60
|
+
const response = await _chunkJSMI4PFCjs.getGraphApi.call(void 0, graphId, optionsRef.current);
|
|
61
|
+
if (response.error) {
|
|
62
|
+
setError(response.error);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return _optionalChain([response, 'access', _3 => _3.data, 'optionalAccess', _4 => _4.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 = _react.useCallback.call(void 0, async (graph) => {
|
|
75
|
+
setLoading(true);
|
|
76
|
+
setError(null);
|
|
77
|
+
try {
|
|
78
|
+
const response = await _chunkJSMI4PFCjs.createGraphApi.call(void 0, graph, optionsRef.current);
|
|
79
|
+
if (response.error) {
|
|
80
|
+
setError(response.error);
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return _optionalChain([response, 'access', _5 => _5.data, 'optionalAccess', _6 => _6.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 = _react.useCallback.call(void 0, async (graphId, updates) => {
|
|
93
|
+
setLoading(true);
|
|
94
|
+
setError(null);
|
|
95
|
+
try {
|
|
96
|
+
const response = await _chunkJSMI4PFCjs.updateGraphApi.call(void 0, graphId, updates, optionsRef.current);
|
|
97
|
+
if (response.error) {
|
|
98
|
+
setError(response.error);
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return _optionalChain([response, 'access', _7 => _7.data, 'optionalAccess', _8 => _8.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 = _react.useCallback.call(void 0, async (graphId) => {
|
|
111
|
+
setLoading(true);
|
|
112
|
+
setError(null);
|
|
113
|
+
try {
|
|
114
|
+
const response = await _chunkJSMI4PFCjs.deleteGraphApi.call(void 0, graphId, optionsRef.current);
|
|
115
|
+
if (response.error) {
|
|
116
|
+
setError(response.error);
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
return _nullishCoalesce(_optionalChain([response, 'access', _9 => _9.data, 'optionalAccess', _10 => _10.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 _react.useMemo.call(void 0,
|
|
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] = _react.useState.call(void 0, false);
|
|
143
|
+
const [error, setError] = _react.useState.call(void 0, null);
|
|
144
|
+
const optionsRef = _react.useRef.call(void 0, options);
|
|
145
|
+
_react.useEffect.call(void 0, () => {
|
|
146
|
+
optionsRef.current = options;
|
|
147
|
+
}, [options]);
|
|
148
|
+
const query = _react.useCallback.call(void 0, async (queryParams) => {
|
|
149
|
+
setLoading(true);
|
|
150
|
+
setError(null);
|
|
151
|
+
try {
|
|
152
|
+
const response = await _chunkJSMI4PFCjs.queryGraphApi.call(void 0, 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 = _react.useCallback.call(void 0, async () => {
|
|
167
|
+
setLoading(true);
|
|
168
|
+
setError(null);
|
|
169
|
+
try {
|
|
170
|
+
const response = await _chunkJSMI4PFCjs.getGraphLabelsApi.call(void 0, optionsRef.current);
|
|
171
|
+
if (response.error) {
|
|
172
|
+
setError(response.error);
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
return _optionalChain([response, 'access', _11 => _11.data, 'optionalAccess', _12 => _12.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 = _react.useCallback.call(void 0, async (nodeId) => {
|
|
185
|
+
setLoading(true);
|
|
186
|
+
setError(null);
|
|
187
|
+
try {
|
|
188
|
+
const response = await _chunkJSMI4PFCjs.getKGNodeApi.call(void 0, nodeId, optionsRef.current);
|
|
189
|
+
if (response.error) {
|
|
190
|
+
setError(response.error);
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
return _optionalChain([response, 'access', _13 => _13.data, 'optionalAccess', _14 => _14.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 = _react.useCallback.call(void 0, async (node) => {
|
|
203
|
+
setLoading(true);
|
|
204
|
+
setError(null);
|
|
205
|
+
try {
|
|
206
|
+
const response = await _chunkJSMI4PFCjs.ingestKGNodeApi.call(void 0, node, optionsRef.current);
|
|
207
|
+
if (response.error) {
|
|
208
|
+
setError(response.error);
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
return _optionalChain([response, 'access', _15 => _15.data, 'optionalAccess', _16 => _16.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 = _react.useCallback.call(void 0, async (nodeId, updates) => {
|
|
221
|
+
setLoading(true);
|
|
222
|
+
setError(null);
|
|
223
|
+
try {
|
|
224
|
+
const response = await _chunkJSMI4PFCjs.updateKGNodeApi.call(void 0, nodeId, updates, optionsRef.current);
|
|
225
|
+
if (response.error) {
|
|
226
|
+
setError(response.error);
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
return _nullishCoalesce(_optionalChain([response, 'access', _17 => _17.data, 'optionalAccess', _18 => _18.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 _react.useMemo.call(void 0,
|
|
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] = _react.useState.call(void 0, false);
|
|
253
|
+
const [error, setError] = _react.useState.call(void 0, null);
|
|
254
|
+
const optionsRef = _react.useRef.call(void 0, options);
|
|
255
|
+
_react.useEffect.call(void 0, () => {
|
|
256
|
+
optionsRef.current = options;
|
|
257
|
+
}, [options]);
|
|
258
|
+
const listNodes = _react.useCallback.call(void 0, async () => {
|
|
259
|
+
setLoading(true);
|
|
260
|
+
setError(null);
|
|
261
|
+
try {
|
|
262
|
+
const response = await _chunkJSMI4PFCjs.listDesignerNodesApi.call(void 0, optionsRef.current);
|
|
263
|
+
if (response.error) {
|
|
264
|
+
setError(response.error);
|
|
265
|
+
return [];
|
|
266
|
+
}
|
|
267
|
+
return _optionalChain([response, 'access', _19 => _19.data, 'optionalAccess', _20 => _20.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 = _react.useCallback.call(void 0, async (label) => {
|
|
277
|
+
setLoading(true);
|
|
278
|
+
setError(null);
|
|
279
|
+
try {
|
|
280
|
+
const response = await _chunkJSMI4PFCjs.getDesignerNodeApi.call(void 0, label, optionsRef.current);
|
|
281
|
+
if (response.error) {
|
|
282
|
+
setError(response.error);
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
return _optionalChain([response, 'access', _21 => _21.data, 'optionalAccess', _22 => _22.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 = _react.useCallback.call(void 0,
|
|
295
|
+
async (node) => {
|
|
296
|
+
setLoading(true);
|
|
297
|
+
setError(null);
|
|
298
|
+
try {
|
|
299
|
+
const response = await _chunkJSMI4PFCjs.createDesignerNodeApi.call(void 0, node, optionsRef.current);
|
|
300
|
+
if (response.error) {
|
|
301
|
+
setError(response.error);
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
return _optionalChain([response, 'access', _23 => _23.data, 'optionalAccess', _24 => _24.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 = _react.useCallback.call(void 0,
|
|
316
|
+
async (label, updates) => {
|
|
317
|
+
setLoading(true);
|
|
318
|
+
setError(null);
|
|
319
|
+
try {
|
|
320
|
+
const response = await _chunkJSMI4PFCjs.updateDesignerNodeApi.call(void 0, label, updates, optionsRef.current);
|
|
321
|
+
if (response.error) {
|
|
322
|
+
setError(response.error);
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
return _optionalChain([response, 'access', _25 => _25.data, 'optionalAccess', _26 => _26.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 = _react.useCallback.call(void 0, async (label) => {
|
|
337
|
+
setLoading(true);
|
|
338
|
+
setError(null);
|
|
339
|
+
try {
|
|
340
|
+
const response = await _chunkJSMI4PFCjs.deleteDesignerNodeApi.call(void 0, label, optionsRef.current);
|
|
341
|
+
if (response.error) {
|
|
342
|
+
setError(response.error);
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
return _nullishCoalesce(_optionalChain([response, 'access', _27 => _27.data, 'optionalAccess', _28 => _28.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 = _react.useCallback.call(void 0, async () => {
|
|
355
|
+
setLoading(true);
|
|
356
|
+
setError(null);
|
|
357
|
+
try {
|
|
358
|
+
const response = await _chunkJSMI4PFCjs.listDesignerEdgesApi.call(void 0, optionsRef.current);
|
|
359
|
+
if (response.error) {
|
|
360
|
+
setError(response.error);
|
|
361
|
+
return [];
|
|
362
|
+
}
|
|
363
|
+
return _optionalChain([response, 'access', _29 => _29.data, 'optionalAccess', _30 => _30.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 = _react.useCallback.call(void 0,
|
|
373
|
+
async (edge) => {
|
|
374
|
+
setLoading(true);
|
|
375
|
+
setError(null);
|
|
376
|
+
try {
|
|
377
|
+
const response = await _chunkJSMI4PFCjs.createDesignerEdgeApi.call(void 0, edge, optionsRef.current);
|
|
378
|
+
if (response.error) {
|
|
379
|
+
setError(response.error);
|
|
380
|
+
return null;
|
|
381
|
+
}
|
|
382
|
+
return _optionalChain([response, 'access', _31 => _31.data, 'optionalAccess', _32 => _32.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 = _react.useCallback.call(void 0,
|
|
394
|
+
async (label, updates) => {
|
|
395
|
+
setLoading(true);
|
|
396
|
+
setError(null);
|
|
397
|
+
try {
|
|
398
|
+
const response = await _chunkJSMI4PFCjs.updateDesignerEdgeApi.call(void 0, label, updates, optionsRef.current);
|
|
399
|
+
if (response.error) {
|
|
400
|
+
setError(response.error);
|
|
401
|
+
return null;
|
|
402
|
+
}
|
|
403
|
+
return _optionalChain([response, 'access', _33 => _33.data, 'optionalAccess', _34 => _34.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 = _react.useCallback.call(void 0, async (label) => {
|
|
415
|
+
setLoading(true);
|
|
416
|
+
setError(null);
|
|
417
|
+
try {
|
|
418
|
+
const response = await _chunkJSMI4PFCjs.deleteDesignerEdgeApi.call(void 0, label, optionsRef.current);
|
|
419
|
+
if (response.error) {
|
|
420
|
+
setError(response.error);
|
|
421
|
+
return false;
|
|
422
|
+
}
|
|
423
|
+
return _nullishCoalesce(_optionalChain([response, 'access', _35 => _35.data, 'optionalAccess', _36 => _36.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 _react.useMemo.call(void 0,
|
|
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] = _react.useState.call(void 0, false);
|
|
453
|
+
const [error, setError] = _react.useState.call(void 0, null);
|
|
454
|
+
const optionsRef = _react.useRef.call(void 0, options);
|
|
455
|
+
_react.useEffect.call(void 0, () => {
|
|
456
|
+
optionsRef.current = options;
|
|
457
|
+
}, [options]);
|
|
458
|
+
const listJobs = _react.useCallback.call(void 0,
|
|
459
|
+
async (params) => {
|
|
460
|
+
setLoading(true);
|
|
461
|
+
setError(null);
|
|
462
|
+
try {
|
|
463
|
+
const response = await _chunkJSMI4PFCjs.listCrawlJobsApi.call(void 0, { ...optionsRef.current, ...params });
|
|
464
|
+
if (response.error) {
|
|
465
|
+
setError(response.error);
|
|
466
|
+
return { jobs: [], total: 0 };
|
|
467
|
+
}
|
|
468
|
+
return { jobs: _optionalChain([response, 'access', _37 => _37.data, 'optionalAccess', _38 => _38.jobs]) || [], total: _optionalChain([response, 'access', _39 => _39.data, 'optionalAccess', _40 => _40.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 = _react.useCallback.call(void 0,
|
|
480
|
+
async (params) => {
|
|
481
|
+
setLoading(true);
|
|
482
|
+
setError(null);
|
|
483
|
+
try {
|
|
484
|
+
const response = await _chunkJSMI4PFCjs.startCrawlJobApi.call(void 0, params, optionsRef.current);
|
|
485
|
+
if (response.error) {
|
|
486
|
+
setError(response.error);
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
return _optionalChain([response, 'access', _41 => _41.data, 'optionalAccess', _42 => _42.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 = _react.useCallback.call(void 0, async (jobId) => {
|
|
501
|
+
setLoading(true);
|
|
502
|
+
setError(null);
|
|
503
|
+
try {
|
|
504
|
+
const response = await _chunkJSMI4PFCjs.getCrawlJobStatusApi.call(void 0, jobId, optionsRef.current);
|
|
505
|
+
if (response.error) {
|
|
506
|
+
setError(response.error);
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
return _optionalChain([response, 'access', _43 => _43.data, 'optionalAccess', _44 => _44.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 = _react.useCallback.call(void 0, async (jobId) => {
|
|
519
|
+
setLoading(true);
|
|
520
|
+
setError(null);
|
|
521
|
+
try {
|
|
522
|
+
const response = await _chunkJSMI4PFCjs.cancelCrawlJobApi.call(void 0, jobId, optionsRef.current);
|
|
523
|
+
if (response.error) {
|
|
524
|
+
setError(response.error);
|
|
525
|
+
return false;
|
|
526
|
+
}
|
|
527
|
+
return _nullishCoalesce(_optionalChain([response, 'access', _45 => _45.data, 'optionalAccess', _46 => _46.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 = _react.useCallback.call(void 0,
|
|
537
|
+
async (jobId) => {
|
|
538
|
+
setLoading(true);
|
|
539
|
+
setError(null);
|
|
540
|
+
try {
|
|
541
|
+
const response = await _chunkJSMI4PFCjs.getCrawledPagesApi.call(void 0, jobId, optionsRef.current);
|
|
542
|
+
if (response.error) {
|
|
543
|
+
setError(response.error);
|
|
544
|
+
return [];
|
|
545
|
+
}
|
|
546
|
+
return _optionalChain([response, 'access', _47 => _47.data, 'optionalAccess', _48 => _48.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 _react.useMemo.call(void 0,
|
|
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
|
+
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
exports.useGraphs = useGraphs; exports.useKGQuery = useKGQuery; exports.useKGDesigner = useKGDesigner; exports.useCrawlJobs = useCrawlJobs;
|
|
577
|
+
//# sourceMappingURL=chunk-KATHAUDG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/kg/dist/chunk-KATHAUDG.js","../hooks/index.ts"],"names":[],"mappings":"AAAA,6rB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EAAO,QAAA,EAAU,QAAA,EAAU,YAAA,EAAc,SAAA,EAAW,eAAe;AAAA,EAC/E,CAAA;AACF;ADpGA;AACA;AACE;AACA;AACA;AACA;AACF,2IAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/kg/dist/chunk-KATHAUDG.js","sourcesContent":[null,"\"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"]}
|
|
@@ -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
|