@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.
Files changed (161) hide show
  1. package/{extensions → artifacts}/InvestorClient.js +0 -1
  2. package/{extensions → artifacts}/InvestorClient.ts +1 -1
  3. package/{extensions → artifacts}/LedgerClient.d.ts +168 -2
  4. package/{extensions → artifacts}/LedgerClient.js +301 -2
  5. package/{extensions → artifacts}/LedgerClient.ts +645 -2
  6. package/{extensions → artifacts}/config.d.ts +11 -11
  7. package/{extensions → artifacts}/config.js +11 -11
  8. package/{extensions → artifacts}/config.ts +16 -16
  9. package/{extensions → artifacts}/graphql/client.d.ts +1 -1
  10. package/{extensions → artifacts}/graphql/client.js +1 -2
  11. package/{extensions → artifacts}/graphql/client.ts +2 -2
  12. package/{extensions → artifacts}/hooks.js +6 -6
  13. package/{extensions → artifacts}/hooks.ts +7 -7
  14. package/{extensions → artifacts}/index.d.ts +21 -18
  15. package/{extensions → artifacts}/index.js +43 -53
  16. package/{extensions → artifacts}/index.ts +47 -60
  17. package/index.d.ts +2 -2
  18. package/index.js +2 -2
  19. package/index.ts +2 -2
  20. package/package.json +38 -8
  21. package/sdk/index.d.ts +2 -2
  22. package/sdk/index.js +27 -9
  23. package/sdk/index.ts +2 -2
  24. package/sdk/sdk.gen.d.ts +272 -274
  25. package/sdk/sdk.gen.js +468 -312
  26. package/sdk/sdk.gen.ts +464 -309
  27. package/sdk/types.gen.d.ts +2962 -440
  28. package/sdk/types.gen.ts +3058 -430
  29. package/sdk.gen.d.ts +272 -274
  30. package/sdk.gen.js +468 -312
  31. package/sdk.gen.ts +464 -309
  32. package/types.gen.d.ts +2962 -440
  33. package/types.gen.ts +3058 -430
  34. package/extensions/ReportClient.d.ts +0 -120
  35. package/extensions/ReportClient.js +0 -191
  36. package/extensions/ReportClient.ts +0 -433
  37. /package/{extensions → artifacts}/AgentClient.d.ts +0 -0
  38. /package/{extensions → artifacts}/AgentClient.js +0 -0
  39. /package/{extensions → artifacts}/AgentClient.ts +0 -0
  40. /package/{extensions → artifacts}/InvestorClient.d.ts +0 -0
  41. /package/{extensions → artifacts}/OperationClient.d.ts +0 -0
  42. /package/{extensions → artifacts}/OperationClient.js +0 -0
  43. /package/{extensions → artifacts}/OperationClient.ts +0 -0
  44. /package/{extensions → artifacts}/QueryClient.d.ts +0 -0
  45. /package/{extensions → artifacts}/QueryClient.js +0 -0
  46. /package/{extensions → artifacts}/QueryClient.ts +0 -0
  47. /package/{extensions → artifacts}/SSEClient.d.ts +0 -0
  48. /package/{extensions → artifacts}/SSEClient.js +0 -0
  49. /package/{extensions → artifacts}/SSEClient.ts +0 -0
  50. /package/{extensions → artifacts}/graphql/generated/graphql.d.ts +0 -0
  51. /package/{extensions → artifacts}/graphql/generated/graphql.js +0 -0
  52. /package/{extensions → artifacts}/graphql/generated/graphql.ts +0 -0
  53. /package/{extensions → artifacts}/graphql/queries/investor/holdings.d.ts +0 -0
  54. /package/{extensions → artifacts}/graphql/queries/investor/holdings.js +0 -0
  55. /package/{extensions → artifacts}/graphql/queries/investor/holdings.ts +0 -0
  56. /package/{extensions → artifacts}/graphql/queries/investor/portfolio.d.ts +0 -0
  57. /package/{extensions → artifacts}/graphql/queries/investor/portfolio.js +0 -0
  58. /package/{extensions → artifacts}/graphql/queries/investor/portfolio.ts +0 -0
  59. /package/{extensions → artifacts}/graphql/queries/investor/portfolios.d.ts +0 -0
  60. /package/{extensions → artifacts}/graphql/queries/investor/portfolios.js +0 -0
  61. /package/{extensions → artifacts}/graphql/queries/investor/portfolios.ts +0 -0
  62. /package/{extensions → artifacts}/graphql/queries/investor/position.d.ts +0 -0
  63. /package/{extensions → artifacts}/graphql/queries/investor/position.js +0 -0
  64. /package/{extensions → artifacts}/graphql/queries/investor/position.ts +0 -0
  65. /package/{extensions → artifacts}/graphql/queries/investor/positions.d.ts +0 -0
  66. /package/{extensions → artifacts}/graphql/queries/investor/positions.js +0 -0
  67. /package/{extensions → artifacts}/graphql/queries/investor/positions.ts +0 -0
  68. /package/{extensions → artifacts}/graphql/queries/investor/securities.d.ts +0 -0
  69. /package/{extensions → artifacts}/graphql/queries/investor/securities.js +0 -0
  70. /package/{extensions → artifacts}/graphql/queries/investor/securities.ts +0 -0
  71. /package/{extensions → artifacts}/graphql/queries/investor/security.d.ts +0 -0
  72. /package/{extensions → artifacts}/graphql/queries/investor/security.js +0 -0
  73. /package/{extensions → artifacts}/graphql/queries/investor/security.ts +0 -0
  74. /package/{extensions → artifacts}/graphql/queries/ledger/accountRollups.d.ts +0 -0
  75. /package/{extensions → artifacts}/graphql/queries/ledger/accountRollups.js +0 -0
  76. /package/{extensions → artifacts}/graphql/queries/ledger/accountRollups.ts +0 -0
  77. /package/{extensions → artifacts}/graphql/queries/ledger/accountTree.d.ts +0 -0
  78. /package/{extensions → artifacts}/graphql/queries/ledger/accountTree.js +0 -0
  79. /package/{extensions → artifacts}/graphql/queries/ledger/accountTree.ts +0 -0
  80. /package/{extensions → artifacts}/graphql/queries/ledger/accounts.d.ts +0 -0
  81. /package/{extensions → artifacts}/graphql/queries/ledger/accounts.js +0 -0
  82. /package/{extensions → artifacts}/graphql/queries/ledger/accounts.ts +0 -0
  83. /package/{extensions → artifacts}/graphql/queries/ledger/closingBookStructures.d.ts +0 -0
  84. /package/{extensions → artifacts}/graphql/queries/ledger/closingBookStructures.js +0 -0
  85. /package/{extensions → artifacts}/graphql/queries/ledger/closingBookStructures.ts +0 -0
  86. /package/{extensions → artifacts}/graphql/queries/ledger/elements.d.ts +0 -0
  87. /package/{extensions → artifacts}/graphql/queries/ledger/elements.js +0 -0
  88. /package/{extensions → artifacts}/graphql/queries/ledger/elements.ts +0 -0
  89. /package/{extensions → artifacts}/graphql/queries/ledger/entities.d.ts +0 -0
  90. /package/{extensions → artifacts}/graphql/queries/ledger/entities.js +0 -0
  91. /package/{extensions → artifacts}/graphql/queries/ledger/entities.ts +0 -0
  92. /package/{extensions → artifacts}/graphql/queries/ledger/entity.d.ts +0 -0
  93. /package/{extensions → artifacts}/graphql/queries/ledger/entity.js +0 -0
  94. /package/{extensions → artifacts}/graphql/queries/ledger/entity.ts +0 -0
  95. /package/{extensions → artifacts}/graphql/queries/ledger/fiscalCalendar.d.ts +0 -0
  96. /package/{extensions → artifacts}/graphql/queries/ledger/fiscalCalendar.js +0 -0
  97. /package/{extensions → artifacts}/graphql/queries/ledger/fiscalCalendar.ts +0 -0
  98. /package/{extensions → artifacts}/graphql/queries/ledger/mappedTrialBalance.d.ts +0 -0
  99. /package/{extensions → artifacts}/graphql/queries/ledger/mappedTrialBalance.js +0 -0
  100. /package/{extensions → artifacts}/graphql/queries/ledger/mappedTrialBalance.ts +0 -0
  101. /package/{extensions → artifacts}/graphql/queries/ledger/mapping.d.ts +0 -0
  102. /package/{extensions → artifacts}/graphql/queries/ledger/mapping.js +0 -0
  103. /package/{extensions → artifacts}/graphql/queries/ledger/mapping.ts +0 -0
  104. /package/{extensions → artifacts}/graphql/queries/ledger/mappingCoverage.d.ts +0 -0
  105. /package/{extensions → artifacts}/graphql/queries/ledger/mappingCoverage.js +0 -0
  106. /package/{extensions → artifacts}/graphql/queries/ledger/mappingCoverage.ts +0 -0
  107. /package/{extensions → artifacts}/graphql/queries/ledger/mappings.d.ts +0 -0
  108. /package/{extensions → artifacts}/graphql/queries/ledger/mappings.js +0 -0
  109. /package/{extensions → artifacts}/graphql/queries/ledger/mappings.ts +0 -0
  110. /package/{extensions → artifacts}/graphql/queries/ledger/periodCloseStatus.d.ts +0 -0
  111. /package/{extensions → artifacts}/graphql/queries/ledger/periodCloseStatus.js +0 -0
  112. /package/{extensions → artifacts}/graphql/queries/ledger/periodCloseStatus.ts +0 -0
  113. /package/{extensions → artifacts}/graphql/queries/ledger/periodDrafts.d.ts +0 -0
  114. /package/{extensions → artifacts}/graphql/queries/ledger/periodDrafts.js +0 -0
  115. /package/{extensions → artifacts}/graphql/queries/ledger/periodDrafts.ts +0 -0
  116. /package/{extensions → artifacts}/graphql/queries/ledger/publishList.d.ts +0 -0
  117. /package/{extensions → artifacts}/graphql/queries/ledger/publishList.js +0 -0
  118. /package/{extensions → artifacts}/graphql/queries/ledger/publishList.ts +0 -0
  119. /package/{extensions → artifacts}/graphql/queries/ledger/publishLists.d.ts +0 -0
  120. /package/{extensions → artifacts}/graphql/queries/ledger/publishLists.js +0 -0
  121. /package/{extensions → artifacts}/graphql/queries/ledger/publishLists.ts +0 -0
  122. /package/{extensions → artifacts}/graphql/queries/ledger/report.d.ts +0 -0
  123. /package/{extensions → artifacts}/graphql/queries/ledger/report.js +0 -0
  124. /package/{extensions → artifacts}/graphql/queries/ledger/report.ts +0 -0
  125. /package/{extensions → artifacts}/graphql/queries/ledger/reportingTaxonomy.d.ts +0 -0
  126. /package/{extensions → artifacts}/graphql/queries/ledger/reportingTaxonomy.js +0 -0
  127. /package/{extensions → artifacts}/graphql/queries/ledger/reportingTaxonomy.ts +0 -0
  128. /package/{extensions → artifacts}/graphql/queries/ledger/reports.d.ts +0 -0
  129. /package/{extensions → artifacts}/graphql/queries/ledger/reports.js +0 -0
  130. /package/{extensions → artifacts}/graphql/queries/ledger/reports.ts +0 -0
  131. /package/{extensions → artifacts}/graphql/queries/ledger/scheduleFacts.d.ts +0 -0
  132. /package/{extensions → artifacts}/graphql/queries/ledger/scheduleFacts.js +0 -0
  133. /package/{extensions → artifacts}/graphql/queries/ledger/scheduleFacts.ts +0 -0
  134. /package/{extensions → artifacts}/graphql/queries/ledger/schedules.d.ts +0 -0
  135. /package/{extensions → artifacts}/graphql/queries/ledger/schedules.js +0 -0
  136. /package/{extensions → artifacts}/graphql/queries/ledger/schedules.ts +0 -0
  137. /package/{extensions → artifacts}/graphql/queries/ledger/statement.d.ts +0 -0
  138. /package/{extensions → artifacts}/graphql/queries/ledger/statement.js +0 -0
  139. /package/{extensions → artifacts}/graphql/queries/ledger/statement.ts +0 -0
  140. /package/{extensions → artifacts}/graphql/queries/ledger/structures.d.ts +0 -0
  141. /package/{extensions → artifacts}/graphql/queries/ledger/structures.js +0 -0
  142. /package/{extensions → artifacts}/graphql/queries/ledger/structures.ts +0 -0
  143. /package/{extensions → artifacts}/graphql/queries/ledger/summary.d.ts +0 -0
  144. /package/{extensions → artifacts}/graphql/queries/ledger/summary.js +0 -0
  145. /package/{extensions → artifacts}/graphql/queries/ledger/summary.ts +0 -0
  146. /package/{extensions → artifacts}/graphql/queries/ledger/taxonomies.d.ts +0 -0
  147. /package/{extensions → artifacts}/graphql/queries/ledger/taxonomies.js +0 -0
  148. /package/{extensions → artifacts}/graphql/queries/ledger/taxonomies.ts +0 -0
  149. /package/{extensions → artifacts}/graphql/queries/ledger/transaction.d.ts +0 -0
  150. /package/{extensions → artifacts}/graphql/queries/ledger/transaction.js +0 -0
  151. /package/{extensions → artifacts}/graphql/queries/ledger/transaction.ts +0 -0
  152. /package/{extensions → artifacts}/graphql/queries/ledger/transactions.d.ts +0 -0
  153. /package/{extensions → artifacts}/graphql/queries/ledger/transactions.js +0 -0
  154. /package/{extensions → artifacts}/graphql/queries/ledger/transactions.ts +0 -0
  155. /package/{extensions → artifacts}/graphql/queries/ledger/trialBalance.d.ts +0 -0
  156. /package/{extensions → artifacts}/graphql/queries/ledger/trialBalance.js +0 -0
  157. /package/{extensions → artifacts}/graphql/queries/ledger/trialBalance.ts +0 -0
  158. /package/{extensions → artifacts}/graphql/queries/ledger/unmappedElements.d.ts +0 -0
  159. /package/{extensions → artifacts}/graphql/queries/ledger/unmappedElements.js +0 -0
  160. /package/{extensions → artifacts}/graphql/queries/ledger/unmappedElements.ts +0 -0
  161. /package/{extensions → artifacts}/hooks.d.ts +0 -0
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Configuration for SDK extensions
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 SDKExtensionsConfig {
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
- * `extensions` singleton picks it up at construction, and each
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 extensions
34
+ * Set global configuration for SDK clients
35
35
  * @param config Partial configuration to merge with defaults
36
36
  */
37
- export declare function setSDKExtensionsConfig(config: Partial<SDKExtensionsConfig>): void;
37
+ export declare function setSDKClientConfig(config: Partial<SDKClientConfig>): void;
38
38
  /**
39
- * Get current SDK extensions configuration
39
+ * Get current SDK clients configuration
40
40
  * @returns Current configuration
41
41
  */
42
- export declare function getSDKExtensionsConfig(): SDKExtensionsConfig;
42
+ export declare function getSDKClientConfig(): SDKClientConfig;
43
43
  /**
44
44
  * Reset configuration to defaults
45
45
  */
46
- export declare function resetSDKExtensionsConfig(): void;
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 extensions for JWT authentication
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<SDKExtensionsConfig>): void;
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'): SDKExtensionsConfig;
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.setSDKExtensionsConfig = setSDKExtensionsConfig;
5
- exports.getSDKExtensionsConfig = getSDKExtensionsConfig;
6
- exports.resetSDKExtensionsConfig = resetSDKExtensionsConfig;
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 extensions
24
+ * Set global configuration for SDK clients
25
25
  * @param config Partial configuration to merge with defaults
26
26
  */
27
- function setSDKExtensionsConfig(config) {
27
+ function setSDKClientConfig(config) {
28
28
  globalConfig = {
29
29
  ...globalConfig,
30
30
  ...config,
31
31
  };
32
32
  }
33
33
  /**
34
- * Get current SDK extensions configuration
34
+ * Get current SDK clients configuration
35
35
  * @returns Current configuration
36
36
  */
37
- function getSDKExtensionsConfig() {
37
+ function getSDKClientConfig() {
38
38
  return { ...globalConfig };
39
39
  }
40
40
  /**
41
41
  * Reset configuration to defaults
42
42
  */
43
- function resetSDKExtensionsConfig() {
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 = getSDKExtensionsConfig();
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 extensions for JWT authentication
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
- setSDKExtensionsConfig({
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 extensions
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 SDKExtensionsConfig {
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
- * `extensions` singleton picks it up at construction, and each
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: SDKExtensionsConfig = {
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: SDKExtensionsConfig = { ...defaultConfig }
49
+ let globalConfig: SDKClientConfig = { ...defaultConfig }
50
50
 
51
51
  /**
52
- * Set global configuration for SDK extensions
52
+ * Set global configuration for SDK clients
53
53
  * @param config Partial configuration to merge with defaults
54
54
  */
55
- export function setSDKExtensionsConfig(config: Partial<SDKExtensionsConfig>) {
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 extensions configuration
63
+ * Get current SDK clients configuration
64
64
  * @returns Current configuration
65
65
  */
66
- export function getSDKExtensionsConfig(): SDKExtensionsConfig {
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 resetSDKExtensionsConfig() {
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 = getSDKExtensionsConfig()
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 extensions for JWT authentication
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<SDKExtensionsConfig>) {
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
- setSDKExtensionsConfig({
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
- ): SDKExtensionsConfig {
167
- const baseConfigs: Record<string, Partial<SDKExtensionsConfig>> = {
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 sdk-extensions/graphql/queries/.
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 sdk-extensions/graphql/queries/.
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 sdk-extensions/graphql/queries/.
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
- // eslint-disable-next-line no-console
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 extensions
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.getSDKExtensionsConfig)();
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.getSDKExtensionsConfig)();
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.getSDKExtensionsConfig)();
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.getSDKExtensionsConfig)();
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.getSDKExtensionsConfig)();
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 extensions
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, getSDKExtensionsConfig } from './config'
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 = getSDKExtensionsConfig()
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 = getSDKExtensionsConfig()
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 = getSDKExtensionsConfig()
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 = getSDKExtensionsConfig()
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 = getSDKExtensionsConfig()
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 Extensions
3
- * Enhanced clients with SSE support for the RoboSystems API
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 RoboSystemsExtensionConfig {
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 RoboSystemsExtensions {
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
- readonly reports: ReportClient;
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?: RoboSystemsExtensionConfig);
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 * from './LedgerClient';
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 extensions: {
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
- readonly reports: ReportClient;
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 Extensions
4
- * Enhanced clients with SSE support for the RoboSystems API
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.extensions = exports.useStreamingQuery = exports.useSDKClients = exports.useQuery = exports.useOperation = exports.useMultipleOperations = exports.ReportClient = exports.InvestorClient = exports.LedgerClient = exports.SSEClient = exports.AgentClient = exports.QueryClient = exports.OperationClient = exports.RoboSystemsExtensions = void 0;
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
- const InvestorClient_1 = require("./InvestorClient");
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 extensions config so
45
- // apps can wire refresh once via `setSDKExtensionsConfig({ tokenProvider })`
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.getSDKExtensionsConfig)().tokenProvider;
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 / ReportClient all use GraphQL
77
- // internally, so they get the tokenProvider — REST-only clients
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
- this.reports = new ReportClient_1.ReportClient({
96
- baseUrl: this.config.baseUrl,
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.RoboSystemsExtensions = RoboSystemsExtensions;
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 _extensions = null;
150
- function getExtensions() {
151
- if (!_extensions) {
152
- _extensions = new RoboSystemsExtensions();
138
+ let _clients = null;
139
+ function getClients() {
140
+ if (!_clients) {
141
+ _clients = new RoboSystemsClients();
153
142
  }
154
- return _extensions;
143
+ return _clients;
155
144
  }
156
- exports.extensions = {
145
+ exports.clients = {
157
146
  get query() {
158
- return getExtensions().query;
147
+ return getClients().query;
159
148
  },
160
149
  get agent() {
161
- return getExtensions().agent;
150
+ return getClients().agent;
162
151
  },
163
152
  get operations() {
164
- return getExtensions().operations;
153
+ return getClients().operations;
165
154
  },
166
155
  get ledger() {
167
- return getExtensions().ledger;
156
+ return getClients().ledger;
168
157
  },
169
158
  get investor() {
170
- return getExtensions().investor;
159
+ return getClients().investor;
171
160
  },
161
+ /** @deprecated Use `ledger` instead */
172
162
  get reports() {
173
- return getExtensions().reports;
163
+ return getClients().ledger;
174
164
  },
175
- monitorOperation: (operationId, onProgress) => getExtensions().monitorOperation(operationId, onProgress),
176
- createSSEClient: () => getExtensions().createSSEClient(),
177
- close: () => getExtensions().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) => getExtensions().monitorOperation(operationId, onProgress);
170
+ const monitorOperation = (operationId, onProgress) => getClients().monitorOperation(operationId, onProgress);
181
171
  exports.monitorOperation = monitorOperation;
182
- const executeQuery = (graphId, query, parameters) => getExtensions().query.query(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) => getExtensions().query.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) => getExtensions().agent.query(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) => getExtensions().agent.analyzeFinancials(graphId, message);
178
+ const analyzeFinancials = (graphId, message) => getClients().agent.analyzeFinancials(graphId, message);
189
179
  exports.analyzeFinancials = analyzeFinancials;