@robosystems/client 0.2.8 → 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sdk.gen.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, GetAllCreditSummariesData, GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, UpdateUserPasswordData, UpdateUserPasswordResponses, UpdateUserPasswordErrors, ListUserApiKeysData, ListUserApiKeysResponses, CreateUserApiKeyData, CreateUserApiKeyResponses, CreateUserApiKeyErrors, RevokeUserApiKeyData, RevokeUserApiKeyResponses, RevokeUserApiKeyErrors, UpdateUserApiKeyData, UpdateUserApiKeyResponses, UpdateUserApiKeyErrors, GetUserLimitsData, GetUserLimitsResponses, GetUserLimitsErrors, GetUserUsageData, GetUserUsageResponses, GetAllSharedRepositoryLimitsData, GetAllSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsData, GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, GetUserUsageOverviewData, GetUserUsageOverviewResponses, GetDetailedUserAnalyticsData, GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, GetUserSharedSubscriptionsData, GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, SubscribeToSharedRepositoryData, SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, UpgradeSharedRepositorySubscriptionData, UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, CancelSharedRepositorySubscriptionData, CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, GetSharedRepositoryCreditsData, GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, GetRepositoryCreditsData, GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, 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, GetGraphUsageStatsData, GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ExecuteCypherQueryData, ExecuteCypherQueryResponses, ExecuteCypherQueryErrors, GetGraphSchemaData, GetGraphSchemaResponses, GetGraphSchemaErrors, ExportGraphSchemaData, ExportGraphSchemaResponses, ExportGraphSchemaErrors, ValidateSchemaData, ValidateSchemaResponses, ValidateSchemaErrors, GetCurrentGraphBillData, GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, GetGraphUsageDetailsData, GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, GetGraphBillingHistoryData, GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, GetGraphMonthlyBillData, GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, 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, 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 } 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, 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';
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> & {
@@ -283,33 +283,6 @@ export const updateUser = <ThrowOnError extends boolean = false>(options: Option
283
283
  });
284
284
  };
285
285
 
286
- /**
287
- * Get All Credit Summaries
288
- * Get credit summaries for all graphs owned by the user.
289
- *
290
- * This endpoint provides a consolidated view of credit usage across
291
- * all graphs where the user has access, helping to monitor overall
292
- * credit consumption and plan usage.
293
- *
294
- * No credits are consumed for viewing summaries.
295
- */
296
- export const getAllCreditSummaries = <ThrowOnError extends boolean = false>(options?: Options<GetAllCreditSummariesData, ThrowOnError>) => {
297
- return (options?.client ?? _heyApiClient).get<GetAllCreditSummariesResponses, GetAllCreditSummariesErrors, ThrowOnError>({
298
- security: [
299
- {
300
- name: 'X-API-Key',
301
- type: 'apiKey'
302
- },
303
- {
304
- scheme: 'bearer',
305
- type: 'http'
306
- }
307
- ],
308
- url: '/v1/user/credits',
309
- ...options
310
- });
311
- };
312
-
313
286
  /**
314
287
  * Update Password
315
288
  * Update the current user's password.
@@ -428,11 +401,11 @@ export const updateUserApiKey = <ThrowOnError extends boolean = false>(options:
428
401
  };
429
402
 
430
403
  /**
431
- * Get user limits
432
- * Retrieve current limits and restrictions for the authenticated user
404
+ * Get user limits and usage
405
+ * Retrieve current limits and usage statistics for the authenticated user (simple safety valve for graph creation)
433
406
  */
434
407
  export const getUserLimits = <ThrowOnError extends boolean = false>(options?: Options<GetUserLimitsData, ThrowOnError>) => {
435
- return (options?.client ?? _heyApiClient).get<GetUserLimitsResponses, GetUserLimitsErrors, ThrowOnError>({
408
+ return (options?.client ?? _heyApiClient).get<GetUserLimitsResponses, unknown, ThrowOnError>({
436
409
  security: [
437
410
  {
438
411
  name: 'X-API-Key',
@@ -448,253 +421,6 @@ export const getUserLimits = <ThrowOnError extends boolean = false>(options?: Op
448
421
  });
449
422
  };
450
423
 
451
- /**
452
- * Get user usage statistics
453
- * Retrieve current usage statistics and remaining limits for the authenticated user
454
- */
455
- export const getUserUsage = <ThrowOnError extends boolean = false>(options?: Options<GetUserUsageData, ThrowOnError>) => {
456
- return (options?.client ?? _heyApiClient).get<GetUserUsageResponses, unknown, ThrowOnError>({
457
- security: [
458
- {
459
- name: 'X-API-Key',
460
- type: 'apiKey'
461
- },
462
- {
463
- scheme: 'bearer',
464
- type: 'http'
465
- }
466
- ],
467
- url: '/v1/user/limits/usage',
468
- ...options
469
- });
470
- };
471
-
472
- /**
473
- * Get all shared repository limits
474
- * Get rate limit status for all shared repositories the user has access to.
475
- */
476
- export const getAllSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options?: Options<GetAllSharedRepositoryLimitsData, ThrowOnError>) => {
477
- return (options?.client ?? _heyApiClient).get<GetAllSharedRepositoryLimitsResponses, unknown, ThrowOnError>({
478
- security: [
479
- {
480
- name: 'X-API-Key',
481
- type: 'apiKey'
482
- },
483
- {
484
- scheme: 'bearer',
485
- type: 'http'
486
- }
487
- ],
488
- url: '/v1/user/limits/shared-repositories/summary',
489
- ...options
490
- });
491
- };
492
-
493
- /**
494
- * Get shared repository rate limit status
495
- * Get current rate limit status and usage for a shared repository.
496
- *
497
- * Returns:
498
- * - Current usage across different time windows
499
- * - Rate limits based on subscription tier
500
- * - Remaining quota
501
- * - Reset times
502
- *
503
- * Note: All queries are included - this only shows rate limit status.
504
- */
505
- export const getSharedRepositoryLimits = <ThrowOnError extends boolean = false>(options: Options<GetSharedRepositoryLimitsData, ThrowOnError>) => {
506
- return (options.client ?? _heyApiClient).get<GetSharedRepositoryLimitsResponses, GetSharedRepositoryLimitsErrors, ThrowOnError>({
507
- security: [
508
- {
509
- name: 'X-API-Key',
510
- type: 'apiKey'
511
- },
512
- {
513
- scheme: 'bearer',
514
- type: 'http'
515
- }
516
- ],
517
- url: '/v1/user/limits/shared-repositories/{repository}',
518
- ...options
519
- });
520
- };
521
-
522
- /**
523
- * Get User Usage Overview
524
- * Get a high-level overview of usage statistics for the current user.
525
- */
526
- export const getUserUsageOverview = <ThrowOnError extends boolean = false>(options?: Options<GetUserUsageOverviewData, ThrowOnError>) => {
527
- return (options?.client ?? _heyApiClient).get<GetUserUsageOverviewResponses, unknown, ThrowOnError>({
528
- security: [
529
- {
530
- name: 'X-API-Key',
531
- type: 'apiKey'
532
- },
533
- {
534
- scheme: 'bearer',
535
- type: 'http'
536
- }
537
- ],
538
- url: '/v1/user/analytics/overview',
539
- ...options
540
- });
541
- };
542
-
543
- /**
544
- * Get Detailed User Analytics
545
- * Get comprehensive analytics for the current user including API usage and recent activity.
546
- */
547
- export const getDetailedUserAnalytics = <ThrowOnError extends boolean = false>(options?: Options<GetDetailedUserAnalyticsData, ThrowOnError>) => {
548
- return (options?.client ?? _heyApiClient).get<GetDetailedUserAnalyticsResponses, GetDetailedUserAnalyticsErrors, ThrowOnError>({
549
- security: [
550
- {
551
- name: 'X-API-Key',
552
- type: 'apiKey'
553
- },
554
- {
555
- scheme: 'bearer',
556
- type: 'http'
557
- }
558
- ],
559
- url: '/v1/user/analytics/detailed',
560
- ...options
561
- });
562
- };
563
-
564
- /**
565
- * Get User Subscriptions
566
- * Retrieve user's current shared repository subscriptions with detailed information
567
- */
568
- export const getUserSharedSubscriptions = <ThrowOnError extends boolean = false>(options?: Options<GetUserSharedSubscriptionsData, ThrowOnError>) => {
569
- return (options?.client ?? _heyApiClient).get<GetUserSharedSubscriptionsResponses, GetUserSharedSubscriptionsErrors, ThrowOnError>({
570
- security: [
571
- {
572
- name: 'X-API-Key',
573
- type: 'apiKey'
574
- },
575
- {
576
- scheme: 'bearer',
577
- type: 'http'
578
- }
579
- ],
580
- url: '/v1/user/subscriptions/shared-repositories',
581
- ...options
582
- });
583
- };
584
-
585
- /**
586
- * Subscribe to Shared Repository
587
- * Create a new subscription to a shared repository add-on with specified tier
588
- */
589
- export const subscribeToSharedRepository = <ThrowOnError extends boolean = false>(options: Options<SubscribeToSharedRepositoryData, ThrowOnError>) => {
590
- return (options.client ?? _heyApiClient).post<SubscribeToSharedRepositoryResponses, SubscribeToSharedRepositoryErrors, ThrowOnError>({
591
- security: [
592
- {
593
- name: 'X-API-Key',
594
- type: 'apiKey'
595
- },
596
- {
597
- scheme: 'bearer',
598
- type: 'http'
599
- }
600
- ],
601
- url: '/v1/user/subscriptions/shared-repositories/subscribe',
602
- ...options,
603
- headers: {
604
- 'Content-Type': 'application/json',
605
- ...options.headers
606
- }
607
- });
608
- };
609
-
610
- /**
611
- * Upgrade Subscription Tier
612
- * Upgrade a subscription to a higher tier with immediate credit adjustment
613
- */
614
- export const upgradeSharedRepositorySubscription = <ThrowOnError extends boolean = false>(options: Options<UpgradeSharedRepositorySubscriptionData, ThrowOnError>) => {
615
- return (options.client ?? _heyApiClient).put<UpgradeSharedRepositorySubscriptionResponses, UpgradeSharedRepositorySubscriptionErrors, ThrowOnError>({
616
- security: [
617
- {
618
- name: 'X-API-Key',
619
- type: 'apiKey'
620
- },
621
- {
622
- scheme: 'bearer',
623
- type: 'http'
624
- }
625
- ],
626
- url: '/v1/user/subscriptions/shared-repositories/{subscription_id}/upgrade',
627
- ...options,
628
- headers: {
629
- 'Content-Type': 'application/json',
630
- ...options.headers
631
- }
632
- });
633
- };
634
-
635
- /**
636
- * Cancel Subscription
637
- * Cancel a shared repository subscription and disable associated credit pool
638
- */
639
- export const cancelSharedRepositorySubscription = <ThrowOnError extends boolean = false>(options: Options<CancelSharedRepositorySubscriptionData, ThrowOnError>) => {
640
- return (options.client ?? _heyApiClient).delete<CancelSharedRepositorySubscriptionResponses, CancelSharedRepositorySubscriptionErrors, ThrowOnError>({
641
- security: [
642
- {
643
- name: 'X-API-Key',
644
- type: 'apiKey'
645
- },
646
- {
647
- scheme: 'bearer',
648
- type: 'http'
649
- }
650
- ],
651
- url: '/v1/user/subscriptions/shared-repositories/{subscription_id}',
652
- ...options
653
- });
654
- };
655
-
656
- /**
657
- * Get Credit Balances
658
- * Retrieve credit balances for all shared repository subscriptions
659
- */
660
- export const getSharedRepositoryCredits = <ThrowOnError extends boolean = false>(options?: Options<GetSharedRepositoryCreditsData, ThrowOnError>) => {
661
- return (options?.client ?? _heyApiClient).get<GetSharedRepositoryCreditsResponses, GetSharedRepositoryCreditsErrors, ThrowOnError>({
662
- security: [
663
- {
664
- name: 'X-API-Key',
665
- type: 'apiKey'
666
- },
667
- {
668
- scheme: 'bearer',
669
- type: 'http'
670
- }
671
- ],
672
- url: '/v1/user/subscriptions/shared-repositories/credits',
673
- ...options
674
- });
675
- };
676
-
677
- /**
678
- * Get Repository Credits
679
- * Get credit balance for a specific shared repository
680
- */
681
- export const getRepositoryCredits = <ThrowOnError extends boolean = false>(options: Options<GetRepositoryCreditsData, ThrowOnError>) => {
682
- return (options.client ?? _heyApiClient).get<GetRepositoryCreditsResponses, GetRepositoryCreditsErrors, ThrowOnError>({
683
- security: [
684
- {
685
- name: 'X-API-Key',
686
- type: 'apiKey'
687
- },
688
- {
689
- scheme: 'bearer',
690
- type: 'http'
691
- }
692
- ],
693
- url: '/v1/user/subscriptions/shared-repositories/credits/{repository}',
694
- ...options
695
- });
696
- };
697
-
698
424
  /**
699
425
  * List Connections
700
426
  * List all data connections in the graph.
@@ -1679,33 +1405,39 @@ export const getGraphMetrics = <ThrowOnError extends boolean = false>(options: O
1679
1405
  };
1680
1406
 
1681
1407
  /**
1682
- * Get Usage Statistics
1683
- * Get detailed usage statistics for the graph.
1408
+ * Get Graph Usage Analytics
1409
+ * Get comprehensive usage analytics tracked by the GraphUsageTracking model.
1684
1410
  *
1685
1411
  * Provides temporal usage patterns including:
1686
- * - **Query Volume**: API calls per day/hour
1687
- * - **Credit Consumption**: Usage patterns and trends
1688
- * - **Operation Breakdown**: Usage by operation type
1689
- * - **User Activity**: Access patterns by user role
1690
- * - **Peak Usage Times**: Identify high-activity periods
1412
+ * - **Storage Analytics**: GB-hours for billing, breakdown by type (files, tables, graphs, subgraphs)
1413
+ * - **Credit Analytics**: Consumption patterns, operation breakdown, cached vs billable
1414
+ * - **Performance Insights**: Operation stats, slow queries, performance scoring
1415
+ * - **Recent Events**: Latest usage events with full details
1691
1416
  *
1692
1417
  * Time ranges available:
1693
- * - Last 24 hours (hourly breakdown)
1694
- * - Last 7 days (daily breakdown)
1695
- * - Last 30 days (daily breakdown)
1696
- * - Custom date ranges
1418
+ * - `24h` - Last 24 hours (hourly breakdown)
1419
+ * - `7d` - Last 7 days (daily breakdown)
1420
+ * - `30d` - Last 30 days (daily breakdown)
1421
+ * - `current_month` - Current billing month
1422
+ * - `last_month` - Previous billing month
1423
+ *
1424
+ * Include options:
1425
+ * - `storage` - Storage usage summary (GB-hours, averages, peaks)
1426
+ * - `credits` - Credit consumption analytics
1427
+ * - `performance` - Performance insights and optimization opportunities
1428
+ * - `events` - Recent usage events (last 50)
1697
1429
  *
1698
1430
  * Useful for:
1431
+ * - Billing and cost analysis
1699
1432
  * - Capacity planning
1700
- * - Cost optimization
1433
+ * - Performance optimization
1701
1434
  * - Usage trend analysis
1702
- * - Performance tuning
1703
1435
  *
1704
1436
  * Note:
1705
1437
  * This operation is included - no credit consumption required.
1706
1438
  */
1707
- export const getGraphUsageStats = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageStatsData, ThrowOnError>) => {
1708
- return (options.client ?? _heyApiClient).get<GetGraphUsageStatsResponses, GetGraphUsageStatsErrors, ThrowOnError>({
1439
+ export const getGraphUsageAnalytics = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageAnalyticsData, ThrowOnError>) => {
1440
+ return (options.client ?? _heyApiClient).get<GetGraphUsageAnalyticsResponses, GetGraphUsageAnalyticsErrors, ThrowOnError>({
1709
1441
  security: [
1710
1442
  {
1711
1443
  name: 'X-API-Key',
@@ -1974,22 +1706,19 @@ export const validateSchema = <ThrowOnError extends boolean = false>(options: Op
1974
1706
  };
1975
1707
 
1976
1708
  /**
1977
- * Get Current Bill
1978
- * Get current month's billing details for the graph.
1979
- *
1980
- * Returns comprehensive billing information including:
1981
- * - **Credit Usage**: Consumed vs. allocated credits
1982
- * - **Storage Charges**: Current storage usage and costs
1983
- * - **Subscription Tier**: Current plan and features
1984
- * - **Pro-rated Charges**: If plan changed mid-month
1985
- * - **Estimated Total**: Current charges to date
1709
+ * Get Credit Summary
1710
+ * Retrieve comprehensive credit usage summary for the specified graph.
1986
1711
  *
1987
- * Billing calculations are updated hourly. Storage is measured in GB-months.
1712
+ * This endpoint provides:
1713
+ * - Current credit balance and monthly allocation
1714
+ * - Credit consumption metrics for the current month
1715
+ * - Graph tier and credit multiplier information
1716
+ * - Usage percentage to help monitor credit consumption
1988
1717
  *
1989
- * ℹ️ No credits are consumed for viewing billing information.
1718
+ * No credits are consumed for checking credit status.
1990
1719
  */
1991
- export const getCurrentGraphBill = <ThrowOnError extends boolean = false>(options: Options<GetCurrentGraphBillData, ThrowOnError>) => {
1992
- return (options.client ?? _heyApiClient).get<GetCurrentGraphBillResponses, GetCurrentGraphBillErrors, ThrowOnError>({
1720
+ export const getCreditSummary = <ThrowOnError extends boolean = false>(options: Options<GetCreditSummaryData, ThrowOnError>) => {
1721
+ return (options.client ?? _heyApiClient).get<GetCreditSummaryResponses, GetCreditSummaryErrors, ThrowOnError>({
1993
1722
  security: [
1994
1723
  {
1995
1724
  name: 'X-API-Key',
@@ -2000,32 +1729,31 @@ export const getCurrentGraphBill = <ThrowOnError extends boolean = false>(option
2000
1729
  type: 'http'
2001
1730
  }
2002
1731
  ],
2003
- url: '/v1/graphs/{graph_id}/billing/current',
1732
+ url: '/v1/graphs/{graph_id}/credits/summary',
2004
1733
  ...options
2005
1734
  });
2006
1735
  };
2007
1736
 
2008
1737
  /**
2009
- * Get Usage Details
2010
- * Get detailed usage metrics for the graph.
1738
+ * List Credit Transactions
1739
+ * Retrieve detailed credit transaction history for the specified graph.
2011
1740
  *
2012
- * Provides granular usage information including:
2013
- * - **Daily Credit Consumption**: Track credit usage patterns
2014
- * - **Storage Growth**: Monitor database size over time
2015
- * - **Operation Breakdown**: Credits by operation type
2016
- * - **Peak Usage Times**: Identify high-activity periods
2017
- * - **API Call Volumes**: Request counts and patterns
1741
+ * This enhanced endpoint provides:
1742
+ * - Detailed transaction records with idempotency information
1743
+ * - Summary by operation type to identify high-consumption operations
1744
+ * - Date range filtering for analysis
1745
+ * - Metadata search capabilities
2018
1746
  *
2019
- * Useful for:
2020
- * - Optimizing credit consumption
2021
- * - Capacity planning
2022
- * - Usage trend analysis
2023
- * - Cost optimization
1747
+ * Transaction types include:
1748
+ * - ALLOCATION: Monthly credit allocations
1749
+ * - CONSUMPTION: Credit usage for operations
1750
+ * - BONUS: Bonus credits added by admins
1751
+ * - REFUND: Credit refunds
2024
1752
  *
2025
- * ℹ️ No credits are consumed for viewing usage details.
1753
+ * No credits are consumed for viewing transaction history.
2026
1754
  */
2027
- export const getGraphUsageDetails = <ThrowOnError extends boolean = false>(options: Options<GetGraphUsageDetailsData, ThrowOnError>) => {
2028
- return (options.client ?? _heyApiClient).get<GetGraphUsageDetailsResponses, GetGraphUsageDetailsErrors, ThrowOnError>({
1755
+ export const listCreditTransactions = <ThrowOnError extends boolean = false>(options: Options<ListCreditTransactionsData, ThrowOnError>) => {
1756
+ return (options.client ?? _heyApiClient).get<ListCreditTransactionsResponses, ListCreditTransactionsErrors, ThrowOnError>({
2029
1757
  security: [
2030
1758
  {
2031
1759
  name: 'X-API-Key',
@@ -2036,31 +1764,27 @@ export const getGraphUsageDetails = <ThrowOnError extends boolean = false>(optio
2036
1764
  type: 'http'
2037
1765
  }
2038
1766
  ],
2039
- url: '/v1/graphs/{graph_id}/billing/usage',
1767
+ url: '/v1/graphs/{graph_id}/credits/transactions',
2040
1768
  ...options
2041
1769
  });
2042
1770
  };
2043
1771
 
2044
1772
  /**
2045
- * Get Billing History
2046
- * Get billing history for the graph.
1773
+ * Check Credit Balance
1774
+ * Check if the graph has sufficient credits for a planned operation.
2047
1775
  *
2048
- * Returns a chronological list of monthly bills, perfect for:
2049
- * - Tracking spending trends over time
2050
- * - Identifying usage patterns
2051
- * - Budget forecasting
2052
- * - Financial reporting
1776
+ * This endpoint allows you to verify credit availability before performing
1777
+ * an operation, helping prevent failed operations due to insufficient credits.
2053
1778
  *
2054
- * Each month includes:
2055
- * - Credit usage and overages
2056
- * - Storage charges
2057
- * - Total charges
2058
- * - Usage metrics
1779
+ * The check considers:
1780
+ * - Base operation cost
1781
+ * - Graph tier multiplier
1782
+ * - Current credit balance
2059
1783
  *
2060
- * ℹ️ No credits are consumed for viewing billing history.
1784
+ * No credits are consumed for checking availability.
2061
1785
  */
2062
- export const getGraphBillingHistory = <ThrowOnError extends boolean = false>(options: Options<GetGraphBillingHistoryData, ThrowOnError>) => {
2063
- return (options.client ?? _heyApiClient).get<GetGraphBillingHistoryResponses, GetGraphBillingHistoryErrors, ThrowOnError>({
1786
+ export const checkCreditBalance = <ThrowOnError extends boolean = false>(options: Options<CheckCreditBalanceData, ThrowOnError>) => {
1787
+ return (options.client ?? _heyApiClient).get<CheckCreditBalanceResponses, CheckCreditBalanceErrors, ThrowOnError>({
2064
1788
  security: [
2065
1789
  {
2066
1790
  name: 'X-API-Key',
@@ -2071,141 +1795,14 @@ export const getGraphBillingHistory = <ThrowOnError extends boolean = false>(opt
2071
1795
  type: 'http'
2072
1796
  }
2073
1797
  ],
2074
- url: '/v1/graphs/{graph_id}/billing/history',
1798
+ url: '/v1/graphs/{graph_id}/credits/balance/check',
2075
1799
  ...options
2076
1800
  });
2077
1801
  };
2078
1802
 
2079
1803
  /**
2080
- * Get Monthly Bill
2081
- * Get billing details for a specific month.
2082
- *
2083
- * Retrieve historical billing information for any previous month.
2084
- * Useful for:
2085
- * - Reconciling past charges
2086
- * - Tracking usage trends
2087
- * - Expense reporting
2088
- * - Budget analysis
2089
- *
2090
- * Returns the same detailed breakdown as the current bill endpoint.
2091
- *
2092
- * ℹ️ No credits are consumed for viewing billing history.
2093
- */
2094
- export const getGraphMonthlyBill = <ThrowOnError extends boolean = false>(options: Options<GetGraphMonthlyBillData, ThrowOnError>) => {
2095
- return (options.client ?? _heyApiClient).get<GetGraphMonthlyBillResponses, GetGraphMonthlyBillErrors, ThrowOnError>({
2096
- security: [
2097
- {
2098
- name: 'X-API-Key',
2099
- type: 'apiKey'
2100
- },
2101
- {
2102
- scheme: 'bearer',
2103
- type: 'http'
2104
- }
2105
- ],
2106
- url: '/v1/graphs/{graph_id}/billing/history/{year}/{month}',
2107
- ...options
2108
- });
2109
- };
2110
-
2111
- /**
2112
- * Get Credit Summary
2113
- * Retrieve comprehensive credit usage summary for the specified graph.
2114
- *
2115
- * This endpoint provides:
2116
- * - Current credit balance and monthly allocation
2117
- * - Credit consumption metrics for the current month
2118
- * - Graph tier and credit multiplier information
2119
- * - Usage percentage to help monitor credit consumption
2120
- *
2121
- * No credits are consumed for checking credit status.
2122
- */
2123
- export const getCreditSummary = <ThrowOnError extends boolean = false>(options: Options<GetCreditSummaryData, ThrowOnError>) => {
2124
- return (options.client ?? _heyApiClient).get<GetCreditSummaryResponses, GetCreditSummaryErrors, ThrowOnError>({
2125
- security: [
2126
- {
2127
- name: 'X-API-Key',
2128
- type: 'apiKey'
2129
- },
2130
- {
2131
- scheme: 'bearer',
2132
- type: 'http'
2133
- }
2134
- ],
2135
- url: '/v1/graphs/{graph_id}/credits/summary',
2136
- ...options
2137
- });
2138
- };
2139
-
2140
- /**
2141
- * List Credit Transactions
2142
- * Retrieve detailed credit transaction history for the specified graph.
2143
- *
2144
- * This enhanced endpoint provides:
2145
- * - Detailed transaction records with idempotency information
2146
- * - Summary by operation type to identify high-consumption operations
2147
- * - Date range filtering for analysis
2148
- * - Metadata search capabilities
2149
- *
2150
- * Transaction types include:
2151
- * - ALLOCATION: Monthly credit allocations
2152
- * - CONSUMPTION: Credit usage for operations
2153
- * - BONUS: Bonus credits added by admins
2154
- * - REFUND: Credit refunds
2155
- *
2156
- * No credits are consumed for viewing transaction history.
2157
- */
2158
- export const listCreditTransactions = <ThrowOnError extends boolean = false>(options: Options<ListCreditTransactionsData, ThrowOnError>) => {
2159
- return (options.client ?? _heyApiClient).get<ListCreditTransactionsResponses, ListCreditTransactionsErrors, ThrowOnError>({
2160
- security: [
2161
- {
2162
- name: 'X-API-Key',
2163
- type: 'apiKey'
2164
- },
2165
- {
2166
- scheme: 'bearer',
2167
- type: 'http'
2168
- }
2169
- ],
2170
- url: '/v1/graphs/{graph_id}/credits/transactions',
2171
- ...options
2172
- });
2173
- };
2174
-
2175
- /**
2176
- * Check Credit Balance
2177
- * Check if the graph has sufficient credits for a planned operation.
2178
- *
2179
- * This endpoint allows you to verify credit availability before performing
2180
- * an operation, helping prevent failed operations due to insufficient credits.
2181
- *
2182
- * The check considers:
2183
- * - Base operation cost
2184
- * - Graph tier multiplier
2185
- * - Current credit balance
2186
- *
2187
- * No credits are consumed for checking availability.
2188
- */
2189
- export const checkCreditBalance = <ThrowOnError extends boolean = false>(options: Options<CheckCreditBalanceData, ThrowOnError>) => {
2190
- return (options.client ?? _heyApiClient).get<CheckCreditBalanceResponses, CheckCreditBalanceErrors, ThrowOnError>({
2191
- security: [
2192
- {
2193
- name: 'X-API-Key',
2194
- type: 'apiKey'
2195
- },
2196
- {
2197
- scheme: 'bearer',
2198
- type: 'http'
2199
- }
2200
- ],
2201
- url: '/v1/graphs/{graph_id}/credits/balance/check',
2202
- ...options
2203
- });
2204
- };
2205
-
2206
- /**
2207
- * Get Storage Usage
2208
- * Get storage usage history for a graph.
1804
+ * Get Storage Usage
1805
+ * Get storage usage history for a graph.
2209
1806
  *
2210
1807
  * Returns detailed storage usage information including:
2211
1808
  * - Daily average storage consumption
@@ -2555,6 +2152,116 @@ export const getSubgraphQuota = <ThrowOnError extends boolean = false>(options:
2555
2152
  });
2556
2153
  };
2557
2154
 
2155
+ /**
2156
+ * Cancel Subscription
2157
+ * Cancel a subscription.
2158
+ *
2159
+ * For shared repositories: Cancels the user's personal subscription
2160
+ * For user graphs: Not allowed - delete the graph instead
2161
+ *
2162
+ * The subscription will be marked as canceled and will end at the current period end date.
2163
+ */
2164
+ export const cancelSubscription = <ThrowOnError extends boolean = false>(options: Options<CancelSubscriptionData, ThrowOnError>) => {
2165
+ return (options.client ?? _heyApiClient).delete<CancelSubscriptionResponses, CancelSubscriptionErrors, ThrowOnError>({
2166
+ security: [
2167
+ {
2168
+ name: 'X-API-Key',
2169
+ type: 'apiKey'
2170
+ },
2171
+ {
2172
+ scheme: 'bearer',
2173
+ type: 'http'
2174
+ }
2175
+ ],
2176
+ url: '/v1/graphs/{graph_id}/subscriptions',
2177
+ ...options
2178
+ });
2179
+ };
2180
+
2181
+ /**
2182
+ * Get Subscription
2183
+ * Get subscription details for a graph or shared repository.
2184
+ *
2185
+ * For user graphs (kg*): Returns the graph's subscription (owned by graph creator)
2186
+ * For shared repositories (sec, industry, etc.): Returns user's personal subscription to that repository
2187
+ *
2188
+ * This unified endpoint automatically detects the resource type and returns the appropriate subscription.
2189
+ */
2190
+ export const getGraphSubscription = <ThrowOnError extends boolean = false>(options: Options<GetGraphSubscriptionData, ThrowOnError>) => {
2191
+ return (options.client ?? _heyApiClient).get<GetGraphSubscriptionResponses, GetGraphSubscriptionErrors, ThrowOnError>({
2192
+ security: [
2193
+ {
2194
+ name: 'X-API-Key',
2195
+ type: 'apiKey'
2196
+ },
2197
+ {
2198
+ scheme: 'bearer',
2199
+ type: 'http'
2200
+ }
2201
+ ],
2202
+ url: '/v1/graphs/{graph_id}/subscriptions',
2203
+ ...options
2204
+ });
2205
+ };
2206
+
2207
+ /**
2208
+ * Create Repository Subscription
2209
+ * Create a new subscription to a shared repository.
2210
+ *
2211
+ * This endpoint is ONLY for shared repositories (sec, industry, economic).
2212
+ * User graph subscriptions are created automatically when the graph is provisioned.
2213
+ *
2214
+ * The subscription will be created in ACTIVE status immediately and credits will be allocated.
2215
+ */
2216
+ export const createRepositorySubscription = <ThrowOnError extends boolean = false>(options: Options<CreateRepositorySubscriptionData, ThrowOnError>) => {
2217
+ return (options.client ?? _heyApiClient).post<CreateRepositorySubscriptionResponses, CreateRepositorySubscriptionErrors, ThrowOnError>({
2218
+ security: [
2219
+ {
2220
+ name: 'X-API-Key',
2221
+ type: 'apiKey'
2222
+ },
2223
+ {
2224
+ scheme: 'bearer',
2225
+ type: 'http'
2226
+ }
2227
+ ],
2228
+ url: '/v1/graphs/{graph_id}/subscriptions',
2229
+ ...options,
2230
+ headers: {
2231
+ 'Content-Type': 'application/json',
2232
+ ...options.headers
2233
+ }
2234
+ });
2235
+ };
2236
+
2237
+ /**
2238
+ * Upgrade Subscription
2239
+ * Upgrade a subscription to a different plan.
2240
+ *
2241
+ * Works for both user graphs and shared repositories.
2242
+ * The subscription will be immediately updated to the new plan and pricing.
2243
+ */
2244
+ export const upgradeSubscription = <ThrowOnError extends boolean = false>(options: Options<UpgradeSubscriptionData, ThrowOnError>) => {
2245
+ return (options.client ?? _heyApiClient).put<UpgradeSubscriptionResponses, UpgradeSubscriptionErrors, ThrowOnError>({
2246
+ security: [
2247
+ {
2248
+ name: 'X-API-Key',
2249
+ type: 'apiKey'
2250
+ },
2251
+ {
2252
+ scheme: 'bearer',
2253
+ type: 'http'
2254
+ }
2255
+ ],
2256
+ url: '/v1/graphs/{graph_id}/subscriptions/upgrade',
2257
+ ...options,
2258
+ headers: {
2259
+ 'Content-Type': 'application/json',
2260
+ ...options.headers
2261
+ }
2262
+ });
2263
+ };
2264
+
2558
2265
  /**
2559
2266
  * List Staging Tables
2560
2267
  * List all DuckDB staging tables with comprehensive metrics and status.
@@ -3467,4 +3174,240 @@ export const cancelOperation = <ThrowOnError extends boolean = false>(options: O
3467
3174
  url: '/v1/operations/{operation_id}',
3468
3175
  ...options
3469
3176
  });
3177
+ };
3178
+
3179
+ /**
3180
+ * Create Payment Checkout Session
3181
+ * Create a Stripe checkout session for collecting payment method.
3182
+ *
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
3194
+ *
3195
+ * **Enterprise customers** (with invoice_billing_enabled) should not call this endpoint.
3196
+ */
3197
+ export const createCheckoutSession = <ThrowOnError extends boolean = false>(options: Options<CreateCheckoutSessionData, ThrowOnError>) => {
3198
+ return (options.client ?? _heyApiClient).post<CreateCheckoutSessionResponses, CreateCheckoutSessionErrors, ThrowOnError>({
3199
+ security: [
3200
+ {
3201
+ name: 'X-API-Key',
3202
+ type: 'apiKey'
3203
+ },
3204
+ {
3205
+ scheme: 'bearer',
3206
+ type: 'http'
3207
+ }
3208
+ ],
3209
+ url: '/v1/billing/checkout',
3210
+ ...options,
3211
+ headers: {
3212
+ 'Content-Type': 'application/json',
3213
+ ...options.headers
3214
+ }
3215
+ });
3216
+ };
3217
+
3218
+ /**
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.
3224
+ *
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)
3230
+ *
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
3234
+ */
3235
+ export const getCheckoutStatus = <ThrowOnError extends boolean = false>(options: Options<GetCheckoutStatusData, ThrowOnError>) => {
3236
+ return (options.client ?? _heyApiClient).get<GetCheckoutStatusResponses, GetCheckoutStatusErrors, ThrowOnError>({
3237
+ security: [
3238
+ {
3239
+ name: 'X-API-Key',
3240
+ type: 'apiKey'
3241
+ },
3242
+ {
3243
+ scheme: 'bearer',
3244
+ type: 'http'
3245
+ }
3246
+ ],
3247
+ url: '/v1/billing/checkout/{session_id}/status',
3248
+ ...options
3249
+ });
3250
+ };
3251
+
3252
+ /**
3253
+ * Get Customer Info
3254
+ * Get billing customer information including payment methods on file.
3255
+ *
3256
+ * Returns customer details, payment methods, and whether invoice billing is enabled.
3257
+ */
3258
+ export const getBillingCustomer = <ThrowOnError extends boolean = false>(options?: Options<GetBillingCustomerData, ThrowOnError>) => {
3259
+ return (options?.client ?? _heyApiClient).get<GetBillingCustomerResponses, unknown, ThrowOnError>({
3260
+ security: [
3261
+ {
3262
+ name: 'X-API-Key',
3263
+ type: 'apiKey'
3264
+ },
3265
+ {
3266
+ scheme: 'bearer',
3267
+ type: 'http'
3268
+ }
3269
+ ],
3270
+ url: '/v1/billing/customer',
3271
+ ...options
3272
+ });
3273
+ };
3274
+
3275
+ /**
3276
+ * Update Default Payment Method
3277
+ * Update the default payment method for the customer.
3278
+ *
3279
+ * This changes which payment method will be used for future subscription charges.
3280
+ */
3281
+ export const updatePaymentMethod = <ThrowOnError extends boolean = false>(options: Options<UpdatePaymentMethodData, ThrowOnError>) => {
3282
+ return (options.client ?? _heyApiClient).post<UpdatePaymentMethodResponses, UpdatePaymentMethodErrors, ThrowOnError>({
3283
+ security: [
3284
+ {
3285
+ name: 'X-API-Key',
3286
+ type: 'apiKey'
3287
+ },
3288
+ {
3289
+ scheme: 'bearer',
3290
+ type: 'http'
3291
+ }
3292
+ ],
3293
+ url: '/v1/billing/customer/payment-method',
3294
+ ...options,
3295
+ headers: {
3296
+ 'Content-Type': 'application/json',
3297
+ ...options.headers
3298
+ }
3299
+ });
3300
+ };
3301
+
3302
+ /**
3303
+ * List Invoices
3304
+ * List payment history and invoices.
3305
+ *
3306
+ * Returns past invoices with payment status, amounts, and line items.
3307
+ */
3308
+ export const listInvoices = <ThrowOnError extends boolean = false>(options?: Options<ListInvoicesData, ThrowOnError>) => {
3309
+ return (options?.client ?? _heyApiClient).get<ListInvoicesResponses, ListInvoicesErrors, ThrowOnError>({
3310
+ security: [
3311
+ {
3312
+ name: 'X-API-Key',
3313
+ type: 'apiKey'
3314
+ },
3315
+ {
3316
+ scheme: 'bearer',
3317
+ type: 'http'
3318
+ }
3319
+ ],
3320
+ url: '/v1/billing/invoices',
3321
+ ...options
3322
+ });
3323
+ };
3324
+
3325
+ /**
3326
+ * Get Upcoming Invoice
3327
+ * Get preview of the next invoice.
3328
+ *
3329
+ * Returns estimated charges for the next billing period.
3330
+ */
3331
+ export const getUpcomingInvoice = <ThrowOnError extends boolean = false>(options?: Options<GetUpcomingInvoiceData, ThrowOnError>) => {
3332
+ return (options?.client ?? _heyApiClient).get<GetUpcomingInvoiceResponses, unknown, ThrowOnError>({
3333
+ security: [
3334
+ {
3335
+ name: 'X-API-Key',
3336
+ type: 'apiKey'
3337
+ },
3338
+ {
3339
+ scheme: 'bearer',
3340
+ type: 'http'
3341
+ }
3342
+ ],
3343
+ url: '/v1/billing/invoices/upcoming',
3344
+ ...options
3345
+ });
3346
+ };
3347
+
3348
+ /**
3349
+ * List All Subscriptions
3350
+ * List all active and past subscriptions for the user.
3351
+ *
3352
+ * Includes both graph and repository subscriptions with their status, pricing, and billing information.
3353
+ */
3354
+ export const listSubscriptions = <ThrowOnError extends boolean = false>(options?: Options<ListSubscriptionsData, ThrowOnError>) => {
3355
+ return (options?.client ?? _heyApiClient).get<ListSubscriptionsResponses, unknown, ThrowOnError>({
3356
+ security: [
3357
+ {
3358
+ name: 'X-API-Key',
3359
+ type: 'apiKey'
3360
+ },
3361
+ {
3362
+ scheme: 'bearer',
3363
+ type: 'http'
3364
+ }
3365
+ ],
3366
+ url: '/v1/billing/subscriptions',
3367
+ ...options
3368
+ });
3369
+ };
3370
+
3371
+ /**
3372
+ * Get Subscription Details
3373
+ * Get detailed information about a specific subscription.
3374
+ */
3375
+ export const getSubscription = <ThrowOnError extends boolean = false>(options: Options<GetSubscriptionData, ThrowOnError>) => {
3376
+ return (options.client ?? _heyApiClient).get<GetSubscriptionResponses, GetSubscriptionErrors, ThrowOnError>({
3377
+ security: [
3378
+ {
3379
+ name: 'X-API-Key',
3380
+ type: 'apiKey'
3381
+ },
3382
+ {
3383
+ scheme: 'bearer',
3384
+ type: 'http'
3385
+ }
3386
+ ],
3387
+ url: '/v1/billing/subscriptions/{subscription_id}',
3388
+ ...options
3389
+ });
3390
+ };
3391
+
3392
+ /**
3393
+ * Cancel Subscription
3394
+ * Cancel a subscription.
3395
+ *
3396
+ * The subscription will remain active until the end of the current billing period.
3397
+ */
3398
+ export const cancelSubscription2 = <ThrowOnError extends boolean = false>(options: Options<CancelSubscription2Data, ThrowOnError>) => {
3399
+ return (options.client ?? _heyApiClient).post<CancelSubscription2Responses, CancelSubscription2Errors, ThrowOnError>({
3400
+ security: [
3401
+ {
3402
+ name: 'X-API-Key',
3403
+ type: 'apiKey'
3404
+ },
3405
+ {
3406
+ scheme: 'bearer',
3407
+ type: 'http'
3408
+ }
3409
+ ],
3410
+ url: '/v1/billing/subscriptions/{subscription_id}/cancel',
3411
+ ...options
3412
+ });
3470
3413
  };