@robosystems/client 0.3.1 → 0.3.3
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 → artifacts}/InvestorClient.js +0 -1
- package/{extensions → artifacts}/InvestorClient.ts +1 -1
- package/{extensions → artifacts}/LedgerClient.d.ts +168 -2
- package/{extensions → artifacts}/LedgerClient.js +301 -2
- package/{extensions → artifacts}/LedgerClient.ts +645 -2
- package/{extensions → artifacts}/config.d.ts +11 -11
- package/{extensions → artifacts}/config.js +11 -11
- package/{extensions → artifacts}/config.ts +16 -16
- package/{extensions → artifacts}/graphql/client.d.ts +1 -1
- package/{extensions → artifacts}/graphql/client.js +1 -2
- package/{extensions → artifacts}/graphql/client.ts +2 -2
- package/{extensions → artifacts}/hooks.js +6 -6
- package/{extensions → artifacts}/hooks.ts +7 -7
- package/{extensions → artifacts}/index.d.ts +21 -18
- package/{extensions → artifacts}/index.js +43 -53
- package/{extensions → artifacts}/index.ts +47 -60
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/index.ts +2 -2
- package/package.json +38 -8
- package/sdk/index.d.ts +2 -2
- package/sdk/index.js +27 -9
- package/sdk/index.ts +2 -2
- package/sdk/sdk.gen.d.ts +272 -274
- package/sdk/sdk.gen.js +468 -312
- package/sdk/sdk.gen.ts +464 -309
- package/sdk/types.gen.d.ts +2962 -440
- package/sdk/types.gen.ts +3058 -430
- package/sdk.gen.d.ts +272 -274
- package/sdk.gen.js +468 -312
- package/sdk.gen.ts +464 -309
- package/types.gen.d.ts +2962 -440
- package/types.gen.ts +3058 -430
- package/extensions/ReportClient.d.ts +0 -120
- package/extensions/ReportClient.js +0 -191
- package/extensions/ReportClient.ts +0 -433
- /package/{extensions → artifacts}/AgentClient.d.ts +0 -0
- /package/{extensions → artifacts}/AgentClient.js +0 -0
- /package/{extensions → artifacts}/AgentClient.ts +0 -0
- /package/{extensions → artifacts}/InvestorClient.d.ts +0 -0
- /package/{extensions → artifacts}/OperationClient.d.ts +0 -0
- /package/{extensions → artifacts}/OperationClient.js +0 -0
- /package/{extensions → artifacts}/OperationClient.ts +0 -0
- /package/{extensions → artifacts}/QueryClient.d.ts +0 -0
- /package/{extensions → artifacts}/QueryClient.js +0 -0
- /package/{extensions → artifacts}/QueryClient.ts +0 -0
- /package/{extensions → artifacts}/SSEClient.d.ts +0 -0
- /package/{extensions → artifacts}/SSEClient.js +0 -0
- /package/{extensions → artifacts}/SSEClient.ts +0 -0
- /package/{extensions → artifacts}/graphql/generated/graphql.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/generated/graphql.js +0 -0
- /package/{extensions → artifacts}/graphql/generated/graphql.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/holdings.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/holdings.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/holdings.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/portfolio.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/portfolio.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/portfolio.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/portfolios.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/portfolios.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/portfolios.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/position.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/position.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/position.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/positions.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/positions.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/positions.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/securities.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/securities.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/securities.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/security.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/security.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/investor/security.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accountRollups.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accountRollups.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accountRollups.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accountTree.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accountTree.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accountTree.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accounts.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accounts.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/accounts.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/closingBookStructures.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/closingBookStructures.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/closingBookStructures.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/elements.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/elements.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/elements.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/entities.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/entities.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/entities.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/entity.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/entity.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/entity.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/fiscalCalendar.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/fiscalCalendar.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/fiscalCalendar.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappedTrialBalance.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappedTrialBalance.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappedTrialBalance.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mapping.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mapping.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mapping.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappingCoverage.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappingCoverage.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappingCoverage.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappings.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappings.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/mappings.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/periodCloseStatus.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/periodCloseStatus.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/periodCloseStatus.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/periodDrafts.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/periodDrafts.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/periodDrafts.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/publishList.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/publishList.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/publishList.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/publishLists.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/publishLists.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/publishLists.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/report.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/report.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/report.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/reportingTaxonomy.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/reportingTaxonomy.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/reportingTaxonomy.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/reports.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/reports.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/reports.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/scheduleFacts.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/scheduleFacts.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/scheduleFacts.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/schedules.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/schedules.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/schedules.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/statement.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/statement.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/statement.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/structures.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/structures.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/structures.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/summary.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/summary.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/summary.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/taxonomies.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/taxonomies.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/taxonomies.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/transaction.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/transaction.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/transaction.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/transactions.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/transactions.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/transactions.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/trialBalance.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/trialBalance.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/trialBalance.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/unmappedElements.d.ts +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/unmappedElements.js +0 -0
- /package/{extensions → artifacts}/graphql/queries/ledger/unmappedElements.ts +0 -0
- /package/{extensions → artifacts}/hooks.d.ts +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Configuration for SDK
|
|
2
|
+
* Configuration for SDK clients
|
|
3
3
|
* Provides centralized configuration for CORS, credentials, and other settings
|
|
4
4
|
*/
|
|
5
5
|
import type { TokenProvider } from './graphql/client';
|
|
6
|
-
export interface
|
|
6
|
+
export interface SDKClientConfig {
|
|
7
7
|
baseUrl?: string;
|
|
8
8
|
credentials?: 'include' | 'same-origin' | 'omit';
|
|
9
9
|
headers?: Record<string, string>;
|
|
@@ -21,7 +21,7 @@ export interface SDKExtensionsConfig {
|
|
|
21
21
|
/**
|
|
22
22
|
* Dynamic credential callback, invoked on every GraphQL request.
|
|
23
23
|
* When set, JWT refresh flows through automatically: the lazy
|
|
24
|
-
* `
|
|
24
|
+
* `clients` singleton picks it up at construction, and each
|
|
25
25
|
* request consults the callback for the current token instead of
|
|
26
26
|
* reusing a stale captured value.
|
|
27
27
|
*/
|
|
@@ -31,19 +31,19 @@ export interface SDKExtensionsConfig {
|
|
|
31
31
|
retryDelay?: number;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Set global configuration for SDK
|
|
34
|
+
* Set global configuration for SDK clients
|
|
35
35
|
* @param config Partial configuration to merge with defaults
|
|
36
36
|
*/
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function setSDKClientConfig(config: Partial<SDKClientConfig>): void;
|
|
38
38
|
/**
|
|
39
|
-
* Get current SDK
|
|
39
|
+
* Get current SDK clients configuration
|
|
40
40
|
* @returns Current configuration
|
|
41
41
|
*/
|
|
42
|
-
export declare function
|
|
42
|
+
export declare function getSDKClientConfig(): SDKClientConfig;
|
|
43
43
|
/**
|
|
44
44
|
* Reset configuration to defaults
|
|
45
45
|
*/
|
|
46
|
-
export declare function
|
|
46
|
+
export declare function resetSDKClientConfig(): void;
|
|
47
47
|
/**
|
|
48
48
|
* Extract JWT token from Authorization header
|
|
49
49
|
* @param authHeader Authorization header value
|
|
@@ -63,14 +63,14 @@ export declare function isValidJWT(token: string | undefined): boolean;
|
|
|
63
63
|
*/
|
|
64
64
|
export declare function extractTokenFromSDKClient(): string | undefined;
|
|
65
65
|
/**
|
|
66
|
-
* Configure SDK
|
|
66
|
+
* Configure SDK clients for JWT authentication
|
|
67
67
|
* @param token JWT token
|
|
68
68
|
* @param config Additional configuration options
|
|
69
69
|
*/
|
|
70
|
-
export declare function configureWithJWT(token: string, config?: Partial<
|
|
70
|
+
export declare function configureWithJWT(token: string, config?: Partial<SDKClientConfig>): void;
|
|
71
71
|
/**
|
|
72
72
|
* Get configuration for a specific environment
|
|
73
73
|
* @param env Environment name (production, staging, development)
|
|
74
74
|
* @returns Environment-specific configuration
|
|
75
75
|
*/
|
|
76
|
-
export declare function getEnvironmentConfig(env?: 'production' | 'staging' | 'development'):
|
|
76
|
+
export declare function getEnvironmentConfig(env?: 'production' | 'staging' | 'development'): SDKClientConfig;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
4
|
+
exports.setSDKClientConfig = setSDKClientConfig;
|
|
5
|
+
exports.getSDKClientConfig = getSDKClientConfig;
|
|
6
|
+
exports.resetSDKClientConfig = resetSDKClientConfig;
|
|
7
7
|
exports.extractJWTFromHeader = extractJWTFromHeader;
|
|
8
8
|
exports.isValidJWT = isValidJWT;
|
|
9
9
|
exports.extractTokenFromSDKClient = extractTokenFromSDKClient;
|
|
@@ -21,26 +21,26 @@ const defaultConfig = {
|
|
|
21
21
|
// Global configuration singleton
|
|
22
22
|
let globalConfig = { ...defaultConfig };
|
|
23
23
|
/**
|
|
24
|
-
* Set global configuration for SDK
|
|
24
|
+
* Set global configuration for SDK clients
|
|
25
25
|
* @param config Partial configuration to merge with defaults
|
|
26
26
|
*/
|
|
27
|
-
function
|
|
27
|
+
function setSDKClientConfig(config) {
|
|
28
28
|
globalConfig = {
|
|
29
29
|
...globalConfig,
|
|
30
30
|
...config,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Get current SDK
|
|
34
|
+
* Get current SDK clients configuration
|
|
35
35
|
* @returns Current configuration
|
|
36
36
|
*/
|
|
37
|
-
function
|
|
37
|
+
function getSDKClientConfig() {
|
|
38
38
|
return { ...globalConfig };
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Reset configuration to defaults
|
|
42
42
|
*/
|
|
43
|
-
function
|
|
43
|
+
function resetSDKClientConfig() {
|
|
44
44
|
globalConfig = { ...defaultConfig };
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
@@ -82,7 +82,7 @@ function isValidJWT(token) {
|
|
|
82
82
|
function extractTokenFromSDKClient() {
|
|
83
83
|
// Import dynamically to avoid circular dependency
|
|
84
84
|
const { client } = require('../client.gen');
|
|
85
|
-
const sdkConfig =
|
|
85
|
+
const sdkConfig = getSDKClientConfig();
|
|
86
86
|
// Priority 1: Use explicitly configured token
|
|
87
87
|
if (sdkConfig.token) {
|
|
88
88
|
return sdkConfig.token;
|
|
@@ -101,7 +101,7 @@ function extractTokenFromSDKClient() {
|
|
|
101
101
|
return undefined;
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
104
|
-
* Configure SDK
|
|
104
|
+
* Configure SDK clients for JWT authentication
|
|
105
105
|
* @param token JWT token
|
|
106
106
|
* @param config Additional configuration options
|
|
107
107
|
*/
|
|
@@ -109,7 +109,7 @@ function configureWithJWT(token, config) {
|
|
|
109
109
|
if (!isValidJWT(token)) {
|
|
110
110
|
console.warn('Warning: Provided JWT token does not appear to be valid');
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
setSDKClientConfig({
|
|
113
113
|
...config,
|
|
114
114
|
token,
|
|
115
115
|
// When using JWT, typically don't need cookies
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Configuration for SDK
|
|
4
|
+
* Configuration for SDK clients
|
|
5
5
|
* Provides centralized configuration for CORS, credentials, and other settings
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { TokenProvider } from './graphql/client'
|
|
9
9
|
|
|
10
|
-
export interface
|
|
10
|
+
export interface SDKClientConfig {
|
|
11
11
|
baseUrl?: string
|
|
12
12
|
credentials?: 'include' | 'same-origin' | 'omit'
|
|
13
13
|
headers?: Record<string, string>
|
|
@@ -25,7 +25,7 @@ export interface SDKExtensionsConfig {
|
|
|
25
25
|
/**
|
|
26
26
|
* Dynamic credential callback, invoked on every GraphQL request.
|
|
27
27
|
* When set, JWT refresh flows through automatically: the lazy
|
|
28
|
-
* `
|
|
28
|
+
* `clients` singleton picks it up at construction, and each
|
|
29
29
|
* request consults the callback for the current token instead of
|
|
30
30
|
* reusing a stale captured value.
|
|
31
31
|
*/
|
|
@@ -36,7 +36,7 @@ export interface SDKExtensionsConfig {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// Default configuration
|
|
39
|
-
const defaultConfig:
|
|
39
|
+
const defaultConfig: SDKClientConfig = {
|
|
40
40
|
baseUrl: process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000',
|
|
41
41
|
credentials: 'include',
|
|
42
42
|
token: undefined, // Will be set from environment or programmatically
|
|
@@ -46,13 +46,13 @@ const defaultConfig: SDKExtensionsConfig = {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
// Global configuration singleton
|
|
49
|
-
let globalConfig:
|
|
49
|
+
let globalConfig: SDKClientConfig = { ...defaultConfig }
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
* Set global configuration for SDK
|
|
52
|
+
* Set global configuration for SDK clients
|
|
53
53
|
* @param config Partial configuration to merge with defaults
|
|
54
54
|
*/
|
|
55
|
-
export function
|
|
55
|
+
export function setSDKClientConfig(config: Partial<SDKClientConfig>) {
|
|
56
56
|
globalConfig = {
|
|
57
57
|
...globalConfig,
|
|
58
58
|
...config,
|
|
@@ -60,17 +60,17 @@ export function setSDKExtensionsConfig(config: Partial<SDKExtensionsConfig>) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Get current SDK
|
|
63
|
+
* Get current SDK clients configuration
|
|
64
64
|
* @returns Current configuration
|
|
65
65
|
*/
|
|
66
|
-
export function
|
|
66
|
+
export function getSDKClientConfig(): SDKClientConfig {
|
|
67
67
|
return { ...globalConfig }
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Reset configuration to defaults
|
|
72
72
|
*/
|
|
73
|
-
export function
|
|
73
|
+
export function resetSDKClientConfig() {
|
|
74
74
|
globalConfig = { ...defaultConfig }
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -116,7 +116,7 @@ export function extractTokenFromSDKClient(): string | undefined {
|
|
|
116
116
|
// Import dynamically to avoid circular dependency
|
|
117
117
|
const { client } = require('../client.gen')
|
|
118
118
|
|
|
119
|
-
const sdkConfig =
|
|
119
|
+
const sdkConfig = getSDKClientConfig()
|
|
120
120
|
|
|
121
121
|
// Priority 1: Use explicitly configured token
|
|
122
122
|
if (sdkConfig.token) {
|
|
@@ -139,16 +139,16 @@ export function extractTokenFromSDKClient(): string | undefined {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* Configure SDK
|
|
142
|
+
* Configure SDK clients for JWT authentication
|
|
143
143
|
* @param token JWT token
|
|
144
144
|
* @param config Additional configuration options
|
|
145
145
|
*/
|
|
146
|
-
export function configureWithJWT(token: string, config?: Partial<
|
|
146
|
+
export function configureWithJWT(token: string, config?: Partial<SDKClientConfig>) {
|
|
147
147
|
if (!isValidJWT(token)) {
|
|
148
148
|
console.warn('Warning: Provided JWT token does not appear to be valid')
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
setSDKClientConfig({
|
|
152
152
|
...config,
|
|
153
153
|
token,
|
|
154
154
|
// When using JWT, typically don't need cookies
|
|
@@ -163,8 +163,8 @@ export function configureWithJWT(token: string, config?: Partial<SDKExtensionsCo
|
|
|
163
163
|
*/
|
|
164
164
|
export function getEnvironmentConfig(
|
|
165
165
|
env: 'production' | 'staging' | 'development' = 'development'
|
|
166
|
-
):
|
|
167
|
-
const baseConfigs: Record<string, Partial<
|
|
166
|
+
): SDKClientConfig {
|
|
167
|
+
const baseConfigs: Record<string, Partial<SDKClientConfig>> = {
|
|
168
168
|
production: {
|
|
169
169
|
baseUrl: process.env.NEXT_PUBLIC_API_URL || 'https://api.robosystems.ai',
|
|
170
170
|
credentials: 'include',
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* We pick graphql-request (tiny, no React, no caching) because the facade
|
|
17
17
|
* doesn't need the hook ergonomics that urql/Apollo provide. Type safety
|
|
18
18
|
* comes from GraphQL Code Generator, which produces typed DocumentNodes
|
|
19
|
-
* from the query files in
|
|
19
|
+
* from the query files in clients/graphql/queries/.
|
|
20
20
|
*/
|
|
21
21
|
import { GraphQLClient } from 'graphql-request';
|
|
22
22
|
/**
|
|
@@ -21,7 +21,7 @@ exports.createGraphQLClient = createGraphQLClient;
|
|
|
21
21
|
* We pick graphql-request (tiny, no React, no caching) because the facade
|
|
22
22
|
* doesn't need the hook ergonomics that urql/Apollo provide. Type safety
|
|
23
23
|
* comes from GraphQL Code Generator, which produces typed DocumentNodes
|
|
24
|
-
* from the query files in
|
|
24
|
+
* from the query files in clients/graphql/queries/.
|
|
25
25
|
*/
|
|
26
26
|
const graphql_request_1 = require("graphql-request");
|
|
27
27
|
/**
|
|
@@ -79,7 +79,6 @@ function createGraphQLClient(config, graphId) {
|
|
|
79
79
|
// devtools/log aggregators instead of silently disappearing;
|
|
80
80
|
// silently swallowing provider bugs in production is worse
|
|
81
81
|
// than the noise.
|
|
82
|
-
// eslint-disable-next-line no-console
|
|
83
82
|
console.warn('[RoboSystems SDK] tokenProvider threw — sending unauthenticated request:', err);
|
|
84
83
|
token = undefined;
|
|
85
84
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* We pick graphql-request (tiny, no React, no caching) because the facade
|
|
19
19
|
* doesn't need the hook ergonomics that urql/Apollo provide. Type safety
|
|
20
20
|
* comes from GraphQL Code Generator, which produces typed DocumentNodes
|
|
21
|
-
* from the query files in
|
|
21
|
+
* from the query files in clients/graphql/queries/.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { GraphQLClient } from 'graphql-request'
|
|
@@ -113,7 +113,7 @@ export function createGraphQLClient(config: GraphQLClientConfig, graphId: string
|
|
|
113
113
|
// devtools/log aggregators instead of silently disappearing;
|
|
114
114
|
// silently swallowing provider bugs in production is worse
|
|
115
115
|
// than the noise.
|
|
116
|
-
|
|
116
|
+
|
|
117
117
|
console.warn(
|
|
118
118
|
'[RoboSystems SDK] tokenProvider threw — sending unauthenticated request:',
|
|
119
119
|
err
|
|
@@ -7,7 +7,7 @@ exports.useOperation = useOperation;
|
|
|
7
7
|
exports.useMultipleOperations = useMultipleOperations;
|
|
8
8
|
exports.useSDKClients = useSDKClients;
|
|
9
9
|
/**
|
|
10
|
-
* React hooks for SDK
|
|
10
|
+
* React hooks for SDK clients
|
|
11
11
|
* Provides easy-to-use hooks for Next.js/React applications
|
|
12
12
|
*/
|
|
13
13
|
const react_1 = require("react");
|
|
@@ -36,7 +36,7 @@ function useQuery(graphId) {
|
|
|
36
36
|
const clientRef = (0, react_1.useRef)(null);
|
|
37
37
|
// Initialize client
|
|
38
38
|
(0, react_1.useEffect)(() => {
|
|
39
|
-
const sdkConfig = (0, config_1.
|
|
39
|
+
const sdkConfig = (0, config_1.getSDKClientConfig)();
|
|
40
40
|
const clientConfig = client_gen_1.client.getConfig();
|
|
41
41
|
// Extract JWT token (uses centralized logic)
|
|
42
42
|
const token = (0, config_1.extractTokenFromSDKClient)();
|
|
@@ -115,7 +115,7 @@ function useStreamingQuery(graphId) {
|
|
|
115
115
|
const [rowsReceived, setRowsReceived] = (0, react_1.useState)(0);
|
|
116
116
|
const clientRef = (0, react_1.useRef)(null);
|
|
117
117
|
(0, react_1.useEffect)(() => {
|
|
118
|
-
const sdkConfig = (0, config_1.
|
|
118
|
+
const sdkConfig = (0, config_1.getSDKClientConfig)();
|
|
119
119
|
const clientConfig = client_gen_1.client.getConfig();
|
|
120
120
|
clientRef.current = new QueryClient_1.QueryClient({
|
|
121
121
|
baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
|
|
@@ -193,7 +193,7 @@ function useOperation(operationId) {
|
|
|
193
193
|
const [result, setResult] = (0, react_1.useState)(null);
|
|
194
194
|
const clientRef = (0, react_1.useRef)(null);
|
|
195
195
|
(0, react_1.useEffect)(() => {
|
|
196
|
-
const sdkConfig = (0, config_1.
|
|
196
|
+
const sdkConfig = (0, config_1.getSDKClientConfig)();
|
|
197
197
|
const clientConfig = client_gen_1.client.getConfig();
|
|
198
198
|
// Extract JWT token (uses centralized logic)
|
|
199
199
|
const token = (0, config_1.extractTokenFromSDKClient)();
|
|
@@ -292,7 +292,7 @@ function useMultipleOperations() {
|
|
|
292
292
|
const [errors, setErrors] = (0, react_1.useState)(new Map());
|
|
293
293
|
const clientRef = (0, react_1.useRef)(null);
|
|
294
294
|
(0, react_1.useEffect)(() => {
|
|
295
|
-
const sdkConfig = (0, config_1.
|
|
295
|
+
const sdkConfig = (0, config_1.getSDKClientConfig)();
|
|
296
296
|
const clientConfig = client_gen_1.client.getConfig();
|
|
297
297
|
// Extract JWT token (uses centralized logic)
|
|
298
298
|
const token = (0, config_1.extractTokenFromSDKClient)();
|
|
@@ -359,7 +359,7 @@ function useSDKClients() {
|
|
|
359
359
|
operations: null,
|
|
360
360
|
});
|
|
361
361
|
(0, react_1.useEffect)(() => {
|
|
362
|
-
const sdkConfig = (0, config_1.
|
|
362
|
+
const sdkConfig = (0, config_1.getSDKClientConfig)();
|
|
363
363
|
const clientConfig = client_gen_1.client.getConfig();
|
|
364
364
|
// Extract JWT token (uses centralized logic)
|
|
365
365
|
const token = (0, config_1.extractTokenFromSDKClient)();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* React hooks for SDK
|
|
4
|
+
* React hooks for SDK clients
|
|
5
5
|
* Provides easy-to-use hooks for Next.js/React applications
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
|
9
9
|
import { client } from '../client.gen'
|
|
10
|
-
import { extractTokenFromSDKClient,
|
|
10
|
+
import { extractTokenFromSDKClient, getSDKClientConfig } from './config'
|
|
11
11
|
import type { OperationProgress, OperationResult } from './OperationClient'
|
|
12
12
|
import { OperationClient } from './OperationClient'
|
|
13
13
|
import type { QueryOptions, QueryResult } from './QueryClient'
|
|
@@ -35,7 +35,7 @@ export function useQuery(graphId: string) {
|
|
|
35
35
|
|
|
36
36
|
// Initialize client
|
|
37
37
|
useEffect(() => {
|
|
38
|
-
const sdkConfig =
|
|
38
|
+
const sdkConfig = getSDKClientConfig()
|
|
39
39
|
const clientConfig = client.getConfig()
|
|
40
40
|
|
|
41
41
|
// Extract JWT token (uses centralized logic)
|
|
@@ -136,7 +136,7 @@ export function useStreamingQuery(graphId: string) {
|
|
|
136
136
|
const clientRef = useRef<QueryClient>(null)
|
|
137
137
|
|
|
138
138
|
useEffect(() => {
|
|
139
|
-
const sdkConfig =
|
|
139
|
+
const sdkConfig = getSDKClientConfig()
|
|
140
140
|
const clientConfig = client.getConfig()
|
|
141
141
|
clientRef.current = new QueryClient({
|
|
142
142
|
baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
|
|
@@ -230,7 +230,7 @@ export function useOperation<T = any>(operationId?: string) {
|
|
|
230
230
|
const clientRef = useRef<OperationClient>(null)
|
|
231
231
|
|
|
232
232
|
useEffect(() => {
|
|
233
|
-
const sdkConfig =
|
|
233
|
+
const sdkConfig = getSDKClientConfig()
|
|
234
234
|
const clientConfig = client.getConfig()
|
|
235
235
|
|
|
236
236
|
// Extract JWT token (uses centralized logic)
|
|
@@ -343,7 +343,7 @@ export function useMultipleOperations<T = any>() {
|
|
|
343
343
|
const clientRef = useRef<OperationClient>(null)
|
|
344
344
|
|
|
345
345
|
useEffect(() => {
|
|
346
|
-
const sdkConfig =
|
|
346
|
+
const sdkConfig = getSDKClientConfig()
|
|
347
347
|
const clientConfig = client.getConfig()
|
|
348
348
|
|
|
349
349
|
// Extract JWT token (uses centralized logic)
|
|
@@ -428,7 +428,7 @@ export function useSDKClients() {
|
|
|
428
428
|
})
|
|
429
429
|
|
|
430
430
|
useEffect(() => {
|
|
431
|
-
const sdkConfig =
|
|
431
|
+
const sdkConfig = getSDKClientConfig()
|
|
432
432
|
const clientConfig = client.getConfig()
|
|
433
433
|
|
|
434
434
|
// Extract JWT token (uses centralized logic)
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* RoboSystems SDK
|
|
3
|
-
*
|
|
2
|
+
* RoboSystems SDK Clients
|
|
3
|
+
* High-level clients with SSE support for the RoboSystems API
|
|
4
4
|
*/
|
|
5
|
+
import { AgentClient } from './AgentClient';
|
|
5
6
|
import type { TokenProvider } from './graphql/client';
|
|
7
|
+
import { InvestorClient } from './InvestorClient';
|
|
8
|
+
import { LedgerClient } from './LedgerClient';
|
|
6
9
|
import { OperationClient } from './OperationClient';
|
|
7
10
|
import { QueryClient } from './QueryClient';
|
|
8
|
-
import { AgentClient } from './AgentClient';
|
|
9
11
|
import { SSEClient } from './SSEClient';
|
|
10
|
-
import { InvestorClient } from './InvestorClient';
|
|
11
|
-
import { LedgerClient } from './LedgerClient';
|
|
12
|
-
import { ReportClient } from './ReportClient';
|
|
13
12
|
export type { TokenProvider } from './graphql/client';
|
|
14
|
-
export interface
|
|
13
|
+
export interface RoboSystemsClientConfig {
|
|
15
14
|
baseUrl?: string;
|
|
16
15
|
credentials?: 'include' | 'same-origin' | 'omit';
|
|
17
16
|
/**
|
|
@@ -30,15 +29,19 @@ export interface RoboSystemsExtensionConfig {
|
|
|
30
29
|
maxRetries?: number;
|
|
31
30
|
retryDelay?: number;
|
|
32
31
|
}
|
|
33
|
-
export declare class
|
|
32
|
+
export declare class RoboSystemsClients {
|
|
34
33
|
readonly query: QueryClient;
|
|
35
34
|
readonly agent: AgentClient;
|
|
36
35
|
readonly operations: OperationClient;
|
|
37
36
|
readonly ledger: LedgerClient;
|
|
38
37
|
readonly investor: InvestorClient;
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `ledger` instead — reports and publish lists are
|
|
40
|
+
* now part of the LedgerClient.
|
|
41
|
+
*/
|
|
42
|
+
readonly reports: LedgerClient;
|
|
40
43
|
private config;
|
|
41
|
-
constructor(config?:
|
|
44
|
+
constructor(config?: RoboSystemsClientConfig);
|
|
42
45
|
/**
|
|
43
46
|
* Convenience method to monitor any operation
|
|
44
47
|
*/
|
|
@@ -52,23 +55,23 @@ export declare class RoboSystemsExtensions {
|
|
|
52
55
|
*/
|
|
53
56
|
close(): void;
|
|
54
57
|
}
|
|
58
|
+
export * from './AgentClient';
|
|
59
|
+
export * from './config';
|
|
60
|
+
export * from './InvestorClient';
|
|
61
|
+
export * from './LedgerClient';
|
|
55
62
|
export * from './OperationClient';
|
|
56
63
|
export * from './QueryClient';
|
|
57
|
-
export * from './AgentClient';
|
|
58
64
|
export * from './SSEClient';
|
|
59
|
-
export
|
|
60
|
-
export * from './InvestorClient';
|
|
61
|
-
export * from './ReportClient';
|
|
62
|
-
export * from './config';
|
|
63
|
-
export { OperationClient, QueryClient, AgentClient, SSEClient, LedgerClient, InvestorClient, ReportClient, };
|
|
65
|
+
export { AgentClient, InvestorClient, LedgerClient, OperationClient, QueryClient, SSEClient };
|
|
64
66
|
export { useMultipleOperations, useOperation, useQuery, useSDKClients, useStreamingQuery, } from './hooks';
|
|
65
|
-
export declare const
|
|
67
|
+
export declare const clients: {
|
|
66
68
|
readonly query: QueryClient;
|
|
67
69
|
readonly agent: AgentClient;
|
|
68
70
|
readonly operations: OperationClient;
|
|
69
71
|
readonly ledger: LedgerClient;
|
|
70
72
|
readonly investor: InvestorClient;
|
|
71
|
-
|
|
73
|
+
/** @deprecated Use `ledger` instead */
|
|
74
|
+
readonly reports: LedgerClient;
|
|
72
75
|
monitorOperation: (operationId: string, onProgress?: (progress: any) => void) => Promise<any>;
|
|
73
76
|
createSSEClient: () => SSEClient;
|
|
74
77
|
close: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* RoboSystems SDK
|
|
4
|
-
*
|
|
3
|
+
* RoboSystems SDK Clients
|
|
4
|
+
* High-level clients with SSE support for the RoboSystems API
|
|
5
5
|
*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
7
|
if (k2 === undefined) k2 = k;
|
|
@@ -18,33 +18,31 @@ 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.
|
|
21
|
+
exports.analyzeFinancials = exports.agentQuery = exports.streamQuery = exports.executeQuery = exports.monitorOperation = exports.clients = exports.useStreamingQuery = exports.useSDKClients = exports.useQuery = exports.useOperation = exports.useMultipleOperations = exports.SSEClient = exports.QueryClient = exports.OperationClient = exports.LedgerClient = exports.InvestorClient = exports.AgentClient = exports.RoboSystemsClients = void 0;
|
|
22
22
|
const client_gen_1 = require("../client.gen");
|
|
23
|
+
const AgentClient_1 = require("./AgentClient");
|
|
24
|
+
Object.defineProperty(exports, "AgentClient", { enumerable: true, get: function () { return AgentClient_1.AgentClient; } });
|
|
23
25
|
const config_1 = require("./config");
|
|
26
|
+
const InvestorClient_1 = require("./InvestorClient");
|
|
27
|
+
Object.defineProperty(exports, "InvestorClient", { enumerable: true, get: function () { return InvestorClient_1.InvestorClient; } });
|
|
28
|
+
const LedgerClient_1 = require("./LedgerClient");
|
|
29
|
+
Object.defineProperty(exports, "LedgerClient", { enumerable: true, get: function () { return LedgerClient_1.LedgerClient; } });
|
|
24
30
|
const OperationClient_1 = require("./OperationClient");
|
|
25
31
|
Object.defineProperty(exports, "OperationClient", { enumerable: true, get: function () { return OperationClient_1.OperationClient; } });
|
|
26
32
|
const QueryClient_1 = require("./QueryClient");
|
|
27
33
|
Object.defineProperty(exports, "QueryClient", { enumerable: true, get: function () { return QueryClient_1.QueryClient; } });
|
|
28
|
-
const AgentClient_1 = require("./AgentClient");
|
|
29
|
-
Object.defineProperty(exports, "AgentClient", { enumerable: true, get: function () { return AgentClient_1.AgentClient; } });
|
|
30
34
|
const SSEClient_1 = require("./SSEClient");
|
|
31
35
|
Object.defineProperty(exports, "SSEClient", { enumerable: true, get: function () { return SSEClient_1.SSEClient; } });
|
|
32
|
-
|
|
33
|
-
Object.defineProperty(exports, "InvestorClient", { enumerable: true, get: function () { return InvestorClient_1.InvestorClient; } });
|
|
34
|
-
const LedgerClient_1 = require("./LedgerClient");
|
|
35
|
-
Object.defineProperty(exports, "LedgerClient", { enumerable: true, get: function () { return LedgerClient_1.LedgerClient; } });
|
|
36
|
-
const ReportClient_1 = require("./ReportClient");
|
|
37
|
-
Object.defineProperty(exports, "ReportClient", { enumerable: true, get: function () { return ReportClient_1.ReportClient; } });
|
|
38
|
-
class RoboSystemsExtensions {
|
|
36
|
+
class RoboSystemsClients {
|
|
39
37
|
constructor(config = {}) {
|
|
40
38
|
// Get base URL from SDK client config or use provided/default
|
|
41
39
|
const sdkConfig = client_gen_1.client.getConfig();
|
|
42
40
|
// Extract JWT token using centralized logic
|
|
43
41
|
const token = config.token || (0, config_1.extractTokenFromSDKClient)();
|
|
44
|
-
// `tokenProvider` falls back to the global SDK
|
|
45
|
-
// apps can wire refresh once via `
|
|
42
|
+
// `tokenProvider` falls back to the global SDK clients config so
|
|
43
|
+
// apps can wire refresh once via `setSDKClientConfig({ tokenProvider })`
|
|
46
44
|
// and have the lazy default singleton pick it up automatically.
|
|
47
|
-
const tokenProvider = config.tokenProvider || (0, config_1.
|
|
45
|
+
const tokenProvider = config.tokenProvider || (0, config_1.getSDKClientConfig)().tokenProvider;
|
|
48
46
|
this.config = {
|
|
49
47
|
baseUrl: config.baseUrl || sdkConfig.baseUrl || 'http://localhost:8000',
|
|
50
48
|
credentials: config.credentials || 'include',
|
|
@@ -73,11 +71,8 @@ class RoboSystemsExtensions {
|
|
|
73
71
|
maxRetries: this.config.maxRetries,
|
|
74
72
|
retryDelay: this.config.retryDelay,
|
|
75
73
|
});
|
|
76
|
-
// LedgerClient / InvestorClient
|
|
77
|
-
//
|
|
78
|
-
// (QueryClient / AgentClient / OperationClient / SSEClient) do
|
|
79
|
-
// not, because their refresh story lives in the main SDK client
|
|
80
|
-
// wrapper, not here.
|
|
74
|
+
// LedgerClient / InvestorClient use GraphQL internally, so they
|
|
75
|
+
// get the tokenProvider — REST-only clients do not.
|
|
81
76
|
this.ledger = new LedgerClient_1.LedgerClient({
|
|
82
77
|
baseUrl: this.config.baseUrl,
|
|
83
78
|
credentials: this.config.credentials,
|
|
@@ -92,13 +87,8 @@ class RoboSystemsExtensions {
|
|
|
92
87
|
tokenProvider: this.config.tokenProvider,
|
|
93
88
|
headers: this.config.headers,
|
|
94
89
|
});
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
credentials: this.config.credentials,
|
|
98
|
-
token: this.config.token,
|
|
99
|
-
tokenProvider: this.config.tokenProvider,
|
|
100
|
-
headers: this.config.headers,
|
|
101
|
-
});
|
|
90
|
+
// Reports consolidated into LedgerClient — alias for backward compat
|
|
91
|
+
this.reports = this.ledger;
|
|
102
92
|
}
|
|
103
93
|
/**
|
|
104
94
|
* Convenience method to monitor any operation
|
|
@@ -128,16 +118,15 @@ class RoboSystemsExtensions {
|
|
|
128
118
|
this.operations.closeAll();
|
|
129
119
|
}
|
|
130
120
|
}
|
|
131
|
-
exports.
|
|
121
|
+
exports.RoboSystemsClients = RoboSystemsClients;
|
|
132
122
|
// Export all types and classes
|
|
123
|
+
__exportStar(require("./AgentClient"), exports);
|
|
124
|
+
__exportStar(require("./config"), exports);
|
|
125
|
+
__exportStar(require("./InvestorClient"), exports);
|
|
126
|
+
__exportStar(require("./LedgerClient"), exports);
|
|
133
127
|
__exportStar(require("./OperationClient"), exports);
|
|
134
128
|
__exportStar(require("./QueryClient"), exports);
|
|
135
|
-
__exportStar(require("./AgentClient"), exports);
|
|
136
129
|
__exportStar(require("./SSEClient"), exports);
|
|
137
|
-
__exportStar(require("./LedgerClient"), exports);
|
|
138
|
-
__exportStar(require("./InvestorClient"), exports);
|
|
139
|
-
__exportStar(require("./ReportClient"), exports);
|
|
140
|
-
__exportStar(require("./config"), exports);
|
|
141
130
|
// Export React hooks
|
|
142
131
|
var hooks_1 = require("./hooks");
|
|
143
132
|
Object.defineProperty(exports, "useMultipleOperations", { enumerable: true, get: function () { return hooks_1.useMultipleOperations; } });
|
|
@@ -146,44 +135,45 @@ Object.defineProperty(exports, "useQuery", { enumerable: true, get: function ()
|
|
|
146
135
|
Object.defineProperty(exports, "useSDKClients", { enumerable: true, get: function () { return hooks_1.useSDKClients; } });
|
|
147
136
|
Object.defineProperty(exports, "useStreamingQuery", { enumerable: true, get: function () { return hooks_1.useStreamingQuery; } });
|
|
148
137
|
// Lazy initialization of default instance
|
|
149
|
-
let
|
|
150
|
-
function
|
|
151
|
-
if (!
|
|
152
|
-
|
|
138
|
+
let _clients = null;
|
|
139
|
+
function getClients() {
|
|
140
|
+
if (!_clients) {
|
|
141
|
+
_clients = new RoboSystemsClients();
|
|
153
142
|
}
|
|
154
|
-
return
|
|
143
|
+
return _clients;
|
|
155
144
|
}
|
|
156
|
-
exports.
|
|
145
|
+
exports.clients = {
|
|
157
146
|
get query() {
|
|
158
|
-
return
|
|
147
|
+
return getClients().query;
|
|
159
148
|
},
|
|
160
149
|
get agent() {
|
|
161
|
-
return
|
|
150
|
+
return getClients().agent;
|
|
162
151
|
},
|
|
163
152
|
get operations() {
|
|
164
|
-
return
|
|
153
|
+
return getClients().operations;
|
|
165
154
|
},
|
|
166
155
|
get ledger() {
|
|
167
|
-
return
|
|
156
|
+
return getClients().ledger;
|
|
168
157
|
},
|
|
169
158
|
get investor() {
|
|
170
|
-
return
|
|
159
|
+
return getClients().investor;
|
|
171
160
|
},
|
|
161
|
+
/** @deprecated Use `ledger` instead */
|
|
172
162
|
get reports() {
|
|
173
|
-
return
|
|
163
|
+
return getClients().ledger;
|
|
174
164
|
},
|
|
175
|
-
monitorOperation: (operationId, onProgress) =>
|
|
176
|
-
createSSEClient: () =>
|
|
177
|
-
close: () =>
|
|
165
|
+
monitorOperation: (operationId, onProgress) => getClients().monitorOperation(operationId, onProgress),
|
|
166
|
+
createSSEClient: () => getClients().createSSEClient(),
|
|
167
|
+
close: () => getClients().close(),
|
|
178
168
|
};
|
|
179
169
|
// Export convenience functions that use the default instance
|
|
180
|
-
const monitorOperation = (operationId, onProgress) =>
|
|
170
|
+
const monitorOperation = (operationId, onProgress) => getClients().monitorOperation(operationId, onProgress);
|
|
181
171
|
exports.monitorOperation = monitorOperation;
|
|
182
|
-
const executeQuery = (graphId, query, parameters) =>
|
|
172
|
+
const executeQuery = (graphId, query, parameters) => getClients().query.query(graphId, query, parameters);
|
|
183
173
|
exports.executeQuery = executeQuery;
|
|
184
|
-
const streamQuery = (graphId, query, parameters, chunkSize) =>
|
|
174
|
+
const streamQuery = (graphId, query, parameters, chunkSize) => getClients().query.streamQuery(graphId, query, parameters, chunkSize);
|
|
185
175
|
exports.streamQuery = streamQuery;
|
|
186
|
-
const agentQuery = (graphId, message, context) =>
|
|
176
|
+
const agentQuery = (graphId, message, context) => getClients().agent.query(graphId, message, context);
|
|
187
177
|
exports.agentQuery = agentQuery;
|
|
188
|
-
const analyzeFinancials = (graphId, message) =>
|
|
178
|
+
const analyzeFinancials = (graphId, message) => getClients().agent.analyzeFinancials(graphId, message);
|
|
189
179
|
exports.analyzeFinancials = analyzeFinancials;
|