@elqnt/kg 3.0.0 → 3.0.2
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 +94 -5
- package/dist/api/index.d.ts +94 -5
- package/dist/api/index.js +16 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +15 -1
- package/dist/api/server.d.mts +4 -3
- package/dist/api/server.d.ts +4 -3
- package/dist/api/server.js.map +1 -1
- package/dist/{chunk-HCDFJCQL.mjs → chunk-5D7RJC7D.mjs} +105 -5
- package/dist/chunk-5D7RJC7D.mjs.map +1 -0
- package/dist/chunk-67SUELDR.js.map +1 -1
- package/dist/chunk-ADIKUMMI.js.map +1 -1
- package/dist/chunk-B33SF6DB.js +2 -0
- package/dist/chunk-B33SF6DB.js.map +1 -0
- package/dist/chunk-BP2I7KWY.js +1031 -0
- package/dist/chunk-BP2I7KWY.js.map +1 -0
- package/dist/{chunk-2TJCYLTP.js → chunk-CNWOI7LX.js} +104 -4
- package/dist/chunk-CNWOI7LX.js.map +1 -0
- package/dist/chunk-MAEB7UOW.mjs +257 -0
- package/dist/chunk-MAEB7UOW.mjs.map +1 -0
- package/dist/chunk-SUDQ45LY.mjs +2 -0
- package/dist/chunk-UCKE66GB.js.map +1 -1
- package/dist/chunk-WYRCAPY4.js +257 -0
- package/dist/chunk-WYRCAPY4.js.map +1 -0
- package/dist/chunk-ZEPJC46Z.mjs +1031 -0
- package/dist/chunk-ZEPJC46Z.mjs.map +1 -0
- package/dist/hooks/index.d.mts +446 -79
- package/dist/hooks/index.d.ts +446 -79
- package/dist/hooks/index.js +8 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +9 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +24 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -12
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.d.mts +213 -0
- package/dist/models/index.d.ts +213 -0
- package/dist/models/index.js +1 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +1 -1
- package/dist/models/kg-designer.js.map +1 -1
- package/dist/models/kg.js.map +1 -1
- package/dist/transport/index.d.mts +365 -0
- package/dist/transport/index.d.ts +365 -0
- package/dist/transport/index.js +10 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/transport/index.mjs +10 -0
- package/dist/transport/index.mjs.map +1 -0
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +15 -13
- package/dist/chunk-2TJCYLTP.js.map +0 -1
- package/dist/chunk-7RW5MHP5.js +0 -497
- package/dist/chunk-7RW5MHP5.js.map +0 -1
- package/dist/chunk-HCDFJCQL.mjs.map +0 -1
- package/dist/chunk-JZ7UXVRW.mjs +0 -497
- package/dist/chunk-JZ7UXVRW.mjs.map +0 -1
- package/dist/chunk-NJNBEGDB.mjs +0 -2
- package/dist/chunk-W4XVBGE7.js +0 -2
- package/dist/chunk-W4XVBGE7.js.map +0 -1
- /package/dist/{chunk-NJNBEGDB.mjs.map → chunk-SUDQ45LY.mjs.map} +0 -0
package/dist/api/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
|
|
2
2
|
import { ResponseMetadata } from '@elqnt/types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { CreateGraphRequest, CreateGraphResult, DeleteGraphResult, DeleteDocumentResponse, GetGraphResult, KGLabelInfo, KGNode, KGNodeIngestRequest, KGSyncIngestResponse, ListGraphsResult, KGQuery, KGQueryResult, Graph, UpdateGraphResult } from '../models/kg.mjs';
|
|
4
|
+
import { GraphEdgeDefinition, GraphEdgeResponse, GraphNodeDefinition, GraphNodeResponse } from '../models/kg-designer.mjs';
|
|
5
|
+
import { FullIngestCancelResult, QuickIngestCancelResult, FullIngestJob, FullIngestNodesRequest, FullIngestNodesResult, FullIngestJobsListResponse, FullIngestExtractionRequest, FullIngestExtractionResult, QuickIngestStartRequest } from '../models/index.mjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Knowledge Graph Browser API
|
|
@@ -206,10 +207,11 @@ declare function ingestDocumentApi(document: {
|
|
|
206
207
|
* Delete a document from the knowledge graph
|
|
207
208
|
*
|
|
208
209
|
* @param documentId - The document ID to delete
|
|
209
|
-
* @param options - API options including optional graphId
|
|
210
|
+
* @param options - API options including optional graphId and cascade
|
|
211
|
+
* @param cascade - If true, also delete all connected nodes (articles, etc.). Default: false
|
|
210
212
|
* @returns Deletion result with counts
|
|
211
213
|
*/
|
|
212
|
-
declare function deleteKGDocumentApi(documentId: string, options: KGApiOptions): Promise<ApiResponse<DeleteDocumentResponse>>;
|
|
214
|
+
declare function deleteKGDocumentApi(documentId: string, options: KGApiOptions, cascade?: boolean): Promise<ApiResponse<DeleteDocumentResponse>>;
|
|
213
215
|
/**
|
|
214
216
|
* Optimize the knowledge graph
|
|
215
217
|
*
|
|
@@ -353,5 +355,92 @@ declare function cancelCrawlJobApi(jobId: string, options: KGApiOptions): Promis
|
|
|
353
355
|
* @returns List of crawled pages
|
|
354
356
|
*/
|
|
355
357
|
declare function getCrawledPagesApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<CrawledPagesResponse>>;
|
|
358
|
+
/**
|
|
359
|
+
* Quick ingest SSE event types
|
|
360
|
+
*/
|
|
361
|
+
interface QuickIngestEvent {
|
|
362
|
+
type: "started" | "item_start" | "item_progress" | "item_complete" | "item_error" | "job_complete" | "error" | "cancelled";
|
|
363
|
+
itemId?: string;
|
|
364
|
+
message?: string;
|
|
365
|
+
progress?: number;
|
|
366
|
+
text?: string;
|
|
367
|
+
error?: string;
|
|
368
|
+
articles?: number;
|
|
369
|
+
topics?: number;
|
|
370
|
+
nodesCreated?: number;
|
|
371
|
+
nodesByLabel?: Record<string, number>;
|
|
372
|
+
timestamp: number;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Start a quick ingestion job with SSE streaming response
|
|
376
|
+
*
|
|
377
|
+
* @param request - Quick ingestion start request
|
|
378
|
+
* @param options - API options including optional graphId
|
|
379
|
+
* @param onEvent - Callback for each SSE event
|
|
380
|
+
* @returns Promise that resolves when streaming completes
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```ts
|
|
384
|
+
* await startQuickIngestApi(
|
|
385
|
+
* { items: [...], options: {...}, graphId: "default" },
|
|
386
|
+
* { baseUrl, orgId },
|
|
387
|
+
* (event) => {
|
|
388
|
+
* if (event.type === "item_complete") {
|
|
389
|
+
* console.log(`Completed: ${event.itemId}`);
|
|
390
|
+
* }
|
|
391
|
+
* }
|
|
392
|
+
* );
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
declare function startQuickIngestApi(request: QuickIngestStartRequest, options: KGApiOptions, onEvent: (event: QuickIngestEvent) => void): Promise<void>;
|
|
396
|
+
/**
|
|
397
|
+
* Cancel a quick ingestion job
|
|
398
|
+
*
|
|
399
|
+
* @param jobId - The job ID to cancel
|
|
400
|
+
* @param options - API options including optional graphId
|
|
401
|
+
* @returns Cancel result with status
|
|
402
|
+
*/
|
|
403
|
+
declare function cancelQuickIngestApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<QuickIngestCancelResult>>;
|
|
404
|
+
/**
|
|
405
|
+
* Start full ingestion extraction
|
|
406
|
+
*
|
|
407
|
+
* @param request - Extraction request with source and labels
|
|
408
|
+
* @param options - API options including optional graphId
|
|
409
|
+
* @returns Extraction job result
|
|
410
|
+
*/
|
|
411
|
+
declare function startFullIngestExtractionApi(request: FullIngestExtractionRequest, options: KGApiOptions): Promise<ApiResponse<FullIngestExtractionResult>>;
|
|
412
|
+
/**
|
|
413
|
+
* Cancel full ingestion extraction
|
|
414
|
+
*
|
|
415
|
+
* @param jobId - The job ID to cancel
|
|
416
|
+
* @param options - API options including optional graphId
|
|
417
|
+
* @returns Cancel result with status
|
|
418
|
+
*/
|
|
419
|
+
declare function cancelFullIngestExtractionApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<FullIngestCancelResult>>;
|
|
420
|
+
/**
|
|
421
|
+
* Ingest extracted nodes into the knowledge graph
|
|
422
|
+
*
|
|
423
|
+
* @param request - Nodes to ingest
|
|
424
|
+
* @param options - API options including optional graphId
|
|
425
|
+
* @returns Ingest result with counts
|
|
426
|
+
*/
|
|
427
|
+
declare function ingestFullIngestNodesApi(request: FullIngestNodesRequest, options: KGApiOptions): Promise<ApiResponse<FullIngestNodesResult>>;
|
|
428
|
+
/**
|
|
429
|
+
* List full ingestion jobs for the organization
|
|
430
|
+
*
|
|
431
|
+
* @param options - API options including optional limit
|
|
432
|
+
* @returns List of job summaries
|
|
433
|
+
*/
|
|
434
|
+
declare function listFullIngestJobsApi(options: KGApiOptions & {
|
|
435
|
+
limit?: number;
|
|
436
|
+
}): Promise<ApiResponse<FullIngestJobsListResponse>>;
|
|
437
|
+
/**
|
|
438
|
+
* Get a specific full ingestion job by ID
|
|
439
|
+
*
|
|
440
|
+
* @param jobId - The job ID
|
|
441
|
+
* @param options - API options
|
|
442
|
+
* @returns The job details including nodes, edges, and events
|
|
443
|
+
*/
|
|
444
|
+
declare function getFullIngestJobApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<FullIngestJob>>;
|
|
356
445
|
|
|
357
|
-
export { type CrawlJob, type CrawlJobStartResponse, type CrawlJobStatusResponse, type CrawlJobsListResponse, type CrawledPagesResponse, type KGApiOptions, cancelCrawlJobApi, createDesignerEdgeApi, createDesignerNodeApi, createGraphApi, deleteDesignerEdgeApi, deleteDesignerNodeApi, deleteGraphApi, deleteKGDocumentApi, getCrawlJobStatusApi, getCrawledPagesApi, getDesignerEdgeApi, getDesignerNodeApi, getGraphApi, getGraphLabelsApi, getKGNodeApi, getNodeConnectionStatsApi, ingestDocumentApi, ingestKGNodeApi, listCrawlJobsApi, listDesignerEdgesApi, listDesignerNodesApi, listGraphsApi, optimizeGraphApi, queryGraphApi, startCrawlJobApi, updateDesignerEdgeApi, updateDesignerNodeApi, updateGraphApi, updateKGNodeApi };
|
|
446
|
+
export { type CrawlJob, type CrawlJobStartResponse, type CrawlJobStatusResponse, type CrawlJobsListResponse, type CrawledPagesResponse, type KGApiOptions, type QuickIngestEvent, cancelCrawlJobApi, cancelFullIngestExtractionApi, cancelQuickIngestApi, createDesignerEdgeApi, createDesignerNodeApi, createGraphApi, deleteDesignerEdgeApi, deleteDesignerNodeApi, deleteGraphApi, deleteKGDocumentApi, getCrawlJobStatusApi, getCrawledPagesApi, getDesignerEdgeApi, getDesignerNodeApi, getFullIngestJobApi, getGraphApi, getGraphLabelsApi, getKGNodeApi, getNodeConnectionStatsApi, ingestDocumentApi, ingestFullIngestNodesApi, ingestKGNodeApi, listCrawlJobsApi, listDesignerEdgesApi, listDesignerNodesApi, listFullIngestJobsApi, listGraphsApi, optimizeGraphApi, queryGraphApi, startCrawlJobApi, startFullIngestExtractionApi, startQuickIngestApi, updateDesignerEdgeApi, updateDesignerNodeApi, updateGraphApi, updateKGNodeApi };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
|
|
2
2
|
import { ResponseMetadata } from '@elqnt/types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { CreateGraphRequest, CreateGraphResult, DeleteGraphResult, DeleteDocumentResponse, GetGraphResult, KGLabelInfo, KGNode, KGNodeIngestRequest, KGSyncIngestResponse, ListGraphsResult, KGQuery, KGQueryResult, Graph, UpdateGraphResult } from '../models/kg.js';
|
|
4
|
+
import { GraphEdgeDefinition, GraphEdgeResponse, GraphNodeDefinition, GraphNodeResponse } from '../models/kg-designer.js';
|
|
5
|
+
import { FullIngestCancelResult, QuickIngestCancelResult, FullIngestJob, FullIngestNodesRequest, FullIngestNodesResult, FullIngestJobsListResponse, FullIngestExtractionRequest, FullIngestExtractionResult, QuickIngestStartRequest } from '../models/index.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Knowledge Graph Browser API
|
|
@@ -206,10 +207,11 @@ declare function ingestDocumentApi(document: {
|
|
|
206
207
|
* Delete a document from the knowledge graph
|
|
207
208
|
*
|
|
208
209
|
* @param documentId - The document ID to delete
|
|
209
|
-
* @param options - API options including optional graphId
|
|
210
|
+
* @param options - API options including optional graphId and cascade
|
|
211
|
+
* @param cascade - If true, also delete all connected nodes (articles, etc.). Default: false
|
|
210
212
|
* @returns Deletion result with counts
|
|
211
213
|
*/
|
|
212
|
-
declare function deleteKGDocumentApi(documentId: string, options: KGApiOptions): Promise<ApiResponse<DeleteDocumentResponse>>;
|
|
214
|
+
declare function deleteKGDocumentApi(documentId: string, options: KGApiOptions, cascade?: boolean): Promise<ApiResponse<DeleteDocumentResponse>>;
|
|
213
215
|
/**
|
|
214
216
|
* Optimize the knowledge graph
|
|
215
217
|
*
|
|
@@ -353,5 +355,92 @@ declare function cancelCrawlJobApi(jobId: string, options: KGApiOptions): Promis
|
|
|
353
355
|
* @returns List of crawled pages
|
|
354
356
|
*/
|
|
355
357
|
declare function getCrawledPagesApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<CrawledPagesResponse>>;
|
|
358
|
+
/**
|
|
359
|
+
* Quick ingest SSE event types
|
|
360
|
+
*/
|
|
361
|
+
interface QuickIngestEvent {
|
|
362
|
+
type: "started" | "item_start" | "item_progress" | "item_complete" | "item_error" | "job_complete" | "error" | "cancelled";
|
|
363
|
+
itemId?: string;
|
|
364
|
+
message?: string;
|
|
365
|
+
progress?: number;
|
|
366
|
+
text?: string;
|
|
367
|
+
error?: string;
|
|
368
|
+
articles?: number;
|
|
369
|
+
topics?: number;
|
|
370
|
+
nodesCreated?: number;
|
|
371
|
+
nodesByLabel?: Record<string, number>;
|
|
372
|
+
timestamp: number;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Start a quick ingestion job with SSE streaming response
|
|
376
|
+
*
|
|
377
|
+
* @param request - Quick ingestion start request
|
|
378
|
+
* @param options - API options including optional graphId
|
|
379
|
+
* @param onEvent - Callback for each SSE event
|
|
380
|
+
* @returns Promise that resolves when streaming completes
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```ts
|
|
384
|
+
* await startQuickIngestApi(
|
|
385
|
+
* { items: [...], options: {...}, graphId: "default" },
|
|
386
|
+
* { baseUrl, orgId },
|
|
387
|
+
* (event) => {
|
|
388
|
+
* if (event.type === "item_complete") {
|
|
389
|
+
* console.log(`Completed: ${event.itemId}`);
|
|
390
|
+
* }
|
|
391
|
+
* }
|
|
392
|
+
* );
|
|
393
|
+
* ```
|
|
394
|
+
*/
|
|
395
|
+
declare function startQuickIngestApi(request: QuickIngestStartRequest, options: KGApiOptions, onEvent: (event: QuickIngestEvent) => void): Promise<void>;
|
|
396
|
+
/**
|
|
397
|
+
* Cancel a quick ingestion job
|
|
398
|
+
*
|
|
399
|
+
* @param jobId - The job ID to cancel
|
|
400
|
+
* @param options - API options including optional graphId
|
|
401
|
+
* @returns Cancel result with status
|
|
402
|
+
*/
|
|
403
|
+
declare function cancelQuickIngestApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<QuickIngestCancelResult>>;
|
|
404
|
+
/**
|
|
405
|
+
* Start full ingestion extraction
|
|
406
|
+
*
|
|
407
|
+
* @param request - Extraction request with source and labels
|
|
408
|
+
* @param options - API options including optional graphId
|
|
409
|
+
* @returns Extraction job result
|
|
410
|
+
*/
|
|
411
|
+
declare function startFullIngestExtractionApi(request: FullIngestExtractionRequest, options: KGApiOptions): Promise<ApiResponse<FullIngestExtractionResult>>;
|
|
412
|
+
/**
|
|
413
|
+
* Cancel full ingestion extraction
|
|
414
|
+
*
|
|
415
|
+
* @param jobId - The job ID to cancel
|
|
416
|
+
* @param options - API options including optional graphId
|
|
417
|
+
* @returns Cancel result with status
|
|
418
|
+
*/
|
|
419
|
+
declare function cancelFullIngestExtractionApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<FullIngestCancelResult>>;
|
|
420
|
+
/**
|
|
421
|
+
* Ingest extracted nodes into the knowledge graph
|
|
422
|
+
*
|
|
423
|
+
* @param request - Nodes to ingest
|
|
424
|
+
* @param options - API options including optional graphId
|
|
425
|
+
* @returns Ingest result with counts
|
|
426
|
+
*/
|
|
427
|
+
declare function ingestFullIngestNodesApi(request: FullIngestNodesRequest, options: KGApiOptions): Promise<ApiResponse<FullIngestNodesResult>>;
|
|
428
|
+
/**
|
|
429
|
+
* List full ingestion jobs for the organization
|
|
430
|
+
*
|
|
431
|
+
* @param options - API options including optional limit
|
|
432
|
+
* @returns List of job summaries
|
|
433
|
+
*/
|
|
434
|
+
declare function listFullIngestJobsApi(options: KGApiOptions & {
|
|
435
|
+
limit?: number;
|
|
436
|
+
}): Promise<ApiResponse<FullIngestJobsListResponse>>;
|
|
437
|
+
/**
|
|
438
|
+
* Get a specific full ingestion job by ID
|
|
439
|
+
*
|
|
440
|
+
* @param jobId - The job ID
|
|
441
|
+
* @param options - API options
|
|
442
|
+
* @returns The job details including nodes, edges, and events
|
|
443
|
+
*/
|
|
444
|
+
declare function getFullIngestJobApi(jobId: string, options: KGApiOptions): Promise<ApiResponse<FullIngestJob>>;
|
|
356
445
|
|
|
357
|
-
export { type CrawlJob, type CrawlJobStartResponse, type CrawlJobStatusResponse, type CrawlJobsListResponse, type CrawledPagesResponse, type KGApiOptions, cancelCrawlJobApi, createDesignerEdgeApi, createDesignerNodeApi, createGraphApi, deleteDesignerEdgeApi, deleteDesignerNodeApi, deleteGraphApi, deleteKGDocumentApi, getCrawlJobStatusApi, getCrawledPagesApi, getDesignerEdgeApi, getDesignerNodeApi, getGraphApi, getGraphLabelsApi, getKGNodeApi, getNodeConnectionStatsApi, ingestDocumentApi, ingestKGNodeApi, listCrawlJobsApi, listDesignerEdgesApi, listDesignerNodesApi, listGraphsApi, optimizeGraphApi, queryGraphApi, startCrawlJobApi, updateDesignerEdgeApi, updateDesignerNodeApi, updateGraphApi, updateKGNodeApi };
|
|
446
|
+
export { type CrawlJob, type CrawlJobStartResponse, type CrawlJobStatusResponse, type CrawlJobsListResponse, type CrawledPagesResponse, type KGApiOptions, type QuickIngestEvent, cancelCrawlJobApi, cancelFullIngestExtractionApi, cancelQuickIngestApi, createDesignerEdgeApi, createDesignerNodeApi, createGraphApi, deleteDesignerEdgeApi, deleteDesignerNodeApi, deleteGraphApi, deleteKGDocumentApi, getCrawlJobStatusApi, getCrawledPagesApi, getDesignerEdgeApi, getDesignerNodeApi, getFullIngestJobApi, getGraphApi, getGraphLabelsApi, getKGNodeApi, getNodeConnectionStatsApi, ingestDocumentApi, ingestFullIngestNodesApi, ingestKGNodeApi, listCrawlJobsApi, listDesignerEdgesApi, listDesignerNodesApi, listFullIngestJobsApi, listGraphsApi, optimizeGraphApi, queryGraphApi, startCrawlJobApi, startFullIngestExtractionApi, startQuickIngestApi, updateDesignerEdgeApi, updateDesignerNodeApi, updateGraphApi, updateKGNodeApi };
|
package/dist/api/index.js
CHANGED
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var _chunk2TJCYLTPjs = require('../chunk-2TJCYLTP.js');
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
|
|
@@ -37,6 +36,7 @@ var _chunk2TJCYLTPjs = require('../chunk-2TJCYLTP.js');
|
|
|
37
36
|
|
|
38
37
|
|
|
39
38
|
|
|
39
|
+
var _chunkCNWOI7LXjs = require('../chunk-CNWOI7LX.js');
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
@@ -60,5 +60,19 @@ var _chunk2TJCYLTPjs = require('../chunk-2TJCYLTP.js');
|
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
exports.cancelCrawlJobApi = _chunkCNWOI7LXjs.cancelCrawlJobApi; exports.cancelFullIngestExtractionApi = _chunkCNWOI7LXjs.cancelFullIngestExtractionApi; exports.cancelQuickIngestApi = _chunkCNWOI7LXjs.cancelQuickIngestApi; exports.createDesignerEdgeApi = _chunkCNWOI7LXjs.createDesignerEdgeApi; exports.createDesignerNodeApi = _chunkCNWOI7LXjs.createDesignerNodeApi; exports.createGraphApi = _chunkCNWOI7LXjs.createGraphApi; exports.deleteDesignerEdgeApi = _chunkCNWOI7LXjs.deleteDesignerEdgeApi; exports.deleteDesignerNodeApi = _chunkCNWOI7LXjs.deleteDesignerNodeApi; exports.deleteGraphApi = _chunkCNWOI7LXjs.deleteGraphApi; exports.deleteKGDocumentApi = _chunkCNWOI7LXjs.deleteKGDocumentApi; exports.getCrawlJobStatusApi = _chunkCNWOI7LXjs.getCrawlJobStatusApi; exports.getCrawledPagesApi = _chunkCNWOI7LXjs.getCrawledPagesApi; exports.getDesignerEdgeApi = _chunkCNWOI7LXjs.getDesignerEdgeApi; exports.getDesignerNodeApi = _chunkCNWOI7LXjs.getDesignerNodeApi; exports.getFullIngestJobApi = _chunkCNWOI7LXjs.getFullIngestJobApi; exports.getGraphApi = _chunkCNWOI7LXjs.getGraphApi; exports.getGraphLabelsApi = _chunkCNWOI7LXjs.getGraphLabelsApi; exports.getKGNodeApi = _chunkCNWOI7LXjs.getKGNodeApi; exports.getNodeConnectionStatsApi = _chunkCNWOI7LXjs.getNodeConnectionStatsApi; exports.ingestDocumentApi = _chunkCNWOI7LXjs.ingestDocumentApi; exports.ingestFullIngestNodesApi = _chunkCNWOI7LXjs.ingestFullIngestNodesApi; exports.ingestKGNodeApi = _chunkCNWOI7LXjs.ingestKGNodeApi; exports.listCrawlJobsApi = _chunkCNWOI7LXjs.listCrawlJobsApi; exports.listDesignerEdgesApi = _chunkCNWOI7LXjs.listDesignerEdgesApi; exports.listDesignerNodesApi = _chunkCNWOI7LXjs.listDesignerNodesApi; exports.listFullIngestJobsApi = _chunkCNWOI7LXjs.listFullIngestJobsApi; exports.listGraphsApi = _chunkCNWOI7LXjs.listGraphsApi; exports.optimizeGraphApi = _chunkCNWOI7LXjs.optimizeGraphApi; exports.queryGraphApi = _chunkCNWOI7LXjs.queryGraphApi; exports.startCrawlJobApi = _chunkCNWOI7LXjs.startCrawlJobApi; exports.startFullIngestExtractionApi = _chunkCNWOI7LXjs.startFullIngestExtractionApi; exports.startQuickIngestApi = _chunkCNWOI7LXjs.startQuickIngestApi; exports.updateDesignerEdgeApi = _chunkCNWOI7LXjs.updateDesignerEdgeApi; exports.updateDesignerNodeApi = _chunkCNWOI7LXjs.updateDesignerNodeApi; exports.updateGraphApi = _chunkCNWOI7LXjs.updateGraphApi; exports.updateKGNodeApi = _chunkCNWOI7LXjs.updateKGNodeApi;
|
|
64
78
|
//# sourceMappingURL=index.js.map
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/eloquent
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/kg/dist/api/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,u2EAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/kg/dist/api/index.js"}
|
package/dist/api/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
cancelCrawlJobApi,
|
|
4
|
+
cancelFullIngestExtractionApi,
|
|
5
|
+
cancelQuickIngestApi,
|
|
4
6
|
createDesignerEdgeApi,
|
|
5
7
|
createDesignerNodeApi,
|
|
6
8
|
createGraphApi,
|
|
@@ -12,26 +14,33 @@ import {
|
|
|
12
14
|
getCrawledPagesApi,
|
|
13
15
|
getDesignerEdgeApi,
|
|
14
16
|
getDesignerNodeApi,
|
|
17
|
+
getFullIngestJobApi,
|
|
15
18
|
getGraphApi,
|
|
16
19
|
getGraphLabelsApi,
|
|
17
20
|
getKGNodeApi,
|
|
18
21
|
getNodeConnectionStatsApi,
|
|
19
22
|
ingestDocumentApi,
|
|
23
|
+
ingestFullIngestNodesApi,
|
|
20
24
|
ingestKGNodeApi,
|
|
21
25
|
listCrawlJobsApi,
|
|
22
26
|
listDesignerEdgesApi,
|
|
23
27
|
listDesignerNodesApi,
|
|
28
|
+
listFullIngestJobsApi,
|
|
24
29
|
listGraphsApi,
|
|
25
30
|
optimizeGraphApi,
|
|
26
31
|
queryGraphApi,
|
|
27
32
|
startCrawlJobApi,
|
|
33
|
+
startFullIngestExtractionApi,
|
|
34
|
+
startQuickIngestApi,
|
|
28
35
|
updateDesignerEdgeApi,
|
|
29
36
|
updateDesignerNodeApi,
|
|
30
37
|
updateGraphApi,
|
|
31
38
|
updateKGNodeApi
|
|
32
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-5D7RJC7D.mjs";
|
|
33
40
|
export {
|
|
34
41
|
cancelCrawlJobApi,
|
|
42
|
+
cancelFullIngestExtractionApi,
|
|
43
|
+
cancelQuickIngestApi,
|
|
35
44
|
createDesignerEdgeApi,
|
|
36
45
|
createDesignerNodeApi,
|
|
37
46
|
createGraphApi,
|
|
@@ -43,19 +52,24 @@ export {
|
|
|
43
52
|
getCrawledPagesApi,
|
|
44
53
|
getDesignerEdgeApi,
|
|
45
54
|
getDesignerNodeApi,
|
|
55
|
+
getFullIngestJobApi,
|
|
46
56
|
getGraphApi,
|
|
47
57
|
getGraphLabelsApi,
|
|
48
58
|
getKGNodeApi,
|
|
49
59
|
getNodeConnectionStatsApi,
|
|
50
60
|
ingestDocumentApi,
|
|
61
|
+
ingestFullIngestNodesApi,
|
|
51
62
|
ingestKGNodeApi,
|
|
52
63
|
listCrawlJobsApi,
|
|
53
64
|
listDesignerEdgesApi,
|
|
54
65
|
listDesignerNodesApi,
|
|
66
|
+
listFullIngestJobsApi,
|
|
55
67
|
listGraphsApi,
|
|
56
68
|
optimizeGraphApi,
|
|
57
69
|
queryGraphApi,
|
|
58
70
|
startCrawlJobApi,
|
|
71
|
+
startFullIngestExtractionApi,
|
|
72
|
+
startQuickIngestApi,
|
|
59
73
|
updateDesignerEdgeApi,
|
|
60
74
|
updateDesignerNodeApi,
|
|
61
75
|
updateGraphApi,
|
package/dist/api/server.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ApiResponse } from '@elqnt/api-client';
|
|
2
2
|
import { ResponseMetadata } from '@elqnt/types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { CreateGraphRequest, CreateGraphResult, DeleteGraphResult, DeleteDocumentResponse, KGLabelInfo, GetGraphResult, KGNode, KGNodeIngestRequest, KGSyncIngestResponse, ListGraphsResult, KGQuery, KGQueryResult, Graph, UpdateGraphResult } from '../models/kg.mjs';
|
|
4
|
+
import { GraphEdgeDefinition, GraphEdgeResponse, GraphNodeDefinition, GraphNodeResponse } from '../models/kg-designer.mjs';
|
|
5
|
+
import { CrawlJobStatusResponse, CrawledPagesResponse, CrawlJobsListResponse, CrawlJobStartResponse } from './index.mjs';
|
|
6
|
+
import '../models/index.mjs';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Knowledge Graph Server API
|
package/dist/api/server.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ApiResponse } from '@elqnt/api-client';
|
|
2
2
|
import { ResponseMetadata } from '@elqnt/types';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { CreateGraphRequest, CreateGraphResult, DeleteGraphResult, DeleteDocumentResponse, KGLabelInfo, GetGraphResult, KGNode, KGNodeIngestRequest, KGSyncIngestResponse, ListGraphsResult, KGQuery, KGQueryResult, Graph, UpdateGraphResult } from '../models/kg.js';
|
|
4
|
+
import { GraphEdgeDefinition, GraphEdgeResponse, GraphNodeDefinition, GraphNodeResponse } from '../models/kg-designer.js';
|
|
5
|
+
import { CrawlJobStatusResponse, CrawledPagesResponse, CrawlJobsListResponse, CrawlJobStartResponse } from './index.js';
|
|
6
|
+
import '../models/index.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Knowledge Graph Server API
|
package/dist/api/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/kg/dist/api/server.js","../../api/server.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACA;ACmBA,kDAAiC;AA4DjC,SAAS,gBAAA,CAAiB,MAAA,EAAoD;AAC5E,EAAA,MAAM,aAAA,EAAe,IAAI,eAAA,CAAgB,CAAA;AACzC,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,KAAK,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,GAAA,CAAI,MAAA,IAAU,KAAA,CAAA,EAAW;AACvB,MAAA,YAAA,CAAa,GAAA,CAAI,GAAA,EAAK,KAAK,CAAA;AAAA,IAC7B;AAAA,EACF;AACA,EAAA,MAAM,YAAA,EAAc,YAAA,CAAa,QAAA,CAAS,CAAA;AAC1C,EAAA,OAAO,YAAA,EAAc,CAAA,CAAA,EAAI,WAAW,CAAA,EAAA;AACtC;AAK4E;AACzC,EAAA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EAAA;AACd,IAAA;AACY,IAAA;AACD,IAAA;AACJ,IAAA;AACC,IAAA;AACG,IAAA;AACF,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AAME;AAGwB,EAAA;AACd,IAAA;AACD,IAAA;AACa,IAAA;AACD,IAAA;AACJ,IAAA;AACC,IAAA;AACG,IAAA;AACW,IAAA;AACb,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AAME;AAGqC,EAAA;AACb,EAAA;AACd,IAAA;AACY,IAAA;AACD,IAAA;AACJ,IAAA;AACC,IAAA;AACG,IAAA;AACF,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AD1UuC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/kg/dist/api/server.js","sourcesContent":[null,"/**\n * Knowledge Graph Server API\n *\n * Server-side API client for KG operations in server actions and SSR.\n * Uses @elqnt/api-client/server for HTTP requests with JWT token generation.\n *\n * @example\n * ```ts\n * // In a server action\n * import { listGraphsServer } from \"@elqnt/kg/api/server\";\n *\n * const graphs = await listGraphsServer({\n * gatewayUrl: process.env.API_GATEWAY_URL!,\n * jwtSecret: process.env.JWT_SECRET!,\n * orgId: orgId,\n * });\n * ```\n *\n * @packageDocumentation\n */\n\nimport { serverApiRequest } from \"@elqnt/api-client/server\";\nimport type { ApiResponse } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n Graph,\n ListGraphsResult,\n GetGraphResult,\n CreateGraphResult,\n CreateGraphRequest,\n UpdateGraphResult,\n DeleteGraphResult,\n KGNode,\n KGQuery,\n KGQueryResult,\n KGLabelInfo,\n KGNodeIngestRequest,\n KGSyncIngestResponse,\n DeleteDocumentResponse,\n GraphNodeDefinition,\n GraphNodeResponse,\n GraphEdgeDefinition,\n GraphEdgeResponse,\n} from \"../models\";\nimport type {\n CrawlJob,\n CrawlJobsListResponse,\n CrawlJobStatusResponse,\n CrawlJobStartResponse,\n CrawledPagesResponse,\n} from \"./index\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Options for server-side KG API calls\n */\nexport interface ServerApiOptions {\n /** API Gateway URL */\n gatewayUrl: string;\n /** JWT secret for token generation */\n jwtSecret: string;\n /** Organization ID */\n orgId: string;\n /** Optional user ID (defaults to \"system\") */\n userId?: string;\n /** Optional user email */\n userEmail?: string;\n /** Optional graph ID for graph-scoped operations */\n graphId?: string;\n /** Request timeout in ms */\n timeout?: number;\n /** Request cache mode */\n cache?: RequestCache;\n}\n\n/**\n * Build query string from parameters, filtering out undefined values\n */\nfunction buildQueryString(params: Record<string, string | undefined>): string {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n searchParams.set(key, value);\n }\n }\n const queryString = searchParams.toString();\n return queryString ? `?${queryString}` : \"\";\n}\n\n/**\n * Build headers including X-Graph-ID if provided\n */\nfunction buildHeaders(graphId?: string): Record<string, string> | undefined {\n return graphId ? { \"X-Graph-ID\": graphId } : undefined;\n}\n\n// =============================================================================\n// GRAPHS\n// =============================================================================\n\n/**\n * List all knowledge graphs for the organization\n *\n * @example\n * ```ts\n * const response = await listGraphsServer({\n * gatewayUrl: \"http://api-gateway:80\",\n * jwtSecret: process.env.JWT_SECRET!,\n * orgId: \"org-123\",\n * });\n * if (response.data?.graphs) {\n * console.log(\"Graphs:\", response.data.graphs);\n * }\n * ```\n */\nexport async function listGraphsServer(\n options: ServerApiOptions\n): Promise<ApiResponse<ListGraphsResult>> {\n return serverApiRequest(\"/api/v1/kg/graphs\", {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get a specific knowledge graph by ID\n */\nexport async function getGraphServer(\n graphId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<GetGraphResult>> {\n return serverApiRequest(`/api/v1/kg/graphs/${graphId}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Create a new knowledge graph\n */\nexport async function createGraphServer(\n graph: CreateGraphRequest,\n options: ServerApiOptions\n): Promise<ApiResponse<CreateGraphResult>> {\n return serverApiRequest(\"/api/v1/kg/graphs\", {\n method: \"POST\",\n body: graph,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing knowledge graph\n */\nexport async function updateGraphServer(\n graphId: string,\n updates: Partial<Graph>,\n options: ServerApiOptions\n): Promise<ApiResponse<UpdateGraphResult>> {\n return serverApiRequest(`/api/v1/kg/graphs/${graphId}`, {\n method: \"PUT\",\n body: updates,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Delete a knowledge graph\n */\nexport async function deleteGraphServer(\n graphId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<DeleteGraphResult>> {\n return serverApiRequest(`/api/v1/kg/graphs/${graphId}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// QUERY & LABELS\n// =============================================================================\n\n/**\n * Query knowledge graph nodes\n *\n * @example\n * ```ts\n * const response = await queryGraphServer(\n * { label: \"Person\", fields: [], limit: 10, depth: 1, sortBy: \"\", sortOrder: \"\" },\n * { gatewayUrl, jwtSecret, orgId, graphId }\n * );\n * ```\n */\nexport async function queryGraphServer(\n query: KGQuery,\n options: ServerApiOptions\n): Promise<ApiResponse<KGQueryResult>> {\n return serverApiRequest(\"/api/v1/kg/query\", {\n method: \"POST\",\n body: query,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout ?? 30000,\n cache: options.cache,\n });\n}\n\n/**\n * Get all node labels in the knowledge graph\n */\nexport async function getGraphLabelsServer(\n options: ServerApiOptions\n): Promise<ApiResponse<{ labels: KGLabelInfo[] }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/labels${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// NODES\n// =============================================================================\n\n/**\n * Get a specific KG node by ID\n */\nexport async function getKGNodeServer(\n nodeId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<{ node: KGNode }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/nodes/${nodeId}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Ingest a new node into the knowledge graph\n */\nexport async function ingestKGNodeServer(\n node: KGNodeIngestRequest,\n options: ServerApiOptions\n): Promise<ApiResponse<KGSyncIngestResponse>> {\n return serverApiRequest(\"/api/v1/kg/nodes\", {\n method: \"POST\",\n body: node,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing KG node\n */\nexport async function updateKGNodeServer(\n nodeId: string,\n updates: Partial<KGNode>,\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return serverApiRequest(`/api/v1/kg/nodes/${nodeId}`, {\n method: \"PUT\",\n body: updates,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get connection statistics for a node\n */\nexport async function getNodeConnectionStatsServer(\n nodeId: string,\n edgeLabel: string,\n options: ServerApiOptions\n): Promise<ApiResponse<Record<string, number>>> {\n const queryString = buildQueryString({\n edgeLabel,\n graphId: options.graphId,\n });\n return serverApiRequest(`/api/v1/kg/nodes/${nodeId}/connections${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// DOCUMENTS\n// =============================================================================\n\n/**\n * Ingest a document into the knowledge graph\n */\nexport async function ingestDocumentServer(\n document: { id: string; title: string; content: string; docUrl?: string; lang?: string },\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return serverApiRequest(\"/api/v1/kg/ingest\", {\n method: \"POST\",\n body: document,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout ?? 120000,\n cache: options.cache,\n });\n}\n\n/**\n * Delete a document from the knowledge graph\n */\nexport async function deleteKGDocumentServer(\n documentId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<DeleteDocumentResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/documents/${documentId}${queryString}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Optimize the knowledge graph\n */\nexport async function optimizeGraphServer(\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return serverApiRequest(\"/api/v1/kg/graph/optimize\", {\n method: \"POST\",\n body: {},\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// DESIGNER - NODES\n// =============================================================================\n\n/**\n * List all node definitions in the graph designer\n */\nexport async function listDesignerNodesServer(\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/nodes${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get a specific node definition by label\n */\nexport async function getDesignerNodeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/nodes/${label}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Create a new node definition\n */\nexport async function createDesignerNodeServer(\n node: Omit<GraphNodeDefinition, \"createdAt\" | \"updatedAt\">,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n return serverApiRequest(\"/api/v1/kg/designer/nodes\", {\n method: \"POST\",\n body: { node },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing node definition\n */\nexport async function updateDesignerNodeServer(\n label: string,\n node: Partial<GraphNodeDefinition>,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n return serverApiRequest(`/api/v1/kg/designer/nodes/${label}`, {\n method: \"PUT\",\n body: { node },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Delete a node definition\n */\nexport async function deleteDesignerNodeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/nodes/${label}${queryString}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// DESIGNER - EDGES\n// =============================================================================\n\n/**\n * List all edge definitions in the graph designer\n */\nexport async function listDesignerEdgesServer(\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/edges${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get a specific edge definition by label\n */\nexport async function getDesignerEdgeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/edges/${label}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Create a new edge definition\n */\nexport async function createDesignerEdgeServer(\n edge: Omit<GraphEdgeDefinition, \"createdAt\" | \"updatedAt\">,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n return serverApiRequest(\"/api/v1/kg/designer/edges\", {\n method: \"POST\",\n body: { edge },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing edge definition\n */\nexport async function updateDesignerEdgeServer(\n label: string,\n edge: Partial<GraphEdgeDefinition>,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n return serverApiRequest(`/api/v1/kg/designer/edges/${label}`, {\n method: \"PUT\",\n body: { edge },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Delete an edge definition\n */\nexport async function deleteDesignerEdgeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/edges/${label}${queryString}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// CRAWL JOBS\n// =============================================================================\n\n/**\n * List crawl jobs\n */\nexport async function listCrawlJobsServer(\n options: ServerApiOptions & { limit?: number; offset?: number; status?: string }\n): Promise<ApiResponse<CrawlJobsListResponse>> {\n const queryString = buildQueryString({\n graphId: options.graphId,\n limit: options.limit?.toString(),\n offset: options.offset?.toString(),\n status: options.status,\n });\n return serverApiRequest(`/api/v1/kg/crawl/jobs${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Start a new crawl job\n */\nexport async function startCrawlJobServer(\n params: { baseUrl: string; depth: number; maxPages: number },\n options: ServerApiOptions\n): Promise<ApiResponse<CrawlJobStartResponse>> {\n return serverApiRequest(\"/api/v1/kg/crawl/jobs\", {\n method: \"POST\",\n body: params,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get crawl job status\n */\nexport async function getCrawlJobStatusServer(\n jobId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<CrawlJobStatusResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/crawl/jobs/${jobId}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Cancel a crawl job\n */\nexport async function cancelCrawlJobServer(\n jobId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<CrawlJobStatusResponse>> {\n return serverApiRequest(`/api/v1/kg/crawl/jobs/${jobId}/cancel`, {\n method: \"POST\",\n body: {},\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get pages crawled by a job\n */\nexport async function getCrawledPagesServer(\n jobId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<CrawledPagesResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/crawl/jobs/${jobId}/pages${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/kg/dist/api/server.js","../../api/server.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACA;ACmBA,kDAAiC;AA4DjC,SAAS,gBAAA,CAAiB,MAAA,EAAoD;AAC5E,EAAA,MAAM,aAAA,EAAe,IAAI,eAAA,CAAgB,CAAA;AACzC,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,KAAK,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,EAAG;AACjD,IAAA,GAAA,CAAI,MAAA,IAAU,KAAA,CAAA,EAAW;AACvB,MAAA,YAAA,CAAa,GAAA,CAAI,GAAA,EAAK,KAAK,CAAA;AAAA,IAC7B;AAAA,EACF;AACA,EAAA,MAAM,YAAA,EAAc,YAAA,CAAa,QAAA,CAAS,CAAA;AAC1C,EAAA,OAAO,YAAA,E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AA;AACb,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AAME;AAGqC,EAAA;AACb,EAAA;AACd,IAAA;AACY,IAAA;AACD,IAAA;AACJ,IAAA;AACC,IAAA;AACG,IAAA;AACF,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AAME;AAGwB,EAAA;AACd,IAAA;AACD,IAAA;AACa,IAAA;AACD,IAAA;AACJ,IAAA;AACC,IAAA;AACG,IAAA;AACW,IAAA;AACb,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AAME;AAGqC,EAAA;AACb,EAAA;AACd,IAAA;AACY,IAAA;AACD,IAAA;AACJ,IAAA;AACC,IAAA;AACG,IAAA;AACF,IAAA;AACF,IAAA;AAChB,EAAA;AACH;AD1UuC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/kg/dist/api/server.js","sourcesContent":[null,"/**\n * Knowledge Graph Server API\n *\n * Server-side API client for KG operations in server actions and SSR.\n * Uses @elqnt/api-client/server for HTTP requests with JWT token generation.\n *\n * @example\n * ```ts\n * // In a server action\n * import { listGraphsServer } from \"@elqnt/kg/api/server\";\n *\n * const graphs = await listGraphsServer({\n * gatewayUrl: process.env.API_GATEWAY_URL!,\n * jwtSecret: process.env.JWT_SECRET!,\n * orgId: orgId,\n * });\n * ```\n *\n * @packageDocumentation\n */\n\nimport { serverApiRequest } from \"@elqnt/api-client/server\";\nimport type { ApiResponse } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n Graph,\n ListGraphsResult,\n GetGraphResult,\n CreateGraphResult,\n CreateGraphRequest,\n UpdateGraphResult,\n DeleteGraphResult,\n KGNode,\n KGQuery,\n KGQueryResult,\n KGLabelInfo,\n KGNodeIngestRequest,\n KGSyncIngestResponse,\n DeleteDocumentResponse,\n GraphNodeDefinition,\n GraphNodeResponse,\n GraphEdgeDefinition,\n GraphEdgeResponse,\n} from \"../models\";\nimport type {\n CrawlJob,\n CrawlJobsListResponse,\n CrawlJobStatusResponse,\n CrawlJobStartResponse,\n CrawledPagesResponse,\n} from \"./index\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/**\n * Options for server-side KG API calls\n */\nexport interface ServerApiOptions {\n /** API Gateway URL */\n gatewayUrl: string;\n /** JWT secret for token generation */\n jwtSecret: string;\n /** Organization ID */\n orgId: string;\n /** Optional user ID (defaults to \"system\") */\n userId?: string;\n /** Optional user email */\n userEmail?: string;\n /** Optional graph ID for graph-scoped operations */\n graphId?: string;\n /** Request timeout in ms */\n timeout?: number;\n /** Request cache mode */\n cache?: RequestCache;\n}\n\n/**\n * Build query string from parameters, filtering out undefined values\n */\nfunction buildQueryString(params: Record<string, string | undefined>): string {\n const searchParams = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n searchParams.set(key, value);\n }\n }\n const queryString = searchParams.toString();\n return queryString ? `?${queryString}` : \"\";\n}\n\n/**\n * Build headers including X-Graph-ID if provided\n */\nfunction buildHeaders(graphId?: string): Record<string, string> | undefined {\n return graphId ? { \"X-Graph-ID\": graphId } : undefined;\n}\n\n// =============================================================================\n// GRAPHS\n// =============================================================================\n\n/**\n * List all knowledge graphs for the organization\n *\n * @example\n * ```ts\n * const response = await listGraphsServer({\n * gatewayUrl: \"http://api-gateway:80\",\n * jwtSecret: process.env.JWT_SECRET!,\n * orgId: \"org-123\",\n * });\n * if (response.data?.graphs) {\n * console.log(\"Graphs:\", response.data.graphs);\n * }\n * ```\n */\nexport async function listGraphsServer(\n options: ServerApiOptions\n): Promise<ApiResponse<ListGraphsResult>> {\n return serverApiRequest(\"/api/v1/kg/graphs\", {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get a specific knowledge graph by ID\n */\nexport async function getGraphServer(\n graphId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<GetGraphResult>> {\n return serverApiRequest(`/api/v1/kg/graphs/${graphId}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Create a new knowledge graph\n */\nexport async function createGraphServer(\n graph: CreateGraphRequest,\n options: ServerApiOptions\n): Promise<ApiResponse<CreateGraphResult>> {\n return serverApiRequest(\"/api/v1/kg/graphs\", {\n method: \"POST\",\n body: graph,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing knowledge graph\n */\nexport async function updateGraphServer(\n graphId: string,\n updates: Partial<Graph>,\n options: ServerApiOptions\n): Promise<ApiResponse<UpdateGraphResult>> {\n return serverApiRequest(`/api/v1/kg/graphs/${graphId}`, {\n method: \"PUT\",\n body: updates,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Delete a knowledge graph\n */\nexport async function deleteGraphServer(\n graphId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<DeleteGraphResult>> {\n return serverApiRequest(`/api/v1/kg/graphs/${graphId}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// QUERY & LABELS\n// =============================================================================\n\n/**\n * Query knowledge graph nodes\n *\n * @example\n * ```ts\n * const response = await queryGraphServer(\n * { label: \"Person\", fields: [], limit: 10, depth: 1, sortBy: \"\", sortOrder: \"\" },\n * { gatewayUrl, jwtSecret, orgId, graphId }\n * );\n * ```\n */\nexport async function queryGraphServer(\n query: KGQuery,\n options: ServerApiOptions\n): Promise<ApiResponse<KGQueryResult>> {\n return serverApiRequest(\"/api/v1/kg/query\", {\n method: \"POST\",\n body: query,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout ?? 30000,\n cache: options.cache,\n });\n}\n\n/**\n * Get all node labels in the knowledge graph\n */\nexport async function getGraphLabelsServer(\n options: ServerApiOptions\n): Promise<ApiResponse<{ labels: KGLabelInfo[] }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/labels${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// NODES\n// =============================================================================\n\n/**\n * Get a specific KG node by ID\n */\nexport async function getKGNodeServer(\n nodeId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<{ node: KGNode }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/nodes/${nodeId}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Ingest a new node into the knowledge graph\n */\nexport async function ingestKGNodeServer(\n node: KGNodeIngestRequest,\n options: ServerApiOptions\n): Promise<ApiResponse<KGSyncIngestResponse>> {\n return serverApiRequest(\"/api/v1/kg/nodes\", {\n method: \"POST\",\n body: node,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing KG node\n */\nexport async function updateKGNodeServer(\n nodeId: string,\n updates: Partial<KGNode>,\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return serverApiRequest(`/api/v1/kg/nodes/${nodeId}`, {\n method: \"PUT\",\n body: updates,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get connection statistics for a node\n */\nexport async function getNodeConnectionStatsServer(\n nodeId: string,\n edgeLabel: string,\n options: ServerApiOptions\n): Promise<ApiResponse<Record<string, number>>> {\n const queryString = buildQueryString({\n edgeLabel,\n graphId: options.graphId,\n });\n return serverApiRequest(`/api/v1/kg/nodes/${nodeId}/connections${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// DOCUMENTS\n// =============================================================================\n\n/**\n * Ingest a document into the knowledge graph\n */\nexport async function ingestDocumentServer(\n document: { id: string; title: string; content: string; docUrl?: string; lang?: string },\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return serverApiRequest(\"/api/v1/kg/ingest\", {\n method: \"POST\",\n body: document,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout ?? 120000,\n cache: options.cache,\n });\n}\n\n/**\n * Delete a document from the knowledge graph\n */\nexport async function deleteKGDocumentServer(\n documentId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<DeleteDocumentResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/documents/${documentId}${queryString}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Optimize the knowledge graph\n */\nexport async function optimizeGraphServer(\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return serverApiRequest(\"/api/v1/kg/graph/optimize\", {\n method: \"POST\",\n body: {},\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// DESIGNER - NODES\n// =============================================================================\n\n/**\n * List all node definitions in the graph designer\n */\nexport async function listDesignerNodesServer(\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/nodes${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get a specific node definition by label\n */\nexport async function getDesignerNodeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/nodes/${label}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Create a new node definition\n */\nexport async function createDesignerNodeServer(\n node: Omit<GraphNodeDefinition, \"createdAt\" | \"updatedAt\">,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n return serverApiRequest(\"/api/v1/kg/designer/nodes\", {\n method: \"POST\",\n body: { node },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing node definition\n */\nexport async function updateDesignerNodeServer(\n label: string,\n node: Partial<GraphNodeDefinition>,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphNodeResponse>> {\n return serverApiRequest(`/api/v1/kg/designer/nodes/${label}`, {\n method: \"PUT\",\n body: { node },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Delete a node definition\n */\nexport async function deleteDesignerNodeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/nodes/${label}${queryString}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// DESIGNER - EDGES\n// =============================================================================\n\n/**\n * List all edge definitions in the graph designer\n */\nexport async function listDesignerEdgesServer(\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/edges${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get a specific edge definition by label\n */\nexport async function getDesignerEdgeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/edges/${label}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Create a new edge definition\n */\nexport async function createDesignerEdgeServer(\n edge: Omit<GraphEdgeDefinition, \"createdAt\" | \"updatedAt\">,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n return serverApiRequest(\"/api/v1/kg/designer/edges\", {\n method: \"POST\",\n body: { edge },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Update an existing edge definition\n */\nexport async function updateDesignerEdgeServer(\n label: string,\n edge: Partial<GraphEdgeDefinition>,\n options: ServerApiOptions\n): Promise<ApiResponse<GraphEdgeResponse>> {\n return serverApiRequest(`/api/v1/kg/designer/edges/${label}`, {\n method: \"PUT\",\n body: { edge },\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Delete an edge definition\n */\nexport async function deleteDesignerEdgeServer(\n label: string,\n options: ServerApiOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/designer/edges/${label}${queryString}`, {\n method: \"DELETE\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n// =============================================================================\n// CRAWL JOBS\n// =============================================================================\n\n/**\n * List crawl jobs\n */\nexport async function listCrawlJobsServer(\n options: ServerApiOptions & { limit?: number; offset?: number; status?: string }\n): Promise<ApiResponse<CrawlJobsListResponse>> {\n const queryString = buildQueryString({\n graphId: options.graphId,\n limit: options.limit?.toString(),\n offset: options.offset?.toString(),\n status: options.status,\n });\n return serverApiRequest(`/api/v1/kg/crawl/jobs${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Start a new crawl job\n */\nexport async function startCrawlJobServer(\n params: { baseUrl: string; depth: number; maxPages: number },\n options: ServerApiOptions\n): Promise<ApiResponse<CrawlJobStartResponse>> {\n return serverApiRequest(\"/api/v1/kg/crawl/jobs\", {\n method: \"POST\",\n body: params,\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get crawl job status\n */\nexport async function getCrawlJobStatusServer(\n jobId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<CrawlJobStatusResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/crawl/jobs/${jobId}${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Cancel a crawl job\n */\nexport async function cancelCrawlJobServer(\n jobId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<CrawlJobStatusResponse>> {\n return serverApiRequest(`/api/v1/kg/crawl/jobs/${jobId}/cancel`, {\n method: \"POST\",\n body: {},\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n headers: buildHeaders(options.graphId),\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n\n/**\n * Get pages crawled by a job\n */\nexport async function getCrawledPagesServer(\n jobId: string,\n options: ServerApiOptions\n): Promise<ApiResponse<CrawledPagesResponse>> {\n const queryString = buildQueryString({ graphId: options.graphId });\n return serverApiRequest(`/api/v1/kg/crawl/jobs/${jobId}/pages${queryString}`, {\n method: \"GET\",\n gatewayUrl: options.gatewayUrl,\n jwtSecret: options.jwtSecret,\n orgId: options.orgId,\n userId: options.userId,\n userEmail: options.userEmail,\n timeout: options.timeout,\n cache: options.cache,\n });\n}\n"]}
|