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.
Files changed (117) hide show
  1. package/README.md +120 -0
  2. package/dist/bin.js +23102 -0
  3. package/dist/index.js +2906 -0
  4. package/dist/tsconfig.tsbuildinfo +1 -1
  5. package/package.json +27 -74
  6. package/src/actions/api/callApi.ts +280 -0
  7. package/src/actions/api/registerApiCommands.ts +121 -0
  8. package/src/actions/env/fetchOrgInfo.ts +32 -0
  9. package/src/actions/env/types/orgInfo.ts +18 -0
  10. package/src/actions/env.ts +94 -0
  11. package/src/actions/init/runInit.ts +401 -0
  12. package/src/actions/login/keyless.ts +135 -0
  13. package/src/actions/login.ts +144 -0
  14. package/src/actions/pull/appendPlanVersionFixture.ts +373 -0
  15. package/src/actions/pull/applyPreview.ts +553 -0
  16. package/src/actions/pull/applySettingsPreview.ts +114 -0
  17. package/src/actions/pull/changedFixtureKeys.ts +88 -0
  18. package/src/actions/pull/listSourceFiles.ts +29 -0
  19. package/src/actions/pull/locateFixture.ts +78 -0
  20. package/src/actions/pull/resolveCollectionTarget.ts +198 -0
  21. package/src/actions/pull/rewriteConfig.ts +57 -0
  22. package/src/actions/pull/scaffoldConfig.ts +118 -0
  23. package/src/actions/pull.ts +399 -0
  24. package/src/actions/push/backfillInternalIds.ts +394 -0
  25. package/src/actions/push/deprecatedFields.ts +55 -0
  26. package/src/actions/push.ts +294 -0
  27. package/src/actions/reset/runReset.ts +58 -0
  28. package/src/actions/sandbox/createSandbox.ts +83 -0
  29. package/src/actions/sandbox/deleteSandbox.ts +91 -0
  30. package/src/actions/sandbox/listSandboxes.ts +28 -0
  31. package/src/actions/sandbox/types/sandboxClient.ts +16 -0
  32. package/src/actions/sandbox/useSandbox.ts +157 -0
  33. package/src/actions/sandbox/withSandboxScopeHint.ts +27 -0
  34. package/src/actions/skills/skills.ts +246 -0
  35. package/src/auth/announceAuthorizationUrl.ts +26 -0
  36. package/src/auth/browser/openSystemBrowser.ts +7 -0
  37. package/src/auth/browser/tryOpenBrowser.ts +17 -0
  38. package/src/auth/browser/watchLauncher.ts +46 -0
  39. package/src/auth/buildAuthorizationUrl.ts +36 -0
  40. package/src/auth/callbackPages.ts +126 -0
  41. package/src/auth/createOrgApiKeys.ts +46 -0
  42. package/src/auth/keyless.ts +119 -0
  43. package/src/auth/oauthConfig.ts +63 -0
  44. package/src/auth/runOAuthFlow.ts +230 -0
  45. package/src/auth/types/browserOpener.ts +5 -0
  46. package/src/auth/types/impersonationTokens.ts +23 -0
  47. package/src/auth/types/oauthTokens.ts +13 -0
  48. package/src/auth/types/orgApiKeys.ts +6 -0
  49. package/src/bin.ts +9 -0
  50. package/src/cli.ts +648 -0
  51. package/src/config/configPackageName.ts +9 -0
  52. package/src/config/legacyConfig.ts +25 -0
  53. package/src/config/loadConfig.ts +231 -0
  54. package/src/env/assertSandboxTarget.ts +20 -0
  55. package/src/env/loadEnv.ts +184 -0
  56. package/src/env/resolveTarget.ts +134 -0
  57. package/src/env/sandboxKeyName.ts +18 -0
  58. package/src/generated/apiRoutes.ts +3787 -0
  59. package/src/generated/client.ts +51564 -0
  60. package/src/generated/emit.ts +1163 -0
  61. package/src/generated/emitRuntime.ts +522 -0
  62. package/src/generated/features.ts +146 -0
  63. package/src/generated/labels.ts +29 -0
  64. package/src/generated/licenses.ts +287 -0
  65. package/src/generated/lintRules.ts +2207 -0
  66. package/src/generated/lintRuntime.ts +865 -0
  67. package/src/generated/plans.ts +1628 -0
  68. package/src/generated/referralPrograms.ts +22 -0
  69. package/src/generated/rewards.ts +58 -0
  70. package/src/generated/settings.ts +21 -0
  71. package/src/generated/skills.ts +305 -0
  72. package/src/generated/variants.ts +934 -0
  73. package/src/generated/wire.ts +334 -0
  74. package/src/http/autumnFetch.ts +30 -0
  75. package/src/index.ts +20 -0
  76. package/src/project/chooseConfigDir.ts +41 -0
  77. package/src/project/resolveProject.ts +115 -0
  78. package/src/project/rootMarker.ts +40 -0
  79. package/src/prompt/prompt.ts +186 -0
  80. package/src/prompt/select.ts +162 -0
  81. package/src/render/renderEnv.ts +77 -0
  82. package/src/render/renderPreview.ts +945 -0
  83. package/src/render/renderSandboxes.ts +92 -0
  84. package/src/render/stripTerminalControls.ts +19 -0
  85. package/src/repo/findRepoRoot.ts +79 -0
  86. package/src/surgery/appendPropertyEdit.ts +67 -0
  87. package/src/surgery/appendToArray.ts +87 -0
  88. package/src/surgery/appendToBinding.ts +19 -0
  89. package/src/surgery/appendToCollection.ts +40 -0
  90. package/src/surgery/appendToFixtureArray.ts +71 -0
  91. package/src/surgery/arrayBinding.ts +30 -0
  92. package/src/surgery/deleteFixtureLiteral.ts +81 -0
  93. package/src/surgery/deleteReference.ts +48 -0
  94. package/src/surgery/ensureBuilderImport.ts +65 -0
  95. package/src/surgery/findFixture.ts +238 -0
  96. package/src/surgery/fixtureEdit.ts +156 -0
  97. package/src/surgery/fixtureLocation.ts +32 -0
  98. package/src/surgery/insertCollection.ts +86 -0
  99. package/src/surgery/insertFirstProperty.ts +73 -0
  100. package/src/surgery/patchFixtureProperty.ts +152 -0
  101. package/src/surgery/patchSingletonProperty.ts +221 -0
  102. package/src/surgery/replaceFixture.ts +28 -0
  103. package/src/surgery/setFixtureProperty.ts +55 -0
  104. package/src/surgery/staticFixtureRule.ts +48 -0
  105. package/src/version.ts +5 -0
  106. package/dist/cli.js +0 -146296
  107. package/dist/compose/index.js +0 -122
  108. package/dist/src/compose/builders/builderFunctions.d.ts +0 -84
  109. package/dist/src/compose/builders/rewardFunctions.d.ts +0 -5
  110. package/dist/src/compose/builders/variantFunctions.d.ts +0 -2
  111. package/dist/src/compose/index.d.ts +0 -19
  112. package/dist/src/compose/models/featureModels.d.ts +0 -262
  113. package/dist/src/compose/models/index.d.ts +0 -3
  114. package/dist/src/compose/models/planModels.d.ts +0 -562
  115. package/dist/src/compose/models/rewardModels.d.ts +0 -52
  116. package/dist/src/compose/models/variantModels.d.ts +0 -34
  117. package/readme.md +0 -186
@@ -0,0 +1,934 @@
1
+ // Generated by @autumn/atmn-generator from packages/openapi/openapi-internal.yml.
2
+ // Do not edit — run `bun generate` in packages/atmn-generator instead.
3
+
4
+ export type Variant = {
5
+ /** The variant plan this overlay applies to. */
6
+ variantPlanId: string;
7
+ /** Address an existing variant row by its stable id, instead of by plan id and version. */
8
+ internalId?: string;
9
+ /** Which version of the variant this overlay targets. At most one of `version` / `version_slug`; omit both to target latest. */
10
+ version?: number;
11
+ /** Which version of the variant this overlay targets, by slug. Same pin as `version`; omit both to target latest. Defaults to "vN", N being the server's version number; state it explicitly on every variant history row. */
12
+ versionSlug?: string;
13
+ /** Display name when creating the variant if it does not exist. */
14
+ name: string;
15
+ /** Archive or unarchive this variant. Omit to leave archived state unchanged. */
16
+ archived?: boolean;
17
+ /** Slug for the row this variant mints. Omit to inherit the base's `new_version_slug`, then `v{n}`. Ignored when this entry resolves to an existing row. */
18
+ newVersionSlug?: string;
19
+ /** Overrides the base plan's processors for this variant. Omit to inherit when the base processors change. */
20
+ processors?: {
21
+ stripe?: {
22
+ /** Stripe product ID this plan is billed under. */
23
+ productId: string;
24
+ /** Extra Stripe product IDs aliased to this plan. */
25
+ additionalProductIds?: Array<string>;
26
+ } | null;
27
+ revenuecat?: {
28
+ /** Every RevenueCat product that maps to this plan. Replaces the current set. */
29
+ products: Array<{
30
+ /** RevenueCat product ID that grants this plan when purchased. */
31
+ productId: string;
32
+ /** Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units. */
33
+ featureQuantities?: Array<{
34
+ featureId: string;
35
+ quantity?: number;
36
+ }>;
37
+ }>;
38
+ } | null;
39
+ };
40
+ /** Pointer write for this nested variant. Omit to link it to this base; `null` detaches it. A string must be this plan's id. */
41
+ baseVariantId?: string | null;
42
+ /** Declared overlay on this variant. `items` is PUT (replaces the list); `add_items` / `remove_items` are PATCH. Independent of `propagate`. Blocked on an archived variant unless `archived` is false in the same entry. */
43
+ customize?: {
44
+ /** Override the base price of the plan. Pass null to remove the base price. */
45
+ price?: {
46
+ /** Base price amount for the plan, in major currency units (e.g. dollars). */
47
+ amount: number;
48
+ /** Billing interval (e.g. 'month', 'year'). */
49
+ interval:
50
+ | "one_off"
51
+ | "week"
52
+ | "month"
53
+ | "quarter"
54
+ | "semi_annual"
55
+ | "year";
56
+ /** Number of intervals per billing cycle. Defaults to 1. */
57
+ intervalCount?: number;
58
+ /** Base price amounts in additional currencies. The base 'amount' is in the org's default currency. */
59
+ additionalCurrencies?: Array<{
60
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
61
+ currency: string;
62
+ /** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
63
+ amount: number;
64
+ }>;
65
+ } | null;
66
+ /** Override the items in the plan (PUT-style — replaces all existing items). Mutually exclusive with add_items / remove_items / deprecated update_items. */
67
+ items?: Array<{
68
+ /** Bills this many feature units when outstanding overage reaches it. */
69
+ thresholdBilling?: {
70
+ threshold: number;
71
+ } | null;
72
+ /** The ID of the feature to configure. */
73
+ featureId: string;
74
+ /** Number of free units included. Balance resets to this each interval for consumable features. */
75
+ included?: number;
76
+ /** If true, customer has unlimited access to this feature. */
77
+ unlimited?: boolean;
78
+ /** Whether entity-level grants contribute to a shared customer balance. Defaults to false. */
79
+ pooled?: boolean;
80
+ /** Reset configuration for consumable features. Omit for non-consumable features like seats. */
81
+ reset?: {
82
+ /** Interval at which balance resets (e.g. 'month', 'year'). For consumable features only. */
83
+ interval:
84
+ | "one_off"
85
+ | "minute"
86
+ | "hour"
87
+ | "day"
88
+ | "week"
89
+ | "month"
90
+ | "quarter"
91
+ | "semi_annual"
92
+ | "year";
93
+ /** Number of intervals between resets. Defaults to 1. */
94
+ intervalCount?: number;
95
+ };
96
+ /** Pricing for usage beyond included units. Omit for free features. */
97
+ price?: {
98
+ /** Price per billing_units after included usage. Either 'amount' or 'tiers' is required. */
99
+ amount?: number;
100
+ /** Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'. */
101
+ additionalCurrencies?: Array<{
102
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
103
+ currency: string;
104
+ /** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
105
+ amount: number;
106
+ }>;
107
+ /** Tiered pricing. Either 'amount' or 'tiers' is required. */
108
+ tiers?: Array<{
109
+ to: number | "inf";
110
+ amount?: number;
111
+ flatAmount?: number;
112
+ /** Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies. */
113
+ additionalCurrencies?: Array<{
114
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
115
+ currency: string;
116
+ /** Per-unit amount for this tier in this currency. */
117
+ amount?: number;
118
+ /** Flat amount for this tier in this currency, if the tier uses one. */
119
+ flatAmount?: number;
120
+ }>;
121
+ }>;
122
+ tierBehavior?: "graduated" | "volume";
123
+ /** Billing interval. For consumable features, should match reset.interval. */
124
+ interval:
125
+ | "one_off"
126
+ | "week"
127
+ | "month"
128
+ | "quarter"
129
+ | "semi_annual"
130
+ | "year";
131
+ /** Number of intervals per billing cycle. Defaults to 1. */
132
+ intervalCount?: number;
133
+ /** Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200). Defaults to 1. */
134
+ billingUnits?: number;
135
+ /** 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go. */
136
+ billingMethod: "prepaid" | "usage_based";
137
+ allocatedBilling?: "arrear" | "prorated_legacy";
138
+ /** Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit. */
139
+ maxPurchase?: number | null;
140
+ };
141
+ /** Proration settings for prepaid features. Controls mid-cycle quantity change billing. */
142
+ proration?: {
143
+ /** Billing behavior when quantity increases mid-cycle. */
144
+ onIncrease:
145
+ | "bill_immediately"
146
+ | "prorate_immediately"
147
+ | "prorate_next_cycle"
148
+ | "bill_next_cycle";
149
+ /** Credit behavior when quantity decreases mid-cycle. */
150
+ onDecrease:
151
+ | "prorate"
152
+ | "prorate_immediately"
153
+ | "prorate_next_cycle"
154
+ | "none"
155
+ | "no_prorations";
156
+ };
157
+ /** Rollover config for unused units. If set, unused included units carry over. */
158
+ rollover?: {
159
+ /** Max rollover units. Omit for unlimited rollover. */
160
+ max?: number;
161
+ /** Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max. */
162
+ maxPercentage?: number;
163
+ /** When rolled over units expire. */
164
+ expiryDurationType: "month" | "forever";
165
+ /** Number of periods before expiry. */
166
+ expiryDurationLength?: number;
167
+ };
168
+ /** Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema). */
169
+ featureOverride?: {
170
+ /** For credit system features: replaces the feature's credit_schema entirely for customers on this plan. */
171
+ creditSchema?: Array<
172
+ | {
173
+ /** ID of the metered feature that draws from this credit system. */
174
+ meteredFeatureId: string;
175
+ /** Number of metered-feature units priced together. Defaults to one when omitted. */
176
+ billingUnits?: number;
177
+ /** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
178
+ dimensions?: Record<
179
+ string,
180
+ | {
181
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
182
+ match: Record<string, string | number | boolean>;
183
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
184
+ priority?: number;
185
+ tierBehavior: "graduated";
186
+ tiers: Array<{
187
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
188
+ to: number | "inf";
189
+ /** Credits consumed per billing-unit group within this tier. */
190
+ creditCost: number;
191
+ }>;
192
+ }
193
+ | {
194
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
195
+ match: Record<string, string | number | boolean>;
196
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
197
+ priority?: number;
198
+ /** Credits consumed per billing-unit group when this dimension matches. */
199
+ creditCost: number;
200
+ }
201
+ >;
202
+ /** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
203
+ multipliers?: Record<
204
+ string,
205
+ {
206
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
207
+ match: Record<string, string | number | boolean>;
208
+ /** Multiplies the matched rate. All matching multipliers stack. */
209
+ factor?: number;
210
+ /** Added to the rate after every factor is applied, in credits per billing-unit group. */
211
+ add?: number;
212
+ }
213
+ >;
214
+ tierBehavior: "graduated";
215
+ tiers: Array<{
216
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
217
+ to: number | "inf";
218
+ /** Credits consumed per billing-unit group within this tier. */
219
+ creditCost: number;
220
+ }>;
221
+ }
222
+ | {
223
+ /** ID of the metered feature that draws from this credit system. */
224
+ meteredFeatureId: string;
225
+ /** Number of metered-feature units priced together. Defaults to one when omitted. */
226
+ billingUnits?: number;
227
+ /** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
228
+ dimensions?: Record<
229
+ string,
230
+ | {
231
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
232
+ match: Record<string, string | number | boolean>;
233
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
234
+ priority?: number;
235
+ tierBehavior: "graduated";
236
+ tiers: Array<{
237
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
238
+ to: number | "inf";
239
+ /** Credits consumed per billing-unit group within this tier. */
240
+ creditCost: number;
241
+ }>;
242
+ }
243
+ | {
244
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
245
+ match: Record<string, string | number | boolean>;
246
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
247
+ priority?: number;
248
+ /** Credits consumed per billing-unit group when this dimension matches. */
249
+ creditCost: number;
250
+ }
251
+ >;
252
+ /** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
253
+ multipliers?: Record<
254
+ string,
255
+ {
256
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
257
+ match: Record<string, string | number | boolean>;
258
+ /** Multiplies the matched rate. All matching multipliers stack. */
259
+ factor?: number;
260
+ /** Added to the rate after every factor is applied, in credits per billing-unit group. */
261
+ add?: number;
262
+ }
263
+ >;
264
+ /** Credits consumed per billing-unit group. */
265
+ creditCost: number;
266
+ }
267
+ >;
268
+ /** For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's. */
269
+ markups?: {
270
+ /** Default percentage markup for customers on this plan. Use -100 to make usage free. */
271
+ defaultMarkup?: number;
272
+ /** Per-provider markup percentages for customers on this plan. */
273
+ providerMarkups?: Record<
274
+ string,
275
+ {
276
+ markup: number;
277
+ }
278
+ > | null;
279
+ /** Per-model markup overrides for customers on this plan. */
280
+ modelMarkups?: Record<
281
+ string,
282
+ {
283
+ markup?: number;
284
+ inputCost?: number;
285
+ outputCost?: number;
286
+ }
287
+ > | null;
288
+ };
289
+ };
290
+ entityFeatureId?: string;
291
+ }>;
292
+ /** Items to add to the plan. */
293
+ addItems?: Array<{
294
+ /** Bills this many feature units when outstanding overage reaches it. */
295
+ thresholdBilling?: {
296
+ threshold: number;
297
+ } | null;
298
+ /** The ID of the feature to configure. */
299
+ featureId: string;
300
+ /** Number of free units included. Balance resets to this each interval for consumable features. */
301
+ included?: number;
302
+ /** If true, customer has unlimited access to this feature. */
303
+ unlimited?: boolean;
304
+ /** Whether entity-level grants contribute to a shared customer balance. Defaults to false. */
305
+ pooled?: boolean;
306
+ /** Reset configuration for consumable features. Omit for non-consumable features like seats. */
307
+ reset?: {
308
+ /** Interval at which balance resets (e.g. 'month', 'year'). For consumable features only. */
309
+ interval:
310
+ | "one_off"
311
+ | "minute"
312
+ | "hour"
313
+ | "day"
314
+ | "week"
315
+ | "month"
316
+ | "quarter"
317
+ | "semi_annual"
318
+ | "year";
319
+ /** Number of intervals between resets. Defaults to 1. */
320
+ intervalCount?: number;
321
+ };
322
+ /** Pricing for usage beyond included units. Omit for free features. */
323
+ price?: {
324
+ /** Price per billing_units after included usage. Either 'amount' or 'tiers' is required. */
325
+ amount?: number;
326
+ /** Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'. */
327
+ additionalCurrencies?: Array<{
328
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
329
+ currency: string;
330
+ /** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
331
+ amount: number;
332
+ }>;
333
+ /** Tiered pricing. Either 'amount' or 'tiers' is required. */
334
+ tiers?: Array<{
335
+ to: number | "inf";
336
+ amount?: number;
337
+ flatAmount?: number;
338
+ /** Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies. */
339
+ additionalCurrencies?: Array<{
340
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
341
+ currency: string;
342
+ /** Per-unit amount for this tier in this currency. */
343
+ amount?: number;
344
+ /** Flat amount for this tier in this currency, if the tier uses one. */
345
+ flatAmount?: number;
346
+ }>;
347
+ }>;
348
+ tierBehavior?: "graduated" | "volume";
349
+ /** Billing interval. For consumable features, should match reset.interval. */
350
+ interval:
351
+ | "one_off"
352
+ | "week"
353
+ | "month"
354
+ | "quarter"
355
+ | "semi_annual"
356
+ | "year";
357
+ /** Number of intervals per billing cycle. Defaults to 1. */
358
+ intervalCount?: number;
359
+ /** Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200). Defaults to 1. */
360
+ billingUnits?: number;
361
+ /** 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go. */
362
+ billingMethod: "prepaid" | "usage_based";
363
+ allocatedBilling?: "arrear" | "prorated_legacy";
364
+ /** Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit. */
365
+ maxPurchase?: number | null;
366
+ };
367
+ /** Proration settings for prepaid features. Controls mid-cycle quantity change billing. */
368
+ proration?: {
369
+ /** Billing behavior when quantity increases mid-cycle. */
370
+ onIncrease:
371
+ | "bill_immediately"
372
+ | "prorate_immediately"
373
+ | "prorate_next_cycle"
374
+ | "bill_next_cycle";
375
+ /** Credit behavior when quantity decreases mid-cycle. */
376
+ onDecrease:
377
+ | "prorate"
378
+ | "prorate_immediately"
379
+ | "prorate_next_cycle"
380
+ | "none"
381
+ | "no_prorations";
382
+ };
383
+ /** Rollover config for unused units. If set, unused included units carry over. */
384
+ rollover?: {
385
+ /** Max rollover units. Omit for unlimited rollover. */
386
+ max?: number;
387
+ /** Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max. */
388
+ maxPercentage?: number;
389
+ /** When rolled over units expire. */
390
+ expiryDurationType: "month" | "forever";
391
+ /** Number of periods before expiry. */
392
+ expiryDurationLength?: number;
393
+ };
394
+ /** Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema). */
395
+ featureOverride?: {
396
+ /** For credit system features: replaces the feature's credit_schema entirely for customers on this plan. */
397
+ creditSchema?: Array<
398
+ | {
399
+ /** ID of the metered feature that draws from this credit system. */
400
+ meteredFeatureId: string;
401
+ /** Number of metered-feature units priced together. Defaults to one when omitted. */
402
+ billingUnits?: number;
403
+ /** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
404
+ dimensions?: Record<
405
+ string,
406
+ | {
407
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
408
+ match: Record<string, string | number | boolean>;
409
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
410
+ priority?: number;
411
+ tierBehavior: "graduated";
412
+ tiers: Array<{
413
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
414
+ to: number | "inf";
415
+ /** Credits consumed per billing-unit group within this tier. */
416
+ creditCost: number;
417
+ }>;
418
+ }
419
+ | {
420
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
421
+ match: Record<string, string | number | boolean>;
422
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
423
+ priority?: number;
424
+ /** Credits consumed per billing-unit group when this dimension matches. */
425
+ creditCost: number;
426
+ }
427
+ >;
428
+ /** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
429
+ multipliers?: Record<
430
+ string,
431
+ {
432
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
433
+ match: Record<string, string | number | boolean>;
434
+ /** Multiplies the matched rate. All matching multipliers stack. */
435
+ factor?: number;
436
+ /** Added to the rate after every factor is applied, in credits per billing-unit group. */
437
+ add?: number;
438
+ }
439
+ >;
440
+ tierBehavior: "graduated";
441
+ tiers: Array<{
442
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
443
+ to: number | "inf";
444
+ /** Credits consumed per billing-unit group within this tier. */
445
+ creditCost: number;
446
+ }>;
447
+ }
448
+ | {
449
+ /** ID of the metered feature that draws from this credit system. */
450
+ meteredFeatureId: string;
451
+ /** Number of metered-feature units priced together. Defaults to one when omitted. */
452
+ billingUnits?: number;
453
+ /** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
454
+ dimensions?: Record<
455
+ string,
456
+ | {
457
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
458
+ match: Record<string, string | number | boolean>;
459
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
460
+ priority?: number;
461
+ tierBehavior: "graduated";
462
+ tiers: Array<{
463
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
464
+ to: number | "inf";
465
+ /** Credits consumed per billing-unit group within this tier. */
466
+ creditCost: number;
467
+ }>;
468
+ }
469
+ | {
470
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
471
+ match: Record<string, string | number | boolean>;
472
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
473
+ priority?: number;
474
+ /** Credits consumed per billing-unit group when this dimension matches. */
475
+ creditCost: number;
476
+ }
477
+ >;
478
+ /** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
479
+ multipliers?: Record<
480
+ string,
481
+ {
482
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
483
+ match: Record<string, string | number | boolean>;
484
+ /** Multiplies the matched rate. All matching multipliers stack. */
485
+ factor?: number;
486
+ /** Added to the rate after every factor is applied, in credits per billing-unit group. */
487
+ add?: number;
488
+ }
489
+ >;
490
+ /** Credits consumed per billing-unit group. */
491
+ creditCost: number;
492
+ }
493
+ >;
494
+ /** For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's. */
495
+ markups?: {
496
+ /** Default percentage markup for customers on this plan. Use -100 to make usage free. */
497
+ defaultMarkup?: number;
498
+ /** Per-provider markup percentages for customers on this plan. */
499
+ providerMarkups?: Record<
500
+ string,
501
+ {
502
+ markup: number;
503
+ }
504
+ > | null;
505
+ /** Per-model markup overrides for customers on this plan. */
506
+ modelMarkups?: Record<
507
+ string,
508
+ {
509
+ markup?: number;
510
+ inputCost?: number;
511
+ outputCost?: number;
512
+ }
513
+ > | null;
514
+ };
515
+ };
516
+ entityFeatureId?: string;
517
+ }>;
518
+ /** Filters selecting items to remove from the plan. */
519
+ removeItems?: Array<{
520
+ /** Match items linked to this feature. */
521
+ featureId?: string;
522
+ /** Match items with this billing method (prepaid or usage_based). */
523
+ billingMethod?: "prepaid" | "usage_based";
524
+ /** 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. */
525
+ interval?:
526
+ | "one_off"
527
+ | "week"
528
+ | "month"
529
+ | "quarter"
530
+ | "semi_annual"
531
+ | "year"
532
+ | "one_off"
533
+ | "minute"
534
+ | "hour"
535
+ | "day"
536
+ | "week"
537
+ | "month"
538
+ | "quarter"
539
+ | "semi_annual"
540
+ | "year";
541
+ /** Match items with this interval_count. Disambiguates between items that share an interval but differ in count. */
542
+ intervalCount?: number;
543
+ /** Match items whose grant equals this included usage. Omitted is a wildcard. */
544
+ included?: number;
545
+ }>;
546
+ /** Override the plan's default free trial. Pass an object to set a custom trial, or null to remove the trial entirely. */
547
+ freeTrial?: {
548
+ /** Number of duration_type periods the trial lasts. */
549
+ durationLength: number;
550
+ /** Unit of time for the trial ('day', 'month', 'year'). Defaults to "month". */
551
+ durationType?: "day" | "month" | "year";
552
+ /** If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false. */
553
+ cardRequired?: boolean;
554
+ /** Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan. */
555
+ onEnd?: "bill" | "revert";
556
+ } | null;
557
+ /** Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer. */
558
+ billingControls?: {
559
+ /** List of auto top-up configurations per feature. Defaults to []. */
560
+ autoTopups?: Array<{
561
+ /** The ID of the feature (credit balance) to auto top-up. */
562
+ featureId: string;
563
+ /** Whether auto top-up is enabled. Defaults to false. */
564
+ enabled?: boolean;
565
+ /** When the balance drops below this threshold, an auto top-up will be purchased. */
566
+ threshold: number;
567
+ /** Amount of credits to add per auto top-up. */
568
+ quantity: number;
569
+ /** Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups. */
570
+ purchaseLimit?: {
571
+ /** The time interval for the purchase limit window. */
572
+ interval: "hour" | "day" | "week" | "month";
573
+ /** Number of intervals in the purchase limit window. Defaults to 1. */
574
+ intervalCount?: number;
575
+ /** Maximum number of auto top-ups allowed within the interval. */
576
+ limit: number;
577
+ /** Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged. */
578
+ count?: number;
579
+ };
580
+ /** When true, auto top-up creates a send_invoice invoice instead of auto-charging. */
581
+ invoiceMode?: boolean;
582
+ }>;
583
+ /** List of overage spend limits per feature (caps overage spend). Defaults to []. */
584
+ spendLimits?: Array<{
585
+ /** Optional feature ID this spend limit applies to. */
586
+ featureId?: string;
587
+ /** Whether the overage spend limit is enabled. Defaults to false. */
588
+ enabled?: boolean;
589
+ /** How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance. */
590
+ limitType?: "absolute" | "usage_percentage";
591
+ /** Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage. */
592
+ overageLimit?: number;
593
+ /** When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally. */
594
+ skipOverageBilling?: boolean;
595
+ }>;
596
+ /** List of hard usage caps per feature (max units per interval). Defaults to []. */
597
+ usageLimits?: Array<{
598
+ /** The feature this usage limit applies to. */
599
+ featureId: string;
600
+ /** Whether this usage limit is enabled. Defaults to true. */
601
+ enabled?: boolean;
602
+ /** Maximum units allowed per interval. */
603
+ limit: number;
604
+ /** Interval for the cap, aligned to the customer's billing cycle. */
605
+ interval: "day" | "week" | "month" | "year";
606
+ /** Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar. */
607
+ anchor?: "billing_cycle" | "utc";
608
+ /** When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature. */
609
+ filter?: {
610
+ properties: Record<string, string | number | boolean>;
611
+ };
612
+ }>;
613
+ /** List of usage alert configurations per feature. Defaults to []. */
614
+ usageAlerts?: Array<{
615
+ /** The feature ID this alert applies to. */
616
+ featureId?: string;
617
+ /** Whether this usage alert is enabled. Defaults to true. */
618
+ enabled?: boolean;
619
+ /** 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). */
620
+ threshold: number;
621
+ /** Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance. */
622
+ thresholdType:
623
+ | "usage"
624
+ | "usage_percentage"
625
+ | "remaining"
626
+ | "remaining_percentage";
627
+ /** What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage_limit: the cap of the usage limit with the same feature and filter. Defaults to "balance". */
628
+ basis?: "balance" | "included" | "recurring" | "usage_limit";
629
+ /** Only valid with basis usage_limit. Points the alert at the usage limit carrying the same filter. */
630
+ filter?: {
631
+ properties: Record<string, string | number | boolean>;
632
+ };
633
+ /** Optional user-defined label to distinguish multiple alerts on the same feature. */
634
+ name?: string;
635
+ }>;
636
+ /** List of overage allowed controls per feature. When enabled, usage can exceed balance. Defaults to []. */
637
+ overageAllowed?: Array<{
638
+ /** The feature ID this overage allowed control applies to. */
639
+ featureId: string;
640
+ /** Whether overage is allowed for this feature. Defaults to false. */
641
+ enabled?: boolean;
642
+ }>;
643
+ };
644
+ /** 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. */
645
+ upsertLicenses?: Array<{
646
+ licensePlanId: string;
647
+ versionSlug?: string;
648
+ included?: number;
649
+ prepaidOnly?: boolean;
650
+ customize?: {
651
+ price?: {
652
+ /** Base price amount for the plan, in major currency units (e.g. dollars). */
653
+ amount: number;
654
+ /** Billing interval (e.g. 'month', 'year'). */
655
+ interval:
656
+ | "one_off"
657
+ | "week"
658
+ | "month"
659
+ | "quarter"
660
+ | "semi_annual"
661
+ | "year";
662
+ /** Number of intervals per billing cycle. Defaults to 1. */
663
+ intervalCount?: number;
664
+ /** Base price amounts in additional currencies. The base 'amount' is in the org's default currency. */
665
+ additionalCurrencies?: Array<{
666
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
667
+ currency: string;
668
+ /** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
669
+ amount: number;
670
+ }>;
671
+ } | null;
672
+ addItems?: Array<{
673
+ /** Bills this many feature units when outstanding overage reaches it. */
674
+ thresholdBilling?: {
675
+ threshold: number;
676
+ } | null;
677
+ /** The ID of the feature to configure. */
678
+ featureId: string;
679
+ /** Number of free units included. Balance resets to this each interval for consumable features. */
680
+ included?: number;
681
+ /** If true, customer has unlimited access to this feature. */
682
+ unlimited?: boolean;
683
+ /** Whether entity-level grants contribute to a shared customer balance. Defaults to false. */
684
+ pooled?: boolean;
685
+ /** Reset configuration for consumable features. Omit for non-consumable features like seats. */
686
+ reset?: {
687
+ /** Interval at which balance resets (e.g. 'month', 'year'). For consumable features only. */
688
+ interval:
689
+ | "one_off"
690
+ | "minute"
691
+ | "hour"
692
+ | "day"
693
+ | "week"
694
+ | "month"
695
+ | "quarter"
696
+ | "semi_annual"
697
+ | "year";
698
+ /** Number of intervals between resets. Defaults to 1. */
699
+ intervalCount?: number;
700
+ };
701
+ /** Pricing for usage beyond included units. Omit for free features. */
702
+ price?: {
703
+ /** Price per billing_units after included usage. Either 'amount' or 'tiers' is required. */
704
+ amount?: number;
705
+ /** Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'. */
706
+ additionalCurrencies?: Array<{
707
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
708
+ currency: string;
709
+ /** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
710
+ amount: number;
711
+ }>;
712
+ /** Tiered pricing. Either 'amount' or 'tiers' is required. */
713
+ tiers?: Array<{
714
+ to: number | "inf";
715
+ amount?: number;
716
+ flatAmount?: number;
717
+ /** Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies. */
718
+ additionalCurrencies?: Array<{
719
+ /** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
720
+ currency: string;
721
+ /** Per-unit amount for this tier in this currency. */
722
+ amount?: number;
723
+ /** Flat amount for this tier in this currency, if the tier uses one. */
724
+ flatAmount?: number;
725
+ }>;
726
+ }>;
727
+ tierBehavior?: "graduated" | "volume";
728
+ /** Billing interval. For consumable features, should match reset.interval. */
729
+ interval:
730
+ | "one_off"
731
+ | "week"
732
+ | "month"
733
+ | "quarter"
734
+ | "semi_annual"
735
+ | "year";
736
+ /** Number of intervals per billing cycle. Defaults to 1. */
737
+ intervalCount?: number;
738
+ /** Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200). Defaults to 1. */
739
+ billingUnits?: number;
740
+ /** 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go. */
741
+ billingMethod: "prepaid" | "usage_based";
742
+ allocatedBilling?: "arrear" | "prorated_legacy";
743
+ /** Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit. */
744
+ maxPurchase?: number | null;
745
+ };
746
+ /** Proration settings for prepaid features. Controls mid-cycle quantity change billing. */
747
+ proration?: {
748
+ /** Billing behavior when quantity increases mid-cycle. */
749
+ onIncrease:
750
+ | "bill_immediately"
751
+ | "prorate_immediately"
752
+ | "prorate_next_cycle"
753
+ | "bill_next_cycle";
754
+ /** Credit behavior when quantity decreases mid-cycle. */
755
+ onDecrease:
756
+ | "prorate"
757
+ | "prorate_immediately"
758
+ | "prorate_next_cycle"
759
+ | "none"
760
+ | "no_prorations";
761
+ };
762
+ /** Rollover config for unused units. If set, unused included units carry over. */
763
+ rollover?: {
764
+ /** Max rollover units. Omit for unlimited rollover. */
765
+ max?: number;
766
+ /** Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max. */
767
+ maxPercentage?: number;
768
+ /** When rolled over units expire. */
769
+ expiryDurationType: "month" | "forever";
770
+ /** Number of periods before expiry. */
771
+ expiryDurationLength?: number;
772
+ };
773
+ /** Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema). */
774
+ featureOverride?: {
775
+ /** For credit system features: replaces the feature's credit_schema entirely for customers on this plan. */
776
+ creditSchema?: Array<
777
+ | {
778
+ /** ID of the metered feature that draws from this credit system. */
779
+ meteredFeatureId: string;
780
+ /** Number of metered-feature units priced together. Defaults to one when omitted. */
781
+ billingUnits?: number;
782
+ /** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
783
+ dimensions?: Record<
784
+ string,
785
+ | {
786
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
787
+ match: Record<string, string | number | boolean>;
788
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
789
+ priority?: number;
790
+ tierBehavior: "graduated";
791
+ tiers: Array<{
792
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
793
+ to?: unknown;
794
+ /** Credits consumed per billing-unit group within this tier. */
795
+ creditCost: number;
796
+ }>;
797
+ }
798
+ | {
799
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
800
+ match: Record<string, string | number | boolean>;
801
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
802
+ priority?: number;
803
+ /** Credits consumed per billing-unit group when this dimension matches. */
804
+ creditCost: number;
805
+ }
806
+ >;
807
+ /** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
808
+ multipliers?: Record<
809
+ string,
810
+ {
811
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
812
+ match: Record<string, string | number | boolean>;
813
+ /** Multiplies the matched rate. All matching multipliers stack. */
814
+ factor?: number;
815
+ /** Added to the rate after every factor is applied, in credits per billing-unit group. */
816
+ add?: number;
817
+ }
818
+ >;
819
+ tierBehavior: "graduated";
820
+ tiers: Array<{
821
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
822
+ to: number | "inf";
823
+ /** Credits consumed per billing-unit group within this tier. */
824
+ creditCost: number;
825
+ }>;
826
+ }
827
+ | {
828
+ /** ID of the metered feature that draws from this credit system. */
829
+ meteredFeatureId: string;
830
+ /** Number of metered-feature units priced together. Defaults to one when omitted. */
831
+ billingUnits?: number;
832
+ /** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
833
+ dimensions?: Record<
834
+ string,
835
+ | {
836
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
837
+ match: Record<string, string | number | boolean>;
838
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
839
+ priority?: number;
840
+ tierBehavior: "graduated";
841
+ tiers: Array<{
842
+ /** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
843
+ to?: unknown;
844
+ /** Credits consumed per billing-unit group within this tier. */
845
+ creditCost: number;
846
+ }>;
847
+ }
848
+ | {
849
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
850
+ match: Record<string, string | number | boolean>;
851
+ /** Breaks ties between dimensions that match the same number of keys. Higher wins. */
852
+ priority?: number;
853
+ /** Credits consumed per billing-unit group when this dimension matches. */
854
+ creditCost: number;
855
+ }
856
+ >;
857
+ /** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
858
+ multipliers?: Record<
859
+ string,
860
+ {
861
+ /** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
862
+ match: Record<string, string | number | boolean>;
863
+ /** Multiplies the matched rate. All matching multipliers stack. */
864
+ factor?: number;
865
+ /** Added to the rate after every factor is applied, in credits per billing-unit group. */
866
+ add?: number;
867
+ }
868
+ >;
869
+ /** Credits consumed per billing-unit group. */
870
+ creditCost: number;
871
+ }
872
+ >;
873
+ /** For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's. */
874
+ markups?: {
875
+ /** Default percentage markup for customers on this plan. Use -100 to make usage free. */
876
+ defaultMarkup?: number;
877
+ /** Per-provider markup percentages for customers on this plan. */
878
+ providerMarkups?: Record<
879
+ string,
880
+ {
881
+ markup: number;
882
+ }
883
+ > | null;
884
+ /** Per-model markup overrides for customers on this plan. */
885
+ modelMarkups?: Record<
886
+ string,
887
+ {
888
+ markup?: number;
889
+ inputCost?: number;
890
+ outputCost?: number;
891
+ }
892
+ > | null;
893
+ };
894
+ };
895
+ entityFeatureId?: string;
896
+ }>;
897
+ removeItems?: Array<{
898
+ /** Match items linked to this feature. */
899
+ featureId?: string;
900
+ /** Match items with this billing method (prepaid or usage_based). */
901
+ billingMethod?: "prepaid" | "usage_based";
902
+ /** 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. */
903
+ interval?:
904
+ | "one_off"
905
+ | "week"
906
+ | "month"
907
+ | "quarter"
908
+ | "semi_annual"
909
+ | "year"
910
+ | "one_off"
911
+ | "minute"
912
+ | "hour"
913
+ | "day"
914
+ | "week"
915
+ | "month"
916
+ | "quarter"
917
+ | "semi_annual"
918
+ | "year";
919
+ /** Match items with this interval_count. Disambiguates between items that share an interval but differ in count. */
920
+ intervalCount?: number;
921
+ /** Match items whose grant equals this included usage. Omitted is a wildcard. */
922
+ included?: number;
923
+ }>;
924
+ } | null;
925
+ metadata?: Record<string, unknown>;
926
+ }>;
927
+ /** License links to drop, keyed by license_plan_id. Parallel to remove_items. */
928
+ removeLicenses?: Array<{
929
+ licensePlanId: string;
930
+ }>;
931
+ } | null;
932
+ };
933
+
934
+ export const variant = (input: Variant): Variant => input;