@buildbase/sdk 0.0.43 → 0.0.45

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/dist/index.d.ts CHANGED
@@ -75,12 +75,14 @@ declare const InvoiceStatuses: {
75
75
  readonly Uncollectible: "uncollectible";
76
76
  readonly Void: "void";
77
77
  };
78
+ type InvoiceStatusType = (typeof InvoiceStatuses)[keyof typeof InvoiceStatuses];
78
79
  /** Subscription item type constants */
79
80
  declare const SubscriptionItemType: {
80
81
  readonly Feature: "feature";
81
82
  readonly Limit: "limit";
82
83
  readonly Quota: "quota";
83
84
  };
85
+ type SubscriptionItemTypeValue = (typeof SubscriptionItemType)[keyof typeof SubscriptionItemType];
84
86
  /** Dunning state constants */
85
87
  declare const DunningState: {
86
88
  readonly None: "none";
@@ -89,11 +91,14 @@ declare const DunningState: {
89
91
  readonly Final: "final";
90
92
  readonly Suspended: "suspended";
91
93
  };
94
+ type DunningStateType = (typeof DunningState)[keyof typeof DunningState];
92
95
  interface ISubscription {
93
96
  _id: string;
94
97
  subscriptionStatus: SubscriptionStatusType;
95
98
  stripePriceId?: string;
96
99
  stripeCurrentPeriodEnd?: string;
100
+ /** When the current monthly usage period ends (quotas reset on this date). */
101
+ usageCurrentPeriodEnd?: string;
97
102
  cancelAtPeriodEnd: boolean;
98
103
  billingInterval?: BillingInterval;
99
104
  /** Trial start date (ISO string). Set when subscription is in trial. */
@@ -213,6 +218,21 @@ interface IPlanVersion {
213
218
  durationDays: number;
214
219
  requireCard: boolean;
215
220
  };
221
+ /** Credit grant configuration. When enabled, credits are granted to workspaces on this plan. */
222
+ creditGrant?: {
223
+ enabled: boolean;
224
+ /** Linked credit package (populated with name, slug, creditAmount). */
225
+ creditPackage?: {
226
+ _id: string;
227
+ name: string;
228
+ slug: string;
229
+ creditAmount: number;
230
+ } | string;
231
+ /** How unused plan credits are handled on renewal: 'reset' = expire old, 'topup' = add to existing. */
232
+ mode: 'reset' | 'topup';
233
+ /** true = credits given fresh every month, false = one-time lifetime grant (default). */
234
+ renewOnPeriod?: boolean;
235
+ };
216
236
  isCurrent?: boolean;
217
237
  isLegacy?: boolean;
218
238
  archived?: boolean;
@@ -360,6 +380,17 @@ interface ICheckoutStripeOptions {
360
380
  /** Custom metadata merged into `subscription_data.metadata` on the Stripe session. */
361
381
  subscriptionMetadata?: Record<string, string>;
362
382
  }
383
+ /**
384
+ * Async callback called before every checkout session is created.
385
+ * Use it to return Stripe-level options (metadata, affiliate IDs, etc.)
386
+ * that should be forwarded to the Stripe checkout session.
387
+ *
388
+ * Return an `ICheckoutStripeOptions` object to merge into the request,
389
+ * or `undefined`/`void` to proceed without extra options.
390
+ *
391
+ * @param request - The checkout request about to be sent (read-only).
392
+ */
393
+ type GetCheckoutStripeParams = (request: Readonly<ICheckoutSessionRequest>) => Promise<ICheckoutStripeOptions | void> | ICheckoutStripeOptions | void;
363
394
  /** Request body for POST .../workspaces/:id/subscription/checkout. */
364
395
  interface ICheckoutSessionRequest {
365
396
  planVersionId: string;
@@ -470,6 +501,15 @@ interface IPublicPlanVersion {
470
501
  durationDays: number;
471
502
  requireCard: boolean;
472
503
  };
504
+ /** Credit grant config. Only present when the plan grants credits. */
505
+ creditGrant?: {
506
+ enabled: boolean;
507
+ creditAmount: number | null;
508
+ packageName: string | null;
509
+ mode: 'reset' | 'topup';
510
+ /** true = credits given fresh every month, false = one-time lifetime grant. */
511
+ renewOnPeriod: boolean;
512
+ };
473
513
  }
474
514
  interface IPublicPlansResponse {
475
515
  items: IPublicPlanItem[];
@@ -565,6 +605,166 @@ interface IUsageLogsResponse {
565
605
  hasNextPage: boolean;
566
606
  hasPrevPage: boolean;
567
607
  }
608
+ /** Credit bucket source (how credits entered the workspace) */
609
+ declare const CreditBucketSource: {
610
+ readonly PlanGrant: "plan_grant";
611
+ readonly CreditPackPurchase: "credit_pack_purchase";
612
+ readonly AdminGrant: "admin_grant";
613
+ readonly Refund: "refund";
614
+ };
615
+ type CreditBucketSourceType = (typeof CreditBucketSource)[keyof typeof CreditBucketSource];
616
+ /** Credit bucket status */
617
+ declare const CreditBucketStatus: {
618
+ readonly Pending: "pending";
619
+ readonly Active: "active";
620
+ readonly Expired: "expired";
621
+ readonly Consumed: "consumed";
622
+ };
623
+ type CreditBucketStatusType = (typeof CreditBucketStatus)[keyof typeof CreditBucketStatus];
624
+ /** Credit transaction type */
625
+ declare const CreditTransactionType: {
626
+ readonly PlanGrant: "plan_grant";
627
+ readonly PackPurchased: "pack_purchased";
628
+ readonly Consumed: "consumed";
629
+ readonly Expired: "expired";
630
+ readonly AdminGrant: "admin_grant";
631
+ readonly AdminRevoke: "admin_revoke";
632
+ readonly Refund: "refund";
633
+ };
634
+ type CreditTransactionTypeValue = (typeof CreditTransactionType)[keyof typeof CreditTransactionType];
635
+ /** Credit balance for a workspace */
636
+ interface ICreditBalance {
637
+ available: number;
638
+ totalGranted: number;
639
+ totalConsumed: number;
640
+ totalExpired: number;
641
+ totalRefunded: number;
642
+ }
643
+ /** Pricing variant for a credit package */
644
+ interface ICreditPackagePricingVariant {
645
+ currency: string;
646
+ /** Price in smallest currency unit (cents) */
647
+ amount: number;
648
+ stripePriceId?: string;
649
+ }
650
+ /** Admin-defined purchasable credit package */
651
+ interface ICreditPackage extends IDocument {
652
+ name: string;
653
+ slug: string;
654
+ description?: string;
655
+ creditAmount: number;
656
+ pricingVariants: ICreditPackagePricingVariant[];
657
+ validityDays?: number;
658
+ isActive: boolean;
659
+ sortOrder: number;
660
+ archived: boolean;
661
+ }
662
+ /** A single credit transaction (user-facing event history) */
663
+ interface ICreditTransaction extends IDocument {
664
+ workspace: string;
665
+ type: CreditTransactionTypeValue;
666
+ /** Positive for grants, negative for consume/expire/revoke */
667
+ amount: number;
668
+ balanceAfter: number;
669
+ description?: string;
670
+ bucket?: string;
671
+ creditPackage?: string;
672
+ actor?: string;
673
+ metadata?: Record<string, any>;
674
+ }
675
+ /** A credit bucket (per-grant allocation with expiry) */
676
+ interface ICreditBucket extends IDocument {
677
+ workspace: string;
678
+ source: CreditBucketSourceType;
679
+ status: CreditBucketStatusType;
680
+ creditAmount: number;
681
+ remaining: number;
682
+ expiresAt?: string;
683
+ activatedAt?: string;
684
+ creditPackage?: string | ICreditPackage;
685
+ grantedBy?: string;
686
+ metadata?: Record<string, any>;
687
+ }
688
+ /** Request body for POST .../credits/consume */
689
+ interface IConsumeCreditsRequest {
690
+ amount: number;
691
+ description?: string;
692
+ idempotencyKey?: string;
693
+ metadata?: Record<string, any>;
694
+ }
695
+ /** Response from POST .../credits/consume */
696
+ interface IConsumeCreditsResponse {
697
+ success: boolean;
698
+ consumed: number;
699
+ balanceAfter: number;
700
+ }
701
+ /** Request body for POST .../credits/purchase */
702
+ interface ICreditPurchaseRequest {
703
+ creditPackageId: string;
704
+ currency?: string;
705
+ successUrl: string;
706
+ cancelUrl: string;
707
+ }
708
+ /** Response from POST .../credits/purchase */
709
+ interface ICreditPurchaseResponse {
710
+ sessionId: string;
711
+ url: string;
712
+ }
713
+ /** Query params for GET .../credits/transactions */
714
+ interface ICreditTransactionsQuery {
715
+ type?: CreditTransactionTypeValue;
716
+ page?: number;
717
+ limit?: number;
718
+ }
719
+ /** Paginated response from GET .../credits/transactions */
720
+ interface ICreditTransactionsResponse {
721
+ docs: ICreditTransaction[];
722
+ totalDocs: number;
723
+ limit: number;
724
+ page: number;
725
+ totalPages: number;
726
+ hasNextPage: boolean;
727
+ hasPrevPage: boolean;
728
+ }
729
+ /** Query params for GET .../credits/buckets */
730
+ interface ICreditBucketsQuery {
731
+ status?: CreditBucketStatusType;
732
+ source?: CreditBucketSourceType;
733
+ page?: number;
734
+ limit?: number;
735
+ }
736
+ /** Paginated response from GET .../credits/buckets */
737
+ interface ICreditBucketsResponse {
738
+ docs: ICreditBucket[];
739
+ totalDocs: number;
740
+ limit: number;
741
+ page: number;
742
+ totalPages: number;
743
+ hasNextPage: boolean;
744
+ hasPrevPage: boolean;
745
+ }
746
+ /** Response from GET .../credits/expiring */
747
+ interface IExpiringCreditsResponse {
748
+ days: number;
749
+ expiringCredits: number;
750
+ buckets: ICreditBucket[];
751
+ }
752
+ /** Public credit package (from public endpoint, no auth) */
753
+ interface IPublicCreditPackage {
754
+ _id: string;
755
+ name: string;
756
+ slug: string;
757
+ description: string;
758
+ creditAmount: number;
759
+ pricingVariants: ICreditPackagePricingVariant[];
760
+ validityDays: number | null;
761
+ sortOrder: number;
762
+ }
763
+ /** Response from GET /:orgId/credit-packages (public, no auth) */
764
+ interface IPublicCreditPackagesResponse {
765
+ packages: IPublicCreditPackage[];
766
+ notes?: string;
767
+ }
568
768
 
569
769
  interface IWorkspace {
570
770
  _id: string;
@@ -1191,6 +1391,14 @@ declare class WorkspaceApi extends BaseApi {
1191
1391
  * @returns Plan group versions response with currentVersion and availableVersions
1192
1392
  */
1193
1393
  getPublicPlans(slug: string): Promise<IPublicPlansResponse>;
1394
+ /**
1395
+ * Get credit packages (public, no auth required).
1396
+ * Returns active credit packages for the org with pricing info.
1397
+ * Use this for public credit store pages.
1398
+ *
1399
+ * @returns Credit packages with pricing variants
1400
+ */
1401
+ getPublicCreditPackages(): Promise<IPublicCreditPackagesResponse>;
1194
1402
  /**
1195
1403
  * Get plan group version details by ID (public, no auth required).
1196
1404
  * Returns the full plan group version with populated plan versions.
@@ -1350,6 +1558,56 @@ declare class WorkspaceApi extends BaseApi {
1350
1558
  email?: boolean;
1351
1559
  push?: boolean;
1352
1560
  }>>;
1561
+ /**
1562
+ * Get credit balance for a workspace.
1563
+ * @param workspaceId - The workspace ID
1564
+ * @returns Credit balance with available, totalGranted, totalConsumed, totalExpired, totalRefunded
1565
+ */
1566
+ getCreditBalance(workspaceId: string): Promise<ICreditBalance>;
1567
+ /**
1568
+ * Consume credits from a workspace balance.
1569
+ * Throws an error with `code: 'INSUFFICIENT_CREDITS'` and `available`/`requested` fields on 402.
1570
+ * @param workspaceId - The workspace ID
1571
+ * @param request - Consume request with amount, optional description, idempotencyKey, metadata
1572
+ * @returns Consume result with consumed amount and balanceAfter
1573
+ */
1574
+ consumeCredits(workspaceId: string, request: IConsumeCreditsRequest): Promise<IConsumeCreditsResponse>;
1575
+ /**
1576
+ * Create a Stripe checkout session for purchasing a credit package.
1577
+ * Returns a checkout URL to redirect the user to.
1578
+ * @param workspaceId - The workspace ID
1579
+ * @param request - Purchase request with creditPackageId, successUrl, cancelUrl, optional currency
1580
+ * @returns Checkout session ID and URL
1581
+ */
1582
+ purchaseCredits(workspaceId: string, request: ICreditPurchaseRequest): Promise<ICreditPurchaseResponse>;
1583
+ /**
1584
+ * List available credit packages for purchase.
1585
+ * Returns active, non-archived packages sorted by sortOrder then creditAmount.
1586
+ * @param workspaceId - The workspace ID
1587
+ * @returns Array of credit packages
1588
+ */
1589
+ getCreditPackages(workspaceId: string): Promise<ICreditPackage[]>;
1590
+ /**
1591
+ * Get paginated credit transaction history.
1592
+ * @param workspaceId - The workspace ID
1593
+ * @param query - Optional filters: type, page, limit
1594
+ * @returns Paginated credit transactions
1595
+ */
1596
+ getCreditTransactions(workspaceId: string, query?: ICreditTransactionsQuery): Promise<ICreditTransactionsResponse>;
1597
+ /**
1598
+ * Get paginated credit buckets.
1599
+ * @param workspaceId - The workspace ID
1600
+ * @param query - Optional filters: status, source, page, limit
1601
+ * @returns Paginated credit buckets
1602
+ */
1603
+ getCreditBuckets(workspaceId: string, query?: ICreditBucketsQuery): Promise<ICreditBucketsResponse>;
1604
+ /**
1605
+ * Get credits expiring within N days.
1606
+ * @param workspaceId - The workspace ID
1607
+ * @param days - Look-ahead window in days (1-90, default 7)
1608
+ * @returns Expiring credits summary with bucket list
1609
+ */
1610
+ getExpiringCredits(workspaceId: string, days?: number): Promise<IExpiringCreditsResponse>;
1353
1611
  }
1354
1612
 
1355
1613
  /**
@@ -1431,6 +1689,12 @@ declare class EventEmitter {
1431
1689
  }
1432
1690
  declare const eventEmitter: EventEmitter;
1433
1691
 
1692
+ /**
1693
+ * Notify all subscribers to refetch credit balance (e.g. after consume or purchase).
1694
+ * Called internally by useConsumeCredits, usePurchaseCredits on success.
1695
+ */
1696
+ declare function invalidateCreditBalance(): void;
1697
+
1434
1698
  /**
1435
1699
  * Notify all subscribers to refetch quota usage (e.g. after recording usage).
1436
1700
  * Called internally by useRecordUsage on success.
@@ -1475,6 +1739,37 @@ declare function invalidateSubscription(): void;
1475
1739
  */
1476
1740
  /** The single URL param name used by the SDK */
1477
1741
  declare const BB_PARAM = "bb";
1742
+ /** BB param action values */
1743
+ declare const BBAction: {
1744
+ readonly Checkout: "checkout";
1745
+ readonly Billing: "billing";
1746
+ readonly SelectPlan: "selectPlan";
1747
+ readonly CreditPurchase: "creditPurchase";
1748
+ readonly OpenCreditStore: "openCreditStore";
1749
+ readonly Invite: "invite";
1750
+ };
1751
+ type BBActionType = (typeof BBAction)[keyof typeof BBAction];
1752
+ /** BB param status values */
1753
+ declare const BBStatus: {
1754
+ readonly Success: "success";
1755
+ readonly Cancel: "cancel";
1756
+ readonly Error: "error";
1757
+ };
1758
+ type BBStatusType = (typeof BBStatus)[keyof typeof BBStatus];
1759
+ /** BB param screen values (mirrors SettingsScreen but avoids cross-layer import) */
1760
+ declare const BBScreen: {
1761
+ readonly Subscription: "subscription";
1762
+ readonly Credits: "credits";
1763
+ readonly Usage: "usage";
1764
+ readonly Users: "users";
1765
+ readonly Profile: "profile";
1766
+ readonly General: "general";
1767
+ readonly Features: "features";
1768
+ readonly Notifications: "notifications";
1769
+ readonly Permissions: "permissions";
1770
+ readonly Danger: "danger";
1771
+ };
1772
+ type BBScreenType = (typeof BBScreen)[keyof typeof BBScreen];
1478
1773
  /**
1479
1774
  * Build a URL with BuildBase params.
1480
1775
  *
@@ -1502,6 +1797,14 @@ declare function createCheckoutRedirectUrls(workspaceId: string, baseUrl?: strin
1502
1797
  successUrl: string;
1503
1798
  cancelUrl: string;
1504
1799
  };
1800
+ /**
1801
+ * Build success + cancel URL pair for credit purchase checkout redirects.
1802
+ * Both include the workspace ID and screen:credits.
1803
+ */
1804
+ declare function createCreditPurchaseRedirectUrls(workspaceId: string, baseUrl?: string): {
1805
+ successUrl: string;
1806
+ cancelUrl: string;
1807
+ };
1505
1808
  /**
1506
1809
  * Read the `bb` param from the current URL.
1507
1810
  * Returns null if no `bb` param is present.
@@ -2159,6 +2462,24 @@ interface NotificationActions {
2159
2462
  */
2160
2463
  send(workspaceId: string, event: string, userId?: string, data?: NotificationData): Promise<NotificationResult>;
2161
2464
  }
2465
+ interface CreditActions {
2466
+ /** Get workspace credit balance */
2467
+ getBalance(workspaceId: string): Promise<ICreditBalance>;
2468
+ /** Consume credits from workspace. Throws with code 'INSUFFICIENT_CREDITS' on 402. */
2469
+ consume(workspaceId: string, request: IConsumeCreditsRequest): Promise<IConsumeCreditsResponse>;
2470
+ /** Create Stripe checkout session for purchasing a credit package */
2471
+ purchase(workspaceId: string, request: ICreditPurchaseRequest): Promise<ICreditPurchaseResponse>;
2472
+ /** List available credit packages for purchase */
2473
+ getPackages(workspaceId: string): Promise<ICreditPackage[]>;
2474
+ /** Get paginated credit transaction history */
2475
+ getTransactions(workspaceId: string, query?: ICreditTransactionsQuery): Promise<ICreditTransactionsResponse>;
2476
+ /** Get paginated credit buckets */
2477
+ getBuckets(workspaceId: string, query?: ICreditBucketsQuery): Promise<ICreditBucketsResponse>;
2478
+ /** Get credits expiring within N days (default 7) */
2479
+ getExpiring(workspaceId: string, days?: number): Promise<IExpiringCreditsResponse>;
2480
+ /** Get credit packages publicly (no auth required) */
2481
+ getPublicPackages(): Promise<IPublicCreditPackagesResponse>;
2482
+ }
2162
2483
  /** All action modules bound to a specific session. Returned by `withSession()`. */
2163
2484
  interface ScopedActions {
2164
2485
  workspace: WorkspaceActions;
@@ -2171,6 +2492,7 @@ interface ScopedActions {
2171
2492
  features: FeatureActions;
2172
2493
  permissions: PermissionActions;
2173
2494
  notification: NotificationActions;
2495
+ credits: CreditActions;
2174
2496
  }
2175
2497
  interface BuildBaseResult extends ScopedActions {
2176
2498
  /**
@@ -2219,5 +2541,5 @@ interface BuildBaseResult extends ScopedActions {
2219
2541
  }
2220
2542
  declare function BuildBase(config: BuildBaseConfig): BuildBaseResult;
2221
2543
 
2222
- export { ApiVersion, AuthApi, AuthStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, BuildBase, CURRENCY_DISPLAY, CURRENCY_FLAG, DEFAULT_ROLE_PERMISSIONS, DunningState, EventEmitter, InvoiceStatuses, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, Permission, PushApi, SDKEvent, SettingsApi, SubscriptionItemType, SubscriptionStatus, UserApi, WorkspaceApi, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, BuildBase as default, eventEmitter, formatCents, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateQuotaUsage, invalidateSubscription, parseWebhookEvent, readBBParams, resolveMaxUsers, resolvePermissions, safeRedirect, saveAuthIntent, validateInvite, validateRedirectUrl, verifyWebhookSignature };
2223
- export type { BetaFormData, BetaFormResponse, BillingInterval, BuildBaseConfig, BuildBaseResult, BuildBaseSession, CheckoutResult, EventData, EventType, FeatureActions, FormatQuotaWithPriceOptions, IAllQuotaUsageResponse, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IEventCallbacks, IInvoice, IInvoiceListResponse, IInvoiceResponse, IOsConfig, IOsState, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, InviteBlockReason, InviteValidation, InvoiceActions, InvoiceStatus, MaxUsersConfig, NotificationData, NotificationEvent, NotificationResult, OnWorkspaceChangeParams, PermissionActions, PermissionContext, PermissionKey, PlanActions, PlanVersionWithPricingVariants, QuotaDisplayValue, QuotaDisplayWithOverage, RolePermissionMap, ScopedActions, SettingsActions, SubscriptionActions, SubscriptionStatusType, UsageActions, UserActions, UserCreatedEventData, UserUpdatedEventData, WorkspaceActions, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };
2544
+ export { ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, BuildBase, CURRENCY_DISPLAY, CURRENCY_FLAG, CreditBucketSource, CreditBucketStatus, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, DunningState, EventEmitter, InvoiceStatuses, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, Permission, PushApi, SDKEvent, SettingsApi, SubscriptionItemType, SubscriptionStatus, UserApi, WorkspaceApi, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, BuildBase as default, eventEmitter, formatCents, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, parseWebhookEvent, readBBParams, resolveMaxUsers, resolvePermissions, safeRedirect, saveAuthIntent, validateInvite, validateRedirectUrl, verifyWebhookSignature };
2545
+ export type { BBActionType, BBScreenType, BBStatusType, BetaFormData, BetaFormResponse, BillingInterval, BuildBaseConfig, BuildBaseResult, BuildBaseSession, CheckoutResult, CreditActions, CreditBucketSourceType, CreditBucketStatusType, CreditTransactionTypeValue, DunningStateType, EventData, EventType, FeatureActions, FormatQuotaWithPriceOptions, GetCheckoutStripeParams, IAllQuotaUsageResponse, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IConsumeCreditsRequest, IConsumeCreditsResponse, ICreditBalance, ICreditBucket, ICreditBucketsQuery, ICreditBucketsResponse, ICreditPackage, ICreditPackagePricingVariant, ICreditPurchaseRequest, ICreditPurchaseResponse, ICreditTransaction, ICreditTransactionsQuery, ICreditTransactionsResponse, IEventCallbacks, IExpiringCreditsResponse, IInvoice, IInvoiceListResponse, IInvoiceResponse, IOsConfig, IOsState, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicCreditPackage, IPublicCreditPackagesResponse, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, InviteBlockReason, InviteValidation, InvoiceActions, InvoiceStatus, InvoiceStatusType, MaxUsersConfig, NotificationData, NotificationEvent, NotificationResult, OnWorkspaceChangeParams, PermissionActions, PermissionContext, PermissionKey, PlanActions, PlanVersionWithPricingVariants, QuotaDisplayValue, QuotaDisplayWithOverage, RolePermissionMap, ScopedActions, SettingsActions, SubscriptionActions, SubscriptionItemTypeValue, SubscriptionStatusType, UsageActions, UserActions, UserCreatedEventData, UserUpdatedEventData, WorkspaceActions, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };