@robosystems/client 0.1.12 → 0.1.13
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/OperationClient.js +237 -283
- package/extensions/QueryClient.js +175 -230
- package/extensions/SSEClient.js +138 -156
- package/extensions/config.js +51 -43
- package/extensions/hooks.js +289 -353
- package/extensions/index.js +98 -106
- package/package.json +1 -1
- package/prepare.js +15 -23
- package/extensions/OperationClient.d.js +0 -45
- package/extensions/QueryClient.d.js +0 -22
- package/extensions/SSEClient.d.js +0 -35
- package/extensions/config.d.js +0 -25
- package/extensions/hooks.d.js +0 -80
- package/extensions/index.d.js +0 -35
package/extensions/index.js
CHANGED
|
@@ -1,118 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* RoboSystems SDK Extensions
|
|
3
4
|
* Enhanced clients with SSE support for the RoboSystems API
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.streamQuery = exports.executeQuery = exports.monitorOperation = exports.extensions = exports.useStreamingQuery = exports.useSDKClients = exports.useQuery = exports.useOperation = exports.useMultipleOperations = exports.SSEClient = exports.QueryClient = exports.OperationClient = exports.RoboSystemsExtensions = void 0;
|
|
22
|
+
const client_gen_1 = require("../sdk/client.gen");
|
|
23
|
+
const OperationClient_1 = require("./OperationClient");
|
|
24
|
+
Object.defineProperty(exports, "OperationClient", { enumerable: true, get: function () { return OperationClient_1.OperationClient; } });
|
|
25
|
+
const QueryClient_1 = require("./QueryClient");
|
|
26
|
+
Object.defineProperty(exports, "QueryClient", { enumerable: true, get: function () { return QueryClient_1.QueryClient; } });
|
|
27
|
+
const SSEClient_1 = require("./SSEClient");
|
|
28
|
+
Object.defineProperty(exports, "SSEClient", { enumerable: true, get: function () { return SSEClient_1.SSEClient; } });
|
|
29
|
+
class RoboSystemsExtensions {
|
|
30
|
+
constructor(config = {}) {
|
|
31
|
+
// Get base URL from SDK client config or use provided/default
|
|
32
|
+
const sdkConfig = client_gen_1.client.getConfig();
|
|
33
|
+
this.config = {
|
|
34
|
+
baseUrl: config.baseUrl || sdkConfig.baseUrl || 'http://localhost:8000',
|
|
35
|
+
credentials: config.credentials || 'include',
|
|
36
|
+
maxRetries: config.maxRetries || 5,
|
|
37
|
+
retryDelay: config.retryDelay || 1000,
|
|
38
|
+
};
|
|
39
|
+
this.query = new QueryClient_1.QueryClient({
|
|
40
|
+
baseUrl: this.config.baseUrl,
|
|
41
|
+
credentials: this.config.credentials,
|
|
42
|
+
});
|
|
43
|
+
this.operations = new OperationClient_1.OperationClient({
|
|
44
|
+
baseUrl: this.config.baseUrl,
|
|
45
|
+
credentials: this.config.credentials,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Convenience method to monitor any operation
|
|
50
|
+
*/
|
|
51
|
+
async monitorOperation(operationId, onProgress) {
|
|
52
|
+
return this.operations.monitorOperation(operationId, { onProgress });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create custom SSE client for advanced use cases
|
|
56
|
+
*/
|
|
57
|
+
createSSEClient() {
|
|
58
|
+
return new SSEClient_1.SSEClient({
|
|
59
|
+
baseUrl: this.config.baseUrl,
|
|
60
|
+
credentials: this.config.credentials,
|
|
61
|
+
maxRetries: this.config.maxRetries,
|
|
62
|
+
retryDelay: this.config.retryDelay,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Clean up all active connections
|
|
67
|
+
*/
|
|
68
|
+
close() {
|
|
69
|
+
this.query.close();
|
|
70
|
+
this.operations.closeAll();
|
|
27
71
|
}
|
|
28
|
-
|
|
29
|
-
this.query = new QueryClient({
|
|
30
|
-
baseUrl.config.baseUrl,
|
|
31
|
-
credentials.config.credentials,
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
this.operations = new OperationClient({
|
|
35
|
-
baseUrl.config.baseUrl,
|
|
36
|
-
credentials.config.credentials,
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Convenience method to monitor any operation
|
|
42
|
-
*/
|
|
43
|
-
async monitorOperation(operationId, onProgress?) {
|
|
44
|
-
return this.operations.monitorOperation(operationId, { onProgress })
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Create custom SSE client for advanced use cases
|
|
49
|
-
*/
|
|
50
|
-
createSSEClient() {
|
|
51
|
-
return new SSEClient({
|
|
52
|
-
baseUrl.config.baseUrl,
|
|
53
|
-
credentials.config.credentials,
|
|
54
|
-
maxRetries.config.maxRetries,
|
|
55
|
-
retryDelay.config.retryDelay,
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Clean up all active connections
|
|
61
|
-
*/
|
|
62
|
-
close() {
|
|
63
|
-
this.query.close()
|
|
64
|
-
this.operations.closeAll()
|
|
65
|
-
}
|
|
66
72
|
}
|
|
67
|
-
|
|
73
|
+
exports.RoboSystemsExtensions = RoboSystemsExtensions;
|
|
68
74
|
// Export all types and classes
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export { OperationClient, QueryClient, SSEClient }
|
|
73
|
-
|
|
75
|
+
__exportStar(require("./OperationClient"), exports);
|
|
76
|
+
__exportStar(require("./QueryClient"), exports);
|
|
77
|
+
__exportStar(require("./SSEClient"), exports);
|
|
74
78
|
// Export React hooks
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} from './hooks'
|
|
82
|
-
|
|
79
|
+
var hooks_1 = require("./hooks");
|
|
80
|
+
Object.defineProperty(exports, "useMultipleOperations", { enumerable: true, get: function () { return hooks_1.useMultipleOperations; } });
|
|
81
|
+
Object.defineProperty(exports, "useOperation", { enumerable: true, get: function () { return hooks_1.useOperation; } });
|
|
82
|
+
Object.defineProperty(exports, "useQuery", { enumerable: true, get: function () { return hooks_1.useQuery; } });
|
|
83
|
+
Object.defineProperty(exports, "useSDKClients", { enumerable: true, get: function () { return hooks_1.useSDKClients; } });
|
|
84
|
+
Object.defineProperty(exports, "useStreamingQuery", { enumerable: true, get: function () { return hooks_1.useStreamingQuery; } });
|
|
83
85
|
// Lazy initialization of default instance
|
|
84
|
-
let _extensions
|
|
85
|
-
|
|
86
|
+
let _extensions = null;
|
|
86
87
|
function getExtensions() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export const extensions = {
|
|
94
|
-
get query() {
|
|
95
|
-
return getExtensions().query
|
|
96
|
-
},
|
|
97
|
-
get operations() {
|
|
98
|
-
return getExtensions().operations
|
|
99
|
-
},
|
|
100
|
-
monitorOperation) =>
|
|
101
|
-
getExtensions().monitorOperation(operationId, onProgress),
|
|
102
|
-
createSSEClient: () => getExtensions().createSSEClient(),
|
|
103
|
-
close: () => getExtensions().close(),
|
|
88
|
+
if (!_extensions) {
|
|
89
|
+
_extensions = new RoboSystemsExtensions();
|
|
90
|
+
}
|
|
91
|
+
return _extensions;
|
|
104
92
|
}
|
|
105
|
-
|
|
93
|
+
exports.extensions = {
|
|
94
|
+
get query() {
|
|
95
|
+
return getExtensions().query;
|
|
96
|
+
},
|
|
97
|
+
get operations() {
|
|
98
|
+
return getExtensions().operations;
|
|
99
|
+
},
|
|
100
|
+
monitorOperation: (operationId, onProgress) => getExtensions().monitorOperation(operationId, onProgress),
|
|
101
|
+
createSSEClient: () => getExtensions().createSSEClient(),
|
|
102
|
+
close: () => getExtensions().close(),
|
|
103
|
+
};
|
|
106
104
|
// Export convenience functions that use the default instance
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
export const streamQuery = (
|
|
114
|
-
graphId,
|
|
115
|
-
query,
|
|
116
|
-
parameters?,
|
|
117
|
-
chunkSize?
|
|
118
|
-
) => getExtensions().query.streamQuery(graphId, query, parameters, chunkSize)
|
|
105
|
+
const monitorOperation = (operationId, onProgress) => getExtensions().monitorOperation(operationId, onProgress);
|
|
106
|
+
exports.monitorOperation = monitorOperation;
|
|
107
|
+
const executeQuery = (graphId, query, parameters) => getExtensions().query.query(graphId, query, parameters);
|
|
108
|
+
exports.executeQuery = executeQuery;
|
|
109
|
+
const streamQuery = (graphId, query, parameters, chunkSize) => getExtensions().query.streamQuery(graphId, query, parameters, chunkSize);
|
|
110
|
+
exports.streamQuery = streamQuery;
|
package/package.json
CHANGED
package/prepare.js
CHANGED
|
@@ -90,38 +90,30 @@ if (!fs.existsSync(extensionsDestDir)) {
|
|
|
90
90
|
|
|
91
91
|
// Copy extensions files
|
|
92
92
|
if (fs.existsSync(extensionsSourceDir)) {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
// The TypeScript compiler will have already built these files
|
|
94
|
+
// Just copy the compiled .js and .d.ts files
|
|
95
|
+
const sdkExtensionsBuilt = fs.readdirSync(extensionsSourceDir)
|
|
96
|
+
|
|
97
|
+
sdkExtensionsBuilt.forEach((file) => {
|
|
95
98
|
const sourcePath = path.join(extensionsSourceDir, file)
|
|
96
99
|
const destPath = path.join(extensionsDestDir, file)
|
|
97
|
-
|
|
98
|
-
if (file.endsWith('.ts')) {
|
|
99
|
-
//
|
|
100
|
+
|
|
101
|
+
if (file.endsWith('.js') || file.endsWith('.d.ts')) {
|
|
102
|
+
// Copy compiled JavaScript and declaration files
|
|
103
|
+
fs.copyFileSync(sourcePath, destPath)
|
|
104
|
+
console.log(` ✓ Copied ${file}`)
|
|
105
|
+
} else if (file.endsWith('.ts') && !file.endsWith('.d.ts')) {
|
|
106
|
+
// Copy TypeScript source files for reference
|
|
100
107
|
let content = fs.readFileSync(sourcePath, 'utf8')
|
|
101
|
-
|
|
108
|
+
|
|
102
109
|
// Adjust imports for published package structure
|
|
103
110
|
content = content
|
|
104
111
|
.replace(/from ['"]\.\.\/sdk\/sdk\.gen['"]/g, "from '../sdk.gen'")
|
|
105
112
|
.replace(/from ['"]\.\.\/sdk\/types\.gen['"]/g, "from '../types.gen'")
|
|
106
113
|
.replace(/from ['"]\.\.\/sdk\/client\.gen['"]/g, "from '../client.gen'")
|
|
107
|
-
|
|
108
|
-
// Save TypeScript version
|
|
114
|
+
|
|
109
115
|
fs.writeFileSync(destPath, content)
|
|
110
|
-
|
|
111
|
-
// Create JavaScript version
|
|
112
|
-
let jsContent = content
|
|
113
|
-
.replace(/export interface \w+[^}]+}/gs, '') // Remove interfaces
|
|
114
|
-
.replace(/export type[^;]+;/gs, '') // Remove type exports
|
|
115
|
-
.replace(/: (\w+(\[\])?|{[^}]+}|\([^)]+\) => \w+|['"][\w-]+['"])/g, '') // Remove type annotations
|
|
116
|
-
.replace(/<[^>]+>/g, '') // Remove generics
|
|
117
|
-
.replace(/\?:/g, ':') // Remove optional markers
|
|
118
|
-
.replace(/ as \w+/g, '') // Remove type assertions
|
|
119
|
-
.replace(/import type/g, 'import') // Convert type imports
|
|
120
|
-
.replace(/type \w+ = [^;]+;/g, '') // Remove type aliases
|
|
121
|
-
|
|
122
|
-
const jsFile = file.replace('.ts', '.js')
|
|
123
|
-
fs.writeFileSync(path.join(extensionsDestDir, jsFile), jsContent)
|
|
124
|
-
console.log(` ✓ Copied ${file} -> ${jsFile}`)
|
|
116
|
+
console.log(` ✓ Copied ${file}`)
|
|
125
117
|
}
|
|
126
118
|
})
|
|
127
119
|
console.log(' ✓ SDK extensions copied')
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare class OperationClient {
|
|
5
|
-
private sseClients;
|
|
6
|
-
private cleanupTimeouts;
|
|
7
|
-
private config;
|
|
8
|
-
private cleanupIntervalMs;
|
|
9
|
-
private cleanupInterval?;
|
|
10
|
-
constructor(config);
|
|
11
|
-
monitorOperation(operationId, options?)>;
|
|
12
|
-
/**
|
|
13
|
-
* Monitor multiple operations concurrently
|
|
14
|
-
*/
|
|
15
|
-
monitorMultiple(operationIds, options?)>>;
|
|
16
|
-
/**
|
|
17
|
-
* Get the current status of an operation (point-in-time check)
|
|
18
|
-
*/
|
|
19
|
-
getStatus(operationId);
|
|
20
|
-
/**
|
|
21
|
-
* Cancel a pending or running operation
|
|
22
|
-
*/
|
|
23
|
-
cancelOperation(operationId);
|
|
24
|
-
/**
|
|
25
|
-
* Wait for an operation with a simple promise interface
|
|
26
|
-
*/
|
|
27
|
-
waitForOperation(operationId, timeoutMs?);
|
|
28
|
-
/**
|
|
29
|
-
* Monitor operation with async iterator for progress updates
|
|
30
|
-
*/
|
|
31
|
-
monitorWithProgress(operationId)>;
|
|
32
|
-
private cleanupClient;
|
|
33
|
-
/**
|
|
34
|
-
* Schedule automatic cleanup of SSE client after a delay
|
|
35
|
-
*/
|
|
36
|
-
private scheduleCleanup;
|
|
37
|
-
/**
|
|
38
|
-
* Perform periodic cleanup of stale SSE connections
|
|
39
|
-
*/
|
|
40
|
-
private performPeriodicCleanup;
|
|
41
|
-
/**
|
|
42
|
-
* Close all active SSE connections and clean up resources
|
|
43
|
-
*/
|
|
44
|
-
closeAll();
|
|
45
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare class QueryClient {
|
|
6
|
-
private sseClient?;
|
|
7
|
-
private config;
|
|
8
|
-
constructor(config);
|
|
9
|
-
executeQuery(graphId, request, options?)>;
|
|
10
|
-
private streamQueryResults;
|
|
11
|
-
private waitForQueryCompletion;
|
|
12
|
-
query(graphId, cypher, parameters?);
|
|
13
|
-
streamQuery(graphId, cypher, parameters?, chunkSize?);
|
|
14
|
-
close();
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Error thrown when query is queued and maxWait is 0
|
|
18
|
-
*/
|
|
19
|
-
export declare class QueuedQueryError extends Error {
|
|
20
|
-
queueInfo;
|
|
21
|
-
constructor(queueInfo);
|
|
22
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}
|
package/extensions/config.d.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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');
|
package/extensions/hooks.d.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
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();
|
package/extensions/index.d.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
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;
|