autumn-js 1.2.53 → 1.2.55
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/backend/adapters/express.js +4928 -1731
- package/dist/backend/adapters/express.mjs +6 -6
- package/dist/backend/adapters/fetch.js +4928 -1731
- package/dist/backend/adapters/fetch.mjs +6 -6
- package/dist/backend/adapters/hono.js +4928 -1731
- package/dist/backend/adapters/hono.mjs +6 -6
- package/dist/backend/adapters/index.js +4928 -1731
- package/dist/backend/adapters/index.mjs +9 -9
- package/dist/backend/adapters/next.js +4928 -1731
- package/dist/backend/adapters/next.mjs +6 -6
- package/dist/backend/{chunk-QZGNWKGU.mjs → chunk-4SLVJJQ3.mjs} +415 -149
- package/dist/backend/{chunk-UO2U5YHG.mjs → chunk-6O2BRQQG.mjs} +1 -1
- package/dist/backend/{chunk-BZJMZLRO.mjs → chunk-CTDUPQOB.mjs} +2 -2
- package/dist/backend/{chunk-DUWBM6AP.mjs → chunk-HBCBE5EZ.mjs} +2 -2
- package/dist/backend/{chunk-G5BNVBAL.mjs → chunk-QP3VSL4U.mjs} +1 -1
- package/dist/backend/{chunk-6HGIR6SI.mjs → chunk-V6O5INQW.mjs} +1 -1
- package/dist/backend/{chunk-QEMMOYX7.mjs → chunk-W4YHYDGM.mjs} +1 -1
- package/dist/backend/{chunk-AKZ3LI43.mjs → chunk-Z3CFUICE.mjs} +4513 -1582
- package/dist/backend/core/handlers/coreHandler.d.mts +1 -1
- package/dist/backend/core/handlers/coreHandler.d.ts +1 -1
- package/dist/backend/core/handlers/coreHandler.js +4928 -1731
- package/dist/backend/core/handlers/coreHandler.mjs +4 -4
- package/dist/backend/core/handlers/executeRoute.d.mts +1 -1
- package/dist/backend/core/handlers/executeRoute.d.ts +1 -1
- package/dist/backend/core/handlers/executeRoute.mjs +1 -1
- package/dist/backend/core/handlers/handleRouteByName.js +4928 -1731
- package/dist/backend/core/handlers/handleRouteByName.mjs +4 -4
- package/dist/backend/core/handlers/index.d.mts +1 -1
- package/dist/backend/core/handlers/index.d.ts +1 -1
- package/dist/backend/core/handlers/index.js +4928 -1731
- package/dist/backend/core/handlers/index.mjs +5 -5
- package/dist/backend/core/index.d.mts +1 -1
- package/dist/backend/core/index.d.ts +1 -1
- package/dist/backend/core/index.js +4928 -1731
- package/dist/backend/core/index.mjs +7 -7
- package/dist/backend/core/routes/index.d.mts +1 -1
- package/dist/backend/core/routes/index.d.ts +1 -1
- package/dist/backend/core/routes/index.js +415 -149
- package/dist/backend/core/routes/index.mjs +2 -2
- package/dist/backend/core/routes/routeBuilder.d.mts +1 -1
- package/dist/backend/core/routes/routeBuilder.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.mts +1 -1
- package/dist/backend/core/routes/routeConfigs.d.ts +1 -1
- package/dist/backend/core/routes/routeConfigs.js +415 -149
- package/dist/backend/core/routes/routeConfigs.mjs +2 -2
- package/dist/backend/core/types/handlerTypes.d.mts +1 -1
- package/dist/backend/core/types/handlerTypes.d.ts +1 -1
- package/dist/backend/core/types/index.d.mts +1 -1
- package/dist/backend/core/types/index.d.ts +1 -1
- package/dist/backend/core/types/routeTypes.d.mts +1 -1
- package/dist/backend/core/types/routeTypes.d.ts +1 -1
- package/dist/backend/core/utils/index.mjs +3 -3
- package/dist/backend/index.d.mts +2 -2
- package/dist/backend/index.d.ts +2 -2
- package/dist/backend/index.js +4928 -1731
- package/dist/backend/index.mjs +7 -7
- package/dist/backend/{routeTypes-jEkjrH2F.d.mts → routeTypes-BDnJulPJ.d.mts} +4748 -1657
- package/dist/backend/{routeTypes-C9oAOQtZ.d.ts → routeTypes-Cx-p8x5O.d.ts} +4748 -1657
- package/dist/better-auth/{chunk-56PNBTLH.mjs → chunk-EVKS2OKA.mjs} +1 -1
- package/dist/better-auth/{chunk-AI73OSOF.mjs → chunk-JQU4W6BA.mjs} +4514 -1583
- package/dist/better-auth/{chunk-IIOL3QPN.mjs → chunk-ODDA4I3O.mjs} +415 -149
- package/dist/better-auth/index.js +4928 -1731
- package/dist/better-auth/index.mjs +3 -3
- package/dist/better-auth/utils/createAutumnEndpoint.js +415 -149
- package/dist/better-auth/utils/createAutumnEndpoint.mjs +2 -2
- package/dist/better-auth/utils/handleBetterAuthRoute.js +4928 -1731
- package/dist/better-auth/utils/handleBetterAuthRoute.mjs +2 -2
- package/dist/better-auth/utils/index.js +4928 -1731
- package/dist/better-auth/utils/index.mjs +3 -3
- package/dist/react/AutumnContext.d.mts +4 -4
- package/dist/react/AutumnContext.d.ts +4 -4
- package/dist/react/{chunk-CQF3ER2L.mjs → chunk-JV4GHJ4W.mjs} +1 -1
- package/dist/react/{chunk-D6DFRS3U.mjs → chunk-NDHIXCZM.mjs} +2 -1
- package/dist/react/{chunk-BWKG32GC.mjs → chunk-Q7HVHWDK.mjs} +1 -1
- package/dist/react/{chunk-LUBYNTYC.mjs → chunk-VKY4SZNZ.mjs} +1 -1
- package/dist/react/client/AutumnClient.d.mts +4 -4
- package/dist/react/client/AutumnClient.d.ts +4 -4
- package/dist/react/client/IAutumnClient.d.mts +4 -4
- package/dist/react/client/IAutumnClient.d.ts +4 -4
- package/dist/react/client/index.d.mts +4 -4
- package/dist/react/client/index.d.ts +4 -4
- package/dist/react/{customer-4XLHVIIG.d.mts → customer-DyNLAM-_.d.ts} +74 -9
- package/dist/react/{customer-CPv9i8iR.d.ts → customer-Dz1Fr6nJ.d.mts} +74 -9
- package/dist/react/hooks/index.d.mts +4 -4
- package/dist/react/hooks/index.d.ts +4 -4
- package/dist/react/hooks/index.js +2 -1
- package/dist/react/hooks/index.mjs +4 -4
- package/dist/react/hooks/internal/check/balanceToAllowed.d.mts +2 -2
- package/dist/react/hooks/internal/check/balanceToAllowed.d.ts +2 -2
- package/dist/react/hooks/internal/check/customerToFeatures.d.mts +2 -2
- package/dist/react/hooks/internal/check/customerToFeatures.d.ts +2 -2
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.mts +2 -2
- package/dist/react/hooks/internal/check/findCreditSystemsByFeature.d.ts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.d.mts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.d.ts +2 -2
- package/dist/react/hooks/internal/check/getCreditCost.js +2 -1
- package/dist/react/hooks/internal/check/getCreditCost.mjs +1 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.d.mts +3 -3
- package/dist/react/hooks/internal/getLocalCheckResponse.d.ts +3 -3
- package/dist/react/hooks/internal/getLocalCheckResponse.js +2 -1
- package/dist/react/hooks/internal/getLocalCheckResponse.mjs +2 -2
- package/dist/react/hooks/internal/useCustomerActions.d.mts +4 -4
- package/dist/react/hooks/internal/useCustomerActions.d.ts +4 -4
- package/dist/react/hooks/internal/useCustomerActions.js +2 -1
- package/dist/react/hooks/internal/useCustomerActions.mjs +3 -3
- package/dist/react/hooks/useAggregateEvents.d.mts +2 -2
- package/dist/react/hooks/useAggregateEvents.d.ts +2 -2
- package/dist/react/hooks/useCustomer.d.mts +3 -3
- package/dist/react/hooks/useCustomer.d.ts +3 -3
- package/dist/react/hooks/useCustomer.js +2 -1
- package/dist/react/hooks/useCustomer.mjs +4 -4
- package/dist/react/hooks/useEntity.d.mts +2 -2
- package/dist/react/hooks/useEntity.d.ts +2 -2
- package/dist/react/hooks/useListEvents.d.mts +2 -2
- package/dist/react/hooks/useListEvents.d.ts +2 -2
- package/dist/react/hooks/useListPlans.d.mts +3 -3
- package/dist/react/hooks/useListPlans.d.ts +3 -3
- package/dist/react/hooks/useReferrals.d.mts +2 -2
- package/dist/react/hooks/useReferrals.d.ts +2 -2
- package/dist/react/index.d.mts +4 -4
- package/dist/react/index.d.ts +4 -4
- package/dist/react/index.js +2 -1
- package/dist/react/index.mjs +4 -4
- package/dist/react/{list-plans-op-Dsryi9lT.d.mts → list-plans-op-DTkteoH6.d.ts} +656 -468
- package/dist/react/{list-plans-op-jsAtkFHJ.d.ts → list-plans-op-ZRs2lBAB.d.mts} +656 -468
- package/dist/react/{params-BGfGRnue.d.ts → params-BiUwODRL.d.mts} +628 -86
- package/dist/react/{params-DPSGMHHa.d.mts → params-DIglFpGj.d.ts} +628 -86
- package/dist/react/{plan-DEGPMYmh.d.mts → plan-C96AilzT.d.mts} +798 -374
- package/dist/react/{plan-DEGPMYmh.d.ts → plan-C96AilzT.d.ts} +798 -374
- package/dist/sdk/index.d.mts +6891 -2819
- package/dist/sdk/index.d.ts +6891 -2819
- package/dist/sdk/index.js +6582 -1771
- package/dist/sdk/index.mjs +5949 -1670
- package/package.json +1 -1
|
@@ -19,16 +19,57 @@ declare const BalanceType: {
|
|
|
19
19
|
* Feature type: 'boolean' for on/off access, 'metered' for usage-tracked features, 'credit_system' for unified credit pools, 'ai_credit_system' for model-based token pricing.
|
|
20
20
|
*/
|
|
21
21
|
type BalanceType = OpenEnum<typeof BalanceType>;
|
|
22
|
-
type
|
|
22
|
+
type BalanceCreditSchema3 = {
|
|
23
|
+
meteredFeatureId: "";
|
|
24
|
+
/**
|
|
25
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
26
|
+
*/
|
|
27
|
+
billingUnits?: number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Credits consumed per billing-unit group.
|
|
30
|
+
*/
|
|
31
|
+
creditCost: number;
|
|
32
|
+
};
|
|
33
|
+
type BalanceCreditSchema2 = {
|
|
23
34
|
/**
|
|
24
35
|
* ID of the metered feature that draws from this credit system.
|
|
25
36
|
*/
|
|
26
37
|
meteredFeatureId: string;
|
|
27
38
|
/**
|
|
28
|
-
*
|
|
39
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
40
|
+
*/
|
|
41
|
+
billingUnits?: number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Credits consumed per billing-unit group.
|
|
29
44
|
*/
|
|
30
45
|
creditCost: number;
|
|
31
46
|
};
|
|
47
|
+
declare const BalanceToEnum: {
|
|
48
|
+
readonly Inf: "inf";
|
|
49
|
+
};
|
|
50
|
+
type BalanceToEnum = ClosedEnum<typeof BalanceToEnum>;
|
|
51
|
+
type BalanceFeatureTier = {
|
|
52
|
+
/**
|
|
53
|
+
* Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'.
|
|
54
|
+
*/
|
|
55
|
+
to: number | BalanceToEnum;
|
|
56
|
+
/**
|
|
57
|
+
* Credits consumed per billing-unit group within this tier.
|
|
58
|
+
*/
|
|
59
|
+
creditCost: number;
|
|
60
|
+
};
|
|
61
|
+
type BalanceCreditSchema1 = {
|
|
62
|
+
/**
|
|
63
|
+
* ID of the metered feature that draws from this credit system.
|
|
64
|
+
*/
|
|
65
|
+
meteredFeatureId: string;
|
|
66
|
+
/**
|
|
67
|
+
* Number of metered-feature units priced together. Defaults to one when omitted.
|
|
68
|
+
*/
|
|
69
|
+
billingUnits?: number | undefined;
|
|
70
|
+
tierBehavior: "graduated";
|
|
71
|
+
tiers: Array<BalanceFeatureTier>;
|
|
72
|
+
};
|
|
32
73
|
type BalanceModelMarkups = {
|
|
33
74
|
markup?: number | undefined;
|
|
34
75
|
inputCost?: number | undefined;
|
|
@@ -50,6 +91,22 @@ type BalanceDisplay = {
|
|
|
50
91
|
*/
|
|
51
92
|
plural?: string | null | undefined;
|
|
52
93
|
};
|
|
94
|
+
type BalanceStripe = {
|
|
95
|
+
/**
|
|
96
|
+
* Stripe product ID this feature's usage prices bill under.
|
|
97
|
+
*/
|
|
98
|
+
productId?: string | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Stripe meter ID used to create this feature's metered price.
|
|
101
|
+
*/
|
|
102
|
+
meterId?: string | undefined;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Processor mappings for this feature. Present when a Stripe product or meter is set.
|
|
106
|
+
*/
|
|
107
|
+
type BalanceProcessors = {
|
|
108
|
+
stripe?: BalanceStripe | undefined;
|
|
109
|
+
};
|
|
53
110
|
/**
|
|
54
111
|
* The full feature object if expanded.
|
|
55
112
|
*/
|
|
@@ -75,9 +132,13 @@ type BalanceFeature = {
|
|
|
75
132
|
*/
|
|
76
133
|
eventNames?: Array<string> | undefined;
|
|
77
134
|
/**
|
|
78
|
-
* For
|
|
135
|
+
* For classic credit systems: maps metered features to flat or graduated credit costs.
|
|
136
|
+
*/
|
|
137
|
+
creditSchema?: Array<BalanceCreditSchema1 | BalanceCreditSchema2 | BalanceCreditSchema3> | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* Whether usage of this classic credit system should be itemized as invoice credits.
|
|
79
140
|
*/
|
|
80
|
-
|
|
141
|
+
invoiceCredit?: boolean | undefined;
|
|
81
142
|
/**
|
|
82
143
|
* Per-model markup overrides for AI credit systems.
|
|
83
144
|
*/
|
|
@@ -102,6 +163,10 @@ type BalanceFeature = {
|
|
|
102
163
|
* Whether the feature is archived and hidden from the dashboard.
|
|
103
164
|
*/
|
|
104
165
|
archived: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Processor mappings for this feature. Present when a Stripe product or meter is set.
|
|
168
|
+
*/
|
|
169
|
+
processors?: BalanceProcessors | undefined;
|
|
105
170
|
};
|
|
106
171
|
declare const BalanceIntervalEnum: {
|
|
107
172
|
readonly OneOff: "one_off";
|
|
@@ -129,7 +194,7 @@ type BalanceReset = {
|
|
|
129
194
|
*/
|
|
130
195
|
resetsAt: number | null;
|
|
131
196
|
};
|
|
132
|
-
type
|
|
197
|
+
type BreakdownTier = {
|
|
133
198
|
to: number | string;
|
|
134
199
|
amount: number;
|
|
135
200
|
flatAmount?: number | undefined;
|
|
@@ -164,7 +229,7 @@ type BalancePrice = {
|
|
|
164
229
|
/**
|
|
165
230
|
* Tiered pricing configuration if applicable.
|
|
166
231
|
*/
|
|
167
|
-
tiers?: Array<
|
|
232
|
+
tiers?: Array<BreakdownTier> | undefined;
|
|
168
233
|
/**
|
|
169
234
|
* How tiers are applied: graduated (split across bands) or volume (flat rate for the matched tier).
|
|
170
235
|
*/
|
|
@@ -325,7 +390,7 @@ type PlanPriceDisplay = {
|
|
|
325
390
|
};
|
|
326
391
|
type PlanPrice = {
|
|
327
392
|
/**
|
|
328
|
-
* Base price amount for the plan.
|
|
393
|
+
* Base price amount for the plan, in major currency units (e.g. dollars).
|
|
329
394
|
*/
|
|
330
395
|
amount: number;
|
|
331
396
|
/**
|
|
@@ -666,206 +731,479 @@ declare const PlanEnv: {
|
|
|
666
731
|
*/
|
|
667
732
|
type PlanEnv = OpenEnum<typeof PlanEnv>;
|
|
668
733
|
/**
|
|
669
|
-
*
|
|
734
|
+
* Miscellaneous plan-level configuration flags.
|
|
670
735
|
*/
|
|
671
|
-
|
|
672
|
-
|
|
736
|
+
type PlanConfig1 = {
|
|
737
|
+
/**
|
|
738
|
+
* If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state.
|
|
739
|
+
*/
|
|
740
|
+
ignorePastDue: boolean;
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* The time interval for the purchase limit window.
|
|
744
|
+
*/
|
|
745
|
+
declare const PlanPurchaseLimitInterval: {
|
|
746
|
+
readonly Hour: "hour";
|
|
747
|
+
readonly Day: "day";
|
|
673
748
|
readonly Week: "week";
|
|
674
749
|
readonly Month: "month";
|
|
675
|
-
readonly Quarter: "quarter";
|
|
676
|
-
readonly SemiAnnual: "semi_annual";
|
|
677
|
-
readonly Year: "year";
|
|
678
750
|
};
|
|
679
751
|
/**
|
|
680
|
-
*
|
|
752
|
+
* The time interval for the purchase limit window.
|
|
681
753
|
*/
|
|
682
|
-
type
|
|
683
|
-
|
|
754
|
+
type PlanPurchaseLimitInterval = OpenEnum<typeof PlanPurchaseLimitInterval>;
|
|
755
|
+
/**
|
|
756
|
+
* Optional rate limit to cap how often auto top-ups occur.
|
|
757
|
+
*/
|
|
758
|
+
type PlanPurchaseLimit = {
|
|
684
759
|
/**
|
|
685
|
-
*
|
|
760
|
+
* The time interval for the purchase limit window.
|
|
686
761
|
*/
|
|
687
|
-
|
|
762
|
+
interval: PlanPurchaseLimitInterval;
|
|
688
763
|
/**
|
|
689
|
-
*
|
|
764
|
+
* Number of intervals in the purchase limit window.
|
|
690
765
|
*/
|
|
691
|
-
|
|
766
|
+
intervalCount: number;
|
|
767
|
+
/**
|
|
768
|
+
* Maximum number of auto top-ups allowed within the interval.
|
|
769
|
+
*/
|
|
770
|
+
limit: number;
|
|
692
771
|
};
|
|
693
|
-
|
|
694
|
-
* Base price configuration for a plan.
|
|
695
|
-
*/
|
|
696
|
-
type BasePrice = {
|
|
772
|
+
type PlanAutoTopup = {
|
|
697
773
|
/**
|
|
698
|
-
*
|
|
774
|
+
* The ID of the feature (credit balance) to auto top-up.
|
|
699
775
|
*/
|
|
700
|
-
|
|
776
|
+
featureId: string;
|
|
701
777
|
/**
|
|
702
|
-
*
|
|
778
|
+
* Whether auto top-up is enabled.
|
|
703
779
|
*/
|
|
704
|
-
|
|
780
|
+
enabled: boolean;
|
|
705
781
|
/**
|
|
706
|
-
*
|
|
782
|
+
* When the balance drops below this threshold, an auto top-up will be purchased.
|
|
707
783
|
*/
|
|
708
|
-
|
|
784
|
+
threshold: number;
|
|
709
785
|
/**
|
|
710
|
-
*
|
|
786
|
+
* Amount of credits to add per auto top-up.
|
|
711
787
|
*/
|
|
712
|
-
|
|
788
|
+
quantity: number;
|
|
789
|
+
/**
|
|
790
|
+
* Optional rate limit to cap how often auto top-ups occur.
|
|
791
|
+
*/
|
|
792
|
+
purchaseLimit?: PlanPurchaseLimit | undefined;
|
|
793
|
+
/**
|
|
794
|
+
* When true, auto top-up creates a send_invoice invoice instead of auto-charging.
|
|
795
|
+
*/
|
|
796
|
+
invoiceMode?: boolean | undefined;
|
|
713
797
|
};
|
|
714
798
|
/**
|
|
715
|
-
*
|
|
799
|
+
* How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
|
|
716
800
|
*/
|
|
717
|
-
declare const
|
|
718
|
-
readonly
|
|
719
|
-
readonly
|
|
720
|
-
readonly Hour: "hour";
|
|
721
|
-
readonly Day: "day";
|
|
722
|
-
readonly Week: "week";
|
|
723
|
-
readonly Month: "month";
|
|
724
|
-
readonly Quarter: "quarter";
|
|
725
|
-
readonly SemiAnnual: "semi_annual";
|
|
726
|
-
readonly Year: "year";
|
|
801
|
+
declare const PlanLimitType: {
|
|
802
|
+
readonly Absolute: "absolute";
|
|
803
|
+
readonly UsagePercentage: "usage_percentage";
|
|
727
804
|
};
|
|
728
805
|
/**
|
|
729
|
-
*
|
|
730
|
-
*/
|
|
731
|
-
type PlanAddItemResetInterval = OpenEnum<typeof PlanAddItemResetInterval>;
|
|
732
|
-
/**
|
|
733
|
-
* Reset configuration for consumable features. Omit for non-consumable features like seats.
|
|
806
|
+
* How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
|
|
734
807
|
*/
|
|
735
|
-
type
|
|
736
|
-
|
|
737
|
-
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
738
|
-
*/
|
|
739
|
-
interval: PlanAddItemResetInterval;
|
|
740
|
-
/**
|
|
741
|
-
* Number of intervals between resets. Defaults to 1.
|
|
742
|
-
*/
|
|
743
|
-
intervalCount?: number | undefined;
|
|
744
|
-
};
|
|
745
|
-
type AddItemAdditionalCurrency = {
|
|
808
|
+
type PlanLimitType = OpenEnum<typeof PlanLimitType>;
|
|
809
|
+
type PlanSpendLimit = {
|
|
746
810
|
/**
|
|
747
|
-
*
|
|
811
|
+
* Optional feature ID this spend limit applies to.
|
|
748
812
|
*/
|
|
749
|
-
|
|
813
|
+
featureId?: string | undefined;
|
|
750
814
|
/**
|
|
751
|
-
*
|
|
815
|
+
* Whether the overage spend limit is enabled.
|
|
752
816
|
*/
|
|
753
|
-
|
|
754
|
-
};
|
|
755
|
-
type VariantDetailsTierAdditionalCurrency = {
|
|
817
|
+
enabled: boolean;
|
|
756
818
|
/**
|
|
757
|
-
*
|
|
819
|
+
* How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
|
|
758
820
|
*/
|
|
759
|
-
|
|
821
|
+
limitType?: PlanLimitType | undefined;
|
|
760
822
|
/**
|
|
761
|
-
*
|
|
823
|
+
* Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage.
|
|
762
824
|
*/
|
|
763
|
-
|
|
825
|
+
overageLimit?: number | undefined;
|
|
764
826
|
/**
|
|
765
|
-
*
|
|
827
|
+
* When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally.
|
|
766
828
|
*/
|
|
767
|
-
|
|
768
|
-
};
|
|
769
|
-
type PlanVariantDetailsTier = {
|
|
770
|
-
to: number | string;
|
|
771
|
-
amount: number;
|
|
772
|
-
flatAmount?: number | undefined;
|
|
773
|
-
additionalCurrencies?: Array<VariantDetailsTierAdditionalCurrency> | undefined;
|
|
774
|
-
};
|
|
775
|
-
declare const PlanVariantDetailsTierBehavior: {
|
|
776
|
-
readonly Graduated: "graduated";
|
|
777
|
-
readonly Volume: "volume";
|
|
829
|
+
skipOverageBilling?: boolean | undefined;
|
|
778
830
|
};
|
|
779
|
-
type PlanVariantDetailsTierBehavior = OpenEnum<typeof PlanVariantDetailsTierBehavior>;
|
|
780
831
|
/**
|
|
781
|
-
*
|
|
832
|
+
* Interval for the cap, aligned to the customer's billing cycle.
|
|
782
833
|
*/
|
|
783
|
-
declare const
|
|
784
|
-
readonly
|
|
834
|
+
declare const PlanUsageLimitInterval: {
|
|
835
|
+
readonly Day: "day";
|
|
785
836
|
readonly Week: "week";
|
|
786
837
|
readonly Month: "month";
|
|
787
|
-
readonly Quarter: "quarter";
|
|
788
|
-
readonly SemiAnnual: "semi_annual";
|
|
789
838
|
readonly Year: "year";
|
|
790
839
|
};
|
|
791
840
|
/**
|
|
792
|
-
*
|
|
841
|
+
* Interval for the cap, aligned to the customer's billing cycle.
|
|
793
842
|
*/
|
|
794
|
-
type
|
|
843
|
+
type PlanUsageLimitInterval = OpenEnum<typeof PlanUsageLimitInterval>;
|
|
795
844
|
/**
|
|
796
|
-
* '
|
|
845
|
+
* Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
|
|
797
846
|
*/
|
|
798
|
-
declare const
|
|
799
|
-
readonly
|
|
800
|
-
readonly
|
|
847
|
+
declare const PlanAnchor: {
|
|
848
|
+
readonly BillingCycle: "billing_cycle";
|
|
849
|
+
readonly Utc: "utc";
|
|
801
850
|
};
|
|
802
851
|
/**
|
|
803
|
-
* '
|
|
852
|
+
* Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
|
|
804
853
|
*/
|
|
805
|
-
type
|
|
854
|
+
type PlanAnchor = OpenEnum<typeof PlanAnchor>;
|
|
806
855
|
/**
|
|
807
|
-
*
|
|
856
|
+
* When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
|
|
808
857
|
*/
|
|
809
|
-
type
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
* Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
|
|
816
|
-
*/
|
|
817
|
-
additionalCurrencies?: Array<AddItemAdditionalCurrency> | undefined;
|
|
858
|
+
type PlanFilter = {
|
|
859
|
+
properties: {
|
|
860
|
+
[k: string]: string;
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
type PlanUsageLimit = {
|
|
818
864
|
/**
|
|
819
|
-
*
|
|
865
|
+
* The feature this usage limit applies to.
|
|
820
866
|
*/
|
|
821
|
-
|
|
822
|
-
tierBehavior?: PlanVariantDetailsTierBehavior | undefined;
|
|
867
|
+
featureId: string;
|
|
823
868
|
/**
|
|
824
|
-
*
|
|
869
|
+
* Whether this usage limit is enabled.
|
|
825
870
|
*/
|
|
826
|
-
|
|
871
|
+
enabled: boolean;
|
|
827
872
|
/**
|
|
828
|
-
*
|
|
873
|
+
* Maximum units allowed per interval.
|
|
829
874
|
*/
|
|
830
|
-
|
|
875
|
+
limit: number;
|
|
831
876
|
/**
|
|
832
|
-
*
|
|
877
|
+
* Interval for the cap, aligned to the customer's billing cycle.
|
|
833
878
|
*/
|
|
834
|
-
|
|
879
|
+
interval: PlanUsageLimitInterval;
|
|
835
880
|
/**
|
|
836
|
-
* '
|
|
881
|
+
* Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
|
|
837
882
|
*/
|
|
838
|
-
|
|
883
|
+
anchor?: PlanAnchor | undefined;
|
|
839
884
|
/**
|
|
840
|
-
*
|
|
885
|
+
* When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
|
|
841
886
|
*/
|
|
842
|
-
|
|
843
|
-
};
|
|
844
|
-
/**
|
|
845
|
-
* Billing behavior when quantity increases mid-cycle.
|
|
846
|
-
*/
|
|
847
|
-
declare const OnIncrease: {
|
|
848
|
-
readonly BillImmediately: "bill_immediately";
|
|
849
|
-
readonly ProrateImmediately: "prorate_immediately";
|
|
850
|
-
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
851
|
-
readonly BillNextCycle: "bill_next_cycle";
|
|
887
|
+
filter?: PlanFilter | undefined;
|
|
852
888
|
};
|
|
853
889
|
/**
|
|
854
|
-
*
|
|
855
|
-
*/
|
|
856
|
-
type OnIncrease = OpenEnum<typeof OnIncrease>;
|
|
857
|
-
/**
|
|
858
|
-
* Credit behavior when quantity decreases mid-cycle.
|
|
890
|
+
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
859
891
|
*/
|
|
860
|
-
declare const
|
|
861
|
-
readonly
|
|
862
|
-
readonly
|
|
863
|
-
readonly
|
|
864
|
-
readonly
|
|
865
|
-
readonly NoProrations: "no_prorations";
|
|
892
|
+
declare const PlanThresholdType: {
|
|
893
|
+
readonly Usage: "usage";
|
|
894
|
+
readonly UsagePercentage: "usage_percentage";
|
|
895
|
+
readonly Remaining: "remaining";
|
|
896
|
+
readonly RemainingPercentage: "remaining_percentage";
|
|
866
897
|
};
|
|
867
898
|
/**
|
|
868
|
-
*
|
|
899
|
+
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
900
|
+
*/
|
|
901
|
+
type PlanThresholdType = OpenEnum<typeof PlanThresholdType>;
|
|
902
|
+
type PlanUsageAlert = {
|
|
903
|
+
/**
|
|
904
|
+
* The feature ID this alert applies to.
|
|
905
|
+
*/
|
|
906
|
+
featureId?: string | undefined;
|
|
907
|
+
/**
|
|
908
|
+
* Whether this usage alert is enabled.
|
|
909
|
+
*/
|
|
910
|
+
enabled: boolean;
|
|
911
|
+
/**
|
|
912
|
+
* The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage_percentage or remaining_percentage, this is a percentage (0-100).
|
|
913
|
+
*/
|
|
914
|
+
threshold: number;
|
|
915
|
+
/**
|
|
916
|
+
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
917
|
+
*/
|
|
918
|
+
thresholdType: PlanThresholdType;
|
|
919
|
+
/**
|
|
920
|
+
* Optional user-defined label to distinguish multiple alerts on the same feature.
|
|
921
|
+
*/
|
|
922
|
+
name?: string | undefined;
|
|
923
|
+
};
|
|
924
|
+
type PlanOverageAllowed = {
|
|
925
|
+
/**
|
|
926
|
+
* The feature ID this overage allowed control applies to.
|
|
927
|
+
*/
|
|
928
|
+
featureId: string;
|
|
929
|
+
/**
|
|
930
|
+
* Whether overage is allowed for this feature.
|
|
931
|
+
*/
|
|
932
|
+
enabled: boolean;
|
|
933
|
+
};
|
|
934
|
+
/**
|
|
935
|
+
* Plan-level billing controls used as customer defaults.
|
|
936
|
+
*/
|
|
937
|
+
type PlanBillingControls = {
|
|
938
|
+
/**
|
|
939
|
+
* List of auto top-up configurations per feature.
|
|
940
|
+
*/
|
|
941
|
+
autoTopups?: Array<PlanAutoTopup> | undefined;
|
|
942
|
+
/**
|
|
943
|
+
* List of overage spend limits per feature (caps overage spend).
|
|
944
|
+
*/
|
|
945
|
+
spendLimits?: Array<PlanSpendLimit> | undefined;
|
|
946
|
+
/**
|
|
947
|
+
* List of hard usage caps per feature (max units per interval).
|
|
948
|
+
*/
|
|
949
|
+
usageLimits?: Array<PlanUsageLimit> | undefined;
|
|
950
|
+
/**
|
|
951
|
+
* List of usage alert configurations per feature.
|
|
952
|
+
*/
|
|
953
|
+
usageAlerts?: Array<PlanUsageAlert> | undefined;
|
|
954
|
+
/**
|
|
955
|
+
* List of overage allowed controls per feature. When enabled, usage can exceed balance.
|
|
956
|
+
*/
|
|
957
|
+
overageAllowed?: Array<PlanOverageAllowed> | undefined;
|
|
958
|
+
};
|
|
959
|
+
/**
|
|
960
|
+
* The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
|
|
961
|
+
*/
|
|
962
|
+
declare const PlanStatus: {
|
|
963
|
+
readonly Active: "active";
|
|
964
|
+
readonly Scheduled: "scheduled";
|
|
965
|
+
};
|
|
966
|
+
/**
|
|
967
|
+
* The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
|
|
968
|
+
*/
|
|
969
|
+
type PlanStatus = OpenEnum<typeof PlanStatus>;
|
|
970
|
+
/**
|
|
971
|
+
* The action that would occur if this plan were attached to the customer.
|
|
972
|
+
*/
|
|
973
|
+
declare const AttachAction: {
|
|
974
|
+
readonly Activate: "activate";
|
|
975
|
+
readonly Upgrade: "upgrade";
|
|
976
|
+
readonly Downgrade: "downgrade";
|
|
977
|
+
readonly None: "none";
|
|
978
|
+
readonly Purchase: "purchase";
|
|
979
|
+
};
|
|
980
|
+
/**
|
|
981
|
+
* The action that would occur if this plan were attached to the customer.
|
|
982
|
+
*/
|
|
983
|
+
type AttachAction = OpenEnum<typeof AttachAction>;
|
|
984
|
+
type CustomerEligibility = {
|
|
985
|
+
/**
|
|
986
|
+
* Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false.
|
|
987
|
+
*/
|
|
988
|
+
trialAvailable?: boolean | undefined;
|
|
989
|
+
/**
|
|
990
|
+
* The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation.
|
|
991
|
+
*/
|
|
992
|
+
status?: PlanStatus | undefined;
|
|
993
|
+
/**
|
|
994
|
+
* Whether the customer's active instance of this plan is set to cancel.
|
|
995
|
+
*/
|
|
996
|
+
canceling?: boolean | undefined;
|
|
997
|
+
/**
|
|
998
|
+
* Whether the customer is currently on a free trial of this plan.
|
|
999
|
+
*/
|
|
1000
|
+
trialing?: boolean | undefined;
|
|
1001
|
+
/**
|
|
1002
|
+
* The action that would occur if this plan were attached to the customer.
|
|
1003
|
+
*/
|
|
1004
|
+
attachAction: AttachAction;
|
|
1005
|
+
};
|
|
1006
|
+
/**
|
|
1007
|
+
* Billing interval (e.g. 'month', 'year').
|
|
1008
|
+
*/
|
|
1009
|
+
declare const PlanPriceVariantDetailsInterval: {
|
|
1010
|
+
readonly OneOff: "one_off";
|
|
1011
|
+
readonly Week: "week";
|
|
1012
|
+
readonly Month: "month";
|
|
1013
|
+
readonly Quarter: "quarter";
|
|
1014
|
+
readonly SemiAnnual: "semi_annual";
|
|
1015
|
+
readonly Year: "year";
|
|
1016
|
+
};
|
|
1017
|
+
/**
|
|
1018
|
+
* Billing interval (e.g. 'month', 'year').
|
|
1019
|
+
*/
|
|
1020
|
+
type PlanPriceVariantDetailsInterval = OpenEnum<typeof PlanPriceVariantDetailsInterval>;
|
|
1021
|
+
type VariantDetailsAdditionalCurrency = {
|
|
1022
|
+
/**
|
|
1023
|
+
* Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
|
|
1024
|
+
*/
|
|
1025
|
+
currency: string;
|
|
1026
|
+
/**
|
|
1027
|
+
* Price amount in this currency. Set explicitly per currency, not converted from the base amount.
|
|
1028
|
+
*/
|
|
1029
|
+
amount: number;
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Base price configuration for a plan.
|
|
1033
|
+
*/
|
|
1034
|
+
type BasePrice = {
|
|
1035
|
+
/**
|
|
1036
|
+
* Base price amount for the plan, in major currency units (e.g. dollars).
|
|
1037
|
+
*/
|
|
1038
|
+
amount: number;
|
|
1039
|
+
/**
|
|
1040
|
+
* Billing interval (e.g. 'month', 'year').
|
|
1041
|
+
*/
|
|
1042
|
+
interval: PlanPriceVariantDetailsInterval;
|
|
1043
|
+
/**
|
|
1044
|
+
* Number of intervals per billing cycle. Defaults to 1.
|
|
1045
|
+
*/
|
|
1046
|
+
intervalCount?: number | undefined;
|
|
1047
|
+
/**
|
|
1048
|
+
* Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
|
|
1049
|
+
*/
|
|
1050
|
+
additionalCurrencies?: Array<VariantDetailsAdditionalCurrency> | undefined;
|
|
1051
|
+
};
|
|
1052
|
+
/**
|
|
1053
|
+
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
1054
|
+
*/
|
|
1055
|
+
declare const PlanAddItemResetInterval: {
|
|
1056
|
+
readonly OneOff: "one_off";
|
|
1057
|
+
readonly Minute: "minute";
|
|
1058
|
+
readonly Hour: "hour";
|
|
1059
|
+
readonly Day: "day";
|
|
1060
|
+
readonly Week: "week";
|
|
1061
|
+
readonly Month: "month";
|
|
1062
|
+
readonly Quarter: "quarter";
|
|
1063
|
+
readonly SemiAnnual: "semi_annual";
|
|
1064
|
+
readonly Year: "year";
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
1068
|
+
*/
|
|
1069
|
+
type PlanAddItemResetInterval = OpenEnum<typeof PlanAddItemResetInterval>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Reset configuration for consumable features. Omit for non-consumable features like seats.
|
|
1072
|
+
*/
|
|
1073
|
+
type PlanVariantDetailsReset1 = {
|
|
1074
|
+
/**
|
|
1075
|
+
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
1076
|
+
*/
|
|
1077
|
+
interval: PlanAddItemResetInterval;
|
|
1078
|
+
/**
|
|
1079
|
+
* Number of intervals between resets. Defaults to 1.
|
|
1080
|
+
*/
|
|
1081
|
+
intervalCount?: number | undefined;
|
|
1082
|
+
};
|
|
1083
|
+
type AddItemAdditionalCurrency = {
|
|
1084
|
+
/**
|
|
1085
|
+
* Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
|
|
1086
|
+
*/
|
|
1087
|
+
currency: string;
|
|
1088
|
+
/**
|
|
1089
|
+
* Price amount in this currency. Set explicitly per currency, not converted from the base amount.
|
|
1090
|
+
*/
|
|
1091
|
+
amount: number;
|
|
1092
|
+
};
|
|
1093
|
+
type VariantDetailsTierAdditionalCurrency = {
|
|
1094
|
+
/**
|
|
1095
|
+
* Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
|
|
1096
|
+
*/
|
|
1097
|
+
currency: string;
|
|
1098
|
+
/**
|
|
1099
|
+
* Per-unit amount for this tier in this currency.
|
|
1100
|
+
*/
|
|
1101
|
+
amount?: number | undefined;
|
|
1102
|
+
/**
|
|
1103
|
+
* Flat amount for this tier in this currency, if the tier uses one.
|
|
1104
|
+
*/
|
|
1105
|
+
flatAmount?: number | undefined;
|
|
1106
|
+
};
|
|
1107
|
+
type PlanVariantDetailsTier1 = {
|
|
1108
|
+
to: number | string;
|
|
1109
|
+
amount: number;
|
|
1110
|
+
flatAmount?: number | undefined;
|
|
1111
|
+
additionalCurrencies?: Array<VariantDetailsTierAdditionalCurrency> | undefined;
|
|
1112
|
+
};
|
|
1113
|
+
declare const PlanVariantDetailsTierBehavior1: {
|
|
1114
|
+
readonly Graduated: "graduated";
|
|
1115
|
+
readonly Volume: "volume";
|
|
1116
|
+
};
|
|
1117
|
+
type PlanVariantDetailsTierBehavior1 = OpenEnum<typeof PlanVariantDetailsTierBehavior1>;
|
|
1118
|
+
/**
|
|
1119
|
+
* Billing interval. For consumable features, should match reset.interval.
|
|
1120
|
+
*/
|
|
1121
|
+
declare const PlanAddItemPriceInterval: {
|
|
1122
|
+
readonly OneOff: "one_off";
|
|
1123
|
+
readonly Week: "week";
|
|
1124
|
+
readonly Month: "month";
|
|
1125
|
+
readonly Quarter: "quarter";
|
|
1126
|
+
readonly SemiAnnual: "semi_annual";
|
|
1127
|
+
readonly Year: "year";
|
|
1128
|
+
};
|
|
1129
|
+
/**
|
|
1130
|
+
* Billing interval. For consumable features, should match reset.interval.
|
|
1131
|
+
*/
|
|
1132
|
+
type PlanAddItemPriceInterval = OpenEnum<typeof PlanAddItemPriceInterval>;
|
|
1133
|
+
/**
|
|
1134
|
+
* 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
|
|
1135
|
+
*/
|
|
1136
|
+
declare const PlanAddItemBillingMethod: {
|
|
1137
|
+
readonly Prepaid: "prepaid";
|
|
1138
|
+
readonly UsageBased: "usage_based";
|
|
1139
|
+
};
|
|
1140
|
+
/**
|
|
1141
|
+
* 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
|
|
1142
|
+
*/
|
|
1143
|
+
type PlanAddItemBillingMethod = OpenEnum<typeof PlanAddItemBillingMethod>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Pricing for usage beyond included units. Omit for free features.
|
|
1146
|
+
*/
|
|
1147
|
+
type PlanVariantDetailsPrice1 = {
|
|
1148
|
+
/**
|
|
1149
|
+
* Price per billing_units after included usage. Either 'amount' or 'tiers' is required.
|
|
1150
|
+
*/
|
|
1151
|
+
amount?: number | undefined;
|
|
1152
|
+
/**
|
|
1153
|
+
* Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
|
|
1154
|
+
*/
|
|
1155
|
+
additionalCurrencies?: Array<AddItemAdditionalCurrency> | undefined;
|
|
1156
|
+
/**
|
|
1157
|
+
* Tiered pricing. Either 'amount' or 'tiers' is required.
|
|
1158
|
+
*/
|
|
1159
|
+
tiers?: Array<PlanVariantDetailsTier1> | undefined;
|
|
1160
|
+
tierBehavior?: PlanVariantDetailsTierBehavior1 | undefined;
|
|
1161
|
+
/**
|
|
1162
|
+
* Billing interval. For consumable features, should match reset.interval.
|
|
1163
|
+
*/
|
|
1164
|
+
interval: PlanAddItemPriceInterval;
|
|
1165
|
+
/**
|
|
1166
|
+
* Number of intervals per billing cycle. Defaults to 1.
|
|
1167
|
+
*/
|
|
1168
|
+
intervalCount: number;
|
|
1169
|
+
/**
|
|
1170
|
+
* Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200).
|
|
1171
|
+
*/
|
|
1172
|
+
billingUnits: number;
|
|
1173
|
+
/**
|
|
1174
|
+
* 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
|
|
1175
|
+
*/
|
|
1176
|
+
billingMethod: PlanAddItemBillingMethod;
|
|
1177
|
+
/**
|
|
1178
|
+
* Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit.
|
|
1179
|
+
*/
|
|
1180
|
+
maxPurchase?: number | null | undefined;
|
|
1181
|
+
};
|
|
1182
|
+
/**
|
|
1183
|
+
* Billing behavior when quantity increases mid-cycle.
|
|
1184
|
+
*/
|
|
1185
|
+
declare const OnIncrease: {
|
|
1186
|
+
readonly BillImmediately: "bill_immediately";
|
|
1187
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
1188
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1189
|
+
readonly BillNextCycle: "bill_next_cycle";
|
|
1190
|
+
};
|
|
1191
|
+
/**
|
|
1192
|
+
* Billing behavior when quantity increases mid-cycle.
|
|
1193
|
+
*/
|
|
1194
|
+
type OnIncrease = OpenEnum<typeof OnIncrease>;
|
|
1195
|
+
/**
|
|
1196
|
+
* Credit behavior when quantity decreases mid-cycle.
|
|
1197
|
+
*/
|
|
1198
|
+
declare const OnDecrease: {
|
|
1199
|
+
readonly Prorate: "prorate";
|
|
1200
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
1201
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1202
|
+
readonly None: "none";
|
|
1203
|
+
readonly NoProrations: "no_prorations";
|
|
1204
|
+
};
|
|
1205
|
+
/**
|
|
1206
|
+
* Credit behavior when quantity decreases mid-cycle.
|
|
869
1207
|
*/
|
|
870
1208
|
type OnDecrease = OpenEnum<typeof OnDecrease>;
|
|
871
1209
|
/**
|
|
@@ -895,7 +1233,7 @@ type VariantDetailsExpiryDurationType = OpenEnum<typeof VariantDetailsExpiryDura
|
|
|
895
1233
|
/**
|
|
896
1234
|
* Rollover config for unused units. If set, unused included units carry over.
|
|
897
1235
|
*/
|
|
898
|
-
type
|
|
1236
|
+
type PlanVariantDetailsRollover1 = {
|
|
899
1237
|
/**
|
|
900
1238
|
* Max rollover units. Omit for unlimited rollover.
|
|
901
1239
|
*/
|
|
@@ -936,11 +1274,11 @@ type PlanPlanItem = {
|
|
|
936
1274
|
/**
|
|
937
1275
|
* Reset configuration for consumable features. Omit for non-consumable features like seats.
|
|
938
1276
|
*/
|
|
939
|
-
reset?:
|
|
1277
|
+
reset?: PlanVariantDetailsReset1 | undefined;
|
|
940
1278
|
/**
|
|
941
1279
|
* Pricing for usage beyond included units. Omit for free features.
|
|
942
1280
|
*/
|
|
943
|
-
price?:
|
|
1281
|
+
price?: PlanVariantDetailsPrice1 | undefined;
|
|
944
1282
|
/**
|
|
945
1283
|
* Proration settings for prepaid features. Controls mid-cycle quantity change billing.
|
|
946
1284
|
*/
|
|
@@ -948,7 +1286,7 @@ type PlanPlanItem = {
|
|
|
948
1286
|
/**
|
|
949
1287
|
* Rollover config for unused units. If set, unused included units carry over.
|
|
950
1288
|
*/
|
|
951
|
-
rollover?:
|
|
1289
|
+
rollover?: PlanVariantDetailsRollover1 | undefined;
|
|
952
1290
|
};
|
|
953
1291
|
/**
|
|
954
1292
|
* Match items with this billing method (prepaid or usage_based).
|
|
@@ -1002,6 +1340,10 @@ type PlanItemFilter = {
|
|
|
1002
1340
|
* Match items with this interval_count. Disambiguates between items that share an interval but differ in count.
|
|
1003
1341
|
*/
|
|
1004
1342
|
intervalCount?: number | undefined;
|
|
1343
|
+
/**
|
|
1344
|
+
* Match items whose grant equals this included usage. Omitted is a wildcard.
|
|
1345
|
+
*/
|
|
1346
|
+
included?: number | undefined;
|
|
1005
1347
|
};
|
|
1006
1348
|
/**
|
|
1007
1349
|
* Unit of time for the trial ('day', 'month', 'year').
|
|
@@ -1039,7 +1381,7 @@ type FreeTrialParams = {
|
|
|
1039
1381
|
*/
|
|
1040
1382
|
durationType: PlanVariantDetailsDurationType1;
|
|
1041
1383
|
/**
|
|
1042
|
-
* If true, payment method required to start trial
|
|
1384
|
+
* If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false.
|
|
1043
1385
|
*/
|
|
1044
1386
|
cardRequired: boolean;
|
|
1045
1387
|
/**
|
|
@@ -1050,7 +1392,7 @@ type FreeTrialParams = {
|
|
|
1050
1392
|
/**
|
|
1051
1393
|
* The time interval for the purchase limit window.
|
|
1052
1394
|
*/
|
|
1053
|
-
declare const
|
|
1395
|
+
declare const PlanVariantDetailsPurchaseLimitInterval1: {
|
|
1054
1396
|
readonly Hour: "hour";
|
|
1055
1397
|
readonly Day: "day";
|
|
1056
1398
|
readonly Week: "week";
|
|
@@ -1059,15 +1401,15 @@ declare const PlanVariantDetailsPurchaseLimitInterval: {
|
|
|
1059
1401
|
/**
|
|
1060
1402
|
* The time interval for the purchase limit window.
|
|
1061
1403
|
*/
|
|
1062
|
-
type
|
|
1404
|
+
type PlanVariantDetailsPurchaseLimitInterval1 = OpenEnum<typeof PlanVariantDetailsPurchaseLimitInterval1>;
|
|
1063
1405
|
/**
|
|
1064
1406
|
* Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
|
|
1065
1407
|
*/
|
|
1066
|
-
type
|
|
1408
|
+
type PlanVariantDetailsPurchaseLimit1 = {
|
|
1067
1409
|
/**
|
|
1068
1410
|
* The time interval for the purchase limit window.
|
|
1069
1411
|
*/
|
|
1070
|
-
interval:
|
|
1412
|
+
interval: PlanVariantDetailsPurchaseLimitInterval1;
|
|
1071
1413
|
/**
|
|
1072
1414
|
* Number of intervals in the purchase limit window.
|
|
1073
1415
|
*/
|
|
@@ -1081,7 +1423,7 @@ type PlanVariantDetailsPurchaseLimit = {
|
|
|
1081
1423
|
*/
|
|
1082
1424
|
count?: number | undefined;
|
|
1083
1425
|
};
|
|
1084
|
-
type
|
|
1426
|
+
type PlanVariantDetailsAutoTopup1 = {
|
|
1085
1427
|
/**
|
|
1086
1428
|
* The ID of the feature (credit balance) to auto top-up.
|
|
1087
1429
|
*/
|
|
@@ -1101,7 +1443,7 @@ type PlanVariantDetailsAutoTopup = {
|
|
|
1101
1443
|
/**
|
|
1102
1444
|
* Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups.
|
|
1103
1445
|
*/
|
|
1104
|
-
purchaseLimit?:
|
|
1446
|
+
purchaseLimit?: PlanVariantDetailsPurchaseLimit1 | undefined;
|
|
1105
1447
|
/**
|
|
1106
1448
|
* When true, auto top-up creates a send_invoice invoice instead of auto-charging.
|
|
1107
1449
|
*/
|
|
@@ -1110,15 +1452,15 @@ type PlanVariantDetailsAutoTopup = {
|
|
|
1110
1452
|
/**
|
|
1111
1453
|
* How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
|
|
1112
1454
|
*/
|
|
1113
|
-
declare const
|
|
1455
|
+
declare const PlanVariantDetailsLimitType1: {
|
|
1114
1456
|
readonly Absolute: "absolute";
|
|
1115
1457
|
readonly UsagePercentage: "usage_percentage";
|
|
1116
1458
|
};
|
|
1117
1459
|
/**
|
|
1118
1460
|
* How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
|
|
1119
1461
|
*/
|
|
1120
|
-
type
|
|
1121
|
-
type
|
|
1462
|
+
type PlanVariantDetailsLimitType1 = OpenEnum<typeof PlanVariantDetailsLimitType1>;
|
|
1463
|
+
type PlanVariantDetailsSpendLimit1 = {
|
|
1122
1464
|
/**
|
|
1123
1465
|
* Optional feature ID this spend limit applies to.
|
|
1124
1466
|
*/
|
|
@@ -1130,7 +1472,7 @@ type PlanVariantDetailsSpendLimit = {
|
|
|
1130
1472
|
/**
|
|
1131
1473
|
* How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance.
|
|
1132
1474
|
*/
|
|
1133
|
-
limitType?:
|
|
1475
|
+
limitType?: PlanVariantDetailsLimitType1 | undefined;
|
|
1134
1476
|
/**
|
|
1135
1477
|
* Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage.
|
|
1136
1478
|
*/
|
|
@@ -1143,7 +1485,7 @@ type PlanVariantDetailsSpendLimit = {
|
|
|
1143
1485
|
/**
|
|
1144
1486
|
* Interval for the cap, aligned to the customer's billing cycle.
|
|
1145
1487
|
*/
|
|
1146
|
-
declare const
|
|
1488
|
+
declare const PlanVariantDetailsUsageLimitInterval1: {
|
|
1147
1489
|
readonly Day: "day";
|
|
1148
1490
|
readonly Week: "week";
|
|
1149
1491
|
readonly Month: "month";
|
|
@@ -1152,27 +1494,27 @@ declare const PlanVariantDetailsUsageLimitInterval: {
|
|
|
1152
1494
|
/**
|
|
1153
1495
|
* Interval for the cap, aligned to the customer's billing cycle.
|
|
1154
1496
|
*/
|
|
1155
|
-
type
|
|
1497
|
+
type PlanVariantDetailsUsageLimitInterval1 = OpenEnum<typeof PlanVariantDetailsUsageLimitInterval1>;
|
|
1156
1498
|
/**
|
|
1157
1499
|
* Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
|
|
1158
1500
|
*/
|
|
1159
|
-
declare const
|
|
1501
|
+
declare const PlanVariantDetailsAnchor1: {
|
|
1160
1502
|
readonly BillingCycle: "billing_cycle";
|
|
1161
1503
|
readonly Utc: "utc";
|
|
1162
1504
|
};
|
|
1163
1505
|
/**
|
|
1164
1506
|
* Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
|
|
1165
1507
|
*/
|
|
1166
|
-
type
|
|
1508
|
+
type PlanVariantDetailsAnchor1 = OpenEnum<typeof PlanVariantDetailsAnchor1>;
|
|
1167
1509
|
/**
|
|
1168
1510
|
* When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
|
|
1169
1511
|
*/
|
|
1170
|
-
type
|
|
1512
|
+
type PlanVariantDetailsFilter1 = {
|
|
1171
1513
|
properties: {
|
|
1172
1514
|
[k: string]: string;
|
|
1173
1515
|
};
|
|
1174
1516
|
};
|
|
1175
|
-
type
|
|
1517
|
+
type PlanVariantDetailsUsageLimit1 = {
|
|
1176
1518
|
/**
|
|
1177
1519
|
* The feature this usage limit applies to.
|
|
1178
1520
|
*/
|
|
@@ -1188,20 +1530,20 @@ type PlanVariantDetailsUsageLimit = {
|
|
|
1188
1530
|
/**
|
|
1189
1531
|
* Interval for the cap, aligned to the customer's billing cycle.
|
|
1190
1532
|
*/
|
|
1191
|
-
interval:
|
|
1533
|
+
interval: PlanVariantDetailsUsageLimitInterval1;
|
|
1192
1534
|
/**
|
|
1193
1535
|
* Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar.
|
|
1194
1536
|
*/
|
|
1195
|
-
anchor?:
|
|
1537
|
+
anchor?: PlanVariantDetailsAnchor1 | undefined;
|
|
1196
1538
|
/**
|
|
1197
1539
|
* When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature.
|
|
1198
1540
|
*/
|
|
1199
|
-
filter?:
|
|
1541
|
+
filter?: PlanVariantDetailsFilter1 | undefined;
|
|
1200
1542
|
};
|
|
1201
1543
|
/**
|
|
1202
1544
|
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
1203
1545
|
*/
|
|
1204
|
-
declare const
|
|
1546
|
+
declare const PlanVariantDetailsThresholdType1: {
|
|
1205
1547
|
readonly Usage: "usage";
|
|
1206
1548
|
readonly UsagePercentage: "usage_percentage";
|
|
1207
1549
|
readonly Remaining: "remaining";
|
|
@@ -1210,8 +1552,8 @@ declare const PlanVariantDetailsThresholdType: {
|
|
|
1210
1552
|
/**
|
|
1211
1553
|
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
1212
1554
|
*/
|
|
1213
|
-
type
|
|
1214
|
-
type
|
|
1555
|
+
type PlanVariantDetailsThresholdType1 = OpenEnum<typeof PlanVariantDetailsThresholdType1>;
|
|
1556
|
+
type PlanVariantDetailsUsageAlert1 = {
|
|
1215
1557
|
/**
|
|
1216
1558
|
* The feature ID this alert applies to.
|
|
1217
1559
|
*/
|
|
@@ -1227,13 +1569,13 @@ type PlanVariantDetailsUsageAlert = {
|
|
|
1227
1569
|
/**
|
|
1228
1570
|
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
1229
1571
|
*/
|
|
1230
|
-
thresholdType:
|
|
1572
|
+
thresholdType: PlanVariantDetailsThresholdType1;
|
|
1231
1573
|
/**
|
|
1232
1574
|
* Optional user-defined label to distinguish multiple alerts on the same feature.
|
|
1233
1575
|
*/
|
|
1234
1576
|
name?: string | undefined;
|
|
1235
1577
|
};
|
|
1236
|
-
type
|
|
1578
|
+
type PlanVariantDetailsOverageAllowed1 = {
|
|
1237
1579
|
/**
|
|
1238
1580
|
* The feature ID this overage allowed control applies to.
|
|
1239
1581
|
*/
|
|
@@ -1246,338 +1588,412 @@ type PlanVariantDetailsOverageAllowed = {
|
|
|
1246
1588
|
/**
|
|
1247
1589
|
* Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
|
|
1248
1590
|
*/
|
|
1249
|
-
type
|
|
1591
|
+
type PlanVariantDetailsBillingControls1 = {
|
|
1250
1592
|
/**
|
|
1251
1593
|
* List of auto top-up configurations per feature.
|
|
1252
1594
|
*/
|
|
1253
|
-
autoTopups?: Array<
|
|
1595
|
+
autoTopups?: Array<PlanVariantDetailsAutoTopup1> | undefined;
|
|
1254
1596
|
/**
|
|
1255
1597
|
* List of overage spend limits per feature (caps overage spend).
|
|
1256
1598
|
*/
|
|
1257
|
-
spendLimits?: Array<
|
|
1599
|
+
spendLimits?: Array<PlanVariantDetailsSpendLimit1> | undefined;
|
|
1258
1600
|
/**
|
|
1259
1601
|
* List of hard usage caps per feature (max units per interval).
|
|
1260
1602
|
*/
|
|
1261
|
-
usageLimits?: Array<
|
|
1603
|
+
usageLimits?: Array<PlanVariantDetailsUsageLimit1> | undefined;
|
|
1262
1604
|
/**
|
|
1263
1605
|
* List of usage alert configurations per feature.
|
|
1264
1606
|
*/
|
|
1265
|
-
usageAlerts?: Array<
|
|
1607
|
+
usageAlerts?: Array<PlanVariantDetailsUsageAlert1> | undefined;
|
|
1266
1608
|
/**
|
|
1267
1609
|
* List of overage allowed controls per feature. When enabled, usage can exceed balance.
|
|
1268
1610
|
*/
|
|
1269
|
-
overageAllowed?: Array<
|
|
1611
|
+
overageAllowed?: Array<PlanVariantDetailsOverageAllowed1> | undefined;
|
|
1270
1612
|
};
|
|
1271
1613
|
/**
|
|
1272
|
-
*
|
|
1614
|
+
* Billing interval (e.g. 'month', 'year').
|
|
1273
1615
|
*/
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1616
|
+
declare const PlanPriceUpsertLicenseInterval: {
|
|
1617
|
+
readonly OneOff: "one_off";
|
|
1618
|
+
readonly Week: "week";
|
|
1619
|
+
readonly Month: "month";
|
|
1620
|
+
readonly Quarter: "quarter";
|
|
1621
|
+
readonly SemiAnnual: "semi_annual";
|
|
1622
|
+
readonly Year: "year";
|
|
1623
|
+
};
|
|
1624
|
+
/**
|
|
1625
|
+
* Billing interval (e.g. 'month', 'year').
|
|
1626
|
+
*/
|
|
1627
|
+
type PlanPriceUpsertLicenseInterval = OpenEnum<typeof PlanPriceUpsertLicenseInterval>;
|
|
1628
|
+
type UpsertLicenseAdditionalCurrency = {
|
|
1287
1629
|
/**
|
|
1288
|
-
*
|
|
1630
|
+
* Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp').
|
|
1289
1631
|
*/
|
|
1290
|
-
|
|
1632
|
+
currency: string;
|
|
1291
1633
|
/**
|
|
1292
|
-
*
|
|
1634
|
+
* Price amount in this currency. Set explicitly per currency, not converted from the base amount.
|
|
1293
1635
|
*/
|
|
1294
|
-
|
|
1636
|
+
amount: number;
|
|
1295
1637
|
};
|
|
1296
1638
|
/**
|
|
1297
|
-
*
|
|
1639
|
+
* Base price configuration for a plan.
|
|
1298
1640
|
*/
|
|
1299
|
-
type
|
|
1641
|
+
type UpsertLicenseBasePrice = {
|
|
1300
1642
|
/**
|
|
1301
|
-
*
|
|
1643
|
+
* Base price amount for the plan, in major currency units (e.g. dollars).
|
|
1302
1644
|
*/
|
|
1303
|
-
|
|
1645
|
+
amount: number;
|
|
1304
1646
|
/**
|
|
1305
|
-
*
|
|
1647
|
+
* Billing interval (e.g. 'month', 'year').
|
|
1306
1648
|
*/
|
|
1307
|
-
|
|
1308
|
-
};
|
|
1309
|
-
/**
|
|
1310
|
-
* Miscellaneous plan-level configuration flags.
|
|
1311
|
-
*/
|
|
1312
|
-
type PlanConfig1 = {
|
|
1649
|
+
interval: PlanPriceUpsertLicenseInterval;
|
|
1313
1650
|
/**
|
|
1314
|
-
*
|
|
1651
|
+
* Number of intervals per billing cycle. Defaults to 1.
|
|
1315
1652
|
*/
|
|
1316
|
-
|
|
1653
|
+
intervalCount?: number | undefined;
|
|
1654
|
+
/**
|
|
1655
|
+
* Base price amounts in additional currencies. The base 'amount' is in the org's default currency.
|
|
1656
|
+
*/
|
|
1657
|
+
additionalCurrencies?: Array<UpsertLicenseAdditionalCurrency> | undefined;
|
|
1317
1658
|
};
|
|
1318
1659
|
/**
|
|
1319
|
-
*
|
|
1660
|
+
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
1320
1661
|
*/
|
|
1321
|
-
declare const
|
|
1662
|
+
declare const PlanUpsertLicenseResetInterval1: {
|
|
1663
|
+
readonly OneOff: "one_off";
|
|
1664
|
+
readonly Minute: "minute";
|
|
1322
1665
|
readonly Hour: "hour";
|
|
1323
1666
|
readonly Day: "day";
|
|
1324
1667
|
readonly Week: "week";
|
|
1325
1668
|
readonly Month: "month";
|
|
1669
|
+
readonly Quarter: "quarter";
|
|
1670
|
+
readonly SemiAnnual: "semi_annual";
|
|
1671
|
+
readonly Year: "year";
|
|
1326
1672
|
};
|
|
1327
1673
|
/**
|
|
1328
|
-
*
|
|
1674
|
+
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
1329
1675
|
*/
|
|
1330
|
-
type
|
|
1676
|
+
type PlanUpsertLicenseResetInterval1 = OpenEnum<typeof PlanUpsertLicenseResetInterval1>;
|
|
1331
1677
|
/**
|
|
1332
|
-
*
|
|
1678
|
+
* Reset configuration for consumable features. Omit for non-consumable features like seats.
|
|
1333
1679
|
*/
|
|
1334
|
-
type
|
|
1335
|
-
/**
|
|
1336
|
-
* The time interval for the purchase limit window.
|
|
1337
|
-
*/
|
|
1338
|
-
interval: PlanPurchaseLimitInterval;
|
|
1680
|
+
type PlanUpsertLicenseReset1 = {
|
|
1339
1681
|
/**
|
|
1340
|
-
*
|
|
1682
|
+
* Interval at which balance resets (e.g. 'month', 'year'). For consumable features only.
|
|
1341
1683
|
*/
|
|
1342
|
-
|
|
1684
|
+
interval: PlanUpsertLicenseResetInterval1;
|
|
1343
1685
|
/**
|
|
1344
|
-
*
|
|
1686
|
+
* Number of intervals between resets. Defaults to 1.
|
|
1345
1687
|
*/
|
|
1346
|
-
|
|
1688
|
+
intervalCount?: number | undefined;
|
|
1347
1689
|
};
|
|
1348
|
-
type
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
/**
|
|
1362
|
-
* Amount of credits to add per auto top-up.
|
|
1363
|
-
*/
|
|
1364
|
-
quantity: number;
|
|
1365
|
-
/**
|
|
1366
|
-
* Optional rate limit to cap how often auto top-ups occur.
|
|
1367
|
-
*/
|
|
1368
|
-
purchaseLimit?: PlanPurchaseLimit | undefined;
|
|
1369
|
-
/**
|
|
1370
|
-
* When true, auto top-up creates a send_invoice invoice instead of auto-charging.
|
|
1371
|
-
*/
|
|
1372
|
-
invoiceMode?: boolean | undefined;
|
|
1690
|
+
type UpsertLicenseAddItemAdditionalCurrency = {
|
|
1691
|
+
currency?: any | undefined;
|
|
1692
|
+
amount?: any | undefined;
|
|
1693
|
+
};
|
|
1694
|
+
type PlanUpsertLicenseTier1 = {
|
|
1695
|
+
to?: any | undefined;
|
|
1696
|
+
amount?: any | undefined;
|
|
1697
|
+
flatAmount?: any | undefined;
|
|
1698
|
+
additionalCurrencies?: any | undefined;
|
|
1699
|
+
};
|
|
1700
|
+
declare const PlanUpsertLicenseTierBehavior1: {
|
|
1701
|
+
readonly Graduated: "graduated";
|
|
1702
|
+
readonly Volume: "volume";
|
|
1373
1703
|
};
|
|
1704
|
+
type PlanUpsertLicenseTierBehavior1 = OpenEnum<typeof PlanUpsertLicenseTierBehavior1>;
|
|
1374
1705
|
/**
|
|
1375
|
-
*
|
|
1706
|
+
* Billing interval. For consumable features, should match reset.interval.
|
|
1376
1707
|
*/
|
|
1377
|
-
declare const
|
|
1378
|
-
readonly
|
|
1379
|
-
readonly
|
|
1708
|
+
declare const PlanUpsertLicenseAddItemPriceInterval1: {
|
|
1709
|
+
readonly OneOff: "one_off";
|
|
1710
|
+
readonly Week: "week";
|
|
1711
|
+
readonly Month: "month";
|
|
1712
|
+
readonly Quarter: "quarter";
|
|
1713
|
+
readonly SemiAnnual: "semi_annual";
|
|
1714
|
+
readonly Year: "year";
|
|
1380
1715
|
};
|
|
1381
1716
|
/**
|
|
1382
|
-
*
|
|
1717
|
+
* Billing interval. For consumable features, should match reset.interval.
|
|
1383
1718
|
*/
|
|
1384
|
-
type
|
|
1385
|
-
|
|
1719
|
+
type PlanUpsertLicenseAddItemPriceInterval1 = OpenEnum<typeof PlanUpsertLicenseAddItemPriceInterval1>;
|
|
1720
|
+
/**
|
|
1721
|
+
* 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
|
|
1722
|
+
*/
|
|
1723
|
+
declare const PlanUpsertLicenseAddItemBillingMethod1: {
|
|
1724
|
+
readonly Prepaid: "prepaid";
|
|
1725
|
+
readonly UsageBased: "usage_based";
|
|
1726
|
+
};
|
|
1727
|
+
/**
|
|
1728
|
+
* 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
|
|
1729
|
+
*/
|
|
1730
|
+
type PlanUpsertLicenseAddItemBillingMethod1 = OpenEnum<typeof PlanUpsertLicenseAddItemBillingMethod1>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Pricing for usage beyond included units. Omit for free features.
|
|
1733
|
+
*/
|
|
1734
|
+
type PlanUpsertLicensePrice1 = {
|
|
1386
1735
|
/**
|
|
1387
|
-
*
|
|
1736
|
+
* Price per billing_units after included usage. Either 'amount' or 'tiers' is required.
|
|
1388
1737
|
*/
|
|
1389
|
-
|
|
1738
|
+
amount?: number | undefined;
|
|
1739
|
+
/**
|
|
1740
|
+
* Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'.
|
|
1741
|
+
*/
|
|
1742
|
+
additionalCurrencies?: Array<UpsertLicenseAddItemAdditionalCurrency> | undefined;
|
|
1743
|
+
/**
|
|
1744
|
+
* Tiered pricing. Either 'amount' or 'tiers' is required.
|
|
1745
|
+
*/
|
|
1746
|
+
tiers?: Array<PlanUpsertLicenseTier1> | undefined;
|
|
1747
|
+
tierBehavior?: PlanUpsertLicenseTierBehavior1 | undefined;
|
|
1748
|
+
/**
|
|
1749
|
+
* Billing interval. For consumable features, should match reset.interval.
|
|
1750
|
+
*/
|
|
1751
|
+
interval: PlanUpsertLicenseAddItemPriceInterval1;
|
|
1390
1752
|
/**
|
|
1391
|
-
*
|
|
1753
|
+
* Number of intervals per billing cycle. Defaults to 1.
|
|
1392
1754
|
*/
|
|
1393
|
-
|
|
1755
|
+
intervalCount: number;
|
|
1394
1756
|
/**
|
|
1395
|
-
*
|
|
1757
|
+
* Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200).
|
|
1396
1758
|
*/
|
|
1397
|
-
|
|
1759
|
+
billingUnits: number;
|
|
1398
1760
|
/**
|
|
1399
|
-
*
|
|
1761
|
+
* 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go.
|
|
1400
1762
|
*/
|
|
1401
|
-
|
|
1763
|
+
billingMethod: PlanUpsertLicenseAddItemBillingMethod1;
|
|
1402
1764
|
/**
|
|
1403
|
-
*
|
|
1765
|
+
* Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit.
|
|
1404
1766
|
*/
|
|
1405
|
-
|
|
1767
|
+
maxPurchase?: number | null | undefined;
|
|
1406
1768
|
};
|
|
1407
1769
|
/**
|
|
1408
|
-
*
|
|
1770
|
+
* Billing behavior when quantity increases mid-cycle.
|
|
1409
1771
|
*/
|
|
1410
|
-
declare const
|
|
1411
|
-
readonly
|
|
1412
|
-
readonly
|
|
1413
|
-
readonly
|
|
1414
|
-
readonly
|
|
1772
|
+
declare const UpsertLicenseOnIncrease: {
|
|
1773
|
+
readonly BillImmediately: "bill_immediately";
|
|
1774
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
1775
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1776
|
+
readonly BillNextCycle: "bill_next_cycle";
|
|
1415
1777
|
};
|
|
1416
1778
|
/**
|
|
1417
|
-
*
|
|
1779
|
+
* Billing behavior when quantity increases mid-cycle.
|
|
1418
1780
|
*/
|
|
1419
|
-
type
|
|
1781
|
+
type UpsertLicenseOnIncrease = OpenEnum<typeof UpsertLicenseOnIncrease>;
|
|
1420
1782
|
/**
|
|
1421
|
-
*
|
|
1783
|
+
* Credit behavior when quantity decreases mid-cycle.
|
|
1422
1784
|
*/
|
|
1423
|
-
declare const
|
|
1424
|
-
readonly
|
|
1425
|
-
readonly
|
|
1785
|
+
declare const UpsertLicenseOnDecrease: {
|
|
1786
|
+
readonly Prorate: "prorate";
|
|
1787
|
+
readonly ProrateImmediately: "prorate_immediately";
|
|
1788
|
+
readonly ProrateNextCycle: "prorate_next_cycle";
|
|
1789
|
+
readonly None: "none";
|
|
1790
|
+
readonly NoProrations: "no_prorations";
|
|
1426
1791
|
};
|
|
1427
1792
|
/**
|
|
1428
|
-
*
|
|
1793
|
+
* Credit behavior when quantity decreases mid-cycle.
|
|
1429
1794
|
*/
|
|
1430
|
-
type
|
|
1795
|
+
type UpsertLicenseOnDecrease = OpenEnum<typeof UpsertLicenseOnDecrease>;
|
|
1431
1796
|
/**
|
|
1432
|
-
*
|
|
1797
|
+
* Proration settings for prepaid features. Controls mid-cycle quantity change billing.
|
|
1433
1798
|
*/
|
|
1434
|
-
type
|
|
1435
|
-
properties: {
|
|
1436
|
-
[k: string]: string;
|
|
1437
|
-
};
|
|
1438
|
-
};
|
|
1439
|
-
type PlanUsageLimit = {
|
|
1799
|
+
type UpsertLicenseProration = {
|
|
1440
1800
|
/**
|
|
1441
|
-
*
|
|
1801
|
+
* Billing behavior when quantity increases mid-cycle.
|
|
1442
1802
|
*/
|
|
1443
|
-
|
|
1803
|
+
onIncrease: UpsertLicenseOnIncrease;
|
|
1444
1804
|
/**
|
|
1445
|
-
*
|
|
1805
|
+
* Credit behavior when quantity decreases mid-cycle.
|
|
1446
1806
|
*/
|
|
1447
|
-
|
|
1807
|
+
onDecrease: UpsertLicenseOnDecrease;
|
|
1808
|
+
};
|
|
1809
|
+
/**
|
|
1810
|
+
* When rolled over units expire.
|
|
1811
|
+
*/
|
|
1812
|
+
declare const UpsertLicenseExpiryDurationType: {
|
|
1813
|
+
readonly Month: "month";
|
|
1814
|
+
readonly Forever: "forever";
|
|
1815
|
+
};
|
|
1816
|
+
/**
|
|
1817
|
+
* When rolled over units expire.
|
|
1818
|
+
*/
|
|
1819
|
+
type UpsertLicenseExpiryDurationType = OpenEnum<typeof UpsertLicenseExpiryDurationType>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Rollover config for unused units. If set, unused included units carry over.
|
|
1822
|
+
*/
|
|
1823
|
+
type PlanUpsertLicenseRollover1 = {
|
|
1448
1824
|
/**
|
|
1449
|
-
*
|
|
1825
|
+
* Max rollover units. Omit for unlimited rollover.
|
|
1450
1826
|
*/
|
|
1451
|
-
|
|
1827
|
+
max?: number | undefined;
|
|
1452
1828
|
/**
|
|
1453
|
-
*
|
|
1829
|
+
* Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max.
|
|
1454
1830
|
*/
|
|
1455
|
-
|
|
1831
|
+
maxPercentage?: number | undefined;
|
|
1456
1832
|
/**
|
|
1457
|
-
*
|
|
1833
|
+
* When rolled over units expire.
|
|
1458
1834
|
*/
|
|
1459
|
-
|
|
1835
|
+
expiryDurationType: UpsertLicenseExpiryDurationType;
|
|
1460
1836
|
/**
|
|
1461
|
-
*
|
|
1837
|
+
* Number of periods before expiry.
|
|
1462
1838
|
*/
|
|
1463
|
-
|
|
1464
|
-
};
|
|
1465
|
-
/**
|
|
1466
|
-
* Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance.
|
|
1467
|
-
*/
|
|
1468
|
-
declare const PlanThresholdType: {
|
|
1469
|
-
readonly Usage: "usage";
|
|
1470
|
-
readonly UsagePercentage: "usage_percentage";
|
|
1471
|
-
readonly Remaining: "remaining";
|
|
1472
|
-
readonly RemainingPercentage: "remaining_percentage";
|
|
1839
|
+
expiryDurationLength?: number | undefined;
|
|
1473
1840
|
};
|
|
1474
1841
|
/**
|
|
1475
|
-
*
|
|
1842
|
+
* Configuration for a feature item in a plan, including usage limits, pricing, and rollover settings.
|
|
1476
1843
|
*/
|
|
1477
|
-
type
|
|
1478
|
-
type PlanUsageAlert = {
|
|
1844
|
+
type UpsertLicensePlanItem = {
|
|
1479
1845
|
/**
|
|
1480
|
-
* The
|
|
1846
|
+
* The ID of the feature to configure.
|
|
1481
1847
|
*/
|
|
1482
|
-
featureId
|
|
1848
|
+
featureId: string;
|
|
1483
1849
|
/**
|
|
1484
|
-
*
|
|
1850
|
+
* Number of free units included. Balance resets to this each interval for consumable features.
|
|
1485
1851
|
*/
|
|
1486
|
-
|
|
1852
|
+
included?: number | undefined;
|
|
1487
1853
|
/**
|
|
1488
|
-
*
|
|
1854
|
+
* If true, customer has unlimited access to this feature.
|
|
1489
1855
|
*/
|
|
1490
|
-
|
|
1856
|
+
unlimited?: boolean | undefined;
|
|
1491
1857
|
/**
|
|
1492
|
-
* Whether
|
|
1858
|
+
* Whether entity-level grants contribute to a shared customer balance.
|
|
1493
1859
|
*/
|
|
1494
|
-
|
|
1860
|
+
pooled: boolean;
|
|
1495
1861
|
/**
|
|
1496
|
-
*
|
|
1862
|
+
* Reset configuration for consumable features. Omit for non-consumable features like seats.
|
|
1497
1863
|
*/
|
|
1498
|
-
|
|
1499
|
-
};
|
|
1500
|
-
type PlanOverageAllowed = {
|
|
1864
|
+
reset?: PlanUpsertLicenseReset1 | undefined;
|
|
1501
1865
|
/**
|
|
1502
|
-
*
|
|
1866
|
+
* Pricing for usage beyond included units. Omit for free features.
|
|
1503
1867
|
*/
|
|
1504
|
-
|
|
1868
|
+
price?: PlanUpsertLicensePrice1 | undefined;
|
|
1505
1869
|
/**
|
|
1506
|
-
*
|
|
1870
|
+
* Proration settings for prepaid features. Controls mid-cycle quantity change billing.
|
|
1507
1871
|
*/
|
|
1508
|
-
|
|
1872
|
+
proration?: UpsertLicenseProration | undefined;
|
|
1873
|
+
/**
|
|
1874
|
+
* Rollover config for unused units. If set, unused included units carry over.
|
|
1875
|
+
*/
|
|
1876
|
+
rollover?: PlanUpsertLicenseRollover1 | undefined;
|
|
1509
1877
|
};
|
|
1510
1878
|
/**
|
|
1511
|
-
*
|
|
1879
|
+
* Match items with this billing method (prepaid or usage_based).
|
|
1512
1880
|
*/
|
|
1513
|
-
|
|
1881
|
+
declare const PlanUpsertLicenseRemoveItemBillingMethod1: {
|
|
1882
|
+
readonly Prepaid: "prepaid";
|
|
1883
|
+
readonly UsageBased: "usage_based";
|
|
1884
|
+
};
|
|
1885
|
+
/**
|
|
1886
|
+
* Match items with this billing method (prepaid or usage_based).
|
|
1887
|
+
*/
|
|
1888
|
+
type PlanUpsertLicenseRemoveItemBillingMethod1 = OpenEnum<typeof PlanUpsertLicenseRemoveItemBillingMethod1>;
|
|
1889
|
+
declare const PlanIntervalUpsertLicenseRemoveItemEnum2: {
|
|
1890
|
+
readonly OneOff: "one_off";
|
|
1891
|
+
readonly Minute: "minute";
|
|
1892
|
+
readonly Hour: "hour";
|
|
1893
|
+
readonly Day: "day";
|
|
1894
|
+
readonly Week: "week";
|
|
1895
|
+
readonly Month: "month";
|
|
1896
|
+
readonly Quarter: "quarter";
|
|
1897
|
+
readonly SemiAnnual: "semi_annual";
|
|
1898
|
+
readonly Year: "year";
|
|
1899
|
+
};
|
|
1900
|
+
type PlanIntervalUpsertLicenseRemoveItemEnum2 = OpenEnum<typeof PlanIntervalUpsertLicenseRemoveItemEnum2>;
|
|
1901
|
+
declare const PlanIntervalUpsertLicenseRemoveItemEnum1: {
|
|
1902
|
+
readonly OneOff: "one_off";
|
|
1903
|
+
readonly Week: "week";
|
|
1904
|
+
readonly Month: "month";
|
|
1905
|
+
readonly Quarter: "quarter";
|
|
1906
|
+
readonly SemiAnnual: "semi_annual";
|
|
1907
|
+
readonly Year: "year";
|
|
1908
|
+
};
|
|
1909
|
+
type PlanIntervalUpsertLicenseRemoveItemEnum1 = OpenEnum<typeof PlanIntervalUpsertLicenseRemoveItemEnum1>;
|
|
1910
|
+
/**
|
|
1911
|
+
* Filter for matching plan items. All provided fields must match (AND).
|
|
1912
|
+
*/
|
|
1913
|
+
type UpsertLicensePlanItemFilter = {
|
|
1514
1914
|
/**
|
|
1515
|
-
*
|
|
1915
|
+
* Match items linked to this feature.
|
|
1516
1916
|
*/
|
|
1517
|
-
|
|
1917
|
+
featureId?: string | undefined;
|
|
1518
1918
|
/**
|
|
1519
|
-
*
|
|
1919
|
+
* Match items with this billing method (prepaid or usage_based).
|
|
1520
1920
|
*/
|
|
1521
|
-
|
|
1921
|
+
billingMethod?: PlanUpsertLicenseRemoveItemBillingMethod1 | undefined;
|
|
1522
1922
|
/**
|
|
1523
|
-
*
|
|
1923
|
+
* Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated.
|
|
1524
1924
|
*/
|
|
1525
|
-
|
|
1925
|
+
interval?: PlanIntervalUpsertLicenseRemoveItemEnum1 | PlanIntervalUpsertLicenseRemoveItemEnum2 | undefined;
|
|
1526
1926
|
/**
|
|
1527
|
-
*
|
|
1927
|
+
* Match items with this interval_count. Disambiguates between items that share an interval but differ in count.
|
|
1528
1928
|
*/
|
|
1529
|
-
|
|
1929
|
+
intervalCount?: number | undefined;
|
|
1530
1930
|
/**
|
|
1531
|
-
*
|
|
1931
|
+
* Match items whose grant equals this included usage. Omitted is a wildcard.
|
|
1532
1932
|
*/
|
|
1533
|
-
|
|
1933
|
+
included?: number | undefined;
|
|
1534
1934
|
};
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
readonly Active: "active";
|
|
1540
|
-
readonly Scheduled: "scheduled";
|
|
1935
|
+
type UpsertLicenseCustomize = {
|
|
1936
|
+
price?: UpsertLicenseBasePrice | null | undefined;
|
|
1937
|
+
addItems?: Array<UpsertLicensePlanItem> | undefined;
|
|
1938
|
+
removeItems?: Array<UpsertLicensePlanItemFilter> | undefined;
|
|
1541
1939
|
};
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
readonly None: "none";
|
|
1554
|
-
readonly Purchase: "purchase";
|
|
1940
|
+
type UpsertLicense = {
|
|
1941
|
+
licensePlanId: string;
|
|
1942
|
+
included?: number | undefined;
|
|
1943
|
+
prepaidOnly?: boolean | undefined;
|
|
1944
|
+
customize?: UpsertLicenseCustomize | null | undefined;
|
|
1945
|
+
metadata?: {
|
|
1946
|
+
[k: string]: any;
|
|
1947
|
+
} | undefined;
|
|
1948
|
+
};
|
|
1949
|
+
type RemoveLicense = {
|
|
1950
|
+
licensePlanId: string;
|
|
1555
1951
|
};
|
|
1556
1952
|
/**
|
|
1557
|
-
* The
|
|
1953
|
+
* The customization that transforms the base plan into this variant.
|
|
1558
1954
|
*/
|
|
1559
|
-
type
|
|
1560
|
-
type CustomerEligibility = {
|
|
1955
|
+
type Customize1 = {
|
|
1561
1956
|
/**
|
|
1562
|
-
*
|
|
1957
|
+
* Override the base price of the plan. Pass null to remove the base price.
|
|
1563
1958
|
*/
|
|
1564
|
-
|
|
1959
|
+
price?: BasePrice | null | undefined;
|
|
1565
1960
|
/**
|
|
1566
|
-
*
|
|
1961
|
+
* Items to add to the plan.
|
|
1567
1962
|
*/
|
|
1568
|
-
|
|
1963
|
+
addItems?: Array<PlanPlanItem> | undefined;
|
|
1569
1964
|
/**
|
|
1570
|
-
*
|
|
1965
|
+
* Filters selecting items to remove from the plan.
|
|
1571
1966
|
*/
|
|
1572
|
-
|
|
1967
|
+
removeItems?: Array<PlanItemFilter> | undefined;
|
|
1573
1968
|
/**
|
|
1574
|
-
*
|
|
1969
|
+
* Override the plan's default free trial. Pass an object to set a custom trial, or null to remove the trial entirely.
|
|
1575
1970
|
*/
|
|
1576
|
-
|
|
1971
|
+
freeTrial?: FreeTrialParams | null | undefined;
|
|
1577
1972
|
/**
|
|
1578
|
-
*
|
|
1973
|
+
* Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer.
|
|
1579
1974
|
*/
|
|
1580
|
-
|
|
1975
|
+
billingControls?: PlanVariantDetailsBillingControls1 | undefined;
|
|
1976
|
+
/**
|
|
1977
|
+
* License links to add or override for this customer, keyed by license_plan_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance.
|
|
1978
|
+
*/
|
|
1979
|
+
upsertLicenses?: Array<UpsertLicense> | undefined;
|
|
1980
|
+
/**
|
|
1981
|
+
* License links to drop, keyed by license_plan_id. Parallel to remove_items.
|
|
1982
|
+
*/
|
|
1983
|
+
removeLicenses?: Array<RemoveLicense> | undefined;
|
|
1984
|
+
};
|
|
1985
|
+
/**
|
|
1986
|
+
* Details about how this variant relates to its latest base plan.
|
|
1987
|
+
*/
|
|
1988
|
+
type VariantDetails = {
|
|
1989
|
+
/**
|
|
1990
|
+
* The ID of the base plan this variant was derived from.
|
|
1991
|
+
*/
|
|
1992
|
+
basePlanId: string;
|
|
1993
|
+
/**
|
|
1994
|
+
* The customization that transforms the base plan into this variant.
|
|
1995
|
+
*/
|
|
1996
|
+
customize?: Customize1 | undefined;
|
|
1581
1997
|
};
|
|
1582
1998
|
type Plan = {
|
|
1583
1999
|
/**
|
|
@@ -1600,6 +2016,14 @@ type Plan = {
|
|
|
1600
2016
|
* Version number of the plan. Incremented when plan configuration changes.
|
|
1601
2017
|
*/
|
|
1602
2018
|
version: number;
|
|
2019
|
+
/**
|
|
2020
|
+
* User-facing version identity. Defaults to v{n} when the version is minted.
|
|
2021
|
+
*/
|
|
2022
|
+
versionSlug?: string | null | undefined;
|
|
2023
|
+
/**
|
|
2024
|
+
* Whether this is the active version of the plan. At most one version is active.
|
|
2025
|
+
*/
|
|
2026
|
+
active?: boolean | undefined;
|
|
1603
2027
|
/**
|
|
1604
2028
|
* Whether this is an add-on plan that can be attached alongside a main plan.
|
|
1605
2029
|
*/
|
|
@@ -1632,14 +2056,6 @@ type Plan = {
|
|
|
1632
2056
|
* Whether the plan is archived. Archived plans cannot be attached to new customers.
|
|
1633
2057
|
*/
|
|
1634
2058
|
archived: boolean;
|
|
1635
|
-
/**
|
|
1636
|
-
* Deprecated. Use variant_details.base_plan_id instead. If this is a variant, the ID of the base plan it was created from.
|
|
1637
|
-
*/
|
|
1638
|
-
baseVariantId: string | null;
|
|
1639
|
-
/**
|
|
1640
|
-
* Details about how this variant relates to its latest base plan.
|
|
1641
|
-
*/
|
|
1642
|
-
variantDetails?: VariantDetails | undefined;
|
|
1643
2059
|
/**
|
|
1644
2060
|
* Miscellaneous plan-level configuration flags.
|
|
1645
2061
|
*/
|
|
@@ -1655,6 +2071,14 @@ type Plan = {
|
|
|
1655
2071
|
[k: string]: any;
|
|
1656
2072
|
};
|
|
1657
2073
|
customerEligibility?: CustomerEligibility | undefined;
|
|
2074
|
+
/**
|
|
2075
|
+
* Deprecated. Use variant_details.base_plan_id instead. If this is a variant, the ID of the base plan it was created from.
|
|
2076
|
+
*/
|
|
2077
|
+
baseVariantId: string | null;
|
|
2078
|
+
/**
|
|
2079
|
+
* Details about how this variant relates to its latest base plan.
|
|
2080
|
+
*/
|
|
2081
|
+
variantDetails?: VariantDetails | undefined;
|
|
1658
2082
|
};
|
|
1659
2083
|
|
|
1660
2084
|
export type { BalanceFeature as B, ClosedEnum as C, OpenEnum as O, Plan as P, Balance as a };
|