@robosystems/client 0.2.9 → 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/package.json +1 -1
- package/sdk/sdk.gen.d.ts +181 -8
- package/sdk/sdk.gen.js +513 -11
- package/sdk/sdk.gen.ts +511 -10
- package/sdk/types.gen.d.ts +1320 -209
- package/sdk/types.gen.ts +1412 -183
- package/sdk.gen.d.ts +181 -8
- package/sdk.gen.js +513 -11
- package/sdk.gen.ts +511 -10
- package/types.gen.d.ts +1320 -209
- package/types.gen.ts +1412 -183
package/sdk/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.
|
|
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.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.
|
|
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
|
-
*
|
|
391
|
-
*
|
|
395
|
+
* List User's Organizations
|
|
396
|
+
* Get all organizations the current user belongs to, with their role in each.
|
|
392
397
|
*/
|
|
393
|
-
const
|
|
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/
|
|
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',
|
|
503
|
+
...options
|
|
504
|
+
});
|
|
505
|
+
};
|
|
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',
|
|
406
524
|
...options
|
|
407
525
|
});
|
|
408
526
|
};
|
|
409
|
-
exports.
|
|
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
|
|
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
|
|
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
|
|
@@ -3162,3 +3402,265 @@ const cancelOperation = (options) => {
|
|
|
3162
3402
|
});
|
|
3163
3403
|
};
|
|
3164
3404
|
exports.cancelOperation = cancelOperation;
|
|
3405
|
+
/**
|
|
3406
|
+
* Get Organization Customer Info
|
|
3407
|
+
* Get billing customer information for an organization including payment methods on file.
|
|
3408
|
+
*
|
|
3409
|
+
* Returns customer details, payment methods, and whether invoice billing is enabled.
|
|
3410
|
+
*
|
|
3411
|
+
* **Requirements:**
|
|
3412
|
+
* - User must be a member of the organization
|
|
3413
|
+
* - Sensitive payment details are only visible to owners
|
|
3414
|
+
*/
|
|
3415
|
+
const getOrgBillingCustomer = (options) => {
|
|
3416
|
+
return (options.client ?? client_gen_1.client).get({
|
|
3417
|
+
security: [
|
|
3418
|
+
{
|
|
3419
|
+
name: 'X-API-Key',
|
|
3420
|
+
type: 'apiKey'
|
|
3421
|
+
},
|
|
3422
|
+
{
|
|
3423
|
+
scheme: 'bearer',
|
|
3424
|
+
type: 'http'
|
|
3425
|
+
}
|
|
3426
|
+
],
|
|
3427
|
+
url: '/v1/billing/customer/{org_id}',
|
|
3428
|
+
...options
|
|
3429
|
+
});
|
|
3430
|
+
};
|
|
3431
|
+
exports.getOrgBillingCustomer = getOrgBillingCustomer;
|
|
3432
|
+
/**
|
|
3433
|
+
* Update Organization Default Payment Method
|
|
3434
|
+
* Update the default payment method for the organization.
|
|
3435
|
+
*
|
|
3436
|
+
* This changes which payment method will be used for future subscription charges.
|
|
3437
|
+
*
|
|
3438
|
+
* **Requirements:**
|
|
3439
|
+
* - User must be an OWNER of the organization
|
|
3440
|
+
*/
|
|
3441
|
+
const updateOrgPaymentMethod = (options) => {
|
|
3442
|
+
return (options.client ?? client_gen_1.client).post({
|
|
3443
|
+
security: [
|
|
3444
|
+
{
|
|
3445
|
+
name: 'X-API-Key',
|
|
3446
|
+
type: 'apiKey'
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
scheme: 'bearer',
|
|
3450
|
+
type: 'http'
|
|
3451
|
+
}
|
|
3452
|
+
],
|
|
3453
|
+
url: '/v1/billing/customer/{org_id}/payment-method',
|
|
3454
|
+
...options,
|
|
3455
|
+
headers: {
|
|
3456
|
+
'Content-Type': 'application/json',
|
|
3457
|
+
...options.headers
|
|
3458
|
+
}
|
|
3459
|
+
});
|
|
3460
|
+
};
|
|
3461
|
+
exports.updateOrgPaymentMethod = updateOrgPaymentMethod;
|
|
3462
|
+
/**
|
|
3463
|
+
* List Organization Subscriptions
|
|
3464
|
+
* List all active and past subscriptions for an organization.
|
|
3465
|
+
*
|
|
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
|
|
3470
|
+
*/
|
|
3471
|
+
const listOrgSubscriptions = (options) => {
|
|
3472
|
+
return (options.client ?? client_gen_1.client).get({
|
|
3473
|
+
security: [
|
|
3474
|
+
{
|
|
3475
|
+
name: 'X-API-Key',
|
|
3476
|
+
type: 'apiKey'
|
|
3477
|
+
},
|
|
3478
|
+
{
|
|
3479
|
+
scheme: 'bearer',
|
|
3480
|
+
type: 'http'
|
|
3481
|
+
}
|
|
3482
|
+
],
|
|
3483
|
+
url: '/v1/billing/subscriptions/{org_id}',
|
|
3484
|
+
...options
|
|
3485
|
+
});
|
|
3486
|
+
};
|
|
3487
|
+
exports.listOrgSubscriptions = listOrgSubscriptions;
|
|
3488
|
+
/**
|
|
3489
|
+
* Get Organization Subscription Details
|
|
3490
|
+
* Get detailed information about a specific subscription.
|
|
3491
|
+
*
|
|
3492
|
+
* **Requirements:**
|
|
3493
|
+
* - User must be a member of the organization
|
|
3494
|
+
*/
|
|
3495
|
+
const getOrgSubscription = (options) => {
|
|
3496
|
+
return (options.client ?? client_gen_1.client).get({
|
|
3497
|
+
security: [
|
|
3498
|
+
{
|
|
3499
|
+
name: 'X-API-Key',
|
|
3500
|
+
type: 'apiKey'
|
|
3501
|
+
},
|
|
3502
|
+
{
|
|
3503
|
+
scheme: 'bearer',
|
|
3504
|
+
type: 'http'
|
|
3505
|
+
}
|
|
3506
|
+
],
|
|
3507
|
+
url: '/v1/billing/subscriptions/{org_id}/subscription/{subscription_id}',
|
|
3508
|
+
...options
|
|
3509
|
+
});
|
|
3510
|
+
};
|
|
3511
|
+
exports.getOrgSubscription = getOrgSubscription;
|
|
3512
|
+
/**
|
|
3513
|
+
* Cancel Organization Subscription
|
|
3514
|
+
* Cancel an organization subscription.
|
|
3515
|
+
*
|
|
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
|
|
3520
|
+
*/
|
|
3521
|
+
const cancelOrgSubscription = (options) => {
|
|
3522
|
+
return (options.client ?? client_gen_1.client).post({
|
|
3523
|
+
security: [
|
|
3524
|
+
{
|
|
3525
|
+
name: 'X-API-Key',
|
|
3526
|
+
type: 'apiKey'
|
|
3527
|
+
},
|
|
3528
|
+
{
|
|
3529
|
+
scheme: 'bearer',
|
|
3530
|
+
type: 'http'
|
|
3531
|
+
}
|
|
3532
|
+
],
|
|
3533
|
+
url: '/v1/billing/subscriptions/{org_id}/subscription/{subscription_id}/cancel',
|
|
3534
|
+
...options
|
|
3535
|
+
});
|
|
3536
|
+
};
|
|
3537
|
+
exports.cancelOrgSubscription = cancelOrgSubscription;
|
|
3538
|
+
/**
|
|
3539
|
+
* List Organization Invoices
|
|
3540
|
+
* List payment history and invoices for an organization.
|
|
3541
|
+
*
|
|
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
|
|
3547
|
+
*/
|
|
3548
|
+
const listOrgInvoices = (options) => {
|
|
3549
|
+
return (options.client ?? client_gen_1.client).get({
|
|
3550
|
+
security: [
|
|
3551
|
+
{
|
|
3552
|
+
name: 'X-API-Key',
|
|
3553
|
+
type: 'apiKey'
|
|
3554
|
+
},
|
|
3555
|
+
{
|
|
3556
|
+
scheme: 'bearer',
|
|
3557
|
+
type: 'http'
|
|
3558
|
+
}
|
|
3559
|
+
],
|
|
3560
|
+
url: '/v1/billing/invoices/{org_id}',
|
|
3561
|
+
...options
|
|
3562
|
+
});
|
|
3563
|
+
};
|
|
3564
|
+
exports.listOrgInvoices = listOrgInvoices;
|
|
3565
|
+
/**
|
|
3566
|
+
* Get Organization Upcoming Invoice
|
|
3567
|
+
* Get preview of the next invoice for an organization.
|
|
3568
|
+
*
|
|
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
|
|
3574
|
+
*/
|
|
3575
|
+
const getOrgUpcomingInvoice = (options) => {
|
|
3576
|
+
return (options.client ?? client_gen_1.client).get({
|
|
3577
|
+
security: [
|
|
3578
|
+
{
|
|
3579
|
+
name: 'X-API-Key',
|
|
3580
|
+
type: 'apiKey'
|
|
3581
|
+
},
|
|
3582
|
+
{
|
|
3583
|
+
scheme: 'bearer',
|
|
3584
|
+
type: 'http'
|
|
3585
|
+
}
|
|
3586
|
+
],
|
|
3587
|
+
url: '/v1/billing/invoices/{org_id}/upcoming',
|
|
3588
|
+
...options
|
|
3589
|
+
});
|
|
3590
|
+
};
|
|
3591
|
+
exports.getOrgUpcomingInvoice = getOrgUpcomingInvoice;
|
|
3592
|
+
/**
|
|
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.
|
|
3611
|
+
*/
|
|
3612
|
+
const createCheckoutSession = (options) => {
|
|
3613
|
+
return (options.client ?? client_gen_1.client).post({
|
|
3614
|
+
security: [
|
|
3615
|
+
{
|
|
3616
|
+
name: 'X-API-Key',
|
|
3617
|
+
type: 'apiKey'
|
|
3618
|
+
},
|
|
3619
|
+
{
|
|
3620
|
+
scheme: 'bearer',
|
|
3621
|
+
type: 'http'
|
|
3622
|
+
}
|
|
3623
|
+
],
|
|
3624
|
+
url: '/v1/billing/checkout',
|
|
3625
|
+
...options,
|
|
3626
|
+
headers: {
|
|
3627
|
+
'Content-Type': 'application/json',
|
|
3628
|
+
...options.headers
|
|
3629
|
+
}
|
|
3630
|
+
});
|
|
3631
|
+
};
|
|
3632
|
+
exports.createCheckoutSession = createCheckoutSession;
|
|
3633
|
+
/**
|
|
3634
|
+
* Get Checkout Session Status
|
|
3635
|
+
* Poll the status of a checkout session.
|
|
3636
|
+
*
|
|
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
|
|
3649
|
+
*/
|
|
3650
|
+
const getCheckoutStatus = (options) => {
|
|
3651
|
+
return (options.client ?? client_gen_1.client).get({
|
|
3652
|
+
security: [
|
|
3653
|
+
{
|
|
3654
|
+
name: 'X-API-Key',
|
|
3655
|
+
type: 'apiKey'
|
|
3656
|
+
},
|
|
3657
|
+
{
|
|
3658
|
+
scheme: 'bearer',
|
|
3659
|
+
type: 'http'
|
|
3660
|
+
}
|
|
3661
|
+
],
|
|
3662
|
+
url: '/v1/billing/checkout/{session_id}/status',
|
|
3663
|
+
...options
|
|
3664
|
+
});
|
|
3665
|
+
};
|
|
3666
|
+
exports.getCheckoutStatus = getCheckoutStatus;
|