@robosystems/client 0.3.6 → 0.3.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.
package/sdk.gen.js CHANGED
@@ -2,18 +2,14 @@
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.callMcpTool = exports.listMcpTools = exports.recommendAgent = exports.batchProcessQueries = exports.executeSpecificAgent = exports.getAgentMetadata = exports.autoSelectAgent = exports.listAgents = exports.syncConnection = exports.getConnection = exports.deleteConnection = exports.oauthCallback = exports.initOAuth = exports.getConnectionOptions = exports.createConnection = exports.listConnections = exports.getOrgUsage = exports.getOrgLimits = exports.updateOrgMemberRole = exports.removeOrgMember = exports.inviteOrgMember = exports.listOrgMembers = exports.listOrgGraphs = exports.updateOrg = exports.getOrg = exports.listUserOrgs = exports.updateUserApiKey = exports.revokeUserApiKey = exports.createUserApiKey = exports.listUserApiKeys = exports.updateUserPassword = exports.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getCaptchaConfig = exports.completeSsoAuth = exports.ssoTokenExchange = exports.generateSsoToken = exports.resetPassword = exports.validateResetToken = exports.forgotPassword = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.verifyEmail = exports.resendVerificationEmail = exports.refreshAuthSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
- exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.selectGraph = exports.getGraphCapacity = exports.getAvailableGraphTiers = exports.getAvailableExtensions = exports.createGraph = exports.getGraphs = exports.updateFile = exports.getFile = exports.deleteFile = exports.createFileUpload = exports.listFiles = exports.opMaterialize = exports.opChangeTier = exports.opRestoreBackup = exports.opCreateBackup = exports.opDeleteSubgraph = exports.opCreateSubgraph = exports.uploadDocumentsBulk = exports.updateDocument = exports.getDocument = exports.deleteDocument = exports.uploadDocument = exports.listDocuments = exports.getDocumentSection = exports.searchDocuments = exports.queryTables = exports.listTables = exports.createRepositorySubscription = exports.changeSubscriptionPlan = exports.getGraphSubscription = exports.getSubgraphQuota = exports.getSubgraphInfo = exports.listSubgraphs = exports.getGraphLimits = exports.getDatabaseInfo = exports.getDatabaseHealth = exports.listCreditTransactions = exports.getCreditSummary = exports.validateSchema = exports.exportGraphSchema = exports.getGraphSchema = exports.executeCypherQuery = exports.getGraphUsageAnalytics = exports.getGraphMetrics = exports.getBackupStats = exports.getBackupDownloadUrl = exports.listBackups = void 0;
6
- exports.opUpdatePublishList = exports.opCreatePublishList = exports.opShareReport = exports.opDeleteReport = exports.opRegenerateReport = exports.opCreateReport = exports.opAutoMapElements = exports.opDeleteSchedule = exports.opUpdateSchedule = exports.opReverseJournalEntry = exports.opDeleteJournalEntry = exports.opUpdateJournalEntry = exports.opCreateJournalEntry = exports.opCreateTransaction = exports.opDeleteAssociation = exports.opUpdateAssociation = exports.opCreateAssociations = exports.opDeleteElement = exports.opUpdateElement = exports.opCreateElement = exports.opDeleteStructure = exports.opUpdateStructure = exports.opLinkEntityTaxonomy = exports.opDeleteTaxonomy = exports.opUpdateTaxonomy = exports.opDeleteMappingAssociation = exports.opCreateMappingAssociation = exports.opCreateStructure = exports.opCreateTaxonomy = exports.opCreateManualClosingEntry = exports.opCreateClosingEntry = exports.opTruncateSchedule = exports.opCreateSchedule = exports.opReopenPeriod = exports.opClosePeriod = exports.opSetCloseTarget = exports.opInitializeLedger = exports.opUpdateEntity = exports.handleHttpPostExtensionsGraphIdGraphqlPost = exports.handleHttpGetExtensionsGraphIdGraphqlGet = exports.getCheckoutStatus = exports.createCheckoutSession = exports.getOrgUpcomingInvoice = exports.listOrgInvoices = exports.cancelOrgSubscription = exports.getOrgSubscription = exports.listOrgSubscriptions = exports.createPortalSession = exports.getOrgBillingCustomer = exports.cancelOperation = void 0;
7
- exports.opDeletePosition = exports.opUpdatePosition = exports.opCreatePosition = exports.opDeleteSecurity = exports.opUpdateSecurity = exports.opCreateSecurity = exports.opDeletePortfolio = exports.opUpdatePortfolio = exports.opCreatePortfolio = exports.opBuildFactGrid = exports.opRemovePublishListMember = exports.opAddPublishListMembers = exports.opDeletePublishList = void 0;
5
+ exports.cancelOperation = exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.selectGraph = exports.getGraphCapacity = exports.getAvailableGraphTiers = exports.getAvailableExtensions = exports.createGraph = exports.getGraphs = exports.updateFile = exports.getFile = exports.deleteFile = exports.createFileUpload = exports.listFiles = exports.opMaterialize = exports.opChangeTier = exports.opRestoreBackup = exports.opCreateBackup = exports.opDeleteSubgraph = exports.opCreateSubgraph = exports.updateDocument = exports.getDocument = exports.deleteDocument = exports.uploadDocument = exports.listDocuments = exports.getDocumentSection = exports.searchDocuments = exports.queryTables = exports.listTables = exports.createRepositorySubscription = exports.changeSubscriptionPlan = exports.getGraphSubscription = exports.getSubgraphQuota = exports.getSubgraphInfo = exports.listSubgraphs = exports.getGraphLimits = exports.getDatabaseInfo = exports.getDatabaseHealth = exports.listCreditTransactions = exports.getCreditSummary = exports.validateSchema = exports.exportGraphSchema = exports.getGraphSchema = exports.executeCypherQuery = exports.getGraphUsageAnalytics = exports.getGraphMetrics = exports.getBackupStats = exports.getBackupDownloadUrl = exports.listBackups = void 0;
6
+ exports.opDeletePublishList = exports.opUpdatePublishList = exports.opCreatePublishList = exports.opShareReport = exports.opDeleteReport = exports.opRegenerateReport = exports.opCreateReport = exports.opAutoMapElements = exports.opCreateMappingAssociation = exports.opDeleteSchedule = exports.opUpdateSchedule = exports.opCreateManualClosingEntry = exports.opCreateClosingEntry = exports.opTruncateSchedule = exports.opCreateSchedule = exports.opReverseJournalEntry = exports.opDeleteJournalEntry = exports.opUpdateJournalEntry = exports.opCreateJournalEntry = exports.opCreateTransaction = exports.opDeleteAssociation = exports.opUpdateAssociation = exports.opCreateAssociations = exports.opDeleteElement = exports.opUpdateElement = exports.opCreateElement = exports.opDeleteStructure = exports.opUpdateStructure = exports.opLinkEntityTaxonomy = exports.opDeleteTaxonomy = exports.opUpdateTaxonomy = exports.opDeleteMappingAssociation = exports.opCreateStructure = exports.opCreateTaxonomy = exports.opReopenPeriod = exports.opClosePeriod = exports.opSetCloseTarget = exports.opInitializeLedger = exports.opUpdateEntity = exports.handleHttpPostExtensionsGraphIdGraphqlPost = exports.handleHttpGetExtensionsGraphIdGraphqlGet = exports.getCheckoutStatus = exports.createCheckoutSession = exports.getOrgUpcomingInvoice = exports.listOrgInvoices = exports.cancelOrgSubscription = exports.getOrgSubscription = exports.listOrgSubscriptions = exports.createPortalSession = exports.getOrgBillingCustomer = void 0;
7
+ exports.opDeletePosition = exports.opUpdatePosition = exports.opCreatePosition = exports.opDeleteSecurity = exports.opUpdateSecurity = exports.opCreateSecurity = exports.opDeletePortfolio = exports.opUpdatePortfolio = exports.opCreatePortfolio = exports.opFinancialStatementAnalysis = exports.opBuildFactGrid = exports.opLiveFinancialStatement = exports.opRemovePublishListMember = exports.opAddPublishListMembers = void 0;
8
8
  const client_gen_1 = require("./client.gen");
9
9
  /**
10
10
  * Register New User
11
11
  *
12
- * Register a new user account with email and password.
13
- *
14
- * **Organization Creation**: RoboSystems is an org-centric platform. When you register, a personal organization is automatically created for you. All resources (graphs, subscriptions, billing) belong to organizations, not individual users. You can later upgrade your personal org to a team or enterprise organization.
15
- *
16
- * **Security Controls**: CAPTCHA and email verification are disabled in development for API testing, but required in production.
12
+ * Creates the user and a personal organization. CAPTCHA required in production. Sends verification email when email verification is enabled.
17
13
  */
18
14
  const registerUser = (options) => (options.client ?? client_gen_1.client).post({
19
15
  url: '/v1/auth/register',
@@ -27,7 +23,7 @@ exports.registerUser = registerUser;
27
23
  /**
28
24
  * User Login
29
25
  *
30
- * Authenticate user with email and password.
26
+ * Returns a JWT token on success. IP-based progressive delays apply after repeated failures.
31
27
  */
32
28
  const loginUser = (options) => (options.client ?? client_gen_1.client).post({
33
29
  url: '/v1/auth/login',
@@ -40,22 +36,18 @@ const loginUser = (options) => (options.client ?? client_gen_1.client).post({
40
36
  exports.loginUser = loginUser;
41
37
  /**
42
38
  * User Logout
43
- *
44
- * Logout user and invalidate session.
45
39
  */
46
40
  const logoutUser = (options) => (options?.client ?? client_gen_1.client).post({ url: '/v1/auth/logout', ...options });
47
41
  exports.logoutUser = logoutUser;
48
42
  /**
49
43
  * Get Current User
50
- *
51
- * Get the currently authenticated user.
52
44
  */
53
45
  const getCurrentAuthUser = (options) => (options?.client ?? client_gen_1.client).get({ url: '/v1/auth/me', ...options });
54
46
  exports.getCurrentAuthUser = getCurrentAuthUser;
55
47
  /**
56
48
  * Refresh Session
57
49
  *
58
- * Refresh authentication session with a new JWT token.
50
+ * Revokes the current token and issues a new one. Accepts recently-expired tokens within the grace period.
59
51
  */
60
52
  const refreshAuthSession = (options) => (options?.client ?? client_gen_1.client).post({ url: '/v1/auth/refresh', ...options });
61
53
  exports.refreshAuthSession = refreshAuthSession;
@@ -82,15 +74,11 @@ const verifyEmail = (options) => (options.client ?? client_gen_1.client).post({
82
74
  exports.verifyEmail = verifyEmail;
83
75
  /**
84
76
  * Get Password Policy
85
- *
86
- * Get current password policy requirements for frontend validation
87
77
  */
88
78
  const getPasswordPolicy = (options) => (options?.client ?? client_gen_1.client).get({ url: '/v1/auth/password/policy', ...options });
89
79
  exports.getPasswordPolicy = getPasswordPolicy;
90
80
  /**
91
81
  * Check Password Strength
92
- *
93
- * Check password strength and get validation feedback
94
82
  */
95
83
  const checkPasswordStrength = (options) => (options.client ?? client_gen_1.client).post({
96
84
  url: '/v1/auth/password/check',
@@ -118,14 +106,14 @@ exports.forgotPassword = forgotPassword;
118
106
  /**
119
107
  * Validate Reset Token
120
108
  *
121
- * Check if a password reset token is valid without consuming it.
109
+ * Check if a password reset token is valid without consuming it. Returns masked email on success.
122
110
  */
123
111
  const validateResetToken = (options) => (options.client ?? client_gen_1.client).get({ url: '/v1/auth/password/reset/validate', ...options });
124
112
  exports.validateResetToken = validateResetToken;
125
113
  /**
126
114
  * Reset Password
127
115
  *
128
- * Reset password with token from email. Returns JWT for auto-login.
116
+ * Reset password with token from email. Invalidates all existing sessions. Returns JWT for auto-login.
129
117
  */
130
118
  const resetPassword = (options) => (options.client ?? client_gen_1.client).post({
131
119
  url: '/v1/auth/password/reset',
@@ -139,14 +127,14 @@ exports.resetPassword = resetPassword;
139
127
  /**
140
128
  * Generate SSO Token
141
129
  *
142
- * Generate a temporary SSO token for cross-app authentication.
130
+ * Step 1 of 3 in the cross-app SSO flow. Issues a single-use token (60s TTL) for handoff to a target application.
143
131
  */
144
132
  const generateSsoToken = (options) => (options?.client ?? client_gen_1.client).post({ url: '/v1/auth/sso-token', ...options });
145
133
  exports.generateSsoToken = generateSsoToken;
146
134
  /**
147
135
  * SSO Token Exchange
148
136
  *
149
- * Exchange SSO token for secure session handoff to target application.
137
+ * Step 2 of 3. Exchanges the SSO token for a short-lived session ID. Avoids passing tokens in redirect URLs.
150
138
  */
151
139
  const ssoTokenExchange = (options) => (options.client ?? client_gen_1.client).post({
152
140
  url: '/v1/auth/sso-exchange',
@@ -160,7 +148,7 @@ exports.ssoTokenExchange = ssoTokenExchange;
160
148
  /**
161
149
  * Complete SSO Authentication
162
150
  *
163
- * Complete SSO authentication using session ID from secure handoff.
151
+ * Step 3 of 3. Exchanges the session ID for a full JWT token. Called by the target app after redirect.
164
152
  */
165
153
  const completeSsoAuth = (options) => (options.client ?? client_gen_1.client).post({
166
154
  url: '/v1/auth/sso-complete',
@@ -174,21 +162,19 @@ exports.completeSsoAuth = completeSsoAuth;
174
162
  /**
175
163
  * Get CAPTCHA Configuration
176
164
  *
177
- * Get CAPTCHA configuration including site key and whether CAPTCHA is required.
165
+ * Returns site key and whether CAPTCHA is required. Site key is null when CAPTCHA is disabled.
178
166
  */
179
167
  const getCaptchaConfig = (options) => (options?.client ?? client_gen_1.client).get({ url: '/v1/auth/captcha/config', ...options });
180
168
  exports.getCaptchaConfig = getCaptchaConfig;
181
169
  /**
182
170
  * Health Check
183
171
  *
184
- * Service health check endpoint for monitoring and load balancers
172
+ * Unprotected used by load balancers and monitoring. No authentication required.
185
173
  */
186
174
  const getServiceStatus = (options) => (options?.client ?? client_gen_1.client).get({ url: '/v1/status', ...options });
187
175
  exports.getServiceStatus = getServiceStatus;
188
176
  /**
189
177
  * Get Current User
190
- *
191
- * Returns information about the currently authenticated user.
192
178
  */
193
179
  const getCurrentUser = (options) => (options?.client ?? client_gen_1.client).get({
194
180
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -198,8 +184,6 @@ const getCurrentUser = (options) => (options?.client ?? client_gen_1.client).get
198
184
  exports.getCurrentUser = getCurrentUser;
199
185
  /**
200
186
  * Update User Profile
201
- *
202
- * Update the current user's profile information.
203
187
  */
204
188
  const updateUser = (options) => (options.client ?? client_gen_1.client).put({
205
189
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -214,7 +198,7 @@ exports.updateUser = updateUser;
214
198
  /**
215
199
  * Update Password
216
200
  *
217
- * Update the current user's password.
201
+ * Requires current password verification. Not available for SSO-only accounts.
218
202
  */
219
203
  const updateUserPassword = (options) => (options.client ?? client_gen_1.client).put({
220
204
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -228,8 +212,6 @@ const updateUserPassword = (options) => (options.client ?? client_gen_1.client).
228
212
  exports.updateUserPassword = updateUserPassword;
229
213
  /**
230
214
  * List API Keys
231
- *
232
- * Get all API keys for the current user.
233
215
  */
234
216
  const listUserApiKeys = (options) => (options?.client ?? client_gen_1.client).get({
235
217
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -240,7 +222,7 @@ exports.listUserApiKeys = listUserApiKeys;
240
222
  /**
241
223
  * Create API Key
242
224
  *
243
- * Create a new API key for the current user.
225
+ * The raw key value is only returned once at creation time and cannot be retrieved again.
244
226
  */
245
227
  const createUserApiKey = (options) => (options.client ?? client_gen_1.client).post({
246
228
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -255,7 +237,7 @@ exports.createUserApiKey = createUserApiKey;
255
237
  /**
256
238
  * Revoke API Key
257
239
  *
258
- * Revoke (deactivate) an API key.
240
+ * Deactivates the key immediately. Requests using the revoked key will fail with 401.
259
241
  */
260
242
  const revokeUserApiKey = (options) => (options.client ?? client_gen_1.client).delete({
261
243
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -265,8 +247,6 @@ const revokeUserApiKey = (options) => (options.client ?? client_gen_1.client).de
265
247
  exports.revokeUserApiKey = revokeUserApiKey;
266
248
  /**
267
249
  * Update API Key
268
- *
269
- * Update an API key's name or description.
270
250
  */
271
251
  const updateUserApiKey = (options) => (options.client ?? client_gen_1.client).put({
272
252
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -280,8 +260,6 @@ const updateUserApiKey = (options) => (options.client ?? client_gen_1.client).pu
280
260
  exports.updateUserApiKey = updateUserApiKey;
281
261
  /**
282
262
  * List User's Organizations
283
- *
284
- * Get all organizations the current user belongs to, with their role in each.
285
263
  */
286
264
  const listUserOrgs = (options) => (options?.client ?? client_gen_1.client).get({
287
265
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -291,8 +269,6 @@ const listUserOrgs = (options) => (options?.client ?? client_gen_1.client).get({
291
269
  exports.listUserOrgs = listUserOrgs;
292
270
  /**
293
271
  * Get Organization
294
- *
295
- * Get detailed information about an organization.
296
272
  */
297
273
  const getOrg = (options) => (options.client ?? client_gen_1.client).get({
298
274
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -303,7 +279,7 @@ exports.getOrg = getOrg;
303
279
  /**
304
280
  * Update Organization
305
281
  *
306
- * Update organization information. Requires admin or owner role.
282
+ * Requires admin or owner role. Only owners can change the org type.
307
283
  */
308
284
  const updateOrg = (options) => (options.client ?? client_gen_1.client).put({
309
285
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -317,8 +293,6 @@ const updateOrg = (options) => (options.client ?? client_gen_1.client).put({
317
293
  exports.updateOrg = updateOrg;
318
294
  /**
319
295
  * List Organization Graphs
320
- *
321
- * Get all graphs belonging to an organization.
322
296
  */
323
297
  const listOrgGraphs = (options) => (options.client ?? client_gen_1.client).get({
324
298
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -328,8 +302,6 @@ const listOrgGraphs = (options) => (options.client ?? client_gen_1.client).get({
328
302
  exports.listOrgGraphs = listOrgGraphs;
329
303
  /**
330
304
  * List Organization Members
331
- *
332
- * Get all members of an organization with their roles.
333
305
  */
334
306
  const listOrgMembers = (options) => (options.client ?? client_gen_1.client).get({
335
307
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -340,10 +312,7 @@ exports.listOrgMembers = listOrgMembers;
340
312
  /**
341
313
  * Invite Member
342
314
  *
343
- * Invite a user to join the organization. Requires admin or owner role.
344
- *
345
- * **⚠️ FEATURE NOT READY**: This endpoint is disabled by default (ORG_MEMBER_INVITATIONS_ENABLED=false).
346
- * Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before enabling.
315
+ * Disabled by default (ORG_MEMBER_INVITATIONS_ENABLED=false). Returns 501 when disabled. Requires admin or owner role.
347
316
  */
348
317
  const inviteOrgMember = (options) => (options.client ?? client_gen_1.client).post({
349
318
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -358,7 +327,7 @@ exports.inviteOrgMember = inviteOrgMember;
358
327
  /**
359
328
  * Remove Member
360
329
  *
361
- * Remove a member from the organization. Requires admin or owner role.
330
+ * Requires admin or owner role. Members may remove themselves.
362
331
  */
363
332
  const removeOrgMember = (options) => (options.client ?? client_gen_1.client).delete({
364
333
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -369,7 +338,7 @@ exports.removeOrgMember = removeOrgMember;
369
338
  /**
370
339
  * Update Member Role
371
340
  *
372
- * Update a member's role in the organization. Requires admin or owner role.
341
+ * Requires admin or owner role. Owner promotion/demotion requires a dedicated ownership transfer workflow.
373
342
  */
374
343
  const updateOrgMemberRole = (options) => (options.client ?? client_gen_1.client).put({
375
344
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -383,8 +352,6 @@ const updateOrgMemberRole = (options) => (options.client ?? client_gen_1.client)
383
352
  exports.updateOrgMemberRole = updateOrgMemberRole;
384
353
  /**
385
354
  * Get Organization Limits
386
- *
387
- * Get the current limits and quotas for an organization.
388
355
  */
389
356
  const getOrgLimits = (options) => (options.client ?? client_gen_1.client).get({
390
357
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -395,7 +362,7 @@ exports.getOrgLimits = getOrgLimits;
395
362
  /**
396
363
  * Get Organization Usage
397
364
  *
398
- * Get detailed usage statistics for an organization aggregated across all graphs.
365
+ * Aggregated across all graphs in the org. Use the `days` query param to control the lookback window (default 30).
399
366
  */
400
367
  const getOrgUsage = (options) => (options.client ?? client_gen_1.client).get({
401
368
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -405,21 +372,6 @@ const getOrgUsage = (options) => (options.client ?? client_gen_1.client).get({
405
372
  exports.getOrgUsage = getOrgUsage;
406
373
  /**
407
374
  * List Connections
408
- *
409
- * List all data connections in the graph.
410
- *
411
- * Returns active and inactive connections with their current status.
412
- * Connections can be filtered by:
413
- * - **Entity**: Show connections for a specific entity
414
- * - **Provider**: Filter by connection type (sec, quickbooks)
415
- *
416
- * Each connection shows:
417
- * - Current sync status and health
418
- * - Last successful sync timestamp
419
- * - Configuration metadata
420
- * - Error messages if any
421
- *
422
- * No credits are consumed for listing connections.
423
375
  */
424
376
  const listConnections = (options) => (options.client ?? client_gen_1.client).get({
425
377
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -430,22 +382,7 @@ exports.listConnections = listConnections;
430
382
  /**
431
383
  * Create Connection
432
384
  *
433
- * Create a new data connection for external system integration.
434
- *
435
- * This endpoint initiates connections to external data sources:
436
- *
437
- * **SEC Connections**:
438
- * - Provide entity CIK for automatic filing retrieval
439
- * - No authentication needed
440
- * - Begins immediate data sync
441
- *
442
- * **QuickBooks Connections**:
443
- * - Returns OAuth URL for authorization
444
- * - Requires admin permissions in QuickBooks
445
- * - Complete with OAuth callback
446
- *
447
- * Note:
448
- * This operation is included - no credit consumption required.
385
+ * SEC: provide entity CIK, no auth needed. QuickBooks: returns an OAuth URL — complete the flow to activate. One connection allowed per provider per graph.
449
386
  */
450
387
  const createConnection = (options) => (options.client ?? client_gen_1.client).post({
451
388
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -460,21 +397,7 @@ exports.createConnection = createConnection;
460
397
  /**
461
398
  * List Connection Options
462
399
  *
463
- * Get metadata about all available data connection providers.
464
- *
465
- * This endpoint returns comprehensive information about each supported provider:
466
- *
467
- * **SEC EDGAR**: Public entity financial filings
468
- * - No authentication required (public data)
469
- * - 10-K, 10-Q, 8-K reports with XBRL data
470
- * - Historical and real-time filing access
471
- *
472
- * **QuickBooks Online**: Full accounting system integration
473
- * - OAuth 2.0 authentication
474
- * - Chart of accounts, transactions, trial balance
475
- * - Real-time sync capabilities
476
- *
477
- * No credits are consumed for viewing connection options.
400
+ * Returns available providers and their requirements. Only enabled providers are included (gated by feature flags). SEC requires no auth; QuickBooks requires OAuth 2.0.
478
401
  */
479
402
  const getConnectionOptions = (options) => (options.client ?? client_gen_1.client).get({
480
403
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -483,12 +406,7 @@ const getConnectionOptions = (options) => (options.client ?? client_gen_1.client
483
406
  });
484
407
  exports.getConnectionOptions = getConnectionOptions;
485
408
  /**
486
- * Init Oauth
487
- *
488
- * Initialize OAuth flow for a connection.
489
- *
490
- * This generates an authorization URL that the frontend should redirect the user to.
491
- * Currently supports: QuickBooks
409
+ * Initialize OAuth Flow
492
410
  */
493
411
  const initOAuth = (options) => (options.client ?? client_gen_1.client).post({
494
412
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -503,25 +421,7 @@ exports.initOAuth = initOAuth;
503
421
  /**
504
422
  * OAuth Callback
505
423
  *
506
- * Handle OAuth callback from provider after user authorization.
507
- *
508
- * This endpoint completes the OAuth flow:
509
- * 1. Validates the OAuth state parameter
510
- * 2. Exchanges authorization code for access tokens
511
- * 3. Stores tokens securely
512
- * 4. Updates connection status
513
- * 5. Optionally triggers initial sync
514
- *
515
- * Supported providers:
516
- * - **QuickBooks**: Accounting data integration
517
- *
518
- * Security measures:
519
- * - State validation prevents session hijacking
520
- * - User context is verified
521
- * - Tokens are encrypted before storage
522
- * - Full audit trail is maintained
523
- *
524
- * No credits are consumed for OAuth callbacks.
424
+ * Completes the OAuth authorization flow after provider redirect. Exchanges the authorization code for tokens, stores them, and triggers an initial sync. This is a redirect target — not typically called directly.
525
425
  */
526
426
  const oauthCallback = (options) => (options.client ?? client_gen_1.client).post({
527
427
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -536,18 +436,7 @@ exports.oauthCallback = oauthCallback;
536
436
  /**
537
437
  * Delete Connection
538
438
  *
539
- * Delete a data connection and clean up related resources.
540
- *
541
- * This operation:
542
- * - Removes the connection configuration
543
- * - Preserves any imported data in the graph
544
- * - Performs provider-specific cleanup
545
- * - Revokes stored credentials
546
- *
547
- * Note:
548
- * This operation is included - no credit consumption required.
549
- *
550
- * Only users with admin role can delete connections.
439
+ * Removes the connection and revokes credentials. Imported data is preserved in the graph. Requires admin role.
551
440
  */
552
441
  const deleteConnection = (options) => (options.client ?? client_gen_1.client).delete({
553
442
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -557,17 +446,6 @@ const deleteConnection = (options) => (options.client ?? client_gen_1.client).de
557
446
  exports.deleteConnection = deleteConnection;
558
447
  /**
559
448
  * Get Connection
560
- *
561
- * Get detailed information about a specific connection.
562
- *
563
- * Returns comprehensive connection details including:
564
- * - Current status and health indicators
565
- * - Authentication state
566
- * - Sync history and statistics
567
- * - Error details if any
568
- * - Provider-specific metadata
569
- *
570
- * No credits are consumed for viewing connection details.
571
449
  */
572
450
  const getConnection = (options) => (options.client ?? client_gen_1.client).get({
573
451
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -578,26 +456,7 @@ exports.getConnection = getConnection;
578
456
  /**
579
457
  * Sync Connection
580
458
  *
581
- * Trigger a data synchronization for the connection.
582
- *
583
- * Initiates data sync based on provider type:
584
- *
585
- * **SEC Sync**:
586
- * - Downloads latest filings from EDGAR
587
- * - Parses XBRL data and updates graph
588
- * - Typically completes in 5-10 minutes
589
- *
590
- * **QuickBooks Sync**:
591
- * - Fetches latest transactions and balances
592
- * - Updates chart of accounts
593
- * - Generates fresh trial balance
594
- * - Duration depends on data volume
595
- *
596
- * Note:
597
- * This operation is included - no credit consumption required.
598
- *
599
- * Returns an `OperationEnvelope` with an `operationId` for tracking sync progress.
600
- * Supports `Idempotency-Key` header to safely retry without triggering duplicate syncs.
459
+ * SEC: downloads latest EDGAR filings (5-10 min). QuickBooks: fetches transactions, balances, and chart of accounts. Returns an `OperationEnvelope` — monitor progress via SSE at `/v1/operations/{operation_id}/stream`. Supports `Idempotency-Key`.
601
460
  */
602
461
  const syncConnection = (options) => (options.client ?? client_gen_1.client).post({
603
462
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -610,17 +469,9 @@ const syncConnection = (options) => (options.client ?? client_gen_1.client).post
610
469
  });
611
470
  exports.syncConnection = syncConnection;
612
471
  /**
613
- * List available agents
614
- *
615
- * Get a comprehensive list of all available agents with their metadata.
616
- *
617
- * **Returns:**
618
- * - Agent types and names
619
- * - Capabilities and supported modes
620
- * - Version information
621
- * - Credit requirements
472
+ * List Available Agents
622
473
  *
623
- * Use the optional `capability` filter to find agents with specific capabilities.
474
+ * Filter by capability using the `capability` query param (e.g., `financial_analysis`, `rag_search`).
624
475
  */
625
476
  const listAgents = (options) => (options.client ?? client_gen_1.client).get({
626
477
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -629,66 +480,9 @@ const listAgents = (options) => (options.client ?? client_gen_1.client).get({
629
480
  });
630
481
  exports.listAgents = listAgents;
631
482
  /**
632
- * Auto-select agent for query
633
- *
634
- * Automatically select the best agent for your query with intelligent execution strategy.
635
- *
636
- * **Agent Selection Process:**
637
- *
638
- * The orchestrator intelligently routes your query by:
639
- * 1. Analyzing query intent and complexity
640
- * 2. Enriching context with RAG if enabled
641
- * 3. Evaluating all available agents against selection criteria
642
- * 4. Selecting the best match based on confidence scores
643
- * 5. Choosing execution strategy (sync/SSE/async) based on expected time
644
- * 6. Executing the query with the selected agent
645
- *
646
- * **Available Agent Types:**
647
- * - `financial`: Financial analysis, SEC filings, company metrics
648
- * - `research`: General research, data exploration, trend analysis
649
- * - `rag`: Knowledge base search using RAG enrichment
650
- *
651
- * **Execution Modes:**
652
- * - `quick`: Fast responses (~2-5s), suitable for simple queries
653
- * - `standard`: Balanced approach (~5-15s), default mode
654
- * - `extended`: Comprehensive analysis (~15-60s), deep research
655
- * - `streaming`: Real-time response streaming
656
- *
657
- * **Execution Strategies (automatic):**
658
- * - Fast operations (<5s): Immediate synchronous response
659
- * - Medium operations (5-30s): SSE streaming with progress updates
660
- * - Long operations (>30s): Background queue with operation tracking
661
- *
662
- * **Response Mode Override:**
663
- * Use query parameter `?mode=sync|async` to override automatic strategy selection.
664
- *
665
- * **Confidence Score Interpretation:**
666
- * - `0.9-1.0`: High confidence, agent is ideal match
667
- * - `0.7-0.9`: Good confidence, agent is suitable
668
- * - `0.5-0.7`: Moderate confidence, agent can handle but may not be optimal
669
- * - `0.3-0.5`: Low confidence, fallback agent used
670
- * - `<0.3`: Very low confidence, consider using specific agent endpoint
671
- *
672
- * **Credit Costs:**
673
- * - Quick mode: 5-10 credits per query
674
- * - Standard mode: 15-25 credits per query
675
- * - Extended mode: 30-75 credits per query
676
- * - RAG enrichment: +5-15 credits (if enabled)
677
- *
678
- * **Use Cases:**
679
- * - Ask questions without specifying agent type
680
- * - Get intelligent routing for complex multi-domain queries
681
- * - Leverage conversation history for contextual understanding
682
- * - Enable RAG for knowledge base enrichment
683
- *
684
- * **Subgraph Support:**
685
- * This endpoint accepts both parent graph IDs and subgraph IDs.
686
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
687
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
688
- * Agents operate on the specified graph/subgraph's data independently. RAG enrichment
689
- * and knowledge base search are scoped to the specific graph/subgraph.
690
- *
691
- * See request/response examples in the "Examples" dropdown below.
483
+ * Auto-select Agent for Query
484
+ *
485
+ * Routes to the best agent for your query. Agents: `financial` (SEC, accounting), `research` (deep analysis), `rag` (knowledge base, free). Credit cost by mode: `quick` 5-10, `standard` 15-25, `extended` 30-75. Execution strategy (sync/SSE/async) auto-selected; override with `?mode=sync|async`.
692
486
  */
693
487
  const autoSelectAgent = (options) => (options.client ?? client_gen_1.client).post({
694
488
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -701,19 +495,7 @@ const autoSelectAgent = (options) => (options.client ?? client_gen_1.client).pos
701
495
  });
702
496
  exports.autoSelectAgent = autoSelectAgent;
703
497
  /**
704
- * Get agent metadata
705
- *
706
- * Get comprehensive metadata for a specific agent type.
707
- *
708
- * **Returns:**
709
- * - Agent name and description
710
- * - Version information
711
- * - Supported capabilities and modes
712
- * - Credit requirements
713
- * - Author and tags
714
- * - Configuration options
715
- *
716
- * Use this to understand agent capabilities before execution.
498
+ * Get Agent Metadata
717
499
  */
718
500
  const getAgentMetadata = (options) => (options.client ?? client_gen_1.client).get({
719
501
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -722,24 +504,9 @@ const getAgentMetadata = (options) => (options.client ?? client_gen_1.client).ge
722
504
  });
723
505
  exports.getAgentMetadata = getAgentMetadata;
724
506
  /**
725
- * Execute specific agent
726
- *
727
- * Execute a specific agent type directly with intelligent execution strategy.
728
- *
729
- * Available agents:
730
- * - **financial**: Financial analysis, SEC filings, accounting data
731
- * - **research**: Deep research and comprehensive analysis
732
- * - **rag**: Fast retrieval without AI (no credits required)
733
- *
734
- * **Execution Strategies (automatic):**
735
- * - Fast operations (<5s): Immediate synchronous response
736
- * - Medium operations (5-30s): SSE streaming with progress updates
737
- * - Long operations (>30s): Background queue with operation tracking
507
+ * Execute Specific Agent
738
508
  *
739
- * **Response Mode Override:**
740
- * Use query parameter `?mode=sync|async` to override automatic strategy selection.
741
- *
742
- * Use this endpoint when you know which agent you want to use.
509
+ * Available: `financial` (SEC filings, accounting), `research` (deep analysis), `rag` (retrieval, no credits). Execution strategy auto-selected; override with `?mode=sync|async`.
743
510
  */
744
511
  const executeSpecificAgent = (options) => (options.client ?? client_gen_1.client).post({
745
512
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -752,22 +519,9 @@ const executeSpecificAgent = (options) => (options.client ?? client_gen_1.client
752
519
  });
753
520
  exports.executeSpecificAgent = executeSpecificAgent;
754
521
  /**
755
- * Batch process multiple queries
756
- *
757
- * Process multiple queries either sequentially or in parallel.
758
- *
759
- * **Features:**
760
- * - Process up to 10 queries in a single request
761
- * - Sequential or parallel execution modes
762
- * - Automatic error handling per query
763
- * - Credit checking before execution
522
+ * Batch Process Queries
764
523
  *
765
- * **Use Cases:**
766
- * - Bulk analysis of multiple entities
767
- * - Comparative analysis across queries
768
- * - Automated report generation
769
- *
770
- * Returns individual results for each query with execution metrics.
524
+ * Process up to 10 queries sequentially or in parallel. Partial failure is supported — each result has individual error handling.
771
525
  */
772
526
  const batchProcessQueries = (options) => (options.client ?? client_gen_1.client).post({
773
527
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -780,22 +534,9 @@ const batchProcessQueries = (options) => (options.client ?? client_gen_1.client)
780
534
  });
781
535
  exports.batchProcessQueries = batchProcessQueries;
782
536
  /**
783
- * Get agent recommendations
784
- *
785
- * Get intelligent agent recommendations for a specific query.
786
- *
787
- * **How it works:**
788
- * 1. Analyzes query content and structure
789
- * 2. Evaluates agent capabilities
790
- * 3. Calculates confidence scores
791
- * 4. Returns ranked recommendations
792
- *
793
- * **Use this when:**
794
- * - Unsure which agent to use
795
- * - Need to understand agent suitability
796
- * - Want confidence scores for decision making
537
+ * Get Agent Recommendations
797
538
  *
798
- * Returns top agents ranked by confidence with explanations.
539
+ * Returns agents ranked by confidence score for a query, with explanations. Use before execution when unsure which agent to pick.
799
540
  */
800
541
  const recommendAgent = (options) => (options.client ?? client_gen_1.client).post({
801
542
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -810,27 +551,7 @@ exports.recommendAgent = recommendAgent;
810
551
  /**
811
552
  * List MCP Tools
812
553
  *
813
- * Get available Model Context Protocol tools for graph analysis.
814
- *
815
- * This endpoint returns a comprehensive list of MCP tools optimized for AI agents:
816
- * - Tool schemas with detailed parameter documentation
817
- * - Context-aware descriptions based on graph type
818
- * - Capability indicators for streaming and progress
819
- *
820
- * The tool list is customized based on:
821
- * - Graph type (shared repository vs user graph)
822
- * - User permissions and subscription tier
823
- * - Available graph capabilities for the selected graph
824
- *
825
- * **Subgraph Support:**
826
- * This endpoint accepts both parent graph IDs and subgraph IDs.
827
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
828
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
829
- * The returned tool list is identical for parent graphs and subgraphs, as all
830
- * MCP tools work uniformly across graph boundaries.
831
- *
832
- * **Note:**
833
- * MCP tool listing is included - no credit consumption required.
554
+ * Returns tool schemas with capability hints (streaming, caching, timeouts) per tool. Tool list is context-aware by graph type; identical for parent graphs and subgraphs.
834
555
  */
835
556
  const listMcpTools = (options) => (options.client ?? client_gen_1.client).get({
836
557
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -841,50 +562,7 @@ exports.listMcpTools = listMcpTools;
841
562
  /**
842
563
  * Execute MCP Tool
843
564
  *
844
- * Execute an MCP tool with intelligent response optimization.
845
- *
846
- * This endpoint automatically selects the best execution strategy based on:
847
- * - Tool type and estimated complexity
848
- * - Client capabilities (AI agent detection)
849
- * - System load and queue status
850
- * - Graph type (shared repository vs user graph)
851
- *
852
- * **Response Formats:**
853
- * - **JSON**: Direct response for small/fast operations
854
- * - **SSE**: Server-Sent Events for progress monitoring
855
- * - **NDJSON**: Newline-delimited JSON for streaming
856
- * - **Queued**: Asynchronous execution with status monitoring
857
- *
858
- * **SSE Streaming Support:**
859
- * - Maximum 5 concurrent SSE connections per user
860
- * - Rate limited to 10 new connections per minute
861
- * - Automatic circuit breaker for Redis failures
862
- * - Graceful degradation to direct response if SSE unavailable
863
- * - Progress events for long-running operations
864
- *
865
- * **AI Agent Optimization:**
866
- * The Node.js MCP client transparently handles all response formats,
867
- * presenting a unified interface to AI agents. Streaming responses are
868
- * automatically aggregated for seamless consumption.
869
- *
870
- * **Error Handling:**
871
- * - `429 Too Many Requests`: Connection limit or rate limit exceeded
872
- * - `503 Service Unavailable`: SSE system temporarily disabled
873
- * - `408 Request Timeout`: Tool execution exceeded timeout
874
- * - Clients should implement exponential backoff on errors
875
- *
876
- * **Subgraph Support:**
877
- * This endpoint accepts both parent graph IDs and subgraph IDs.
878
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
879
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
880
- * MCP tools operate on the specified graph/subgraph independently. Each subgraph
881
- * has its own schema, data, and can be queried separately via MCP.
882
- *
883
- * **Credit Model:**
884
- * MCP tool execution is included - no credit consumption required. Database
885
- * operations (queries, schema inspection, analytics) are completely free.
886
- * Only AI operations that invoke Claude or other LLM APIs consume credits,
887
- * which happens at the AI agent layer, not the MCP tool layer.
565
+ * Strategy auto-selected by tool type and load: JSON for fast tools, SSE for long queries, NDJSON for large results. Database operations (Cypher, schema, info) consume no credits — only AI LLM calls cost credits.
888
566
  */
889
567
  const callMcpTool = (options) => (options.client ?? client_gen_1.client).post({
890
568
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -898,8 +576,6 @@ const callMcpTool = (options) => (options.client ?? client_gen_1.client).post({
898
576
  exports.callMcpTool = callMcpTool;
899
577
  /**
900
578
  * List graph database backups
901
- *
902
- * List all backups for the specified graph database
903
579
  */
904
580
  const listBackups = (options) => (options.client ?? client_gen_1.client).get({
905
581
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -920,8 +596,6 @@ const getBackupDownloadUrl = (options) => (options.client ?? client_gen_1.client
920
596
  exports.getBackupDownloadUrl = getBackupDownloadUrl;
921
597
  /**
922
598
  * Get backup statistics
923
- *
924
- * Get comprehensive backup statistics for the specified graph database
925
599
  */
926
600
  const getBackupStats = (options) => (options.client ?? client_gen_1.client).get({
927
601
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -931,24 +605,6 @@ const getBackupStats = (options) => (options.client ?? client_gen_1.client).get(
931
605
  exports.getBackupStats = getBackupStats;
932
606
  /**
933
607
  * Get Graph Metrics
934
- *
935
- * Get comprehensive metrics for the graph database.
936
- *
937
- * Provides detailed analytics including:
938
- * - **Node Statistics**: Counts by type (Entity, Report, Account, Transaction)
939
- * - **Relationship Metrics**: Connection counts and patterns
940
- * - **Data Quality**: Completeness scores and validation results
941
- * - **Performance Metrics**: Query response times and database health
942
- * - **Storage Analytics**: Database size and growth trends
943
- *
944
- * This data helps with:
945
- * - Monitoring data completeness
946
- * - Identifying data quality issues
947
- * - Capacity planning
948
- * - Performance optimization
949
- *
950
- * Note:
951
- * This operation is included - no credit consumption required.
952
608
  */
953
609
  const getGraphMetrics = (options) => (options.client ?? client_gen_1.client).get({
954
610
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -959,35 +615,7 @@ exports.getGraphMetrics = getGraphMetrics;
959
615
  /**
960
616
  * Get Graph Usage Analytics
961
617
  *
962
- * Get comprehensive usage analytics tracked by the GraphUsage model.
963
- *
964
- * Provides temporal usage patterns including:
965
- * - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
966
- * - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
967
- * - **Performance Insights**: Operation stats, slow queries, performance scoring
968
- * - **Recent Events**: Latest usage events with full details
969
- *
970
- * Time ranges available:
971
- * - `24h` - Last 24 hours (hourly breakdown)
972
- * - `7d` - Last 7 days (daily breakdown)
973
- * - `30d` - Last 30 days (daily breakdown)
974
- * - `current_month` - Current billing month
975
- * - `last_month` - Previous billing month
976
- *
977
- * Include options:
978
- * - `storage` - Storage usage summary (GB-hours, averages, peaks)
979
- * - `credits` - Credit consumption analytics
980
- * - `performance` - Performance insights and optimization opportunities
981
- * - `events` - Recent usage events (last 50)
982
- *
983
- * Useful for:
984
- * - Billing and cost analysis
985
- * - Capacity planning
986
- * - Performance optimization
987
- * - Usage trend analysis
988
- *
989
- * Note:
990
- * This operation is included - no credit consumption required.
618
+ * Time ranges: 24h, 7d, 30d, current_month, last_month. Toggle storage, credits, performance, and events sections via query params.
991
619
  */
992
620
  const getGraphUsageAnalytics = (options) => (options.client ?? client_gen_1.client).get({
993
621
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -998,74 +626,7 @@ exports.getGraphUsageAnalytics = getGraphUsageAnalytics;
998
626
  /**
999
627
  * Execute Cypher Query
1000
628
  *
1001
- * Execute a Cypher query with intelligent response optimization.
1002
- *
1003
- * **IMPORTANT: Write operations depend on graph type:**
1004
- * - **Main Graphs**: READ-ONLY. Write operations (CREATE, MERGE, SET, DELETE) are not allowed.
1005
- * - **Subgraphs**: WRITE-ENABLED. Full Cypher write operations are supported for development and report creation.
1006
- *
1007
- * To load data into main graphs, use the staging pipeline:
1008
- * 1. Create file upload: `POST /v1/graphs/{graph_id}/tables/{table_name}/files`
1009
- * 2. Ingest to graph: `POST /v1/graphs/{graph_id}/tables/ingest`
1010
- *
1011
- * **Security Best Practice - Use Parameterized Queries:**
1012
- * ALWAYS use query parameters instead of string interpolation to prevent injection attacks:
1013
- * - ✅ SAFE: `MATCH (n:Entity {type: $entity_type}) RETURN n` with `parameters: {"entity_type": "Company"}`
1014
- * - ❌ UNSAFE: `MATCH (n:Entity {type: "Company"}) RETURN n` with user input concatenated into query string
1015
- *
1016
- * Query parameters provide automatic escaping and type safety. All examples in this API use parameterized queries.
1017
- *
1018
- * This endpoint automatically selects the best execution strategy based on:
1019
- * - Query characteristics (size, complexity)
1020
- * - Client capabilities (SSE, NDJSON, JSON)
1021
- * - System load (queue status, concurrent queries)
1022
- * - User preferences (mode parameter, headers)
1023
- *
1024
- * **Response Modes:**
1025
- * - `auto` (default): Intelligent automatic selection
1026
- * - `sync`: Force synchronous JSON response (best for testing)
1027
- * - `async`: Force queued response with SSE monitoring endpoints (no polling needed)
1028
- * - `stream`: Force streaming response (SSE or NDJSON)
1029
- *
1030
- * **Client Detection:**
1031
- * - Automatically detects testing tools (Postman, Swagger UI)
1032
- * - Adjusts behavior for better interactive experience
1033
- * - Respects Accept and Prefer headers for capabilities
1034
- *
1035
- * **Streaming Support (SSE):**
1036
- * - Real-time events with progress updates
1037
- * - Maximum 5 concurrent SSE connections per user
1038
- * - Rate limited to 10 new connections per minute
1039
- * - Automatic circuit breaker for Redis failures
1040
- * - Graceful degradation if event system unavailable
1041
- * - 30-second keepalive to prevent timeouts
1042
- *
1043
- * **Streaming Support (NDJSON):**
1044
- * - Efficient line-delimited JSON for large results
1045
- * - Automatic chunking (configurable 10-10000 rows)
1046
- * - No connection limits (stateless streaming)
1047
- *
1048
- * **Queue Management:**
1049
- * - Automatic queuing under high load
1050
- * - Real-time monitoring via SSE events (no polling needed)
1051
- * - Priority based on subscription tier
1052
- * - Queue position and progress updates pushed via SSE
1053
- * - Connect to returned `/v1/operations/{id}/stream` endpoint for updates
1054
- *
1055
- * **Error Handling:**
1056
- * - `429 Too Many Requests`: Rate limit or connection limit exceeded
1057
- * - `503 Service Unavailable`: Circuit breaker open or SSE disabled
1058
- * - Clients should implement exponential backoff
1059
- *
1060
- * **Subgraph Support:**
1061
- * This endpoint accepts both parent graph IDs and subgraph IDs.
1062
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
1063
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
1064
- * Subgraphs share the same instance as their parent graph and have independent data.
1065
- *
1066
- * **Note:**
1067
- * Query operations are included - no credit consumption required.
1068
- * Queue position is based on subscription tier for priority.
629
+ * Main graphs are **read-only** use the staging pipeline to ingest data. Subgraphs support full writes. Always use parameterized queries (`parameters: {"key": "val"}`) to prevent injection. Response modes: `auto` (default), `sync`, `async`, `stream`. Under load, queries are queued and emit an `operation_id` for SSE monitoring at `/v1/operations/{id}/stream`.
1069
630
  */
1070
631
  const executeCypherQuery = (options) => (options.client ?? client_gen_1.client).post({
1071
632
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1080,50 +641,7 @@ exports.executeCypherQuery = executeCypherQuery;
1080
641
  /**
1081
642
  * Get Runtime Graph Schema
1082
643
  *
1083
- * Get runtime schema information for the specified graph database.
1084
- *
1085
- * ## What This Returns
1086
- *
1087
- * This endpoint inspects the **actual current state** of the graph database and returns:
1088
- * - **Node Labels**: All node types currently in the database
1089
- * - **Relationship Types**: All relationship types currently in the database
1090
- * - **Node Properties**: Properties discovered from actual data (up to 10 properties per node type)
1091
- *
1092
- * ## Runtime vs Declared Schema
1093
- *
1094
- * **Use this endpoint** (`/schema`) when you need to know:
1095
- * - What data is ACTUALLY in the database right now
1096
- * - What properties exist on real nodes
1097
- * - What relationships have been created
1098
- * - Current database structure for querying
1099
- *
1100
- * **Use `/schema/export` instead** when you need:
1101
- * - The original schema definition used to create the graph
1102
- * - Schema in a specific format (JSON, YAML, Cypher DDL)
1103
- * - Schema for documentation or version control
1104
- * - Schema to replicate in another graph
1105
- *
1106
- * ## Example Use Cases
1107
- *
1108
- * - **Building queries**: See what node labels and properties exist to write accurate Cypher
1109
- * - **Data exploration**: Discover what's in an unfamiliar graph
1110
- * - **Schema drift detection**: Compare runtime vs declared schema
1111
- * - **API integration**: Dynamically adapt to current graph structure
1112
- *
1113
- * ## Performance Note
1114
- *
1115
- * Property discovery is limited to 10 properties per node type for performance.
1116
- * For complete schema definitions, use `/schema/export`.
1117
- *
1118
- * ## Subgraph Support
1119
- *
1120
- * This endpoint accepts both parent graph IDs and subgraph IDs.
1121
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
1122
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
1123
- * Each subgraph has independent schema and data. The returned schema reflects
1124
- * only the specified graph/subgraph's actual structure.
1125
- *
1126
- * This operation is included - no credit consumption required.
644
+ * Runtime schema from actual graph data — node labels, relationship types, and up to 10 sample properties per node type. For the original schema definition or structured export formats, use `/schema/export`.
1127
645
  */
1128
646
  const getGraphSchema = (options) => (options.client ?? client_gen_1.client).get({
1129
647
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1134,53 +652,7 @@ exports.getGraphSchema = getGraphSchema;
1134
652
  /**
1135
653
  * Export Declared Graph Schema
1136
654
  *
1137
- * Export the declared schema definition of an existing graph.
1138
- *
1139
- * ## What This Returns
1140
- *
1141
- * This endpoint returns the **original schema definition** that was used to create the graph:
1142
- * - The schema as it was **declared** during graph creation
1143
- * - Complete node and relationship definitions
1144
- * - Property types and constraints
1145
- * - Schema metadata (name, version, type)
1146
- *
1147
- * ## Runtime vs Declared Schema
1148
- *
1149
- * **Use this endpoint** (`/schema/export`) when you need:
1150
- * - The original schema definition used to create the graph
1151
- * - Schema in a specific format (JSON, YAML, Cypher DDL)
1152
- * - Schema for documentation or version control
1153
- * - Schema to replicate in another graph
1154
- *
1155
- * **Use `/schema` instead** when you need:
1156
- * - What data is ACTUALLY in the database right now
1157
- * - What properties exist on real nodes (discovered from data)
1158
- * - Current runtime database structure for querying
1159
- *
1160
- * ## Export Formats
1161
- *
1162
- * ### JSON Format (`format=json`)
1163
- * Returns structured JSON with nodes, relationships, and properties.
1164
- * Best for programmatic access and API integration.
1165
- *
1166
- * ### YAML Format (`format=yaml`)
1167
- * Returns human-readable YAML with comments.
1168
- * Best for documentation and configuration management.
1169
- *
1170
- * ### Cypher DDL Format (`format=cypher`)
1171
- * Returns Cypher CREATE statements for recreating the schema.
1172
- * Best for database migration and replication.
1173
- *
1174
- * ## Data Statistics
1175
- *
1176
- * Set `include_data_stats=true` to include:
1177
- * - Node counts by label
1178
- * - Relationship counts by type
1179
- * - Total nodes and relationships
1180
- *
1181
- * This combines declared schema with runtime statistics.
1182
- *
1183
- * This operation is included - no credit consumption required.
655
+ * Returns the original schema definition from graph creation, not the runtime state. Set `include_data_stats=true` to add live node/relationship counts. Use `/schema` to inspect what's actually in the database.
1184
656
  */
1185
657
  const exportGraphSchema = (options) => (options.client ?? client_gen_1.client).get({
1186
658
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1191,35 +663,7 @@ exports.exportGraphSchema = exportGraphSchema;
1191
663
  /**
1192
664
  * Validate Schema
1193
665
  *
1194
- * Validate a custom schema definition before deployment.
1195
- *
1196
- * This endpoint performs comprehensive validation including:
1197
- * - **Structure Validation**: Ensures proper JSON/YAML format
1198
- * - **Type Checking**: Validates data types (STRING, INT, DOUBLE, etc.)
1199
- * - **Constraint Verification**: Checks primary keys and unique constraints
1200
- * - **Relationship Integrity**: Validates node references in relationships
1201
- * - **Naming Conventions**: Ensures valid identifiers
1202
- * - **Compatibility**: Checks against existing extensions if specified
1203
- *
1204
- * Supported formats:
1205
- * - JSON schema definitions
1206
- * - YAML schema definitions
1207
- * - Direct dictionary format
1208
- *
1209
- * Validation helps prevent:
1210
- * - Schema deployment failures
1211
- * - Data integrity issues
1212
- * - Performance problems
1213
- * - Naming conflicts
1214
- *
1215
- * **Subgraph Support:**
1216
- * This endpoint accepts both parent graph IDs and subgraph IDs.
1217
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
1218
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
1219
- * Schema validation is performed against the specified graph/subgraph's current
1220
- * schema and data structure.
1221
- *
1222
- * This operation is included - no credit consumption required.
666
+ * Validates a custom schema definition before deployment — checks structure, types, constraints, and relationship references. Returns errors and warnings without applying changes. Supports JSON, YAML, and dict formats.
1223
667
  */
1224
668
  const validateSchema = (options) => (options.client ?? client_gen_1.client).post({
1225
669
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1233,16 +677,6 @@ const validateSchema = (options) => (options.client ?? client_gen_1.client).post
1233
677
  exports.validateSchema = validateSchema;
1234
678
  /**
1235
679
  * Get Credit Summary
1236
- *
1237
- * Retrieve comprehensive credit usage summary for the specified graph.
1238
- *
1239
- * This endpoint provides:
1240
- * - Current credit balance and monthly allocation
1241
- * - Credit consumption metrics for the current month
1242
- * - Graph tier and credit multiplier information
1243
- * - Usage percentage to help monitor credit consumption
1244
- *
1245
- * No credits are consumed for checking credit status.
1246
680
  */
1247
681
  const getCreditSummary = (options) => (options.client ?? client_gen_1.client).get({
1248
682
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1252,22 +686,6 @@ const getCreditSummary = (options) => (options.client ?? client_gen_1.client).ge
1252
686
  exports.getCreditSummary = getCreditSummary;
1253
687
  /**
1254
688
  * List Credit Transactions
1255
- *
1256
- * Retrieve detailed credit transaction history for the specified graph.
1257
- *
1258
- * This enhanced endpoint provides:
1259
- * - Detailed transaction records with idempotency information
1260
- * - Summary by operation type to identify high-consumption operations
1261
- * - Date range filtering for analysis
1262
- * - Metadata search capabilities
1263
- *
1264
- * Transaction types include:
1265
- * - ALLOCATION: Monthly credit allocations
1266
- * - CONSUMPTION: Credit usage for operations
1267
- * - BONUS: Bonus credits added by admins
1268
- * - REFUND: Credit refunds
1269
- *
1270
- * No credits are consumed for viewing transaction history.
1271
689
  */
1272
690
  const listCreditTransactions = (options) => (options.client ?? client_gen_1.client).get({
1273
691
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1277,31 +695,6 @@ const listCreditTransactions = (options) => (options.client ?? client_gen_1.clie
1277
695
  exports.listCreditTransactions = listCreditTransactions;
1278
696
  /**
1279
697
  * Database Health Check
1280
- *
1281
- * Get comprehensive health information for the graph database.
1282
- *
1283
- * Returns detailed health metrics including:
1284
- * - **Connection Status**: Database connectivity and responsiveness
1285
- * - **Performance Metrics**: Query execution times and throughput
1286
- * - **Resource Usage**: Memory and storage utilization
1287
- * - **Error Monitoring**: Recent error rates and patterns
1288
- * - **Uptime Statistics**: Service availability metrics
1289
- *
1290
- * Health indicators:
1291
- * - **Status**: healthy, degraded, or unhealthy
1292
- * - **Query Performance**: Average execution times
1293
- * - **Error Rates**: Recent failure percentages
1294
- * - **Resource Usage**: Memory and storage consumption
1295
- * - **Alerts**: Active warnings or issues
1296
- *
1297
- * **Subgraph Support:**
1298
- * This endpoint accepts both parent graph IDs and subgraph IDs.
1299
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
1300
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
1301
- * Health metrics are specific to the requested graph/subgraph. Subgraphs share the
1302
- * same physical instance as their parent but have independent health indicators.
1303
- *
1304
- * This endpoint provides essential monitoring data for operational visibility.
1305
698
  */
1306
699
  const getDatabaseHealth = (options) => (options.client ?? client_gen_1.client).get({
1307
700
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1311,32 +704,6 @@ const getDatabaseHealth = (options) => (options.client ?? client_gen_1.client).g
1311
704
  exports.getDatabaseHealth = getDatabaseHealth;
1312
705
  /**
1313
706
  * Database Information
1314
- *
1315
- * Get comprehensive database information and statistics.
1316
- *
1317
- * Returns detailed database metrics including:
1318
- * - **Database Metadata**: Name, path, size, and timestamps
1319
- * - **Schema Information**: Node labels, relationship types, and counts
1320
- * - **Storage Statistics**: Database size and usage metrics
1321
- * - **Data Composition**: Node and relationship counts
1322
- * - **Backup Information**: Available backups and last backup date
1323
- * - **Configuration**: Read-only status and schema version
1324
- *
1325
- * Database statistics:
1326
- * - **Size**: Storage usage in bytes and MB
1327
- * - **Content**: Node and relationship counts
1328
- * - **Schema**: Available labels and relationship types
1329
- * - **Backup Status**: Backup availability and recency
1330
- * - **Timestamps**: Creation and modification dates
1331
- *
1332
- * **Subgraph Support:**
1333
- * This endpoint accepts both parent graph IDs and subgraph IDs.
1334
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
1335
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
1336
- * Returned metrics are specific to the requested graph/subgraph. Subgraphs have
1337
- * independent size, node/relationship counts, and backup status.
1338
- *
1339
- * This endpoint provides essential database information for capacity planning and monitoring.
1340
707
  */
1341
708
  const getDatabaseInfo = (options) => (options.client ?? client_gen_1.client).get({
1342
709
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1347,19 +714,7 @@ exports.getDatabaseInfo = getDatabaseInfo;
1347
714
  /**
1348
715
  * Get Graph Operational Limits
1349
716
  *
1350
- * Get comprehensive operational limits for the graph database.
1351
- *
1352
- * Returns all operational limits that apply to this graph including:
1353
- * - **Storage Limits**: Maximum storage size and current usage
1354
- * - **Query Limits**: Timeouts, complexity, row limits
1355
- * - **Copy/Ingestion Limits**: File sizes, timeouts, concurrent operations
1356
- * - **Backup Limits**: Frequency, retention, size limits
1357
- * - **Rate Limits**: Requests per minute/hour based on tier
1358
- * - **Credit Limits**: AI operation credits (if applicable)
1359
- * - **Content Limits**: Per-operation materialization limits (if applicable)
1360
- * - **Instance Usage**: Aggregate storage across parent + subgraphs (user graphs only)
1361
- *
1362
- * **Note**: Limits vary based on subscription tier (ladybug-standard, ladybug-large, ladybug-xlarge).
717
+ * Limits vary by subscription tier (ladybug-standard, ladybug-large, ladybug-xlarge). Includes storage, query, backup, rate, credit, and instance usage limits.
1363
718
  */
1364
719
  const getGraphLimits = (options) => (options.client ?? client_gen_1.client).get({
1365
720
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1369,17 +724,6 @@ const getGraphLimits = (options) => (options.client ?? client_gen_1.client).get(
1369
724
  exports.getGraphLimits = getGraphLimits;
1370
725
  /**
1371
726
  * List Subgraphs
1372
- *
1373
- * List all subgraphs for a parent graph.
1374
- *
1375
- * **Requirements:**
1376
- * - Valid authentication
1377
- * - Parent graph must exist and be accessible to the user
1378
- * - User must have at least 'read' permission on the parent graph
1379
- *
1380
- * **Returns:**
1381
- * - List of all subgraphs for the parent graph
1382
- * - Each subgraph includes its ID, name, description, type, status, and creation date
1383
727
  */
1384
728
  const listSubgraphs = (options) => (options.client ?? client_gen_1.client).get({
1385
729
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1390,30 +734,7 @@ exports.listSubgraphs = listSubgraphs;
1390
734
  /**
1391
735
  * Get Subgraph Details
1392
736
  *
1393
- * Get detailed information about a specific subgraph.
1394
- *
1395
- * **Requirements:**
1396
- * - User must have read access to parent graph
1397
- * - Subgraph name must be alphanumeric (1-20 characters)
1398
- *
1399
- * **Response includes:**
1400
- * - Full subgraph metadata
1401
- * - Database statistics (nodes, edges)
1402
- * - Size information
1403
- * - Schema configuration
1404
- * - Creation/modification timestamps
1405
- * - Last access time (when available)
1406
- *
1407
- * **Statistics:**
1408
- * Real-time statistics queried from LadybugDB:
1409
- * - Node count
1410
- * - Edge count
1411
- * - Database size on disk
1412
- * - Schema information
1413
- *
1414
- * **Note:**
1415
- * Use the subgraph name (e.g., 'dev', 'staging') not the full subgraph ID.
1416
- * The full ID is returned in the response (e.g., 'kg0123456789abcdef_dev').
737
+ * Pass the subgraph name (e.g., `dev`) not the full subgraph ID (e.g., `kg0123_dev`).
1417
738
  */
1418
739
  const getSubgraphInfo = (options) => (options.client ?? client_gen_1.client).get({
1419
740
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1424,23 +745,7 @@ exports.getSubgraphInfo = getSubgraphInfo;
1424
745
  /**
1425
746
  * Get Subgraph Quota
1426
747
  *
1427
- * Get subgraph quota and usage information for a parent graph.
1428
- *
1429
- * **Shows:**
1430
- * - Current subgraph count
1431
- * - Maximum allowed subgraphs per tier
1432
- * - Remaining capacity
1433
- * - Total size usage across all subgraphs
1434
- *
1435
- * **Tier Limits:**
1436
- * - Standard: Up to 3 subgraphs (dedicated m7g.large instance)
1437
- * - Large: Up to 10 subgraphs (dedicated r7g.large instance)
1438
- * - XLarge: Up to 25 subgraphs (dedicated r7g.xlarge instance)
1439
- * - Limits are defined in graph.yml deployment configuration
1440
- *
1441
- * **Size Tracking:**
1442
- * Provides aggregate size metrics when available.
1443
- * Individual subgraph sizes shown in list endpoint.
748
+ * Tier capacity: Standard 3, Large 10, XLarge 25 subgraphs. Use the list endpoint for per-subgraph sizes.
1444
749
  */
1445
750
  const getSubgraphQuota = (options) => (options.client ?? client_gen_1.client).get({
1446
751
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1449,14 +754,9 @@ const getSubgraphQuota = (options) => (options.client ?? client_gen_1.client).ge
1449
754
  });
1450
755
  exports.getSubgraphQuota = getSubgraphQuota;
1451
756
  /**
1452
- * Get Graph and Shared Repository Subscription
1453
- *
1454
- * Get subscription details for a graph or shared repository.
757
+ * Get Graph Subscription
1455
758
  *
1456
- * For user graphs (kg*): Returns the graph's subscription (owned by graph creator)
1457
- * For shared repositories (sec, industry, etc.): Returns user's personal subscription to that repository
1458
- *
1459
- * This unified endpoint automatically detects the resource type and returns the appropriate subscription.
759
+ * Detects resource type automatically: user graphs (kg*) return the graph's subscription; shared repositories return the user's personal subscription to that repo.
1460
760
  */
1461
761
  const getGraphSubscription = (options) => (options.client ?? client_gen_1.client).get({
1462
762
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1467,24 +767,7 @@ exports.getGraphSubscription = getGraphSubscription;
1467
767
  /**
1468
768
  * Change Subscription Plan
1469
769
  *
1470
- * Change the plan on an existing subscription.
1471
- *
1472
- * **For shared repositories** (sec, industry, etc.): Changes access tier (e.g., starter -> advanced).
1473
- * Synchronous — takes effect immediately.
1474
- *
1475
- * **For user graphs** (kg*): Changes infrastructure tier (e.g., ladybug-standard -> ladybug-large).
1476
- * Asynchronous — returns an `operation_id` for tracking the EBS volume migration via SSE.
1477
- *
1478
- * Stripe handles proration automatically for both types.
1479
- *
1480
- * **Requirements:**
1481
- * - User must be an OWNER of their organization
1482
- * - Subscription must be active
1483
- * - New plan must be valid for the resource type
1484
- *
1485
- * **Downgrade restrictions (graphs only):**
1486
- * - Subgraph count must fit the target tier's limit
1487
- * - Storage usage must fit the target tier's limit
770
+ * For repositories: synchronous tier change. For user graphs: use `POST /v1/graphs/{graph_id}/operations/change-tier` instead — this endpoint rejects graph tier changes. Requires org owner role.
1488
771
  */
1489
772
  const changeSubscriptionPlan = (options) => (options.client ?? client_gen_1.client).patch({
1490
773
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1499,12 +782,7 @@ exports.changeSubscriptionPlan = changeSubscriptionPlan;
1499
782
  /**
1500
783
  * Create Repository Subscription
1501
784
  *
1502
- * Create a new subscription to a shared repository.
1503
- *
1504
- * This endpoint is ONLY for shared repositories (sec, industry, economic).
1505
- * User graph subscriptions are created automatically when the graph is provisioned.
1506
- *
1507
- * The subscription will be created in ACTIVE status immediately and credits will be allocated.
785
+ * For shared repositories only (sec, industry, etc.). User graph subscriptions are created automatically during provisioning.
1508
786
  */
1509
787
  const createRepositorySubscription = (options) => (options.client ?? client_gen_1.client).post({
1510
788
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1519,40 +797,7 @@ exports.createRepositorySubscription = createRepositorySubscription;
1519
797
  /**
1520
798
  * List Staging Tables
1521
799
  *
1522
- * List all DuckDB staging tables with comprehensive metrics and status.
1523
- *
1524
- * Get a complete inventory of all staging tables for a graph, including
1525
- * file counts, storage sizes, and row estimates. Essential for monitoring
1526
- * the data pipeline and determining which tables are ready for ingestion.
1527
- *
1528
- * **Returned Metrics:**
1529
- * - Table name and type (node/relationship)
1530
- * - File count per table
1531
- * - Total storage size in bytes
1532
- * - Estimated row count
1533
- * - S3 location pattern
1534
- * - Ready-for-ingestion status
1535
- *
1536
- * **Use Cases:**
1537
- * - Monitor data upload progress
1538
- * - Check which tables have files ready
1539
- * - Track storage consumption
1540
- * - Validate pipeline before ingestion
1541
- * - Capacity planning
1542
- *
1543
- * **Workflow:**
1544
- * 1. List tables to see current state
1545
- * 2. Upload files to empty tables
1546
- * 3. Re-list to verify uploads
1547
- * 4. Check file counts and sizes
1548
- * 5. Ingest when ready
1549
- *
1550
- * **Important Notes:**
1551
- * - Tables with `file_count > 0` have data ready
1552
- * - Check `total_size_bytes` for storage monitoring
1553
- * - Use `s3_location` to verify upload paths
1554
- * - Empty tables (file_count=0) are skipped during ingestion
1555
- * - Table queries are included - no credit consumption
800
+ * Returns file count, storage size, row count, and S3 location per table. Tables with `file_count=0` are skipped during ingestion.
1556
801
  */
1557
802
  const listTables = (options) => (options.client ?? client_gen_1.client).get({
1558
803
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1563,62 +808,7 @@ exports.listTables = listTables;
1563
808
  /**
1564
809
  * Query Staging Tables with SQL
1565
810
  *
1566
- * Execute SQL queries on DuckDB staging tables for data inspection and validation.
1567
- *
1568
- * Query raw staging data directly with SQL before ingestion into the graph database.
1569
- * Useful for data quality checks, validation, and exploratory analysis.
1570
- *
1571
- * **Security Best Practice - Use Parameterized Queries:**
1572
- * ALWAYS use query parameters instead of string concatenation to prevent SQL injection:
1573
- * - ✅ SAFE: `SELECT * FROM Entity WHERE type = ? LIMIT ?` with `parameters: ["Company", 100]`
1574
- * - ❌ UNSAFE: `SELECT * FROM Entity WHERE type = 'Company' LIMIT 100` with user input concatenated into SQL string
1575
- *
1576
- * Query parameters provide automatic escaping and type safety. Use `?` placeholders with parameters array.
1577
- *
1578
- * **Use Cases:**
1579
- * - Validate data quality before graph ingestion
1580
- * - Inspect row-level data for debugging
1581
- * - Run analytics on staging tables
1582
- * - Check for duplicates, nulls, or data issues
1583
- * - Preview data transformations
1584
- *
1585
- * **Workflow:**
1586
- * 1. Upload data files via `POST /tables/{table_name}/files`
1587
- * 2. Query staging tables to validate: `POST /tables/query`
1588
- * 3. Fix any data issues by re-uploading
1589
- * 4. Ingest validated data: `POST /tables/ingest`
1590
- *
1591
- * **Supported SQL:**
1592
- * - Full DuckDB SQL syntax
1593
- * - SELECT, JOIN, WHERE, GROUP BY, ORDER BY
1594
- * - Aggregations, window functions, CTEs
1595
- * - Multiple table joins across staging area
1596
- *
1597
- * **Common Operations:**
1598
- * - Count rows: `SELECT COUNT(*) FROM Entity`
1599
- * - Filter by type: `SELECT * FROM Entity WHERE entity_type = ? LIMIT ?` with `parameters: ["Company", 100]`
1600
- * - Check for nulls: `SELECT * FROM Entity WHERE name IS NULL LIMIT 10`
1601
- * - Find duplicates: `SELECT identifier, COUNT(*) as cnt FROM Entity GROUP BY identifier HAVING COUNT(*) > 1`
1602
- * - Filter amounts: `SELECT * FROM Transaction WHERE amount > ? AND date >= ?` with `parameters: [1000, "2024-01-01"]`
1603
- *
1604
- * **Limits:**
1605
- * - Query timeout: 30 seconds
1606
- * - Result limit: 10,000 rows (use LIMIT clause)
1607
- * - Read-only: No INSERT, UPDATE, DELETE
1608
- * - User's tables only: Cannot query other users' data
1609
- *
1610
- * **Subgraph Support:**
1611
- * This endpoint accepts both parent graph IDs and subgraph IDs.
1612
- * - Parent graph: Use `graph_id` like `kg0123456789abcdef`
1613
- * - Subgraph: Use full subgraph ID like `kg0123456789abcdef_dev`
1614
- * Each subgraph has its own independent staging tables.
1615
- *
1616
- * **Shared Repositories:**
1617
- * Shared repositories (SEC, etc.) do not allow direct SQL queries.
1618
- * Use the graph query endpoint instead: `POST /v1/graphs/{graph_id}/query`
1619
- *
1620
- * **Note:**
1621
- * Staging table queries are included - no credit consumption
811
+ * Execute SQL against DuckDB staging tables for pre-ingestion validation. Use `?` placeholders with the `parameters` array to prevent injection. Read-only (SELECT only), 30s timeout, 10K row limit. Not allowed on shared repositories.
1622
812
  */
1623
813
  const queryTables = (options) => (options.client ?? client_gen_1.client).post({
1624
814
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1631,9 +821,9 @@ const queryTables = (options) => (options.client ?? client_gen_1.client).post({
1631
821
  });
1632
822
  exports.queryTables = queryTables;
1633
823
  /**
1634
- * Search Documents
824
+ * Search Graph Documents
1635
825
  *
1636
- * Search filing narratives and text content within a graph.
826
+ * Shared repositories require a subscription; subscription plan determines search rate limits.
1637
827
  */
1638
828
  const searchDocuments = (options) => (options.client ?? client_gen_1.client).post({
1639
829
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1647,8 +837,6 @@ const searchDocuments = (options) => (options.client ?? client_gen_1.client).pos
1647
837
  exports.searchDocuments = searchDocuments;
1648
838
  /**
1649
839
  * Get Document Section
1650
- *
1651
- * Retrieve the full text of a document section by ID.
1652
840
  */
1653
841
  const getDocumentSection = (options) => (options.client ?? client_gen_1.client).get({
1654
842
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1658,8 +846,6 @@ const getDocumentSection = (options) => (options.client ?? client_gen_1.client).
1658
846
  exports.getDocumentSection = getDocumentSection;
1659
847
  /**
1660
848
  * List Documents
1661
- *
1662
- * List documents for a graph from PostgreSQL.
1663
849
  */
1664
850
  const listDocuments = (options) => (options.client ?? client_gen_1.client).get({
1665
851
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1670,7 +856,7 @@ exports.listDocuments = listDocuments;
1670
856
  /**
1671
857
  * Upload Document
1672
858
  *
1673
- * Upload a markdown document. Stored in PostgreSQL, synced to OpenSearch.
859
+ * Stored in PostgreSQL, synced to OpenSearch for search. Not allowed on shared repositories.
1674
860
  */
1675
861
  const uploadDocument = (options) => (options.client ?? client_gen_1.client).post({
1676
862
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1684,8 +870,6 @@ const uploadDocument = (options) => (options.client ?? client_gen_1.client).post
1684
870
  exports.uploadDocument = uploadDocument;
1685
871
  /**
1686
872
  * Delete Document
1687
- *
1688
- * Delete a document from PostgreSQL and OpenSearch.
1689
873
  */
1690
874
  const deleteDocument = (options) => (options.client ?? client_gen_1.client).delete({
1691
875
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1695,8 +879,6 @@ const deleteDocument = (options) => (options.client ?? client_gen_1.client).dele
1695
879
  exports.deleteDocument = deleteDocument;
1696
880
  /**
1697
881
  * Get Document
1698
- *
1699
- * Get a document with full content from PostgreSQL.
1700
882
  */
1701
883
  const getDocument = (options) => (options.client ?? client_gen_1.client).get({
1702
884
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1707,7 +889,7 @@ exports.getDocument = getDocument;
1707
889
  /**
1708
890
  * Update Document
1709
891
  *
1710
- * Update a document's content and/or metadata. Re-syncs to OpenSearch.
892
+ * Updates content and/or metadata. Re-syncs to OpenSearch.
1711
893
  */
1712
894
  const updateDocument = (options) => (options.client ?? client_gen_1.client).put({
1713
895
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1719,25 +901,10 @@ const updateDocument = (options) => (options.client ?? client_gen_1.client).put(
1719
901
  }
1720
902
  });
1721
903
  exports.updateDocument = updateDocument;
1722
- /**
1723
- * Upload Documents Bulk
1724
- *
1725
- * Upload multiple markdown documents (max 50).
1726
- */
1727
- const uploadDocumentsBulk = (options) => (options.client ?? client_gen_1.client).post({
1728
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1729
- url: '/v1/graphs/{graph_id}/documents/bulk',
1730
- ...options,
1731
- headers: {
1732
- 'Content-Type': 'application/json',
1733
- ...options.headers
1734
- }
1735
- });
1736
- exports.uploadDocumentsBulk = uploadDocumentsBulk;
1737
904
  /**
1738
905
  * Create Subgraph
1739
906
  *
1740
- * Create a new subgraph, optionally forking parent data.
907
+ * Set `fork_parent=true` to clone parent graph data into the new subgraph (async, returns a pending `OperationEnvelope`). Without `fork_parent`, creates an empty subgraph synchronously.
1741
908
  *
1742
909
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1743
910
  */
@@ -1754,7 +921,7 @@ exports.opCreateSubgraph = opCreateSubgraph;
1754
921
  /**
1755
922
  * Delete Subgraph
1756
923
  *
1757
- * Delete a subgraph database.
924
+ * Set `backup_first=true` to create a safety backup before deletion. Requires admin role on the parent graph.
1758
925
  *
1759
926
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1760
927
  */
@@ -1771,7 +938,7 @@ exports.opDeleteSubgraph = opDeleteSubgraph;
1771
938
  /**
1772
939
  * Create Backup
1773
940
  *
1774
- * Create a backup of the graph database (async).
941
+ * Not allowed on shared repositories. Only `full_dump` format supported. Retention capped at tier maximum. Monitor progress via SSE at `/v1/operations/{operation_id}/stream`.
1775
942
  *
1776
943
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1777
944
  */
@@ -1788,10 +955,7 @@ exports.opCreateBackup = opCreateBackup;
1788
955
  /**
1789
956
  * Restore Backup
1790
957
  *
1791
- * Restore a graph database from an encrypted backup.
1792
- *
1793
- * Blocked for entity graphs — OLTP is the source of truth, use
1794
- * the materialize operation instead.
958
+ * Only encrypted backups can be restored. Not allowed on entity graphs (use `materialize` instead) or shared repositories.
1795
959
  *
1796
960
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1797
961
  */
@@ -1808,7 +972,7 @@ exports.opRestoreBackup = opRestoreBackup;
1808
972
  /**
1809
973
  * Change Tier
1810
974
  *
1811
- * Change the infrastructure tier on a graph (async EBS migration).
975
+ * Async EBS migration (3-5 min). Valid tiers: `ladybug-standard`, `ladybug-large`, `ladybug-xlarge`.
1812
976
  *
1813
977
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1814
978
  */
@@ -1825,7 +989,7 @@ exports.opChangeTier = opChangeTier;
1825
989
  /**
1826
990
  * Materialize Graph
1827
991
  *
1828
- * Materialize graph from staging tables or extensions OLTP.
992
+ * Rebuilds LadybugDB from staging tables (file uploads) or extensions OLTP data. Set `dry_run=true` to preview without changes.
1829
993
  *
1830
994
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1831
995
  */
@@ -1842,37 +1006,7 @@ exports.opMaterialize = opMaterialize;
1842
1006
  /**
1843
1007
  * List Files in Graph
1844
1008
  *
1845
- * List all files in the graph with optional filtering.
1846
- *
1847
- * Get a complete inventory of files across all tables or filtered by table name,
1848
- * status, or other criteria. Files are first-class resources with independent lifecycle.
1849
- *
1850
- * **Query Parameters:**
1851
- * - `table_name` (optional): Filter by table name
1852
- * - `status` (optional): Filter by upload status (uploaded, pending, failed, etc.)
1853
- *
1854
- * **Use Cases:**
1855
- * - Monitor file upload progress across all tables
1856
- * - Verify files are ready for ingestion
1857
- * - Check file metadata and sizes
1858
- * - Track storage usage per graph
1859
- * - Identify failed or incomplete uploads
1860
- * - Audit file provenance
1861
- *
1862
- * **Returned Metadata:**
1863
- * - File ID, name, and format (parquet, csv, json)
1864
- * - Size in bytes and row count (if available)
1865
- * - Upload status and timestamps
1866
- * - DuckDB and graph ingestion status
1867
- * - Table association
1868
- *
1869
- * **File Lifecycle Tracking:**
1870
- * Multi-layer status across S3 → DuckDB → Graph pipeline
1871
- *
1872
- * **Important Notes:**
1873
- * - Files are graph-scoped, not table-scoped
1874
- * - Use table_name parameter to filter by table
1875
- * - File listing is included - no credit consumption
1009
+ * Filter by `table_name` or upload `status`. Files are graph-scoped resources with S3 → DuckDB → Graph lifecycle tracking.
1876
1010
  */
1877
1011
  const listFiles = (options) => (options.client ?? client_gen_1.client).get({
1878
1012
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1883,33 +1017,7 @@ exports.listFiles = listFiles;
1883
1017
  /**
1884
1018
  * Create File Upload
1885
1019
  *
1886
- * Generate presigned S3 URL for file upload.
1887
- *
1888
- * Initiate file upload by generating a secure, time-limited presigned S3 URL.
1889
- * Files are first-class resources uploaded directly to S3.
1890
- *
1891
- * **Request Body:**
1892
- * - `file_name`: Name of the file (1-255 characters)
1893
- * - `file_format`: Format (parquet, csv, json)
1894
- * - `table_name`: Table to associate file with
1895
- *
1896
- * **Upload Workflow:**
1897
- * 1. Call this endpoint to get presigned URL
1898
- * 2. PUT file directly to S3 URL
1899
- * 3. Call PATCH /files/{file_id} with status='uploaded'
1900
- * 4. Backend validates and stages in DuckDB immediately
1901
- * 5. Background task ingests to graph
1902
- *
1903
- * **Supported Formats:**
1904
- * - Parquet, CSV, JSON
1905
- *
1906
- * **Auto-Table Creation:**
1907
- * Tables are automatically created if they don't exist.
1908
- *
1909
- * **Important Notes:**
1910
- * - Presigned URLs expire (default: 1 hour)
1911
- * - Files are graph-scoped, independent resources
1912
- * - Upload URL generation is included - no credit consumption
1020
+ * Returns a presigned S3 URL for direct upload. After uploading, call `PATCH /files/{file_id}` with `status=uploaded` to trigger DuckDB staging. Tables are auto-created if missing. Not allowed on entity graphs or shared repositories.
1913
1021
  */
1914
1022
  const createFileUpload = (options) => (options.client ?? client_gen_1.client).post({
1915
1023
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1924,41 +1032,7 @@ exports.createFileUpload = createFileUpload;
1924
1032
  /**
1925
1033
  * Delete File
1926
1034
  *
1927
- * Delete file from all layers.
1928
- *
1929
- * Remove file from S3, database tracking, and optionally from DuckDB and graph.
1930
- * Files are deleted by file_id, independent of table context.
1931
- *
1932
- * **Query Parameters:**
1933
- * - `cascade` (optional, default=false): Delete from all layers including DuckDB
1934
- *
1935
- * **What Happens (cascade=false):**
1936
- * 1. File deleted from S3
1937
- * 2. Database record removed
1938
- * 3. Table statistics updated
1939
- *
1940
- * **What Happens (cascade=true):**
1941
- * 1. File data deleted from all DuckDB tables (by file_id)
1942
- * 2. Graph marked as stale
1943
- * 3. File deleted from S3
1944
- * 4. Database record removed
1945
- * 5. Table statistics updated
1946
- *
1947
- * **Use Cases:**
1948
- * - Remove incorrect or duplicate files
1949
- * - Clean up failed uploads
1950
- * - Delete files before graph ingestion
1951
- * - Surgical data removal with cascade
1952
- *
1953
- * **Security:**
1954
- * - Write access required
1955
- * - Shared repositories block deletions
1956
- * - Full audit trail
1957
- *
1958
- * **Important:**
1959
- * - Use cascade=true for immediate DuckDB cleanup
1960
- * - Graph rebuild recommended after cascade deletion
1961
- * - File deletion is included - no credit consumption
1035
+ * Removes from S3 and database. `cascade=true` also deletes data from DuckDB tables and marks the graph stale (rebuild recommended). Not allowed on shared repositories.
1962
1036
  */
1963
1037
  const deleteFile = (options) => (options.client ?? client_gen_1.client).delete({
1964
1038
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -1969,41 +1043,7 @@ exports.deleteFile = deleteFile;
1969
1043
  /**
1970
1044
  * Get File Information
1971
1045
  *
1972
- * Get detailed information about a specific file.
1973
- *
1974
- * Retrieve comprehensive metadata for a single file by file_id, independent of
1975
- * table context. Files are first-class resources with complete lifecycle tracking.
1976
- *
1977
- * **Returned Information:**
1978
- * - File ID, name, format, size
1979
- * - Upload status and timestamps
1980
- * - **Enhanced Multi-Layer Status** (new in this version):
1981
- * - S3 layer: upload_status, uploaded_at, size_bytes, row_count
1982
- * - DuckDB layer: duckdb_status, duckdb_staged_at, duckdb_row_count
1983
- * - Graph layer: graph_status, graph_ingested_at
1984
- * - Table association
1985
- * - S3 location
1986
- *
1987
- * **Multi-Layer Pipeline Visibility:**
1988
- * The `layers` object provides independent status tracking across the three-tier
1989
- * data pipeline:
1990
- * - **S3 (Immutable Source)**: File upload and validation
1991
- * - **DuckDB (Mutable Staging)**: Immediate queryability with file provenance
1992
- * - **Graph (Immutable View)**: Optional graph database materialization
1993
- *
1994
- * Each layer shows its own status, timestamp, and row count (where applicable),
1995
- * enabling precise debugging and monitoring of the data ingestion flow.
1996
- *
1997
- * **Use Cases:**
1998
- * - Validate file upload completion
1999
- * - Monitor multi-layer ingestion progress in real-time
2000
- * - Debug upload or staging issues at specific layers
2001
- * - Verify file metadata and row counts
2002
- * - Track file provenance through the pipeline
2003
- * - Identify bottlenecks in the ingestion process
2004
- *
2005
- * **Note:**
2006
- * File info retrieval is included - no credit consumption
1046
+ * Returns per-layer status (`layers.s3`, `layers.duckdb`, `layers.graph`) for pipeline debugging.
2007
1047
  */
2008
1048
  const getFile = (options) => (options.client ?? client_gen_1.client).get({
2009
1049
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2014,32 +1054,7 @@ exports.getFile = getFile;
2014
1054
  /**
2015
1055
  * Update File Status
2016
1056
  *
2017
- * Update file status and trigger processing.
2018
- *
2019
- * Update file status after upload completion. Setting status='uploaded' triggers
2020
- * immediate DuckDB staging and optional graph ingestion.
2021
- *
2022
- * **Request Body:**
2023
- * - `status`: New status (uploaded, disabled, failed)
2024
- * - `ingest_to_graph` (optional): If true, auto-ingest to graph after DuckDB staging
2025
- *
2026
- * **What Happens (status='uploaded'):**
2027
- * 1. File validated in S3
2028
- * 2. Row count calculated
2029
- * 3. DuckDB staging triggered immediately (background task)
2030
- * 4. If ingest_to_graph=true, graph ingestion queued
2031
- * 5. File queryable in DuckDB within seconds
2032
- *
2033
- * **Use Cases:**
2034
- * - Signal upload completion
2035
- * - Trigger immediate DuckDB staging
2036
- * - Enable/disable files
2037
- * - Mark failed uploads
2038
- *
2039
- * **Important:**
2040
- * - Files must exist in S3 before marking uploaded
2041
- * - DuckDB staging happens asynchronously
2042
- * - Graph ingestion is optional (ingest_to_graph flag)
1057
+ * Setting `status=uploaded` validates the file in S3, calculates row count, and triggers DuckDB staging. Small files use direct staging; large files use a background Dagster job with an `operation_id` for SSE monitoring. Set `ingest_to_graph=true` to auto-chain graph materialization.
2043
1058
  */
2044
1059
  const updateFile = (options) => (options.client ?? client_gen_1.client).patch({
2045
1060
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2052,49 +1067,7 @@ const updateFile = (options) => (options.client ?? client_gen_1.client).patch({
2052
1067
  });
2053
1068
  exports.updateFile = updateFile;
2054
1069
  /**
2055
- * Get User Graphs and Repositories
2056
- *
2057
- * List all graph databases and shared repositories accessible to the current user.
2058
- *
2059
- * Returns a unified list of both user-created graphs and shared repositories (like SEC data)
2060
- * that the user has access to, including their role/access level and selection status.
2061
- *
2062
- * **Returned Information:**
2063
- * - Graph/Repository ID and display name
2064
- * - User's role/access level (admin/member for graphs, read/write/admin for repositories)
2065
- * - Selection status (only user graphs can be selected)
2066
- * - Creation timestamp
2067
- * - Repository type indicator (isRepository: true for shared repositories)
2068
- *
2069
- * **User Graphs (isRepository: false):**
2070
- * - Collaborative workspaces that can be shared with other users
2071
- * - Roles: `admin` (full access, can invite users) or `member` (read/write access)
2072
- * - Can be selected as active workspace
2073
- * - Graphs you create or have been invited to
2074
- *
2075
- * **Shared Repositories (isRepository: true):**
2076
- * - Read-only data repositories (e.g., SEC filings)
2077
- * - Access levels: `read`, `write` (for data contributions), `admin`
2078
- * - Cannot be selected (each has separate subscription)
2079
- * - Require separate subscriptions (personal, cannot be shared)
2080
- *
2081
- * **Selected Graph Concept:**
2082
- * The "selected" graph is the user's currently active workspace (user graphs only).
2083
- * Many API operations default to the selected graph if no graph_id is provided.
2084
- * Users can change their selected graph via `POST /v1/graphs/{graph_id}/select`.
2085
- *
2086
- * **Use Cases:**
2087
- * - Display unified graph/repository selector in UI
2088
- * - Show all accessible data sources (both owned graphs and subscribed repositories)
2089
- * - Identify currently active workspace
2090
- * - Filter by type (user graphs vs repositories)
2091
- *
2092
- * **Empty Response:**
2093
- * New users receive an empty list with `selectedGraphId: null`. Users should create
2094
- * a graph or subscribe to a repository.
2095
- *
2096
- * **Note:**
2097
- * Graph listing is included - no credit consumption required.
1070
+ * List User Graphs and Repositories
2098
1071
  */
2099
1072
  const getGraphs = (options) => (options?.client ?? client_gen_1.client).get({
2100
1073
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2105,66 +1078,7 @@ exports.getGraphs = getGraphs;
2105
1078
  /**
2106
1079
  * Create New Graph Database
2107
1080
  *
2108
- * Create a new graph database with specified schema and an initial entity.
2109
- *
2110
- * This endpoint starts an asynchronous graph creation operation and returns
2111
- * connection details for monitoring progress via Server-Sent Events (SSE).
2112
- *
2113
- * **Graph Creation Options:**
2114
- *
2115
- * 1. **Entity Graph** (`initial_entity` required, `custom_schema` omitted):
2116
- * - Creates graph structure with entity schema extensions
2117
- * - `initial_entity` is required — entity graphs must have an entity
2118
- * - Set `create_entity=False` to defer entity population (e.g. file-based ingestion)
2119
- * - Example: Creating a company graph with the company pre-populated
2120
- *
2121
- * 2. **Custom Graph** (`custom_schema` provided, no `initial_entity`):
2122
- * - Creates a generic graph with a fully custom schema
2123
- * - `initial_entity` is not used
2124
- * - Example: Analytics graphs, custom data models
2125
- *
2126
- * **Required Fields:**
2127
- * - `metadata.graph_name`: Unique name for the graph
2128
- * - `instance_tier`: Resource tier (ladybug-standard, ladybug-large, ladybug-xlarge)
2129
- * - `initial_entity`: Entity data — required for entity graphs (omit only when providing `custom_schema`)
2130
- *
2131
- * **Optional Fields:**
2132
- * - `metadata.description`: Human-readable description of the graph's purpose
2133
- * - `metadata.schema_extensions`: List of schema extensions (roboledger, roboinvestor, etc.)
2134
- * - `tags`: Organizational tags (max 10)
2135
- * - `create_entity`: Whether to populate entity data on creation (default: true)
2136
- *
2137
- * **Monitoring Progress:**
2138
- * Use the returned `operation_id` to connect to the SSE stream:
2139
- * ```javascript
2140
- * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
2141
- * eventSource.onmessage = (event) => {
2142
- * const data = JSON.parse(event.data);
2143
- * console.log('Progress:', data.progress_percent + '%');
2144
- * };
2145
- * ```
2146
- *
2147
- * **SSE Connection Limits:**
2148
- * - Maximum 5 concurrent SSE connections per user
2149
- * - Rate limited to 10 new connections per minute
2150
- * - Automatic circuit breaker for Redis failures
2151
- * - Graceful degradation if event system unavailable
2152
- *
2153
- * **Events Emitted:**
2154
- * - `operation_started`: Graph creation begins
2155
- * - `operation_progress`: Schema loading, database setup, etc.
2156
- * - `operation_completed`: Graph ready with connection details
2157
- * - `operation_error`: Creation failed with error details
2158
- *
2159
- * **Error Handling:**
2160
- * - `429 Too Many Requests`: SSE connection limit exceeded
2161
- * - `503 Service Unavailable`: SSE system temporarily disabled
2162
- * - Clients should implement exponential backoff on errors
2163
- *
2164
- * **Response includes:**
2165
- * - `operation_id`: Unique identifier for monitoring
2166
- * - `_links.stream`: SSE endpoint for real-time updates
2167
- * - `_links.status`: Point-in-time status check endpoint
1081
+ * Creates a graph asynchronously. Returns an `OperationEnvelope` with `operation_id` for SSE progress at `/v1/operations/{operation_id}/stream`. Entity graphs require `initial_entity`. Supports `Idempotency-Key` header.
2168
1082
  */
2169
1083
  const createGraph = (options) => (options.client ?? client_gen_1.client).post({
2170
1084
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2178,35 +1092,6 @@ const createGraph = (options) => (options.client ?? client_gen_1.client).post({
2178
1092
  exports.createGraph = createGraph;
2179
1093
  /**
2180
1094
  * Get Available Schema Extensions
2181
- *
2182
- * List all available schema extensions for graph creation.
2183
- *
2184
- * Schema extensions provide pre-built industry-specific data models that extend
2185
- * the base graph schema with specialized nodes, relationships, and properties.
2186
- *
2187
- * **Available Extensions:**
2188
- * - **RoboLedger**: Complete accounting system with XBRL reporting, general ledger, and financial statements
2189
- * - **RoboInvestor**: Investment portfolio management with securities tracking, trade execution, and risk analysis
2190
- * - **RoboSCM**: Supply chain management and logistics
2191
- * - **RoboFO**: Front office operations and CRM
2192
- * - **RoboHRM**: Human resources management
2193
- * - **RoboEPM**: Enterprise performance management
2194
- * - **RoboReport**: Business intelligence and reporting
2195
- *
2196
- * **Extension Information:**
2197
- * Each extension includes:
2198
- * - Display name and description
2199
- * - Node and relationship counts
2200
- * - Context-aware capabilities (e.g., SEC repositories get different features than entity graphs)
2201
- *
2202
- * **Use Cases:**
2203
- * - Browse available extensions before creating a graph
2204
- * - Understand extension capabilities and data models
2205
- * - Plan graph schema based on business requirements
2206
- * - Combine multiple extensions for comprehensive data modeling
2207
- *
2208
- * **Note:**
2209
- * Extension listing is included - no credit consumption required.
2210
1095
  */
2211
1096
  const getAvailableExtensions = (options) => (options?.client ?? client_gen_1.client).get({
2212
1097
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2216,32 +1101,6 @@ const getAvailableExtensions = (options) => (options?.client ?? client_gen_1.cli
2216
1101
  exports.getAvailableExtensions = getAvailableExtensions;
2217
1102
  /**
2218
1103
  * Get Available Graph Tiers
2219
- *
2220
- * List all available graph database tier configurations.
2221
- *
2222
- * This endpoint provides comprehensive technical specifications for each available
2223
- * graph database tier, including instance types, resource limits, and features.
2224
- *
2225
- * **Tier Information:**
2226
- * Each tier includes:
2227
- * - Technical specifications (instance type, memory, storage)
2228
- * - Resource limits (subgraphs, credits, rate limits)
2229
- * - Feature list with capabilities
2230
- * - Availability status
2231
- *
2232
- * **Available Tiers:**
2233
- * - **ladybug-standard**: Dedicated entry-level tier
2234
- * - **ladybug-large**: Dedicated professional tier with subgraph support
2235
- * - **ladybug-xlarge**: Enterprise tier with maximum resources
2236
- *
2237
- * **Use Cases:**
2238
- * - Display tier options in graph creation UI
2239
- * - Show technical specifications for tier selection
2240
- * - Validate tier availability before graph creation
2241
- * - Display feature comparisons
2242
- *
2243
- * **Note:**
2244
- * Tier listing is included - no credit consumption required.
2245
1104
  */
2246
1105
  const getAvailableGraphTiers = (options) => (options?.client ?? client_gen_1.client).get({
2247
1106
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2252,26 +1111,7 @@ exports.getAvailableGraphTiers = getAvailableGraphTiers;
2252
1111
  /**
2253
1112
  * Get Graph Tier Capacity
2254
1113
  *
2255
- * Check current infrastructure capacity for each graph database tier.
2256
- *
2257
- * Returns a status per tier indicating whether instances are immediately available,
2258
- * can be provisioned on demand, or are at capacity.
2259
- *
2260
- * **Status Values:**
2261
- * - `ready` — An instance slot is available; graph creation will succeed immediately
2262
- * - `scalable` — No slots right now, but a new instance can be provisioned (3-5 min)
2263
- * - `at_capacity` — Tier is full and cannot auto-scale; contact support
2264
- *
2265
- * **Use Cases:**
2266
- * - Pre-flight check before entering the graph creation wizard
2267
- * - Show availability badges on tier selection cards
2268
- * - Gate tier selection and show contact form for at-capacity tiers
2269
- *
2270
- * **Caching:**
2271
- * Results are cached for 60 seconds to avoid excessive infrastructure queries.
2272
- *
2273
- * **Note:**
2274
- * No credit consumption required. Does not expose instance counts or IPs.
1114
+ * Status per tier: `ready` (slot available), `scalable` (can provision, 3-5 min), `at_capacity` (contact support). Cached 60s.
2275
1115
  */
2276
1116
  const getGraphCapacity = (options) => (options?.client ?? client_gen_1.client).get({
2277
1117
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2281,36 +1121,6 @@ const getGraphCapacity = (options) => (options?.client ?? client_gen_1.client).g
2281
1121
  exports.getGraphCapacity = getGraphCapacity;
2282
1122
  /**
2283
1123
  * Select Graph
2284
- *
2285
- * Select a specific graph as the active workspace for the user.
2286
- *
2287
- * The selected graph becomes the default context for operations in client applications
2288
- * and can be used to maintain user workspace preferences across sessions.
2289
- *
2290
- * **Functionality:**
2291
- * - Sets the specified graph as the user's currently selected graph
2292
- * - Deselects any previously selected graph (only one can be selected at a time)
2293
- * - Persists selection across sessions until changed
2294
- * - Returns confirmation with the selected graph ID
2295
- *
2296
- * **Requirements:**
2297
- * - User must have access to the graph (as admin or member)
2298
- * - Graph must exist and not be deleted
2299
- * - User can only select graphs they have permission to access
2300
- *
2301
- * **Use Cases:**
2302
- * - Switch between multiple graphs in a multi-graph environment
2303
- * - Set default workspace after creating a new graph
2304
- * - Restore user's preferred workspace on login
2305
- * - Support graph context switching in client applications
2306
- *
2307
- * **Client Integration:**
2308
- * Many client operations can default to the selected graph, simplifying API calls
2309
- * by eliminating the need to specify graph_id repeatedly. Check the selected
2310
- * graph with `GET /v1/graphs` which returns `selectedGraphId`.
2311
- *
2312
- * **Note:**
2313
- * Graph selection is included - no credit consumption required.
2314
1124
  */
2315
1125
  const selectGraph = (options) => (options.client ?? client_gen_1.client).post({
2316
1126
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2321,81 +1131,14 @@ exports.selectGraph = selectGraph;
2321
1131
  /**
2322
1132
  * Get Service Offerings
2323
1133
  *
2324
- * Get comprehensive information about all subscription offerings.
2325
- *
2326
- * This endpoint provides complete information about both graph database subscriptions
2327
- * and shared repository subscriptions. This is the primary endpoint for frontend
2328
- * applications to display subscription options.
2329
- *
2330
- * **Pricing Model:**
2331
- * - Graph subscriptions are **per-graph** with infrastructure-based pricing
2332
- * - Each graph you create has its own monthly subscription
2333
- * - Organizations can have multiple graphs with different infrastructure tiers
2334
- * - Credits are allocated per-graph, not shared across organization
2335
- *
2336
- * Includes:
2337
- * - Graph infrastructure tiers (ladybug-standard, ladybug-large, ladybug-xlarge) - per-graph pricing
2338
- * - Shared repository subscriptions - org-level
2339
- * - Operation costs and credit information
2340
- * - Features and capabilities for each tier
2341
- * - Enabled/disabled status for repositories
2342
- *
2343
- * All data comes from the config-based systems to ensure accuracy with backend behavior.
2344
- *
2345
- * No authentication required - this is public service information.
1134
+ * Returns all subscription tiers, shared repository plans, and AI credit costs. No authentication required.
2346
1135
  */
2347
1136
  const getServiceOfferings = (options) => (options?.client ?? client_gen_1.client).get({ url: '/v1/offering', ...options });
2348
1137
  exports.getServiceOfferings = getServiceOfferings;
2349
1138
  /**
2350
1139
  * Stream Operation Events
2351
1140
  *
2352
- * Stream real-time events for an operation using Server-Sent Events (SSE).
2353
- *
2354
- * This endpoint provides real-time monitoring for all non-immediate operations including:
2355
- * - Graph creation and management
2356
- * - Agent analysis processing
2357
- * - Database backups and restores
2358
- * - Data synchronization tasks
2359
- *
2360
- * **Event Types:**
2361
- * - `operation_started`: Operation began execution
2362
- * - `operation_progress`: Progress update with details
2363
- * - `operation_completed`: Operation finished successfully
2364
- * - `operation_error`: Operation failed with error details
2365
- * - `operation_cancelled`: Operation was cancelled
2366
- *
2367
- * **Features:**
2368
- * - **Event Replay**: Use `from_sequence` parameter to replay missed events
2369
- * - **Automatic Reconnection**: Client can reconnect and resume from last seen event
2370
- * - **Real-time Updates**: Live progress updates during execution
2371
- * - **Timeout Handling**: 30-second keepalive messages prevent connection timeouts
2372
- * - **Graceful Degradation**: Automatic fallback if Redis is unavailable
2373
- *
2374
- * **Connection Limits:**
2375
- * - Maximum 5 concurrent SSE connections per user
2376
- * - Rate limited to 10 new connections per minute
2377
- * - Automatic cleanup of stale connections
2378
- * - Circuit breaker protection for Redis failures
2379
- *
2380
- * **Client Usage:**
2381
- * ```javascript
2382
- * const eventSource = new EventSource('/v1/operations/abc123/stream');
2383
- * eventSource.onmessage = (event) => {
2384
- * const data = JSON.parse(event.data);
2385
- * console.log('Progress:', data);
2386
- * };
2387
- * eventSource.onerror = (error) => {
2388
- * // Handle connection errors or rate limits
2389
- * console.error('SSE Error:', error);
2390
- * };
2391
- * ```
2392
- *
2393
- * **Error Handling:**
2394
- * - `429 Too Many Requests`: Connection limit or rate limit exceeded
2395
- * - `503 Service Unavailable`: SSE system temporarily disabled
2396
- * - Clients should implement exponential backoff on errors
2397
- *
2398
- * **No credits are consumed for SSE connections.**
1141
+ * Server-Sent Events stream for real-time operation progress. Use `from_sequence` to replay missed events on reconnect. Max 5 concurrent SSE connections per user. Consumes no credits.
2399
1142
  */
2400
1143
  const streamOperationEvents = (options) => (options.client ?? client_gen_1.client).get({
2401
1144
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2406,19 +1149,7 @@ exports.streamOperationEvents = streamOperationEvents;
2406
1149
  /**
2407
1150
  * Get Operation Status
2408
1151
  *
2409
- * Get current status and metadata for an operation.
2410
- *
2411
- * Returns detailed information including:
2412
- * - Current status (pending, running, completed, failed, cancelled)
2413
- * - Creation and update timestamps
2414
- * - Operation type and associated graph
2415
- * - Result data (for completed operations)
2416
- * - Error details (for failed operations)
2417
- *
2418
- * This endpoint provides a point-in-time status check, while the `/stream` endpoint
2419
- * provides real-time updates. Use this for polling or initial status checks.
2420
- *
2421
- * **No credits are consumed for status checks.**
1152
+ * Point-in-time status check. Use `/stream` for real-time updates. Consumes no credits.
2422
1153
  */
2423
1154
  const getOperationStatus = (options) => (options.client ?? client_gen_1.client).get({
2424
1155
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2429,15 +1160,7 @@ exports.getOperationStatus = getOperationStatus;
2429
1160
  /**
2430
1161
  * Cancel Operation
2431
1162
  *
2432
- * Cancel a pending or running operation.
2433
- *
2434
- * Cancels the specified operation if it's still in progress. Once cancelled,
2435
- * the operation cannot be resumed and will emit a cancellation event to any
2436
- * active SSE connections.
2437
- *
2438
- * **Note**: Completed or already failed operations cannot be cancelled.
2439
- *
2440
- * **No credits are consumed for cancellation requests.**
1163
+ * Cancels a pending or running operation. Emits a cancellation event to any active SSE connections. Cannot cancel completed or failed operations.
2441
1164
  */
2442
1165
  const cancelOperation = (options) => (options.client ?? client_gen_1.client).delete({
2443
1166
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2448,13 +1171,7 @@ exports.cancelOperation = cancelOperation;
2448
1171
  /**
2449
1172
  * Get Organization Customer Info
2450
1173
  *
2451
- * Get billing customer information for an organization including payment methods on file.
2452
- *
2453
- * Returns customer details, payment methods, and whether invoice billing is enabled.
2454
- *
2455
- * **Requirements:**
2456
- * - User must be a member of the organization
2457
- * - Sensitive payment details are only visible to owners
1174
+ * Payment method details are only visible to org owners.
2458
1175
  */
2459
1176
  const getOrgBillingCustomer = (options) => (options.client ?? client_gen_1.client).get({
2460
1177
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2465,19 +1182,7 @@ exports.getOrgBillingCustomer = getOrgBillingCustomer;
2465
1182
  /**
2466
1183
  * Create Customer Portal Session
2467
1184
  *
2468
- * Create a Stripe Customer Portal session for managing payment methods.
2469
- *
2470
- * The portal allows users to:
2471
- * - Add new payment methods
2472
- * - Remove existing payment methods
2473
- * - Update default payment method
2474
- * - View billing history
2475
- *
2476
- * The user will be redirected to Stripe's hosted portal page and returned to the billing page when done.
2477
- *
2478
- * **Requirements:**
2479
- * - User must be an OWNER of the organization
2480
- * - Organization must have a Stripe customer ID (i.e., has gone through checkout at least once)
1185
+ * Returns a Stripe Customer Portal URL for managing payment methods and billing history. Requires org owner role.
2481
1186
  */
2482
1187
  const createPortalSession = (options) => (options.client ?? client_gen_1.client).post({
2483
1188
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2487,13 +1192,6 @@ const createPortalSession = (options) => (options.client ?? client_gen_1.client)
2487
1192
  exports.createPortalSession = createPortalSession;
2488
1193
  /**
2489
1194
  * List Organization Subscriptions
2490
- *
2491
- * List all active and past subscriptions for an organization.
2492
- *
2493
- * Includes both graph and repository subscriptions with their status, pricing, and billing information.
2494
- *
2495
- * **Requirements:**
2496
- * - User must be a member of the organization
2497
1195
  */
2498
1196
  const listOrgSubscriptions = (options) => (options.client ?? client_gen_1.client).get({
2499
1197
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2503,11 +1201,6 @@ const listOrgSubscriptions = (options) => (options.client ?? client_gen_1.client
2503
1201
  exports.listOrgSubscriptions = listOrgSubscriptions;
2504
1202
  /**
2505
1203
  * Get Organization Subscription Details
2506
- *
2507
- * Get detailed information about a specific subscription.
2508
- *
2509
- * **Requirements:**
2510
- * - User must be a member of the organization
2511
1204
  */
2512
1205
  const getOrgSubscription = (options) => (options.client ?? client_gen_1.client).get({
2513
1206
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2518,12 +1211,7 @@ exports.getOrgSubscription = getOrgSubscription;
2518
1211
  /**
2519
1212
  * Cancel Organization Subscription
2520
1213
  *
2521
- * Cancel an organization subscription.
2522
- *
2523
- * The subscription will remain active until the end of the current billing period.
2524
- *
2525
- * **Requirements:**
2526
- * - User must be an OWNER of the organization
1214
+ * Cancels at period end — subscription remains active through the current billing cycle. Requires org owner role.
2527
1215
  */
2528
1216
  const cancelOrgSubscription = (options) => (options.client ?? client_gen_1.client).post({
2529
1217
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2534,13 +1222,7 @@ exports.cancelOrgSubscription = cancelOrgSubscription;
2534
1222
  /**
2535
1223
  * List Organization Invoices
2536
1224
  *
2537
- * List payment history and invoices for an organization.
2538
- *
2539
- * Returns past invoices with payment status, amounts, and line items.
2540
- *
2541
- * **Requirements:**
2542
- * - User must be a member of the organization
2543
- * - Full invoice details are only visible to owners and admins
1225
+ * Requires admin or owner role.
2544
1226
  */
2545
1227
  const listOrgInvoices = (options) => (options.client ?? client_gen_1.client).get({
2546
1228
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2551,13 +1233,7 @@ exports.listOrgInvoices = listOrgInvoices;
2551
1233
  /**
2552
1234
  * Get Organization Upcoming Invoice
2553
1235
  *
2554
- * Get preview of the next invoice for an organization.
2555
- *
2556
- * Returns estimated charges for the next billing period.
2557
- *
2558
- * **Requirements:**
2559
- * - User must be a member of the organization
2560
- * - Full invoice details are only visible to owners and admins
1236
+ * Requires admin or owner role. Returns null if no billing activity yet.
2561
1237
  */
2562
1238
  const getOrgUpcomingInvoice = (options) => (options.client ?? client_gen_1.client).get({
2563
1239
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2568,23 +1244,7 @@ exports.getOrgUpcomingInvoice = getOrgUpcomingInvoice;
2568
1244
  /**
2569
1245
  * Create Payment Checkout Session
2570
1246
  *
2571
- * Create a Stripe checkout session for collecting payment method.
2572
- *
2573
- * This endpoint is used when an organization owner needs to add a payment method before
2574
- * provisioning resources. It creates a pending subscription and redirects
2575
- * to Stripe Checkout to collect payment details.
2576
- *
2577
- * **Flow:**
2578
- * 1. Owner tries to create a graph but org has no payment method
2579
- * 2. Frontend calls this endpoint with graph configuration
2580
- * 3. Backend creates a subscription in PENDING_PAYMENT status for the user's org
2581
- * 4. Returns Stripe Checkout URL
2582
- * 5. User completes payment on Stripe
2583
- * 6. Webhook activates subscription and provisions resource
2584
- *
2585
- * **Requirements:**
2586
- * - User must be an OWNER of their organization
2587
- * - Enterprise customers (with invoice_billing_enabled) should not call this endpoint.
1247
+ * Initiates a Stripe checkout session for payment collection. Creates a pending subscription; the webhook activates it and provisions the resource after payment completes. Returns billing_disabled=true with no URL when billing is off. Requires org owner role.
2588
1248
  */
2589
1249
  const createCheckoutSession = (options) => (options.client ?? client_gen_1.client).post({
2590
1250
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2599,21 +1259,7 @@ exports.createCheckoutSession = createCheckoutSession;
2599
1259
  /**
2600
1260
  * Get Checkout Session Status
2601
1261
  *
2602
- * Poll the status of a checkout session.
2603
- *
2604
- * Frontend should poll this endpoint after user returns from Stripe Checkout
2605
- * to determine when the resource is ready.
2606
- *
2607
- * **Status Values:**
2608
- * - `pending_payment`: Waiting for payment to complete
2609
- * - `provisioning`: Payment confirmed, resource being created
2610
- * - `active`: Resource is ready (resource_id will be set)
2611
- * - `failed`: Something went wrong (error field will be set)
2612
- * - `canceled`: Payment was canceled
2613
- *
2614
- * **When status is 'active':**
2615
- * - For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE progress
2616
- * - For repositories: `resource_id` will be the repository name and access is immediately available
1262
+ * Poll after returning from Stripe Checkout. Status progresses: pending_payment → provisioning → active. When active, resource_id is populated; for graphs, operation_id tracks SSE provisioning progress.
2617
1263
  */
2618
1264
  const getCheckoutStatus = (options) => (options.client ?? client_gen_1.client).get({
2619
1265
  security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
@@ -2654,7 +1300,7 @@ exports.handleHttpPostExtensionsGraphIdGraphqlPost = handleHttpPostExtensionsGra
2654
1300
  /**
2655
1301
  * Update Entity
2656
1302
  *
2657
- * Update entity details. Only provided (non-null) fields are updated.
1303
+ * Only provided (non-null) fields are updated.
2658
1304
  *
2659
1305
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2660
1306
  */
@@ -2671,7 +1317,7 @@ exports.opUpdateEntity = opUpdateEntity;
2671
1317
  /**
2672
1318
  * Initialize Ledger
2673
1319
  *
2674
- * One-time ledger initialization create fiscal calendar + seed periods.
1320
+ * One-time setup: creates the fiscal calendar and seeds periods. Returns 409 if already initialized.
2675
1321
  *
2676
1322
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2677
1323
  */
@@ -2688,7 +1334,7 @@ exports.opInitializeLedger = opInitializeLedger;
2688
1334
  /**
2689
1335
  * Set Close Target
2690
1336
  *
2691
- * Set the user-controlled close target (YYYY-MM).
1337
+ * Period format: YYYY-MM. The close target is the user-controlled goal date, distinct from `closed_through` (what's actually closed).
2692
1338
  *
2693
1339
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2694
1340
  */
@@ -2705,7 +1351,7 @@ exports.opSetCloseTarget = opSetCloseTarget;
2705
1351
  /**
2706
1352
  * Close Fiscal Period
2707
1353
  *
2708
- * Close a fiscal period — the final commit action.
1354
+ *
2709
1355
  *
2710
1356
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2711
1357
  */
@@ -2722,7 +1368,7 @@ exports.opClosePeriod = opClosePeriod;
2722
1368
  /**
2723
1369
  * Reopen Fiscal Period
2724
1370
  *
2725
- * Reopen a closed fiscal period decrements `closed_through`.
1371
+ * Decrements `closed_through` by one — only the most recently closed period can be reopened.
2726
1372
  *
2727
1373
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2728
1374
  */
@@ -2736,78 +1382,10 @@ const opReopenPeriod = (options) => (options.client ?? client_gen_1.client).post
2736
1382
  }
2737
1383
  });
2738
1384
  exports.opReopenPeriod = opReopenPeriod;
2739
- /**
2740
- * Create Schedule
2741
- *
2742
- * Create a schedule with pre-generated monthly facts.
2743
- *
2744
- * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2745
- */
2746
- const opCreateSchedule = (options) => (options.client ?? client_gen_1.client).post({
2747
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2748
- url: '/extensions/roboledger/{graph_id}/operations/create-schedule',
2749
- ...options,
2750
- headers: {
2751
- 'Content-Type': 'application/json',
2752
- ...options.headers
2753
- }
2754
- });
2755
- exports.opCreateSchedule = opCreateSchedule;
2756
- /**
2757
- * Truncate Schedule (End Early)
2758
- *
2759
- * End a schedule early — delete forward facts + stale drafts.
2760
- *
2761
- * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2762
- */
2763
- const opTruncateSchedule = (options) => (options.client ?? client_gen_1.client).post({
2764
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2765
- url: '/extensions/roboledger/{graph_id}/operations/truncate-schedule',
2766
- ...options,
2767
- headers: {
2768
- 'Content-Type': 'application/json',
2769
- ...options.headers
2770
- }
2771
- });
2772
- exports.opTruncateSchedule = opTruncateSchedule;
2773
- /**
2774
- * Create Closing Entry
2775
- *
2776
- * Create a draft closing entry from a schedule's facts for a period.
2777
- *
2778
- * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2779
- */
2780
- const opCreateClosingEntry = (options) => (options.client ?? client_gen_1.client).post({
2781
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2782
- url: '/extensions/roboledger/{graph_id}/operations/create-closing-entry',
2783
- ...options,
2784
- headers: {
2785
- 'Content-Type': 'application/json',
2786
- ...options.headers
2787
- }
2788
- });
2789
- exports.opCreateClosingEntry = opCreateClosingEntry;
2790
- /**
2791
- * Create Manual Closing Entry
2792
- *
2793
- * Create a manual (non-schedule) draft closing entry.
2794
- *
2795
- * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2796
- */
2797
- const opCreateManualClosingEntry = (options) => (options.client ?? client_gen_1.client).post({
2798
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2799
- url: '/extensions/roboledger/{graph_id}/operations/create-manual-closing-entry',
2800
- ...options,
2801
- headers: {
2802
- 'Content-Type': 'application/json',
2803
- ...options.headers
2804
- }
2805
- });
2806
- exports.opCreateManualClosingEntry = opCreateManualClosingEntry;
2807
1385
  /**
2808
1386
  * Create Taxonomy
2809
1387
  *
2810
- * Create a new taxonomy definition.
1388
+ *
2811
1389
  *
2812
1390
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2813
1391
  */
@@ -2824,7 +1402,7 @@ exports.opCreateTaxonomy = opCreateTaxonomy;
2824
1402
  /**
2825
1403
  * Create Structure
2826
1404
  *
2827
- * Create a new structure (statement, mapping, schedule, etc.).
1405
+ * Structures organize elements within a taxonomy. Types: `statement`, `mapping`, `schedule`, `presentation`, `calculation`.
2828
1406
  *
2829
1407
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2830
1408
  */
@@ -2838,27 +1416,10 @@ const opCreateStructure = (options) => (options.client ?? client_gen_1.client).p
2838
1416
  }
2839
1417
  });
2840
1418
  exports.opCreateStructure = opCreateStructure;
2841
- /**
2842
- * Create Mapping Association
2843
- *
2844
- * Add a mapping association (CoA element → reporting concept).
2845
- *
2846
- * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2847
- */
2848
- const opCreateMappingAssociation = (options) => (options.client ?? client_gen_1.client).post({
2849
- security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2850
- url: '/extensions/roboledger/{graph_id}/operations/create-mapping-association',
2851
- ...options,
2852
- headers: {
2853
- 'Content-Type': 'application/json',
2854
- ...options.headers
2855
- }
2856
- });
2857
- exports.opCreateMappingAssociation = opCreateMappingAssociation;
2858
1419
  /**
2859
1420
  * Delete Mapping Association
2860
1421
  *
2861
- * Remove a mapping association.
1422
+ *
2862
1423
  *
2863
1424
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2864
1425
  */
@@ -3144,6 +1705,74 @@ const opReverseJournalEntry = (options) => (options.client ?? client_gen_1.clien
3144
1705
  }
3145
1706
  });
3146
1707
  exports.opReverseJournalEntry = opReverseJournalEntry;
1708
+ /**
1709
+ * Create Schedule
1710
+ *
1711
+ * Create a schedule and pre-generate monthly amortization facts spanning the period range. `entry_template` defines the debit/credit elements used by `create-closing-entry` each period.
1712
+ *
1713
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1714
+ */
1715
+ const opCreateSchedule = (options) => (options.client ?? client_gen_1.client).post({
1716
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1717
+ url: '/extensions/roboledger/{graph_id}/operations/create-schedule',
1718
+ ...options,
1719
+ headers: {
1720
+ 'Content-Type': 'application/json',
1721
+ ...options.headers
1722
+ }
1723
+ });
1724
+ exports.opCreateSchedule = opCreateSchedule;
1725
+ /**
1726
+ * Truncate Schedule (End Early)
1727
+ *
1728
+ * End a schedule early by deleting forward facts and any stale draft closing entries past the cutoff. Historical facts and posted entries are preserved. Use this when a business event (asset disposal, contract cancellation) shortens the schedule's lifespan.
1729
+ *
1730
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1731
+ */
1732
+ const opTruncateSchedule = (options) => (options.client ?? client_gen_1.client).post({
1733
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1734
+ url: '/extensions/roboledger/{graph_id}/operations/truncate-schedule',
1735
+ ...options,
1736
+ headers: {
1737
+ 'Content-Type': 'application/json',
1738
+ ...options.headers
1739
+ }
1740
+ });
1741
+ exports.opTruncateSchedule = opTruncateSchedule;
1742
+ /**
1743
+ * Create Closing Entry
1744
+ *
1745
+ * Create a draft closing entry pre-populated from a schedule's facts for the given period. Idempotent — safe to call repeatedly; the `outcome` field describes what happened (`created`, `unchanged`, `regenerated`, `removed`, `skipped`).
1746
+ *
1747
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1748
+ */
1749
+ const opCreateClosingEntry = (options) => (options.client ?? client_gen_1.client).post({
1750
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1751
+ url: '/extensions/roboledger/{graph_id}/operations/create-closing-entry',
1752
+ ...options,
1753
+ headers: {
1754
+ 'Content-Type': 'application/json',
1755
+ ...options.headers
1756
+ }
1757
+ });
1758
+ exports.opCreateClosingEntry = opCreateClosingEntry;
1759
+ /**
1760
+ * Create Manual Closing Entry
1761
+ *
1762
+ * Create a draft closing entry with manually specified line items — not tied to a schedule. Use for one-off business events (asset disposal, correcting entry, impairment). Total debits must equal total credits.
1763
+ *
1764
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1765
+ */
1766
+ const opCreateManualClosingEntry = (options) => (options.client ?? client_gen_1.client).post({
1767
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1768
+ url: '/extensions/roboledger/{graph_id}/operations/create-manual-closing-entry',
1769
+ ...options,
1770
+ headers: {
1771
+ 'Content-Type': 'application/json',
1772
+ ...options.headers
1773
+ }
1774
+ });
1775
+ exports.opCreateManualClosingEntry = opCreateManualClosingEntry;
3147
1776
  /**
3148
1777
  * Update Schedule
3149
1778
  *
@@ -3179,20 +1808,26 @@ const opDeleteSchedule = (options) => (options.client ?? client_gen_1.client).po
3179
1808
  });
3180
1809
  exports.opDeleteSchedule = opDeleteSchedule;
3181
1810
  /**
3182
- * Auto-Map Elements via AI (async)
1811
+ * Create Mapping Association
3183
1812
  *
3184
- * Trigger autonomous CoA US GAAP mapping via background worker.
1813
+ * Link a chart-of-accounts element to a US GAAP reporting concept. For bulk associations (presentation/calculation linkbases, 50+ arcs at once) use `create-associations` instead.
3185
1814
  *
3186
- * This is the only async/Dagster-dispatched ledger operation. Instead
3187
- * of running synchronously, it enqueues a `MappingAgent` task and
3188
- * returns a `pending` envelope with the worker-issued operation_id —
3189
- * callers subscribe via `/v1/operations/{operation_id}/stream` for SSE
3190
- * progress events.
1815
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
1816
+ */
1817
+ const opCreateMappingAssociation = (options) => (options.client ?? client_gen_1.client).post({
1818
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
1819
+ url: '/extensions/roboledger/{graph_id}/operations/create-mapping-association',
1820
+ ...options,
1821
+ headers: {
1822
+ 'Content-Type': 'application/json',
1823
+ ...options.headers
1824
+ }
1825
+ });
1826
+ exports.opCreateMappingAssociation = opCreateMappingAssociation;
1827
+ /**
1828
+ * Auto-Map Elements via AI (async)
3191
1829
  *
3192
- * Confidence thresholds (in the agent):
3193
- * - ≥0.90: auto-approved mapping
3194
- * - 0.70-0.89: flagged for review
3195
- * - <0.70: skipped (left unmapped)
1830
+ * Dispatches to the background worker — returns a `pending` envelope immediately. Monitor via SSE at `/v1/operations/{operation_id}/stream`. Confidence thresholds: ≥0.90 auto-approved, 0.70–0.89 flagged for review, <0.70 skipped.
3196
1831
  *
3197
1832
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3198
1833
  */
@@ -3209,7 +1844,7 @@ exports.opAutoMapElements = opAutoMapElements;
3209
1844
  /**
3210
1845
  * Create Report
3211
1846
  *
3212
- * Create a report definition, generate facts, and mark as published.
1847
+ * Generates report facts from the ledger and marks the report as published.
3213
1848
  *
3214
1849
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3215
1850
  */
@@ -3226,7 +1861,7 @@ exports.opCreateReport = opCreateReport;
3226
1861
  /**
3227
1862
  * Regenerate Report
3228
1863
  *
3229
- * Regenerate a report with new period dates.
1864
+ *
3230
1865
  *
3231
1866
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3232
1867
  */
@@ -3243,7 +1878,7 @@ exports.opRegenerateReport = opRegenerateReport;
3243
1878
  /**
3244
1879
  * Delete Report
3245
1880
  *
3246
- * Delete a report definition and its facts.
1881
+ * Deletes the report definition and all generated facts.
3247
1882
  *
3248
1883
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3249
1884
  */
@@ -3260,7 +1895,7 @@ exports.opDeleteReport = opDeleteReport;
3260
1895
  /**
3261
1896
  * Share Report
3262
1897
  *
3263
- * Share a published report to a publish list's members.
1898
+ * Only published reports can be shared. Sends the report to all members of the target publish list.
3264
1899
  *
3265
1900
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3266
1901
  */
@@ -3277,7 +1912,7 @@ exports.opShareReport = opShareReport;
3277
1912
  /**
3278
1913
  * Create Publish List
3279
1914
  *
3280
- * Create a new publish list.
1915
+ *
3281
1916
  *
3282
1917
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3283
1918
  */
@@ -3294,7 +1929,7 @@ exports.opCreatePublishList = opCreatePublishList;
3294
1929
  /**
3295
1930
  * Update Publish List
3296
1931
  *
3297
- * Update a publish list's name / description.
1932
+ * Updates the publish list's `name` and/or `description`. Membership is managed via add/remove-member operations.
3298
1933
  *
3299
1934
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3300
1935
  */
@@ -3311,7 +1946,7 @@ exports.opUpdatePublishList = opUpdatePublishList;
3311
1946
  /**
3312
1947
  * Delete Publish List
3313
1948
  *
3314
- * Delete a publish list.
1949
+ *
3315
1950
  *
3316
1951
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3317
1952
  */
@@ -3328,7 +1963,7 @@ exports.opDeletePublishList = opDeletePublishList;
3328
1963
  /**
3329
1964
  * Add Members to Publish List
3330
1965
  *
3331
- * Add target graphs as members of a publish list.
1966
+ *
3332
1967
  *
3333
1968
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3334
1969
  */
@@ -3345,7 +1980,7 @@ exports.opAddPublishListMembers = opAddPublishListMembers;
3345
1980
  /**
3346
1981
  * Remove Member from Publish List
3347
1982
  *
3348
- * Remove a target graph from a publish list.
1983
+ *
3349
1984
  *
3350
1985
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3351
1986
  */
@@ -3360,19 +1995,26 @@ const opRemovePublishListMember = (options) => (options.client ?? client_gen_1.c
3360
1995
  });
3361
1996
  exports.opRemovePublishListMember = opRemovePublishListMember;
3362
1997
  /**
3363
- * Build Fact Grid
1998
+ * Live Financial Statement
3364
1999
  *
3365
- * Build a multi-dimensional fact grid against the graph schema.
2000
+ * Generate an ad-hoc financial statement directly from the tenant's OLTP ledger data using the active CoA→GAAP mapping. This is the authoritative source for RoboLedger entity graphs — no graph materialization required. Rejected on shared-repository graphs; those should use `financial-statement-analysis` instead.
3366
2001
  *
3367
- * Queries `Fact` nodes by element qnames or canonical concepts with
3368
- * optional filters for periods, entities, filing form, fiscal context,
3369
- * and period type. Returns a deduplicated pivot table plus optional
3370
- * summary statistics.
2002
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2003
+ */
2004
+ const opLiveFinancialStatement = (options) => (options.client ?? client_gen_1.client).post({
2005
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2006
+ url: '/extensions/roboledger/{graph_id}/operations/live-financial-statement',
2007
+ ...options,
2008
+ headers: {
2009
+ 'Content-Type': 'application/json',
2010
+ ...options.headers
2011
+ }
2012
+ });
2013
+ exports.opLiveFinancialStatement = opLiveFinancialStatement;
2014
+ /**
2015
+ * Build Fact Grid
3371
2016
  *
3372
- * This is a graph-database read the query runs against LadybugDB,
3373
- * not the extensions OLTP database. The same operation works for
3374
- * roboledger tenant graphs (post-materialization) and the SEC shared
3375
- * repository (which uses the same XBRL hypercube schema).
2017
+ * Queries LadybugDB `Fact` nodes by element qnames or canonical concepts, with filters for periods, entities, form, and fiscal context. Returns a deduplicated pivot table. Works on both roboledger tenant graphs (post-materialization) and the SEC shared repository.
3376
2018
  *
3377
2019
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3378
2020
  */
@@ -3387,9 +2029,26 @@ const opBuildFactGrid = (options) => (options.client ?? client_gen_1.client).pos
3387
2029
  });
3388
2030
  exports.opBuildFactGrid = opBuildFactGrid;
3389
2031
  /**
3390
- * Create Portfolio
2032
+ * Financial Statement Analysis
2033
+ *
2034
+ * Query a rendered financial statement from the graph-backed XBRL hypercube (Structure → FactSet → Fact). Works on the SEC shared repository today and on any RoboLedger tenant graph whose ledger has been materialized to LadybugDB. For shared-repo graphs, provide `ticker` to auto-resolve the latest filing; for tenant graphs, provide `report_id` explicitly.
3391
2035
  *
2036
+ * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
2037
+ */
2038
+ const opFinancialStatementAnalysis = (options) => (options.client ?? client_gen_1.client).post({
2039
+ security: [{ name: 'X-API-Key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' }],
2040
+ url: '/extensions/roboledger/{graph_id}/operations/financial-statement-analysis',
2041
+ ...options,
2042
+ headers: {
2043
+ 'Content-Type': 'application/json',
2044
+ ...options.headers
2045
+ }
2046
+ });
2047
+ exports.opFinancialStatementAnalysis = opFinancialStatementAnalysis;
2048
+ /**
2049
+ * Create Portfolio
3392
2050
  *
2051
+ * Create an investment portfolio within this graph. Portfolios are logical groupings of securities (stocks, notes, warrants) owned by the entity; subsequent positions attach to the portfolio.
3393
2052
  *
3394
2053
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3395
2054
  */
@@ -3406,7 +2065,7 @@ exports.opCreatePortfolio = opCreatePortfolio;
3406
2065
  /**
3407
2066
  * Update Portfolio
3408
2067
  *
3409
- *
2068
+ * Update mutable fields on a portfolio (name, description, strategy, inception_date, base_currency). Unset fields are ignored — partial updates are explicit.
3410
2069
  *
3411
2070
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3412
2071
  */
@@ -3423,7 +2082,7 @@ exports.opUpdatePortfolio = opUpdatePortfolio;
3423
2082
  /**
3424
2083
  * Delete Portfolio
3425
2084
  *
3426
- *
2085
+ * Hard-delete a portfolio. Returns 409 if the portfolio has active positions — dispose (soft-delete) them first.
3427
2086
  *
3428
2087
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3429
2088
  */
@@ -3440,7 +2099,7 @@ exports.opDeletePortfolio = opDeletePortfolio;
3440
2099
  /**
3441
2100
  * Create Security
3442
2101
  *
3443
- *
2102
+ * Register a security (common stock, preferred stock, warrant, convertible note, etc.) owned by this graph's entity. Optionally cross-links to an issuing entity in another graph via `source_graph_id` for mutual-handshake attribution.
3444
2103
  *
3445
2104
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3446
2105
  */
@@ -3457,7 +2116,7 @@ exports.opCreateSecurity = opCreateSecurity;
3457
2116
  /**
3458
2117
  * Update Security
3459
2118
  *
3460
- *
2119
+ * Update mutable fields on a security (name, type, subtype, terms, share counts, entity linkage). Unset fields are ignored.
3461
2120
  *
3462
2121
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3463
2122
  */
@@ -3474,7 +2133,7 @@ exports.opUpdateSecurity = opUpdateSecurity;
3474
2133
  /**
3475
2134
  * Delete Security
3476
2135
  *
3477
- *
2136
+ * Soft-delete the security (`is_active=false`). Historical positions referencing it remain valid.
3478
2137
  *
3479
2138
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3480
2139
  */
@@ -3491,7 +2150,7 @@ exports.opDeleteSecurity = opDeleteSecurity;
3491
2150
  /**
3492
2151
  * Create Position
3493
2152
  *
3494
- *
2153
+ * Open a position in a security within a portfolio. One active position per (portfolio, security) pair — creating a second active position returns 409. Dispose an existing position via `delete-position` before opening a new one.
3495
2154
  *
3496
2155
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3497
2156
  */
@@ -3508,7 +2167,7 @@ exports.opCreatePosition = opCreatePosition;
3508
2167
  /**
3509
2168
  * Update Position
3510
2169
  *
3511
- *
2170
+ * Update mutable fields on a position (quantity, cost basis, valuation, notes, status). Use `delete-position` for soft disposal instead of setting `status` manually.
3512
2171
  *
3513
2172
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3514
2173
  */
@@ -3525,7 +2184,7 @@ exports.opUpdatePosition = opUpdatePosition;
3525
2184
  /**
3526
2185
  * Delete Position
3527
2186
  *
3528
- *
2187
+ * Soft-delete the position (`status='disposed'`). Historical holding records referencing it remain valid.
3529
2188
  *
3530
2189
  * **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
3531
2190
  */