@robosystems/client 0.1.11 → 0.1.12
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/client/client.gen.d.ts +2 -0
- package/client/client.gen.js +153 -0
- package/client/index.d.ts +7 -0
- package/client/index.js +15 -0
- package/client/types.gen.d.ts +122 -0
- package/client/types.gen.js +4 -0
- package/client/utils.gen.d.ts +45 -0
- package/client/utils.gen.js +296 -0
- package/client.gen.d.ts +12 -0
- package/client.gen.js +8 -0
- package/core/auth.gen.d.ts +18 -0
- package/core/auth.gen.js +18 -0
- package/core/bodySerializer.gen.d.ts +17 -0
- package/core/bodySerializer.gen.js +57 -0
- package/core/params.gen.d.ts +33 -0
- package/core/params.gen.js +92 -0
- package/core/pathSerializer.gen.d.ts +33 -0
- package/core/pathSerializer.gen.js +123 -0
- package/core/types.gen.d.ts +78 -0
- package/core/types.gen.js +4 -0
- package/extensions/OperationClient.d.js +45 -0
- package/extensions/OperationClient.d.ts +64 -0
- package/extensions/QueryClient.d.js +22 -0
- package/extensions/QueryClient.d.ts +50 -0
- package/extensions/SSEClient.d.js +35 -0
- package/extensions/SSEClient.d.ts +48 -0
- package/extensions/config.d.js +25 -0
- package/extensions/config.d.ts +32 -0
- package/extensions/hooks.d.js +80 -0
- package/extensions/hooks.d.ts +110 -0
- package/extensions/hooks.js +4 -4
- package/extensions/hooks.ts +4 -4
- package/extensions/index.d.js +35 -0
- package/extensions/index.d.ts +46 -0
- package/package.json +2 -2
- package/prepare.js +10 -0
- package/sdk.gen.d.ts +1145 -0
- package/sdk.gen.js +2436 -0
- package/types.gen.d.ts +5712 -0
- package/types.gen.js +3 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core SSE (Server-Sent Events) client for RoboSystems API
|
|
3
|
+
* Provides automatic reconnection, event replay, and type-safe event handling
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export declare enum EventType {
|
|
8
|
+
OPERATION_STARTED = "operation_started",
|
|
9
|
+
OPERATION_PROGRESS = "operation_progress",
|
|
10
|
+
OPERATION_COMPLETED = "operation_completed",
|
|
11
|
+
OPERATION_ERROR = "operation_error",
|
|
12
|
+
OPERATION_CANCELLED = "operation_cancelled",
|
|
13
|
+
DATA_CHUNK = "data_chunk",
|
|
14
|
+
METADATA = "metadata",
|
|
15
|
+
HEARTBEAT = "heartbeat",
|
|
16
|
+
QUEUE_UPDATE = "queue_update"
|
|
17
|
+
}
|
|
18
|
+
export declare class SSEClient {
|
|
19
|
+
private config;
|
|
20
|
+
private eventSource?;
|
|
21
|
+
private reconnectAttempts;
|
|
22
|
+
private lastEventId?;
|
|
23
|
+
private closed;
|
|
24
|
+
private listeners;
|
|
25
|
+
constructor(config);
|
|
26
|
+
connect(operationId, fromSequence?);
|
|
27
|
+
private handleMessage;
|
|
28
|
+
private handleTypedEvent;
|
|
29
|
+
private handleError;
|
|
30
|
+
on(event, listener);
|
|
31
|
+
off(event, listener);
|
|
32
|
+
private emit;
|
|
33
|
+
close();
|
|
34
|
+
isConnected();
|
|
35
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core SSE (Server-Sent Events) client for RoboSystems API
|
|
3
|
+
* Provides automatic reconnection, event replay, and type-safe event handling
|
|
4
|
+
*/
|
|
5
|
+
export interface SSEConfig {
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
credentials?: 'include' | 'same-origin' | 'omit';
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
maxRetries?: number;
|
|
10
|
+
retryDelay?: number;
|
|
11
|
+
heartbeatInterval?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface SSEEvent {
|
|
14
|
+
event: string;
|
|
15
|
+
data: any;
|
|
16
|
+
id?: string;
|
|
17
|
+
retry?: number;
|
|
18
|
+
timestamp: Date;
|
|
19
|
+
}
|
|
20
|
+
export declare enum EventType {
|
|
21
|
+
OPERATION_STARTED = "operation_started",
|
|
22
|
+
OPERATION_PROGRESS = "operation_progress",
|
|
23
|
+
OPERATION_COMPLETED = "operation_completed",
|
|
24
|
+
OPERATION_ERROR = "operation_error",
|
|
25
|
+
OPERATION_CANCELLED = "operation_cancelled",
|
|
26
|
+
DATA_CHUNK = "data_chunk",
|
|
27
|
+
METADATA = "metadata",
|
|
28
|
+
HEARTBEAT = "heartbeat",
|
|
29
|
+
QUEUE_UPDATE = "queue_update"
|
|
30
|
+
}
|
|
31
|
+
export declare class SSEClient {
|
|
32
|
+
private config;
|
|
33
|
+
private eventSource?;
|
|
34
|
+
private reconnectAttempts;
|
|
35
|
+
private lastEventId?;
|
|
36
|
+
private closed;
|
|
37
|
+
private listeners;
|
|
38
|
+
constructor(config: SSEConfig);
|
|
39
|
+
connect(operationId: string, fromSequence?: number): Promise<void>;
|
|
40
|
+
private handleMessage;
|
|
41
|
+
private handleTypedEvent;
|
|
42
|
+
private handleError;
|
|
43
|
+
on(event: string, listener: (data: any) => void): void;
|
|
44
|
+
off(event: string, listener: (data: any) => void): void;
|
|
45
|
+
private emit;
|
|
46
|
+
close(): void;
|
|
47
|
+
isConnected(): boolean;
|
|
48
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for SDK extensions
|
|
3
|
+
* Provides centralized configuration for CORS, credentials, and other settings
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Set global configuration for SDK extensions
|
|
8
|
+
* @param config Partial configuration to merge with defaults
|
|
9
|
+
*/
|
|
10
|
+
export declare function setSDKExtensionsConfig(config);
|
|
11
|
+
/**
|
|
12
|
+
* Get current SDK extensions configuration
|
|
13
|
+
* @returns Current configuration
|
|
14
|
+
*/
|
|
15
|
+
export declare function getSDKExtensionsConfig();
|
|
16
|
+
/**
|
|
17
|
+
* Reset configuration to defaults
|
|
18
|
+
*/
|
|
19
|
+
export declare function resetSDKExtensionsConfig();
|
|
20
|
+
/**
|
|
21
|
+
* Get configuration for a specific environment
|
|
22
|
+
* @param env Environment name (production, staging, development)
|
|
23
|
+
* @returns Environment-specific configuration
|
|
24
|
+
*/
|
|
25
|
+
export declare function getEnvironmentConfig(env? | 'staging' | 'development');
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for SDK extensions
|
|
3
|
+
* Provides centralized configuration for CORS, credentials, and other settings
|
|
4
|
+
*/
|
|
5
|
+
export interface SDKExtensionsConfig {
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
credentials?: 'include' | 'same-origin' | 'omit';
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
maxRetries?: number;
|
|
11
|
+
retryDelay?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Set global configuration for SDK extensions
|
|
15
|
+
* @param config Partial configuration to merge with defaults
|
|
16
|
+
*/
|
|
17
|
+
export declare function setSDKExtensionsConfig(config: Partial<SDKExtensionsConfig>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get current SDK extensions configuration
|
|
20
|
+
* @returns Current configuration
|
|
21
|
+
*/
|
|
22
|
+
export declare function getSDKExtensionsConfig(): SDKExtensionsConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Reset configuration to defaults
|
|
25
|
+
*/
|
|
26
|
+
export declare function resetSDKExtensionsConfig(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Get configuration for a specific environment
|
|
29
|
+
* @param env Environment name (production, staging, development)
|
|
30
|
+
* @returns Environment-specific configuration
|
|
31
|
+
*/
|
|
32
|
+
export declare function getEnvironmentConfig(env?: 'production' | 'staging' | 'development'): SDKExtensionsConfig;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { OperationProgress, OperationResult } from './OperationClient';
|
|
2
|
+
import { OperationClient } from './OperationClient';
|
|
3
|
+
import { QueryOptions, QueryResult } from './QueryClient';
|
|
4
|
+
import { QueryClient } from './QueryClient';
|
|
5
|
+
/**
|
|
6
|
+
* Hook for executing Cypher queries with loading states and error handling
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const { execute, loading, error, data } = useQuery('graph_123')
|
|
11
|
+
*
|
|
12
|
+
* const handleSearch = async () => {
|
|
13
|
+
* const result = await execute('MATCH (n:Company) RETURN n LIMIT 10')
|
|
14
|
+
* console.log(result.data)
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useQuery(graphId);
|
|
19
|
+
/**
|
|
20
|
+
* Hook for streaming large query results
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { stream, isStreaming, error, cancel } = useStreamingQuery('graph_123')
|
|
25
|
+
*
|
|
26
|
+
* const handleStream = async () => {
|
|
27
|
+
* const iterator = stream('MATCH (n) RETURN n')
|
|
28
|
+
* for await (const batch of iterator) {
|
|
29
|
+
* console.log('Received batch:', batch)
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function useStreamingQuery(graphId);
|
|
35
|
+
/**
|
|
36
|
+
* Hook for monitoring long-running operations
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* const { monitor, status, progress, error, result } = useOperation()
|
|
41
|
+
*
|
|
42
|
+
* const handleBackup = async () => {
|
|
43
|
+
* const { operation_id } = await createBackup({ ... })
|
|
44
|
+
* const result = await monitor(operation_id)
|
|
45
|
+
* console.log('Backup completed:', result)
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function useOperation(operationId?);
|
|
50
|
+
/**
|
|
51
|
+
* Hook for monitoring multiple operations concurrently
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* const { monitorAll, results, allCompleted, hasErrors } = useMultipleOperations()
|
|
56
|
+
*
|
|
57
|
+
* const handleMultiple = async () => {
|
|
58
|
+
* const operations = await Promise.all([
|
|
59
|
+
* createBackup(...),
|
|
60
|
+
* createExport(...),
|
|
61
|
+
* ])
|
|
62
|
+
*
|
|
63
|
+
* const results = await monitorAll(operations.map(op => op.operation_id))
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function useMultipleOperations();
|
|
68
|
+
/**
|
|
69
|
+
* Hook that provides access to all SDK extension clients
|
|
70
|
+
* Useful when you need direct access to the underlying clients
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* const clients = useSDKClients()
|
|
75
|
+
*
|
|
76
|
+
* // Direct access to clients
|
|
77
|
+
* const result = await clients.query.query('graph_123', 'MATCH (n) RETURN n')
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function useSDKClients();
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { OperationProgress, OperationResult } from './OperationClient';
|
|
2
|
+
import { OperationClient } from './OperationClient';
|
|
3
|
+
import type { QueryOptions, QueryResult } from './QueryClient';
|
|
4
|
+
import { QueryClient } from './QueryClient';
|
|
5
|
+
/**
|
|
6
|
+
* Hook for executing Cypher queries with loading states and error handling
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const { execute, loading, error, data } = useQuery('graph_123')
|
|
11
|
+
*
|
|
12
|
+
* const handleSearch = async () => {
|
|
13
|
+
* const result = await execute('MATCH (n:Company) RETURN n LIMIT 10')
|
|
14
|
+
* console.log(result.data)
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useQuery(graphId: string): {
|
|
19
|
+
execute: (query: string, parameters?: Record<string, any>, options?: QueryOptions) => Promise<QueryResult | null>;
|
|
20
|
+
query: (cypher: string, parameters?: Record<string, any>) => Promise<any[]>;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
error: Error;
|
|
23
|
+
data: QueryResult;
|
|
24
|
+
queuePosition: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Hook for streaming large query results
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* const { stream, isStreaming, error, cancel } = useStreamingQuery('graph_123')
|
|
32
|
+
*
|
|
33
|
+
* const handleStream = async () => {
|
|
34
|
+
* const iterator = stream('MATCH (n) RETURN n')
|
|
35
|
+
* for await (const batch of iterator) {
|
|
36
|
+
* console.log('Received batch:', batch)
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useStreamingQuery(graphId: string): {
|
|
42
|
+
stream: (query: string, parameters?: Record<string, any>, chunkSize?: number) => AsyncIterableIterator<any[]>;
|
|
43
|
+
isStreaming: boolean;
|
|
44
|
+
error: Error;
|
|
45
|
+
rowsReceived: number;
|
|
46
|
+
cancel: () => void;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Hook for monitoring long-running operations
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* const { monitor, status, progress, error, result } = useOperation<BackupResult>()
|
|
54
|
+
*
|
|
55
|
+
* const handleBackup = async () => {
|
|
56
|
+
* const { operation_id } = await createBackup({ ... })
|
|
57
|
+
* const result = await monitor(operation_id)
|
|
58
|
+
* console.log('Backup completed:', result)
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function useOperation<T = any>(operationId?: string): {
|
|
63
|
+
monitor: (id: string, timeout?: number) => Promise<OperationResult<T> | null>;
|
|
64
|
+
cancel: (id: string) => Promise<void>;
|
|
65
|
+
status: "error" | "idle" | "running" | "completed";
|
|
66
|
+
progress: OperationProgress;
|
|
67
|
+
error: Error;
|
|
68
|
+
result: OperationResult<T>;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Hook for monitoring multiple operations concurrently
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* const { monitorAll, results, allCompleted, hasErrors } = useMultipleOperations()
|
|
76
|
+
*
|
|
77
|
+
* const handleMultiple = async () => {
|
|
78
|
+
* const operations = await Promise.all([
|
|
79
|
+
* createBackup(...),
|
|
80
|
+
* createExport(...),
|
|
81
|
+
* ])
|
|
82
|
+
*
|
|
83
|
+
* const results = await monitorAll(operations.map(op => op.operation_id))
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function useMultipleOperations<T = any>(): {
|
|
88
|
+
monitorAll: (operationIds: string[]) => Promise<Map<string, OperationResult<T>>>;
|
|
89
|
+
results: Map<string, OperationResult<T>>;
|
|
90
|
+
errors: Map<string, Error>;
|
|
91
|
+
loading: boolean;
|
|
92
|
+
allCompleted: boolean;
|
|
93
|
+
hasErrors: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Hook that provides access to all SDK extension clients
|
|
97
|
+
* Useful when you need direct access to the underlying clients
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* const clients = useSDKClients()
|
|
102
|
+
*
|
|
103
|
+
* // Direct access to clients
|
|
104
|
+
* const result = await clients.query.query('graph_123', 'MATCH (n) RETURN n')
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
export declare function useSDKClients(): {
|
|
108
|
+
query: QueryClient | null;
|
|
109
|
+
operations: OperationClient | null;
|
|
110
|
+
};
|
package/extensions/hooks.js
CHANGED
|
@@ -31,7 +31,7 @@ export function useQuery(graphId) {
|
|
|
31
31
|
const [error, setError] = useState(null)
|
|
32
32
|
const [data, setData] = useState(null)
|
|
33
33
|
const [queuePosition, setQueuePosition] = useState(null)
|
|
34
|
-
const clientRef = useRef()
|
|
34
|
+
const clientRef = useRef(null)
|
|
35
35
|
|
|
36
36
|
// Initialize client
|
|
37
37
|
useEffect(() => {
|
|
@@ -128,7 +128,7 @@ export function useStreamingQuery(graphId) {
|
|
|
128
128
|
const [isStreaming, setIsStreaming] = useState(false)
|
|
129
129
|
const [error, setError] = useState(null)
|
|
130
130
|
const [rowsReceived, setRowsReceived] = useState(0)
|
|
131
|
-
const clientRef = useRef()
|
|
131
|
+
const clientRef = useRef(null)
|
|
132
132
|
|
|
133
133
|
useEffect(() => {
|
|
134
134
|
const sdkConfig = getSDKExtensionsConfig()
|
|
@@ -221,7 +221,7 @@ export function useOperation(operationId?) {
|
|
|
221
221
|
const [progress, setProgress] = useState(null)
|
|
222
222
|
const [error, setError] = useState(null)
|
|
223
223
|
const [result, setResult] = useState | null>(null)
|
|
224
|
-
const clientRef = useRef()
|
|
224
|
+
const clientRef = useRef(null)
|
|
225
225
|
|
|
226
226
|
useEffect(() => {
|
|
227
227
|
const sdkConfig = getSDKExtensionsConfig()
|
|
@@ -329,7 +329,7 @@ export function useMultipleOperations() {
|
|
|
329
329
|
const [results, setResults] = useState>>(new Map())
|
|
330
330
|
const [loading, setLoading] = useState(false)
|
|
331
331
|
const [errors, setErrors] = useState>(new Map())
|
|
332
|
-
const clientRef = useRef()
|
|
332
|
+
const clientRef = useRef(null)
|
|
333
333
|
|
|
334
334
|
useEffect(() => {
|
|
335
335
|
const sdkConfig = getSDKExtensionsConfig()
|
package/extensions/hooks.ts
CHANGED
|
@@ -31,7 +31,7 @@ export function useQuery(graphId: string) {
|
|
|
31
31
|
const [error, setError] = useState<Error | null>(null)
|
|
32
32
|
const [data, setData] = useState<QueryResult | null>(null)
|
|
33
33
|
const [queuePosition, setQueuePosition] = useState<number | null>(null)
|
|
34
|
-
const clientRef = useRef<QueryClient>()
|
|
34
|
+
const clientRef = useRef<QueryClient>(null)
|
|
35
35
|
|
|
36
36
|
// Initialize client
|
|
37
37
|
useEffect(() => {
|
|
@@ -128,7 +128,7 @@ export function useStreamingQuery(graphId: string) {
|
|
|
128
128
|
const [isStreaming, setIsStreaming] = useState(false)
|
|
129
129
|
const [error, setError] = useState<Error | null>(null)
|
|
130
130
|
const [rowsReceived, setRowsReceived] = useState(0)
|
|
131
|
-
const clientRef = useRef<QueryClient>()
|
|
131
|
+
const clientRef = useRef<QueryClient>(null)
|
|
132
132
|
|
|
133
133
|
useEffect(() => {
|
|
134
134
|
const sdkConfig = getSDKExtensionsConfig()
|
|
@@ -221,7 +221,7 @@ export function useOperation<T = any>(operationId?: string) {
|
|
|
221
221
|
const [progress, setProgress] = useState<OperationProgress | null>(null)
|
|
222
222
|
const [error, setError] = useState<Error | null>(null)
|
|
223
223
|
const [result, setResult] = useState<OperationResult<T> | null>(null)
|
|
224
|
-
const clientRef = useRef<OperationClient>()
|
|
224
|
+
const clientRef = useRef<OperationClient>(null)
|
|
225
225
|
|
|
226
226
|
useEffect(() => {
|
|
227
227
|
const sdkConfig = getSDKExtensionsConfig()
|
|
@@ -329,7 +329,7 @@ export function useMultipleOperations<T = any>() {
|
|
|
329
329
|
const [results, setResults] = useState<Map<string, OperationResult<T>>>(new Map())
|
|
330
330
|
const [loading, setLoading] = useState(false)
|
|
331
331
|
const [errors, setErrors] = useState<Map<string, Error>>(new Map())
|
|
332
|
-
const clientRef = useRef<OperationClient>()
|
|
332
|
+
const clientRef = useRef<OperationClient>(null)
|
|
333
333
|
|
|
334
334
|
useEffect(() => {
|
|
335
335
|
const sdkConfig = getSDKExtensionsConfig()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RoboSystems SDK Extensions
|
|
3
|
+
* Enhanced clients with SSE support for the RoboSystems API
|
|
4
|
+
*/
|
|
5
|
+
import { OperationClient } from './OperationClient';
|
|
6
|
+
import { QueryClient } from './QueryClient';
|
|
7
|
+
import { SSEClient } from './SSEClient';
|
|
8
|
+
|
|
9
|
+
export declare class RoboSystemsExtensions {
|
|
10
|
+
readonly query;
|
|
11
|
+
readonly operations;
|
|
12
|
+
private config;
|
|
13
|
+
constructor(config?);
|
|
14
|
+
/**
|
|
15
|
+
* Convenience method to monitor any operation
|
|
16
|
+
*/
|
|
17
|
+
monitorOperation(operationId, onProgress?);
|
|
18
|
+
/**
|
|
19
|
+
* Create custom SSE client for advanced use cases
|
|
20
|
+
*/
|
|
21
|
+
createSSEClient();
|
|
22
|
+
/**
|
|
23
|
+
* Clean up all active connections
|
|
24
|
+
*/
|
|
25
|
+
close();
|
|
26
|
+
}
|
|
27
|
+
export * from './OperationClient';
|
|
28
|
+
export * from './QueryClient';
|
|
29
|
+
export * from './SSEClient';
|
|
30
|
+
export { OperationClient, QueryClient, SSEClient };
|
|
31
|
+
export { useMultipleOperations, useOperation, useQuery, useSDKClients, useStreamingQuery, } from './hooks';
|
|
32
|
+
export declare const extensions;
|
|
33
|
+
export declare const monitorOperation) => Promise;
|
|
34
|
+
export declare const executeQuery;
|
|
35
|
+
export declare const streamQuery;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RoboSystems SDK Extensions
|
|
3
|
+
* Enhanced clients with SSE support for the RoboSystems API
|
|
4
|
+
*/
|
|
5
|
+
import { OperationClient } from './OperationClient';
|
|
6
|
+
import { QueryClient } from './QueryClient';
|
|
7
|
+
import { SSEClient } from './SSEClient';
|
|
8
|
+
export interface RoboSystemsExtensionConfig {
|
|
9
|
+
baseUrl?: string;
|
|
10
|
+
credentials?: 'include' | 'same-origin' | 'omit';
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
retryDelay?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class RoboSystemsExtensions {
|
|
15
|
+
readonly query: QueryClient;
|
|
16
|
+
readonly operations: OperationClient;
|
|
17
|
+
private config;
|
|
18
|
+
constructor(config?: RoboSystemsExtensionConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Convenience method to monitor any operation
|
|
21
|
+
*/
|
|
22
|
+
monitorOperation(operationId: string, onProgress?: (progress: any) => void): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Create custom SSE client for advanced use cases
|
|
25
|
+
*/
|
|
26
|
+
createSSEClient(): SSEClient;
|
|
27
|
+
/**
|
|
28
|
+
* Clean up all active connections
|
|
29
|
+
*/
|
|
30
|
+
close(): void;
|
|
31
|
+
}
|
|
32
|
+
export * from './OperationClient';
|
|
33
|
+
export * from './QueryClient';
|
|
34
|
+
export * from './SSEClient';
|
|
35
|
+
export { OperationClient, QueryClient, SSEClient };
|
|
36
|
+
export { useMultipleOperations, useOperation, useQuery, useSDKClients, useStreamingQuery, } from './hooks';
|
|
37
|
+
export declare const extensions: {
|
|
38
|
+
readonly query: QueryClient;
|
|
39
|
+
readonly operations: OperationClient;
|
|
40
|
+
monitorOperation: (operationId: string, onProgress?: (progress: any) => void) => Promise<any>;
|
|
41
|
+
createSSEClient: () => SSEClient;
|
|
42
|
+
close: () => void;
|
|
43
|
+
};
|
|
44
|
+
export declare const monitorOperation: (operationId: string, onProgress?: (progress: any) => void) => Promise<any>;
|
|
45
|
+
export declare const executeQuery: (graphId: string, query: string, parameters?: Record<string, any>) => Promise<import("./QueryClient").QueryResult>;
|
|
46
|
+
export declare const streamQuery: (graphId: string, query: string, parameters?: Record<string, any>, chunkSize?: number) => AsyncIterableIterator<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robosystems/client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "TypeScript client library for RoboSystems Financial Knowledge Graph API",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"url": "https://github.com/RoboFinSystems/robosystems-typescript-client/issues"
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/RoboFinSystems/robosystems-typescript-client#readme",
|
|
55
|
-
"dependencies": {},
|
|
56
55
|
"engines": {
|
|
57
56
|
"node": ">=18.0.0"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
59
|
"@hey-api/openapi-ts": "^0.80.2",
|
|
61
60
|
"@types/node": "^22.0.0",
|
|
61
|
+
"@types/react": "^19.1.9",
|
|
62
62
|
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
63
63
|
"@typescript-eslint/parser": "^7.0.0",
|
|
64
64
|
"eslint": "^8.0.0",
|
package/prepare.js
CHANGED
|
@@ -11,6 +11,16 @@ const { execSync } = require('child_process')
|
|
|
11
11
|
|
|
12
12
|
console.log('🚀 Preparing RoboSystems SDK for publishing...')
|
|
13
13
|
|
|
14
|
+
// First, build the TypeScript
|
|
15
|
+
console.log('🔨 Building TypeScript...')
|
|
16
|
+
try {
|
|
17
|
+
execSync('npm run build', { stdio: 'inherit' })
|
|
18
|
+
console.log('✅ TypeScript build complete')
|
|
19
|
+
} catch (error) {
|
|
20
|
+
console.error('❌ TypeScript build failed:', error.message)
|
|
21
|
+
process.exit(1)
|
|
22
|
+
}
|
|
23
|
+
|
|
14
24
|
const sdkSourceDir = path.join(__dirname, 'sdk')
|
|
15
25
|
const currentDir = __dirname
|
|
16
26
|
|