@robosystems/client 0.1.15 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/extensions/hooks.d.ts +1 -1
  2. package/package.json +48 -6
  3. package/sdk/client/client.gen.d.ts +2 -0
  4. package/sdk/client/client.gen.js +153 -0
  5. package/sdk/client/client.gen.ts +200 -0
  6. package/sdk/client/index.d.ts +7 -0
  7. package/sdk/client/index.js +15 -0
  8. package/sdk/client/index.ts +25 -0
  9. package/sdk/client/types.gen.d.ts +122 -0
  10. package/sdk/client/types.gen.js +4 -0
  11. package/sdk/client/types.gen.ts +233 -0
  12. package/sdk/client/utils.gen.d.ts +45 -0
  13. package/sdk/client/utils.gen.js +296 -0
  14. package/sdk/client/utils.gen.ts +419 -0
  15. package/sdk/client.gen.d.ts +12 -0
  16. package/sdk/client.gen.js +8 -0
  17. package/sdk/client.gen.ts +18 -0
  18. package/sdk/core/auth.gen.d.ts +18 -0
  19. package/sdk/core/auth.gen.js +18 -0
  20. package/sdk/core/auth.gen.ts +42 -0
  21. package/sdk/core/bodySerializer.gen.d.ts +17 -0
  22. package/sdk/core/bodySerializer.gen.js +57 -0
  23. package/sdk/core/bodySerializer.gen.ts +90 -0
  24. package/sdk/core/params.gen.d.ts +33 -0
  25. package/sdk/core/params.gen.js +92 -0
  26. package/sdk/core/params.gen.ts +153 -0
  27. package/sdk/core/pathSerializer.gen.d.ts +33 -0
  28. package/sdk/core/pathSerializer.gen.js +123 -0
  29. package/sdk/core/pathSerializer.gen.ts +181 -0
  30. package/sdk/core/types.gen.d.ts +78 -0
  31. package/sdk/core/types.gen.js +4 -0
  32. package/sdk/core/types.gen.ts +121 -0
  33. package/sdk/index.d.ts +2 -0
  34. package/sdk/index.js +19 -0
  35. package/sdk/index.ts +3 -0
  36. package/sdk/sdk.gen.d.ts +1249 -0
  37. package/sdk/sdk.gen.js +2572 -0
  38. package/sdk/sdk.gen.ts +2585 -0
  39. package/sdk/types.gen.d.ts +6347 -0
  40. package/sdk/types.gen.js +3 -0
  41. package/sdk/types.gen.ts +6852 -0
  42. package/sdk-extensions/OperationClient.d.ts +64 -0
  43. package/sdk-extensions/OperationClient.js +251 -0
  44. package/sdk-extensions/OperationClient.ts +322 -0
  45. package/sdk-extensions/QueryClient.d.ts +50 -0
  46. package/sdk-extensions/QueryClient.js +190 -0
  47. package/sdk-extensions/QueryClient.ts +283 -0
  48. package/sdk-extensions/README.md +672 -0
  49. package/sdk-extensions/SSEClient.d.ts +48 -0
  50. package/sdk-extensions/SSEClient.js +148 -0
  51. package/sdk-extensions/SSEClient.ts +189 -0
  52. package/sdk-extensions/config.d.ts +32 -0
  53. package/sdk-extensions/config.js +74 -0
  54. package/sdk-extensions/config.ts +91 -0
  55. package/sdk-extensions/hooks.d.ts +110 -0
  56. package/sdk-extensions/hooks.js +371 -0
  57. package/sdk-extensions/hooks.ts +438 -0
  58. package/sdk-extensions/index.d.ts +46 -0
  59. package/sdk-extensions/index.js +110 -0
  60. package/sdk-extensions/index.ts +123 -0
  61. package/sdk.gen.d.ts +210 -104
  62. package/sdk.gen.js +409 -287
  63. package/sdk.gen.ts +404 -282
  64. package/types.gen.d.ts +1218 -567
  65. package/types.gen.ts +1236 -566
  66. package/openapi-ts.config.js +0 -9
  67. package/prepare.js +0 -220
package/sdk/sdk.gen.js ADDED
@@ -0,0 +1,2572 @@
1
+ "use strict";
2
+ // This file is auto-generated by @hey-api/openapi-ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.createBackup = exports.listBackups = exports.callMcpTool = exports.listMcpTools = exports.queryFinancialAgent = exports.oauthCallback = exports.initOAuth = exports.exchangeLinkToken = exports.createLinkToken = exports.syncConnection = exports.getConnectionOptions = exports.getConnection = exports.deleteConnection = exports.createConnection = exports.listConnections = exports.getRepositoryCredits = exports.getSharedRepositoryCredits = exports.cancelSharedRepositorySubscription = exports.upgradeSharedRepositorySubscription = exports.subscribeToSharedRepository = exports.getUserSharedSubscriptions = exports.getDetailedUserAnalytics = exports.getUserUsageOverview = exports.getSharedRepositoryLimits = exports.getAllSharedRepositoryLimits = exports.getUserUsage = exports.getUserLimits = exports.updateUserApiKey = exports.revokeUserApiKey = exports.createUserApiKey = exports.listUserApiKeys = exports.updateUserPassword = exports.getAllCreditSummaries = exports.selectUserGraph = exports.getUserGraphs = exports.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getCaptchaConfig = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.completeSsoAuth = exports.ssoTokenExchange = exports.ssoLogin = exports.generateSsoToken = exports.refreshSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
+ exports.cancelOperation = exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.getAvailableExtensions = exports.createGraph = exports.copyDataToGraph = exports.getSubgraphQuota = exports.getSubgraphInfo = exports.deleteSubgraph = exports.createSubgraph = exports.listSubgraphs = exports.getGraphLimits = exports.getDatabaseInfo = exports.getDatabaseHealth = exports.checkStorageLimits = exports.getStorageUsage = exports.checkCreditBalance = exports.listCreditTransactions = exports.getCreditSummary = exports.getGraphMonthlyBill = exports.getGraphBillingHistory = exports.getGraphUsageDetails = exports.getCurrentGraphBill = exports.listSchemaExtensions = exports.exportGraphSchema = exports.validateSchema = exports.getGraphSchemaInfo = exports.executeCypherQuery = exports.getGraphUsageStats = exports.getGraphMetrics = exports.getBackupStats = exports.restoreBackup = exports.getBackupDownloadUrl = exports.exportBackup = void 0;
6
+ const client_gen_1 = require("./client.gen");
7
+ /**
8
+ * Register New User
9
+ * Register a new user account with email and password. Security controls vary by environment: CAPTCHA and email verification are disabled in development for API testing, but required in production.
10
+ */
11
+ const registerUser = (options) => {
12
+ return (options.client ?? client_gen_1.client).post({
13
+ url: '/v1/auth/register',
14
+ ...options,
15
+ headers: {
16
+ 'Content-Type': 'application/json',
17
+ ...options.headers
18
+ }
19
+ });
20
+ };
21
+ exports.registerUser = registerUser;
22
+ /**
23
+ * User Login
24
+ * Authenticate user with email and password.
25
+ */
26
+ const loginUser = (options) => {
27
+ return (options.client ?? client_gen_1.client).post({
28
+ url: '/v1/auth/login',
29
+ ...options,
30
+ headers: {
31
+ 'Content-Type': 'application/json',
32
+ ...options.headers
33
+ }
34
+ });
35
+ };
36
+ exports.loginUser = loginUser;
37
+ /**
38
+ * User Logout
39
+ * Logout user and invalidate session.
40
+ */
41
+ const logoutUser = (options) => {
42
+ return (options?.client ?? client_gen_1.client).post({
43
+ url: '/v1/auth/logout',
44
+ ...options
45
+ });
46
+ };
47
+ exports.logoutUser = logoutUser;
48
+ /**
49
+ * Get Current User
50
+ * Get current authenticated user from session.
51
+ */
52
+ const getCurrentAuthUser = (options) => {
53
+ return (options?.client ?? client_gen_1.client).get({
54
+ url: '/v1/auth/me',
55
+ ...options
56
+ });
57
+ };
58
+ exports.getCurrentAuthUser = getCurrentAuthUser;
59
+ /**
60
+ * Refresh Session
61
+ * Refresh user session and extend authentication token.
62
+ */
63
+ const refreshSession = (options) => {
64
+ return (options?.client ?? client_gen_1.client).post({
65
+ url: '/v1/auth/refresh',
66
+ ...options
67
+ });
68
+ };
69
+ exports.refreshSession = refreshSession;
70
+ /**
71
+ * Generate SSO Token
72
+ * Generate a temporary SSO token for cross-app authentication.
73
+ */
74
+ const generateSsoToken = (options) => {
75
+ return (options?.client ?? client_gen_1.client).post({
76
+ url: '/v1/auth/sso-token',
77
+ ...options
78
+ });
79
+ };
80
+ exports.generateSsoToken = generateSsoToken;
81
+ /**
82
+ * SSO Login
83
+ * Authenticate user with SSO token and establish session.
84
+ */
85
+ const ssoLogin = (options) => {
86
+ return (options.client ?? client_gen_1.client).post({
87
+ url: '/v1/auth/sso-login',
88
+ ...options,
89
+ headers: {
90
+ 'Content-Type': 'application/json',
91
+ ...options.headers
92
+ }
93
+ });
94
+ };
95
+ exports.ssoLogin = ssoLogin;
96
+ /**
97
+ * SSO Token Exchange
98
+ * Exchange SSO token for secure session handoff to target application.
99
+ */
100
+ const ssoTokenExchange = (options) => {
101
+ return (options.client ?? client_gen_1.client).post({
102
+ url: '/v1/auth/sso-exchange',
103
+ ...options,
104
+ headers: {
105
+ 'Content-Type': 'application/json',
106
+ ...options.headers
107
+ }
108
+ });
109
+ };
110
+ exports.ssoTokenExchange = ssoTokenExchange;
111
+ /**
112
+ * Complete SSO Authentication
113
+ * Complete SSO authentication using session ID from secure handoff.
114
+ */
115
+ const completeSsoAuth = (options) => {
116
+ return (options.client ?? client_gen_1.client).post({
117
+ url: '/v1/auth/sso-complete',
118
+ ...options,
119
+ headers: {
120
+ 'Content-Type': 'application/json',
121
+ ...options.headers
122
+ }
123
+ });
124
+ };
125
+ exports.completeSsoAuth = completeSsoAuth;
126
+ /**
127
+ * Get Password Policy
128
+ * Get current password policy requirements for frontend validation
129
+ */
130
+ const getPasswordPolicy = (options) => {
131
+ return (options?.client ?? client_gen_1.client).get({
132
+ url: '/v1/auth/password/policy',
133
+ ...options
134
+ });
135
+ };
136
+ exports.getPasswordPolicy = getPasswordPolicy;
137
+ /**
138
+ * Check Password Strength
139
+ * Check password strength and get validation feedback
140
+ */
141
+ const checkPasswordStrength = (options) => {
142
+ return (options.client ?? client_gen_1.client).post({
143
+ url: '/v1/auth/password/check',
144
+ ...options,
145
+ headers: {
146
+ 'Content-Type': 'application/json',
147
+ ...options.headers
148
+ }
149
+ });
150
+ };
151
+ exports.checkPasswordStrength = checkPasswordStrength;
152
+ /**
153
+ * Get CAPTCHA Configuration
154
+ * Get CAPTCHA configuration including site key and whether CAPTCHA is required.
155
+ */
156
+ const getCaptchaConfig = (options) => {
157
+ return (options?.client ?? client_gen_1.client).get({
158
+ url: '/v1/auth/captcha/config',
159
+ ...options
160
+ });
161
+ };
162
+ exports.getCaptchaConfig = getCaptchaConfig;
163
+ /**
164
+ * Health Check
165
+ * Service health check endpoint for monitoring and load balancers
166
+ */
167
+ const getServiceStatus = (options) => {
168
+ return (options?.client ?? client_gen_1.client).get({
169
+ url: '/v1/status',
170
+ ...options
171
+ });
172
+ };
173
+ exports.getServiceStatus = getServiceStatus;
174
+ /**
175
+ * Get Current User
176
+ * Returns information about the currently authenticated user.
177
+ */
178
+ const getCurrentUser = (options) => {
179
+ return (options?.client ?? client_gen_1.client).get({
180
+ security: [
181
+ {
182
+ name: 'X-API-Key',
183
+ type: 'apiKey'
184
+ },
185
+ {
186
+ scheme: 'bearer',
187
+ type: 'http'
188
+ }
189
+ ],
190
+ url: '/v1/user',
191
+ ...options
192
+ });
193
+ };
194
+ exports.getCurrentUser = getCurrentUser;
195
+ /**
196
+ * Update User Profile
197
+ * Update the current user's profile information.
198
+ */
199
+ const updateUser = (options) => {
200
+ return (options.client ?? client_gen_1.client).put({
201
+ security: [
202
+ {
203
+ name: 'X-API-Key',
204
+ type: 'apiKey'
205
+ },
206
+ {
207
+ scheme: 'bearer',
208
+ type: 'http'
209
+ }
210
+ ],
211
+ url: '/v1/user',
212
+ ...options,
213
+ headers: {
214
+ 'Content-Type': 'application/json',
215
+ ...options.headers
216
+ }
217
+ });
218
+ };
219
+ exports.updateUser = updateUser;
220
+ /**
221
+ * Get User Graphs
222
+ * Get all graph databases accessible to the current user.
223
+ */
224
+ const getUserGraphs = (options) => {
225
+ return (options?.client ?? client_gen_1.client).get({
226
+ security: [
227
+ {
228
+ name: 'X-API-Key',
229
+ type: 'apiKey'
230
+ },
231
+ {
232
+ scheme: 'bearer',
233
+ type: 'http'
234
+ }
235
+ ],
236
+ url: '/v1/user/graphs',
237
+ ...options
238
+ });
239
+ };
240
+ exports.getUserGraphs = getUserGraphs;
241
+ /**
242
+ * Select User Graph
243
+ * Select a specific graph as the active graph for the user.
244
+ */
245
+ const selectUserGraph = (options) => {
246
+ return (options.client ?? client_gen_1.client).post({
247
+ security: [
248
+ {
249
+ name: 'X-API-Key',
250
+ type: 'apiKey'
251
+ },
252
+ {
253
+ scheme: 'bearer',
254
+ type: 'http'
255
+ }
256
+ ],
257
+ url: '/v1/user/graphs/{graph_id}/select',
258
+ ...options
259
+ });
260
+ };
261
+ exports.selectUserGraph = selectUserGraph;
262
+ /**
263
+ * Get All Credit Summaries
264
+ * Get credit summaries for all graphs owned by the user.
265
+ *
266
+ * This endpoint provides a consolidated view of credit usage across
267
+ * all graphs where the user has access, helping to monitor overall
268
+ * credit consumption and plan usage.
269
+ *
270
+ * No credits are consumed for viewing summaries.
271
+ */
272
+ const getAllCreditSummaries = (options) => {
273
+ return (options?.client ?? client_gen_1.client).get({
274
+ security: [
275
+ {
276
+ name: 'X-API-Key',
277
+ type: 'apiKey'
278
+ },
279
+ {
280
+ scheme: 'bearer',
281
+ type: 'http'
282
+ }
283
+ ],
284
+ url: '/v1/user/credits',
285
+ ...options
286
+ });
287
+ };
288
+ exports.getAllCreditSummaries = getAllCreditSummaries;
289
+ /**
290
+ * Update Password
291
+ * Update the current user's password.
292
+ */
293
+ const updateUserPassword = (options) => {
294
+ return (options.client ?? client_gen_1.client).put({
295
+ security: [
296
+ {
297
+ name: 'X-API-Key',
298
+ type: 'apiKey'
299
+ },
300
+ {
301
+ scheme: 'bearer',
302
+ type: 'http'
303
+ }
304
+ ],
305
+ url: '/v1/user/password',
306
+ ...options,
307
+ headers: {
308
+ 'Content-Type': 'application/json',
309
+ ...options.headers
310
+ }
311
+ });
312
+ };
313
+ exports.updateUserPassword = updateUserPassword;
314
+ /**
315
+ * List API Keys
316
+ * Get all API keys for the current user.
317
+ */
318
+ const listUserApiKeys = (options) => {
319
+ return (options?.client ?? client_gen_1.client).get({
320
+ security: [
321
+ {
322
+ name: 'X-API-Key',
323
+ type: 'apiKey'
324
+ },
325
+ {
326
+ scheme: 'bearer',
327
+ type: 'http'
328
+ }
329
+ ],
330
+ url: '/v1/user/api-keys',
331
+ ...options
332
+ });
333
+ };
334
+ exports.listUserApiKeys = listUserApiKeys;
335
+ /**
336
+ * Create API Key
337
+ * Create a new API key for the current user.
338
+ */
339
+ const createUserApiKey = (options) => {
340
+ return (options.client ?? client_gen_1.client).post({
341
+ security: [
342
+ {
343
+ name: 'X-API-Key',
344
+ type: 'apiKey'
345
+ },
346
+ {
347
+ scheme: 'bearer',
348
+ type: 'http'
349
+ }
350
+ ],
351
+ url: '/v1/user/api-keys',
352
+ ...options,
353
+ headers: {
354
+ 'Content-Type': 'application/json',
355
+ ...options.headers
356
+ }
357
+ });
358
+ };
359
+ exports.createUserApiKey = createUserApiKey;
360
+ /**
361
+ * Revoke API Key
362
+ * Revoke (deactivate) an API key.
363
+ */
364
+ const revokeUserApiKey = (options) => {
365
+ return (options.client ?? client_gen_1.client).delete({
366
+ security: [
367
+ {
368
+ name: 'X-API-Key',
369
+ type: 'apiKey'
370
+ },
371
+ {
372
+ scheme: 'bearer',
373
+ type: 'http'
374
+ }
375
+ ],
376
+ url: '/v1/user/api-keys/{api_key_id}',
377
+ ...options
378
+ });
379
+ };
380
+ exports.revokeUserApiKey = revokeUserApiKey;
381
+ /**
382
+ * Update API Key
383
+ * Update an API key's name or description.
384
+ */
385
+ const updateUserApiKey = (options) => {
386
+ return (options.client ?? client_gen_1.client).put({
387
+ security: [
388
+ {
389
+ name: 'X-API-Key',
390
+ type: 'apiKey'
391
+ },
392
+ {
393
+ scheme: 'bearer',
394
+ type: 'http'
395
+ }
396
+ ],
397
+ url: '/v1/user/api-keys/{api_key_id}',
398
+ ...options,
399
+ headers: {
400
+ 'Content-Type': 'application/json',
401
+ ...options.headers
402
+ }
403
+ });
404
+ };
405
+ exports.updateUserApiKey = updateUserApiKey;
406
+ /**
407
+ * Get user limits
408
+ * Retrieve current limits and restrictions for the authenticated user
409
+ */
410
+ const getUserLimits = (options) => {
411
+ return (options?.client ?? client_gen_1.client).get({
412
+ security: [
413
+ {
414
+ name: 'X-API-Key',
415
+ type: 'apiKey'
416
+ },
417
+ {
418
+ scheme: 'bearer',
419
+ type: 'http'
420
+ }
421
+ ],
422
+ url: '/v1/user/limits',
423
+ ...options
424
+ });
425
+ };
426
+ exports.getUserLimits = getUserLimits;
427
+ /**
428
+ * Get user usage statistics
429
+ * Retrieve current usage statistics and remaining limits for the authenticated user
430
+ */
431
+ const getUserUsage = (options) => {
432
+ return (options?.client ?? client_gen_1.client).get({
433
+ security: [
434
+ {
435
+ name: 'X-API-Key',
436
+ type: 'apiKey'
437
+ },
438
+ {
439
+ scheme: 'bearer',
440
+ type: 'http'
441
+ }
442
+ ],
443
+ url: '/v1/user/limits/usage',
444
+ ...options
445
+ });
446
+ };
447
+ exports.getUserUsage = getUserUsage;
448
+ /**
449
+ * Get all shared repository limits
450
+ * Get rate limit status for all shared repositories the user has access to.
451
+ */
452
+ const getAllSharedRepositoryLimits = (options) => {
453
+ return (options?.client ?? client_gen_1.client).get({
454
+ security: [
455
+ {
456
+ name: 'X-API-Key',
457
+ type: 'apiKey'
458
+ },
459
+ {
460
+ scheme: 'bearer',
461
+ type: 'http'
462
+ }
463
+ ],
464
+ url: '/v1/user/limits/shared-repositories/summary',
465
+ ...options
466
+ });
467
+ };
468
+ exports.getAllSharedRepositoryLimits = getAllSharedRepositoryLimits;
469
+ /**
470
+ * Get shared repository rate limit status
471
+ * Get current rate limit status and usage for a shared repository.
472
+ *
473
+ * Returns:
474
+ * - Current usage across different time windows
475
+ * - Rate limits based on subscription tier
476
+ * - Remaining quota
477
+ * - Reset times
478
+ *
479
+ * Note: All queries are FREE - this only shows rate limit status.
480
+ */
481
+ const getSharedRepositoryLimits = (options) => {
482
+ return (options.client ?? client_gen_1.client).get({
483
+ security: [
484
+ {
485
+ name: 'X-API-Key',
486
+ type: 'apiKey'
487
+ },
488
+ {
489
+ scheme: 'bearer',
490
+ type: 'http'
491
+ }
492
+ ],
493
+ url: '/v1/user/limits/shared-repositories/{repository}',
494
+ ...options
495
+ });
496
+ };
497
+ exports.getSharedRepositoryLimits = getSharedRepositoryLimits;
498
+ /**
499
+ * Get User Usage Overview
500
+ * Get a high-level overview of usage statistics for the current user.
501
+ */
502
+ const getUserUsageOverview = (options) => {
503
+ return (options?.client ?? client_gen_1.client).get({
504
+ security: [
505
+ {
506
+ name: 'X-API-Key',
507
+ type: 'apiKey'
508
+ },
509
+ {
510
+ scheme: 'bearer',
511
+ type: 'http'
512
+ }
513
+ ],
514
+ url: '/v1/user/analytics/overview',
515
+ ...options
516
+ });
517
+ };
518
+ exports.getUserUsageOverview = getUserUsageOverview;
519
+ /**
520
+ * Get Detailed User Analytics
521
+ * Get comprehensive analytics for the current user including API usage and recent activity.
522
+ */
523
+ const getDetailedUserAnalytics = (options) => {
524
+ return (options?.client ?? client_gen_1.client).get({
525
+ security: [
526
+ {
527
+ name: 'X-API-Key',
528
+ type: 'apiKey'
529
+ },
530
+ {
531
+ scheme: 'bearer',
532
+ type: 'http'
533
+ }
534
+ ],
535
+ url: '/v1/user/analytics/detailed',
536
+ ...options
537
+ });
538
+ };
539
+ exports.getDetailedUserAnalytics = getDetailedUserAnalytics;
540
+ /**
541
+ * Get User Subscriptions
542
+ * Retrieve user's current shared repository subscriptions with detailed information
543
+ */
544
+ const getUserSharedSubscriptions = (options) => {
545
+ return (options?.client ?? client_gen_1.client).get({
546
+ security: [
547
+ {
548
+ name: 'X-API-Key',
549
+ type: 'apiKey'
550
+ },
551
+ {
552
+ scheme: 'bearer',
553
+ type: 'http'
554
+ }
555
+ ],
556
+ url: '/v1/user/subscriptions/shared-repositories',
557
+ ...options
558
+ });
559
+ };
560
+ exports.getUserSharedSubscriptions = getUserSharedSubscriptions;
561
+ /**
562
+ * Subscribe to Shared Repository
563
+ * Create a new subscription to a shared repository add-on with specified tier
564
+ */
565
+ const subscribeToSharedRepository = (options) => {
566
+ return (options.client ?? client_gen_1.client).post({
567
+ security: [
568
+ {
569
+ name: 'X-API-Key',
570
+ type: 'apiKey'
571
+ },
572
+ {
573
+ scheme: 'bearer',
574
+ type: 'http'
575
+ }
576
+ ],
577
+ url: '/v1/user/subscriptions/shared-repositories/subscribe',
578
+ ...options,
579
+ headers: {
580
+ 'Content-Type': 'application/json',
581
+ ...options.headers
582
+ }
583
+ });
584
+ };
585
+ exports.subscribeToSharedRepository = subscribeToSharedRepository;
586
+ /**
587
+ * Upgrade Subscription Tier
588
+ * Upgrade a subscription to a higher tier with immediate credit adjustment
589
+ */
590
+ const upgradeSharedRepositorySubscription = (options) => {
591
+ return (options.client ?? client_gen_1.client).put({
592
+ security: [
593
+ {
594
+ name: 'X-API-Key',
595
+ type: 'apiKey'
596
+ },
597
+ {
598
+ scheme: 'bearer',
599
+ type: 'http'
600
+ }
601
+ ],
602
+ url: '/v1/user/subscriptions/shared-repositories/{subscription_id}/upgrade',
603
+ ...options,
604
+ headers: {
605
+ 'Content-Type': 'application/json',
606
+ ...options.headers
607
+ }
608
+ });
609
+ };
610
+ exports.upgradeSharedRepositorySubscription = upgradeSharedRepositorySubscription;
611
+ /**
612
+ * Cancel Subscription
613
+ * Cancel a shared repository subscription and disable associated credit pool
614
+ */
615
+ const cancelSharedRepositorySubscription = (options) => {
616
+ return (options.client ?? client_gen_1.client).delete({
617
+ security: [
618
+ {
619
+ name: 'X-API-Key',
620
+ type: 'apiKey'
621
+ },
622
+ {
623
+ scheme: 'bearer',
624
+ type: 'http'
625
+ }
626
+ ],
627
+ url: '/v1/user/subscriptions/shared-repositories/{subscription_id}',
628
+ ...options
629
+ });
630
+ };
631
+ exports.cancelSharedRepositorySubscription = cancelSharedRepositorySubscription;
632
+ /**
633
+ * Get Credit Balances
634
+ * Retrieve credit balances for all shared repository subscriptions
635
+ */
636
+ const getSharedRepositoryCredits = (options) => {
637
+ return (options?.client ?? client_gen_1.client).get({
638
+ security: [
639
+ {
640
+ name: 'X-API-Key',
641
+ type: 'apiKey'
642
+ },
643
+ {
644
+ scheme: 'bearer',
645
+ type: 'http'
646
+ }
647
+ ],
648
+ url: '/v1/user/subscriptions/shared-repositories/credits',
649
+ ...options
650
+ });
651
+ };
652
+ exports.getSharedRepositoryCredits = getSharedRepositoryCredits;
653
+ /**
654
+ * Get Repository Credits
655
+ * Get credit balance for a specific shared repository
656
+ */
657
+ const getRepositoryCredits = (options) => {
658
+ return (options.client ?? client_gen_1.client).get({
659
+ security: [
660
+ {
661
+ name: 'X-API-Key',
662
+ type: 'apiKey'
663
+ },
664
+ {
665
+ scheme: 'bearer',
666
+ type: 'http'
667
+ }
668
+ ],
669
+ url: '/v1/user/subscriptions/shared-repositories/credits/{repository}',
670
+ ...options
671
+ });
672
+ };
673
+ exports.getRepositoryCredits = getRepositoryCredits;
674
+ /**
675
+ * List Connections
676
+ * List all data connections in the graph.
677
+ *
678
+ * Returns active and inactive connections with their current status.
679
+ * Connections can be filtered by:
680
+ * - **Entity**: Show connections for a specific entity
681
+ * - **Provider**: Filter by connection type (sec, quickbooks, plaid)
682
+ *
683
+ * Each connection shows:
684
+ * - Current sync status and health
685
+ * - Last successful sync timestamp
686
+ * - Configuration metadata
687
+ * - Error messages if any
688
+ *
689
+ * No credits are consumed for listing connections.
690
+ */
691
+ const listConnections = (options) => {
692
+ return (options.client ?? client_gen_1.client).get({
693
+ security: [
694
+ {
695
+ name: 'X-API-Key',
696
+ type: 'apiKey'
697
+ },
698
+ {
699
+ scheme: 'bearer',
700
+ type: 'http'
701
+ }
702
+ ],
703
+ url: '/v1/{graph_id}/connections',
704
+ ...options
705
+ });
706
+ };
707
+ exports.listConnections = listConnections;
708
+ /**
709
+ * Create Connection
710
+ * Create a new data connection for external system integration.
711
+ *
712
+ * This endpoint initiates connections to external data sources:
713
+ *
714
+ * **SEC Connections**:
715
+ * - Provide entity CIK for automatic filing retrieval
716
+ * - No authentication needed
717
+ * - Begins immediate data sync
718
+ *
719
+ * **QuickBooks Connections**:
720
+ * - Returns OAuth URL for authorization
721
+ * - Requires admin permissions in QuickBooks
722
+ * - Complete with OAuth callback
723
+ *
724
+ * **Plaid Connections**:
725
+ * - Returns Plaid Link token
726
+ * - User completes bank authentication
727
+ * - Exchange public token for access
728
+ *
729
+ * Note:
730
+ * This operation is FREE - no credit consumption required.
731
+ */
732
+ const createConnection = (options) => {
733
+ return (options.client ?? client_gen_1.client).post({
734
+ security: [
735
+ {
736
+ name: 'X-API-Key',
737
+ type: 'apiKey'
738
+ },
739
+ {
740
+ scheme: 'bearer',
741
+ type: 'http'
742
+ }
743
+ ],
744
+ url: '/v1/{graph_id}/connections',
745
+ ...options,
746
+ headers: {
747
+ 'Content-Type': 'application/json',
748
+ ...options.headers
749
+ }
750
+ });
751
+ };
752
+ exports.createConnection = createConnection;
753
+ /**
754
+ * Delete Connection
755
+ * Delete a data connection and clean up related resources.
756
+ *
757
+ * This operation:
758
+ * - Removes the connection configuration
759
+ * - Preserves any imported data in the graph
760
+ * - Performs provider-specific cleanup
761
+ * - Revokes stored credentials
762
+ *
763
+ * Note:
764
+ * This operation is FREE - no credit consumption required.
765
+ *
766
+ * Only users with admin role can delete connections.
767
+ */
768
+ const deleteConnection = (options) => {
769
+ return (options.client ?? client_gen_1.client).delete({
770
+ security: [
771
+ {
772
+ name: 'X-API-Key',
773
+ type: 'apiKey'
774
+ },
775
+ {
776
+ scheme: 'bearer',
777
+ type: 'http'
778
+ }
779
+ ],
780
+ url: '/v1/{graph_id}/connections/{connection_id}',
781
+ ...options
782
+ });
783
+ };
784
+ exports.deleteConnection = deleteConnection;
785
+ /**
786
+ * Get Connection
787
+ * Get detailed information about a specific connection.
788
+ *
789
+ * Returns comprehensive connection details including:
790
+ * - Current status and health indicators
791
+ * - Authentication state
792
+ * - Sync history and statistics
793
+ * - Error details if any
794
+ * - Provider-specific metadata
795
+ *
796
+ * No credits are consumed for viewing connection details.
797
+ */
798
+ const getConnection = (options) => {
799
+ return (options.client ?? client_gen_1.client).get({
800
+ security: [
801
+ {
802
+ name: 'X-API-Key',
803
+ type: 'apiKey'
804
+ },
805
+ {
806
+ scheme: 'bearer',
807
+ type: 'http'
808
+ }
809
+ ],
810
+ url: '/v1/{graph_id}/connections/{connection_id}',
811
+ ...options
812
+ });
813
+ };
814
+ exports.getConnection = getConnection;
815
+ /**
816
+ * List Connection Options
817
+ * Get metadata about all available data connection providers.
818
+ *
819
+ * This endpoint returns comprehensive information about each supported provider:
820
+ *
821
+ * **SEC EDGAR**: Public entity financial filings
822
+ * - No authentication required (public data)
823
+ * - 10-K, 10-Q, 8-K reports with XBRL data
824
+ * - Historical and real-time filing access
825
+ *
826
+ * **QuickBooks Online**: Full accounting system integration
827
+ * - OAuth 2.0 authentication
828
+ * - Chart of accounts, transactions, trial balance
829
+ * - Real-time sync capabilities
830
+ *
831
+ * **Plaid**: Bank account connections
832
+ * - Secure bank authentication via Plaid Link
833
+ * - Transaction history and balances
834
+ * - Multi-account support
835
+ *
836
+ * No credits are consumed for viewing connection options.
837
+ */
838
+ const getConnectionOptions = (options) => {
839
+ return (options.client ?? client_gen_1.client).get({
840
+ security: [
841
+ {
842
+ name: 'X-API-Key',
843
+ type: 'apiKey'
844
+ },
845
+ {
846
+ scheme: 'bearer',
847
+ type: 'http'
848
+ }
849
+ ],
850
+ url: '/v1/{graph_id}/connections/options',
851
+ ...options
852
+ });
853
+ };
854
+ exports.getConnectionOptions = getConnectionOptions;
855
+ /**
856
+ * Sync Connection
857
+ * Trigger a data synchronization for the connection.
858
+ *
859
+ * Initiates data sync based on provider type:
860
+ *
861
+ * **SEC Sync**:
862
+ * - Downloads latest filings from EDGAR
863
+ * - Parses XBRL data and updates graph
864
+ * - Typically completes in 5-10 minutes
865
+ *
866
+ * **QuickBooks Sync**:
867
+ * - Fetches latest transactions and balances
868
+ * - Updates chart of accounts
869
+ * - Generates fresh trial balance
870
+ * - Duration depends on data volume
871
+ *
872
+ * **Plaid Sync**:
873
+ * - Retrieves recent bank transactions
874
+ * - Updates account balances
875
+ * - Categorizes new transactions
876
+ *
877
+ * Note:
878
+ * This operation is FREE - no credit consumption required.
879
+ *
880
+ * Returns a task ID for monitoring sync progress.
881
+ */
882
+ const syncConnection = (options) => {
883
+ return (options.client ?? client_gen_1.client).post({
884
+ security: [
885
+ {
886
+ name: 'X-API-Key',
887
+ type: 'apiKey'
888
+ },
889
+ {
890
+ scheme: 'bearer',
891
+ type: 'http'
892
+ }
893
+ ],
894
+ url: '/v1/{graph_id}/connections/{connection_id}/sync',
895
+ ...options,
896
+ headers: {
897
+ 'Content-Type': 'application/json',
898
+ ...options.headers
899
+ }
900
+ });
901
+ };
902
+ exports.syncConnection = syncConnection;
903
+ /**
904
+ * Create Link Token
905
+ * Create a link token for embedded authentication providers.
906
+ *
907
+ * This endpoint generates a temporary token used to initialize embedded authentication UI.
908
+ *
909
+ * Currently supported providers:
910
+ * - **Plaid**: Bank account connections with real-time transaction access
911
+ *
912
+ * The link token:
913
+ * - Expires after 4 hours
914
+ * - Is single-use only
915
+ * - Must be used with the matching frontend SDK
916
+ * - Includes user and entity context
917
+ *
918
+ * No credits are consumed for creating link tokens.
919
+ */
920
+ const createLinkToken = (options) => {
921
+ return (options.client ?? client_gen_1.client).post({
922
+ security: [
923
+ {
924
+ name: 'X-API-Key',
925
+ type: 'apiKey'
926
+ },
927
+ {
928
+ scheme: 'bearer',
929
+ type: 'http'
930
+ }
931
+ ],
932
+ url: '/v1/{graph_id}/connections/link/token',
933
+ ...options,
934
+ headers: {
935
+ 'Content-Type': 'application/json',
936
+ ...options.headers
937
+ }
938
+ });
939
+ };
940
+ exports.createLinkToken = createLinkToken;
941
+ /**
942
+ * Exchange Link Token
943
+ * Exchange a public token for permanent access credentials.
944
+ *
945
+ * This completes the embedded authentication flow after user authorization.
946
+ *
947
+ * The exchange process:
948
+ * 1. Validates the temporary public token
949
+ * 2. Exchanges it for permanent access credentials
950
+ * 3. Updates the connection with account information
951
+ * 4. Optionally triggers initial data sync
952
+ *
953
+ * Supported providers:
954
+ * - **Plaid**: Exchanges Plaid Link public token for access token
955
+ *
956
+ * Security:
957
+ * - Public tokens expire after 30 minutes
958
+ * - Each token can only be exchanged once
959
+ * - Full audit trail is maintained
960
+ *
961
+ * No credits are consumed for token exchange.
962
+ */
963
+ const exchangeLinkToken = (options) => {
964
+ return (options.client ?? client_gen_1.client).post({
965
+ security: [
966
+ {
967
+ name: 'X-API-Key',
968
+ type: 'apiKey'
969
+ },
970
+ {
971
+ scheme: 'bearer',
972
+ type: 'http'
973
+ }
974
+ ],
975
+ url: '/v1/{graph_id}/connections/link/exchange',
976
+ ...options,
977
+ headers: {
978
+ 'Content-Type': 'application/json',
979
+ ...options.headers
980
+ }
981
+ });
982
+ };
983
+ exports.exchangeLinkToken = exchangeLinkToken;
984
+ /**
985
+ * Init Oauth
986
+ * Initialize OAuth flow for a connection.
987
+ *
988
+ * This generates an authorization URL that the frontend should redirect the user to.
989
+ * Currently supports: QuickBooks
990
+ */
991
+ const initOAuth = (options) => {
992
+ return (options.client ?? client_gen_1.client).post({
993
+ security: [
994
+ {
995
+ name: 'X-API-Key',
996
+ type: 'apiKey'
997
+ },
998
+ {
999
+ scheme: 'bearer',
1000
+ type: 'http'
1001
+ }
1002
+ ],
1003
+ url: '/v1/{graph_id}/connections/oauth/init',
1004
+ ...options,
1005
+ headers: {
1006
+ 'Content-Type': 'application/json',
1007
+ ...options.headers
1008
+ }
1009
+ });
1010
+ };
1011
+ exports.initOAuth = initOAuth;
1012
+ /**
1013
+ * OAuth Callback
1014
+ * Handle OAuth callback from provider after user authorization.
1015
+ *
1016
+ * This endpoint completes the OAuth flow:
1017
+ * 1. Validates the OAuth state parameter
1018
+ * 2. Exchanges authorization code for access tokens
1019
+ * 3. Stores tokens securely
1020
+ * 4. Updates connection status
1021
+ * 5. Optionally triggers initial sync
1022
+ *
1023
+ * Supported providers:
1024
+ * - **QuickBooks**: Accounting data integration
1025
+ *
1026
+ * Security measures:
1027
+ * - State validation prevents CSRF attacks
1028
+ * - User context is verified
1029
+ * - Tokens are encrypted before storage
1030
+ * - Full audit trail is maintained
1031
+ *
1032
+ * No credits are consumed for OAuth callbacks.
1033
+ */
1034
+ const oauthCallback = (options) => {
1035
+ return (options.client ?? client_gen_1.client).post({
1036
+ security: [
1037
+ {
1038
+ name: 'X-API-Key',
1039
+ type: 'apiKey'
1040
+ },
1041
+ {
1042
+ scheme: 'bearer',
1043
+ type: 'http'
1044
+ }
1045
+ ],
1046
+ url: '/v1/{graph_id}/connections/oauth/callback/{provider}',
1047
+ ...options,
1048
+ headers: {
1049
+ 'Content-Type': 'application/json',
1050
+ ...options.headers
1051
+ }
1052
+ });
1053
+ };
1054
+ exports.oauthCallback = oauthCallback;
1055
+ /**
1056
+ * Query Financial Agent
1057
+ * AI-powered financial analysis with direct access to graph data.
1058
+ *
1059
+ * This endpoint provides intelligent financial analysis using an AI agent that can:
1060
+ * - Analyze entity financial statements and SEC filings
1061
+ * - Review QuickBooks transactions and accounting data
1062
+ * - Perform multi-period trend analysis
1063
+ * - Generate insights from balance sheets and income statements
1064
+ * - Answer complex financial queries with contextual understanding
1065
+ *
1066
+ * **Execution Modes:**
1067
+ * - **Quick Analysis** (default): Synchronous responses for simple queries (1-2 tool calls)
1068
+ * - **Extended Analysis**: Asynchronous processing for complex research (returns operation_id for SSE monitoring)
1069
+ *
1070
+ * **Extended Analysis Monitoring:**
1071
+ * For complex queries, connect to the SSE stream for real-time progress:
1072
+ * ```javascript
1073
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1074
+ * eventSource.onmessage = (event) => {
1075
+ * const data = JSON.parse(event.data);
1076
+ * console.log('Analysis:', data.message);
1077
+ * };
1078
+ * ```
1079
+ *
1080
+ * **SSE Connection Limits:**
1081
+ * - Maximum 5 concurrent SSE connections per user
1082
+ * - Rate limited to 10 new connections per minute
1083
+ * - Automatic circuit breaker for Redis failures
1084
+ * - Graceful degradation with fallback to polling if SSE unavailable
1085
+ *
1086
+ * **Events Emitted:**
1087
+ * - `operation_started`: Analysis begins
1088
+ * - `operation_progress`: Tool calls, analysis steps
1089
+ * - `operation_completed`: Final comprehensive analysis
1090
+ * - `operation_error`: Analysis failed
1091
+ *
1092
+ * **Error Handling:**
1093
+ * - `429 Too Many Requests`: SSE connection limit exceeded
1094
+ * - `503 Service Unavailable`: SSE system temporarily disabled
1095
+ * - Fallback to status polling endpoint if SSE unavailable
1096
+ *
1097
+ * **Credit Consumption:**
1098
+ * - AI operations consume credits based on actual token usage
1099
+ * - Claude 4/4.1 Opus: ~15 credits per 1K input tokens, ~75 credits per 1K output tokens
1100
+ * - Claude 4 Sonnet: ~3 credits per 1K input tokens, ~15 credits per 1K output tokens
1101
+ * - Credits are consumed after operation completes based on actual usage
1102
+ *
1103
+ * The agent automatically determines query complexity or you can force extended analysis.
1104
+ */
1105
+ const queryFinancialAgent = (options) => {
1106
+ return (options.client ?? client_gen_1.client).post({
1107
+ security: [
1108
+ {
1109
+ name: 'X-API-Key',
1110
+ type: 'apiKey'
1111
+ },
1112
+ {
1113
+ scheme: 'bearer',
1114
+ type: 'http'
1115
+ }
1116
+ ],
1117
+ url: '/v1/{graph_id}/agent',
1118
+ ...options,
1119
+ headers: {
1120
+ 'Content-Type': 'application/json',
1121
+ ...options.headers
1122
+ }
1123
+ });
1124
+ };
1125
+ exports.queryFinancialAgent = queryFinancialAgent;
1126
+ /**
1127
+ * List MCP Tools
1128
+ * Get available Model Context Protocol tools for graph analysis.
1129
+ *
1130
+ * This endpoint returns a comprehensive list of MCP tools optimized for AI agents:
1131
+ * - Tool schemas with detailed parameter documentation
1132
+ * - Context-aware descriptions based on graph type
1133
+ * - Capability indicators for streaming and progress
1134
+ *
1135
+ * The tool list is customized based on:
1136
+ * - Graph type (shared repository vs user graph)
1137
+ * - User permissions and subscription tier
1138
+ * - Backend capabilities (Kuzu, Neo4j, etc.)
1139
+ *
1140
+ * Credit consumption:
1141
+ * - Listing tools is FREE to encourage exploration
1142
+ * - Tool execution costs vary by operation complexity
1143
+ */
1144
+ const listMcpTools = (options) => {
1145
+ return (options.client ?? client_gen_1.client).get({
1146
+ security: [
1147
+ {
1148
+ name: 'X-API-Key',
1149
+ type: 'apiKey'
1150
+ },
1151
+ {
1152
+ scheme: 'bearer',
1153
+ type: 'http'
1154
+ }
1155
+ ],
1156
+ url: '/v1/{graph_id}/mcp/tools',
1157
+ ...options
1158
+ });
1159
+ };
1160
+ exports.listMcpTools = listMcpTools;
1161
+ /**
1162
+ * Execute MCP Tool
1163
+ * Execute an MCP tool with intelligent response optimization.
1164
+ *
1165
+ * This endpoint automatically selects the best execution strategy based on:
1166
+ * - Tool type and estimated complexity
1167
+ * - Client capabilities (AI agent detection)
1168
+ * - System load and queue status
1169
+ * - Graph type (shared repository vs user graph)
1170
+ *
1171
+ * **Response Formats:**
1172
+ * - **JSON**: Direct response for small/fast operations
1173
+ * - **SSE**: Server-Sent Events for progress monitoring
1174
+ * - **NDJSON**: Newline-delimited JSON for streaming
1175
+ * - **Queued**: Asynchronous execution with status monitoring
1176
+ *
1177
+ * **SSE Streaming Support:**
1178
+ * - Maximum 5 concurrent SSE connections per user
1179
+ * - Rate limited to 10 new connections per minute
1180
+ * - Automatic circuit breaker for Redis failures
1181
+ * - Graceful degradation to direct response if SSE unavailable
1182
+ * - Progress events for long-running operations
1183
+ *
1184
+ * **AI Agent Optimization:**
1185
+ * The Node.js MCP client transparently handles all response formats,
1186
+ * presenting a unified interface to AI agents. Streaming responses are
1187
+ * automatically aggregated for seamless consumption.
1188
+ *
1189
+ * **Error Handling:**
1190
+ * - `429 Too Many Requests`: Connection limit or rate limit exceeded
1191
+ * - `503 Service Unavailable`: SSE system temporarily disabled
1192
+ * - `408 Request Timeout`: Tool execution exceeded timeout
1193
+ * - Clients should implement exponential backoff on errors
1194
+ *
1195
+ * **Note:**
1196
+ * MCP tool calls are currently FREE and do not consume credits.
1197
+ */
1198
+ const callMcpTool = (options) => {
1199
+ return (options.client ?? client_gen_1.client).post({
1200
+ security: [
1201
+ {
1202
+ name: 'X-API-Key',
1203
+ type: 'apiKey'
1204
+ },
1205
+ {
1206
+ scheme: 'bearer',
1207
+ type: 'http'
1208
+ }
1209
+ ],
1210
+ url: '/v1/{graph_id}/mcp/call-tool',
1211
+ ...options,
1212
+ headers: {
1213
+ 'Content-Type': 'application/json',
1214
+ ...options.headers
1215
+ }
1216
+ });
1217
+ };
1218
+ exports.callMcpTool = callMcpTool;
1219
+ /**
1220
+ * List Kuzu graph backups
1221
+ * List all backups for the specified graph database
1222
+ */
1223
+ const listBackups = (options) => {
1224
+ return (options.client ?? client_gen_1.client).get({
1225
+ security: [
1226
+ {
1227
+ name: 'X-API-Key',
1228
+ type: 'apiKey'
1229
+ },
1230
+ {
1231
+ scheme: 'bearer',
1232
+ type: 'http'
1233
+ }
1234
+ ],
1235
+ url: '/v1/{graph_id}/backups',
1236
+ ...options
1237
+ });
1238
+ };
1239
+ exports.listBackups = listBackups;
1240
+ /**
1241
+ * Create Backup
1242
+ * Create a backup of the graph database.
1243
+ *
1244
+ * Creates a complete backup of the Kuzu database (.kuzu file) with:
1245
+ * - **Format**: Full database backup only (complete .kuzu file)
1246
+ * - **Compression**: Always enabled for optimal storage
1247
+ * - **Encryption**: Optional AES-256 encryption for security
1248
+ * - **Retention**: Configurable retention period (1-2555 days)
1249
+ *
1250
+ * **Backup Features:**
1251
+ * - **Complete Backup**: Full database file backup
1252
+ * - **Consistency**: Point-in-time consistent snapshot
1253
+ * - **Download Support**: Unencrypted backups can be downloaded
1254
+ * - **Restore Support**: Future support for encrypted backup restoration
1255
+ *
1256
+ * **Progress Monitoring:**
1257
+ * Use the returned operation_id to connect to the SSE stream:
1258
+ * ```javascript
1259
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1260
+ * eventSource.addEventListener('operation_progress', (event) => {
1261
+ * const data = JSON.parse(event.data);
1262
+ * console.log('Backup progress:', data.progress_percent + '%');
1263
+ * });
1264
+ * ```
1265
+ *
1266
+ * **SSE Connection Limits:**
1267
+ * - Maximum 5 concurrent SSE connections per user
1268
+ * - Rate limited to 10 new connections per minute
1269
+ * - Automatic circuit breaker for Redis failures
1270
+ * - Graceful degradation if event system unavailable
1271
+ *
1272
+ * **Important Notes:**
1273
+ * - Only full_dump format is supported (no CSV/JSON exports)
1274
+ * - Compression is always enabled
1275
+ * - Encrypted backups cannot be downloaded (security measure)
1276
+ * - All backups are stored securely in cloud storage
1277
+ *
1278
+ * **Credit Consumption:**
1279
+ * - Base cost: 25.0 credits
1280
+ * - Large databases (>10GB): 50.0 credits
1281
+ * - Multiplied by graph tier
1282
+ *
1283
+ * Returns operation details for SSE monitoring.
1284
+ */
1285
+ const createBackup = (options) => {
1286
+ return (options.client ?? client_gen_1.client).post({
1287
+ security: [
1288
+ {
1289
+ name: 'X-API-Key',
1290
+ type: 'apiKey'
1291
+ },
1292
+ {
1293
+ scheme: 'bearer',
1294
+ type: 'http'
1295
+ }
1296
+ ],
1297
+ url: '/v1/{graph_id}/backups',
1298
+ ...options,
1299
+ headers: {
1300
+ 'Content-Type': 'application/json',
1301
+ ...options.headers
1302
+ }
1303
+ });
1304
+ };
1305
+ exports.createBackup = createBackup;
1306
+ /**
1307
+ * Export Kuzu backup for download
1308
+ * Export a backup file for download (only available for non-encrypted, compressed .kuzu backups)
1309
+ */
1310
+ const exportBackup = (options) => {
1311
+ return (options.client ?? client_gen_1.client).post({
1312
+ security: [
1313
+ {
1314
+ name: 'X-API-Key',
1315
+ type: 'apiKey'
1316
+ },
1317
+ {
1318
+ scheme: 'bearer',
1319
+ type: 'http'
1320
+ }
1321
+ ],
1322
+ url: '/v1/{graph_id}/backups/{backup_id}/export',
1323
+ ...options
1324
+ });
1325
+ };
1326
+ exports.exportBackup = exportBackup;
1327
+ /**
1328
+ * Get temporary download URL for backup
1329
+ * Generate a temporary download URL for a backup (unencrypted, compressed .kuzu files only)
1330
+ */
1331
+ const getBackupDownloadUrl = (options) => {
1332
+ return (options.client ?? client_gen_1.client).get({
1333
+ security: [
1334
+ {
1335
+ name: 'X-API-Key',
1336
+ type: 'apiKey'
1337
+ },
1338
+ {
1339
+ scheme: 'bearer',
1340
+ type: 'http'
1341
+ }
1342
+ ],
1343
+ url: '/v1/{graph_id}/backups/{backup_id}/download',
1344
+ ...options
1345
+ });
1346
+ };
1347
+ exports.getBackupDownloadUrl = getBackupDownloadUrl;
1348
+ /**
1349
+ * Restore Encrypted Backup
1350
+ * Restore a graph database from an encrypted backup.
1351
+ *
1352
+ * Restores a complete Kuzu database from an encrypted backup:
1353
+ * - **Format**: Only full_dump backups can be restored
1354
+ * - **Encryption**: Only encrypted backups can be restored (security requirement)
1355
+ * - **System Backup**: Creates automatic backup of existing database before restore
1356
+ * - **Verification**: Optionally verifies database integrity after restore
1357
+ *
1358
+ * **Restore Features:**
1359
+ * - **Atomic Operation**: Complete replacement of database
1360
+ * - **Rollback Protection**: System backup created before restore
1361
+ * - **Data Integrity**: Verification ensures successful restore
1362
+ * - **Security**: Only encrypted backups to prevent data tampering
1363
+ *
1364
+ * **Progress Monitoring:**
1365
+ * Use the returned operation_id to connect to the SSE stream:
1366
+ * ```javascript
1367
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
1368
+ * eventSource.addEventListener('operation_progress', (event) => {
1369
+ * const data = JSON.parse(event.data);
1370
+ * console.log('Restore progress:', data.message);
1371
+ * });
1372
+ * ```
1373
+ *
1374
+ * **SSE Connection Limits:**
1375
+ * - Maximum 5 concurrent SSE connections per user
1376
+ * - Rate limited to 10 new connections per minute
1377
+ * - Automatic circuit breaker for Redis failures
1378
+ * - Graceful degradation if event system unavailable
1379
+ *
1380
+ * **Important Notes:**
1381
+ * - Only encrypted backups can be restored (security measure)
1382
+ * - Existing database is backed up to S3 before restore
1383
+ * - Restore is a destructive operation - existing data is replaced
1384
+ * - System backups are stored separately for recovery
1385
+ *
1386
+ * **Credit Consumption:**
1387
+ * - Base cost: 100.0 credits
1388
+ * - Large databases (>10GB): 200.0 credits
1389
+ * - Multiplied by graph tier
1390
+ *
1391
+ * Returns operation details for SSE monitoring.
1392
+ */
1393
+ const restoreBackup = (options) => {
1394
+ return (options.client ?? client_gen_1.client).post({
1395
+ security: [
1396
+ {
1397
+ name: 'X-API-Key',
1398
+ type: 'apiKey'
1399
+ },
1400
+ {
1401
+ scheme: 'bearer',
1402
+ type: 'http'
1403
+ }
1404
+ ],
1405
+ url: '/v1/{graph_id}/backups/restore',
1406
+ ...options,
1407
+ headers: {
1408
+ 'Content-Type': 'application/json',
1409
+ ...options.headers
1410
+ }
1411
+ });
1412
+ };
1413
+ exports.restoreBackup = restoreBackup;
1414
+ /**
1415
+ * Get backup statistics
1416
+ * Get comprehensive backup statistics for the specified graph database
1417
+ */
1418
+ const getBackupStats = (options) => {
1419
+ return (options.client ?? client_gen_1.client).get({
1420
+ security: [
1421
+ {
1422
+ name: 'X-API-Key',
1423
+ type: 'apiKey'
1424
+ },
1425
+ {
1426
+ scheme: 'bearer',
1427
+ type: 'http'
1428
+ }
1429
+ ],
1430
+ url: '/v1/{graph_id}/backups/stats',
1431
+ ...options
1432
+ });
1433
+ };
1434
+ exports.getBackupStats = getBackupStats;
1435
+ /**
1436
+ * Get Graph Metrics
1437
+ * Get comprehensive metrics for the graph database.
1438
+ *
1439
+ * Provides detailed analytics including:
1440
+ * - **Node Statistics**: Counts by type (Entity, Report, Account, Transaction)
1441
+ * - **Relationship Metrics**: Connection counts and patterns
1442
+ * - **Data Quality**: Completeness scores and validation results
1443
+ * - **Performance Metrics**: Query response times and database health
1444
+ * - **Storage Analytics**: Database size and growth trends
1445
+ *
1446
+ * This data helps with:
1447
+ * - Monitoring data completeness
1448
+ * - Identifying data quality issues
1449
+ * - Capacity planning
1450
+ * - Performance optimization
1451
+ *
1452
+ * Note:
1453
+ * This operation is FREE - no credit consumption required.
1454
+ */
1455
+ const getGraphMetrics = (options) => {
1456
+ return (options.client ?? client_gen_1.client).get({
1457
+ security: [
1458
+ {
1459
+ name: 'X-API-Key',
1460
+ type: 'apiKey'
1461
+ },
1462
+ {
1463
+ scheme: 'bearer',
1464
+ type: 'http'
1465
+ }
1466
+ ],
1467
+ url: '/v1/{graph_id}/analytics',
1468
+ ...options
1469
+ });
1470
+ };
1471
+ exports.getGraphMetrics = getGraphMetrics;
1472
+ /**
1473
+ * Get Usage Statistics
1474
+ * Get detailed usage statistics for the graph.
1475
+ *
1476
+ * Provides temporal usage patterns including:
1477
+ * - **Query Volume**: API calls per day/hour
1478
+ * - **Credit Consumption**: Usage patterns and trends
1479
+ * - **Operation Breakdown**: Usage by operation type
1480
+ * - **User Activity**: Access patterns by user role
1481
+ * - **Peak Usage Times**: Identify high-activity periods
1482
+ *
1483
+ * Time ranges available:
1484
+ * - Last 24 hours (hourly breakdown)
1485
+ * - Last 7 days (daily breakdown)
1486
+ * - Last 30 days (daily breakdown)
1487
+ * - Custom date ranges
1488
+ *
1489
+ * Useful for:
1490
+ * - Capacity planning
1491
+ * - Cost optimization
1492
+ * - Usage trend analysis
1493
+ * - Performance tuning
1494
+ *
1495
+ * Note:
1496
+ * This operation is FREE - no credit consumption required.
1497
+ */
1498
+ const getGraphUsageStats = (options) => {
1499
+ return (options.client ?? client_gen_1.client).get({
1500
+ security: [
1501
+ {
1502
+ name: 'X-API-Key',
1503
+ type: 'apiKey'
1504
+ },
1505
+ {
1506
+ scheme: 'bearer',
1507
+ type: 'http'
1508
+ }
1509
+ ],
1510
+ url: '/v1/{graph_id}/analytics/usage',
1511
+ ...options
1512
+ });
1513
+ };
1514
+ exports.getGraphUsageStats = getGraphUsageStats;
1515
+ /**
1516
+ * Execute Cypher Query
1517
+ * Execute a Cypher query with intelligent response optimization.
1518
+ *
1519
+ * This endpoint automatically selects the best execution strategy based on:
1520
+ * - Query characteristics (size, complexity)
1521
+ * - Client capabilities (SSE, NDJSON, JSON)
1522
+ * - System load (queue status, concurrent queries)
1523
+ * - User preferences (mode parameter, headers)
1524
+ *
1525
+ * **Response Modes:**
1526
+ * - `auto` (default): Intelligent automatic selection
1527
+ * - `sync`: Force synchronous JSON response (best for testing)
1528
+ * - `async`: Force queued response with SSE monitoring endpoints (no polling needed)
1529
+ * - `stream`: Force streaming response (SSE or NDJSON)
1530
+ *
1531
+ * **Client Detection:**
1532
+ * - Automatically detects testing tools (Postman, Swagger UI)
1533
+ * - Adjusts behavior for better interactive experience
1534
+ * - Respects Accept and Prefer headers for capabilities
1535
+ *
1536
+ * **Streaming Support (SSE):**
1537
+ * - Real-time events with progress updates
1538
+ * - Maximum 5 concurrent SSE connections per user
1539
+ * - Rate limited to 10 new connections per minute
1540
+ * - Automatic circuit breaker for Redis failures
1541
+ * - Graceful degradation if event system unavailable
1542
+ * - 30-second keepalive to prevent timeouts
1543
+ *
1544
+ * **Streaming Support (NDJSON):**
1545
+ * - Efficient line-delimited JSON for large results
1546
+ * - Automatic chunking (configurable 10-10000 rows)
1547
+ * - No connection limits (stateless streaming)
1548
+ *
1549
+ * **Queue Management:**
1550
+ * - Automatic queuing under high load
1551
+ * - Real-time monitoring via SSE events (no polling needed)
1552
+ * - Priority based on subscription tier
1553
+ * - Queue position and progress updates pushed via SSE
1554
+ * - Connect to returned `/v1/operations/{id}/stream` endpoint for updates
1555
+ *
1556
+ * **Error Handling:**
1557
+ * - `429 Too Many Requests`: Rate limit or connection limit exceeded
1558
+ * - `503 Service Unavailable`: Circuit breaker open or SSE disabled
1559
+ * - Clients should implement exponential backoff
1560
+ *
1561
+ * **Note:**
1562
+ * Query operations are FREE - no credit consumption required.
1563
+ * Queue position is based on subscription tier for priority.
1564
+ */
1565
+ const executeCypherQuery = (options) => {
1566
+ return (options.client ?? client_gen_1.client).post({
1567
+ security: [
1568
+ {
1569
+ name: 'X-API-Key',
1570
+ type: 'apiKey'
1571
+ },
1572
+ {
1573
+ scheme: 'bearer',
1574
+ type: 'http'
1575
+ }
1576
+ ],
1577
+ url: '/v1/{graph_id}/query',
1578
+ ...options,
1579
+ headers: {
1580
+ 'Content-Type': 'application/json',
1581
+ ...options.headers
1582
+ }
1583
+ });
1584
+ };
1585
+ exports.executeCypherQuery = executeCypherQuery;
1586
+ /**
1587
+ * Get Runtime Graph Schema Information
1588
+ * Get runtime schema information for the specified graph database.
1589
+ *
1590
+ * This endpoint inspects the actual graph database structure and returns:
1591
+ * - **Node Labels**: All node types currently in the database
1592
+ * - **Relationship Types**: All relationship types currently in the database
1593
+ * - **Node Properties**: Properties for each node type (limited to first 10 for performance)
1594
+ *
1595
+ * This is different from custom schema management - it shows what actually exists in the database,
1596
+ * useful for understanding the current graph structure before writing queries.
1597
+ *
1598
+ * This operation is FREE - no credit consumption required.
1599
+ */
1600
+ const getGraphSchemaInfo = (options) => {
1601
+ return (options.client ?? client_gen_1.client).get({
1602
+ security: [
1603
+ {
1604
+ name: 'X-API-Key',
1605
+ type: 'apiKey'
1606
+ },
1607
+ {
1608
+ scheme: 'bearer',
1609
+ type: 'http'
1610
+ }
1611
+ ],
1612
+ url: '/v1/{graph_id}/schema/info',
1613
+ ...options
1614
+ });
1615
+ };
1616
+ exports.getGraphSchemaInfo = getGraphSchemaInfo;
1617
+ /**
1618
+ * Validate Schema
1619
+ * Validate a custom schema definition before deployment.
1620
+ *
1621
+ * This endpoint performs comprehensive validation including:
1622
+ * - **Structure Validation**: Ensures proper JSON/YAML format
1623
+ * - **Type Checking**: Validates data types (STRING, INT, DOUBLE, etc.)
1624
+ * - **Constraint Verification**: Checks primary keys and unique constraints
1625
+ * - **Relationship Integrity**: Validates node references in relationships
1626
+ * - **Naming Conventions**: Ensures valid identifiers
1627
+ * - **Compatibility**: Checks against existing extensions if specified
1628
+ *
1629
+ * Supported formats:
1630
+ * - JSON schema definitions
1631
+ * - YAML schema definitions
1632
+ * - Direct dictionary format
1633
+ *
1634
+ * Validation helps prevent:
1635
+ * - Schema deployment failures
1636
+ * - Data integrity issues
1637
+ * - Performance problems
1638
+ * - Naming conflicts
1639
+ *
1640
+ * This operation is FREE - no credit consumption required.
1641
+ */
1642
+ const validateSchema = (options) => {
1643
+ return (options.client ?? client_gen_1.client).post({
1644
+ security: [
1645
+ {
1646
+ name: 'X-API-Key',
1647
+ type: 'apiKey'
1648
+ },
1649
+ {
1650
+ scheme: 'bearer',
1651
+ type: 'http'
1652
+ }
1653
+ ],
1654
+ url: '/v1/{graph_id}/schema/validate',
1655
+ ...options,
1656
+ headers: {
1657
+ 'Content-Type': 'application/json',
1658
+ ...options.headers
1659
+ }
1660
+ });
1661
+ };
1662
+ exports.validateSchema = validateSchema;
1663
+ /**
1664
+ * Export Graph Schema
1665
+ * Export the schema of an existing graph in JSON, YAML, or Cypher format
1666
+ */
1667
+ const exportGraphSchema = (options) => {
1668
+ return (options.client ?? client_gen_1.client).get({
1669
+ security: [
1670
+ {
1671
+ name: 'X-API-Key',
1672
+ type: 'apiKey'
1673
+ },
1674
+ {
1675
+ scheme: 'bearer',
1676
+ type: 'http'
1677
+ }
1678
+ ],
1679
+ url: '/v1/{graph_id}/schema/export',
1680
+ ...options
1681
+ });
1682
+ };
1683
+ exports.exportGraphSchema = exportGraphSchema;
1684
+ /**
1685
+ * List Available Schema Extensions
1686
+ * Get list of available schema extensions and compatibility groups
1687
+ */
1688
+ const listSchemaExtensions = (options) => {
1689
+ return (options.client ?? client_gen_1.client).get({
1690
+ security: [
1691
+ {
1692
+ name: 'X-API-Key',
1693
+ type: 'apiKey'
1694
+ },
1695
+ {
1696
+ scheme: 'bearer',
1697
+ type: 'http'
1698
+ }
1699
+ ],
1700
+ url: '/v1/{graph_id}/schema/extensions',
1701
+ ...options
1702
+ });
1703
+ };
1704
+ exports.listSchemaExtensions = listSchemaExtensions;
1705
+ /**
1706
+ * Get Current Bill
1707
+ * Get current month's billing details for the graph.
1708
+ *
1709
+ * Returns comprehensive billing information including:
1710
+ * - **Credit Usage**: Consumed vs. allocated credits
1711
+ * - **Storage Charges**: Current storage usage and costs
1712
+ * - **Subscription Tier**: Current plan and features
1713
+ * - **Pro-rated Charges**: If plan changed mid-month
1714
+ * - **Estimated Total**: Current charges to date
1715
+ *
1716
+ * Billing calculations are updated hourly. Storage is measured in GB-months.
1717
+ *
1718
+ * ℹ️ No credits are consumed for viewing billing information.
1719
+ */
1720
+ const getCurrentGraphBill = (options) => {
1721
+ return (options.client ?? client_gen_1.client).get({
1722
+ security: [
1723
+ {
1724
+ name: 'X-API-Key',
1725
+ type: 'apiKey'
1726
+ },
1727
+ {
1728
+ scheme: 'bearer',
1729
+ type: 'http'
1730
+ }
1731
+ ],
1732
+ url: '/v1/{graph_id}/billing/current',
1733
+ ...options
1734
+ });
1735
+ };
1736
+ exports.getCurrentGraphBill = getCurrentGraphBill;
1737
+ /**
1738
+ * Get Usage Details
1739
+ * Get detailed usage metrics for the graph.
1740
+ *
1741
+ * Provides granular usage information including:
1742
+ * - **Daily Credit Consumption**: Track credit usage patterns
1743
+ * - **Storage Growth**: Monitor database size over time
1744
+ * - **Operation Breakdown**: Credits by operation type
1745
+ * - **Peak Usage Times**: Identify high-activity periods
1746
+ * - **API Call Volumes**: Request counts and patterns
1747
+ *
1748
+ * Useful for:
1749
+ * - Optimizing credit consumption
1750
+ * - Capacity planning
1751
+ * - Usage trend analysis
1752
+ * - Cost optimization
1753
+ *
1754
+ * ℹ️ No credits are consumed for viewing usage details.
1755
+ */
1756
+ const getGraphUsageDetails = (options) => {
1757
+ return (options.client ?? client_gen_1.client).get({
1758
+ security: [
1759
+ {
1760
+ name: 'X-API-Key',
1761
+ type: 'apiKey'
1762
+ },
1763
+ {
1764
+ scheme: 'bearer',
1765
+ type: 'http'
1766
+ }
1767
+ ],
1768
+ url: '/v1/{graph_id}/billing/usage',
1769
+ ...options
1770
+ });
1771
+ };
1772
+ exports.getGraphUsageDetails = getGraphUsageDetails;
1773
+ /**
1774
+ * Get Billing History
1775
+ * Get billing history for the graph.
1776
+ *
1777
+ * Returns a chronological list of monthly bills, perfect for:
1778
+ * - Tracking spending trends over time
1779
+ * - Identifying usage patterns
1780
+ * - Budget forecasting
1781
+ * - Financial reporting
1782
+ *
1783
+ * Each month includes:
1784
+ * - Credit usage and overages
1785
+ * - Storage charges
1786
+ * - Total charges
1787
+ * - Usage metrics
1788
+ *
1789
+ * ℹ️ No credits are consumed for viewing billing history.
1790
+ */
1791
+ const getGraphBillingHistory = (options) => {
1792
+ return (options.client ?? client_gen_1.client).get({
1793
+ security: [
1794
+ {
1795
+ name: 'X-API-Key',
1796
+ type: 'apiKey'
1797
+ },
1798
+ {
1799
+ scheme: 'bearer',
1800
+ type: 'http'
1801
+ }
1802
+ ],
1803
+ url: '/v1/{graph_id}/billing/history',
1804
+ ...options
1805
+ });
1806
+ };
1807
+ exports.getGraphBillingHistory = getGraphBillingHistory;
1808
+ /**
1809
+ * Get Monthly Bill
1810
+ * Get billing details for a specific month.
1811
+ *
1812
+ * Retrieve historical billing information for any previous month.
1813
+ * Useful for:
1814
+ * - Reconciling past charges
1815
+ * - Tracking usage trends
1816
+ * - Expense reporting
1817
+ * - Budget analysis
1818
+ *
1819
+ * Returns the same detailed breakdown as the current bill endpoint.
1820
+ *
1821
+ * ℹ️ No credits are consumed for viewing billing history.
1822
+ */
1823
+ const getGraphMonthlyBill = (options) => {
1824
+ return (options.client ?? client_gen_1.client).get({
1825
+ security: [
1826
+ {
1827
+ name: 'X-API-Key',
1828
+ type: 'apiKey'
1829
+ },
1830
+ {
1831
+ scheme: 'bearer',
1832
+ type: 'http'
1833
+ }
1834
+ ],
1835
+ url: '/v1/{graph_id}/billing/history/{year}/{month}',
1836
+ ...options
1837
+ });
1838
+ };
1839
+ exports.getGraphMonthlyBill = getGraphMonthlyBill;
1840
+ /**
1841
+ * Get Credit Summary
1842
+ * Retrieve comprehensive credit usage summary for the specified graph.
1843
+ *
1844
+ * This endpoint provides:
1845
+ * - Current credit balance and monthly allocation
1846
+ * - Credit consumption metrics for the current month
1847
+ * - Graph tier and credit multiplier information
1848
+ * - Usage percentage to help monitor credit consumption
1849
+ *
1850
+ * No credits are consumed for checking credit status.
1851
+ */
1852
+ const getCreditSummary = (options) => {
1853
+ return (options.client ?? client_gen_1.client).get({
1854
+ security: [
1855
+ {
1856
+ name: 'X-API-Key',
1857
+ type: 'apiKey'
1858
+ },
1859
+ {
1860
+ scheme: 'bearer',
1861
+ type: 'http'
1862
+ }
1863
+ ],
1864
+ url: '/v1/{graph_id}/credits/summary',
1865
+ ...options
1866
+ });
1867
+ };
1868
+ exports.getCreditSummary = getCreditSummary;
1869
+ /**
1870
+ * List Credit Transactions
1871
+ * Retrieve detailed credit transaction history for the specified graph.
1872
+ *
1873
+ * This enhanced endpoint provides:
1874
+ * - Detailed transaction records with idempotency information
1875
+ * - Summary by operation type to identify high-consumption operations
1876
+ * - Date range filtering for analysis
1877
+ * - Metadata search capabilities
1878
+ *
1879
+ * Transaction types include:
1880
+ * - ALLOCATION: Monthly credit allocations
1881
+ * - CONSUMPTION: Credit usage for operations
1882
+ * - BONUS: Bonus credits added by admins
1883
+ * - REFUND: Credit refunds
1884
+ *
1885
+ * No credits are consumed for viewing transaction history.
1886
+ */
1887
+ const listCreditTransactions = (options) => {
1888
+ return (options.client ?? client_gen_1.client).get({
1889
+ security: [
1890
+ {
1891
+ name: 'X-API-Key',
1892
+ type: 'apiKey'
1893
+ },
1894
+ {
1895
+ scheme: 'bearer',
1896
+ type: 'http'
1897
+ }
1898
+ ],
1899
+ url: '/v1/{graph_id}/credits/transactions',
1900
+ ...options
1901
+ });
1902
+ };
1903
+ exports.listCreditTransactions = listCreditTransactions;
1904
+ /**
1905
+ * Check Credit Balance
1906
+ * Check if the graph has sufficient credits for a planned operation.
1907
+ *
1908
+ * This endpoint allows you to verify credit availability before performing
1909
+ * an operation, helping prevent failed operations due to insufficient credits.
1910
+ *
1911
+ * The check considers:
1912
+ * - Base operation cost
1913
+ * - Graph tier multiplier
1914
+ * - Current credit balance
1915
+ *
1916
+ * No credits are consumed for checking availability.
1917
+ */
1918
+ const checkCreditBalance = (options) => {
1919
+ return (options.client ?? client_gen_1.client).get({
1920
+ security: [
1921
+ {
1922
+ name: 'X-API-Key',
1923
+ type: 'apiKey'
1924
+ },
1925
+ {
1926
+ scheme: 'bearer',
1927
+ type: 'http'
1928
+ }
1929
+ ],
1930
+ url: '/v1/{graph_id}/credits/balance/check',
1931
+ ...options
1932
+ });
1933
+ };
1934
+ exports.checkCreditBalance = checkCreditBalance;
1935
+ /**
1936
+ * Get Storage Usage
1937
+ * Get storage usage history for a graph.
1938
+ *
1939
+ * Returns detailed storage usage information including:
1940
+ * - Daily average storage consumption
1941
+ * - Storage trends over time
1942
+ * - Credit costs for storage
1943
+ * - Current storage billing information
1944
+ *
1945
+ * This endpoint helps users understand their storage patterns
1946
+ * and associated credit costs.
1947
+ */
1948
+ const getStorageUsage = (options) => {
1949
+ return (options.client ?? client_gen_1.client).get({
1950
+ security: [
1951
+ {
1952
+ name: 'X-API-Key',
1953
+ type: 'apiKey'
1954
+ },
1955
+ {
1956
+ scheme: 'bearer',
1957
+ type: 'http'
1958
+ }
1959
+ ],
1960
+ url: '/v1/{graph_id}/credits/storage/usage',
1961
+ ...options
1962
+ });
1963
+ };
1964
+ exports.getStorageUsage = getStorageUsage;
1965
+ /**
1966
+ * Check Storage Limits
1967
+ * Check storage limits and usage for a graph.
1968
+ *
1969
+ * Returns comprehensive storage limit information including:
1970
+ * - Current storage usage
1971
+ * - Effective limit (override or default)
1972
+ * - Usage percentage and warnings
1973
+ * - Recommendations for limit management
1974
+ *
1975
+ * This endpoint helps users monitor storage usage and plan for potential
1976
+ * limit increases. No credits are consumed for checking storage limits.
1977
+ */
1978
+ const checkStorageLimits = (options) => {
1979
+ return (options.client ?? client_gen_1.client).get({
1980
+ security: [
1981
+ {
1982
+ name: 'X-API-Key',
1983
+ type: 'apiKey'
1984
+ },
1985
+ {
1986
+ scheme: 'bearer',
1987
+ type: 'http'
1988
+ }
1989
+ ],
1990
+ url: '/v1/{graph_id}/credits/storage/limits',
1991
+ ...options
1992
+ });
1993
+ };
1994
+ exports.checkStorageLimits = checkStorageLimits;
1995
+ /**
1996
+ * Database Health Check
1997
+ * Get comprehensive health information for the graph database.
1998
+ *
1999
+ * Returns detailed health metrics including:
2000
+ * - **Connection Status**: Database connectivity and responsiveness
2001
+ * - **Performance Metrics**: Query execution times and throughput
2002
+ * - **Resource Usage**: Memory and storage utilization
2003
+ * - **Error Monitoring**: Recent error rates and patterns
2004
+ * - **Uptime Statistics**: Service availability metrics
2005
+ *
2006
+ * Health indicators:
2007
+ * - **Status**: healthy, degraded, or unhealthy
2008
+ * - **Query Performance**: Average execution times
2009
+ * - **Error Rates**: Recent failure percentages
2010
+ * - **Resource Usage**: Memory and storage consumption
2011
+ * - **Alerts**: Active warnings or issues
2012
+ *
2013
+ * This endpoint provides essential monitoring data for operational visibility.
2014
+ */
2015
+ const getDatabaseHealth = (options) => {
2016
+ return (options.client ?? client_gen_1.client).get({
2017
+ security: [
2018
+ {
2019
+ name: 'X-API-Key',
2020
+ type: 'apiKey'
2021
+ },
2022
+ {
2023
+ scheme: 'bearer',
2024
+ type: 'http'
2025
+ }
2026
+ ],
2027
+ url: '/v1/{graph_id}/health',
2028
+ ...options
2029
+ });
2030
+ };
2031
+ exports.getDatabaseHealth = getDatabaseHealth;
2032
+ /**
2033
+ * Database Information
2034
+ * Get comprehensive database information and statistics.
2035
+ *
2036
+ * Returns detailed database metrics including:
2037
+ * - **Database Metadata**: Name, path, size, and timestamps
2038
+ * - **Schema Information**: Node labels, relationship types, and counts
2039
+ * - **Storage Statistics**: Database size and usage metrics
2040
+ * - **Data Composition**: Node and relationship counts
2041
+ * - **Backup Information**: Available backups and last backup date
2042
+ * - **Configuration**: Read-only status and schema version
2043
+ *
2044
+ * Database statistics:
2045
+ * - **Size**: Storage usage in bytes and MB
2046
+ * - **Content**: Node and relationship counts
2047
+ * - **Schema**: Available labels and relationship types
2048
+ * - **Backup Status**: Backup availability and recency
2049
+ * - **Timestamps**: Creation and modification dates
2050
+ *
2051
+ * This endpoint provides essential database information for capacity planning and monitoring.
2052
+ */
2053
+ const getDatabaseInfo = (options) => {
2054
+ return (options.client ?? client_gen_1.client).get({
2055
+ security: [
2056
+ {
2057
+ name: 'X-API-Key',
2058
+ type: 'apiKey'
2059
+ },
2060
+ {
2061
+ scheme: 'bearer',
2062
+ type: 'http'
2063
+ }
2064
+ ],
2065
+ url: '/v1/{graph_id}/info',
2066
+ ...options
2067
+ });
2068
+ };
2069
+ exports.getDatabaseInfo = getDatabaseInfo;
2070
+ /**
2071
+ * Get Graph Operational Limits
2072
+ * Get comprehensive operational limits for the graph database.
2073
+ *
2074
+ * Returns all operational limits that apply to this graph including:
2075
+ * - **Storage Limits**: Maximum storage size and current usage
2076
+ * - **Query Limits**: Timeouts, complexity, row limits
2077
+ * - **Copy/Ingestion Limits**: File sizes, timeouts, concurrent operations
2078
+ * - **Backup Limits**: Frequency, retention, size limits
2079
+ * - **Rate Limits**: Requests per minute/hour based on tier
2080
+ * - **Credit Limits**: AI operation credits (if applicable)
2081
+ *
2082
+ * This unified endpoint provides all limits in one place for easier client integration.
2083
+ *
2084
+ * **Note**: Limits vary based on subscription tier (Standard, Enterprise, Premium).
2085
+ */
2086
+ const getGraphLimits = (options) => {
2087
+ return (options.client ?? client_gen_1.client).get({
2088
+ security: [
2089
+ {
2090
+ name: 'X-API-Key',
2091
+ type: 'apiKey'
2092
+ },
2093
+ {
2094
+ scheme: 'bearer',
2095
+ type: 'http'
2096
+ }
2097
+ ],
2098
+ url: '/v1/{graph_id}/limits',
2099
+ ...options
2100
+ });
2101
+ };
2102
+ exports.getGraphLimits = getGraphLimits;
2103
+ /**
2104
+ * List Subgraphs
2105
+ * List all subgraphs for a parent graph.
2106
+ *
2107
+ * **Requirements:**
2108
+ * - Valid authentication
2109
+ * - Parent graph must exist and be accessible to the user
2110
+ * - User must have at least 'read' permission on the parent graph
2111
+ *
2112
+ * **Returns:**
2113
+ * - List of all subgraphs for the parent graph
2114
+ * - Each subgraph includes its ID, name, description, type, status, and creation date
2115
+ */
2116
+ const listSubgraphs = (options) => {
2117
+ return (options.client ?? client_gen_1.client).get({
2118
+ security: [
2119
+ {
2120
+ name: 'X-API-Key',
2121
+ type: 'apiKey'
2122
+ },
2123
+ {
2124
+ scheme: 'bearer',
2125
+ type: 'http'
2126
+ }
2127
+ ],
2128
+ url: '/v1/{graph_id}/subgraphs',
2129
+ ...options
2130
+ });
2131
+ };
2132
+ exports.listSubgraphs = listSubgraphs;
2133
+ /**
2134
+ * Create Subgraph
2135
+ * Create a new subgraph within a parent graph.
2136
+ *
2137
+ * **Requirements:**
2138
+ * - Valid authentication
2139
+ * - Parent graph must exist and be accessible to the user
2140
+ * - User must have 'admin' permission on the parent graph
2141
+ * - Parent graph tier must support subgraphs (Enterprise or Premium only)
2142
+ * - Must be within subgraph quota limits
2143
+ * - Subgraph name must be unique within the parent graph
2144
+ *
2145
+ * **Returns:**
2146
+ * - Created subgraph details including its unique ID
2147
+ */
2148
+ const createSubgraph = (options) => {
2149
+ return (options.client ?? client_gen_1.client).post({
2150
+ security: [
2151
+ {
2152
+ name: 'X-API-Key',
2153
+ type: 'apiKey'
2154
+ },
2155
+ {
2156
+ scheme: 'bearer',
2157
+ type: 'http'
2158
+ }
2159
+ ],
2160
+ url: '/v1/{graph_id}/subgraphs',
2161
+ ...options,
2162
+ headers: {
2163
+ 'Content-Type': 'application/json',
2164
+ ...options.headers
2165
+ }
2166
+ });
2167
+ };
2168
+ exports.createSubgraph = createSubgraph;
2169
+ /**
2170
+ * Delete Subgraph
2171
+ * Delete a subgraph database.
2172
+ *
2173
+ * **Requirements:**
2174
+ * - Must be a valid subgraph (not parent graph)
2175
+ * - User must have admin access to parent graph
2176
+ * - Optional backup before deletion
2177
+ *
2178
+ * **Deletion Options:**
2179
+ * - `force`: Delete even if contains data
2180
+ * - `backup_first`: Create backup before deletion
2181
+ *
2182
+ * **Warning:**
2183
+ * Deletion is permanent unless backup is created.
2184
+ * All data in the subgraph will be lost.
2185
+ *
2186
+ * **Backup Location:**
2187
+ * If backup requested, stored in S3 at:
2188
+ * `s3://robosystems-backups/{instance_id}/{database_name}_{timestamp}.backup`
2189
+ */
2190
+ const deleteSubgraph = (options) => {
2191
+ return (options.client ?? client_gen_1.client).delete({
2192
+ security: [
2193
+ {
2194
+ name: 'X-API-Key',
2195
+ type: 'apiKey'
2196
+ },
2197
+ {
2198
+ scheme: 'bearer',
2199
+ type: 'http'
2200
+ }
2201
+ ],
2202
+ url: '/v1/{graph_id}/subgraphs/{subgraph_id}',
2203
+ ...options,
2204
+ headers: {
2205
+ 'Content-Type': 'application/json',
2206
+ ...options.headers
2207
+ }
2208
+ });
2209
+ };
2210
+ exports.deleteSubgraph = deleteSubgraph;
2211
+ /**
2212
+ * Get Subgraph Details
2213
+ * Get detailed information about a specific subgraph.
2214
+ *
2215
+ * **Requirements:**
2216
+ * - User must have read access to parent graph
2217
+ *
2218
+ * **Response includes:**
2219
+ * - Full subgraph metadata
2220
+ * - Database statistics (nodes, edges)
2221
+ * - Size information
2222
+ * - Schema configuration
2223
+ * - Creation/modification timestamps
2224
+ * - Last access time (when available)
2225
+ *
2226
+ * **Statistics:**
2227
+ * Real-time statistics queried from Kuzu:
2228
+ * - Node count
2229
+ * - Edge count
2230
+ * - Database size on disk
2231
+ * - Schema information
2232
+ */
2233
+ const getSubgraphInfo = (options) => {
2234
+ return (options.client ?? client_gen_1.client).get({
2235
+ security: [
2236
+ {
2237
+ name: 'X-API-Key',
2238
+ type: 'apiKey'
2239
+ },
2240
+ {
2241
+ scheme: 'bearer',
2242
+ type: 'http'
2243
+ }
2244
+ ],
2245
+ url: '/v1/{graph_id}/subgraphs/{subgraph_id}/info',
2246
+ ...options
2247
+ });
2248
+ };
2249
+ exports.getSubgraphInfo = getSubgraphInfo;
2250
+ /**
2251
+ * Get Subgraph Quota
2252
+ * Get subgraph quota and usage information for a parent graph.
2253
+ *
2254
+ * **Shows:**
2255
+ * - Current subgraph count
2256
+ * - Maximum allowed subgraphs per tier
2257
+ * - Remaining capacity
2258
+ * - Total size usage across all subgraphs
2259
+ *
2260
+ * **Tier Limits:**
2261
+ * - Standard: 0 subgraphs (not supported)
2262
+ * - Enterprise: Configurable limit (default: 10 subgraphs)
2263
+ * - Premium: Unlimited subgraphs
2264
+ * - Limits are defined in deployment configuration
2265
+ *
2266
+ * **Size Tracking:**
2267
+ * Provides aggregate size metrics when available.
2268
+ * Individual subgraph sizes shown in list endpoint.
2269
+ */
2270
+ const getSubgraphQuota = (options) => {
2271
+ return (options.client ?? client_gen_1.client).get({
2272
+ security: [
2273
+ {
2274
+ name: 'X-API-Key',
2275
+ type: 'apiKey'
2276
+ },
2277
+ {
2278
+ scheme: 'bearer',
2279
+ type: 'http'
2280
+ }
2281
+ ],
2282
+ url: '/v1/{graph_id}/subgraphs/quota',
2283
+ ...options
2284
+ });
2285
+ };
2286
+ exports.getSubgraphQuota = getSubgraphQuota;
2287
+ /**
2288
+ * Copy Data to Graph
2289
+ * Copy data from external sources into the graph database.
2290
+ *
2291
+ * This endpoint supports multiple data sources through a unified interface:
2292
+ * - **S3**: Copy from S3 buckets with user-provided credentials
2293
+ * - **URL** (future): Copy from HTTP(S) URLs
2294
+ * - **DataFrame** (future): Copy from uploaded DataFrames
2295
+ *
2296
+ * **Security:**
2297
+ * - Requires write permissions to the target graph
2298
+ * - **Not allowed on shared repositories** (sec, industry, economic) - these are read-only
2299
+ * - User must provide their own AWS credentials for S3 access
2300
+ * - All operations are logged for audit purposes
2301
+ *
2302
+ * **Tier Limits:**
2303
+ * - Standard: 10GB max file size, 15 min timeout
2304
+ * - Enterprise: 50GB max file size, 30 min timeout
2305
+ * - Premium: 100GB max file size, 60 min timeout
2306
+ *
2307
+ * **Copy Options:**
2308
+ * - `ignore_errors`: Skip duplicate/invalid rows (enables upsert-like behavior)
2309
+ * - `extended_timeout`: Use extended timeout for large datasets
2310
+ * - `validate_schema`: Validate source schema against target table
2311
+ */
2312
+ const copyDataToGraph = (options) => {
2313
+ return (options.client ?? client_gen_1.client).post({
2314
+ security: [
2315
+ {
2316
+ name: 'X-API-Key',
2317
+ type: 'apiKey'
2318
+ },
2319
+ {
2320
+ scheme: 'bearer',
2321
+ type: 'http'
2322
+ }
2323
+ ],
2324
+ url: '/v1/{graph_id}/copy',
2325
+ ...options,
2326
+ headers: {
2327
+ 'Content-Type': 'application/json',
2328
+ ...options.headers
2329
+ }
2330
+ });
2331
+ };
2332
+ exports.copyDataToGraph = copyDataToGraph;
2333
+ /**
2334
+ * Create New Graph Database
2335
+ * Create a new graph database with specified schema and optionally an initial entity.
2336
+ *
2337
+ * This endpoint starts an asynchronous graph creation operation and returns
2338
+ * connection details for monitoring progress via Server-Sent Events (SSE).
2339
+ *
2340
+ * **Operation Types:**
2341
+ * - **Generic Graph**: Creates empty graph with schema extensions
2342
+ * - **Entity Graph**: Creates graph with initial entity data
2343
+ *
2344
+ * **Monitoring Progress:**
2345
+ * Use the returned `operation_id` to connect to the SSE stream:
2346
+ * ```javascript
2347
+ * const eventSource = new EventSource('/v1/operations/{operation_id}/stream');
2348
+ * eventSource.onmessage = (event) => {
2349
+ * const data = JSON.parse(event.data);
2350
+ * console.log('Progress:', data.progress_percent + '%');
2351
+ * };
2352
+ * ```
2353
+ *
2354
+ * **SSE Connection Limits:**
2355
+ * - Maximum 5 concurrent SSE connections per user
2356
+ * - Rate limited to 10 new connections per minute
2357
+ * - Automatic circuit breaker for Redis failures
2358
+ * - Graceful degradation if event system unavailable
2359
+ *
2360
+ * **Events Emitted:**
2361
+ * - `operation_started`: Graph creation begins
2362
+ * - `operation_progress`: Schema loading, database setup, etc.
2363
+ * - `operation_completed`: Graph ready with connection details
2364
+ * - `operation_error`: Creation failed with error details
2365
+ *
2366
+ * **Error Handling:**
2367
+ * - `429 Too Many Requests`: SSE connection limit exceeded
2368
+ * - `503 Service Unavailable`: SSE system temporarily disabled
2369
+ * - Clients should implement exponential backoff on errors
2370
+ *
2371
+ * **Response includes:**
2372
+ * - `operation_id`: Unique identifier for monitoring
2373
+ * - `_links.stream`: SSE endpoint for real-time updates
2374
+ * - `_links.status`: Point-in-time status check endpoint
2375
+ */
2376
+ const createGraph = (options) => {
2377
+ return (options.client ?? client_gen_1.client).post({
2378
+ security: [
2379
+ {
2380
+ name: 'X-API-Key',
2381
+ type: 'apiKey'
2382
+ },
2383
+ {
2384
+ scheme: 'bearer',
2385
+ type: 'http'
2386
+ }
2387
+ ],
2388
+ url: '/v1/create/graph',
2389
+ ...options,
2390
+ headers: {
2391
+ 'Content-Type': 'application/json',
2392
+ ...options.headers
2393
+ }
2394
+ });
2395
+ };
2396
+ exports.createGraph = createGraph;
2397
+ /**
2398
+ * Get Available Schema Extensions
2399
+ * List all available schema extensions for graph creation
2400
+ */
2401
+ const getAvailableExtensions = (options) => {
2402
+ return (options?.client ?? client_gen_1.client).get({
2403
+ security: [
2404
+ {
2405
+ name: 'X-API-Key',
2406
+ type: 'apiKey'
2407
+ },
2408
+ {
2409
+ scheme: 'bearer',
2410
+ type: 'http'
2411
+ }
2412
+ ],
2413
+ url: '/v1/create/graph/extensions',
2414
+ ...options
2415
+ });
2416
+ };
2417
+ exports.getAvailableExtensions = getAvailableExtensions;
2418
+ /**
2419
+ * Get Service Offerings
2420
+ * Get comprehensive information about all subscription offerings.
2421
+ *
2422
+ * This endpoint provides complete information about both graph database subscriptions
2423
+ * and shared repository subscriptions. This is the primary endpoint for frontend
2424
+ * applications to display subscription options.
2425
+ *
2426
+ * Includes:
2427
+ * - Graph subscription tiers (standard, enterprise, premium)
2428
+ * - Shared repository subscriptions (SEC, industry, economic data)
2429
+ * - Operation costs and credit information
2430
+ * - Features and capabilities for each tier
2431
+ * - Enabled/disabled status for repositories
2432
+ *
2433
+ * All data comes from the config-based systems to ensure accuracy with backend behavior.
2434
+ *
2435
+ * No authentication required - this is public service information.
2436
+ */
2437
+ const getServiceOfferings = (options) => {
2438
+ return (options?.client ?? client_gen_1.client).get({
2439
+ url: '/v1/offering',
2440
+ ...options
2441
+ });
2442
+ };
2443
+ exports.getServiceOfferings = getServiceOfferings;
2444
+ /**
2445
+ * Stream Operation Events
2446
+ * Stream real-time events for an operation using Server-Sent Events (SSE).
2447
+ *
2448
+ * This endpoint provides real-time monitoring for all non-immediate operations including:
2449
+ * - Graph creation and management
2450
+ * - Agent analysis processing
2451
+ * - Database backups and restores
2452
+ * - Data synchronization tasks
2453
+ *
2454
+ * **Event Types:**
2455
+ * - `operation_started`: Operation began execution
2456
+ * - `operation_progress`: Progress update with details
2457
+ * - `operation_completed`: Operation finished successfully
2458
+ * - `operation_error`: Operation failed with error details
2459
+ * - `operation_cancelled`: Operation was cancelled
2460
+ *
2461
+ * **Features:**
2462
+ * - **Event Replay**: Use `from_sequence` parameter to replay missed events
2463
+ * - **Automatic Reconnection**: Client can reconnect and resume from last seen event
2464
+ * - **Real-time Updates**: Live progress updates during execution
2465
+ * - **Timeout Handling**: 30-second keepalive messages prevent connection timeouts
2466
+ * - **Graceful Degradation**: Automatic fallback if Redis is unavailable
2467
+ *
2468
+ * **Connection Limits:**
2469
+ * - Maximum 5 concurrent SSE connections per user
2470
+ * - Rate limited to 10 new connections per minute
2471
+ * - Automatic cleanup of stale connections
2472
+ * - Circuit breaker protection for Redis failures
2473
+ *
2474
+ * **Client Usage:**
2475
+ * ```javascript
2476
+ * const eventSource = new EventSource('/v1/operations/abc123/stream');
2477
+ * eventSource.onmessage = (event) => {
2478
+ * const data = JSON.parse(event.data);
2479
+ * console.log('Progress:', data);
2480
+ * };
2481
+ * eventSource.onerror = (error) => {
2482
+ * // Handle connection errors or rate limits
2483
+ * console.error('SSE Error:', error);
2484
+ * };
2485
+ * ```
2486
+ *
2487
+ * **Error Handling:**
2488
+ * - `429 Too Many Requests`: Connection limit or rate limit exceeded
2489
+ * - `503 Service Unavailable`: SSE system temporarily disabled
2490
+ * - Clients should implement exponential backoff on errors
2491
+ *
2492
+ * **No credits are consumed for SSE connections.**
2493
+ */
2494
+ const streamOperationEvents = (options) => {
2495
+ return (options.client ?? client_gen_1.client).get({
2496
+ security: [
2497
+ {
2498
+ name: 'X-API-Key',
2499
+ type: 'apiKey'
2500
+ },
2501
+ {
2502
+ scheme: 'bearer',
2503
+ type: 'http'
2504
+ }
2505
+ ],
2506
+ url: '/v1/operations/{operation_id}/stream',
2507
+ ...options
2508
+ });
2509
+ };
2510
+ exports.streamOperationEvents = streamOperationEvents;
2511
+ /**
2512
+ * Get Operation Status
2513
+ * Get current status and metadata for an operation.
2514
+ *
2515
+ * Returns detailed information including:
2516
+ * - Current status (pending, running, completed, failed, cancelled)
2517
+ * - Creation and update timestamps
2518
+ * - Operation type and associated graph
2519
+ * - Result data (for completed operations)
2520
+ * - Error details (for failed operations)
2521
+ *
2522
+ * This endpoint provides a point-in-time status check, while the `/stream` endpoint
2523
+ * provides real-time updates. Use this for polling or initial status checks.
2524
+ *
2525
+ * **No credits are consumed for status checks.**
2526
+ */
2527
+ const getOperationStatus = (options) => {
2528
+ return (options.client ?? client_gen_1.client).get({
2529
+ security: [
2530
+ {
2531
+ name: 'X-API-Key',
2532
+ type: 'apiKey'
2533
+ },
2534
+ {
2535
+ scheme: 'bearer',
2536
+ type: 'http'
2537
+ }
2538
+ ],
2539
+ url: '/v1/operations/{operation_id}/status',
2540
+ ...options
2541
+ });
2542
+ };
2543
+ exports.getOperationStatus = getOperationStatus;
2544
+ /**
2545
+ * Cancel Operation
2546
+ * Cancel a pending or running operation.
2547
+ *
2548
+ * Cancels the specified operation if it's still in progress. Once cancelled,
2549
+ * the operation cannot be resumed and will emit a cancellation event to any
2550
+ * active SSE connections.
2551
+ *
2552
+ * **Note**: Completed or already failed operations cannot be cancelled.
2553
+ *
2554
+ * **No credits are consumed for cancellation requests.**
2555
+ */
2556
+ const cancelOperation = (options) => {
2557
+ return (options.client ?? client_gen_1.client).delete({
2558
+ security: [
2559
+ {
2560
+ name: 'X-API-Key',
2561
+ type: 'apiKey'
2562
+ },
2563
+ {
2564
+ scheme: 'bearer',
2565
+ type: 'http'
2566
+ }
2567
+ ],
2568
+ url: '/v1/operations/{operation_id}',
2569
+ ...options
2570
+ });
2571
+ };
2572
+ exports.cancelOperation = cancelOperation;