@robosystems/client 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sdk.gen.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  // This file is auto-generated by @hey-api/openapi-ts
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.batchProcessQueries = exports.executeSpecificAgent = exports.autoSelectAgent = exports.syncConnection = exports.getConnection = exports.deleteConnection = exports.oauthCallback = exports.initOAuth = exports.createLinkToken = exports.exchangeLinkToken = exports.getConnectionOptions = 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.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getCaptchaConfig = exports.completeSsoAuth = exports.ssoTokenExchange = exports.generateSsoToken = exports.resetPassword = exports.validateResetToken = exports.forgotPassword = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.verifyEmail = exports.resendVerificationEmail = exports.refreshAuthSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
- exports.cancelOperation = exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.selectGraph = exports.getAvailableGraphTiers = exports.getAvailableExtensions = exports.createGraph = exports.getGraphs = exports.queryTables = exports.ingestTables = exports.updateFileStatus = exports.getFileInfo = exports.deleteFile = exports.getUploadUrl = exports.listTableFiles = exports.listTables = 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.validateSchema = exports.exportGraphSchema = exports.getGraphSchema = exports.executeCypherQuery = exports.getGraphUsageStats = exports.getGraphMetrics = exports.getBackupStats = exports.restoreBackup = exports.getBackupDownloadUrl = exports.createBackup = exports.listBackups = exports.callMcpTool = exports.listMcpTools = exports.recommendAgent = exports.getAgentMetadata = exports.listAgents = void 0;
4
+ exports.getGraphUsageAnalytics = exports.getGraphMetrics = exports.getBackupStats = exports.restoreBackup = exports.getBackupDownloadUrl = exports.createBackup = exports.listBackups = exports.callMcpTool = exports.listMcpTools = exports.recommendAgent = exports.getAgentMetadata = exports.listAgents = exports.batchProcessQueries = exports.executeSpecificAgent = exports.autoSelectAgent = exports.syncConnection = exports.getConnection = exports.deleteConnection = exports.oauthCallback = exports.initOAuth = exports.createLinkToken = exports.exchangeLinkToken = exports.getConnectionOptions = exports.createConnection = exports.listConnections = exports.getUserLimits = exports.updateUserApiKey = exports.revokeUserApiKey = exports.createUserApiKey = exports.listUserApiKeys = exports.updateUserPassword = exports.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getCaptchaConfig = exports.completeSsoAuth = exports.ssoTokenExchange = exports.generateSsoToken = exports.resetPassword = exports.validateResetToken = exports.forgotPassword = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.verifyEmail = exports.resendVerificationEmail = exports.refreshAuthSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
+ exports.cancelSubscription2 = exports.getSubscription = exports.listSubscriptions = exports.getUpcomingInvoice = exports.listInvoices = exports.updatePaymentMethod = exports.getBillingCustomer = exports.getCheckoutStatus = exports.createCheckoutSession = exports.cancelOperation = exports.getOperationStatus = exports.streamOperationEvents = exports.getServiceOfferings = exports.selectGraph = exports.getAvailableGraphTiers = exports.getAvailableExtensions = exports.createGraph = exports.getGraphs = exports.queryTables = exports.ingestTables = exports.updateFileStatus = exports.getFileInfo = exports.deleteFile = exports.getUploadUrl = exports.listTableFiles = exports.listTables = exports.upgradeSubscription = exports.createRepositorySubscription = exports.getGraphSubscription = exports.cancelSubscription = 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.validateSchema = exports.exportGraphSchema = exports.getGraphSchema = exports.executeCypherQuery = void 0;
6
6
  const client_gen_1 = require("./client.gen");
7
7
  /**
8
8
  * Register New User
@@ -269,33 +269,6 @@ const updateUser = (options) => {
269
269
  });
270
270
  };
271
271
  exports.updateUser = updateUser;
272
- /**
273
- * Get All Credit Summaries
274
- * Get credit summaries for all graphs owned by the user.
275
- *
276
- * This endpoint provides a consolidated view of credit usage across
277
- * all graphs where the user has access, helping to monitor overall
278
- * credit consumption and plan usage.
279
- *
280
- * No credits are consumed for viewing summaries.
281
- */
282
- const getAllCreditSummaries = (options) => {
283
- return (options?.client ?? client_gen_1.client).get({
284
- security: [
285
- {
286
- name: 'X-API-Key',
287
- type: 'apiKey'
288
- },
289
- {
290
- scheme: 'bearer',
291
- type: 'http'
292
- }
293
- ],
294
- url: '/v1/user/credits',
295
- ...options
296
- });
297
- };
298
- exports.getAllCreditSummaries = getAllCreditSummaries;
299
272
  /**
300
273
  * Update Password
301
274
  * Update the current user's password.
@@ -414,8 +387,8 @@ const updateUserApiKey = (options) => {
414
387
  };
415
388
  exports.updateUserApiKey = updateUserApiKey;
416
389
  /**
417
- * Get user limits
418
- * Retrieve current limits and restrictions for the authenticated user
390
+ * Get user limits and usage
391
+ * Retrieve current limits and usage statistics for the authenticated user (simple safety valve for graph creation)
419
392
  */
420
393
  const getUserLimits = (options) => {
421
394
  return (options?.client ?? client_gen_1.client).get({
@@ -434,253 +407,6 @@ const getUserLimits = (options) => {
434
407
  });
435
408
  };
436
409
  exports.getUserLimits = getUserLimits;
437
- /**
438
- * Get user usage statistics
439
- * Retrieve current usage statistics and remaining limits for the authenticated user
440
- */
441
- const getUserUsage = (options) => {
442
- return (options?.client ?? client_gen_1.client).get({
443
- security: [
444
- {
445
- name: 'X-API-Key',
446
- type: 'apiKey'
447
- },
448
- {
449
- scheme: 'bearer',
450
- type: 'http'
451
- }
452
- ],
453
- url: '/v1/user/limits/usage',
454
- ...options
455
- });
456
- };
457
- exports.getUserUsage = getUserUsage;
458
- /**
459
- * Get all shared repository limits
460
- * Get rate limit status for all shared repositories the user has access to.
461
- */
462
- const getAllSharedRepositoryLimits = (options) => {
463
- return (options?.client ?? client_gen_1.client).get({
464
- security: [
465
- {
466
- name: 'X-API-Key',
467
- type: 'apiKey'
468
- },
469
- {
470
- scheme: 'bearer',
471
- type: 'http'
472
- }
473
- ],
474
- url: '/v1/user/limits/shared-repositories/summary',
475
- ...options
476
- });
477
- };
478
- exports.getAllSharedRepositoryLimits = getAllSharedRepositoryLimits;
479
- /**
480
- * Get shared repository rate limit status
481
- * Get current rate limit status and usage for a shared repository.
482
- *
483
- * Returns:
484
- * - Current usage across different time windows
485
- * - Rate limits based on subscription tier
486
- * - Remaining quota
487
- * - Reset times
488
- *
489
- * Note: All queries are included - this only shows rate limit status.
490
- */
491
- const getSharedRepositoryLimits = (options) => {
492
- return (options.client ?? client_gen_1.client).get({
493
- security: [
494
- {
495
- name: 'X-API-Key',
496
- type: 'apiKey'
497
- },
498
- {
499
- scheme: 'bearer',
500
- type: 'http'
501
- }
502
- ],
503
- url: '/v1/user/limits/shared-repositories/{repository}',
504
- ...options
505
- });
506
- };
507
- exports.getSharedRepositoryLimits = getSharedRepositoryLimits;
508
- /**
509
- * Get User Usage Overview
510
- * Get a high-level overview of usage statistics for the current user.
511
- */
512
- const getUserUsageOverview = (options) => {
513
- return (options?.client ?? client_gen_1.client).get({
514
- security: [
515
- {
516
- name: 'X-API-Key',
517
- type: 'apiKey'
518
- },
519
- {
520
- scheme: 'bearer',
521
- type: 'http'
522
- }
523
- ],
524
- url: '/v1/user/analytics/overview',
525
- ...options
526
- });
527
- };
528
- exports.getUserUsageOverview = getUserUsageOverview;
529
- /**
530
- * Get Detailed User Analytics
531
- * Get comprehensive analytics for the current user including API usage and recent activity.
532
- */
533
- const getDetailedUserAnalytics = (options) => {
534
- return (options?.client ?? client_gen_1.client).get({
535
- security: [
536
- {
537
- name: 'X-API-Key',
538
- type: 'apiKey'
539
- },
540
- {
541
- scheme: 'bearer',
542
- type: 'http'
543
- }
544
- ],
545
- url: '/v1/user/analytics/detailed',
546
- ...options
547
- });
548
- };
549
- exports.getDetailedUserAnalytics = getDetailedUserAnalytics;
550
- /**
551
- * Get User Subscriptions
552
- * Retrieve user's current shared repository subscriptions with detailed information
553
- */
554
- const getUserSharedSubscriptions = (options) => {
555
- return (options?.client ?? client_gen_1.client).get({
556
- security: [
557
- {
558
- name: 'X-API-Key',
559
- type: 'apiKey'
560
- },
561
- {
562
- scheme: 'bearer',
563
- type: 'http'
564
- }
565
- ],
566
- url: '/v1/user/subscriptions/shared-repositories',
567
- ...options
568
- });
569
- };
570
- exports.getUserSharedSubscriptions = getUserSharedSubscriptions;
571
- /**
572
- * Subscribe to Shared Repository
573
- * Create a new subscription to a shared repository add-on with specified tier
574
- */
575
- const subscribeToSharedRepository = (options) => {
576
- return (options.client ?? client_gen_1.client).post({
577
- security: [
578
- {
579
- name: 'X-API-Key',
580
- type: 'apiKey'
581
- },
582
- {
583
- scheme: 'bearer',
584
- type: 'http'
585
- }
586
- ],
587
- url: '/v1/user/subscriptions/shared-repositories/subscribe',
588
- ...options,
589
- headers: {
590
- 'Content-Type': 'application/json',
591
- ...options.headers
592
- }
593
- });
594
- };
595
- exports.subscribeToSharedRepository = subscribeToSharedRepository;
596
- /**
597
- * Upgrade Subscription Tier
598
- * Upgrade a subscription to a higher tier with immediate credit adjustment
599
- */
600
- const upgradeSharedRepositorySubscription = (options) => {
601
- return (options.client ?? client_gen_1.client).put({
602
- security: [
603
- {
604
- name: 'X-API-Key',
605
- type: 'apiKey'
606
- },
607
- {
608
- scheme: 'bearer',
609
- type: 'http'
610
- }
611
- ],
612
- url: '/v1/user/subscriptions/shared-repositories/{subscription_id}/upgrade',
613
- ...options,
614
- headers: {
615
- 'Content-Type': 'application/json',
616
- ...options.headers
617
- }
618
- });
619
- };
620
- exports.upgradeSharedRepositorySubscription = upgradeSharedRepositorySubscription;
621
- /**
622
- * Cancel Subscription
623
- * Cancel a shared repository subscription and disable associated credit pool
624
- */
625
- const cancelSharedRepositorySubscription = (options) => {
626
- return (options.client ?? client_gen_1.client).delete({
627
- security: [
628
- {
629
- name: 'X-API-Key',
630
- type: 'apiKey'
631
- },
632
- {
633
- scheme: 'bearer',
634
- type: 'http'
635
- }
636
- ],
637
- url: '/v1/user/subscriptions/shared-repositories/{subscription_id}',
638
- ...options
639
- });
640
- };
641
- exports.cancelSharedRepositorySubscription = cancelSharedRepositorySubscription;
642
- /**
643
- * Get Credit Balances
644
- * Retrieve credit balances for all shared repository subscriptions
645
- */
646
- const getSharedRepositoryCredits = (options) => {
647
- return (options?.client ?? client_gen_1.client).get({
648
- security: [
649
- {
650
- name: 'X-API-Key',
651
- type: 'apiKey'
652
- },
653
- {
654
- scheme: 'bearer',
655
- type: 'http'
656
- }
657
- ],
658
- url: '/v1/user/subscriptions/shared-repositories/credits',
659
- ...options
660
- });
661
- };
662
- exports.getSharedRepositoryCredits = getSharedRepositoryCredits;
663
- /**
664
- * Get Repository Credits
665
- * Get credit balance for a specific shared repository
666
- */
667
- const getRepositoryCredits = (options) => {
668
- return (options.client ?? client_gen_1.client).get({
669
- security: [
670
- {
671
- name: 'X-API-Key',
672
- type: 'apiKey'
673
- },
674
- {
675
- scheme: 'bearer',
676
- type: 'http'
677
- }
678
- ],
679
- url: '/v1/user/subscriptions/shared-repositories/credits/{repository}',
680
- ...options
681
- });
682
- };
683
- exports.getRepositoryCredits = getRepositoryCredits;
684
410
  /**
685
411
  * List Connections
686
412
  * List all data connections in the graph.
@@ -1665,32 +1391,38 @@ const getGraphMetrics = (options) => {
1665
1391
  };
1666
1392
  exports.getGraphMetrics = getGraphMetrics;
1667
1393
  /**
1668
- * Get Usage Statistics
1669
- * Get detailed usage statistics for the graph.
1394
+ * Get Graph Usage Analytics
1395
+ * Get comprehensive usage analytics tracked by the GraphUsageTracking model.
1670
1396
  *
1671
1397
  * Provides temporal usage patterns including:
1672
- * - **Query Volume**: API calls per day/hour
1673
- * - **Credit Consumption**: Usage patterns and trends
1674
- * - **Operation Breakdown**: Usage by operation type
1675
- * - **User Activity**: Access patterns by user role
1676
- * - **Peak Usage Times**: Identify high-activity periods
1398
+ * - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
1399
+ * - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
1400
+ * - **Performance Insights**: Operation stats, slow queries, performance scoring
1401
+ * - **Recent Events**: Latest usage events with full details
1677
1402
  *
1678
1403
  * Time ranges available:
1679
- * - Last 24 hours (hourly breakdown)
1680
- * - Last 7 days (daily breakdown)
1681
- * - Last 30 days (daily breakdown)
1682
- * - Custom date ranges
1404
+ * - `24h` - Last 24 hours (hourly breakdown)
1405
+ * - `7d` - Last 7 days (daily breakdown)
1406
+ * - `30d` - Last 30 days (daily breakdown)
1407
+ * - `current_month` - Current billing month
1408
+ * - `last_month` - Previous billing month
1409
+ *
1410
+ * Include options:
1411
+ * - `storage` - Storage usage summary (GB-hours, averages, peaks)
1412
+ * - `credits` - Credit consumption analytics
1413
+ * - `performance` - Performance insights and optimization opportunities
1414
+ * - `events` - Recent usage events (last 50)
1683
1415
  *
1684
1416
  * Useful for:
1417
+ * - Billing and cost analysis
1685
1418
  * - Capacity planning
1686
- * - Cost optimization
1419
+ * - Performance optimization
1687
1420
  * - Usage trend analysis
1688
- * - Performance tuning
1689
1421
  *
1690
1422
  * Note:
1691
1423
  * This operation is included - no credit consumption required.
1692
1424
  */
1693
- const getGraphUsageStats = (options) => {
1425
+ const getGraphUsageAnalytics = (options) => {
1694
1426
  return (options.client ?? client_gen_1.client).get({
1695
1427
  security: [
1696
1428
  {
@@ -1706,7 +1438,7 @@ const getGraphUsageStats = (options) => {
1706
1438
  ...options
1707
1439
  });
1708
1440
  };
1709
- exports.getGraphUsageStats = getGraphUsageStats;
1441
+ exports.getGraphUsageAnalytics = getGraphUsageAnalytics;
1710
1442
  /**
1711
1443
  * Execute Cypher Query (Read-Only)
1712
1444
  * Execute a read-only Cypher query with intelligent response optimization.
@@ -1960,21 +1692,18 @@ const validateSchema = (options) => {
1960
1692
  };
1961
1693
  exports.validateSchema = validateSchema;
1962
1694
  /**
1963
- * Get Current Bill
1964
- * Get current month's billing details for the graph.
1965
- *
1966
- * Returns comprehensive billing information including:
1967
- * - **Credit Usage**: Consumed vs. allocated credits
1968
- * - **Storage Charges**: Current storage usage and costs
1969
- * - **Subscription Tier**: Current plan and features
1970
- * - **Pro-rated Charges**: If plan changed mid-month
1971
- * - **Estimated Total**: Current charges to date
1695
+ * Get Credit Summary
1696
+ * Retrieve comprehensive credit usage summary for the specified graph.
1972
1697
  *
1973
- * Billing calculations are updated hourly. Storage is measured in GB-months.
1698
+ * This endpoint provides:
1699
+ * - Current credit balance and monthly allocation
1700
+ * - Credit consumption metrics for the current month
1701
+ * - Graph tier and credit multiplier information
1702
+ * - Usage percentage to help monitor credit consumption
1974
1703
  *
1975
- * ℹ️ No credits are consumed for viewing billing information.
1704
+ * No credits are consumed for checking credit status.
1976
1705
  */
1977
- const getCurrentGraphBill = (options) => {
1706
+ const getCreditSummary = (options) => {
1978
1707
  return (options.client ?? client_gen_1.client).get({
1979
1708
  security: [
1980
1709
  {
@@ -1986,31 +1715,30 @@ const getCurrentGraphBill = (options) => {
1986
1715
  type: 'http'
1987
1716
  }
1988
1717
  ],
1989
- url: '/v1/graphs/{graph_id}/billing/current',
1718
+ url: '/v1/graphs/{graph_id}/credits/summary',
1990
1719
  ...options
1991
1720
  });
1992
1721
  };
1993
- exports.getCurrentGraphBill = getCurrentGraphBill;
1722
+ exports.getCreditSummary = getCreditSummary;
1994
1723
  /**
1995
- * Get Usage Details
1996
- * Get detailed usage metrics for the graph.
1724
+ * List Credit Transactions
1725
+ * Retrieve detailed credit transaction history for the specified graph.
1997
1726
  *
1998
- * Provides granular usage information including:
1999
- * - **Daily Credit Consumption**: Track credit usage patterns
2000
- * - **Storage Growth**: Monitor database size over time
2001
- * - **Operation Breakdown**: Credits by operation type
2002
- * - **Peak Usage Times**: Identify high-activity periods
2003
- * - **API Call Volumes**: Request counts and patterns
1727
+ * This enhanced endpoint provides:
1728
+ * - Detailed transaction records with idempotency information
1729
+ * - Summary by operation type to identify high-consumption operations
1730
+ * - Date range filtering for analysis
1731
+ * - Metadata search capabilities
2004
1732
  *
2005
- * Useful for:
2006
- * - Optimizing credit consumption
2007
- * - Capacity planning
2008
- * - Usage trend analysis
2009
- * - Cost optimization
1733
+ * Transaction types include:
1734
+ * - ALLOCATION: Monthly credit allocations
1735
+ * - CONSUMPTION: Credit usage for operations
1736
+ * - BONUS: Bonus credits added by admins
1737
+ * - REFUND: Credit refunds
2010
1738
  *
2011
- * ℹ️ No credits are consumed for viewing usage details.
1739
+ * No credits are consumed for viewing transaction history.
2012
1740
  */
2013
- const getGraphUsageDetails = (options) => {
1741
+ const listCreditTransactions = (options) => {
2014
1742
  return (options.client ?? client_gen_1.client).get({
2015
1743
  security: [
2016
1744
  {
@@ -2022,30 +1750,26 @@ const getGraphUsageDetails = (options) => {
2022
1750
  type: 'http'
2023
1751
  }
2024
1752
  ],
2025
- url: '/v1/graphs/{graph_id}/billing/usage',
1753
+ url: '/v1/graphs/{graph_id}/credits/transactions',
2026
1754
  ...options
2027
1755
  });
2028
1756
  };
2029
- exports.getGraphUsageDetails = getGraphUsageDetails;
1757
+ exports.listCreditTransactions = listCreditTransactions;
2030
1758
  /**
2031
- * Get Billing History
2032
- * Get billing history for the graph.
1759
+ * Check Credit Balance
1760
+ * Check if the graph has sufficient credits for a planned operation.
2033
1761
  *
2034
- * Returns a chronological list of monthly bills, perfect for:
2035
- * - Tracking spending trends over time
2036
- * - Identifying usage patterns
2037
- * - Budget forecasting
2038
- * - Financial reporting
1762
+ * This endpoint allows you to verify credit availability before performing
1763
+ * an operation, helping prevent failed operations due to insufficient credits.
2039
1764
  *
2040
- * Each month includes:
2041
- * - Credit usage and overages
2042
- * - Storage charges
2043
- * - Total charges
2044
- * - Usage metrics
1765
+ * The check considers:
1766
+ * - Base operation cost
1767
+ * - Graph tier multiplier
1768
+ * - Current credit balance
2045
1769
  *
2046
- * ℹ️ No credits are consumed for viewing billing history.
1770
+ * No credits are consumed for checking availability.
2047
1771
  */
2048
- const getGraphBillingHistory = (options) => {
1772
+ const checkCreditBalance = (options) => {
2049
1773
  return (options.client ?? client_gen_1.client).get({
2050
1774
  security: [
2051
1775
  {
@@ -2057,141 +1781,14 @@ const getGraphBillingHistory = (options) => {
2057
1781
  type: 'http'
2058
1782
  }
2059
1783
  ],
2060
- url: '/v1/graphs/{graph_id}/billing/history',
1784
+ url: '/v1/graphs/{graph_id}/credits/balance/check',
2061
1785
  ...options
2062
1786
  });
2063
1787
  };
2064
- exports.getGraphBillingHistory = getGraphBillingHistory;
1788
+ exports.checkCreditBalance = checkCreditBalance;
2065
1789
  /**
2066
- * Get Monthly Bill
2067
- * Get billing details for a specific month.
2068
- *
2069
- * Retrieve historical billing information for any previous month.
2070
- * Useful for:
2071
- * - Reconciling past charges
2072
- * - Tracking usage trends
2073
- * - Expense reporting
2074
- * - Budget analysis
2075
- *
2076
- * Returns the same detailed breakdown as the current bill endpoint.
2077
- *
2078
- * ℹ️ No credits are consumed for viewing billing history.
2079
- */
2080
- const getGraphMonthlyBill = (options) => {
2081
- return (options.client ?? client_gen_1.client).get({
2082
- security: [
2083
- {
2084
- name: 'X-API-Key',
2085
- type: 'apiKey'
2086
- },
2087
- {
2088
- scheme: 'bearer',
2089
- type: 'http'
2090
- }
2091
- ],
2092
- url: '/v1/graphs/{graph_id}/billing/history/{year}/{month}',
2093
- ...options
2094
- });
2095
- };
2096
- exports.getGraphMonthlyBill = getGraphMonthlyBill;
2097
- /**
2098
- * Get Credit Summary
2099
- * Retrieve comprehensive credit usage summary for the specified graph.
2100
- *
2101
- * This endpoint provides:
2102
- * - Current credit balance and monthly allocation
2103
- * - Credit consumption metrics for the current month
2104
- * - Graph tier and credit multiplier information
2105
- * - Usage percentage to help monitor credit consumption
2106
- *
2107
- * No credits are consumed for checking credit status.
2108
- */
2109
- const getCreditSummary = (options) => {
2110
- return (options.client ?? client_gen_1.client).get({
2111
- security: [
2112
- {
2113
- name: 'X-API-Key',
2114
- type: 'apiKey'
2115
- },
2116
- {
2117
- scheme: 'bearer',
2118
- type: 'http'
2119
- }
2120
- ],
2121
- url: '/v1/graphs/{graph_id}/credits/summary',
2122
- ...options
2123
- });
2124
- };
2125
- exports.getCreditSummary = getCreditSummary;
2126
- /**
2127
- * List Credit Transactions
2128
- * Retrieve detailed credit transaction history for the specified graph.
2129
- *
2130
- * This enhanced endpoint provides:
2131
- * - Detailed transaction records with idempotency information
2132
- * - Summary by operation type to identify high-consumption operations
2133
- * - Date range filtering for analysis
2134
- * - Metadata search capabilities
2135
- *
2136
- * Transaction types include:
2137
- * - ALLOCATION: Monthly credit allocations
2138
- * - CONSUMPTION: Credit usage for operations
2139
- * - BONUS: Bonus credits added by admins
2140
- * - REFUND: Credit refunds
2141
- *
2142
- * No credits are consumed for viewing transaction history.
2143
- */
2144
- const listCreditTransactions = (options) => {
2145
- return (options.client ?? client_gen_1.client).get({
2146
- security: [
2147
- {
2148
- name: 'X-API-Key',
2149
- type: 'apiKey'
2150
- },
2151
- {
2152
- scheme: 'bearer',
2153
- type: 'http'
2154
- }
2155
- ],
2156
- url: '/v1/graphs/{graph_id}/credits/transactions',
2157
- ...options
2158
- });
2159
- };
2160
- exports.listCreditTransactions = listCreditTransactions;
2161
- /**
2162
- * Check Credit Balance
2163
- * Check if the graph has sufficient credits for a planned operation.
2164
- *
2165
- * This endpoint allows you to verify credit availability before performing
2166
- * an operation, helping prevent failed operations due to insufficient credits.
2167
- *
2168
- * The check considers:
2169
- * - Base operation cost
2170
- * - Graph tier multiplier
2171
- * - Current credit balance
2172
- *
2173
- * No credits are consumed for checking availability.
2174
- */
2175
- const checkCreditBalance = (options) => {
2176
- return (options.client ?? client_gen_1.client).get({
2177
- security: [
2178
- {
2179
- name: 'X-API-Key',
2180
- type: 'apiKey'
2181
- },
2182
- {
2183
- scheme: 'bearer',
2184
- type: 'http'
2185
- }
2186
- ],
2187
- url: '/v1/graphs/{graph_id}/credits/balance/check',
2188
- ...options
2189
- });
2190
- };
2191
- exports.checkCreditBalance = checkCreditBalance;
2192
- /**
2193
- * Get Storage Usage
2194
- * Get storage usage history for a graph.
1790
+ * Get Storage Usage
1791
+ * Get storage usage history for a graph.
2195
1792
  *
2196
1793
  * Returns detailed storage usage information including:
2197
1794
  * - Daily average storage consumption
@@ -2541,6 +2138,116 @@ const getSubgraphQuota = (options) => {
2541
2138
  });
2542
2139
  };
2543
2140
  exports.getSubgraphQuota = getSubgraphQuota;
2141
+ /**
2142
+ * Cancel Subscription
2143
+ * Cancel a subscription.
2144
+ *
2145
+ * For shared repositories: Cancels the user's personal subscription
2146
+ * For user graphs: Not allowed - delete the graph instead
2147
+ *
2148
+ * The subscription will be marked as canceled and will end at the current period end date.
2149
+ */
2150
+ const cancelSubscription = (options) => {
2151
+ return (options.client ?? client_gen_1.client).delete({
2152
+ security: [
2153
+ {
2154
+ name: 'X-API-Key',
2155
+ type: 'apiKey'
2156
+ },
2157
+ {
2158
+ scheme: 'bearer',
2159
+ type: 'http'
2160
+ }
2161
+ ],
2162
+ url: '/v1/graphs/{graph_id}/subscriptions',
2163
+ ...options
2164
+ });
2165
+ };
2166
+ exports.cancelSubscription = cancelSubscription;
2167
+ /**
2168
+ * Get Subscription
2169
+ * Get subscription details for a graph or shared repository.
2170
+ *
2171
+ * For user graphs (kg*): Returns the graph's subscription (owned by graph creator)
2172
+ * For shared repositories (sec, industry, etc.): Returns user's personal subscription to that repository
2173
+ *
2174
+ * This unified endpoint automatically detects the resource type and returns the appropriate subscription.
2175
+ */
2176
+ const getGraphSubscription = (options) => {
2177
+ return (options.client ?? client_gen_1.client).get({
2178
+ security: [
2179
+ {
2180
+ name: 'X-API-Key',
2181
+ type: 'apiKey'
2182
+ },
2183
+ {
2184
+ scheme: 'bearer',
2185
+ type: 'http'
2186
+ }
2187
+ ],
2188
+ url: '/v1/graphs/{graph_id}/subscriptions',
2189
+ ...options
2190
+ });
2191
+ };
2192
+ exports.getGraphSubscription = getGraphSubscription;
2193
+ /**
2194
+ * Create Repository Subscription
2195
+ * Create a new subscription to a shared repository.
2196
+ *
2197
+ * This endpoint is ONLY for shared repositories (sec, industry, economic).
2198
+ * User graph subscriptions are created automatically when the graph is provisioned.
2199
+ *
2200
+ * The subscription will be created in ACTIVE status immediately and credits will be allocated.
2201
+ */
2202
+ const createRepositorySubscription = (options) => {
2203
+ return (options.client ?? client_gen_1.client).post({
2204
+ security: [
2205
+ {
2206
+ name: 'X-API-Key',
2207
+ type: 'apiKey'
2208
+ },
2209
+ {
2210
+ scheme: 'bearer',
2211
+ type: 'http'
2212
+ }
2213
+ ],
2214
+ url: '/v1/graphs/{graph_id}/subscriptions',
2215
+ ...options,
2216
+ headers: {
2217
+ 'Content-Type': 'application/json',
2218
+ ...options.headers
2219
+ }
2220
+ });
2221
+ };
2222
+ exports.createRepositorySubscription = createRepositorySubscription;
2223
+ /**
2224
+ * Upgrade Subscription
2225
+ * Upgrade a subscription to a different plan.
2226
+ *
2227
+ * Works for both user graphs and shared repositories.
2228
+ * The subscription will be immediately updated to the new plan and pricing.
2229
+ */
2230
+ const upgradeSubscription = (options) => {
2231
+ return (options.client ?? client_gen_1.client).put({
2232
+ security: [
2233
+ {
2234
+ name: 'X-API-Key',
2235
+ type: 'apiKey'
2236
+ },
2237
+ {
2238
+ scheme: 'bearer',
2239
+ type: 'http'
2240
+ }
2241
+ ],
2242
+ url: '/v1/graphs/{graph_id}/subscriptions/upgrade',
2243
+ ...options,
2244
+ headers: {
2245
+ 'Content-Type': 'application/json',
2246
+ ...options.headers
2247
+ }
2248
+ });
2249
+ };
2250
+ exports.upgradeSubscription = upgradeSubscription;
2544
2251
  /**
2545
2252
  * List Staging Tables
2546
2253
  * List all DuckDB staging tables with comprehensive metrics and status.
@@ -3455,3 +3162,239 @@ const cancelOperation = (options) => {
3455
3162
  });
3456
3163
  };
3457
3164
  exports.cancelOperation = cancelOperation;
3165
+ /**
3166
+ * Create Payment Checkout Session
3167
+ * Create a Stripe checkout session for collecting payment method.
3168
+ *
3169
+ * This endpoint is used when a user needs to add a payment method before
3170
+ * provisioning resources. It creates a pending subscription and redirects
3171
+ * the user to Stripe Checkout to collect payment details.
3172
+ *
3173
+ * **Flow:**
3174
+ * 1. User tries to create a graph but has no payment method
3175
+ * 2. Frontend calls this endpoint with graph configuration
3176
+ * 3. Backend creates a subscription in PENDING_PAYMENT status
3177
+ * 4. Returns Stripe Checkout URL
3178
+ * 5. User completes payment on Stripe
3179
+ * 6. Webhook activates subscription and provisions resource
3180
+ *
3181
+ * **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
3182
+ */
3183
+ const createCheckoutSession = (options) => {
3184
+ return (options.client ?? client_gen_1.client).post({
3185
+ security: [
3186
+ {
3187
+ name: 'X-API-Key',
3188
+ type: 'apiKey'
3189
+ },
3190
+ {
3191
+ scheme: 'bearer',
3192
+ type: 'http'
3193
+ }
3194
+ ],
3195
+ url: '/v1/billing/checkout',
3196
+ ...options,
3197
+ headers: {
3198
+ 'Content-Type': 'application/json',
3199
+ ...options.headers
3200
+ }
3201
+ });
3202
+ };
3203
+ exports.createCheckoutSession = createCheckoutSession;
3204
+ /**
3205
+ * Get Checkout Session Status
3206
+ * Poll the status of a checkout session.
3207
+ *
3208
+ * Frontend should poll this endpoint after user returns from Stripe Checkout
3209
+ * to determine when the resource is ready.
3210
+ *
3211
+ * **Status Values:**
3212
+ * - `pending_payment`: Waiting for payment to complete
3213
+ * - `provisioning`: Payment confirmed, resource being created
3214
+ * - `completed`: Resource is ready (resource_id will be set)
3215
+ * - `failed`: Something went wrong (error field will be set)
3216
+ *
3217
+ * **When status is 'completed':**
3218
+ * - For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE progress
3219
+ * - For repositories: `resource_id` will be the repository name and access is immediately available
3220
+ */
3221
+ const getCheckoutStatus = (options) => {
3222
+ return (options.client ?? client_gen_1.client).get({
3223
+ security: [
3224
+ {
3225
+ name: 'X-API-Key',
3226
+ type: 'apiKey'
3227
+ },
3228
+ {
3229
+ scheme: 'bearer',
3230
+ type: 'http'
3231
+ }
3232
+ ],
3233
+ url: '/v1/billing/checkout/{session_id}/status',
3234
+ ...options
3235
+ });
3236
+ };
3237
+ exports.getCheckoutStatus = getCheckoutStatus;
3238
+ /**
3239
+ * Get Customer Info
3240
+ * Get billing customer information including payment methods on file.
3241
+ *
3242
+ * Returns customer details, payment methods, and whether invoice billing is enabled.
3243
+ */
3244
+ const getBillingCustomer = (options) => {
3245
+ return (options?.client ?? client_gen_1.client).get({
3246
+ security: [
3247
+ {
3248
+ name: 'X-API-Key',
3249
+ type: 'apiKey'
3250
+ },
3251
+ {
3252
+ scheme: 'bearer',
3253
+ type: 'http'
3254
+ }
3255
+ ],
3256
+ url: '/v1/billing/customer',
3257
+ ...options
3258
+ });
3259
+ };
3260
+ exports.getBillingCustomer = getBillingCustomer;
3261
+ /**
3262
+ * Update Default Payment Method
3263
+ * Update the default payment method for the customer.
3264
+ *
3265
+ * This changes which payment method will be used for future subscription charges.
3266
+ */
3267
+ const updatePaymentMethod = (options) => {
3268
+ return (options.client ?? client_gen_1.client).post({
3269
+ security: [
3270
+ {
3271
+ name: 'X-API-Key',
3272
+ type: 'apiKey'
3273
+ },
3274
+ {
3275
+ scheme: 'bearer',
3276
+ type: 'http'
3277
+ }
3278
+ ],
3279
+ url: '/v1/billing/customer/payment-method',
3280
+ ...options,
3281
+ headers: {
3282
+ 'Content-Type': 'application/json',
3283
+ ...options.headers
3284
+ }
3285
+ });
3286
+ };
3287
+ exports.updatePaymentMethod = updatePaymentMethod;
3288
+ /**
3289
+ * List Invoices
3290
+ * List payment history and invoices.
3291
+ *
3292
+ * Returns past invoices with payment status, amounts, and line items.
3293
+ */
3294
+ const listInvoices = (options) => {
3295
+ return (options?.client ?? client_gen_1.client).get({
3296
+ security: [
3297
+ {
3298
+ name: 'X-API-Key',
3299
+ type: 'apiKey'
3300
+ },
3301
+ {
3302
+ scheme: 'bearer',
3303
+ type: 'http'
3304
+ }
3305
+ ],
3306
+ url: '/v1/billing/invoices',
3307
+ ...options
3308
+ });
3309
+ };
3310
+ exports.listInvoices = listInvoices;
3311
+ /**
3312
+ * Get Upcoming Invoice
3313
+ * Get preview of the next invoice.
3314
+ *
3315
+ * Returns estimated charges for the next billing period.
3316
+ */
3317
+ const getUpcomingInvoice = (options) => {
3318
+ return (options?.client ?? client_gen_1.client).get({
3319
+ security: [
3320
+ {
3321
+ name: 'X-API-Key',
3322
+ type: 'apiKey'
3323
+ },
3324
+ {
3325
+ scheme: 'bearer',
3326
+ type: 'http'
3327
+ }
3328
+ ],
3329
+ url: '/v1/billing/invoices/upcoming',
3330
+ ...options
3331
+ });
3332
+ };
3333
+ exports.getUpcomingInvoice = getUpcomingInvoice;
3334
+ /**
3335
+ * List All Subscriptions
3336
+ * List all active and past subscriptions for the user.
3337
+ *
3338
+ * Includes both graph and repository subscriptions with their status, pricing, and billing information.
3339
+ */
3340
+ const listSubscriptions = (options) => {
3341
+ return (options?.client ?? client_gen_1.client).get({
3342
+ security: [
3343
+ {
3344
+ name: 'X-API-Key',
3345
+ type: 'apiKey'
3346
+ },
3347
+ {
3348
+ scheme: 'bearer',
3349
+ type: 'http'
3350
+ }
3351
+ ],
3352
+ url: '/v1/billing/subscriptions',
3353
+ ...options
3354
+ });
3355
+ };
3356
+ exports.listSubscriptions = listSubscriptions;
3357
+ /**
3358
+ * Get Subscription Details
3359
+ * Get detailed information about a specific subscription.
3360
+ */
3361
+ const getSubscription = (options) => {
3362
+ return (options.client ?? client_gen_1.client).get({
3363
+ security: [
3364
+ {
3365
+ name: 'X-API-Key',
3366
+ type: 'apiKey'
3367
+ },
3368
+ {
3369
+ scheme: 'bearer',
3370
+ type: 'http'
3371
+ }
3372
+ ],
3373
+ url: '/v1/billing/subscriptions/{subscription_id}',
3374
+ ...options
3375
+ });
3376
+ };
3377
+ exports.getSubscription = getSubscription;
3378
+ /**
3379
+ * Cancel Subscription
3380
+ * Cancel a subscription.
3381
+ *
3382
+ * The subscription will remain active until the end of the current billing period.
3383
+ */
3384
+ const cancelSubscription2 = (options) => {
3385
+ return (options.client ?? client_gen_1.client).post({
3386
+ security: [
3387
+ {
3388
+ name: 'X-API-Key',
3389
+ type: 'apiKey'
3390
+ },
3391
+ {
3392
+ scheme: 'bearer',
3393
+ type: 'http'
3394
+ }
3395
+ ],
3396
+ url: '/v1/billing/subscriptions/{subscription_id}/cancel',
3397
+ ...options
3398
+ });
3399
+ };
3400
+ exports.cancelSubscription2 = cancelSubscription2;