@robosystems/client 0.2.10 → 0.2.11

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,12 +1,17 @@
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.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;
4
+ 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.getOrgUsage = exports.getOrgLimits = exports.updateOrgMemberRole = exports.removeOrgMember = exports.inviteOrgMember = exports.listOrgMembers = exports.listOrgGraphs = exports.updateOrg = exports.getOrg = exports.createOrg = exports.listUserOrgs = exports.updateUserApiKey = exports.revokeUserApiKey = exports.createUserApiKey = exports.listUserApiKeys = exports.updateUserPassword = exports.updateUser = exports.getCurrentUser = exports.getServiceStatus = exports.getCaptchaConfig = exports.completeSsoAuth = exports.ssoTokenExchange = exports.generateSsoToken = exports.resetPassword = exports.validateResetToken = exports.forgotPassword = exports.checkPasswordStrength = exports.getPasswordPolicy = exports.verifyEmail = exports.resendVerificationEmail = exports.refreshAuthSession = exports.getCurrentAuthUser = exports.logoutUser = exports.loginUser = exports.registerUser = void 0;
5
+ exports.updateOrgPaymentMethod = exports.getOrgBillingCustomer = 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 = exports.getGraphUsageAnalytics = exports.getGraphMetrics = exports.getBackupStats = exports.restoreBackup = exports.getBackupDownloadUrl = exports.createBackup = exports.listBackups = exports.callMcpTool = exports.listMcpTools = exports.recommendAgent = void 0;
6
+ exports.getCheckoutStatus = exports.createCheckoutSession = exports.getOrgUpcomingInvoice = exports.listOrgInvoices = exports.cancelOrgSubscription = exports.getOrgSubscription = exports.listOrgSubscriptions = void 0;
6
7
  const client_gen_1 = require("./client.gen");
7
8
  /**
8
9
  * 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
+ * Register a new user account with email and password.
11
+ *
12
+ * **Organization Creation**: RoboSystems is an org-centric platform. When you register, a personal organization is automatically created for you. All resources (graphs, subscriptions, billing) belong to organizations, not individual users. You can later upgrade your personal org to a team or enterprise organization.
13
+ *
14
+ * **Security Controls**: CAPTCHA and email verification are disabled in development for API testing, but required in production.
10
15
  */
11
16
  const registerUser = (options) => {
12
17
  return (options.client ?? client_gen_1.client).post({
@@ -387,10 +392,10 @@ const updateUserApiKey = (options) => {
387
392
  };
388
393
  exports.updateUserApiKey = updateUserApiKey;
389
394
  /**
390
- * Get user limits and usage
391
- * Retrieve current limits and usage statistics for the authenticated user (simple safety valve for graph creation)
395
+ * List User's Organizations
396
+ * Get all organizations the current user belongs to, with their role in each.
392
397
  */
393
- const getUserLimits = (options) => {
398
+ const listUserOrgs = (options) => {
394
399
  return (options?.client ?? client_gen_1.client).get({
395
400
  security: [
396
401
  {
@@ -402,11 +407,240 @@ const getUserLimits = (options) => {
402
407
  type: 'http'
403
408
  }
404
409
  ],
405
- url: '/v1/user/limits',
410
+ url: '/v1/orgs',
411
+ ...options
412
+ });
413
+ };
414
+ exports.listUserOrgs = listUserOrgs;
415
+ /**
416
+ * Create Organization
417
+ * Create a new organization. The creating user becomes the owner.
418
+ */
419
+ const createOrg = (options) => {
420
+ return (options.client ?? client_gen_1.client).post({
421
+ security: [
422
+ {
423
+ name: 'X-API-Key',
424
+ type: 'apiKey'
425
+ },
426
+ {
427
+ scheme: 'bearer',
428
+ type: 'http'
429
+ }
430
+ ],
431
+ url: '/v1/orgs',
432
+ ...options,
433
+ headers: {
434
+ 'Content-Type': 'application/json',
435
+ ...options.headers
436
+ }
437
+ });
438
+ };
439
+ exports.createOrg = createOrg;
440
+ /**
441
+ * Get Organization
442
+ * Get detailed information about an organization.
443
+ */
444
+ const getOrg = (options) => {
445
+ return (options.client ?? client_gen_1.client).get({
446
+ security: [
447
+ {
448
+ name: 'X-API-Key',
449
+ type: 'apiKey'
450
+ },
451
+ {
452
+ scheme: 'bearer',
453
+ type: 'http'
454
+ }
455
+ ],
456
+ url: '/v1/orgs/{org_id}',
457
+ ...options
458
+ });
459
+ };
460
+ exports.getOrg = getOrg;
461
+ /**
462
+ * Update Organization
463
+ * Update organization information. Requires admin or owner role.
464
+ */
465
+ const updateOrg = (options) => {
466
+ return (options.client ?? client_gen_1.client).put({
467
+ security: [
468
+ {
469
+ name: 'X-API-Key',
470
+ type: 'apiKey'
471
+ },
472
+ {
473
+ scheme: 'bearer',
474
+ type: 'http'
475
+ }
476
+ ],
477
+ url: '/v1/orgs/{org_id}',
478
+ ...options,
479
+ headers: {
480
+ 'Content-Type': 'application/json',
481
+ ...options.headers
482
+ }
483
+ });
484
+ };
485
+ exports.updateOrg = updateOrg;
486
+ /**
487
+ * List Organization Graphs
488
+ * Get all graphs belonging to an organization.
489
+ */
490
+ const listOrgGraphs = (options) => {
491
+ return (options.client ?? client_gen_1.client).get({
492
+ security: [
493
+ {
494
+ name: 'X-API-Key',
495
+ type: 'apiKey'
496
+ },
497
+ {
498
+ scheme: 'bearer',
499
+ type: 'http'
500
+ }
501
+ ],
502
+ url: '/v1/orgs/{org_id}/graphs',
406
503
  ...options
407
504
  });
408
505
  };
409
- exports.getUserLimits = getUserLimits;
506
+ exports.listOrgGraphs = listOrgGraphs;
507
+ /**
508
+ * List Organization Members
509
+ * Get all members of an organization with their roles.
510
+ */
511
+ const listOrgMembers = (options) => {
512
+ return (options.client ?? client_gen_1.client).get({
513
+ security: [
514
+ {
515
+ name: 'X-API-Key',
516
+ type: 'apiKey'
517
+ },
518
+ {
519
+ scheme: 'bearer',
520
+ type: 'http'
521
+ }
522
+ ],
523
+ url: '/v1/orgs/{org_id}/members',
524
+ ...options
525
+ });
526
+ };
527
+ exports.listOrgMembers = listOrgMembers;
528
+ /**
529
+ * Invite Member
530
+ * Invite a user to join the organization. Requires admin or owner role.
531
+ *
532
+ * **⚠️ FEATURE NOT READY**: This endpoint is disabled by default (ORG_MEMBER_INVITATIONS_ENABLED=false).
533
+ * Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before enabling.
534
+ */
535
+ const inviteOrgMember = (options) => {
536
+ return (options.client ?? client_gen_1.client).post({
537
+ security: [
538
+ {
539
+ name: 'X-API-Key',
540
+ type: 'apiKey'
541
+ },
542
+ {
543
+ scheme: 'bearer',
544
+ type: 'http'
545
+ }
546
+ ],
547
+ url: '/v1/orgs/{org_id}/members',
548
+ ...options,
549
+ headers: {
550
+ 'Content-Type': 'application/json',
551
+ ...options.headers
552
+ }
553
+ });
554
+ };
555
+ exports.inviteOrgMember = inviteOrgMember;
556
+ /**
557
+ * Remove Member
558
+ * Remove a member from the organization. Requires admin or owner role.
559
+ */
560
+ const removeOrgMember = (options) => {
561
+ return (options.client ?? client_gen_1.client).delete({
562
+ security: [
563
+ {
564
+ name: 'X-API-Key',
565
+ type: 'apiKey'
566
+ },
567
+ {
568
+ scheme: 'bearer',
569
+ type: 'http'
570
+ }
571
+ ],
572
+ url: '/v1/orgs/{org_id}/members/{user_id}',
573
+ ...options
574
+ });
575
+ };
576
+ exports.removeOrgMember = removeOrgMember;
577
+ /**
578
+ * Update Member Role
579
+ * Update a member's role in the organization. Requires admin or owner role.
580
+ */
581
+ const updateOrgMemberRole = (options) => {
582
+ return (options.client ?? client_gen_1.client).put({
583
+ security: [
584
+ {
585
+ name: 'X-API-Key',
586
+ type: 'apiKey'
587
+ },
588
+ {
589
+ scheme: 'bearer',
590
+ type: 'http'
591
+ }
592
+ ],
593
+ url: '/v1/orgs/{org_id}/members/{user_id}',
594
+ ...options,
595
+ headers: {
596
+ 'Content-Type': 'application/json',
597
+ ...options.headers
598
+ }
599
+ });
600
+ };
601
+ exports.updateOrgMemberRole = updateOrgMemberRole;
602
+ /**
603
+ * Get Organization Limits
604
+ * Get the current limits and quotas for an organization.
605
+ */
606
+ const getOrgLimits = (options) => {
607
+ return (options.client ?? client_gen_1.client).get({
608
+ security: [
609
+ {
610
+ name: 'X-API-Key',
611
+ type: 'apiKey'
612
+ },
613
+ {
614
+ scheme: 'bearer',
615
+ type: 'http'
616
+ }
617
+ ],
618
+ url: '/v1/orgs/{org_id}/limits',
619
+ ...options
620
+ });
621
+ };
622
+ exports.getOrgLimits = getOrgLimits;
623
+ /**
624
+ * Get Organization Usage
625
+ * Get detailed usage statistics for an organization aggregated across all graphs.
626
+ */
627
+ const getOrgUsage = (options) => {
628
+ return (options.client ?? client_gen_1.client).get({
629
+ security: [
630
+ {
631
+ name: 'X-API-Key',
632
+ type: 'apiKey'
633
+ },
634
+ {
635
+ scheme: 'bearer',
636
+ type: 'http'
637
+ }
638
+ ],
639
+ url: '/v1/orgs/{org_id}/usage',
640
+ ...options
641
+ });
642
+ };
643
+ exports.getOrgUsage = getOrgUsage;
410
644
  /**
411
645
  * List Connections
412
646
  * List all data connections in the graph.
@@ -1392,7 +1626,7 @@ const getGraphMetrics = (options) => {
1392
1626
  exports.getGraphMetrics = getGraphMetrics;
1393
1627
  /**
1394
1628
  * Get Graph Usage Analytics
1395
- * Get comprehensive usage analytics tracked by the GraphUsageTracking model.
1629
+ * Get comprehensive usage analytics tracked by the GraphUsage model.
1396
1630
  *
1397
1631
  * Provides temporal usage patterns including:
1398
1632
  * - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
@@ -3015,9 +3249,15 @@ exports.selectGraph = selectGraph;
3015
3249
  * and shared repository subscriptions. This is the primary endpoint for frontend
3016
3250
  * applications to display subscription options.
3017
3251
  *
3252
+ * **Pricing Model:**
3253
+ * - Graph subscriptions are **per-graph** with infrastructure-based pricing
3254
+ * - Each graph you create has its own monthly subscription
3255
+ * - Organizations can have multiple graphs with different infrastructure tiers
3256
+ * - Credits are allocated per-graph, not shared across organization
3257
+ *
3018
3258
  * Includes:
3019
- * - Graph subscription tiers (standard, enterprise, premium)
3020
- * - Shared repository subscriptions (SEC, industry, economic data)
3259
+ * - Graph infrastructure tiers (kuzu-standard, kuzu-large, kuzu-xlarge) - per-graph pricing
3260
+ * - Shared repository subscriptions (SEC, industry, economic data) - org-level
3021
3261
  * - Operation costs and credit information
3022
3262
  * - Features and capabilities for each tier
3023
3263
  * - Enabled/disabled status for repositories
@@ -3163,25 +3403,17 @@ const cancelOperation = (options) => {
3163
3403
  };
3164
3404
  exports.cancelOperation = cancelOperation;
3165
3405
  /**
3166
- * Create Payment Checkout Session
3167
- * Create a Stripe checkout session for collecting payment method.
3406
+ * Get Organization Customer Info
3407
+ * Get billing customer information for an organization including payment methods on file.
3168
3408
  *
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
3409
+ * Returns customer details, payment methods, and whether invoice billing is enabled.
3180
3410
  *
3181
- * **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
3411
+ * **Requirements:**
3412
+ * - User must be a member of the organization
3413
+ * - Sensitive payment details are only visible to owners
3182
3414
  */
3183
- const createCheckoutSession = (options) => {
3184
- return (options.client ?? client_gen_1.client).post({
3415
+ const getOrgBillingCustomer = (options) => {
3416
+ return (options.client ?? client_gen_1.client).get({
3185
3417
  security: [
3186
3418
  {
3187
3419
  name: 'X-API-Key',
@@ -3192,34 +3424,22 @@ const createCheckoutSession = (options) => {
3192
3424
  type: 'http'
3193
3425
  }
3194
3426
  ],
3195
- url: '/v1/billing/checkout',
3196
- ...options,
3197
- headers: {
3198
- 'Content-Type': 'application/json',
3199
- ...options.headers
3200
- }
3427
+ url: '/v1/billing/customer/{org_id}',
3428
+ ...options
3201
3429
  });
3202
3430
  };
3203
- exports.createCheckoutSession = createCheckoutSession;
3431
+ exports.getOrgBillingCustomer = getOrgBillingCustomer;
3204
3432
  /**
3205
- * Get Checkout Session Status
3206
- * Poll the status of a checkout session.
3433
+ * Update Organization Default Payment Method
3434
+ * Update the default payment method for the organization.
3207
3435
  *
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)
3436
+ * This changes which payment method will be used for future subscription charges.
3216
3437
  *
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
3438
+ * **Requirements:**
3439
+ * - User must be an OWNER of the organization
3220
3440
  */
3221
- const getCheckoutStatus = (options) => {
3222
- return (options.client ?? client_gen_1.client).get({
3441
+ const updateOrgPaymentMethod = (options) => {
3442
+ return (options.client ?? client_gen_1.client).post({
3223
3443
  security: [
3224
3444
  {
3225
3445
  name: 'X-API-Key',
@@ -3230,19 +3450,26 @@ const getCheckoutStatus = (options) => {
3230
3450
  type: 'http'
3231
3451
  }
3232
3452
  ],
3233
- url: '/v1/billing/checkout/{session_id}/status',
3234
- ...options
3453
+ url: '/v1/billing/customer/{org_id}/payment-method',
3454
+ ...options,
3455
+ headers: {
3456
+ 'Content-Type': 'application/json',
3457
+ ...options.headers
3458
+ }
3235
3459
  });
3236
3460
  };
3237
- exports.getCheckoutStatus = getCheckoutStatus;
3461
+ exports.updateOrgPaymentMethod = updateOrgPaymentMethod;
3238
3462
  /**
3239
- * Get Customer Info
3240
- * Get billing customer information including payment methods on file.
3463
+ * List Organization Subscriptions
3464
+ * List all active and past subscriptions for an organization.
3241
3465
  *
3242
- * Returns customer details, payment methods, and whether invoice billing is enabled.
3466
+ * Includes both graph and repository subscriptions with their status, pricing, and billing information.
3467
+ *
3468
+ * **Requirements:**
3469
+ * - User must be a member of the organization
3243
3470
  */
3244
- const getBillingCustomer = (options) => {
3245
- return (options?.client ?? client_gen_1.client).get({
3471
+ const listOrgSubscriptions = (options) => {
3472
+ return (options.client ?? client_gen_1.client).get({
3246
3473
  security: [
3247
3474
  {
3248
3475
  name: 'X-API-Key',
@@ -3253,19 +3480,20 @@ const getBillingCustomer = (options) => {
3253
3480
  type: 'http'
3254
3481
  }
3255
3482
  ],
3256
- url: '/v1/billing/customer',
3483
+ url: '/v1/billing/subscriptions/{org_id}',
3257
3484
  ...options
3258
3485
  });
3259
3486
  };
3260
- exports.getBillingCustomer = getBillingCustomer;
3487
+ exports.listOrgSubscriptions = listOrgSubscriptions;
3261
3488
  /**
3262
- * Update Default Payment Method
3263
- * Update the default payment method for the customer.
3489
+ * Get Organization Subscription Details
3490
+ * Get detailed information about a specific subscription.
3264
3491
  *
3265
- * This changes which payment method will be used for future subscription charges.
3492
+ * **Requirements:**
3493
+ * - User must be a member of the organization
3266
3494
  */
3267
- const updatePaymentMethod = (options) => {
3268
- return (options.client ?? client_gen_1.client).post({
3495
+ const getOrgSubscription = (options) => {
3496
+ return (options.client ?? client_gen_1.client).get({
3269
3497
  security: [
3270
3498
  {
3271
3499
  name: 'X-API-Key',
@@ -3276,23 +3504,22 @@ const updatePaymentMethod = (options) => {
3276
3504
  type: 'http'
3277
3505
  }
3278
3506
  ],
3279
- url: '/v1/billing/customer/payment-method',
3280
- ...options,
3281
- headers: {
3282
- 'Content-Type': 'application/json',
3283
- ...options.headers
3284
- }
3507
+ url: '/v1/billing/subscriptions/{org_id}/subscription/{subscription_id}',
3508
+ ...options
3285
3509
  });
3286
3510
  };
3287
- exports.updatePaymentMethod = updatePaymentMethod;
3511
+ exports.getOrgSubscription = getOrgSubscription;
3288
3512
  /**
3289
- * List Invoices
3290
- * List payment history and invoices.
3513
+ * Cancel Organization Subscription
3514
+ * Cancel an organization subscription.
3291
3515
  *
3292
- * Returns past invoices with payment status, amounts, and line items.
3516
+ * The subscription will remain active until the end of the current billing period.
3517
+ *
3518
+ * **Requirements:**
3519
+ * - User must be an OWNER of the organization
3293
3520
  */
3294
- const listInvoices = (options) => {
3295
- return (options?.client ?? client_gen_1.client).get({
3521
+ const cancelOrgSubscription = (options) => {
3522
+ return (options.client ?? client_gen_1.client).post({
3296
3523
  security: [
3297
3524
  {
3298
3525
  name: 'X-API-Key',
@@ -3303,19 +3530,23 @@ const listInvoices = (options) => {
3303
3530
  type: 'http'
3304
3531
  }
3305
3532
  ],
3306
- url: '/v1/billing/invoices',
3533
+ url: '/v1/billing/subscriptions/{org_id}/subscription/{subscription_id}/cancel',
3307
3534
  ...options
3308
3535
  });
3309
3536
  };
3310
- exports.listInvoices = listInvoices;
3537
+ exports.cancelOrgSubscription = cancelOrgSubscription;
3311
3538
  /**
3312
- * Get Upcoming Invoice
3313
- * Get preview of the next invoice.
3539
+ * List Organization Invoices
3540
+ * List payment history and invoices for an organization.
3314
3541
  *
3315
- * Returns estimated charges for the next billing period.
3542
+ * Returns past invoices with payment status, amounts, and line items.
3543
+ *
3544
+ * **Requirements:**
3545
+ * - User must be a member of the organization
3546
+ * - Full invoice details are only visible to owners and admins
3316
3547
  */
3317
- const getUpcomingInvoice = (options) => {
3318
- return (options?.client ?? client_gen_1.client).get({
3548
+ const listOrgInvoices = (options) => {
3549
+ return (options.client ?? client_gen_1.client).get({
3319
3550
  security: [
3320
3551
  {
3321
3552
  name: 'X-API-Key',
@@ -3326,19 +3557,23 @@ const getUpcomingInvoice = (options) => {
3326
3557
  type: 'http'
3327
3558
  }
3328
3559
  ],
3329
- url: '/v1/billing/invoices/upcoming',
3560
+ url: '/v1/billing/invoices/{org_id}',
3330
3561
  ...options
3331
3562
  });
3332
3563
  };
3333
- exports.getUpcomingInvoice = getUpcomingInvoice;
3564
+ exports.listOrgInvoices = listOrgInvoices;
3334
3565
  /**
3335
- * List All Subscriptions
3336
- * List all active and past subscriptions for the user.
3566
+ * Get Organization Upcoming Invoice
3567
+ * Get preview of the next invoice for an organization.
3337
3568
  *
3338
- * Includes both graph and repository subscriptions with their status, pricing, and billing information.
3569
+ * Returns estimated charges for the next billing period.
3570
+ *
3571
+ * **Requirements:**
3572
+ * - User must be a member of the organization
3573
+ * - Full invoice details are only visible to owners and admins
3339
3574
  */
3340
- const listSubscriptions = (options) => {
3341
- return (options?.client ?? client_gen_1.client).get({
3575
+ const getOrgUpcomingInvoice = (options) => {
3576
+ return (options.client ?? client_gen_1.client).get({
3342
3577
  security: [
3343
3578
  {
3344
3579
  name: 'X-API-Key',
@@ -3349,17 +3584,33 @@ const listSubscriptions = (options) => {
3349
3584
  type: 'http'
3350
3585
  }
3351
3586
  ],
3352
- url: '/v1/billing/subscriptions',
3587
+ url: '/v1/billing/invoices/{org_id}/upcoming',
3353
3588
  ...options
3354
3589
  });
3355
3590
  };
3356
- exports.listSubscriptions = listSubscriptions;
3591
+ exports.getOrgUpcomingInvoice = getOrgUpcomingInvoice;
3357
3592
  /**
3358
- * Get Subscription Details
3359
- * Get detailed information about a specific subscription.
3593
+ * Create Payment Checkout Session
3594
+ * Create a Stripe checkout session for collecting payment method.
3595
+ *
3596
+ * This endpoint is used when an organization owner needs to add a payment method before
3597
+ * provisioning resources. It creates a pending subscription and redirects
3598
+ * to Stripe Checkout to collect payment details.
3599
+ *
3600
+ * **Flow:**
3601
+ * 1. Owner tries to create a graph but org has no payment method
3602
+ * 2. Frontend calls this endpoint with graph configuration
3603
+ * 3. Backend creates a subscription in PENDING_PAYMENT status for the user's org
3604
+ * 4. Returns Stripe Checkout URL
3605
+ * 5. User completes payment on Stripe
3606
+ * 6. Webhook activates subscription and provisions resource
3607
+ *
3608
+ * **Requirements:**
3609
+ * - User must be an OWNER of their organization
3610
+ * - Enterprise customers (with invoice_billing_enabled) should not call this endpoint.
3360
3611
  */
3361
- const getSubscription = (options) => {
3362
- return (options.client ?? client_gen_1.client).get({
3612
+ const createCheckoutSession = (options) => {
3613
+ return (options.client ?? client_gen_1.client).post({
3363
3614
  security: [
3364
3615
  {
3365
3616
  name: 'X-API-Key',
@@ -3370,19 +3621,34 @@ const getSubscription = (options) => {
3370
3621
  type: 'http'
3371
3622
  }
3372
3623
  ],
3373
- url: '/v1/billing/subscriptions/{subscription_id}',
3374
- ...options
3624
+ url: '/v1/billing/checkout',
3625
+ ...options,
3626
+ headers: {
3627
+ 'Content-Type': 'application/json',
3628
+ ...options.headers
3629
+ }
3375
3630
  });
3376
3631
  };
3377
- exports.getSubscription = getSubscription;
3632
+ exports.createCheckoutSession = createCheckoutSession;
3378
3633
  /**
3379
- * Cancel Subscription
3380
- * Cancel a subscription.
3634
+ * Get Checkout Session Status
3635
+ * Poll the status of a checkout session.
3381
3636
  *
3382
- * The subscription will remain active until the end of the current billing period.
3637
+ * Frontend should poll this endpoint after user returns from Stripe Checkout
3638
+ * to determine when the resource is ready.
3639
+ *
3640
+ * **Status Values:**
3641
+ * - `pending_payment`: Waiting for payment to complete
3642
+ * - `provisioning`: Payment confirmed, resource being created
3643
+ * - `completed`: Resource is ready (resource_id will be set)
3644
+ * - `failed`: Something went wrong (error field will be set)
3645
+ *
3646
+ * **When status is 'completed':**
3647
+ * - For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE progress
3648
+ * - For repositories: `resource_id` will be the repository name and access is immediately available
3383
3649
  */
3384
- const cancelSubscription2 = (options) => {
3385
- return (options.client ?? client_gen_1.client).post({
3650
+ const getCheckoutStatus = (options) => {
3651
+ return (options.client ?? client_gen_1.client).get({
3386
3652
  security: [
3387
3653
  {
3388
3654
  name: 'X-API-Key',
@@ -3393,8 +3659,8 @@ const cancelSubscription2 = (options) => {
3393
3659
  type: 'http'
3394
3660
  }
3395
3661
  ],
3396
- url: '/v1/billing/subscriptions/{subscription_id}/cancel',
3662
+ url: '/v1/billing/checkout/{session_id}/status',
3397
3663
  ...options
3398
3664
  });
3399
3665
  };
3400
- exports.cancelSubscription2 = cancelSubscription2;
3666
+ exports.getCheckoutStatus = getCheckoutStatus;