@bpinternal/billing-ui 0.14.3 → 0.16.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.ts CHANGED
@@ -74,11 +74,16 @@ export declare type AutoRechargeDialogProps = {
74
74
 
75
75
  export declare type AutoRechargeSetting = AutoRechargeSettings[string];
76
76
 
77
- /**
78
- * Auto-recharge settings, keyed by feature (e.g. 'ai_spend' for the AI-spend
79
- * credit wallet). `threshold`/`chunkSize`/`maxAmount` are nano-dollars
80
- * (1e9 nano = $1) and must be multiples of $5 (5_000_000_000).
81
- */
77
+ export declare type AutoRechargeSettingInput = {
78
+ enabled?: boolean;
79
+ targetType?: 'addon' | 'credit_grant';
80
+ thresholdType?: 'percentage' | 'remaining_amount';
81
+ threshold?: number;
82
+ addonId?: string;
83
+ chunkSize?: number | null;
84
+ maxAmount?: number | null;
85
+ };
86
+
82
87
  export declare type AutoRechargeSettings = Awaited<ReturnType<BillingClient['getAutoRechargeSettings']>>['settings'];
83
88
 
84
89
  /**
@@ -250,9 +255,9 @@ export declare type BillingProviderProps = {
250
255
  featureLabels?: Record<string, (quantity: number) => string>;
251
256
  /**
252
257
  * Workspace billing version (from the generic client's `getWorkspace().billingVersion`).
253
- * Smaug only serves v4 — any other value makes the dialogs render a
254
- * "manage billing in Dashboard" gate instead of the self-serve flow.
255
- * Omit if the host app gates on the version itself.
258
+ * Pre-Smaug versions (v1-v3) make the dialogs render a "manage billing in
259
+ * Dashboard" gate instead of the self-serve flow; v4 (Smaug) and later render
260
+ * the self-serve flow. Omit if the host app gates on the version itself.
256
261
  */
257
262
  billingVersion?: string;
258
263
  /**
@@ -486,6 +491,9 @@ export declare type InvoicesDialogProps = {
486
491
  onOpenChange: (open: boolean) => void;
487
492
  };
488
493
 
494
+ /** v4 (Smaug) and later (e.g. v5) are all self-serve — only v1-v3 are legacy. */
495
+ export declare function isLegacyBillingVersion(version: string): boolean;
496
+
489
497
  export declare const LayersIcon: ({ size, ...props }: IconProps) => JSX.Element;
490
498
 
491
499
  export declare type LimitPreviewRow = {
@@ -820,7 +828,7 @@ export declare type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
820
828
  };
821
829
 
822
830
  export declare type SetAutoRechargeSettingsInput = {
823
- settings: Record<string, AutoRechargeSetting>;
831
+ settings: Record<string, AutoRechargeSettingInput>;
824
832
  };
825
833
 
826
834
  declare type SetCustomerInput = {