@robosystems/client 0.2.15 → 0.2.17
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/extensions/FileClient.d.ts +57 -0
- package/extensions/{TableIngestClient.js → FileClient.js} +55 -77
- package/extensions/{TableIngestClient.ts → FileClient.ts} +67 -122
- package/extensions/MaterializationClient.d.ts +51 -0
- package/extensions/MaterializationClient.js +107 -0
- package/extensions/MaterializationClient.ts +163 -0
- package/extensions/TableClient.d.ts +38 -0
- package/extensions/TableClient.js +92 -0
- package/extensions/TableClient.ts +132 -0
- package/extensions/hooks.d.ts +9 -11
- package/extensions/hooks.js +21 -56
- package/extensions/hooks.ts +30 -79
- package/extensions/index.d.ts +14 -4
- package/extensions/index.js +32 -5
- package/extensions/index.test.ts +10 -2
- package/extensions/index.ts +46 -5
- package/package.json +1 -4
- package/sdk/sdk.gen.d.ts +14 -14
- package/sdk/sdk.gen.js +14 -14
- package/sdk/sdk.gen.ts +14 -14
- package/sdk/types.gen.d.ts +7 -7
- package/sdk/types.gen.ts +7 -7
- package/sdk-extensions/FileClient.d.ts +57 -0
- package/sdk-extensions/{TableIngestClient.js → FileClient.js} +55 -77
- package/sdk-extensions/{TableIngestClient.ts → FileClient.ts} +67 -122
- package/sdk-extensions/MaterializationClient.d.ts +51 -0
- package/sdk-extensions/MaterializationClient.js +107 -0
- package/sdk-extensions/MaterializationClient.ts +163 -0
- package/sdk-extensions/TableClient.d.ts +38 -0
- package/sdk-extensions/TableClient.js +92 -0
- package/sdk-extensions/TableClient.ts +132 -0
- package/sdk-extensions/hooks.d.ts +9 -11
- package/sdk-extensions/hooks.js +21 -56
- package/sdk-extensions/hooks.ts +30 -79
- package/sdk-extensions/index.d.ts +14 -4
- package/sdk-extensions/index.js +32 -5
- package/sdk-extensions/index.test.ts +10 -2
- package/sdk-extensions/index.ts +46 -5
- package/sdk.gen.d.ts +14 -14
- package/sdk.gen.js +14 -14
- package/sdk.gen.ts +14 -14
- package/types.gen.d.ts +7 -7
- package/types.gen.ts +7 -7
- package/extensions/TableIngestClient.d.ts +0 -75
- package/extensions/TableIngestClient.test.ts +0 -304
- package/sdk-extensions/TableIngestClient.d.ts +0 -75
- package/sdk-extensions/TableIngestClient.test.ts +0 -304
package/sdk-extensions/hooks.js
CHANGED
|
@@ -14,9 +14,11 @@ exports.useTableUpload = useTableUpload;
|
|
|
14
14
|
const react_1 = require("react");
|
|
15
15
|
const client_gen_1 = require("../sdk/client.gen");
|
|
16
16
|
const config_1 = require("./config");
|
|
17
|
+
const FileClient_1 = require("./FileClient");
|
|
18
|
+
const MaterializationClient_1 = require("./MaterializationClient");
|
|
17
19
|
const OperationClient_1 = require("./OperationClient");
|
|
18
20
|
const QueryClient_1 = require("./QueryClient");
|
|
19
|
-
const
|
|
21
|
+
const TableClient_1 = require("./TableClient");
|
|
20
22
|
/**
|
|
21
23
|
* Hook for executing Cypher queries with loading states and error handling
|
|
22
24
|
*
|
|
@@ -385,11 +387,11 @@ function useSDKClients() {
|
|
|
385
387
|
return clients;
|
|
386
388
|
}
|
|
387
389
|
/**
|
|
388
|
-
* Hook for uploading Parquet files to staging
|
|
390
|
+
* Hook for uploading Parquet files to staging and materializing graphs
|
|
389
391
|
*
|
|
390
392
|
* @example
|
|
391
393
|
* ```tsx
|
|
392
|
-
* const { upload,
|
|
394
|
+
* const { upload, listTables, materialize, loading, error, progress } = useTableUpload('graph_123')
|
|
393
395
|
*
|
|
394
396
|
* const handleFileUpload = async (file: File) => {
|
|
395
397
|
* const result = await upload('Entity', file, {
|
|
@@ -408,28 +410,32 @@ function useTableUpload(graphId) {
|
|
|
408
410
|
const [error, setError] = (0, react_1.useState)(null);
|
|
409
411
|
const [progress, setProgress] = (0, react_1.useState)(null);
|
|
410
412
|
const [uploadResult, setUploadResult] = (0, react_1.useState)(null);
|
|
411
|
-
const
|
|
413
|
+
const fileClientRef = (0, react_1.useRef)(null);
|
|
414
|
+
const materializationClientRef = (0, react_1.useRef)(null);
|
|
415
|
+
const tableClientRef = (0, react_1.useRef)(null);
|
|
412
416
|
(0, react_1.useEffect)(() => {
|
|
413
417
|
const sdkConfig = (0, config_1.getSDKExtensionsConfig)();
|
|
414
418
|
const clientConfig = client_gen_1.client.getConfig();
|
|
415
|
-
// Extract JWT token (uses centralized logic)
|
|
416
419
|
const token = (0, config_1.extractTokenFromSDKClient)();
|
|
417
|
-
|
|
420
|
+
const baseConfig = {
|
|
418
421
|
baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
|
|
419
422
|
credentials: sdkConfig.credentials,
|
|
420
423
|
token,
|
|
421
424
|
headers: sdkConfig.headers,
|
|
422
|
-
}
|
|
425
|
+
};
|
|
426
|
+
fileClientRef.current = new FileClient_1.FileClient(baseConfig);
|
|
427
|
+
materializationClientRef.current = new MaterializationClient_1.MaterializationClient(baseConfig);
|
|
428
|
+
tableClientRef.current = new TableClient_1.TableClient(baseConfig);
|
|
423
429
|
}, []);
|
|
424
430
|
const upload = (0, react_1.useCallback)(async (tableName, fileOrBuffer, options) => {
|
|
425
|
-
if (!
|
|
431
|
+
if (!fileClientRef.current)
|
|
426
432
|
return null;
|
|
427
433
|
setLoading(true);
|
|
428
434
|
setError(null);
|
|
429
435
|
setUploadResult(null);
|
|
430
436
|
setProgress(null);
|
|
431
437
|
try {
|
|
432
|
-
const result = await
|
|
438
|
+
const result = await fileClientRef.current.upload(graphId, tableName, fileOrBuffer, {
|
|
433
439
|
...options,
|
|
434
440
|
onProgress: (msg) => {
|
|
435
441
|
setProgress(msg);
|
|
@@ -452,65 +458,25 @@ function useTableUpload(graphId) {
|
|
|
452
458
|
setProgress(null);
|
|
453
459
|
}
|
|
454
460
|
}, [graphId]);
|
|
455
|
-
const uploadAndIngest = (0, react_1.useCallback)(async (tableName, fileOrBuffer, uploadOptions, ingestOptions) => {
|
|
456
|
-
if (!clientRef.current)
|
|
457
|
-
return null;
|
|
458
|
-
setLoading(true);
|
|
459
|
-
setError(null);
|
|
460
|
-
setUploadResult(null);
|
|
461
|
-
setProgress(null);
|
|
462
|
-
try {
|
|
463
|
-
const result = await clientRef.current.uploadAndIngest(graphId, tableName, fileOrBuffer, {
|
|
464
|
-
...uploadOptions,
|
|
465
|
-
onProgress: (msg) => {
|
|
466
|
-
setProgress(msg);
|
|
467
|
-
uploadOptions?.onProgress?.(msg);
|
|
468
|
-
},
|
|
469
|
-
}, {
|
|
470
|
-
...ingestOptions,
|
|
471
|
-
onProgress: (msg) => {
|
|
472
|
-
setProgress(msg);
|
|
473
|
-
ingestOptions?.onProgress?.(msg);
|
|
474
|
-
},
|
|
475
|
-
});
|
|
476
|
-
setUploadResult(result.upload);
|
|
477
|
-
if (!result.upload.success && result.upload.error) {
|
|
478
|
-
setError(new Error(result.upload.error));
|
|
479
|
-
}
|
|
480
|
-
else if (result.ingest && !result.ingest.success && result.ingest.error) {
|
|
481
|
-
setError(new Error(result.ingest.error));
|
|
482
|
-
}
|
|
483
|
-
return result;
|
|
484
|
-
}
|
|
485
|
-
catch (err) {
|
|
486
|
-
const error = err;
|
|
487
|
-
setError(error);
|
|
488
|
-
return null;
|
|
489
|
-
}
|
|
490
|
-
finally {
|
|
491
|
-
setLoading(false);
|
|
492
|
-
setProgress(null);
|
|
493
|
-
}
|
|
494
|
-
}, [graphId]);
|
|
495
461
|
const listTables = (0, react_1.useCallback)(async () => {
|
|
496
|
-
if (!
|
|
462
|
+
if (!tableClientRef.current)
|
|
497
463
|
return [];
|
|
498
464
|
try {
|
|
499
|
-
return await
|
|
465
|
+
return await tableClientRef.current.list(graphId);
|
|
500
466
|
}
|
|
501
467
|
catch (err) {
|
|
502
468
|
setError(err);
|
|
503
469
|
return [];
|
|
504
470
|
}
|
|
505
471
|
}, [graphId]);
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
472
|
+
const materialize = (0, react_1.useCallback)(async (options) => {
|
|
473
|
+
if (!materializationClientRef.current)
|
|
508
474
|
return null;
|
|
509
475
|
setLoading(true);
|
|
510
476
|
setError(null);
|
|
511
477
|
setProgress(null);
|
|
512
478
|
try {
|
|
513
|
-
const result = await
|
|
479
|
+
const result = await materializationClientRef.current.materialize(graphId, {
|
|
514
480
|
...options,
|
|
515
481
|
onProgress: (msg) => {
|
|
516
482
|
setProgress(msg);
|
|
@@ -534,9 +500,8 @@ function useTableUpload(graphId) {
|
|
|
534
500
|
}, [graphId]);
|
|
535
501
|
return {
|
|
536
502
|
upload,
|
|
537
|
-
uploadAndIngest,
|
|
538
503
|
listTables,
|
|
539
|
-
|
|
504
|
+
materialize,
|
|
540
505
|
loading,
|
|
541
506
|
error,
|
|
542
507
|
progress,
|
package/sdk-extensions/hooks.ts
CHANGED
|
@@ -8,12 +8,16 @@
|
|
|
8
8
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
9
9
|
import { client } from '../sdk/client.gen'
|
|
10
10
|
import { extractTokenFromSDKClient, getSDKExtensionsConfig } from './config'
|
|
11
|
+
import type { FileInput, FileUploadOptions, FileUploadResult } from './FileClient'
|
|
12
|
+
import { FileClient } from './FileClient'
|
|
13
|
+
import type { MaterializationOptions } from './MaterializationClient'
|
|
14
|
+
import { MaterializationClient } from './MaterializationClient'
|
|
11
15
|
import type { OperationProgress, OperationResult } from './OperationClient'
|
|
12
16
|
import { OperationClient } from './OperationClient'
|
|
13
17
|
import type { QueryOptions, QueryResult } from './QueryClient'
|
|
14
18
|
import { QueryClient } from './QueryClient'
|
|
15
|
-
import type {
|
|
16
|
-
import {
|
|
19
|
+
import type { TableInfo } from './TableClient'
|
|
20
|
+
import { TableClient } from './TableClient'
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
23
|
* Hook for executing Cypher queries with loading states and error handling
|
|
@@ -461,11 +465,11 @@ export function useSDKClients() {
|
|
|
461
465
|
}
|
|
462
466
|
|
|
463
467
|
/**
|
|
464
|
-
* Hook for uploading Parquet files to staging
|
|
468
|
+
* Hook for uploading Parquet files to staging and materializing graphs
|
|
465
469
|
*
|
|
466
470
|
* @example
|
|
467
471
|
* ```tsx
|
|
468
|
-
* const { upload,
|
|
472
|
+
* const { upload, listTables, materialize, loading, error, progress } = useTableUpload('graph_123')
|
|
469
473
|
*
|
|
470
474
|
* const handleFileUpload = async (file: File) => {
|
|
471
475
|
* const result = await upload('Entity', file, {
|
|
@@ -483,31 +487,35 @@ export function useTableUpload(graphId: string) {
|
|
|
483
487
|
const [loading, setLoading] = useState(false)
|
|
484
488
|
const [error, setError] = useState<Error | null>(null)
|
|
485
489
|
const [progress, setProgress] = useState<string | null>(null)
|
|
486
|
-
const [uploadResult, setUploadResult] = useState<
|
|
487
|
-
const
|
|
490
|
+
const [uploadResult, setUploadResult] = useState<FileUploadResult | null>(null)
|
|
491
|
+
const fileClientRef = useRef<FileClient | null>(null)
|
|
492
|
+
const materializationClientRef = useRef<MaterializationClient | null>(null)
|
|
493
|
+
const tableClientRef = useRef<TableClient | null>(null)
|
|
488
494
|
|
|
489
495
|
useEffect(() => {
|
|
490
496
|
const sdkConfig = getSDKExtensionsConfig()
|
|
491
497
|
const clientConfig = client.getConfig()
|
|
492
|
-
|
|
493
|
-
// Extract JWT token (uses centralized logic)
|
|
494
498
|
const token = extractTokenFromSDKClient()
|
|
495
499
|
|
|
496
|
-
|
|
500
|
+
const baseConfig = {
|
|
497
501
|
baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
|
|
498
502
|
credentials: sdkConfig.credentials,
|
|
499
503
|
token,
|
|
500
504
|
headers: sdkConfig.headers,
|
|
501
|
-
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
fileClientRef.current = new FileClient(baseConfig)
|
|
508
|
+
materializationClientRef.current = new MaterializationClient(baseConfig)
|
|
509
|
+
tableClientRef.current = new TableClient(baseConfig)
|
|
502
510
|
}, [])
|
|
503
511
|
|
|
504
512
|
const upload = useCallback(
|
|
505
513
|
async (
|
|
506
514
|
tableName: string,
|
|
507
515
|
fileOrBuffer: FileInput,
|
|
508
|
-
options?:
|
|
509
|
-
): Promise<
|
|
510
|
-
if (!
|
|
516
|
+
options?: FileUploadOptions
|
|
517
|
+
): Promise<FileUploadResult | null> => {
|
|
518
|
+
if (!fileClientRef.current) return null
|
|
511
519
|
|
|
512
520
|
setLoading(true)
|
|
513
521
|
setError(null)
|
|
@@ -515,7 +523,7 @@ export function useTableUpload(graphId: string) {
|
|
|
515
523
|
setProgress(null)
|
|
516
524
|
|
|
517
525
|
try {
|
|
518
|
-
const result = await
|
|
526
|
+
const result = await fileClientRef.current.upload(graphId, tableName, fileOrBuffer, {
|
|
519
527
|
...options,
|
|
520
528
|
onProgress: (msg) => {
|
|
521
529
|
setProgress(msg)
|
|
@@ -542,83 +550,27 @@ export function useTableUpload(graphId: string) {
|
|
|
542
550
|
[graphId]
|
|
543
551
|
)
|
|
544
552
|
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
tableName: string,
|
|
548
|
-
fileOrBuffer: FileInput,
|
|
549
|
-
uploadOptions?: UploadOptions,
|
|
550
|
-
ingestOptions?: IngestOptions
|
|
551
|
-
): Promise<{ upload: UploadResult; ingest: any } | null> => {
|
|
552
|
-
if (!clientRef.current) return null
|
|
553
|
-
|
|
554
|
-
setLoading(true)
|
|
555
|
-
setError(null)
|
|
556
|
-
setUploadResult(null)
|
|
557
|
-
setProgress(null)
|
|
558
|
-
|
|
559
|
-
try {
|
|
560
|
-
const result = await clientRef.current.uploadAndIngest(
|
|
561
|
-
graphId,
|
|
562
|
-
tableName,
|
|
563
|
-
fileOrBuffer,
|
|
564
|
-
{
|
|
565
|
-
...uploadOptions,
|
|
566
|
-
onProgress: (msg) => {
|
|
567
|
-
setProgress(msg)
|
|
568
|
-
uploadOptions?.onProgress?.(msg)
|
|
569
|
-
},
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
...ingestOptions,
|
|
573
|
-
onProgress: (msg) => {
|
|
574
|
-
setProgress(msg)
|
|
575
|
-
ingestOptions?.onProgress?.(msg)
|
|
576
|
-
},
|
|
577
|
-
}
|
|
578
|
-
)
|
|
579
|
-
|
|
580
|
-
setUploadResult(result.upload)
|
|
581
|
-
|
|
582
|
-
if (!result.upload.success && result.upload.error) {
|
|
583
|
-
setError(new Error(result.upload.error))
|
|
584
|
-
} else if (result.ingest && !result.ingest.success && result.ingest.error) {
|
|
585
|
-
setError(new Error(result.ingest.error))
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
return result
|
|
589
|
-
} catch (err) {
|
|
590
|
-
const error = err as Error
|
|
591
|
-
setError(error)
|
|
592
|
-
return null
|
|
593
|
-
} finally {
|
|
594
|
-
setLoading(false)
|
|
595
|
-
setProgress(null)
|
|
596
|
-
}
|
|
597
|
-
},
|
|
598
|
-
[graphId]
|
|
599
|
-
)
|
|
600
|
-
|
|
601
|
-
const listTables = useCallback(async () => {
|
|
602
|
-
if (!clientRef.current) return []
|
|
553
|
+
const listTables = useCallback(async (): Promise<TableInfo[]> => {
|
|
554
|
+
if (!tableClientRef.current) return []
|
|
603
555
|
|
|
604
556
|
try {
|
|
605
|
-
return await
|
|
557
|
+
return await tableClientRef.current.list(graphId)
|
|
606
558
|
} catch (err) {
|
|
607
559
|
setError(err as Error)
|
|
608
560
|
return []
|
|
609
561
|
}
|
|
610
562
|
}, [graphId])
|
|
611
563
|
|
|
612
|
-
const
|
|
613
|
-
async (options?:
|
|
614
|
-
if (!
|
|
564
|
+
const materialize = useCallback(
|
|
565
|
+
async (options?: MaterializationOptions) => {
|
|
566
|
+
if (!materializationClientRef.current) return null
|
|
615
567
|
|
|
616
568
|
setLoading(true)
|
|
617
569
|
setError(null)
|
|
618
570
|
setProgress(null)
|
|
619
571
|
|
|
620
572
|
try {
|
|
621
|
-
const result = await
|
|
573
|
+
const result = await materializationClientRef.current.materialize(graphId, {
|
|
622
574
|
...options,
|
|
623
575
|
onProgress: (msg) => {
|
|
624
576
|
setProgress(msg)
|
|
@@ -645,9 +597,8 @@ export function useTableUpload(graphId: string) {
|
|
|
645
597
|
|
|
646
598
|
return {
|
|
647
599
|
upload,
|
|
648
|
-
uploadAndIngest,
|
|
649
600
|
listTables,
|
|
650
|
-
|
|
601
|
+
materialize,
|
|
651
602
|
loading,
|
|
652
603
|
error,
|
|
653
604
|
progress,
|
|
@@ -6,7 +6,9 @@ import { OperationClient } from './OperationClient';
|
|
|
6
6
|
import { QueryClient } from './QueryClient';
|
|
7
7
|
import { AgentClient } from './AgentClient';
|
|
8
8
|
import { SSEClient } from './SSEClient';
|
|
9
|
-
import {
|
|
9
|
+
import { FileClient } from './FileClient';
|
|
10
|
+
import { MaterializationClient } from './MaterializationClient';
|
|
11
|
+
import { TableClient } from './TableClient';
|
|
10
12
|
import { GraphClient } from './GraphClient';
|
|
11
13
|
export interface RoboSystemsExtensionConfig {
|
|
12
14
|
baseUrl?: string;
|
|
@@ -20,7 +22,9 @@ export declare class RoboSystemsExtensions {
|
|
|
20
22
|
readonly query: QueryClient;
|
|
21
23
|
readonly agent: AgentClient;
|
|
22
24
|
readonly operations: OperationClient;
|
|
23
|
-
readonly
|
|
25
|
+
readonly files: FileClient;
|
|
26
|
+
readonly materialization: MaterializationClient;
|
|
27
|
+
readonly tables: TableClient;
|
|
24
28
|
readonly graphs: GraphClient;
|
|
25
29
|
private config;
|
|
26
30
|
constructor(config?: RoboSystemsExtensionConfig);
|
|
@@ -41,15 +45,21 @@ export * from './OperationClient';
|
|
|
41
45
|
export * from './QueryClient';
|
|
42
46
|
export * from './AgentClient';
|
|
43
47
|
export * from './SSEClient';
|
|
44
|
-
export * from './
|
|
48
|
+
export * from './FileClient';
|
|
49
|
+
export * from './MaterializationClient';
|
|
45
50
|
export * from './GraphClient';
|
|
46
51
|
export * from './config';
|
|
47
|
-
export {
|
|
52
|
+
export type { TableInfo, TableQueryResult } from './TableClient';
|
|
53
|
+
export { TableClient } from './TableClient';
|
|
54
|
+
export { OperationClient, QueryClient, AgentClient, SSEClient, FileClient, MaterializationClient, GraphClient, };
|
|
48
55
|
export { useMultipleOperations, useOperation, useQuery, useSDKClients, useStreamingQuery, useTableUpload, } from './hooks';
|
|
49
56
|
export declare const extensions: {
|
|
50
57
|
readonly query: QueryClient;
|
|
51
58
|
readonly agent: AgentClient;
|
|
52
59
|
readonly operations: OperationClient;
|
|
60
|
+
readonly files: FileClient;
|
|
61
|
+
readonly materialization: MaterializationClient;
|
|
62
|
+
readonly tables: TableClient;
|
|
53
63
|
readonly graphs: GraphClient;
|
|
54
64
|
monitorOperation: (operationId: string, onProgress?: (progress: any) => void) => Promise<any>;
|
|
55
65
|
createSSEClient: () => SSEClient;
|
package/sdk-extensions/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.analyzeFinancials = exports.agentQuery = exports.streamQuery = exports.executeQuery = exports.monitorOperation = exports.extensions = exports.useTableUpload = exports.useStreamingQuery = exports.useSDKClients = exports.useQuery = exports.useOperation = exports.useMultipleOperations = exports.GraphClient = exports.
|
|
21
|
+
exports.analyzeFinancials = exports.agentQuery = exports.streamQuery = exports.executeQuery = exports.monitorOperation = exports.extensions = exports.useTableUpload = exports.useStreamingQuery = exports.useSDKClients = exports.useQuery = exports.useOperation = exports.useMultipleOperations = exports.GraphClient = exports.MaterializationClient = exports.FileClient = exports.SSEClient = exports.AgentClient = exports.QueryClient = exports.OperationClient = exports.TableClient = exports.RoboSystemsExtensions = void 0;
|
|
22
22
|
const client_gen_1 = require("../sdk/client.gen");
|
|
23
23
|
const config_1 = require("./config");
|
|
24
24
|
const OperationClient_1 = require("./OperationClient");
|
|
@@ -29,8 +29,11 @@ const AgentClient_1 = require("./AgentClient");
|
|
|
29
29
|
Object.defineProperty(exports, "AgentClient", { enumerable: true, get: function () { return AgentClient_1.AgentClient; } });
|
|
30
30
|
const SSEClient_1 = require("./SSEClient");
|
|
31
31
|
Object.defineProperty(exports, "SSEClient", { enumerable: true, get: function () { return SSEClient_1.SSEClient; } });
|
|
32
|
-
const
|
|
33
|
-
Object.defineProperty(exports, "
|
|
32
|
+
const FileClient_1 = require("./FileClient");
|
|
33
|
+
Object.defineProperty(exports, "FileClient", { enumerable: true, get: function () { return FileClient_1.FileClient; } });
|
|
34
|
+
const MaterializationClient_1 = require("./MaterializationClient");
|
|
35
|
+
Object.defineProperty(exports, "MaterializationClient", { enumerable: true, get: function () { return MaterializationClient_1.MaterializationClient; } });
|
|
36
|
+
const TableClient_1 = require("./TableClient");
|
|
34
37
|
const GraphClient_1 = require("./GraphClient");
|
|
35
38
|
Object.defineProperty(exports, "GraphClient", { enumerable: true, get: function () { return GraphClient_1.GraphClient; } });
|
|
36
39
|
class RoboSystemsExtensions {
|
|
@@ -66,7 +69,19 @@ class RoboSystemsExtensions {
|
|
|
66
69
|
maxRetries: this.config.maxRetries,
|
|
67
70
|
retryDelay: this.config.retryDelay,
|
|
68
71
|
});
|
|
69
|
-
this.
|
|
72
|
+
this.files = new FileClient_1.FileClient({
|
|
73
|
+
baseUrl: this.config.baseUrl,
|
|
74
|
+
credentials: this.config.credentials,
|
|
75
|
+
token: this.config.token,
|
|
76
|
+
headers: this.config.headers,
|
|
77
|
+
});
|
|
78
|
+
this.materialization = new MaterializationClient_1.MaterializationClient({
|
|
79
|
+
baseUrl: this.config.baseUrl,
|
|
80
|
+
credentials: this.config.credentials,
|
|
81
|
+
token: this.config.token,
|
|
82
|
+
headers: this.config.headers,
|
|
83
|
+
});
|
|
84
|
+
this.tables = new TableClient_1.TableClient({
|
|
70
85
|
baseUrl: this.config.baseUrl,
|
|
71
86
|
credentials: this.config.credentials,
|
|
72
87
|
token: this.config.token,
|
|
@@ -114,9 +129,12 @@ __exportStar(require("./OperationClient"), exports);
|
|
|
114
129
|
__exportStar(require("./QueryClient"), exports);
|
|
115
130
|
__exportStar(require("./AgentClient"), exports);
|
|
116
131
|
__exportStar(require("./SSEClient"), exports);
|
|
117
|
-
__exportStar(require("./
|
|
132
|
+
__exportStar(require("./FileClient"), exports);
|
|
133
|
+
__exportStar(require("./MaterializationClient"), exports);
|
|
118
134
|
__exportStar(require("./GraphClient"), exports);
|
|
119
135
|
__exportStar(require("./config"), exports);
|
|
136
|
+
var TableClient_2 = require("./TableClient");
|
|
137
|
+
Object.defineProperty(exports, "TableClient", { enumerable: true, get: function () { return TableClient_2.TableClient; } });
|
|
120
138
|
// Export React hooks
|
|
121
139
|
var hooks_1 = require("./hooks");
|
|
122
140
|
Object.defineProperty(exports, "useMultipleOperations", { enumerable: true, get: function () { return hooks_1.useMultipleOperations; } });
|
|
@@ -143,6 +161,15 @@ exports.extensions = {
|
|
|
143
161
|
get operations() {
|
|
144
162
|
return getExtensions().operations;
|
|
145
163
|
},
|
|
164
|
+
get files() {
|
|
165
|
+
return getExtensions().files;
|
|
166
|
+
},
|
|
167
|
+
get materialization() {
|
|
168
|
+
return getExtensions().materialization;
|
|
169
|
+
},
|
|
170
|
+
get tables() {
|
|
171
|
+
return getExtensions().tables;
|
|
172
|
+
},
|
|
146
173
|
get graphs() {
|
|
147
174
|
return getExtensions().graphs;
|
|
148
175
|
},
|
|
@@ -23,12 +23,16 @@ describe('RoboSystemsExtensions', () => {
|
|
|
23
23
|
expect(extensions).toBeDefined()
|
|
24
24
|
expect(extensions.query).toBeDefined()
|
|
25
25
|
expect(extensions.operations).toBeDefined()
|
|
26
|
+
expect(extensions.files).toBeDefined()
|
|
27
|
+
expect(extensions.materialization).toBeDefined()
|
|
26
28
|
expect(extensions.tables).toBeDefined()
|
|
27
29
|
expect(extensions.graphs).toBeDefined()
|
|
28
30
|
// Verify clients have expected methods
|
|
29
31
|
expect(typeof extensions.query.executeQuery).toBe('function')
|
|
30
32
|
expect(typeof extensions.operations.monitorOperation).toBe('function')
|
|
31
|
-
expect(typeof extensions.
|
|
33
|
+
expect(typeof extensions.files.upload).toBe('function')
|
|
34
|
+
expect(typeof extensions.materialization.materialize).toBe('function')
|
|
35
|
+
expect(typeof extensions.tables.list).toBe('function')
|
|
32
36
|
expect(typeof extensions.graphs.createGraphAndWait).toBe('function')
|
|
33
37
|
})
|
|
34
38
|
|
|
@@ -193,11 +197,15 @@ describe('RoboSystemsExtensions', () => {
|
|
|
193
197
|
|
|
194
198
|
expect(extensions.query).toBeDefined()
|
|
195
199
|
expect(extensions.operations).toBeDefined()
|
|
200
|
+
expect(extensions.files).toBeDefined()
|
|
201
|
+
expect(extensions.materialization).toBeDefined()
|
|
196
202
|
expect(extensions.tables).toBeDefined()
|
|
197
203
|
expect(extensions.graphs).toBeDefined()
|
|
198
204
|
expect(typeof extensions.query.executeQuery).toBe('function')
|
|
199
205
|
expect(typeof extensions.operations.monitorOperation).toBe('function')
|
|
200
|
-
expect(typeof extensions.
|
|
206
|
+
expect(typeof extensions.files.upload).toBe('function')
|
|
207
|
+
expect(typeof extensions.materialization.materialize).toBe('function')
|
|
208
|
+
expect(typeof extensions.tables.list).toBe('function')
|
|
201
209
|
expect(typeof extensions.graphs.createGraphAndWait).toBe('function')
|
|
202
210
|
})
|
|
203
211
|
|
package/sdk-extensions/index.ts
CHANGED
|
@@ -9,7 +9,9 @@ import { OperationClient } from './OperationClient'
|
|
|
9
9
|
import { QueryClient } from './QueryClient'
|
|
10
10
|
import { AgentClient } from './AgentClient'
|
|
11
11
|
import { SSEClient } from './SSEClient'
|
|
12
|
-
import {
|
|
12
|
+
import { FileClient } from './FileClient'
|
|
13
|
+
import { MaterializationClient } from './MaterializationClient'
|
|
14
|
+
import { TableClient } from './TableClient'
|
|
13
15
|
import { GraphClient } from './GraphClient'
|
|
14
16
|
|
|
15
17
|
export interface RoboSystemsExtensionConfig {
|
|
@@ -35,7 +37,9 @@ export class RoboSystemsExtensions {
|
|
|
35
37
|
public readonly query: QueryClient
|
|
36
38
|
public readonly agent: AgentClient
|
|
37
39
|
public readonly operations: OperationClient
|
|
38
|
-
public readonly
|
|
40
|
+
public readonly files: FileClient
|
|
41
|
+
public readonly materialization: MaterializationClient
|
|
42
|
+
public readonly tables: TableClient
|
|
39
43
|
public readonly graphs: GraphClient
|
|
40
44
|
private config: ResolvedConfig
|
|
41
45
|
|
|
@@ -77,7 +81,21 @@ export class RoboSystemsExtensions {
|
|
|
77
81
|
retryDelay: this.config.retryDelay,
|
|
78
82
|
})
|
|
79
83
|
|
|
80
|
-
this.
|
|
84
|
+
this.files = new FileClient({
|
|
85
|
+
baseUrl: this.config.baseUrl,
|
|
86
|
+
credentials: this.config.credentials,
|
|
87
|
+
token: this.config.token,
|
|
88
|
+
headers: this.config.headers,
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
this.materialization = new MaterializationClient({
|
|
92
|
+
baseUrl: this.config.baseUrl,
|
|
93
|
+
credentials: this.config.credentials,
|
|
94
|
+
token: this.config.token,
|
|
95
|
+
headers: this.config.headers,
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
this.tables = new TableClient({
|
|
81
99
|
baseUrl: this.config.baseUrl,
|
|
82
100
|
credentials: this.config.credentials,
|
|
83
101
|
token: this.config.token,
|
|
@@ -129,10 +147,24 @@ export * from './OperationClient'
|
|
|
129
147
|
export * from './QueryClient'
|
|
130
148
|
export * from './AgentClient'
|
|
131
149
|
export * from './SSEClient'
|
|
132
|
-
export * from './
|
|
150
|
+
export * from './FileClient'
|
|
151
|
+
export * from './MaterializationClient'
|
|
133
152
|
export * from './GraphClient'
|
|
134
153
|
export * from './config'
|
|
135
|
-
|
|
154
|
+
|
|
155
|
+
// Export TableClient types individually to avoid conflicts with QueryClient's QueryResult
|
|
156
|
+
export type { TableInfo, TableQueryResult } from './TableClient'
|
|
157
|
+
export { TableClient } from './TableClient'
|
|
158
|
+
|
|
159
|
+
export {
|
|
160
|
+
OperationClient,
|
|
161
|
+
QueryClient,
|
|
162
|
+
AgentClient,
|
|
163
|
+
SSEClient,
|
|
164
|
+
FileClient,
|
|
165
|
+
MaterializationClient,
|
|
166
|
+
GraphClient,
|
|
167
|
+
}
|
|
136
168
|
|
|
137
169
|
// Export React hooks
|
|
138
170
|
export {
|
|
@@ -164,6 +196,15 @@ export const extensions = {
|
|
|
164
196
|
get operations() {
|
|
165
197
|
return getExtensions().operations
|
|
166
198
|
},
|
|
199
|
+
get files() {
|
|
200
|
+
return getExtensions().files
|
|
201
|
+
},
|
|
202
|
+
get materialization() {
|
|
203
|
+
return getExtensions().materialization
|
|
204
|
+
},
|
|
205
|
+
get tables() {
|
|
206
|
+
return getExtensions().tables
|
|
207
|
+
},
|
|
167
208
|
get graphs() {
|
|
168
209
|
return getExtensions().graphs
|
|
169
210
|
},
|
package/sdk.gen.d.ts
CHANGED
|
@@ -550,7 +550,7 @@ export declare const recommendAgent: <ThrowOnError extends boolean = false>(opti
|
|
|
550
550
|
* The tool list is customized based on:
|
|
551
551
|
* - Graph type (shared repository vs user graph)
|
|
552
552
|
* - User permissions and subscription tier
|
|
553
|
-
* - Backend capabilities (
|
|
553
|
+
* - Backend capabilities (LadybugDB, Neo4j, etc.)
|
|
554
554
|
*
|
|
555
555
|
* **Subgraph Support:**
|
|
556
556
|
* This endpoint accepts both parent graph IDs and subgraph IDs.
|
|
@@ -620,8 +620,8 @@ export declare const listBackups: <ThrowOnError extends boolean = false>(options
|
|
|
620
620
|
* Create Backup
|
|
621
621
|
* Create a backup of the graph database.
|
|
622
622
|
*
|
|
623
|
-
* Creates a complete backup of the graph database (.
|
|
624
|
-
* - **Format**: Full database backup only (complete .
|
|
623
|
+
* Creates a complete backup of the graph database (.lbug file) with:
|
|
624
|
+
* - **Format**: Full database backup only (complete .lbug file)
|
|
625
625
|
* - **Compression**: Always enabled for optimal storage
|
|
626
626
|
* - **Encryption**: Optional AES-256 encryption for security
|
|
627
627
|
* - **Retention**: Configurable retention period (1-2555 days)
|
|
@@ -682,7 +682,7 @@ export declare const listBackups: <ThrowOnError extends boolean = false>(options
|
|
|
682
682
|
export declare const createBackup: <ThrowOnError extends boolean = false>(options: Options<CreateBackupData, ThrowOnError>) => import("./client").RequestResult<CreateBackupResponses, CreateBackupErrors, ThrowOnError, "fields">;
|
|
683
683
|
/**
|
|
684
684
|
* Get temporary download URL for backup
|
|
685
|
-
* Generate a temporary download URL for a backup (unencrypted, compressed .
|
|
685
|
+
* Generate a temporary download URL for a backup (unencrypted, compressed .lbug files only)
|
|
686
686
|
*/
|
|
687
687
|
export declare const getBackupDownloadUrl: <ThrowOnError extends boolean = false>(options: Options<GetBackupDownloadUrlData, ThrowOnError>) => import("./client").RequestResult<GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, ThrowOnError, "fields">;
|
|
688
688
|
/**
|
|
@@ -1163,7 +1163,7 @@ export declare const getDatabaseInfo: <ThrowOnError extends boolean = false>(opt
|
|
|
1163
1163
|
*
|
|
1164
1164
|
* This unified endpoint provides all limits in one place for easier client integration.
|
|
1165
1165
|
*
|
|
1166
|
-
* **Note**: Limits vary based on subscription tier (
|
|
1166
|
+
* **Note**: Limits vary based on subscription tier (ladybug-standard, ladybug-large, ladybug-xlarge).
|
|
1167
1167
|
*/
|
|
1168
1168
|
export declare const getGraphLimits: <ThrowOnError extends boolean = false>(options: Options<GetGraphLimitsData, ThrowOnError>) => import("./client").RequestResult<GetGraphLimitsResponses, GetGraphLimitsErrors, ThrowOnError, "fields">;
|
|
1169
1169
|
/**
|
|
@@ -1188,7 +1188,7 @@ export declare const listSubgraphs: <ThrowOnError extends boolean = false>(optio
|
|
|
1188
1188
|
* - Valid authentication
|
|
1189
1189
|
* - Parent graph must exist and be accessible to the user
|
|
1190
1190
|
* - User must have 'admin' permission on the parent graph
|
|
1191
|
-
* - Parent graph tier must support subgraphs (
|
|
1191
|
+
* - Parent graph tier must support subgraphs (LadybugDB Large/XLarge or Neo4j Enterprise XLarge)
|
|
1192
1192
|
* - Must be within subgraph quota limits
|
|
1193
1193
|
* - Subgraph name must be unique within the parent graph
|
|
1194
1194
|
*
|
|
@@ -1230,8 +1230,8 @@ export declare const createSubgraph: <ThrowOnError extends boolean = false>(opti
|
|
|
1230
1230
|
* All data in the subgraph will be lost.
|
|
1231
1231
|
*
|
|
1232
1232
|
* **Backup Location:**
|
|
1233
|
-
* If backup requested, stored in S3
|
|
1234
|
-
* `s3://{
|
|
1233
|
+
* If backup requested, stored in S3 graph database bucket at:
|
|
1234
|
+
* `s3://{graph_s3_bucket}/{instance_id}/{database_name}_{timestamp}.backup`
|
|
1235
1235
|
*
|
|
1236
1236
|
* **Notes:**
|
|
1237
1237
|
* - Use the subgraph name (e.g., 'dev', 'staging') not the full subgraph ID
|
|
@@ -1256,7 +1256,7 @@ export declare const deleteSubgraph: <ThrowOnError extends boolean = false>(opti
|
|
|
1256
1256
|
* - Last access time (when available)
|
|
1257
1257
|
*
|
|
1258
1258
|
* **Statistics:**
|
|
1259
|
-
* Real-time statistics queried from
|
|
1259
|
+
* Real-time statistics queried from LadybugDB:
|
|
1260
1260
|
* - Node count
|
|
1261
1261
|
* - Edge count
|
|
1262
1262
|
* - Database size on disk
|
|
@@ -1797,7 +1797,7 @@ export declare const getGraphs: <ThrowOnError extends boolean = false>(options?:
|
|
|
1797
1797
|
*
|
|
1798
1798
|
* **Required Fields:**
|
|
1799
1799
|
* - `metadata.graph_name`: Unique name for the graph
|
|
1800
|
-
* - `instance_tier`: Resource tier (
|
|
1800
|
+
* - `instance_tier`: Resource tier (ladybug-standard, ladybug-large, ladybug-xlarge)
|
|
1801
1801
|
*
|
|
1802
1802
|
* **Optional Fields:**
|
|
1803
1803
|
* - `metadata.description`: Human-readable description of the graph's purpose
|
|
@@ -1886,9 +1886,9 @@ export declare const getAvailableExtensions: <ThrowOnError extends boolean = fal
|
|
|
1886
1886
|
* - Availability status
|
|
1887
1887
|
*
|
|
1888
1888
|
* **Available Tiers:**
|
|
1889
|
-
* - **
|
|
1890
|
-
* - **
|
|
1891
|
-
* - **
|
|
1889
|
+
* - **ladybug-standard**: Multi-tenant entry-level tier
|
|
1890
|
+
* - **ladybug-large**: Dedicated professional tier with subgraph support
|
|
1891
|
+
* - **ladybug-xlarge**: Enterprise tier with maximum resources
|
|
1892
1892
|
* - **neo4j-community-large**: Neo4j Community Edition (optional, if enabled)
|
|
1893
1893
|
* - **neo4j-enterprise-xlarge**: Neo4j Enterprise Edition (optional, if enabled)
|
|
1894
1894
|
*
|
|
@@ -1950,7 +1950,7 @@ export declare const selectGraph: <ThrowOnError extends boolean = false>(options
|
|
|
1950
1950
|
* - Credits are allocated per-graph, not shared across organization
|
|
1951
1951
|
*
|
|
1952
1952
|
* Includes:
|
|
1953
|
-
* - Graph infrastructure tiers (
|
|
1953
|
+
* - Graph infrastructure tiers (ladybug-standard, ladybug-large, ladybug-xlarge) - per-graph pricing
|
|
1954
1954
|
* - Shared repository subscriptions (SEC, industry, economic data) - org-level
|
|
1955
1955
|
* - Operation costs and credit information
|
|
1956
1956
|
* - Features and capabilities for each tier
|