@buildbase/sdk 0.0.18 → 0.0.19
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/README.md +16 -23
- package/dist/index.d.ts +222 -51
- package/dist/index.esm.js +4 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/saas-os.css +1 -1
- package/dist/types/api/currency-utils.d.ts +44 -0
- package/dist/types/api/index.d.ts +5 -0
- package/dist/types/api/pricing-variant-utils.d.ts +53 -0
- package/dist/types/api/quota-utils.d.ts +7 -7
- package/dist/types/api/types.d.ts +93 -41
- package/dist/types/components/pricing/PricingPage.d.ts +2 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/providers/workspace/hooks.d.ts +1 -1
- package/dist/types/providers/workspace/subscription-hooks.d.ts +1 -0
- package/dist/types/providers/workspace/types.d.ts +18 -1
- package/dist/types/providers/workspace/ui/SubscriptionDialog.d.ts +7 -1
- package/package.json +1 -1
|
@@ -7,7 +7,24 @@ export interface IWorkspace {
|
|
|
7
7
|
roles: string[];
|
|
8
8
|
createdBy: string | IUser;
|
|
9
9
|
features: Record<string, boolean>;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Quota usage tracking: { [quotaSlug]: number } – how much of each quota has been used.
|
|
12
|
+
*/
|
|
13
|
+
quotas?: Record<string, number>;
|
|
14
|
+
/**
|
|
15
|
+
* Subscription limits snapshot: { [limitSlug]: number | null } – synced from subscription plan.
|
|
16
|
+
* Limits are maximum values (e.g. max-users, max-workspaces). Updated when subscription is assigned/updated.
|
|
17
|
+
*/
|
|
18
|
+
limits?: Record<string, number | null>;
|
|
19
|
+
subscription?: ISubscription | string | null;
|
|
20
|
+
/** Stripe Customer ID for this workspace. */
|
|
21
|
+
stripeCustomerId?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Billing currency locked for this workspace (set on first subscription).
|
|
24
|
+
* Stripe allows one currency per customer; all future subscriptions must use this currency.
|
|
25
|
+
* When set, subscription UI only shows/uses this currency.
|
|
26
|
+
*/
|
|
27
|
+
billingCurrency?: string | null;
|
|
11
28
|
}
|
|
12
29
|
export interface IWorkspaceFeature {
|
|
13
30
|
_id: string;
|
|
@@ -6,7 +6,13 @@ interface SubscriptionDialogProps {
|
|
|
6
6
|
planVersions: IPlanVersionWithPlan[];
|
|
7
7
|
currentPlanVersionId?: string | null;
|
|
8
8
|
currentStripePriceId?: string | null;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* When set, only this currency is allowed (workspace has existing Stripe billing; Stripe does not allow multiple currencies per customer).
|
|
11
|
+
* When null/undefined, all plan currencies are available.
|
|
12
|
+
*/
|
|
13
|
+
billingCurrency?: string | null;
|
|
14
|
+
/** Called when user selects a plan. Currency is optional (for display/logging only; not sent to API). */
|
|
15
|
+
onSelectPlan: (planVersionId: string, billingInterval: BillingInterval, currency?: string) => Promise<void>;
|
|
10
16
|
loading?: boolean;
|
|
11
17
|
}
|
|
12
18
|
declare const SubscriptionDialog: React.FC<SubscriptionDialogProps>;
|