@robosystems/client 0.1.11 → 0.1.12

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