atmn 1.1.25 → 2.0.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/README.md +120 -0
- package/dist/bin.js +23102 -0
- package/dist/index.js +2906 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -74
- package/src/actions/api/callApi.ts +280 -0
- package/src/actions/api/registerApiCommands.ts +121 -0
- package/src/actions/env/fetchOrgInfo.ts +32 -0
- package/src/actions/env/types/orgInfo.ts +18 -0
- package/src/actions/env.ts +94 -0
- package/src/actions/init/runInit.ts +401 -0
- package/src/actions/login/keyless.ts +135 -0
- package/src/actions/login.ts +144 -0
- package/src/actions/pull/appendPlanVersionFixture.ts +373 -0
- package/src/actions/pull/applyPreview.ts +553 -0
- package/src/actions/pull/applySettingsPreview.ts +114 -0
- package/src/actions/pull/changedFixtureKeys.ts +88 -0
- package/src/actions/pull/listSourceFiles.ts +29 -0
- package/src/actions/pull/locateFixture.ts +78 -0
- package/src/actions/pull/resolveCollectionTarget.ts +198 -0
- package/src/actions/pull/rewriteConfig.ts +57 -0
- package/src/actions/pull/scaffoldConfig.ts +118 -0
- package/src/actions/pull.ts +399 -0
- package/src/actions/push/backfillInternalIds.ts +394 -0
- package/src/actions/push/deprecatedFields.ts +55 -0
- package/src/actions/push.ts +294 -0
- package/src/actions/reset/runReset.ts +58 -0
- package/src/actions/sandbox/createSandbox.ts +83 -0
- package/src/actions/sandbox/deleteSandbox.ts +91 -0
- package/src/actions/sandbox/listSandboxes.ts +28 -0
- package/src/actions/sandbox/types/sandboxClient.ts +16 -0
- package/src/actions/sandbox/useSandbox.ts +157 -0
- package/src/actions/sandbox/withSandboxScopeHint.ts +27 -0
- package/src/actions/skills/skills.ts +246 -0
- package/src/auth/announceAuthorizationUrl.ts +26 -0
- package/src/auth/browser/openSystemBrowser.ts +7 -0
- package/src/auth/browser/tryOpenBrowser.ts +17 -0
- package/src/auth/browser/watchLauncher.ts +46 -0
- package/src/auth/buildAuthorizationUrl.ts +36 -0
- package/src/auth/callbackPages.ts +126 -0
- package/src/auth/createOrgApiKeys.ts +46 -0
- package/src/auth/keyless.ts +119 -0
- package/src/auth/oauthConfig.ts +63 -0
- package/src/auth/runOAuthFlow.ts +230 -0
- package/src/auth/types/browserOpener.ts +5 -0
- package/src/auth/types/impersonationTokens.ts +23 -0
- package/src/auth/types/oauthTokens.ts +13 -0
- package/src/auth/types/orgApiKeys.ts +6 -0
- package/src/bin.ts +9 -0
- package/src/cli.ts +648 -0
- package/src/config/configPackageName.ts +9 -0
- package/src/config/legacyConfig.ts +25 -0
- package/src/config/loadConfig.ts +231 -0
- package/src/env/assertSandboxTarget.ts +20 -0
- package/src/env/loadEnv.ts +184 -0
- package/src/env/resolveTarget.ts +134 -0
- package/src/env/sandboxKeyName.ts +18 -0
- package/src/generated/apiRoutes.ts +3787 -0
- package/src/generated/client.ts +51564 -0
- package/src/generated/emit.ts +1163 -0
- package/src/generated/emitRuntime.ts +522 -0
- package/src/generated/features.ts +146 -0
- package/src/generated/labels.ts +29 -0
- package/src/generated/licenses.ts +287 -0
- package/src/generated/lintRules.ts +2207 -0
- package/src/generated/lintRuntime.ts +865 -0
- package/src/generated/plans.ts +1628 -0
- package/src/generated/referralPrograms.ts +22 -0
- package/src/generated/rewards.ts +58 -0
- package/src/generated/settings.ts +21 -0
- package/src/generated/skills.ts +305 -0
- package/src/generated/variants.ts +934 -0
- package/src/generated/wire.ts +334 -0
- package/src/http/autumnFetch.ts +30 -0
- package/src/index.ts +20 -0
- package/src/project/chooseConfigDir.ts +41 -0
- package/src/project/resolveProject.ts +115 -0
- package/src/project/rootMarker.ts +40 -0
- package/src/prompt/prompt.ts +186 -0
- package/src/prompt/select.ts +162 -0
- package/src/render/renderEnv.ts +77 -0
- package/src/render/renderPreview.ts +945 -0
- package/src/render/renderSandboxes.ts +92 -0
- package/src/render/stripTerminalControls.ts +19 -0
- package/src/repo/findRepoRoot.ts +79 -0
- package/src/surgery/appendPropertyEdit.ts +67 -0
- package/src/surgery/appendToArray.ts +87 -0
- package/src/surgery/appendToBinding.ts +19 -0
- package/src/surgery/appendToCollection.ts +40 -0
- package/src/surgery/appendToFixtureArray.ts +71 -0
- package/src/surgery/arrayBinding.ts +30 -0
- package/src/surgery/deleteFixtureLiteral.ts +81 -0
- package/src/surgery/deleteReference.ts +48 -0
- package/src/surgery/ensureBuilderImport.ts +65 -0
- package/src/surgery/findFixture.ts +238 -0
- package/src/surgery/fixtureEdit.ts +156 -0
- package/src/surgery/fixtureLocation.ts +32 -0
- package/src/surgery/insertCollection.ts +86 -0
- package/src/surgery/insertFirstProperty.ts +73 -0
- package/src/surgery/patchFixtureProperty.ts +152 -0
- package/src/surgery/patchSingletonProperty.ts +221 -0
- package/src/surgery/replaceFixture.ts +28 -0
- package/src/surgery/setFixtureProperty.ts +55 -0
- package/src/surgery/staticFixtureRule.ts +48 -0
- package/src/version.ts +5 -0
- package/dist/cli.js +0 -146296
- package/dist/compose/index.js +0 -122
- package/dist/src/compose/builders/builderFunctions.d.ts +0 -84
- package/dist/src/compose/builders/rewardFunctions.d.ts +0 -5
- package/dist/src/compose/builders/variantFunctions.d.ts +0 -2
- package/dist/src/compose/index.d.ts +0 -19
- package/dist/src/compose/models/featureModels.d.ts +0 -262
- package/dist/src/compose/models/index.d.ts +0 -3
- package/dist/src/compose/models/planModels.d.ts +0 -562
- package/dist/src/compose/models/rewardModels.d.ts +0 -52
- package/dist/src/compose/models/variantModels.d.ts +0 -34
- package/readme.md +0 -186
|
@@ -1,562 +0,0 @@
|
|
|
1
|
-
import { z } from "zod/v4";
|
|
2
|
-
export declare const AdditionalCurrencySchema: z.ZodObject<{
|
|
3
|
-
currency: z.ZodString;
|
|
4
|
-
amount: z.ZodNumber;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
export declare const AdditionalCurrencyTierSchema: z.ZodObject<{
|
|
7
|
-
currency: z.ZodString;
|
|
8
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
9
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export declare const UsageTierSchema: z.ZodObject<{
|
|
12
|
-
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
13
|
-
amount: z.ZodNumber;
|
|
14
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
15
|
-
currency: z.ZodString;
|
|
16
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
17
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
}, z.core.$strip>>>;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
declare const BasePriceParamsSchema: z.ZodObject<{
|
|
21
|
-
amount: z.ZodNumber;
|
|
22
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
23
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
25
|
-
currency: z.ZodString;
|
|
26
|
-
amount: z.ZodNumber;
|
|
27
|
-
}, z.core.$strip>>>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
type AutoTopupPurchaseLimit = {
|
|
30
|
-
interval: "hour" | "day" | "week" | "month";
|
|
31
|
-
interval_count?: number;
|
|
32
|
-
limit: number;
|
|
33
|
-
};
|
|
34
|
-
type AutoTopup = {
|
|
35
|
-
feature_id: string;
|
|
36
|
-
enabled?: boolean;
|
|
37
|
-
threshold: number;
|
|
38
|
-
quantity: number;
|
|
39
|
-
purchase_limit?: AutoTopupPurchaseLimit;
|
|
40
|
-
invoice_mode?: boolean;
|
|
41
|
-
};
|
|
42
|
-
type SpendLimit = {
|
|
43
|
-
feature_id?: string;
|
|
44
|
-
enabled?: boolean;
|
|
45
|
-
limit_type?: "absolute" | "usage_percentage";
|
|
46
|
-
overage_limit?: number;
|
|
47
|
-
skip_overage_billing?: boolean;
|
|
48
|
-
};
|
|
49
|
-
type UsageLimit = {
|
|
50
|
-
feature_id: string;
|
|
51
|
-
enabled?: boolean;
|
|
52
|
-
limit: number;
|
|
53
|
-
interval: "day" | "week" | "month" | "year";
|
|
54
|
-
anchor?: "billing_cycle" | "utc";
|
|
55
|
-
filter?: UsageLimitFilter;
|
|
56
|
-
};
|
|
57
|
-
type UsageLimitFilter = {
|
|
58
|
-
properties: Record<string, string>;
|
|
59
|
-
};
|
|
60
|
-
type UsageAlert = {
|
|
61
|
-
feature_id?: string;
|
|
62
|
-
enabled?: boolean;
|
|
63
|
-
threshold: number;
|
|
64
|
-
threshold_type: "usage" | "usage_percentage" | "remaining" | "remaining_percentage";
|
|
65
|
-
basis?: "balance" | "included" | "recurring" | "usage_limit";
|
|
66
|
-
filter?: UsageLimitFilter;
|
|
67
|
-
name?: string;
|
|
68
|
-
};
|
|
69
|
-
type OverageAllowed = {
|
|
70
|
-
feature_id: string;
|
|
71
|
-
enabled?: boolean;
|
|
72
|
-
};
|
|
73
|
-
export type BillingControls = {
|
|
74
|
-
auto_topups?: AutoTopup[];
|
|
75
|
-
spend_limits?: SpendLimit[];
|
|
76
|
-
usage_limits?: UsageLimit[];
|
|
77
|
-
usage_alerts?: UsageAlert[];
|
|
78
|
-
overage_allowed?: OverageAllowed[];
|
|
79
|
-
};
|
|
80
|
-
export declare const PlanItemSchema: z.ZodObject<{
|
|
81
|
-
featureId: z.ZodString;
|
|
82
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
83
|
-
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
-
pooled: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
-
reset: z.ZodOptional<z.ZodObject<{
|
|
86
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
87
|
-
interval_count: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>>;
|
|
89
|
-
price: z.ZodOptional<z.ZodObject<{
|
|
90
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
91
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
-
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
93
|
-
amount: z.ZodNumber;
|
|
94
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
-
currency: z.ZodString;
|
|
96
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
97
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
98
|
-
}, z.core.$strip>>>;
|
|
99
|
-
}, z.core.$strip>>>;
|
|
100
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
101
|
-
currency: z.ZodString;
|
|
102
|
-
amount: z.ZodNumber;
|
|
103
|
-
}, z.core.$strip>>>;
|
|
104
|
-
tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
|
|
105
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
106
|
-
interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
107
|
-
billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
108
|
-
billing_method: z.ZodUnion<readonly [z.ZodLiteral<"prepaid">, z.ZodLiteral<"usage_based">]>;
|
|
109
|
-
max_purchase: z.ZodOptional<z.ZodNumber>;
|
|
110
|
-
}, z.core.$strip>>;
|
|
111
|
-
proration: z.ZodOptional<z.ZodObject<{
|
|
112
|
-
on_increase: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"charge_immediately">]>;
|
|
113
|
-
on_decrease: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"refund_immediately">, z.ZodLiteral<"no_action">]>;
|
|
114
|
-
}, z.core.$strip>>;
|
|
115
|
-
rollover: z.ZodOptional<z.ZodObject<{
|
|
116
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
117
|
-
max_percentage: z.ZodOptional<z.ZodNumber>;
|
|
118
|
-
expiry_duration_type: z.ZodUnion<readonly [z.ZodLiteral<"month">, z.ZodLiteral<"forever">]>;
|
|
119
|
-
expiry_duration_length: z.ZodOptional<z.ZodNumber>;
|
|
120
|
-
}, z.core.$strip>>;
|
|
121
|
-
entityFeatureId: z.ZodOptional<z.ZodString>;
|
|
122
|
-
entitlementId: z.ZodOptional<z.ZodString>;
|
|
123
|
-
priceId: z.ZodOptional<z.ZodString>;
|
|
124
|
-
}, z.core.$strip>;
|
|
125
|
-
export declare const FreeTrialSchema: z.ZodObject<{
|
|
126
|
-
durationLength: z.ZodNumber;
|
|
127
|
-
durationType: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"day">, z.ZodLiteral<"month">, z.ZodLiteral<"year">]>>;
|
|
128
|
-
cardRequired: z.ZodDefault<z.ZodBoolean>;
|
|
129
|
-
}, z.core.$strip>;
|
|
130
|
-
export declare const BillingControlsSchema: z.ZodCustom<BillingControls, BillingControls>;
|
|
131
|
-
export type LicenseItemFilter = {
|
|
132
|
-
featureId?: string;
|
|
133
|
-
billingMethod?: BillingMethod;
|
|
134
|
-
interval?: BillingInterval | ResetInterval;
|
|
135
|
-
intervalCount?: number;
|
|
136
|
-
};
|
|
137
|
-
/** Diff applied to the license plan for THIS parent only — the child plan
|
|
138
|
-
* itself stays shared. */
|
|
139
|
-
export declare const LicenseCustomizeSchema: z.ZodObject<{
|
|
140
|
-
price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
141
|
-
amount: z.ZodNumber;
|
|
142
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
143
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
144
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
145
|
-
currency: z.ZodString;
|
|
146
|
-
amount: z.ZodNumber;
|
|
147
|
-
}, z.core.$strip>>>;
|
|
148
|
-
}, z.core.$strip>>>;
|
|
149
|
-
addItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
150
|
-
featureId: z.ZodString;
|
|
151
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
-
pooled: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
-
reset: z.ZodOptional<z.ZodObject<{
|
|
155
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
156
|
-
interval_count: z.ZodOptional<z.ZodNumber>;
|
|
157
|
-
}, z.core.$strip>>;
|
|
158
|
-
price: z.ZodOptional<z.ZodObject<{
|
|
159
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
160
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
161
|
-
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
162
|
-
amount: z.ZodNumber;
|
|
163
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
164
|
-
currency: z.ZodString;
|
|
165
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
166
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
167
|
-
}, z.core.$strip>>>;
|
|
168
|
-
}, z.core.$strip>>>;
|
|
169
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
170
|
-
currency: z.ZodString;
|
|
171
|
-
amount: z.ZodNumber;
|
|
172
|
-
}, z.core.$strip>>>;
|
|
173
|
-
tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
|
|
174
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
175
|
-
interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
176
|
-
billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
177
|
-
billing_method: z.ZodUnion<readonly [z.ZodLiteral<"prepaid">, z.ZodLiteral<"usage_based">]>;
|
|
178
|
-
max_purchase: z.ZodOptional<z.ZodNumber>;
|
|
179
|
-
}, z.core.$strip>>;
|
|
180
|
-
proration: z.ZodOptional<z.ZodObject<{
|
|
181
|
-
on_increase: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"charge_immediately">]>;
|
|
182
|
-
on_decrease: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"refund_immediately">, z.ZodLiteral<"no_action">]>;
|
|
183
|
-
}, z.core.$strip>>;
|
|
184
|
-
rollover: z.ZodOptional<z.ZodObject<{
|
|
185
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
186
|
-
max_percentage: z.ZodOptional<z.ZodNumber>;
|
|
187
|
-
expiry_duration_type: z.ZodUnion<readonly [z.ZodLiteral<"month">, z.ZodLiteral<"forever">]>;
|
|
188
|
-
expiry_duration_length: z.ZodOptional<z.ZodNumber>;
|
|
189
|
-
}, z.core.$strip>>;
|
|
190
|
-
entityFeatureId: z.ZodOptional<z.ZodString>;
|
|
191
|
-
entitlementId: z.ZodOptional<z.ZodString>;
|
|
192
|
-
priceId: z.ZodOptional<z.ZodString>;
|
|
193
|
-
}, z.core.$strip>>>;
|
|
194
|
-
removeItems: z.ZodOptional<z.ZodArray<z.ZodCustom<LicenseItemFilter, LicenseItemFilter>>>;
|
|
195
|
-
}, z.core.$strip>;
|
|
196
|
-
export declare const PlanLicenseSchema: z.ZodObject<{
|
|
197
|
-
licensePlanId: z.ZodString;
|
|
198
|
-
version: z.ZodOptional<z.ZodNumber>;
|
|
199
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
200
|
-
customize: z.ZodOptional<z.ZodObject<{
|
|
201
|
-
price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
202
|
-
amount: z.ZodNumber;
|
|
203
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
204
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
205
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
206
|
-
currency: z.ZodString;
|
|
207
|
-
amount: z.ZodNumber;
|
|
208
|
-
}, z.core.$strip>>>;
|
|
209
|
-
}, z.core.$strip>>>;
|
|
210
|
-
addItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
211
|
-
featureId: z.ZodString;
|
|
212
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
213
|
-
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
214
|
-
pooled: z.ZodOptional<z.ZodBoolean>;
|
|
215
|
-
reset: z.ZodOptional<z.ZodObject<{
|
|
216
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
217
|
-
interval_count: z.ZodOptional<z.ZodNumber>;
|
|
218
|
-
}, z.core.$strip>>;
|
|
219
|
-
price: z.ZodOptional<z.ZodObject<{
|
|
220
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
221
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
222
|
-
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
223
|
-
amount: z.ZodNumber;
|
|
224
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
225
|
-
currency: z.ZodString;
|
|
226
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
227
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
228
|
-
}, z.core.$strip>>>;
|
|
229
|
-
}, z.core.$strip>>>;
|
|
230
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
231
|
-
currency: z.ZodString;
|
|
232
|
-
amount: z.ZodNumber;
|
|
233
|
-
}, z.core.$strip>>>;
|
|
234
|
-
tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
|
|
235
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
236
|
-
interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
237
|
-
billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
238
|
-
billing_method: z.ZodUnion<readonly [z.ZodLiteral<"prepaid">, z.ZodLiteral<"usage_based">]>;
|
|
239
|
-
max_purchase: z.ZodOptional<z.ZodNumber>;
|
|
240
|
-
}, z.core.$strip>>;
|
|
241
|
-
proration: z.ZodOptional<z.ZodObject<{
|
|
242
|
-
on_increase: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"charge_immediately">]>;
|
|
243
|
-
on_decrease: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"refund_immediately">, z.ZodLiteral<"no_action">]>;
|
|
244
|
-
}, z.core.$strip>>;
|
|
245
|
-
rollover: z.ZodOptional<z.ZodObject<{
|
|
246
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
247
|
-
max_percentage: z.ZodOptional<z.ZodNumber>;
|
|
248
|
-
expiry_duration_type: z.ZodUnion<readonly [z.ZodLiteral<"month">, z.ZodLiteral<"forever">]>;
|
|
249
|
-
expiry_duration_length: z.ZodOptional<z.ZodNumber>;
|
|
250
|
-
}, z.core.$strip>>;
|
|
251
|
-
entityFeatureId: z.ZodOptional<z.ZodString>;
|
|
252
|
-
entitlementId: z.ZodOptional<z.ZodString>;
|
|
253
|
-
priceId: z.ZodOptional<z.ZodString>;
|
|
254
|
-
}, z.core.$strip>>>;
|
|
255
|
-
removeItems: z.ZodOptional<z.ZodArray<z.ZodCustom<LicenseItemFilter, LicenseItemFilter>>>;
|
|
256
|
-
}, z.core.$strip>>;
|
|
257
|
-
}, z.core.$strip>;
|
|
258
|
-
export declare const PlanSchema: z.ZodObject<{
|
|
259
|
-
description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
260
|
-
addOn: z.ZodDefault<z.ZodBoolean>;
|
|
261
|
-
autoEnable: z.ZodDefault<z.ZodBoolean>;
|
|
262
|
-
price: z.ZodOptional<z.ZodObject<{
|
|
263
|
-
amount: z.ZodNumber;
|
|
264
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
265
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
266
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
-
currency: z.ZodString;
|
|
268
|
-
amount: z.ZodNumber;
|
|
269
|
-
}, z.core.$strip>>>;
|
|
270
|
-
}, z.core.$strip>>;
|
|
271
|
-
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
272
|
-
featureId: z.ZodString;
|
|
273
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
274
|
-
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
275
|
-
pooled: z.ZodOptional<z.ZodBoolean>;
|
|
276
|
-
reset: z.ZodOptional<z.ZodObject<{
|
|
277
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
278
|
-
interval_count: z.ZodOptional<z.ZodNumber>;
|
|
279
|
-
}, z.core.$strip>>;
|
|
280
|
-
price: z.ZodOptional<z.ZodObject<{
|
|
281
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
282
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
283
|
-
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
284
|
-
amount: z.ZodNumber;
|
|
285
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
286
|
-
currency: z.ZodString;
|
|
287
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
288
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
289
|
-
}, z.core.$strip>>>;
|
|
290
|
-
}, z.core.$strip>>>;
|
|
291
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
292
|
-
currency: z.ZodString;
|
|
293
|
-
amount: z.ZodNumber;
|
|
294
|
-
}, z.core.$strip>>>;
|
|
295
|
-
tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
|
|
296
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
297
|
-
interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
298
|
-
billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
299
|
-
billing_method: z.ZodUnion<readonly [z.ZodLiteral<"prepaid">, z.ZodLiteral<"usage_based">]>;
|
|
300
|
-
max_purchase: z.ZodOptional<z.ZodNumber>;
|
|
301
|
-
}, z.core.$strip>>;
|
|
302
|
-
proration: z.ZodOptional<z.ZodObject<{
|
|
303
|
-
on_increase: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"charge_immediately">]>;
|
|
304
|
-
on_decrease: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"refund_immediately">, z.ZodLiteral<"no_action">]>;
|
|
305
|
-
}, z.core.$strip>>;
|
|
306
|
-
rollover: z.ZodOptional<z.ZodObject<{
|
|
307
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
308
|
-
max_percentage: z.ZodOptional<z.ZodNumber>;
|
|
309
|
-
expiry_duration_type: z.ZodUnion<readonly [z.ZodLiteral<"month">, z.ZodLiteral<"forever">]>;
|
|
310
|
-
expiry_duration_length: z.ZodOptional<z.ZodNumber>;
|
|
311
|
-
}, z.core.$strip>>;
|
|
312
|
-
entityFeatureId: z.ZodOptional<z.ZodString>;
|
|
313
|
-
entitlementId: z.ZodOptional<z.ZodString>;
|
|
314
|
-
priceId: z.ZodOptional<z.ZodString>;
|
|
315
|
-
}, z.core.$strip>>>;
|
|
316
|
-
freeTrial: z.ZodOptional<z.ZodObject<{
|
|
317
|
-
durationLength: z.ZodNumber;
|
|
318
|
-
durationType: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"day">, z.ZodLiteral<"month">, z.ZodLiteral<"year">]>>;
|
|
319
|
-
cardRequired: z.ZodDefault<z.ZodBoolean>;
|
|
320
|
-
}, z.core.$strip>>;
|
|
321
|
-
billingControls: z.ZodOptional<z.ZodCustom<BillingControls, BillingControls>>;
|
|
322
|
-
licenses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
323
|
-
licensePlanId: z.ZodString;
|
|
324
|
-
version: z.ZodOptional<z.ZodNumber>;
|
|
325
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
326
|
-
customize: z.ZodOptional<z.ZodObject<{
|
|
327
|
-
price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
328
|
-
amount: z.ZodNumber;
|
|
329
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
330
|
-
intervalCount: z.ZodOptional<z.ZodNumber>;
|
|
331
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
332
|
-
currency: z.ZodString;
|
|
333
|
-
amount: z.ZodNumber;
|
|
334
|
-
}, z.core.$strip>>>;
|
|
335
|
-
}, z.core.$strip>>>;
|
|
336
|
-
addItems: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
337
|
-
featureId: z.ZodString;
|
|
338
|
-
included: z.ZodOptional<z.ZodNumber>;
|
|
339
|
-
unlimited: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
-
pooled: z.ZodOptional<z.ZodBoolean>;
|
|
341
|
-
reset: z.ZodOptional<z.ZodObject<{
|
|
342
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"minute">, z.ZodLiteral<"hour">, z.ZodLiteral<"day">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
343
|
-
interval_count: z.ZodOptional<z.ZodNumber>;
|
|
344
|
-
}, z.core.$strip>>;
|
|
345
|
-
price: z.ZodOptional<z.ZodObject<{
|
|
346
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
347
|
-
tiers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
348
|
-
to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
|
|
349
|
-
amount: z.ZodNumber;
|
|
350
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
351
|
-
currency: z.ZodString;
|
|
352
|
-
amount: z.ZodOptional<z.ZodNumber>;
|
|
353
|
-
flatAmount: z.ZodOptional<z.ZodNumber>;
|
|
354
|
-
}, z.core.$strip>>>;
|
|
355
|
-
}, z.core.$strip>>>;
|
|
356
|
-
additionalCurrencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
357
|
-
currency: z.ZodString;
|
|
358
|
-
amount: z.ZodNumber;
|
|
359
|
-
}, z.core.$strip>>>;
|
|
360
|
-
tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
|
|
361
|
-
interval: z.ZodUnion<readonly [z.ZodLiteral<"one_off">, z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
|
|
362
|
-
interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
363
|
-
billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
364
|
-
billing_method: z.ZodUnion<readonly [z.ZodLiteral<"prepaid">, z.ZodLiteral<"usage_based">]>;
|
|
365
|
-
max_purchase: z.ZodOptional<z.ZodNumber>;
|
|
366
|
-
}, z.core.$strip>>;
|
|
367
|
-
proration: z.ZodOptional<z.ZodObject<{
|
|
368
|
-
on_increase: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"charge_immediately">]>;
|
|
369
|
-
on_decrease: z.ZodUnion<readonly [z.ZodLiteral<"prorate">, z.ZodLiteral<"refund_immediately">, z.ZodLiteral<"no_action">]>;
|
|
370
|
-
}, z.core.$strip>>;
|
|
371
|
-
rollover: z.ZodOptional<z.ZodObject<{
|
|
372
|
-
max: z.ZodOptional<z.ZodNumber>;
|
|
373
|
-
max_percentage: z.ZodOptional<z.ZodNumber>;
|
|
374
|
-
expiry_duration_type: z.ZodUnion<readonly [z.ZodLiteral<"month">, z.ZodLiteral<"forever">]>;
|
|
375
|
-
expiry_duration_length: z.ZodOptional<z.ZodNumber>;
|
|
376
|
-
}, z.core.$strip>>;
|
|
377
|
-
entityFeatureId: z.ZodOptional<z.ZodString>;
|
|
378
|
-
entitlementId: z.ZodOptional<z.ZodString>;
|
|
379
|
-
priceId: z.ZodOptional<z.ZodString>;
|
|
380
|
-
}, z.core.$strip>>>;
|
|
381
|
-
removeItems: z.ZodOptional<z.ZodArray<z.ZodCustom<LicenseItemFilter, LicenseItemFilter>>>;
|
|
382
|
-
}, z.core.$strip>>;
|
|
383
|
-
}, z.core.$strip>>>;
|
|
384
|
-
id: z.ZodString;
|
|
385
|
-
name: z.ZodString;
|
|
386
|
-
group: z.ZodDefault<z.ZodString>;
|
|
387
|
-
archived: z.ZodOptional<z.ZodBoolean>;
|
|
388
|
-
}, z.core.$strip>;
|
|
389
|
-
export type ResetInterval = "one_off" | "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year";
|
|
390
|
-
export type RolloverExpiryDurationType = "month" | "forever";
|
|
391
|
-
export type BillingInterval = "one_off" | "week" | "month" | "quarter" | "semi_annual" | "year";
|
|
392
|
-
export type PlanPriceInterval = "one_off" | "week" | "month" | "quarter" | "semi_annual" | "year";
|
|
393
|
-
export type BillingMethod = "prepaid" | "usage_based";
|
|
394
|
-
export type OnIncrease = "prorate" | "charge_immediately";
|
|
395
|
-
export type OnDecrease = "prorate" | "refund_immediately" | "no_action";
|
|
396
|
-
export type AdditionalCurrency = {
|
|
397
|
-
/** Three-letter ISO currency code (e.g. 'eur', 'gbp') */
|
|
398
|
-
currency: string;
|
|
399
|
-
/** Amount in this currency */
|
|
400
|
-
amount: number;
|
|
401
|
-
};
|
|
402
|
-
export type AdditionalCurrencyTier = {
|
|
403
|
-
/** Three-letter ISO currency code (e.g. 'eur', 'gbp') */
|
|
404
|
-
currency: string;
|
|
405
|
-
/** Per-unit amount for this tier in this currency */
|
|
406
|
-
amount?: number;
|
|
407
|
-
/** Flat amount for this tier in this currency */
|
|
408
|
-
flatAmount?: number;
|
|
409
|
-
};
|
|
410
|
-
type ResetConfig = {
|
|
411
|
-
/** How often usage resets (e.g., 'month', 'day') */
|
|
412
|
-
interval: ResetInterval;
|
|
413
|
-
/** Number of intervals between resets (default: 1) */
|
|
414
|
-
intervalCount?: number;
|
|
415
|
-
};
|
|
416
|
-
type ProrationConfig = {
|
|
417
|
-
/** Behavior when quantity increases */
|
|
418
|
-
onIncrease: OnIncrease;
|
|
419
|
-
/** Behavior when quantity decreases */
|
|
420
|
-
onDecrease: OnDecrease;
|
|
421
|
-
};
|
|
422
|
-
type RolloverConfig = {
|
|
423
|
-
/** Maximum amount that can roll over (null for unlimited). Mutually exclusive with maxPercentage. */
|
|
424
|
-
max?: number | null;
|
|
425
|
-
/** Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max. */
|
|
426
|
-
maxPercentage?: number | null;
|
|
427
|
-
/** How long rollover lasts before expiring */
|
|
428
|
-
expiryDurationType: RolloverExpiryDurationType;
|
|
429
|
-
/** Duration length for rollover expiry */
|
|
430
|
-
expiryDurationLength?: number;
|
|
431
|
-
};
|
|
432
|
-
type PlanItemBaseFields = {
|
|
433
|
-
/** Reference to the feature being configured */
|
|
434
|
-
featureId: string;
|
|
435
|
-
/** The entity feature ID of the product item if applicable */
|
|
436
|
-
entityFeatureId?: string | null;
|
|
437
|
-
/** Amount of usage included in this plan */
|
|
438
|
-
included?: number;
|
|
439
|
-
/** Whether usage is unlimited */
|
|
440
|
-
unlimited?: boolean;
|
|
441
|
-
/** Whether entity-level grants contribute to a shared customer balance */
|
|
442
|
-
pooled?: boolean;
|
|
443
|
-
/** Proration rules for quantity changes */
|
|
444
|
-
proration?: ProrationConfig;
|
|
445
|
-
/** Rollover policy for unused usage */
|
|
446
|
-
rollover?: RolloverConfig;
|
|
447
|
-
};
|
|
448
|
-
type PriceBaseFields = {
|
|
449
|
-
/** Billing method: 'prepaid' or 'usage_based' */
|
|
450
|
-
billingMethod: BillingMethod;
|
|
451
|
-
/** Number of units per billing cycle */
|
|
452
|
-
billingUnits?: number;
|
|
453
|
-
/** Maximum purchasable quantity */
|
|
454
|
-
maxPurchase?: number;
|
|
455
|
-
};
|
|
456
|
-
type PriceWithAmount = PriceBaseFields & {
|
|
457
|
-
/** Price amount */
|
|
458
|
-
amount: number;
|
|
459
|
-
/** Cannot have tiers when using flat amount */
|
|
460
|
-
tiers?: never;
|
|
461
|
-
/** Flat price amounts in additional currencies */
|
|
462
|
-
additionalCurrencies?: AdditionalCurrency[];
|
|
463
|
-
};
|
|
464
|
-
type PriceWithTiers = PriceBaseFields & {
|
|
465
|
-
/** Cannot have flat amount when using tiers */
|
|
466
|
-
amount?: never;
|
|
467
|
-
/** Tiered pricing structure based on usage ranges */
|
|
468
|
-
tiers: Array<{
|
|
469
|
-
to: number | "inf";
|
|
470
|
-
amount: number;
|
|
471
|
-
flatAmount?: number;
|
|
472
|
-
/** Per-tier amounts in additional currencies */
|
|
473
|
-
additionalCurrencies?: AdditionalCurrencyTier[];
|
|
474
|
-
}>;
|
|
475
|
-
/** Required when tiers is defined: how tiers are applied */
|
|
476
|
-
tierBehavior: "graduated" | "volume";
|
|
477
|
-
/** Tiered prices carry additional currencies per tier, not at price level */
|
|
478
|
-
additionalCurrencies?: never;
|
|
479
|
-
};
|
|
480
|
-
type PriceAmountOrTiers = PriceWithAmount | PriceWithTiers;
|
|
481
|
-
type Price = PriceAmountOrTiers & {
|
|
482
|
-
/** Billing interval - omit for one-off pricing */
|
|
483
|
-
interval?: BillingInterval;
|
|
484
|
-
/** Number of intervals between billing cycles (default: 1) */
|
|
485
|
-
intervalCount?: number;
|
|
486
|
-
};
|
|
487
|
-
/** Plan item with a free reset cycle (e.g. 100 messages per month). */
|
|
488
|
-
export type PlanItemWithReset = PlanItemBaseFields & {
|
|
489
|
-
/** Reset configuration for the included allowance */
|
|
490
|
-
reset: ResetConfig;
|
|
491
|
-
price?: never;
|
|
492
|
-
};
|
|
493
|
-
/**
|
|
494
|
-
* Plan item with prepaid or usage-based pricing.
|
|
495
|
-
* Prepaid items may reset on a different cycle from billing.
|
|
496
|
-
*/
|
|
497
|
-
export type PlanItemWithPrice = PlanItemBaseFields & {
|
|
498
|
-
/** Reset configuration when it differs from the billing cycle */
|
|
499
|
-
reset?: ResetConfig;
|
|
500
|
-
/** Pricing configuration */
|
|
501
|
-
price: Price;
|
|
502
|
-
};
|
|
503
|
-
/**
|
|
504
|
-
* Plan item with no reset and no price.
|
|
505
|
-
* Use for continuous-use or boolean features (e.g. seats, feature flags).
|
|
506
|
-
*/
|
|
507
|
-
export type PlanItemNoReset = PlanItemBaseFields & {
|
|
508
|
-
/** No reset for continuous-use features */
|
|
509
|
-
reset?: never;
|
|
510
|
-
/** No price for free/boolean features */
|
|
511
|
-
price?: never;
|
|
512
|
-
};
|
|
513
|
-
/**
|
|
514
|
-
* Plan item configuration:
|
|
515
|
-
* - PlanItemWithReset: included allowance that resets on an interval (e.g. 100/month free)
|
|
516
|
-
* - PlanItemWithPrice: prepaid or usage-based pricing with a billing cycle
|
|
517
|
-
* - PlanItemNoReset: no reset, no price (continuous-use or boolean features)
|
|
518
|
-
*/
|
|
519
|
-
export type PlanItem = PlanItemWithReset | PlanItemWithPrice | PlanItemNoReset;
|
|
520
|
-
export type FreeTrial = z.infer<typeof FreeTrialSchema>;
|
|
521
|
-
export type LicenseCustomize = {
|
|
522
|
-
price?: z.infer<typeof BasePriceParamsSchema> | null;
|
|
523
|
-
addItems?: PlanItem[];
|
|
524
|
-
removeItems?: LicenseItemFilter[];
|
|
525
|
-
};
|
|
526
|
-
export type PlanLicense = Omit<z.infer<typeof PlanLicenseSchema>, "customize"> & {
|
|
527
|
-
customize?: LicenseCustomize;
|
|
528
|
-
};
|
|
529
|
-
export type Plan = {
|
|
530
|
-
/** Unique identifier for the plan. */
|
|
531
|
-
id: string;
|
|
532
|
-
/** Display name of the plan. */
|
|
533
|
-
name: string;
|
|
534
|
-
/** Optional description of the plan. */
|
|
535
|
-
description?: string | null;
|
|
536
|
-
/** Group identifier for organizing related plans. Plans in the same group are mutually exclusive. */
|
|
537
|
-
group?: string;
|
|
538
|
-
/** If true, this plan can be attached alongside other plans. Otherwise, attaching replaces existing plans in the same group. */
|
|
539
|
-
addOn?: boolean;
|
|
540
|
-
/** If true, plan is automatically attached when a customer is created. Use for free tiers. */
|
|
541
|
-
autoEnable?: boolean;
|
|
542
|
-
/** Base price for the plan */
|
|
543
|
-
price?: {
|
|
544
|
-
/** Price in your currency (e.g., 50 for $50.00) */
|
|
545
|
-
amount: number;
|
|
546
|
-
/** Billing frequency */
|
|
547
|
-
interval: PlanPriceInterval;
|
|
548
|
-
/** Base price amounts in additional currencies */
|
|
549
|
-
additionalCurrencies?: AdditionalCurrency[];
|
|
550
|
-
};
|
|
551
|
-
/** Feature configurations for this plan. Each item defines included units, pricing, and reset behavior. */
|
|
552
|
-
items?: PlanItem[];
|
|
553
|
-
/** Free trial period before billing begins */
|
|
554
|
-
freeTrial?: FreeTrial | null;
|
|
555
|
-
/** Plan-level billing controls used as customer defaults */
|
|
556
|
-
billingControls?: BillingControls;
|
|
557
|
-
/** Plans offered as assignable licenses under this plan. */
|
|
558
|
-
licenses?: PlanLicense[];
|
|
559
|
-
/** Whether the plan is archived */
|
|
560
|
-
archived?: boolean;
|
|
561
|
-
};
|
|
562
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
export type RewardDuration = {
|
|
2
|
-
type: "months";
|
|
3
|
-
length: number;
|
|
4
|
-
} | {
|
|
5
|
-
type: "one_off" | "forever";
|
|
6
|
-
length?: never;
|
|
7
|
-
};
|
|
8
|
-
type NonEmptyArray<T> = [T, ...T[]];
|
|
9
|
-
export type CouponReward = {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
type: "percentage_discount" | "fixed_discount";
|
|
13
|
-
value: number;
|
|
14
|
-
duration: RewardDuration;
|
|
15
|
-
planIds?: string[];
|
|
16
|
-
promoCodes?: Array<{
|
|
17
|
-
code: string;
|
|
18
|
-
maxRedemptions?: number;
|
|
19
|
-
firstTimeTransaction?: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
readonly __atmnType?: "reward";
|
|
22
|
-
};
|
|
23
|
-
export type FeatureGrantReward = {
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
type: "feature_grant";
|
|
27
|
-
grants: NonEmptyArray<{
|
|
28
|
-
featureId: string;
|
|
29
|
-
included?: number;
|
|
30
|
-
expiry?: {
|
|
31
|
-
type: "day" | "week" | "month" | "year";
|
|
32
|
-
length: number;
|
|
33
|
-
};
|
|
34
|
-
}>;
|
|
35
|
-
promoCodes: NonEmptyArray<{
|
|
36
|
-
code: string;
|
|
37
|
-
maxUses?: number;
|
|
38
|
-
}>;
|
|
39
|
-
readonly __atmnType?: "reward";
|
|
40
|
-
};
|
|
41
|
-
export type Reward = CouponReward | FeatureGrantReward;
|
|
42
|
-
export type ReferralProgram = {
|
|
43
|
-
id: string;
|
|
44
|
-
rewardId: string;
|
|
45
|
-
redeemOn: "customer_creation" | "checkout";
|
|
46
|
-
receivedBy: "referrer" | "all";
|
|
47
|
-
maxRedemptions?: number;
|
|
48
|
-
planIds?: string[];
|
|
49
|
-
excludeTrial?: boolean;
|
|
50
|
-
readonly __atmnType?: "referral_program";
|
|
51
|
-
};
|
|
52
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { BillingInterval, BillingMethod, FreeTrial, Plan as BasePlan, PlanItem, PlanPriceInterval, ResetInterval } from "./planModels.js";
|
|
2
|
-
type ApiBasePrice = {
|
|
3
|
-
amount: number;
|
|
4
|
-
interval: PlanPriceInterval;
|
|
5
|
-
interval_count?: number;
|
|
6
|
-
};
|
|
7
|
-
export type PlanItemFilter = {
|
|
8
|
-
featureId?: string;
|
|
9
|
-
billingMethod?: BillingMethod;
|
|
10
|
-
interval?: BillingInterval | ResetInterval;
|
|
11
|
-
intervalCount?: number;
|
|
12
|
-
};
|
|
13
|
-
export type CustomizePlan = {
|
|
14
|
-
price?: (Pick<ApiBasePrice, "amount" | "interval"> & {
|
|
15
|
-
intervalCount?: ApiBasePrice["interval_count"];
|
|
16
|
-
}) | null;
|
|
17
|
-
items?: PlanItem[];
|
|
18
|
-
addItems?: PlanItem[];
|
|
19
|
-
removeItems?: PlanItemFilter[];
|
|
20
|
-
freeTrial?: FreeTrial | null;
|
|
21
|
-
};
|
|
22
|
-
export type Variant = {
|
|
23
|
-
id: string;
|
|
24
|
-
name: string;
|
|
25
|
-
version?: number;
|
|
26
|
-
customize?: CustomizePlan;
|
|
27
|
-
readonly __atmnType?: "variant";
|
|
28
|
-
};
|
|
29
|
-
export type Plan = BasePlan & {
|
|
30
|
-
version?: number;
|
|
31
|
-
variants?: Variant[];
|
|
32
|
-
variant?: (params: Omit<Variant, "__atmnType">) => Variant;
|
|
33
|
-
};
|
|
34
|
-
export {};
|