@streamoid/settings 0.23.0 → 0.25.0

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.mts CHANGED
@@ -794,6 +794,8 @@ interface UsageHistoryItem {
794
794
  /** The workspace id that spent it, on a row of a sponsor's shared credits. */
795
795
  usedBy?: string;
796
796
  poolMemberId?: string;
797
+ /** `"true"` on credits bought by auto top-up rather than Buy credits. */
798
+ autoTopUp?: string;
797
799
  };
798
800
  service?: {
799
801
  serviceGroupName: string;
@@ -964,6 +966,62 @@ interface WorkspaceCreditLimit {
964
966
  setBy?: string;
965
967
  updatedAt?: string;
966
968
  }
969
+ /** What an admin chooses for auto top-up. Billing prices the pack itself. */
970
+ interface AutoTopUpSettings {
971
+ enabled: boolean;
972
+ /** Buy a pack when the balance falls below this many credits. */
973
+ thresholdCredits: number;
974
+ /** Credits bought each time; one of `AutoTopUpView.packs`. */
975
+ packCredits: number;
976
+ /** The most auto top-up buys per billing cycle, in credits. */
977
+ cycleCapCredits: number;
978
+ }
979
+ /**
980
+ * The workspace's auto top-up and what it would charge. Mirrors billing's
981
+ * `GET /auto-topup/:id`: the defaults when it was never set.
982
+ */
983
+ interface AutoTopUpView extends AutoTopUpSettings {
984
+ /** Why billing turned it off (`card_declined`, `authentication_required`,
985
+ * `no_payment_method`, …); cleared when an admin turns it on again. */
986
+ disabledReason: string | null;
987
+ disabledAt: string | null;
988
+ /** A charge is in flight. */
989
+ pending: boolean;
990
+ /** Lower-case ISO code the card is charged in; `null` when unknown. */
991
+ currency: string | null;
992
+ pricePerCredit: number | null;
993
+ /** The packs on offer, priced in `currency` (major units; `null` when unpriced). */
994
+ packs: {
995
+ credits: number;
996
+ amount: number | null;
997
+ }[];
998
+ /** On a paid plan: auto top-up needs one, as Buy credits does. */
999
+ paidPlan: boolean;
1000
+ /** The card auto top-up charges; `null` when there is none. */
1001
+ paymentMethod: {
1002
+ brand: string | null;
1003
+ last4: string | null;
1004
+ } | null;
1005
+ cycle: {
1006
+ start: string;
1007
+ end: string;
1008
+ };
1009
+ /** Credits auto top-up bought (or is buying) this billing cycle. */
1010
+ spentThisCycleCredits: number;
1011
+ lastAttempt: {
1012
+ status: string;
1013
+ credits: number;
1014
+ amountMinor: number | null;
1015
+ currency: string | null;
1016
+ failure: {
1017
+ code?: string;
1018
+ declineCode?: string;
1019
+ message?: string;
1020
+ } | null;
1021
+ createdAt: string;
1022
+ completedAt: string | null;
1023
+ } | null;
1024
+ }
967
1025
  type CreditPoolMode = "fixed" | "percent";
968
1026
  type CreditPoolMemberStatus = "active" | "canceled";
969
1027
  /**
@@ -1242,6 +1300,12 @@ interface SettingsApiAdapter {
1242
1300
  * `LIMIT_BELOW_USAGE` (under `used`) or `LIMIT_ABOVE_TOTAL` (over
1243
1301
  * `totalCredits`), each carrying `used`, `limit` and `totalCredits`. */
1244
1302
  setWorkspaceCreditLimit?: (limit: number | null) => Promise<void>;
1303
+ /** The workspace's auto top-up. Admins only: hosts pass it only to
1304
+ * workspace and org admins. When omitted, there is no "Auto top-up" card. */
1305
+ fetchAutoTopUp?: () => Promise<AutoTopUpView>;
1306
+ /** Save it and return the new view. Turning it on rejects with code
1307
+ * `NO_ACTIVE_SUBSCRIPTION`, `NO_PAYMENT_METHOD` or `UNSUPPORTED_CURRENCY`. */
1308
+ setAutoTopUp?: (input: AutoTopUpSettings) => Promise<AutoTopUpView>;
1245
1309
  /**
1246
1310
  * Who this workspace shares its credits with, or whose it spends. When
1247
1311
  * omitted, Billing hides the "Shared credits" entry.
@@ -2751,6 +2815,65 @@ declare function WorkspaceCreditLimitCard({ unit: cycleUnit }: {
2751
2815
  unit?: CreditCycleUnit;
2752
2816
  }): react.JSX.Element | null;
2753
2817
 
2818
+ /** What the form starts from when the workspace never set it. */
2819
+ declare const AUTO_TOPUP_DEFAULTS: AutoTopUpSettings;
2820
+ type AutoTopUpValidation = {
2821
+ ok: true;
2822
+ value: AutoTopUpSettings;
2823
+ } | {
2824
+ ok: false;
2825
+ reason: string;
2826
+ };
2827
+ /** Keeps only digits, as the user types. */
2828
+ declare function cleanAutoTopUpInput(value: string): string;
2829
+ /** The setting from the form's fields, or why it can't be saved. */
2830
+ declare function validateAutoTopUpInput(input: {
2831
+ enabled: boolean;
2832
+ threshold: string;
2833
+ packCredits: number;
2834
+ cap: string;
2835
+ packs: readonly number[];
2836
+ }): AutoTopUpValidation;
2837
+ /** `amount` (major units) in `currency`: "$80.00", "₹2,500.00". */
2838
+ declare function formatAutoTopUpMoney(amount: number, currency: string | null): string;
2839
+ /** A pack as the select lists it: "1,000 credits · $80.00". */
2840
+ declare function formatPackOption(pack: {
2841
+ credits: number;
2842
+ amount: number | null;
2843
+ }, currency: string | null): string;
2844
+ /** What a cap of `credits` costs at the workspace's price, or `null` when unpriced. */
2845
+ declare function capMoney(credits: number, view: Pick<AutoTopUpView, "pricePerCredit" | "currency">): string | null;
2846
+ /** Why auto top-up can't be turned on here, or `null` when it can. */
2847
+ declare function autoTopUpBlockedReason(view: Pick<AutoTopUpView, "paidPlan" | "paymentMethod" | "pricePerCredit" | "currency">): string | null;
2848
+ /** Why billing turned it off: "Card declined on 30 Nov — auto top-up turned off." */
2849
+ declare function autoTopUpDisabledMessage(reason: string | null, at: string | null): string | null;
2850
+ /**
2851
+ * "Bought 1,000 of 5,000 credits this billing cycle (resets 30 Dec)." Once
2852
+ * the cap is used up (or lowered below what was bought), it says so rather
2853
+ * than read "2,000 of 1,000".
2854
+ */
2855
+ declare function autoTopUpCycleText(view: Pick<AutoTopUpView, "spentThisCycleCredits" | "cycleCapCredits" | "cycle">): string;
2856
+ /**
2857
+ * Why auto top-up is paused, when its latest attempt this cycle was skipped
2858
+ * for the cap and the cap still has no room for a pack: "Cap reached on
2859
+ * 1 Dec — auto top-up is paused until 1 Jan. Raise the cap per billing cycle
2860
+ * to keep topping up." `null` once the cap is raised enough, a later top-up
2861
+ * is attempted, or a new cycle starts. Billing sends no email for this and
2862
+ * leaves the setting on.
2863
+ */
2864
+ declare function autoTopUpCapNotice(view: Pick<AutoTopUpView, "enabled" | "lastAttempt" | "cycle" | "spentThisCycleCredits" | "packCredits" | "cycleCapCredits">, now?: Date): string | null;
2865
+
2866
+ /**
2867
+ * Auto top-up: when credits fall below a threshold, billing buys the chosen
2868
+ * pack on the saved card, up to a cap per billing cycle. Admins only: render
2869
+ * it only for workspace or org admins. Renders nothing when the host has no
2870
+ * `api.fetchAutoTopUp`. `onTopUpSettled` runs when a top-up the card watched
2871
+ * finishes, so the host can reload the balance.
2872
+ */
2873
+ declare function AutoTopUpCard({ onTopUpSettled }?: {
2874
+ onTopUpSettled?: () => void;
2875
+ }): react.JSX.Element | null;
2876
+
2754
2877
  /**
2755
2878
  * Shared credit pool rules and copy, kept out of the components so a host can
2756
2879
  * test them. A sponsor workspace keeps all of its credits and lets other
@@ -3181,4 +3304,4 @@ interface AppSettingsRowProps {
3181
3304
  }
3182
3305
  declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
3183
3306
 
3184
- export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, INVOICE_DOWNLOAD_FAILED_MESSAGE, INVOICE_NOT_AVAILABLE_MESSAGE, InviteUpdateModal, type InvoiceDownloadKind, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsOrganizationWorkspaceJoin, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, UsageLogsTable, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, checkPoolPercentTotal, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, invoiceDownloadKind, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolSharesCredits, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsShowWorkspace, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
3307
+ export { APP_KEYS, AUTO_TOPUP_DEFAULTS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, AutoTopUpCard, type AutoTopUpSettings, type AutoTopUpValidation, type AutoTopUpView, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, INVOICE_DOWNLOAD_FAILED_MESSAGE, INVOICE_NOT_AVAILABLE_MESSAGE, InviteUpdateModal, type InvoiceDownloadKind, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsOrganizationWorkspaceJoin, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, UsageLogsTable, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, autoTopUpBlockedReason, autoTopUpCapNotice, autoTopUpCycleText, autoTopUpDisabledMessage, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, capMoney, checkPoolPercentTotal, cleanAutoTopUpInput, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatAutoTopUpMoney, formatCreditLimit, formatCredits, formatPackOption, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, invoiceDownloadKind, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolSharesCredits, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsShowWorkspace, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateAutoTopUpInput, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
package/dist/index.d.ts CHANGED
@@ -794,6 +794,8 @@ interface UsageHistoryItem {
794
794
  /** The workspace id that spent it, on a row of a sponsor's shared credits. */
795
795
  usedBy?: string;
796
796
  poolMemberId?: string;
797
+ /** `"true"` on credits bought by auto top-up rather than Buy credits. */
798
+ autoTopUp?: string;
797
799
  };
798
800
  service?: {
799
801
  serviceGroupName: string;
@@ -964,6 +966,62 @@ interface WorkspaceCreditLimit {
964
966
  setBy?: string;
965
967
  updatedAt?: string;
966
968
  }
969
+ /** What an admin chooses for auto top-up. Billing prices the pack itself. */
970
+ interface AutoTopUpSettings {
971
+ enabled: boolean;
972
+ /** Buy a pack when the balance falls below this many credits. */
973
+ thresholdCredits: number;
974
+ /** Credits bought each time; one of `AutoTopUpView.packs`. */
975
+ packCredits: number;
976
+ /** The most auto top-up buys per billing cycle, in credits. */
977
+ cycleCapCredits: number;
978
+ }
979
+ /**
980
+ * The workspace's auto top-up and what it would charge. Mirrors billing's
981
+ * `GET /auto-topup/:id`: the defaults when it was never set.
982
+ */
983
+ interface AutoTopUpView extends AutoTopUpSettings {
984
+ /** Why billing turned it off (`card_declined`, `authentication_required`,
985
+ * `no_payment_method`, …); cleared when an admin turns it on again. */
986
+ disabledReason: string | null;
987
+ disabledAt: string | null;
988
+ /** A charge is in flight. */
989
+ pending: boolean;
990
+ /** Lower-case ISO code the card is charged in; `null` when unknown. */
991
+ currency: string | null;
992
+ pricePerCredit: number | null;
993
+ /** The packs on offer, priced in `currency` (major units; `null` when unpriced). */
994
+ packs: {
995
+ credits: number;
996
+ amount: number | null;
997
+ }[];
998
+ /** On a paid plan: auto top-up needs one, as Buy credits does. */
999
+ paidPlan: boolean;
1000
+ /** The card auto top-up charges; `null` when there is none. */
1001
+ paymentMethod: {
1002
+ brand: string | null;
1003
+ last4: string | null;
1004
+ } | null;
1005
+ cycle: {
1006
+ start: string;
1007
+ end: string;
1008
+ };
1009
+ /** Credits auto top-up bought (or is buying) this billing cycle. */
1010
+ spentThisCycleCredits: number;
1011
+ lastAttempt: {
1012
+ status: string;
1013
+ credits: number;
1014
+ amountMinor: number | null;
1015
+ currency: string | null;
1016
+ failure: {
1017
+ code?: string;
1018
+ declineCode?: string;
1019
+ message?: string;
1020
+ } | null;
1021
+ createdAt: string;
1022
+ completedAt: string | null;
1023
+ } | null;
1024
+ }
967
1025
  type CreditPoolMode = "fixed" | "percent";
968
1026
  type CreditPoolMemberStatus = "active" | "canceled";
969
1027
  /**
@@ -1242,6 +1300,12 @@ interface SettingsApiAdapter {
1242
1300
  * `LIMIT_BELOW_USAGE` (under `used`) or `LIMIT_ABOVE_TOTAL` (over
1243
1301
  * `totalCredits`), each carrying `used`, `limit` and `totalCredits`. */
1244
1302
  setWorkspaceCreditLimit?: (limit: number | null) => Promise<void>;
1303
+ /** The workspace's auto top-up. Admins only: hosts pass it only to
1304
+ * workspace and org admins. When omitted, there is no "Auto top-up" card. */
1305
+ fetchAutoTopUp?: () => Promise<AutoTopUpView>;
1306
+ /** Save it and return the new view. Turning it on rejects with code
1307
+ * `NO_ACTIVE_SUBSCRIPTION`, `NO_PAYMENT_METHOD` or `UNSUPPORTED_CURRENCY`. */
1308
+ setAutoTopUp?: (input: AutoTopUpSettings) => Promise<AutoTopUpView>;
1245
1309
  /**
1246
1310
  * Who this workspace shares its credits with, or whose it spends. When
1247
1311
  * omitted, Billing hides the "Shared credits" entry.
@@ -2751,6 +2815,65 @@ declare function WorkspaceCreditLimitCard({ unit: cycleUnit }: {
2751
2815
  unit?: CreditCycleUnit;
2752
2816
  }): react.JSX.Element | null;
2753
2817
 
2818
+ /** What the form starts from when the workspace never set it. */
2819
+ declare const AUTO_TOPUP_DEFAULTS: AutoTopUpSettings;
2820
+ type AutoTopUpValidation = {
2821
+ ok: true;
2822
+ value: AutoTopUpSettings;
2823
+ } | {
2824
+ ok: false;
2825
+ reason: string;
2826
+ };
2827
+ /** Keeps only digits, as the user types. */
2828
+ declare function cleanAutoTopUpInput(value: string): string;
2829
+ /** The setting from the form's fields, or why it can't be saved. */
2830
+ declare function validateAutoTopUpInput(input: {
2831
+ enabled: boolean;
2832
+ threshold: string;
2833
+ packCredits: number;
2834
+ cap: string;
2835
+ packs: readonly number[];
2836
+ }): AutoTopUpValidation;
2837
+ /** `amount` (major units) in `currency`: "$80.00", "₹2,500.00". */
2838
+ declare function formatAutoTopUpMoney(amount: number, currency: string | null): string;
2839
+ /** A pack as the select lists it: "1,000 credits · $80.00". */
2840
+ declare function formatPackOption(pack: {
2841
+ credits: number;
2842
+ amount: number | null;
2843
+ }, currency: string | null): string;
2844
+ /** What a cap of `credits` costs at the workspace's price, or `null` when unpriced. */
2845
+ declare function capMoney(credits: number, view: Pick<AutoTopUpView, "pricePerCredit" | "currency">): string | null;
2846
+ /** Why auto top-up can't be turned on here, or `null` when it can. */
2847
+ declare function autoTopUpBlockedReason(view: Pick<AutoTopUpView, "paidPlan" | "paymentMethod" | "pricePerCredit" | "currency">): string | null;
2848
+ /** Why billing turned it off: "Card declined on 30 Nov — auto top-up turned off." */
2849
+ declare function autoTopUpDisabledMessage(reason: string | null, at: string | null): string | null;
2850
+ /**
2851
+ * "Bought 1,000 of 5,000 credits this billing cycle (resets 30 Dec)." Once
2852
+ * the cap is used up (or lowered below what was bought), it says so rather
2853
+ * than read "2,000 of 1,000".
2854
+ */
2855
+ declare function autoTopUpCycleText(view: Pick<AutoTopUpView, "spentThisCycleCredits" | "cycleCapCredits" | "cycle">): string;
2856
+ /**
2857
+ * Why auto top-up is paused, when its latest attempt this cycle was skipped
2858
+ * for the cap and the cap still has no room for a pack: "Cap reached on
2859
+ * 1 Dec — auto top-up is paused until 1 Jan. Raise the cap per billing cycle
2860
+ * to keep topping up." `null` once the cap is raised enough, a later top-up
2861
+ * is attempted, or a new cycle starts. Billing sends no email for this and
2862
+ * leaves the setting on.
2863
+ */
2864
+ declare function autoTopUpCapNotice(view: Pick<AutoTopUpView, "enabled" | "lastAttempt" | "cycle" | "spentThisCycleCredits" | "packCredits" | "cycleCapCredits">, now?: Date): string | null;
2865
+
2866
+ /**
2867
+ * Auto top-up: when credits fall below a threshold, billing buys the chosen
2868
+ * pack on the saved card, up to a cap per billing cycle. Admins only: render
2869
+ * it only for workspace or org admins. Renders nothing when the host has no
2870
+ * `api.fetchAutoTopUp`. `onTopUpSettled` runs when a top-up the card watched
2871
+ * finishes, so the host can reload the balance.
2872
+ */
2873
+ declare function AutoTopUpCard({ onTopUpSettled }?: {
2874
+ onTopUpSettled?: () => void;
2875
+ }): react.JSX.Element | null;
2876
+
2754
2877
  /**
2755
2878
  * Shared credit pool rules and copy, kept out of the components so a host can
2756
2879
  * test them. A sponsor workspace keeps all of its credits and lets other
@@ -3181,4 +3304,4 @@ interface AppSettingsRowProps {
3181
3304
  }
3182
3305
  declare function AppSettingsRow({ title, description, summary, href, onClick, disabled, disabledReason, ariaLabel, trailing }: AppSettingsRowProps): react.JSX.Element;
3183
3306
 
3184
- export { APP_KEYS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, INVOICE_DOWNLOAD_FAILED_MESSAGE, INVOICE_NOT_AVAILABLE_MESSAGE, InviteUpdateModal, type InvoiceDownloadKind, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsOrganizationWorkspaceJoin, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, UsageLogsTable, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, checkPoolPercentTotal, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatCreditLimit, formatCredits, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, invoiceDownloadKind, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolSharesCredits, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsShowWorkspace, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };
3307
+ export { APP_KEYS, AUTO_TOPUP_DEFAULTS, type AddCreditPoolMemberInput, AdministrationOverview, type AdministrationOverviewProps, type AdministrativeNavigationOptions, type ApiToken, type AppKey, AppSettingsHeader, type AppSettingsHeaderProps, AppSettingsPage, type AppSettingsPageProps, AppSettingsRow, type AppSettingsRowProps, AppSettingsSection, type AppSettingsSectionProps, AutoTopUpCard, type AutoTopUpSettings, type AutoTopUpValidation, type AutoTopUpView, type AvailableCreditsResponse, BILLING_TABLE_FRAME_STYLE, BILLING_TABLE_MIN_HEIGHT, BILLING_TABLE_PAGER_STYLE, BillingContent, type BillingEntitlement, type BillingEventPayload, type BillingProduct, type BillingSubscription, BuyCreditsModal, type BuyCreditsPayload, type BuyCreditsResponse, ConfirmDeleteModal, ConfirmLeaveModal, type ConnectedApp, ConnectedAppsContent, type CreatedToken, type CreditCycleUnit, type CreditLimitUnit, type CreditLimitValidation, type CreditPoolCandidate, type CreditPoolFormerMember, type CreditPoolMember, CreditPoolMemberModal, type CreditPoolMemberModalProps, type CreditPoolMemberStatus, type CreditPoolMode, type CreditPoolResponse, type CreditPoolSelfShare, type CreditsMeter, type CurrentPlanState, type CustomCreditInfo, type CustomCreditResponse, DEFAULT_PERMISSIONS, DEFAULT_USER_LANGUAGE, EMPTY_USAGE_LOGS_PAGE, ExportDateModal, type FetchUsageLogs, type FetchUsageLogsInRangeOptions, INITIAL_USAGE_LOGS_STATE, INVOICE_DOWNLOAD_FAILED_MESSAGE, INVOICE_NOT_AVAILABLE_MESSAGE, InviteUpdateModal, type InvoiceDownloadKind, type InvoicePdfResponse, type LoginMethodsMember, type LoginMethodsSettings, type LoginMethodsSwitchState, MOCK_REFERRED_USERS, type MemberCreditLimit, MemberCreditLimitModal, type MemberCreditLimitRow, type MemberCreditLimitSource, type MemberCreditLimitsResponse, MemberListFrame, type MemberListFrameProps, type MemberListTab, MemberListToolbar, type MemberListToolbarProps, type MemberPermissionsPayload, OrganizationContent, type OrganizationData, type OrganizationDetails, OrganizationIntegrationsContent, type OrganizationInvite, type OrganizationJoinRequest, type OrganizationJoinableWorkspace, OrganizationLoginMethodsContent, type OrganizationMember, OrganizationMemberModal, type OrganizationMemberModalProps, type OrganizationMemberRole, OrganizationModal, OrganizationPicker, type OrganizationPickerItem, type OrganizationPickerProps, type OrganizationPickerType, type OrganizationView, type OrganizationWorkspaceItem, POOL_ERROR_CODES, POOL_EXPIRY_MAX_MONTHS, POOL_NOTE_MAX_LENGTH, PerUserLimitsView, type PoolEndsAtResult, type PoolErrorCode, type PoolExpiryChoice, type PoolValueValidation, type Price, type PriceMetadata, type ProductsResponse, ProfileAvatar, ProfileTab, REMOVE_REASON_MAX_LENGTH, ReferralHistoryView, type ReferralHistoryViewProps, ReferralTab, type ReferredUser, RemovePoolMemberModal, type RemovePoolMemberModalProps, RemoveSelfShareModal, type RemoveSelfShareModalProps, SCOPE_LABELS, ScopeHeader, type ScopeHeaderProps, type ServiceItem, type SetCreditPoolSelfShareInput, type SettingsAdapters, SettingsAdaptersProvider, type SettingsApiAdapter, type SettingsAuthAdapter, type SettingsAuthUser, SettingsContent, type SettingsContentProps, type SettingsImageUploadAdapter, type SettingsIntegrationsAdapter, type SettingsLoginMethodsAdapter, type SettingsNavigationAdapter, type SettingsOrganizationAdapter, type SettingsOrganizationCreateOptions, type SettingsOrganizationCurrent, type SettingsOrganizationJoinableItem, type SettingsOrganizationListItem, type SettingsOrganizationType, type SettingsOrganizationWorkspaceJoin, type SettingsScope, type SettingsTab, type SettingsToastAdapter, SettingsTooltip, type SettingsTooltipPlacement, type SettingsTooltipProps, type SettingsWorkspaceAdapter, type SettingsWorkspaceCurrent, type SettingsWorkspaceListItem, SharedCreditsView, type SharedPoolBalance, SiconKey, type SponsorShareBalance, type StoreItem, type SubscriptionPlan, type SubscriptionResponse, TAB_DESCRIPTIONS, TAB_LABELS, TAB_SCOPE, TAB_TO_URL, type TeamMember, TeamsContent, type TokenExpiry, TokensContent, URL_TO_TAB, USAGE_LOGS_EXPORT_BATCH_SIZE, USAGE_LOGS_EXPORT_EXTRA_REQUESTS, USAGE_LOGS_EXPORT_MAX_ROWS, USAGE_LOGS_PAGE_SIZE, USER_LANGUAGES, type UpdateCreditPoolMemberInput, type UpdateSubscriptionPayload, type UpdateSubscriptionResponse, type UsageHistoryItem, type UsageHistoryPagination, type UsageHistoryResponse, type UsageLogsAction, type UsageLogsExportResult, type UsageLogsPage, UsageLogsPager, type UsageLogsQuery, type UsageLogsState, UsageLogsTable, type UsedByNamesLoader, type UserLanguage, type UserPermissions, WORKSPACE_CREDIT_LIMIT_REACHED, WORKSPACE_CREDIT_LIMIT_REACHED_MESSAGE, WORKSPACE_LIST_PAGE_SIZE, type WorkspaceCreditLimit, WorkspaceCreditLimitCard, type WorkspaceCreditLimitSummary, type WorkspaceData, WorkspaceGeneralTab, type WorkspaceGeneralTabProps, type WorkspaceInvite, type WorkspaceListOrganization, WorkspaceListTab, type WorkspaceMember, WorkspaceModal, type WorkspaceOrganization, type WorkspaceOrganizationRequest, WorkspacePicker, type WorkspacePickerGroup, type WorkspacePickerItem, type WorkspacePickerProps, WorkspaceTab, type WorkspaceUsageResponse, aboveTotalReason, autoTopUpBlockedReason, autoTopUpCapNotice, autoTopUpCycleText, autoTopUpDisabledMessage, belowUsageReason, canManageOnlyWorkspaceCreditLimit, canShowSharedCredits, capMoney, checkPoolPercentTotal, cleanAutoTopUpInput, cleanCreditLimitInput, cleanPoolValueInput, countLabel, createUsedByNamesLoader, creditCycleUnit, creditsMeter, deriveWorkspaceInvitePermission, describeAllowance, describeDefaultLimit, describeMemberLimit, describeWorkspaceCreditLimit, entitlementFromBody, entitlementFromFailure, expiryChoiceFor, fetchUsageLogsInRange, findBillingError, findPoolError, formatAutoTopUpMoney, formatCreditLimit, formatCredits, formatPackOption, formatPoolEndsAt, formatPoolSplit, groupWorkspaceList, hasPaidFeatures, inviteUpdate, invoiceDownloadKind, isLimitAboveTotal, isLimitBelowUsage, isPaidPlan, isSponsoredEntitlement, isWorkspaceCreditLimitReached, joinMembersWithLimits, lastUsedLabel, limitAboveTotalTotal, limitBelowUsageUsed, limitSourceLabel, loadCurrentPlan, loadWorkspaceOrganization, loginMethodsSwitchState, maximumCreditLimit, memberRoleUpdate, minPoolEndDate, minimumCreditLimit, ownCreditsFirstText, parseBillingEntitlement, parseInviteEmails, pausedOwnCreditsText, poolAllocatedPercent, poolAllocationText, poolEndsAtFrom, poolErrorMessage, poolRenewsAtCycleEnd, poolSharesCredits, poolUnallocatedPercent, poolWorkspaceName, productsForCountry, readSettingsCaller, referralCodeOf, referralCountLabel, referralLink, referralSignupDate, rememberSettingsCaller, resolveSettingsTabFromPath, roundCredits, settingsReturnTarget, sharedPoolBannerText, sharedPoolEndsText, sliceUsageLogsPage, sortReferredUsers, sponsorShareBannerText, sponsorShareDetailText, sponsorShareSpentText, sponsoredCreditsText, ssoLabel, toCsv, toLocalDateInput, usageLogsCsvRows, usageLogsDateRange, usageLogsExportFileName, usageLogsPage, usageLogsReducer, usageLogsReloadPage, usageLogsShowWorkspace, usageLogsSpentByOthers, useBillingEntitlement, useSettingsAdapters, useWorkspaceInvitePermission, useWorkspaceOrganization, usedByNamesFrom, usedByWorkspaceKey, userLanguageLabel, validateAutoTopUpInput, validateCreditLimitInput, validateDefaultCreditLimitInput, validatePoolText, validatePoolValue };