atmn 1.1.24 → 1.1.25

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.
@@ -17,6 +17,15 @@ export declare const UsageTierSchema: z.ZodObject<{
17
17
  flatAmount: z.ZodOptional<z.ZodNumber>;
18
18
  }, z.core.$strip>>>;
19
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>;
20
29
  type AutoTopupPurchaseLimit = {
21
30
  interval: "hour" | "day" | "week" | "month";
22
31
  interval_count?: number;
@@ -119,10 +128,132 @@ export declare const FreeTrialSchema: z.ZodObject<{
119
128
  cardRequired: z.ZodDefault<z.ZodBoolean>;
120
129
  }, z.core.$strip>;
121
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>;
122
196
  export declare const PlanLicenseSchema: z.ZodObject<{
123
197
  licensePlanId: z.ZodString;
124
198
  version: z.ZodOptional<z.ZodNumber>;
125
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>>;
126
257
  }, z.core.$strip>;
127
258
  export declare const PlanSchema: z.ZodObject<{
128
259
  description: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -192,6 +323,63 @@ export declare const PlanSchema: z.ZodObject<{
192
323
  licensePlanId: z.ZodString;
193
324
  version: z.ZodOptional<z.ZodNumber>;
194
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>>;
195
383
  }, z.core.$strip>>>;
196
384
  id: z.ZodString;
197
385
  name: z.ZodString;
@@ -330,7 +518,14 @@ export type PlanItemNoReset = PlanItemBaseFields & {
330
518
  */
331
519
  export type PlanItem = PlanItemWithReset | PlanItemWithPrice | PlanItemNoReset;
332
520
  export type FreeTrial = z.infer<typeof FreeTrialSchema>;
333
- export type PlanLicense = z.infer<typeof PlanLicenseSchema>;
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
+ };
334
529
  export type Plan = {
335
530
  /** Unique identifier for the plan. */
336
531
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmn",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "atmn": "dist/cli.js"
@@ -35,8 +35,8 @@
35
35
  "dev": "nodemon -e ts,tsx --watch src --ignore dist --exec \"bun run bun.config.ts\"",
36
36
  "dev:bun": "bun run dev.ts",
37
37
  "test": "bun test test/*.test.ts test/auth test/codegen test/nuke test/pull test/push test/workflow",
38
- "test:integration": "cd ../../server && ENV_FILE=.env infisical run --env=dev --recursive -- bun test --timeout 0 ../packages/atmn/test/integration",
39
- "test:integration:cli": "cd ../../server && ENV_FILE=.env infisical run --env=dev --recursive -- bun ../packages/atmn/test/integration/cli.ts",
38
+ "test:integration": "echo 'deprecated: v1 atmn integration — see packages/atmn/test/integration/DEPRECATED.md' && exit 0",
39
+ "test:integration:cli": "echo 'deprecated: v1 atmn integration — see packages/atmn/test/integration/DEPRECATED.md' && exit 0",
40
40
  "test:unit": "bun test test/codegen",
41
41
  "test:watch": "bun test --watch",
42
42
  "test2": "prettier --check . && xo && ava",