@robosystems/client 0.2.10 → 0.2.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.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated by @hey-api/openapi-ts
2
2
 
3
3
  import type { Options as ClientOptions, TDataShape, Client } from './client';
4
- import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, LogoutUserData, LogoutUserResponses, GetCurrentAuthUserData, GetCurrentAuthUserResponses, GetCurrentAuthUserErrors, RefreshAuthSessionData, RefreshAuthSessionResponses, RefreshAuthSessionErrors, ResendVerificationEmailData, ResendVerificationEmailResponses, ResendVerificationEmailErrors, VerifyEmailData, VerifyEmailResponses, VerifyEmailErrors, GetPasswordPolicyData, GetPasswordPolicyResponses, CheckPasswordStrengthData, CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, ForgotPasswordData, ForgotPasswordResponses, ForgotPasswordErrors, ValidateResetTokenData, ValidateResetTokenResponses, ValidateResetTokenErrors, ResetPasswordData, ResetPasswordResponses, ResetPasswordErrors, GenerateSsoTokenData, GenerateSsoTokenResponses, GenerateSsoTokenErrors, SsoTokenExchangeData, SsoTokenExchangeResponses, SsoTokenExchangeErrors, CompleteSsoAuthData, CompleteSsoAuthResponses, CompleteSsoAuthErrors, GetCaptchaConfigData, GetCaptchaConfigResponses, GetServiceStatusData, GetServiceStatusResponses, GetCurrentUserData, GetCurrentUserResponses, UpdateUserData, UpdateUserResponses, UpdateUserErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, GetUserLimitsData, GetUserLimitsResponses, ListConnectionsData, ListConnectionsResponses, ListConnectionsErrors, CreateConnectionData, CreateConnectionResponses, CreateConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsResponses, GetConnectionOptionsErrors, ExchangeLinkTokenData, ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, CreateLinkTokenData, CreateLinkTokenResponses, CreateLinkTokenErrors, InitOAuthData, InitOAuthResponses, InitOAuthErrors, OauthCallbackData, OauthCallbackResponses, OauthCallbackErrors, DeleteConnectionData, DeleteConnectionResponses, DeleteConnectionErrors, GetConnectionData, GetConnectionResponses, GetConnectionErrors, SyncConnectionData, SyncConnectionResponses, SyncConnectionErrors, AutoSelectAgentData, AutoSelectAgentResponses, AutoSelectAgentErrors, ExecuteSpecificAgentData, ExecuteSpecificAgentResponses, ExecuteSpecificAgentErrors, BatchProcessQueriesData, BatchProcessQueriesResponses, BatchProcessQueriesErrors, ListAgentsData, ListAgentsResponses, ListAgentsErrors, GetAgentMetadataData, GetAgentMetadataResponses, GetAgentMetadataErrors, RecommendAgentData, RecommendAgentResponses, RecommendAgentErrors, ListMcpToolsData, ListMcpToolsResponses, ListMcpToolsErrors, CallMcpToolData, CallMcpToolResponses, CallMcpToolErrors, ListBackupsData, ListBackupsResponses, ListBackupsErrors, CreateBackupData, CreateBackupResponses, CreateBackupErrors, GetBackupDownloadUrlData, GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, RestoreBackupData, RestoreBackupResponses, RestoreBackupErrors, GetBackupStatsData, GetBackupStatsResponses, GetBackupStatsErrors, GetGraphMetricsData, GetGraphMetricsResponses, GetGraphMetricsErrors, GetGraphUsageAnalyticsData, GetGraphUsageAnalyticsResponses, GetGraphUsageAnalyticsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaData, GetGraphSchemaResponses, GetGraphSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, GetCreditSummaryData, GetCreditSummaryResponses, GetCreditSummaryErrors, ListCreditTransactionsData, ListCreditTransactionsResponses, ListCreditTransactionsErrors, CheckCreditBalanceData, CheckCreditBalanceResponses, CheckCreditBalanceErrors, GetStorageUsageData, GetStorageUsageResponses, GetStorageUsageErrors, CheckStorageLimitsData, CheckStorageLimitsResponses, CheckStorageLimitsErrors, GetDatabaseHealthData, GetDatabaseHealthResponses, GetDatabaseHealthErrors, GetDatabaseInfoData, GetDatabaseInfoResponses, GetDatabaseInfoErrors, GetGraphLimitsData, GetGraphLimitsResponses, GetGraphLimitsErrors, ListSubgraphsData, ListSubgraphsResponses, ListSubgraphsErrors, CreateSubgraphData, CreateSubgraphResponses, CreateSubgraphErrors, DeleteSubgraphData, DeleteSubgraphResponses, DeleteSubgraphErrors, GetSubgraphInfoData, GetSubgraphInfoResponses, GetSubgraphInfoErrors, GetSubgraphQuotaData, GetSubgraphQuotaResponses, GetSubgraphQuotaErrors, CancelSubscriptionData, CancelSubscriptionResponses, CancelSubscriptionErrors, GetGraphSubscriptionData, GetGraphSubscriptionResponses, GetGraphSubscriptionErrors, CreateRepositorySubscriptionData, CreateRepositorySubscriptionResponses, CreateRepositorySubscriptionErrors, UpgradeSubscriptionData, UpgradeSubscriptionResponses, UpgradeSubscriptionErrors, ListTablesData, ListTablesResponses, ListTablesErrors, ListTableFilesData, ListTableFilesResponses, ListTableFilesErrors, GetUploadUrlData, GetUploadUrlResponses, GetUploadUrlErrors, DeleteFileData, DeleteFileResponses, DeleteFileErrors, GetFileInfoData, GetFileInfoResponses, GetFileInfoErrors, UpdateFileStatusData, UpdateFileStatusResponses, UpdateFileStatusErrors, IngestTablesData, IngestTablesResponses, IngestTablesErrors, QueryTablesData, QueryTablesResponses, QueryTablesErrors, GetGraphsData, GetGraphsResponses, GetGraphsErrors, CreateGraphData, CreateGraphResponses, CreateGraphErrors, GetAvailableExtensionsData, GetAvailableExtensionsResponses, GetAvailableExtensionsErrors, GetAvailableGraphTiersData, GetAvailableGraphTiersResponses, GetAvailableGraphTiersErrors, SelectGraphData, SelectGraphResponses, SelectGraphErrors, GetServiceOfferingsData, GetServiceOfferingsResponses, GetServiceOfferingsErrors, StreamOperationEventsData, StreamOperationEventsResponses, StreamOperationEventsErrors, GetOperationStatusData, GetOperationStatusResponses, GetOperationStatusErrors, CancelOperationData, CancelOperationResponses, CancelOperationErrors, CreateCheckoutSessionData, CreateCheckoutSessionResponses, CreateCheckoutSessionErrors, GetCheckoutStatusData, GetCheckoutStatusResponses, GetCheckoutStatusErrors, GetBillingCustomerData, GetBillingCustomerResponses, UpdatePaymentMethodData, UpdatePaymentMethodResponses, UpdatePaymentMethodErrors, ListInvoicesData, ListInvoicesResponses, ListInvoicesErrors, GetUpcomingInvoiceData, GetUpcomingInvoiceResponses, ListSubscriptionsData, ListSubscriptionsResponses, GetSubscriptionData, GetSubscriptionResponses, GetSubscriptionErrors, CancelSubscription2Data, CancelSubscription2Responses, CancelSubscription2Errors } from './types.gen';
4
+ import type { RegisterUserData, RegisterUserResponses, RegisterUserErrors, LoginUserData, LoginUserResponses, LoginUserErrors, LogoutUserData, LogoutUserResponses, GetCurrentAuthUserData, GetCurrentAuthUserResponses, GetCurrentAuthUserErrors, RefreshAuthSessionData, RefreshAuthSessionResponses, RefreshAuthSessionErrors, ResendVerificationEmailData, ResendVerificationEmailResponses, ResendVerificationEmailErrors, VerifyEmailData, VerifyEmailResponses, VerifyEmailErrors, GetPasswordPolicyData, GetPasswordPolicyResponses, CheckPasswordStrengthData, CheckPasswordStrengthResponses, CheckPasswordStrengthErrors, ForgotPasswordData, ForgotPasswordResponses, ForgotPasswordErrors, ValidateResetTokenData, ValidateResetTokenResponses, ValidateResetTokenErrors, ResetPasswordData, ResetPasswordResponses, ResetPasswordErrors, GenerateSsoTokenData, GenerateSsoTokenResponses, GenerateSsoTokenErrors, SsoTokenExchangeData, SsoTokenExchangeResponses, SsoTokenExchangeErrors, CompleteSsoAuthData, CompleteSsoAuthResponses, CompleteSsoAuthErrors, GetCaptchaConfigData, GetCaptchaConfigResponses, GetServiceStatusData, GetServiceStatusResponses, GetCurrentUserData, GetCurrentUserResponses, UpdateUserData, UpdateUserResponses, UpdateUserErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, ListUserOrgsData, ListUserOrgsResponses, CreateOrgData, CreateOrgResponses, CreateOrgErrors, GetOrgData, GetOrgResponses, GetOrgErrors, UpdateOrgData, UpdateOrgResponses, UpdateOrgErrors, ListOrgGraphsData, ListOrgGraphsResponses, ListOrgGraphsErrors, ListOrgMembersData, ListOrgMembersResponses, ListOrgMembersErrors, InviteOrgMemberData, InviteOrgMemberResponses, InviteOrgMemberErrors, RemoveOrgMemberData, RemoveOrgMemberResponses, RemoveOrgMemberErrors, UpdateOrgMemberRoleData, UpdateOrgMemberRoleResponses, UpdateOrgMemberRoleErrors, GetOrgLimitsData, GetOrgLimitsResponses, GetOrgLimitsErrors, GetOrgUsageData, GetOrgUsageResponses, GetOrgUsageErrors, ListConnectionsData, ListConnectionsResponses, ListConnectionsErrors, CreateConnectionData, CreateConnectionResponses, CreateConnectionErrors, GetConnectionOptionsData, GetConnectionOptionsResponses, GetConnectionOptionsErrors, ExchangeLinkTokenData, ExchangeLinkTokenResponses, ExchangeLinkTokenErrors, CreateLinkTokenData, CreateLinkTokenResponses, CreateLinkTokenErrors, InitOAuthData, InitOAuthResponses, InitOAuthErrors, OauthCallbackData, OauthCallbackResponses, OauthCallbackErrors, DeleteConnectionData, DeleteConnectionResponses, DeleteConnectionErrors, GetConnectionData, GetConnectionResponses, GetConnectionErrors, SyncConnectionData, SyncConnectionResponses, SyncConnectionErrors, ListAgentsData, ListAgentsResponses, ListAgentsErrors, AutoSelectAgentData, AutoSelectAgentResponses, AutoSelectAgentErrors, GetAgentMetadataData, GetAgentMetadataResponses, GetAgentMetadataErrors, ExecuteSpecificAgentData, ExecuteSpecificAgentResponses, ExecuteSpecificAgentErrors, BatchProcessQueriesData, BatchProcessQueriesResponses, BatchProcessQueriesErrors, RecommendAgentData, RecommendAgentResponses, RecommendAgentErrors, ListMcpToolsData, ListMcpToolsResponses, ListMcpToolsErrors, CallMcpToolData, CallMcpToolResponses, CallMcpToolErrors, ListBackupsData, ListBackupsResponses, ListBackupsErrors, CreateBackupData, CreateBackupResponses, CreateBackupErrors, GetBackupDownloadUrlData, GetBackupDownloadUrlResponses, GetBackupDownloadUrlErrors, RestoreBackupData, RestoreBackupResponses, RestoreBackupErrors, GetBackupStatsData, GetBackupStatsResponses, GetBackupStatsErrors, GetGraphMetricsData, GetGraphMetricsResponses, GetGraphMetricsErrors, GetGraphUsageAnalyticsData, GetGraphUsageAnalyticsResponses, GetGraphUsageAnalyticsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaData, GetGraphSchemaResponses, GetGraphSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, GetCreditSummaryData, GetCreditSummaryResponses, GetCreditSummaryErrors, ListCreditTransactionsData, ListCreditTransactionsResponses, ListCreditTransactionsErrors, CheckCreditBalanceData, CheckCreditBalanceResponses, CheckCreditBalanceErrors, GetStorageUsageData, GetStorageUsageResponses, GetStorageUsageErrors, CheckStorageLimitsData, CheckStorageLimitsResponses, CheckStorageLimitsErrors, GetDatabaseHealthData, GetDatabaseHealthResponses, GetDatabaseHealthErrors, GetDatabaseInfoData, GetDatabaseInfoResponses, GetDatabaseInfoErrors, GetGraphLimitsData, GetGraphLimitsResponses, GetGraphLimitsErrors, ListSubgraphsData, ListSubgraphsResponses, ListSubgraphsErrors, CreateSubgraphData, CreateSubgraphResponses, CreateSubgraphErrors, DeleteSubgraphData, DeleteSubgraphResponses, DeleteSubgraphErrors, GetSubgraphInfoData, GetSubgraphInfoResponses, GetSubgraphInfoErrors, GetSubgraphQuotaData, GetSubgraphQuotaResponses, GetSubgraphQuotaErrors, CancelSubscriptionData, CancelSubscriptionResponses, CancelSubscriptionErrors, GetGraphSubscriptionData, GetGraphSubscriptionResponses, GetGraphSubscriptionErrors, CreateRepositorySubscriptionData, CreateRepositorySubscriptionResponses, CreateRepositorySubscriptionErrors, UpgradeSubscriptionData, UpgradeSubscriptionResponses, UpgradeSubscriptionErrors, ListTablesData, ListTablesResponses, ListTablesErrors, ListTableFilesData, ListTableFilesResponses, ListTableFilesErrors, GetUploadUrlData, GetUploadUrlResponses, GetUploadUrlErrors, DeleteFileData, DeleteFileResponses, DeleteFileErrors, GetFileInfoData, GetFileInfoResponses, GetFileInfoErrors, UpdateFileStatusData, UpdateFileStatusResponses, UpdateFileStatusErrors, IngestTablesData, IngestTablesResponses, IngestTablesErrors, QueryTablesData, QueryTablesResponses, QueryTablesErrors, GetGraphsData, GetGraphsResponses, GetGraphsErrors, CreateGraphData, CreateGraphResponses, CreateGraphErrors, GetAvailableExtensionsData, GetAvailableExtensionsResponses, GetAvailableExtensionsErrors, GetAvailableGraphTiersData, GetAvailableGraphTiersResponses, GetAvailableGraphTiersErrors, SelectGraphData, SelectGraphResponses, SelectGraphErrors, GetServiceOfferingsData, GetServiceOfferingsResponses, GetServiceOfferingsErrors, StreamOperationEventsData, StreamOperationEventsResponses, StreamOperationEventsErrors, GetOperationStatusData, GetOperationStatusResponses, GetOperationStatusErrors, CancelOperationData, CancelOperationResponses, CancelOperationErrors, GetOrgBillingCustomerData, GetOrgBillingCustomerResponses, GetOrgBillingCustomerErrors, UpdateOrgPaymentMethodData, UpdateOrgPaymentMethodResponses, UpdateOrgPaymentMethodErrors, ListOrgSubscriptionsData, ListOrgSubscriptionsResponses, ListOrgSubscriptionsErrors, GetOrgSubscriptionData, GetOrgSubscriptionResponses, GetOrgSubscriptionErrors, CancelOrgSubscriptionData, CancelOrgSubscriptionResponses, CancelOrgSubscriptionErrors, ListOrgInvoicesData, ListOrgInvoicesResponses, ListOrgInvoicesErrors, GetOrgUpcomingInvoiceData, GetOrgUpcomingInvoiceResponses, GetOrgUpcomingInvoiceErrors, CreateCheckoutSessionData, CreateCheckoutSessionResponses, CreateCheckoutSessionErrors, GetCheckoutStatusData, GetCheckoutStatusResponses, GetCheckoutStatusErrors } from './types.gen';
5
5
  import { client as _heyApiClient } from './client.gen';
6
6
 
7
7
  export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
@@ -20,7 +20,11 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
20
20
 
21
21
  /**
22
22
  * Register New User
23
- * 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.
23
+ * Register a new user account with email and password.
24
+ *
25
+ * **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.
26
+ *
27
+ * **Security Controls**: CAPTCHA and email verification are disabled in development for API testing, but required in production.
24
28
  */
25
29
  export const registerUser = <ThrowOnError extends boolean = false>(options: Options<RegisterUserData, ThrowOnError>) => {
26
30
  return (options.client ?? _heyApiClient).post<RegisterUserResponses, RegisterUserErrors, ThrowOnError>({
@@ -401,11 +405,124 @@ export const updateUserApiKey = <ThrowOnError extends boolean = false>(options:
401
405
  };
402
406
 
403
407
  /**
404
- * Get user limits and usage
405
- * Retrieve current limits and usage statistics for the authenticated user (simple safety valve for graph creation)
408
+ * List User's Organizations
409
+ * Get all organizations the current user belongs to, with their role in each.
410
+ */
411
+ export const listUserOrgs = <ThrowOnError extends boolean = false>(options?: Options<ListUserOrgsData, ThrowOnError>) => {
412
+ return (options?.client ?? _heyApiClient).get<ListUserOrgsResponses, unknown, ThrowOnError>({
413
+ security: [
414
+ {
415
+ name: 'X-API-Key',
416
+ type: 'apiKey'
417
+ },
418
+ {
419
+ scheme: 'bearer',
420
+ type: 'http'
421
+ }
422
+ ],
423
+ url: '/v1/orgs',
424
+ ...options
425
+ });
426
+ };
427
+
428
+ /**
429
+ * Create Organization
430
+ * Create a new organization. The creating user becomes the owner.
431
+ */
432
+ export const createOrg = <ThrowOnError extends boolean = false>(options: Options<CreateOrgData, ThrowOnError>) => {
433
+ return (options.client ?? _heyApiClient).post<CreateOrgResponses, CreateOrgErrors, ThrowOnError>({
434
+ security: [
435
+ {
436
+ name: 'X-API-Key',
437
+ type: 'apiKey'
438
+ },
439
+ {
440
+ scheme: 'bearer',
441
+ type: 'http'
442
+ }
443
+ ],
444
+ url: '/v1/orgs',
445
+ ...options,
446
+ headers: {
447
+ 'Content-Type': 'application/json',
448
+ ...options.headers
449
+ }
450
+ });
451
+ };
452
+
453
+ /**
454
+ * Get Organization
455
+ * Get detailed information about an organization.
456
+ */
457
+ export const getOrg = <ThrowOnError extends boolean = false>(options: Options<GetOrgData, ThrowOnError>) => {
458
+ return (options.client ?? _heyApiClient).get<GetOrgResponses, GetOrgErrors, ThrowOnError>({
459
+ security: [
460
+ {
461
+ name: 'X-API-Key',
462
+ type: 'apiKey'
463
+ },
464
+ {
465
+ scheme: 'bearer',
466
+ type: 'http'
467
+ }
468
+ ],
469
+ url: '/v1/orgs/{org_id}',
470
+ ...options
471
+ });
472
+ };
473
+
474
+ /**
475
+ * Update Organization
476
+ * Update organization information. Requires admin or owner role.
477
+ */
478
+ export const updateOrg = <ThrowOnError extends boolean = false>(options: Options<UpdateOrgData, ThrowOnError>) => {
479
+ return (options.client ?? _heyApiClient).put<UpdateOrgResponses, UpdateOrgErrors, ThrowOnError>({
480
+ security: [
481
+ {
482
+ name: 'X-API-Key',
483
+ type: 'apiKey'
484
+ },
485
+ {
486
+ scheme: 'bearer',
487
+ type: 'http'
488
+ }
489
+ ],
490
+ url: '/v1/orgs/{org_id}',
491
+ ...options,
492
+ headers: {
493
+ 'Content-Type': 'application/json',
494
+ ...options.headers
495
+ }
496
+ });
497
+ };
498
+
499
+ /**
500
+ * List Organization Graphs
501
+ * Get all graphs belonging to an organization.
502
+ */
503
+ export const listOrgGraphs = <ThrowOnError extends boolean = false>(options: Options<ListOrgGraphsData, ThrowOnError>) => {
504
+ return (options.client ?? _heyApiClient).get<ListOrgGraphsResponses, ListOrgGraphsErrors, ThrowOnError>({
505
+ security: [
506
+ {
507
+ name: 'X-API-Key',
508
+ type: 'apiKey'
509
+ },
510
+ {
511
+ scheme: 'bearer',
512
+ type: 'http'
513
+ }
514
+ ],
515
+ url: '/v1/orgs/{org_id}/graphs',
516
+ ...options
517
+ });
518
+ };
519
+
520
+ /**
521
+ * List Organization Members
522
+ * Get all members of an organization with their roles.
406
523
  */
407
- export const getUserLimits = <ThrowOnError extends boolean = false>(options?: Options<GetUserLimitsData, ThrowOnError>) => {
408
- return (options?.client ?? _heyApiClient).get<GetUserLimitsResponses, unknown, ThrowOnError>({
524
+ export const listOrgMembers = <ThrowOnError extends boolean = false>(options: Options<ListOrgMembersData, ThrowOnError>) => {
525
+ return (options.client ?? _heyApiClient).get<ListOrgMembersResponses, ListOrgMembersErrors, ThrowOnError>({
409
526
  security: [
410
527
  {
411
528
  name: 'X-API-Key',
@@ -416,7 +533,123 @@ export const getUserLimits = <ThrowOnError extends boolean = false>(options?: Op
416
533
  type: 'http'
417
534
  }
418
535
  ],
419
- url: '/v1/user/limits',
536
+ url: '/v1/orgs/{org_id}/members',
537
+ ...options
538
+ });
539
+ };
540
+
541
+ /**
542
+ * Invite Member
543
+ * Invite a user to join the organization. Requires admin or owner role.
544
+ *
545
+ * **⚠️ FEATURE NOT READY**: This endpoint is disabled by default (ORG_MEMBER_INVITATIONS_ENABLED=false).
546
+ * Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before enabling.
547
+ */
548
+ export const inviteOrgMember = <ThrowOnError extends boolean = false>(options: Options<InviteOrgMemberData, ThrowOnError>) => {
549
+ return (options.client ?? _heyApiClient).post<InviteOrgMemberResponses, InviteOrgMemberErrors, ThrowOnError>({
550
+ security: [
551
+ {
552
+ name: 'X-API-Key',
553
+ type: 'apiKey'
554
+ },
555
+ {
556
+ scheme: 'bearer',
557
+ type: 'http'
558
+ }
559
+ ],
560
+ url: '/v1/orgs/{org_id}/members',
561
+ ...options,
562
+ headers: {
563
+ 'Content-Type': 'application/json',
564
+ ...options.headers
565
+ }
566
+ });
567
+ };
568
+
569
+ /**
570
+ * Remove Member
571
+ * Remove a member from the organization. Requires admin or owner role.
572
+ */
573
+ export const removeOrgMember = <ThrowOnError extends boolean = false>(options: Options<RemoveOrgMemberData, ThrowOnError>) => {
574
+ return (options.client ?? _heyApiClient).delete<RemoveOrgMemberResponses, RemoveOrgMemberErrors, ThrowOnError>({
575
+ security: [
576
+ {
577
+ name: 'X-API-Key',
578
+ type: 'apiKey'
579
+ },
580
+ {
581
+ scheme: 'bearer',
582
+ type: 'http'
583
+ }
584
+ ],
585
+ url: '/v1/orgs/{org_id}/members/{user_id}',
586
+ ...options
587
+ });
588
+ };
589
+
590
+ /**
591
+ * Update Member Role
592
+ * Update a member's role in the organization. Requires admin or owner role.
593
+ */
594
+ export const updateOrgMemberRole = <ThrowOnError extends boolean = false>(options: Options<UpdateOrgMemberRoleData, ThrowOnError>) => {
595
+ return (options.client ?? _heyApiClient).put<UpdateOrgMemberRoleResponses, UpdateOrgMemberRoleErrors, ThrowOnError>({
596
+ security: [
597
+ {
598
+ name: 'X-API-Key',
599
+ type: 'apiKey'
600
+ },
601
+ {
602
+ scheme: 'bearer',
603
+ type: 'http'
604
+ }
605
+ ],
606
+ url: '/v1/orgs/{org_id}/members/{user_id}',
607
+ ...options,
608
+ headers: {
609
+ 'Content-Type': 'application/json',
610
+ ...options.headers
611
+ }
612
+ });
613
+ };
614
+
615
+ /**
616
+ * Get Organization Limits
617
+ * Get the current limits and quotas for an organization.
618
+ */
619
+ export const getOrgLimits = <ThrowOnError extends boolean = false>(options: Options<GetOrgLimitsData, ThrowOnError>) => {
620
+ return (options.client ?? _heyApiClient).get<GetOrgLimitsResponses, GetOrgLimitsErrors, ThrowOnError>({
621
+ security: [
622
+ {
623
+ name: 'X-API-Key',
624
+ type: 'apiKey'
625
+ },
626
+ {
627
+ scheme: 'bearer',
628
+ type: 'http'
629
+ }
630
+ ],
631
+ url: '/v1/orgs/{org_id}/limits',
632
+ ...options
633
+ });
634
+ };
635
+
636
+ /**
637
+ * Get Organization Usage
638
+ * Get detailed usage statistics for an organization aggregated across all graphs.
639
+ */
640
+ export const getOrgUsage = <ThrowOnError extends boolean = false>(options: Options<GetOrgUsageData, ThrowOnError>) => {
641
+ return (options.client ?? _heyApiClient).get<GetOrgUsageResponses, GetOrgUsageErrors, ThrowOnError>({
642
+ security: [
643
+ {
644
+ name: 'X-API-Key',
645
+ type: 'apiKey'
646
+ },
647
+ {
648
+ scheme: 'bearer',
649
+ type: 'http'
650
+ }
651
+ ],
652
+ url: '/v1/orgs/{org_id}/usage',
420
653
  ...options
421
654
  });
422
655
  };
@@ -802,9 +1035,38 @@ export const syncConnection = <ThrowOnError extends boolean = false>(options: Op
802
1035
  });
803
1036
  };
804
1037
 
1038
+ /**
1039
+ * List available agents
1040
+ * Get a comprehensive list of all available agents with their metadata.
1041
+ *
1042
+ * **Returns:**
1043
+ * - Agent types and names
1044
+ * - Capabilities and supported modes
1045
+ * - Version information
1046
+ * - Credit requirements
1047
+ *
1048
+ * Use the optional `capability` filter to find agents with specific capabilities.
1049
+ */
1050
+ export const listAgents = <ThrowOnError extends boolean = false>(options: Options<ListAgentsData, ThrowOnError>) => {
1051
+ return (options.client ?? _heyApiClient).get<ListAgentsResponses, ListAgentsErrors, ThrowOnError>({
1052
+ security: [
1053
+ {
1054
+ name: 'X-API-Key',
1055
+ type: 'apiKey'
1056
+ },
1057
+ {
1058
+ scheme: 'bearer',
1059
+ type: 'http'
1060
+ }
1061
+ ],
1062
+ url: '/v1/graphs/{graph_id}/agent',
1063
+ ...options
1064
+ });
1065
+ };
1066
+
805
1067
  /**
806
1068
  * Auto-select agent for query
807
- * Automatically select the best agent for your query.
1069
+ * Automatically select the best agent for your query with intelligent execution strategy.
808
1070
  *
809
1071
  * **Agent Selection Process:**
810
1072
  *
@@ -813,7 +1075,8 @@ export const syncConnection = <ThrowOnError extends boolean = false>(options: Op
813
1075
  * 2. Enriching context with RAG if enabled
814
1076
  * 3. Evaluating all available agents against selection criteria
815
1077
  * 4. Selecting the best match based on confidence scores
816
- * 5. Executing the query with the selected agent
1078
+ * 5. Choosing execution strategy (sync/SSE/async) based on expected time
1079
+ * 6. Executing the query with the selected agent
817
1080
  *
818
1081
  * **Available Agent Types:**
819
1082
  * - `financial`: Financial analysis, SEC filings, company metrics
@@ -826,6 +1089,14 @@ export const syncConnection = <ThrowOnError extends boolean = false>(options: Op
826
1089
  * - `extended`: Comprehensive analysis (~15-60s), deep research
827
1090
  * - `streaming`: Real-time response streaming
828
1091
  *
1092
+ * **Execution Strategies (automatic):**
1093
+ * - Fast operations (<5s): Immediate synchronous response
1094
+ * - Medium operations (5-30s): SSE streaming with progress updates
1095
+ * - Long operations (>30s): Async Celery worker with operation tracking
1096
+ *
1097
+ * **Response Mode Override:**
1098
+ * Use query parameter `?mode=sync|async` to override automatic strategy selection.
1099
+ *
829
1100
  * **Confidence Score Interpretation:**
830
1101
  * - `0.9-1.0`: High confidence, agent is ideal match
831
1102
  * - `0.7-0.9`: Good confidence, agent is suitable
@@ -868,15 +1139,54 @@ export const autoSelectAgent = <ThrowOnError extends boolean = false>(options: O
868
1139
  });
869
1140
  };
870
1141
 
1142
+ /**
1143
+ * Get agent metadata
1144
+ * Get comprehensive metadata for a specific agent type.
1145
+ *
1146
+ * **Returns:**
1147
+ * - Agent name and description
1148
+ * - Version information
1149
+ * - Supported capabilities and modes
1150
+ * - Credit requirements
1151
+ * - Author and tags
1152
+ * - Configuration options
1153
+ *
1154
+ * Use this to understand agent capabilities before execution.
1155
+ */
1156
+ export const getAgentMetadata = <ThrowOnError extends boolean = false>(options: Options<GetAgentMetadataData, ThrowOnError>) => {
1157
+ return (options.client ?? _heyApiClient).get<GetAgentMetadataResponses, GetAgentMetadataErrors, ThrowOnError>({
1158
+ security: [
1159
+ {
1160
+ name: 'X-API-Key',
1161
+ type: 'apiKey'
1162
+ },
1163
+ {
1164
+ scheme: 'bearer',
1165
+ type: 'http'
1166
+ }
1167
+ ],
1168
+ url: '/v1/graphs/{graph_id}/agent/{agent_type}',
1169
+ ...options
1170
+ });
1171
+ };
1172
+
871
1173
  /**
872
1174
  * Execute specific agent
873
- * Execute a specific agent type directly.
1175
+ * Execute a specific agent type directly with intelligent execution strategy.
874
1176
  *
875
1177
  * Available agents:
876
1178
  * - **financial**: Financial analysis, SEC filings, accounting data
877
1179
  * - **research**: Deep research and comprehensive analysis
878
1180
  * - **rag**: Fast retrieval without AI (no credits required)
879
1181
  *
1182
+ * **Execution Strategies (automatic):**
1183
+ * - Fast operations (<5s): Immediate synchronous response
1184
+ * - Medium operations (5-30s): SSE streaming with progress updates
1185
+ * - Long operations (>30s): Async Celery worker with operation tracking
1186
+ *
1187
+ * **Response Mode Override:**
1188
+ * Use query parameter `?mode=sync|async` to override automatic strategy selection.
1189
+ *
880
1190
  * Use this endpoint when you know which agent you want to use.
881
1191
  */
882
1192
  export const executeSpecificAgent = <ThrowOnError extends boolean = false>(options: Options<ExecuteSpecificAgentData, ThrowOnError>) => {
@@ -938,66 +1248,6 @@ export const batchProcessQueries = <ThrowOnError extends boolean = false>(option
938
1248
  });
939
1249
  };
940
1250
 
941
- /**
942
- * List available agents
943
- * Get a comprehensive list of all available agents with their metadata.
944
- *
945
- * **Returns:**
946
- * - Agent types and names
947
- * - Capabilities and supported modes
948
- * - Version information
949
- * - Credit requirements
950
- *
951
- * Use the optional `capability` filter to find agents with specific capabilities.
952
- */
953
- export const listAgents = <ThrowOnError extends boolean = false>(options: Options<ListAgentsData, ThrowOnError>) => {
954
- return (options.client ?? _heyApiClient).get<ListAgentsResponses, ListAgentsErrors, ThrowOnError>({
955
- security: [
956
- {
957
- name: 'X-API-Key',
958
- type: 'apiKey'
959
- },
960
- {
961
- scheme: 'bearer',
962
- type: 'http'
963
- }
964
- ],
965
- url: '/v1/graphs/{graph_id}/agent/list',
966
- ...options
967
- });
968
- };
969
-
970
- /**
971
- * Get agent metadata
972
- * Get comprehensive metadata for a specific agent type.
973
- *
974
- * **Returns:**
975
- * - Agent name and description
976
- * - Version information
977
- * - Supported capabilities and modes
978
- * - Credit requirements
979
- * - Author and tags
980
- * - Configuration options
981
- *
982
- * Use this to understand agent capabilities before execution.
983
- */
984
- export const getAgentMetadata = <ThrowOnError extends boolean = false>(options: Options<GetAgentMetadataData, ThrowOnError>) => {
985
- return (options.client ?? _heyApiClient).get<GetAgentMetadataResponses, GetAgentMetadataErrors, ThrowOnError>({
986
- security: [
987
- {
988
- name: 'X-API-Key',
989
- type: 'apiKey'
990
- },
991
- {
992
- scheme: 'bearer',
993
- type: 'http'
994
- }
995
- ],
996
- url: '/v1/graphs/{graph_id}/agent/{agent_type}/metadata',
997
- ...options
998
- });
999
- };
1000
-
1001
1251
  /**
1002
1252
  * Get agent recommendations
1003
1253
  * Get intelligent agent recommendations for a specific query.
@@ -1406,7 +1656,7 @@ export const getGraphMetrics = <ThrowOnError extends boolean = false>(options: O
1406
1656
 
1407
1657
  /**
1408
1658
  * Get Graph Usage Analytics
1409
- * Get comprehensive usage analytics tracked by the GraphUsageTracking model.
1659
+ * Get comprehensive usage analytics tracked by the GraphUsage model.
1410
1660
  *
1411
1661
  * Provides temporal usage patterns including:
1412
1662
  * - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
@@ -3029,9 +3279,15 @@ export const selectGraph = <ThrowOnError extends boolean = false>(options: Optio
3029
3279
  * and shared repository subscriptions. This is the primary endpoint for frontend
3030
3280
  * applications to display subscription options.
3031
3281
  *
3282
+ * **Pricing Model:**
3283
+ * - Graph subscriptions are **per-graph** with infrastructure-based pricing
3284
+ * - Each graph you create has its own monthly subscription
3285
+ * - Organizations can have multiple graphs with different infrastructure tiers
3286
+ * - Credits are allocated per-graph, not shared across organization
3287
+ *
3032
3288
  * Includes:
3033
- * - Graph subscription tiers (standard, enterprise, premium)
3034
- * - Shared repository subscriptions (SEC, industry, economic data)
3289
+ * - Graph infrastructure tiers (kuzu-standard, kuzu-large, kuzu-xlarge) - per-graph pricing
3290
+ * - Shared repository subscriptions (SEC, industry, economic data) - org-level
3035
3291
  * - Operation costs and credit information
3036
3292
  * - Features and capabilities for each tier
3037
3293
  * - Enabled/disabled status for repositories
@@ -3177,25 +3433,17 @@ export const cancelOperation = <ThrowOnError extends boolean = false>(options: O
3177
3433
  };
3178
3434
 
3179
3435
  /**
3180
- * Create Payment Checkout Session
3181
- * Create a Stripe checkout session for collecting payment method.
3436
+ * Get Organization Customer Info
3437
+ * Get billing customer information for an organization including payment methods on file.
3182
3438
  *
3183
- * This endpoint is used when a user needs to add a payment method before
3184
- * provisioning resources. It creates a pending subscription and redirects
3185
- * the user to Stripe Checkout to collect payment details.
3186
- *
3187
- * **Flow:**
3188
- * 1. User tries to create a graph but has no payment method
3189
- * 2. Frontend calls this endpoint with graph configuration
3190
- * 3. Backend creates a subscription in PENDING_PAYMENT status
3191
- * 4. Returns Stripe Checkout URL
3192
- * 5. User completes payment on Stripe
3193
- * 6. Webhook activates subscription and provisions resource
3439
+ * Returns customer details, payment methods, and whether invoice billing is enabled.
3194
3440
  *
3195
- * **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
3441
+ * **Requirements:**
3442
+ * - User must be a member of the organization
3443
+ * - Sensitive payment details are only visible to owners
3196
3444
  */
3197
- export const createCheckoutSession = <ThrowOnError extends boolean = false>(options: Options<CreateCheckoutSessionData, ThrowOnError>) => {
3198
- return (options.client ?? _heyApiClient).post<CreateCheckoutSessionResponses, CreateCheckoutSessionErrors, ThrowOnError>({
3445
+ export const getOrgBillingCustomer = <ThrowOnError extends boolean = false>(options: Options<GetOrgBillingCustomerData, ThrowOnError>) => {
3446
+ return (options.client ?? _heyApiClient).get<GetOrgBillingCustomerResponses, GetOrgBillingCustomerErrors, ThrowOnError>({
3199
3447
  security: [
3200
3448
  {
3201
3449
  name: 'X-API-Key',
@@ -3206,34 +3454,22 @@ export const createCheckoutSession = <ThrowOnError extends boolean = false>(opti
3206
3454
  type: 'http'
3207
3455
  }
3208
3456
  ],
3209
- url: '/v1/billing/checkout',
3210
- ...options,
3211
- headers: {
3212
- 'Content-Type': 'application/json',
3213
- ...options.headers
3214
- }
3457
+ url: '/v1/billing/customer/{org_id}',
3458
+ ...options
3215
3459
  });
3216
3460
  };
3217
3461
 
3218
3462
  /**
3219
- * Get Checkout Session Status
3220
- * Poll the status of a checkout session.
3221
- *
3222
- * Frontend should poll this endpoint after user returns from Stripe Checkout
3223
- * to determine when the resource is ready.
3463
+ * Update Organization Default Payment Method
3464
+ * Update the default payment method for the organization.
3224
3465
  *
3225
- * **Status Values:**
3226
- * - `pending_payment`: Waiting for payment to complete
3227
- * - `provisioning`: Payment confirmed, resource being created
3228
- * - `completed`: Resource is ready (resource_id will be set)
3229
- * - `failed`: Something went wrong (error field will be set)
3466
+ * This changes which payment method will be used for future subscription charges.
3230
3467
  *
3231
- * **When status is 'completed':**
3232
- * - For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE progress
3233
- * - For repositories: `resource_id` will be the repository name and access is immediately available
3468
+ * **Requirements:**
3469
+ * - User must be an OWNER of the organization
3234
3470
  */
3235
- export const getCheckoutStatus = <ThrowOnError extends boolean = false>(options: Options<GetCheckoutStatusData, ThrowOnError>) => {
3236
- return (options.client ?? _heyApiClient).get<GetCheckoutStatusResponses, GetCheckoutStatusErrors, ThrowOnError>({
3471
+ export const updateOrgPaymentMethod = <ThrowOnError extends boolean = false>(options: Options<UpdateOrgPaymentMethodData, ThrowOnError>) => {
3472
+ return (options.client ?? _heyApiClient).post<UpdateOrgPaymentMethodResponses, UpdateOrgPaymentMethodErrors, ThrowOnError>({
3237
3473
  security: [
3238
3474
  {
3239
3475
  name: 'X-API-Key',
@@ -3244,19 +3480,26 @@ export const getCheckoutStatus = <ThrowOnError extends boolean = false>(options:
3244
3480
  type: 'http'
3245
3481
  }
3246
3482
  ],
3247
- url: '/v1/billing/checkout/{session_id}/status',
3248
- ...options
3483
+ url: '/v1/billing/customer/{org_id}/payment-method',
3484
+ ...options,
3485
+ headers: {
3486
+ 'Content-Type': 'application/json',
3487
+ ...options.headers
3488
+ }
3249
3489
  });
3250
3490
  };
3251
3491
 
3252
3492
  /**
3253
- * Get Customer Info
3254
- * Get billing customer information including payment methods on file.
3493
+ * List Organization Subscriptions
3494
+ * List all active and past subscriptions for an organization.
3255
3495
  *
3256
- * Returns customer details, payment methods, and whether invoice billing is enabled.
3496
+ * Includes both graph and repository subscriptions with their status, pricing, and billing information.
3497
+ *
3498
+ * **Requirements:**
3499
+ * - User must be a member of the organization
3257
3500
  */
3258
- export const getBillingCustomer = <ThrowOnError extends boolean = false>(options?: Options<GetBillingCustomerData, ThrowOnError>) => {
3259
- return (options?.client ?? _heyApiClient).get<GetBillingCustomerResponses, unknown, ThrowOnError>({
3501
+ export const listOrgSubscriptions = <ThrowOnError extends boolean = false>(options: Options<ListOrgSubscriptionsData, ThrowOnError>) => {
3502
+ return (options.client ?? _heyApiClient).get<ListOrgSubscriptionsResponses, ListOrgSubscriptionsErrors, ThrowOnError>({
3260
3503
  security: [
3261
3504
  {
3262
3505
  name: 'X-API-Key',
@@ -3267,19 +3510,20 @@ export const getBillingCustomer = <ThrowOnError extends boolean = false>(options
3267
3510
  type: 'http'
3268
3511
  }
3269
3512
  ],
3270
- url: '/v1/billing/customer',
3513
+ url: '/v1/billing/subscriptions/{org_id}',
3271
3514
  ...options
3272
3515
  });
3273
3516
  };
3274
3517
 
3275
3518
  /**
3276
- * Update Default Payment Method
3277
- * Update the default payment method for the customer.
3519
+ * Get Organization Subscription Details
3520
+ * Get detailed information about a specific subscription.
3278
3521
  *
3279
- * This changes which payment method will be used for future subscription charges.
3522
+ * **Requirements:**
3523
+ * - User must be a member of the organization
3280
3524
  */
3281
- export const updatePaymentMethod = <ThrowOnError extends boolean = false>(options: Options<UpdatePaymentMethodData, ThrowOnError>) => {
3282
- return (options.client ?? _heyApiClient).post<UpdatePaymentMethodResponses, UpdatePaymentMethodErrors, ThrowOnError>({
3525
+ export const getOrgSubscription = <ThrowOnError extends boolean = false>(options: Options<GetOrgSubscriptionData, ThrowOnError>) => {
3526
+ return (options.client ?? _heyApiClient).get<GetOrgSubscriptionResponses, GetOrgSubscriptionErrors, ThrowOnError>({
3283
3527
  security: [
3284
3528
  {
3285
3529
  name: 'X-API-Key',
@@ -3290,23 +3534,22 @@ export const updatePaymentMethod = <ThrowOnError extends boolean = false>(option
3290
3534
  type: 'http'
3291
3535
  }
3292
3536
  ],
3293
- url: '/v1/billing/customer/payment-method',
3294
- ...options,
3295
- headers: {
3296
- 'Content-Type': 'application/json',
3297
- ...options.headers
3298
- }
3537
+ url: '/v1/billing/subscriptions/{org_id}/subscription/{subscription_id}',
3538
+ ...options
3299
3539
  });
3300
3540
  };
3301
3541
 
3302
3542
  /**
3303
- * List Invoices
3304
- * List payment history and invoices.
3543
+ * Cancel Organization Subscription
3544
+ * Cancel an organization subscription.
3305
3545
  *
3306
- * Returns past invoices with payment status, amounts, and line items.
3546
+ * The subscription will remain active until the end of the current billing period.
3547
+ *
3548
+ * **Requirements:**
3549
+ * - User must be an OWNER of the organization
3307
3550
  */
3308
- export const listInvoices = <ThrowOnError extends boolean = false>(options?: Options<ListInvoicesData, ThrowOnError>) => {
3309
- return (options?.client ?? _heyApiClient).get<ListInvoicesResponses, ListInvoicesErrors, ThrowOnError>({
3551
+ export const cancelOrgSubscription = <ThrowOnError extends boolean = false>(options: Options<CancelOrgSubscriptionData, ThrowOnError>) => {
3552
+ return (options.client ?? _heyApiClient).post<CancelOrgSubscriptionResponses, CancelOrgSubscriptionErrors, ThrowOnError>({
3310
3553
  security: [
3311
3554
  {
3312
3555
  name: 'X-API-Key',
@@ -3317,19 +3560,23 @@ export const listInvoices = <ThrowOnError extends boolean = false>(options?: Opt
3317
3560
  type: 'http'
3318
3561
  }
3319
3562
  ],
3320
- url: '/v1/billing/invoices',
3563
+ url: '/v1/billing/subscriptions/{org_id}/subscription/{subscription_id}/cancel',
3321
3564
  ...options
3322
3565
  });
3323
3566
  };
3324
3567
 
3325
3568
  /**
3326
- * Get Upcoming Invoice
3327
- * Get preview of the next invoice.
3569
+ * List Organization Invoices
3570
+ * List payment history and invoices for an organization.
3328
3571
  *
3329
- * Returns estimated charges for the next billing period.
3572
+ * Returns past invoices with payment status, amounts, and line items.
3573
+ *
3574
+ * **Requirements:**
3575
+ * - User must be a member of the organization
3576
+ * - Full invoice details are only visible to owners and admins
3330
3577
  */
3331
- export const getUpcomingInvoice = <ThrowOnError extends boolean = false>(options?: Options<GetUpcomingInvoiceData, ThrowOnError>) => {
3332
- return (options?.client ?? _heyApiClient).get<GetUpcomingInvoiceResponses, unknown, ThrowOnError>({
3578
+ export const listOrgInvoices = <ThrowOnError extends boolean = false>(options: Options<ListOrgInvoicesData, ThrowOnError>) => {
3579
+ return (options.client ?? _heyApiClient).get<ListOrgInvoicesResponses, ListOrgInvoicesErrors, ThrowOnError>({
3333
3580
  security: [
3334
3581
  {
3335
3582
  name: 'X-API-Key',
@@ -3340,19 +3587,23 @@ export const getUpcomingInvoice = <ThrowOnError extends boolean = false>(options
3340
3587
  type: 'http'
3341
3588
  }
3342
3589
  ],
3343
- url: '/v1/billing/invoices/upcoming',
3590
+ url: '/v1/billing/invoices/{org_id}',
3344
3591
  ...options
3345
3592
  });
3346
3593
  };
3347
3594
 
3348
3595
  /**
3349
- * List All Subscriptions
3350
- * List all active and past subscriptions for the user.
3596
+ * Get Organization Upcoming Invoice
3597
+ * Get preview of the next invoice for an organization.
3351
3598
  *
3352
- * Includes both graph and repository subscriptions with their status, pricing, and billing information.
3599
+ * Returns estimated charges for the next billing period.
3600
+ *
3601
+ * **Requirements:**
3602
+ * - User must be a member of the organization
3603
+ * - Full invoice details are only visible to owners and admins
3353
3604
  */
3354
- export const listSubscriptions = <ThrowOnError extends boolean = false>(options?: Options<ListSubscriptionsData, ThrowOnError>) => {
3355
- return (options?.client ?? _heyApiClient).get<ListSubscriptionsResponses, unknown, ThrowOnError>({
3605
+ export const getOrgUpcomingInvoice = <ThrowOnError extends boolean = false>(options: Options<GetOrgUpcomingInvoiceData, ThrowOnError>) => {
3606
+ return (options.client ?? _heyApiClient).get<GetOrgUpcomingInvoiceResponses, GetOrgUpcomingInvoiceErrors, ThrowOnError>({
3356
3607
  security: [
3357
3608
  {
3358
3609
  name: 'X-API-Key',
@@ -3363,17 +3614,33 @@ export const listSubscriptions = <ThrowOnError extends boolean = false>(options?
3363
3614
  type: 'http'
3364
3615
  }
3365
3616
  ],
3366
- url: '/v1/billing/subscriptions',
3617
+ url: '/v1/billing/invoices/{org_id}/upcoming',
3367
3618
  ...options
3368
3619
  });
3369
3620
  };
3370
3621
 
3371
3622
  /**
3372
- * Get Subscription Details
3373
- * Get detailed information about a specific subscription.
3623
+ * Create Payment Checkout Session
3624
+ * Create a Stripe checkout session for collecting payment method.
3625
+ *
3626
+ * This endpoint is used when an organization owner needs to add a payment method before
3627
+ * provisioning resources. It creates a pending subscription and redirects
3628
+ * to Stripe Checkout to collect payment details.
3629
+ *
3630
+ * **Flow:**
3631
+ * 1. Owner tries to create a graph but org has no payment method
3632
+ * 2. Frontend calls this endpoint with graph configuration
3633
+ * 3. Backend creates a subscription in PENDING_PAYMENT status for the user's org
3634
+ * 4. Returns Stripe Checkout URL
3635
+ * 5. User completes payment on Stripe
3636
+ * 6. Webhook activates subscription and provisions resource
3637
+ *
3638
+ * **Requirements:**
3639
+ * - User must be an OWNER of their organization
3640
+ * - Enterprise customers (with invoice_billing_enabled) should not call this endpoint.
3374
3641
  */
3375
- export const getSubscription = <ThrowOnError extends boolean = false>(options: Options<GetSubscriptionData, ThrowOnError>) => {
3376
- return (options.client ?? _heyApiClient).get<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError>({
3642
+ export const createCheckoutSession = <ThrowOnError extends boolean = false>(options: Options<CreateCheckoutSessionData, ThrowOnError>) => {
3643
+ return (options.client ?? _heyApiClient).post<CreateCheckoutSessionResponses, CreateCheckoutSessionErrors, ThrowOnError>({
3377
3644
  security: [
3378
3645
  {
3379
3646
  name: 'X-API-Key',
@@ -3384,19 +3651,34 @@ export const getSubscription = <ThrowOnError extends boolean = false>(options: O
3384
3651
  type: 'http'
3385
3652
  }
3386
3653
  ],
3387
- url: '/v1/billing/subscriptions/{subscription_id}',
3388
- ...options
3654
+ url: '/v1/billing/checkout',
3655
+ ...options,
3656
+ headers: {
3657
+ 'Content-Type': 'application/json',
3658
+ ...options.headers
3659
+ }
3389
3660
  });
3390
3661
  };
3391
3662
 
3392
3663
  /**
3393
- * Cancel Subscription
3394
- * Cancel a subscription.
3664
+ * Get Checkout Session Status
3665
+ * Poll the status of a checkout session.
3395
3666
  *
3396
- * The subscription will remain active until the end of the current billing period.
3667
+ * Frontend should poll this endpoint after user returns from Stripe Checkout
3668
+ * to determine when the resource is ready.
3669
+ *
3670
+ * **Status Values:**
3671
+ * - `pending_payment`: Waiting for payment to complete
3672
+ * - `provisioning`: Payment confirmed, resource being created
3673
+ * - `completed`: Resource is ready (resource_id will be set)
3674
+ * - `failed`: Something went wrong (error field will be set)
3675
+ *
3676
+ * **When status is 'completed':**
3677
+ * - For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE progress
3678
+ * - For repositories: `resource_id` will be the repository name and access is immediately available
3397
3679
  */
3398
- export const cancelSubscription2 = <ThrowOnError extends boolean = false>(options: Options<CancelSubscription2Data, ThrowOnError>) => {
3399
- return (options.client ?? _heyApiClient).post<CancelSubscription2Responses, CancelSubscription2Errors, ThrowOnError>({
3680
+ export const getCheckoutStatus = <ThrowOnError extends boolean = false>(options: Options<GetCheckoutStatusData, ThrowOnError>) => {
3681
+ return (options.client ?? _heyApiClient).get<GetCheckoutStatusResponses, GetCheckoutStatusErrors, ThrowOnError>({
3400
3682
  security: [
3401
3683
  {
3402
3684
  name: 'X-API-Key',
@@ -3407,7 +3689,7 @@ export const cancelSubscription2 = <ThrowOnError extends boolean = false>(option
3407
3689
  type: 'http'
3408
3690
  }
3409
3691
  ],
3410
- url: '/v1/billing/subscriptions/{subscription_id}/cancel',
3692
+ url: '/v1/billing/checkout/{session_id}/status',
3411
3693
  ...options
3412
3694
  });
3413
3695
  };