@robosystems/client 0.2.6 → 0.2.8

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.
@@ -36,6 +36,7 @@ export declare class QueryClient {
36
36
  token?: string;
37
37
  });
38
38
  executeQuery(graphId: string, request: QueryRequest, options?: QueryOptions): Promise<QueryResult | AsyncIterableIterator<any>>;
39
+ private parseNDJSONResponse;
39
40
  private streamQueryResults;
40
41
  private waitForQueryCompletion;
41
42
  query(graphId: string, cypher: string, parameters?: Record<string, any>): Promise<QueryResult>;
@@ -27,6 +27,15 @@ class QueryClient {
27
27
  };
28
28
  // Execute the query
29
29
  const response = await (0, sdk_gen_1.executeCypherQuery)(data);
30
+ // Check if this is an NDJSON streaming response
31
+ // The SDK returns the response object which includes the raw Response
32
+ if (response.response) {
33
+ const contentType = response.response.headers.get('content-type') || '';
34
+ const streamFormat = response.response.headers.get('x-stream-format');
35
+ if (contentType.includes('application/x-ndjson') || streamFormat === 'ndjson') {
36
+ return this.parseNDJSONResponse(response.response, graphId);
37
+ }
38
+ }
30
39
  const responseData = response.data;
31
40
  // Check if this is an immediate response
32
41
  if (responseData?.data !== undefined && responseData?.columns) {
@@ -59,6 +68,51 @@ class QueryClient {
59
68
  // Unexpected response format
60
69
  throw new Error('Unexpected response format from query endpoint');
61
70
  }
71
+ async parseNDJSONResponse(response, graphId) {
72
+ const allData = [];
73
+ let columns = null;
74
+ let totalRows = 0;
75
+ let executionTimeMs = 0;
76
+ // Parse NDJSON line by line
77
+ const text = await response.text();
78
+ const lines = text.trim().split('\n');
79
+ for (const line of lines) {
80
+ if (!line.trim())
81
+ continue;
82
+ try {
83
+ const chunk = JSON.parse(line);
84
+ // Extract columns from first chunk
85
+ if (columns === null && chunk.columns) {
86
+ columns = chunk.columns;
87
+ }
88
+ // Aggregate data rows (NDJSON uses "rows", regular JSON uses "data")
89
+ if (chunk.rows) {
90
+ allData.push(...chunk.rows);
91
+ totalRows += chunk.rows.length;
92
+ }
93
+ else if (chunk.data) {
94
+ allData.push(...chunk.data);
95
+ totalRows += chunk.data.length;
96
+ }
97
+ // Track execution time (use max from all chunks)
98
+ if (chunk.execution_time_ms) {
99
+ executionTimeMs = Math.max(executionTimeMs, chunk.execution_time_ms);
100
+ }
101
+ }
102
+ catch (error) {
103
+ throw new Error(`Failed to parse NDJSON line: ${error}`);
104
+ }
105
+ }
106
+ // Return aggregated result
107
+ return {
108
+ data: allData,
109
+ columns: columns || [],
110
+ row_count: totalRows,
111
+ execution_time_ms: executionTimeMs,
112
+ graph_id: graphId,
113
+ timestamp: new Date().toISOString(),
114
+ };
115
+ }
62
116
  async *streamQueryResults(operationId, options) {
63
117
  const buffer = [];
64
118
  let completed = false;
@@ -79,6 +79,18 @@ export class QueryClient {
79
79
 
80
80
  // Execute the query
81
81
  const response = await executeCypherQuery(data)
82
+
83
+ // Check if this is an NDJSON streaming response
84
+ // The SDK returns the response object which includes the raw Response
85
+ if (response.response) {
86
+ const contentType = response.response.headers.get('content-type') || ''
87
+ const streamFormat = response.response.headers.get('x-stream-format')
88
+
89
+ if (contentType.includes('application/x-ndjson') || streamFormat === 'ndjson') {
90
+ return this.parseNDJSONResponse(response.response, graphId)
91
+ }
92
+ }
93
+
82
94
  const responseData = response.data as any
83
95
 
84
96
  // Check if this is an immediate response
@@ -117,6 +129,56 @@ export class QueryClient {
117
129
  throw new Error('Unexpected response format from query endpoint')
118
130
  }
119
131
 
132
+ private async parseNDJSONResponse(response: Response, graphId: string): Promise<QueryResult> {
133
+ const allData: any[] = []
134
+ let columns: string[] | null = null
135
+ let totalRows = 0
136
+ let executionTimeMs = 0
137
+
138
+ // Parse NDJSON line by line
139
+ const text = await response.text()
140
+ const lines = text.trim().split('\n')
141
+
142
+ for (const line of lines) {
143
+ if (!line.trim()) continue
144
+
145
+ try {
146
+ const chunk = JSON.parse(line)
147
+
148
+ // Extract columns from first chunk
149
+ if (columns === null && chunk.columns) {
150
+ columns = chunk.columns
151
+ }
152
+
153
+ // Aggregate data rows (NDJSON uses "rows", regular JSON uses "data")
154
+ if (chunk.rows) {
155
+ allData.push(...chunk.rows)
156
+ totalRows += chunk.rows.length
157
+ } else if (chunk.data) {
158
+ allData.push(...chunk.data)
159
+ totalRows += chunk.data.length
160
+ }
161
+
162
+ // Track execution time (use max from all chunks)
163
+ if (chunk.execution_time_ms) {
164
+ executionTimeMs = Math.max(executionTimeMs, chunk.execution_time_ms)
165
+ }
166
+ } catch (error) {
167
+ throw new Error(`Failed to parse NDJSON line: ${error}`)
168
+ }
169
+ }
170
+
171
+ // Return aggregated result
172
+ return {
173
+ data: allData,
174
+ columns: columns || [],
175
+ row_count: totalRows,
176
+ execution_time_ms: executionTimeMs,
177
+ graph_id: graphId,
178
+ timestamp: new Date().toISOString(),
179
+ }
180
+ }
181
+
120
182
  private async *streamQueryResults(
121
183
  operationId: string,
122
184
  options: QueryOptions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robosystems/client",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "TypeScript client library for RoboSystems Financial Knowledge Graph API",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/sdk/sdk.gen.d.ts CHANGED
@@ -1589,38 +1589,45 @@ export declare const ingestTables: <ThrowOnError extends boolean = false>(option
1589
1589
  */
1590
1590
  export declare const queryTables: <ThrowOnError extends boolean = false>(options: Options<QueryTablesData, ThrowOnError>) => import("./client").RequestResult<QueryTablesResponses, QueryTablesErrors, ThrowOnError, "fields">;
1591
1591
  /**
1592
- * Get User Graphs
1593
- * List all graph databases accessible to the current user with roles and selection status.
1592
+ * Get User Graphs and Repositories
1593
+ * List all graph databases and shared repositories accessible to the current user.
1594
1594
  *
1595
- * Returns a comprehensive list of all graphs the user can access, including their
1596
- * role in each graph (admin or member) and which graph is currently selected as
1597
- * the active workspace.
1595
+ * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
1596
+ * that the user has access to, including their role/access level and selection status.
1598
1597
  *
1599
1598
  * **Returned Information:**
1600
- * - Graph ID and display name for each accessible graph
1601
- * - User's role (admin/member) indicating permission level
1602
- * - Selection status (one graph can be marked as "selected")
1603
- * - Creation timestamp for each graph
1604
- *
1605
- * **Graph Roles:**
1606
- * - `admin`: Full access - can manage graph settings, invite users, delete graph
1607
- * - `member`: Read/write access - can query and modify data, cannot manage settings
1599
+ * - Graph/Repository ID and display name
1600
+ * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
1601
+ * - Selection status (only user graphs can be selected)
1602
+ * - Creation timestamp
1603
+ * - Repository type indicator (isRepository: true for shared repositories)
1604
+ *
1605
+ * **User Graphs (isRepository: false):**
1606
+ * - Collaborative workspaces that can be shared with other users
1607
+ * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
1608
+ * - Can be selected as active workspace
1609
+ * - Graphs you create or have been invited to
1610
+ *
1611
+ * **Shared Repositories (isRepository: true):**
1612
+ * - Read-only data repositories like SEC filings, industry benchmarks
1613
+ * - Access levels: `read`, `write` (for data contributions), `admin`
1614
+ * - Cannot be selected (each has separate subscription)
1615
+ * - Require separate subscriptions (personal, cannot be shared)
1608
1616
  *
1609
1617
  * **Selected Graph Concept:**
1610
- * The "selected" graph is the user's currently active workspace. Many API operations
1611
- * default to the selected graph if no graph_id is provided. Users can change their
1612
- * selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
1618
+ * The "selected" graph is the user's currently active workspace (user graphs only).
1619
+ * Many API operations default to the selected graph if no graph_id is provided.
1620
+ * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
1613
1621
  *
1614
1622
  * **Use Cases:**
1615
- * - Display graph selector in UI
1616
- * - Show user's accessible workspaces
1617
- * - Identify which graph is currently active
1618
- * - Filter graphs by role for permission-based features
1623
+ * - Display unified graph/repository selector in UI
1624
+ * - Show all accessible data sources (both owned graphs and subscribed repositories)
1625
+ * - Identify currently active workspace
1626
+ * - Filter by type (user graphs vs repositories)
1619
1627
  *
1620
1628
  * **Empty Response:**
1621
- * New users or users without graph access will receive an empty list with
1622
- * `selectedGraphId: null`. Users should create a new graph or request access
1623
- * to an existing graph.
1629
+ * New users receive an empty list with `selectedGraphId: null`. Users should create
1630
+ * a graph or subscribe to a repository.
1624
1631
  *
1625
1632
  * **Note:**
1626
1633
  * Graph listing is included - no credit consumption required.
package/sdk/sdk.gen.js CHANGED
@@ -3006,38 +3006,45 @@ const queryTables = (options) => {
3006
3006
  };
3007
3007
  exports.queryTables = queryTables;
3008
3008
  /**
3009
- * Get User Graphs
3010
- * List all graph databases accessible to the current user with roles and selection status.
3009
+ * Get User Graphs and Repositories
3010
+ * List all graph databases and shared repositories accessible to the current user.
3011
3011
  *
3012
- * Returns a comprehensive list of all graphs the user can access, including their
3013
- * role in each graph (admin or member) and which graph is currently selected as
3014
- * the active workspace.
3012
+ * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
3013
+ * that the user has access to, including their role/access level and selection status.
3015
3014
  *
3016
3015
  * **Returned Information:**
3017
- * - Graph ID and display name for each accessible graph
3018
- * - User's role (admin/member) indicating permission level
3019
- * - Selection status (one graph can be marked as "selected")
3020
- * - Creation timestamp for each graph
3021
- *
3022
- * **Graph Roles:**
3023
- * - `admin`: Full access - can manage graph settings, invite users, delete graph
3024
- * - `member`: Read/write access - can query and modify data, cannot manage settings
3016
+ * - Graph/Repository ID and display name
3017
+ * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
3018
+ * - Selection status (only user graphs can be selected)
3019
+ * - Creation timestamp
3020
+ * - Repository type indicator (isRepository: true for shared repositories)
3021
+ *
3022
+ * **User Graphs (isRepository: false):**
3023
+ * - Collaborative workspaces that can be shared with other users
3024
+ * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
3025
+ * - Can be selected as active workspace
3026
+ * - Graphs you create or have been invited to
3027
+ *
3028
+ * **Shared Repositories (isRepository: true):**
3029
+ * - Read-only data repositories like SEC filings, industry benchmarks
3030
+ * - Access levels: `read`, `write` (for data contributions), `admin`
3031
+ * - Cannot be selected (each has separate subscription)
3032
+ * - Require separate subscriptions (personal, cannot be shared)
3025
3033
  *
3026
3034
  * **Selected Graph Concept:**
3027
- * The "selected" graph is the user's currently active workspace. Many API operations
3028
- * default to the selected graph if no graph_id is provided. Users can change their
3029
- * selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
3035
+ * The "selected" graph is the user's currently active workspace (user graphs only).
3036
+ * Many API operations default to the selected graph if no graph_id is provided.
3037
+ * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
3030
3038
  *
3031
3039
  * **Use Cases:**
3032
- * - Display graph selector in UI
3033
- * - Show user's accessible workspaces
3034
- * - Identify which graph is currently active
3035
- * - Filter graphs by role for permission-based features
3040
+ * - Display unified graph/repository selector in UI
3041
+ * - Show all accessible data sources (both owned graphs and subscribed repositories)
3042
+ * - Identify currently active workspace
3043
+ * - Filter by type (user graphs vs repositories)
3036
3044
  *
3037
3045
  * **Empty Response:**
3038
- * New users or users without graph access will receive an empty list with
3039
- * `selectedGraphId: null`. Users should create a new graph or request access
3040
- * to an existing graph.
3046
+ * New users receive an empty list with `selectedGraphId: null`. Users should create
3047
+ * a graph or subscribe to a repository.
3041
3048
  *
3042
3049
  * **Note:**
3043
3050
  * Graph listing is included - no credit consumption required.
package/sdk/sdk.gen.ts CHANGED
@@ -3020,38 +3020,45 @@ export const queryTables = <ThrowOnError extends boolean = false>(options: Optio
3020
3020
  };
3021
3021
 
3022
3022
  /**
3023
- * Get User Graphs
3024
- * List all graph databases accessible to the current user with roles and selection status.
3023
+ * Get User Graphs and Repositories
3024
+ * List all graph databases and shared repositories accessible to the current user.
3025
3025
  *
3026
- * Returns a comprehensive list of all graphs the user can access, including their
3027
- * role in each graph (admin or member) and which graph is currently selected as
3028
- * the active workspace.
3026
+ * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
3027
+ * that the user has access to, including their role/access level and selection status.
3029
3028
  *
3030
3029
  * **Returned Information:**
3031
- * - Graph ID and display name for each accessible graph
3032
- * - User's role (admin/member) indicating permission level
3033
- * - Selection status (one graph can be marked as "selected")
3034
- * - Creation timestamp for each graph
3035
- *
3036
- * **Graph Roles:**
3037
- * - `admin`: Full access - can manage graph settings, invite users, delete graph
3038
- * - `member`: Read/write access - can query and modify data, cannot manage settings
3030
+ * - Graph/Repository ID and display name
3031
+ * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
3032
+ * - Selection status (only user graphs can be selected)
3033
+ * - Creation timestamp
3034
+ * - Repository type indicator (isRepository: true for shared repositories)
3035
+ *
3036
+ * **User Graphs (isRepository: false):**
3037
+ * - Collaborative workspaces that can be shared with other users
3038
+ * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
3039
+ * - Can be selected as active workspace
3040
+ * - Graphs you create or have been invited to
3041
+ *
3042
+ * **Shared Repositories (isRepository: true):**
3043
+ * - Read-only data repositories like SEC filings, industry benchmarks
3044
+ * - Access levels: `read`, `write` (for data contributions), `admin`
3045
+ * - Cannot be selected (each has separate subscription)
3046
+ * - Require separate subscriptions (personal, cannot be shared)
3039
3047
  *
3040
3048
  * **Selected Graph Concept:**
3041
- * The "selected" graph is the user's currently active workspace. Many API operations
3042
- * default to the selected graph if no graph_id is provided. Users can change their
3043
- * selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
3049
+ * The "selected" graph is the user's currently active workspace (user graphs only).
3050
+ * Many API operations default to the selected graph if no graph_id is provided.
3051
+ * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
3044
3052
  *
3045
3053
  * **Use Cases:**
3046
- * - Display graph selector in UI
3047
- * - Show user's accessible workspaces
3048
- * - Identify which graph is currently active
3049
- * - Filter graphs by role for permission-based features
3054
+ * - Display unified graph/repository selector in UI
3055
+ * - Show all accessible data sources (both owned graphs and subscribed repositories)
3056
+ * - Identify currently active workspace
3057
+ * - Filter by type (user graphs vs repositories)
3050
3058
  *
3051
3059
  * **Empty Response:**
3052
- * New users or users without graph access will receive an empty list with
3053
- * `selectedGraphId: null`. Users should create a new graph or request access
3054
- * to an existing graph.
3060
+ * New users receive an empty list with `selectedGraphId: null`. Users should create
3061
+ * a graph or subscribe to a repository.
3055
3062
  *
3056
3063
  * **Note:**
3057
3064
  * Graph listing is included - no credit consumption required.
@@ -1908,7 +1908,7 @@ export type GraphInfo = {
1908
1908
  graphName: string;
1909
1909
  /**
1910
1910
  * Role
1911
- * User's role in this graph
1911
+ * User's role/access level
1912
1912
  */
1913
1913
  role: string;
1914
1914
  /**
@@ -1921,6 +1921,16 @@ export type GraphInfo = {
1921
1921
  * Creation timestamp
1922
1922
  */
1923
1923
  createdAt: string;
1924
+ /**
1925
+ * Isrepository
1926
+ * Whether this is a shared repository (vs user graph)
1927
+ */
1928
+ isRepository?: boolean;
1929
+ /**
1930
+ * Repositorytype
1931
+ * Repository type if isRepository=true
1932
+ */
1933
+ repositoryType?: string | null;
1924
1934
  };
1925
1935
  /**
1926
1936
  * GraphLimitsResponse
@@ -2311,14 +2321,14 @@ export type GraphTierInstance = {
2311
2321
  type: string;
2312
2322
  /**
2313
2323
  * Memory Mb
2314
- * Memory in megabytes
2324
+ * Memory allocated to your graph in megabytes
2315
2325
  */
2316
2326
  memory_mb: number;
2317
2327
  /**
2318
- * Databases Per Instance
2319
- * Databases per instance
2328
+ * Is Multitenant
2329
+ * Whether this tier shares infrastructure with other graphs
2320
2330
  */
2321
- databases_per_instance: number;
2331
+ is_multitenant: boolean;
2322
2332
  };
2323
2333
  /**
2324
2334
  * GraphTierLimits
package/sdk/types.gen.ts CHANGED
@@ -1970,7 +1970,7 @@ export type GraphInfo = {
1970
1970
  graphName: string;
1971
1971
  /**
1972
1972
  * Role
1973
- * User's role in this graph
1973
+ * User's role/access level
1974
1974
  */
1975
1975
  role: string;
1976
1976
  /**
@@ -1983,6 +1983,16 @@ export type GraphInfo = {
1983
1983
  * Creation timestamp
1984
1984
  */
1985
1985
  createdAt: string;
1986
+ /**
1987
+ * Isrepository
1988
+ * Whether this is a shared repository (vs user graph)
1989
+ */
1990
+ isRepository?: boolean;
1991
+ /**
1992
+ * Repositorytype
1993
+ * Repository type if isRepository=true
1994
+ */
1995
+ repositoryType?: string | null;
1986
1996
  };
1987
1997
 
1988
1998
  /**
@@ -2382,14 +2392,14 @@ export type GraphTierInstance = {
2382
2392
  type: string;
2383
2393
  /**
2384
2394
  * Memory Mb
2385
- * Memory in megabytes
2395
+ * Memory allocated to your graph in megabytes
2386
2396
  */
2387
2397
  memory_mb: number;
2388
2398
  /**
2389
- * Databases Per Instance
2390
- * Databases per instance
2399
+ * Is Multitenant
2400
+ * Whether this tier shares infrastructure with other graphs
2391
2401
  */
2392
- databases_per_instance: number;
2402
+ is_multitenant: boolean;
2393
2403
  };
2394
2404
 
2395
2405
  /**
@@ -36,6 +36,7 @@ export declare class QueryClient {
36
36
  token?: string;
37
37
  });
38
38
  executeQuery(graphId: string, request: QueryRequest, options?: QueryOptions): Promise<QueryResult | AsyncIterableIterator<any>>;
39
+ private parseNDJSONResponse;
39
40
  private streamQueryResults;
40
41
  private waitForQueryCompletion;
41
42
  query(graphId: string, cypher: string, parameters?: Record<string, any>): Promise<QueryResult>;
@@ -27,6 +27,15 @@ class QueryClient {
27
27
  };
28
28
  // Execute the query
29
29
  const response = await (0, sdk_gen_1.executeCypherQuery)(data);
30
+ // Check if this is an NDJSON streaming response
31
+ // The SDK returns the response object which includes the raw Response
32
+ if (response.response) {
33
+ const contentType = response.response.headers.get('content-type') || '';
34
+ const streamFormat = response.response.headers.get('x-stream-format');
35
+ if (contentType.includes('application/x-ndjson') || streamFormat === 'ndjson') {
36
+ return this.parseNDJSONResponse(response.response, graphId);
37
+ }
38
+ }
30
39
  const responseData = response.data;
31
40
  // Check if this is an immediate response
32
41
  if (responseData?.data !== undefined && responseData?.columns) {
@@ -59,6 +68,51 @@ class QueryClient {
59
68
  // Unexpected response format
60
69
  throw new Error('Unexpected response format from query endpoint');
61
70
  }
71
+ async parseNDJSONResponse(response, graphId) {
72
+ const allData = [];
73
+ let columns = null;
74
+ let totalRows = 0;
75
+ let executionTimeMs = 0;
76
+ // Parse NDJSON line by line
77
+ const text = await response.text();
78
+ const lines = text.trim().split('\n');
79
+ for (const line of lines) {
80
+ if (!line.trim())
81
+ continue;
82
+ try {
83
+ const chunk = JSON.parse(line);
84
+ // Extract columns from first chunk
85
+ if (columns === null && chunk.columns) {
86
+ columns = chunk.columns;
87
+ }
88
+ // Aggregate data rows (NDJSON uses "rows", regular JSON uses "data")
89
+ if (chunk.rows) {
90
+ allData.push(...chunk.rows);
91
+ totalRows += chunk.rows.length;
92
+ }
93
+ else if (chunk.data) {
94
+ allData.push(...chunk.data);
95
+ totalRows += chunk.data.length;
96
+ }
97
+ // Track execution time (use max from all chunks)
98
+ if (chunk.execution_time_ms) {
99
+ executionTimeMs = Math.max(executionTimeMs, chunk.execution_time_ms);
100
+ }
101
+ }
102
+ catch (error) {
103
+ throw new Error(`Failed to parse NDJSON line: ${error}`);
104
+ }
105
+ }
106
+ // Return aggregated result
107
+ return {
108
+ data: allData,
109
+ columns: columns || [],
110
+ row_count: totalRows,
111
+ execution_time_ms: executionTimeMs,
112
+ graph_id: graphId,
113
+ timestamp: new Date().toISOString(),
114
+ };
115
+ }
62
116
  async *streamQueryResults(operationId, options) {
63
117
  const buffer = [];
64
118
  let completed = false;
@@ -79,6 +79,18 @@ export class QueryClient {
79
79
 
80
80
  // Execute the query
81
81
  const response = await executeCypherQuery(data)
82
+
83
+ // Check if this is an NDJSON streaming response
84
+ // The SDK returns the response object which includes the raw Response
85
+ if (response.response) {
86
+ const contentType = response.response.headers.get('content-type') || ''
87
+ const streamFormat = response.response.headers.get('x-stream-format')
88
+
89
+ if (contentType.includes('application/x-ndjson') || streamFormat === 'ndjson') {
90
+ return this.parseNDJSONResponse(response.response, graphId)
91
+ }
92
+ }
93
+
82
94
  const responseData = response.data as any
83
95
 
84
96
  // Check if this is an immediate response
@@ -117,6 +129,56 @@ export class QueryClient {
117
129
  throw new Error('Unexpected response format from query endpoint')
118
130
  }
119
131
 
132
+ private async parseNDJSONResponse(response: Response, graphId: string): Promise<QueryResult> {
133
+ const allData: any[] = []
134
+ let columns: string[] | null = null
135
+ let totalRows = 0
136
+ let executionTimeMs = 0
137
+
138
+ // Parse NDJSON line by line
139
+ const text = await response.text()
140
+ const lines = text.trim().split('\n')
141
+
142
+ for (const line of lines) {
143
+ if (!line.trim()) continue
144
+
145
+ try {
146
+ const chunk = JSON.parse(line)
147
+
148
+ // Extract columns from first chunk
149
+ if (columns === null && chunk.columns) {
150
+ columns = chunk.columns
151
+ }
152
+
153
+ // Aggregate data rows (NDJSON uses "rows", regular JSON uses "data")
154
+ if (chunk.rows) {
155
+ allData.push(...chunk.rows)
156
+ totalRows += chunk.rows.length
157
+ } else if (chunk.data) {
158
+ allData.push(...chunk.data)
159
+ totalRows += chunk.data.length
160
+ }
161
+
162
+ // Track execution time (use max from all chunks)
163
+ if (chunk.execution_time_ms) {
164
+ executionTimeMs = Math.max(executionTimeMs, chunk.execution_time_ms)
165
+ }
166
+ } catch (error) {
167
+ throw new Error(`Failed to parse NDJSON line: ${error}`)
168
+ }
169
+ }
170
+
171
+ // Return aggregated result
172
+ return {
173
+ data: allData,
174
+ columns: columns || [],
175
+ row_count: totalRows,
176
+ execution_time_ms: executionTimeMs,
177
+ graph_id: graphId,
178
+ timestamp: new Date().toISOString(),
179
+ }
180
+ }
181
+
120
182
  private async *streamQueryResults(
121
183
  operationId: string,
122
184
  options: QueryOptions
package/sdk.gen.d.ts CHANGED
@@ -1589,38 +1589,45 @@ export declare const ingestTables: <ThrowOnError extends boolean = false>(option
1589
1589
  */
1590
1590
  export declare const queryTables: <ThrowOnError extends boolean = false>(options: Options<QueryTablesData, ThrowOnError>) => import("./client").RequestResult<QueryTablesResponses, QueryTablesErrors, ThrowOnError, "fields">;
1591
1591
  /**
1592
- * Get User Graphs
1593
- * List all graph databases accessible to the current user with roles and selection status.
1592
+ * Get User Graphs and Repositories
1593
+ * List all graph databases and shared repositories accessible to the current user.
1594
1594
  *
1595
- * Returns a comprehensive list of all graphs the user can access, including their
1596
- * role in each graph (admin or member) and which graph is currently selected as
1597
- * the active workspace.
1595
+ * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
1596
+ * that the user has access to, including their role/access level and selection status.
1598
1597
  *
1599
1598
  * **Returned Information:**
1600
- * - Graph ID and display name for each accessible graph
1601
- * - User's role (admin/member) indicating permission level
1602
- * - Selection status (one graph can be marked as "selected")
1603
- * - Creation timestamp for each graph
1604
- *
1605
- * **Graph Roles:**
1606
- * - `admin`: Full access - can manage graph settings, invite users, delete graph
1607
- * - `member`: Read/write access - can query and modify data, cannot manage settings
1599
+ * - Graph/Repository ID and display name
1600
+ * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
1601
+ * - Selection status (only user graphs can be selected)
1602
+ * - Creation timestamp
1603
+ * - Repository type indicator (isRepository: true for shared repositories)
1604
+ *
1605
+ * **User Graphs (isRepository: false):**
1606
+ * - Collaborative workspaces that can be shared with other users
1607
+ * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
1608
+ * - Can be selected as active workspace
1609
+ * - Graphs you create or have been invited to
1610
+ *
1611
+ * **Shared Repositories (isRepository: true):**
1612
+ * - Read-only data repositories like SEC filings, industry benchmarks
1613
+ * - Access levels: `read`, `write` (for data contributions), `admin`
1614
+ * - Cannot be selected (each has separate subscription)
1615
+ * - Require separate subscriptions (personal, cannot be shared)
1608
1616
  *
1609
1617
  * **Selected Graph Concept:**
1610
- * The "selected" graph is the user's currently active workspace. Many API operations
1611
- * default to the selected graph if no graph_id is provided. Users can change their
1612
- * selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
1618
+ * The "selected" graph is the user's currently active workspace (user graphs only).
1619
+ * Many API operations default to the selected graph if no graph_id is provided.
1620
+ * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
1613
1621
  *
1614
1622
  * **Use Cases:**
1615
- * - Display graph selector in UI
1616
- * - Show user's accessible workspaces
1617
- * - Identify which graph is currently active
1618
- * - Filter graphs by role for permission-based features
1623
+ * - Display unified graph/repository selector in UI
1624
+ * - Show all accessible data sources (both owned graphs and subscribed repositories)
1625
+ * - Identify currently active workspace
1626
+ * - Filter by type (user graphs vs repositories)
1619
1627
  *
1620
1628
  * **Empty Response:**
1621
- * New users or users without graph access will receive an empty list with
1622
- * `selectedGraphId: null`. Users should create a new graph or request access
1623
- * to an existing graph.
1629
+ * New users receive an empty list with `selectedGraphId: null`. Users should create
1630
+ * a graph or subscribe to a repository.
1624
1631
  *
1625
1632
  * **Note:**
1626
1633
  * Graph listing is included - no credit consumption required.
package/sdk.gen.js CHANGED
@@ -3006,38 +3006,45 @@ const queryTables = (options) => {
3006
3006
  };
3007
3007
  exports.queryTables = queryTables;
3008
3008
  /**
3009
- * Get User Graphs
3010
- * List all graph databases accessible to the current user with roles and selection status.
3009
+ * Get User Graphs and Repositories
3010
+ * List all graph databases and shared repositories accessible to the current user.
3011
3011
  *
3012
- * Returns a comprehensive list of all graphs the user can access, including their
3013
- * role in each graph (admin or member) and which graph is currently selected as
3014
- * the active workspace.
3012
+ * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
3013
+ * that the user has access to, including their role/access level and selection status.
3015
3014
  *
3016
3015
  * **Returned Information:**
3017
- * - Graph ID and display name for each accessible graph
3018
- * - User's role (admin/member) indicating permission level
3019
- * - Selection status (one graph can be marked as "selected")
3020
- * - Creation timestamp for each graph
3021
- *
3022
- * **Graph Roles:**
3023
- * - `admin`: Full access - can manage graph settings, invite users, delete graph
3024
- * - `member`: Read/write access - can query and modify data, cannot manage settings
3016
+ * - Graph/Repository ID and display name
3017
+ * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
3018
+ * - Selection status (only user graphs can be selected)
3019
+ * - Creation timestamp
3020
+ * - Repository type indicator (isRepository: true for shared repositories)
3021
+ *
3022
+ * **User Graphs (isRepository: false):**
3023
+ * - Collaborative workspaces that can be shared with other users
3024
+ * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
3025
+ * - Can be selected as active workspace
3026
+ * - Graphs you create or have been invited to
3027
+ *
3028
+ * **Shared Repositories (isRepository: true):**
3029
+ * - Read-only data repositories like SEC filings, industry benchmarks
3030
+ * - Access levels: `read`, `write` (for data contributions), `admin`
3031
+ * - Cannot be selected (each has separate subscription)
3032
+ * - Require separate subscriptions (personal, cannot be shared)
3025
3033
  *
3026
3034
  * **Selected Graph Concept:**
3027
- * The "selected" graph is the user's currently active workspace. Many API operations
3028
- * default to the selected graph if no graph_id is provided. Users can change their
3029
- * selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
3035
+ * The "selected" graph is the user's currently active workspace (user graphs only).
3036
+ * Many API operations default to the selected graph if no graph_id is provided.
3037
+ * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
3030
3038
  *
3031
3039
  * **Use Cases:**
3032
- * - Display graph selector in UI
3033
- * - Show user's accessible workspaces
3034
- * - Identify which graph is currently active
3035
- * - Filter graphs by role for permission-based features
3040
+ * - Display unified graph/repository selector in UI
3041
+ * - Show all accessible data sources (both owned graphs and subscribed repositories)
3042
+ * - Identify currently active workspace
3043
+ * - Filter by type (user graphs vs repositories)
3036
3044
  *
3037
3045
  * **Empty Response:**
3038
- * New users or users without graph access will receive an empty list with
3039
- * `selectedGraphId: null`. Users should create a new graph or request access
3040
- * to an existing graph.
3046
+ * New users receive an empty list with `selectedGraphId: null`. Users should create
3047
+ * a graph or subscribe to a repository.
3041
3048
  *
3042
3049
  * **Note:**
3043
3050
  * Graph listing is included - no credit consumption required.
package/sdk.gen.ts CHANGED
@@ -3020,38 +3020,45 @@ export const queryTables = <ThrowOnError extends boolean = false>(options: Optio
3020
3020
  };
3021
3021
 
3022
3022
  /**
3023
- * Get User Graphs
3024
- * List all graph databases accessible to the current user with roles and selection status.
3023
+ * Get User Graphs and Repositories
3024
+ * List all graph databases and shared repositories accessible to the current user.
3025
3025
  *
3026
- * Returns a comprehensive list of all graphs the user can access, including their
3027
- * role in each graph (admin or member) and which graph is currently selected as
3028
- * the active workspace.
3026
+ * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
3027
+ * that the user has access to, including their role/access level and selection status.
3029
3028
  *
3030
3029
  * **Returned Information:**
3031
- * - Graph ID and display name for each accessible graph
3032
- * - User's role (admin/member) indicating permission level
3033
- * - Selection status (one graph can be marked as "selected")
3034
- * - Creation timestamp for each graph
3035
- *
3036
- * **Graph Roles:**
3037
- * - `admin`: Full access - can manage graph settings, invite users, delete graph
3038
- * - `member`: Read/write access - can query and modify data, cannot manage settings
3030
+ * - Graph/Repository ID and display name
3031
+ * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
3032
+ * - Selection status (only user graphs can be selected)
3033
+ * - Creation timestamp
3034
+ * - Repository type indicator (isRepository: true for shared repositories)
3035
+ *
3036
+ * **User Graphs (isRepository: false):**
3037
+ * - Collaborative workspaces that can be shared with other users
3038
+ * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
3039
+ * - Can be selected as active workspace
3040
+ * - Graphs you create or have been invited to
3041
+ *
3042
+ * **Shared Repositories (isRepository: true):**
3043
+ * - Read-only data repositories like SEC filings, industry benchmarks
3044
+ * - Access levels: `read`, `write` (for data contributions), `admin`
3045
+ * - Cannot be selected (each has separate subscription)
3046
+ * - Require separate subscriptions (personal, cannot be shared)
3039
3047
  *
3040
3048
  * **Selected Graph Concept:**
3041
- * The "selected" graph is the user's currently active workspace. Many API operations
3042
- * default to the selected graph if no graph_id is provided. Users can change their
3043
- * selected graph via the `POST /v1/graphs/{graph_id}/select` endpoint.
3049
+ * The "selected" graph is the user's currently active workspace (user graphs only).
3050
+ * Many API operations default to the selected graph if no graph_id is provided.
3051
+ * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
3044
3052
  *
3045
3053
  * **Use Cases:**
3046
- * - Display graph selector in UI
3047
- * - Show user's accessible workspaces
3048
- * - Identify which graph is currently active
3049
- * - Filter graphs by role for permission-based features
3054
+ * - Display unified graph/repository selector in UI
3055
+ * - Show all accessible data sources (both owned graphs and subscribed repositories)
3056
+ * - Identify currently active workspace
3057
+ * - Filter by type (user graphs vs repositories)
3050
3058
  *
3051
3059
  * **Empty Response:**
3052
- * New users or users without graph access will receive an empty list with
3053
- * `selectedGraphId: null`. Users should create a new graph or request access
3054
- * to an existing graph.
3060
+ * New users receive an empty list with `selectedGraphId: null`. Users should create
3061
+ * a graph or subscribe to a repository.
3055
3062
  *
3056
3063
  * **Note:**
3057
3064
  * Graph listing is included - no credit consumption required.
package/types.gen.d.ts CHANGED
@@ -1908,7 +1908,7 @@ export type GraphInfo = {
1908
1908
  graphName: string;
1909
1909
  /**
1910
1910
  * Role
1911
- * User's role in this graph
1911
+ * User's role/access level
1912
1912
  */
1913
1913
  role: string;
1914
1914
  /**
@@ -1921,6 +1921,16 @@ export type GraphInfo = {
1921
1921
  * Creation timestamp
1922
1922
  */
1923
1923
  createdAt: string;
1924
+ /**
1925
+ * Isrepository
1926
+ * Whether this is a shared repository (vs user graph)
1927
+ */
1928
+ isRepository?: boolean;
1929
+ /**
1930
+ * Repositorytype
1931
+ * Repository type if isRepository=true
1932
+ */
1933
+ repositoryType?: string | null;
1924
1934
  };
1925
1935
  /**
1926
1936
  * GraphLimitsResponse
@@ -2311,14 +2321,14 @@ export type GraphTierInstance = {
2311
2321
  type: string;
2312
2322
  /**
2313
2323
  * Memory Mb
2314
- * Memory in megabytes
2324
+ * Memory allocated to your graph in megabytes
2315
2325
  */
2316
2326
  memory_mb: number;
2317
2327
  /**
2318
- * Databases Per Instance
2319
- * Databases per instance
2328
+ * Is Multitenant
2329
+ * Whether this tier shares infrastructure with other graphs
2320
2330
  */
2321
- databases_per_instance: number;
2331
+ is_multitenant: boolean;
2322
2332
  };
2323
2333
  /**
2324
2334
  * GraphTierLimits
package/types.gen.ts CHANGED
@@ -1970,7 +1970,7 @@ export type GraphInfo = {
1970
1970
  graphName: string;
1971
1971
  /**
1972
1972
  * Role
1973
- * User's role in this graph
1973
+ * User's role/access level
1974
1974
  */
1975
1975
  role: string;
1976
1976
  /**
@@ -1983,6 +1983,16 @@ export type GraphInfo = {
1983
1983
  * Creation timestamp
1984
1984
  */
1985
1985
  createdAt: string;
1986
+ /**
1987
+ * Isrepository
1988
+ * Whether this is a shared repository (vs user graph)
1989
+ */
1990
+ isRepository?: boolean;
1991
+ /**
1992
+ * Repositorytype
1993
+ * Repository type if isRepository=true
1994
+ */
1995
+ repositoryType?: string | null;
1986
1996
  };
1987
1997
 
1988
1998
  /**
@@ -2382,14 +2392,14 @@ export type GraphTierInstance = {
2382
2392
  type: string;
2383
2393
  /**
2384
2394
  * Memory Mb
2385
- * Memory in megabytes
2395
+ * Memory allocated to your graph in megabytes
2386
2396
  */
2387
2397
  memory_mb: number;
2388
2398
  /**
2389
- * Databases Per Instance
2390
- * Databases per instance
2399
+ * Is Multitenant
2400
+ * Whether this tier shares infrastructure with other graphs
2391
2401
  */
2392
- databases_per_instance: number;
2402
+ is_multitenant: boolean;
2393
2403
  };
2394
2404
 
2395
2405
  /**