atmn 2.0.216 → 2.0.218

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -5257,6 +5257,9 @@ var LINT_RULES = {
5257
5257
  "plans.billingControls.autoTopups.purchaseLimit": {
5258
5258
  required: ["interval", "limit"],
5259
5259
  fields: {
5260
+ limitType: {
5261
+ enum: ["count", "amount"]
5262
+ },
5260
5263
  interval: {
5261
5264
  enum: ["hour", "day", "week", "month"]
5262
5265
  },
@@ -5264,10 +5267,13 @@ var LINT_RULES = {
5264
5267
  minimum: 1
5265
5268
  },
5266
5269
  limit: {
5267
- minimum: 1
5270
+ exclusiveMinimum: 0
5268
5271
  },
5269
5272
  count: {
5270
5273
  minimum: 0
5274
+ },
5275
+ amount: {
5276
+ minimum: 0
5271
5277
  }
5272
5278
  }
5273
5279
  },
@@ -6249,6 +6255,9 @@ var LINT_RULES = {
6249
6255
  "plans.variants.customize.billingControls.autoTopups.purchaseLimit": {
6250
6256
  required: ["interval", "limit"],
6251
6257
  fields: {
6258
+ limitType: {
6259
+ enum: ["count", "amount"]
6260
+ },
6252
6261
  interval: {
6253
6262
  enum: ["hour", "day", "week", "month"]
6254
6263
  },
@@ -6256,10 +6265,13 @@ var LINT_RULES = {
6256
6265
  minimum: 1
6257
6266
  },
6258
6267
  limit: {
6259
- minimum: 1
6268
+ exclusiveMinimum: 0
6260
6269
  },
6261
6270
  count: {
6262
6271
  minimum: 0
6272
+ },
6273
+ amount: {
6274
+ minimum: 0
6263
6275
  }
6264
6276
  }
6265
6277
  },
@@ -8258,7 +8270,7 @@ var createClient = (options) => ({
8258
8270
  });
8259
8271
 
8260
8272
  // src/version.ts
8261
- var version = "2.0.216";
8273
+ var version = "2.0.218";
8262
8274
 
8263
8275
  // src/http/autumnFetch.ts
8264
8276
  var runtime = typeof Bun !== "undefined" ? `bun ${Bun.version}` : `node ${process.versions.node}`;
@@ -9620,10 +9632,12 @@ var COLLECTIONS = {
9620
9632
  "billingControls.autoTopups.featureId",
9621
9633
  "billingControls.autoTopups.invoiceMode",
9622
9634
  "billingControls.autoTopups.purchaseLimit",
9635
+ "billingControls.autoTopups.purchaseLimit.amount",
9623
9636
  "billingControls.autoTopups.purchaseLimit.count",
9624
9637
  "billingControls.autoTopups.purchaseLimit.interval",
9625
9638
  "billingControls.autoTopups.purchaseLimit.intervalCount",
9626
9639
  "billingControls.autoTopups.purchaseLimit.limit",
9640
+ "billingControls.autoTopups.purchaseLimit.limitType",
9627
9641
  "billingControls.autoTopups.quantity",
9628
9642
  "billingControls.autoTopups.threshold",
9629
9643
  "billingControls.overageAllowed",
@@ -9935,10 +9949,12 @@ var COLLECTIONS = {
9935
9949
  "variants.customize.billingControls.autoTopups.featureId",
9936
9950
  "variants.customize.billingControls.autoTopups.invoiceMode",
9937
9951
  "variants.customize.billingControls.autoTopups.purchaseLimit",
9952
+ "variants.customize.billingControls.autoTopups.purchaseLimit.amount",
9938
9953
  "variants.customize.billingControls.autoTopups.purchaseLimit.count",
9939
9954
  "variants.customize.billingControls.autoTopups.purchaseLimit.interval",
9940
9955
  "variants.customize.billingControls.autoTopups.purchaseLimit.intervalCount",
9941
9956
  "variants.customize.billingControls.autoTopups.purchaseLimit.limit",
9957
+ "variants.customize.billingControls.autoTopups.purchaseLimit.limitType",
9942
9958
  "variants.customize.billingControls.autoTopups.quantity",
9943
9959
  "variants.customize.billingControls.autoTopups.threshold",
9944
9960
  "variants.customize.billingControls.overageAllowed",
@@ -10631,16 +10647,16 @@ import { dirname as dirname4, join as join7 } from "node:path";
10631
10647
  import chalk3 from "chalk";
10632
10648
 
10633
10649
  // src/generated/skills.ts
10634
- var SKILLS_VERSION = "2.0.215";
10650
+ var SKILLS_VERSION = "2.0.217";
10635
10651
  var SKILLS = [
10636
10652
  {
10637
10653
  name: "autumn-setup",
10638
10654
  description: "First-time Autumn setup — install the atmn CLI, connect to an org (sign in, or keyless with no account), turn the user's pricing into autumn.config.ts, and push it to a sandbox org. Use when the user is new to Autumn, pastes an Autumn setup prompt, or asks to set up Autumn, add billing, monetization, subscriptions, usage-based billing, pricing, or plans. If Autumn is already set up, use autumn-catalog instead.",
10639
- version: "2.0.215",
10655
+ version: "2.0.217",
10640
10656
  markdown: `---
10641
10657
  name: autumn-setup
10642
10658
  description: First-time Autumn setup — install the atmn CLI, connect to an org (sign in, or keyless with no account), turn the user's pricing into autumn.config.ts, and push it to a sandbox org. Use when the user is new to Autumn, pastes an Autumn setup prompt, or asks to set up Autumn, add billing, monetization, subscriptions, usage-based billing, pricing, or plans. If Autumn is already set up, use autumn-catalog instead.
10643
- version: 2.0.215
10659
+ version: 2.0.217
10644
10660
  ---
10645
10661
 
10646
10662
  # Setup
@@ -10798,11 +10814,11 @@ Then stop. Don't keep building, don't tour the dashboard, don't deploy anything.
10798
10814
  {
10799
10815
  name: "autumn-catalog",
10800
10816
  description: "Modeling a user's pricing into an Autumn catalog — deciding the structure (plans, variants, add-ons, licenses, credit systems, pooled balances) before writing config, then filling in the numbers. Use when the user describes their pricing or asks to model, change, or push a catalog.",
10801
- version: "2.0.215",
10817
+ version: "2.0.217",
10802
10818
  markdown: `---
10803
10819
  name: autumn-catalog
10804
10820
  description: Modeling a user's pricing into an Autumn catalog — deciding the structure (plans, variants, add-ons, licenses, credit systems, pooled balances) before writing config, then filling in the numbers. Use when the user describes their pricing or asks to model, change, or push a catalog.
10805
- version: 2.0.215
10821
+ version: 2.0.217
10806
10822
  ---
10807
10823
 
10808
10824
  # Catalog
@@ -14669,11 +14685,11 @@ Pitch: "Pro $20/mo or $200/yr — 1,000 messages per month either way."
14669
14685
  {
14670
14686
  name: "autumn-integrate",
14671
14687
  description: "Integrating Autumn into an app's backend — creating customers, billing flows (attach, checkout, upgrade, cancel), gating features with check, recording usage with track, and exposing billing data to the frontend. Use when the user asks to integrate Autumn, add billing/payments to their app, gate features, meter usage, or build checkout/upgrade flows. Requires a pushed catalog; use autumn-catalog first if plans don't exist yet.",
14672
- version: "2.0.215",
14688
+ version: "2.0.217",
14673
14689
  markdown: `---
14674
14690
  name: autumn-integrate
14675
14691
  description: Integrating Autumn into an app's backend — creating customers, billing flows (attach, checkout, upgrade, cancel), gating features with check, recording usage with track, and exposing billing data to the frontend. Use when the user asks to integrate Autumn, add billing/payments to their app, gate features, meter usage, or build checkout/upgrade flows. Requires a pushed catalog; use autumn-catalog first if plans don't exist yet.
14676
- version: 2.0.215
14692
+ version: 2.0.217
14677
14693
  ---
14678
14694
 
14679
14695
  # Integrate
@@ -19390,11 +19406,11 @@ Monitor your logs for this message. If you see it, check [status.useautumn.com](
19390
19406
  {
19391
19407
  name: "autumn-concepts",
19392
19408
  description: "Understanding Autumn's billing objects before acting on them — what a plan version is and what active means, when a trial starts or ends billing, how entity- and seat-scoped subscriptions differ from the customer's own, what a customize diff actually changes, and how caps, overage, and top-ups behave. Load before versioning, editing, or drafting a plan, or when a customer's state does not match the plain reading of their plan.",
19393
- version: "2.0.215",
19409
+ version: "2.0.217",
19394
19410
  markdown: `---
19395
19411
  name: autumn-concepts
19396
19412
  description: Understanding Autumn's billing objects before acting on them — what a plan version is and what active means, when a trial starts or ends billing, how entity- and seat-scoped subscriptions differ from the customer's own, what a customize diff actually changes, and how caps, overage, and top-ups behave. Load before versioning, editing, or drafting a plan, or when a customer's state does not match the plain reading of their plan.
19397
- version: 2.0.215
19413
+ version: 2.0.217
19398
19414
  ---
19399
19415
 
19400
19416
  # Concepts
@@ -19679,7 +19695,7 @@ Metered volume variant:
19679
19695
  },
19680
19696
  {
19681
19697
  path: "references/trials.md",
19682
- contents: '### Trials\n\n- A trial gives a customer temporary, free access to a plan. It can be passed in during the billing call, or it can come with the plan configuration itself (which can be overriden).\n- Set a trial with `free_trial` on attach: `{ duration_length, duration_type (day|month|year), card_required, on_end }`. Always pass `duration_type` and `on_end`; never omit `on_end`, because it silently defaults to `"bill"`.\n- Default to card not required (if there is no paid plan), and on_end: revert (if there is a paid plan).\n- `on_end` must match what you tell the user happens when the trial ends. If you say the customer goes back to their current or previous plan (e.g. "if no card is added, they go back to Hobby"), pass `on_end: "revert"`. Pass `on_end: "bill"` only when the customer should be charged and keep the plan at trial end, and say that.\n\nIf the customer the customer is NOT on a paid plan (free plan or no plan at all). 2 options:\n\n- No-card trial (default to this): attach with `free_trial` and set `card_required` false. The subscription starts with no card and ends at trial end if none is added. While on it, the customer cannot upgrade or attach another plan until they add a card via the Stripe billing portal.\n- No-card trials cannot be combined with `invoice_mode` (attach rejects it). If an invoice is needed, use `card_required: true`.\n- Card-required trial: attach with `free_trial` and `card_required: true` and `long_lived_checkout` If the customer has no payment method, the attach returns a checkout URL to collect a card; they are charged when the trial ends. This should be done with a long-lived checkout URL param.\n\nThe customer already has an active (Stripe) subscription — common in sales-led trials.\n\n- On end: revert (default to this): attach the new plan with `on_end: "revert"` . This grants the plan in Autumn without touching the Stripe subscription; at trial end Autumn moves the customer back to their original plan, preserving the existing billing cycle.\n- For a revert trial on several entities at once (e.g. every deployment), use `setPlans` with one phase starting now, one plan per `entity_id`, and a top-level `free_trial` with `on_end: "revert"`. Each entity\'s current plan is paused and comes back at trial end. If `setPlans` rejects the revert, report why or attach per entity; never switch to `on_end: "bill"` without asking.\n- To end a revert trial early, cancel it with `updateSubscription` and `cancel_action: "cancel_immediately"`; Autumn restores the previous plan. Do not remove `free_trial` (that converts the trial to paid) or re-attach the old plan.\n- On end: bill -- attaching a plan with a trial (or updating the subscription to add one) resets the Stripe billing anchor/cycle. This can be undesired so warn the user if they request this.\n- Card required param is ignored if there is already an active sub.\n\n\nUpdating or ending a trial\n- Call update_subscription on the trialing plan with the new trial nested under `customize`: `{ customer_id, subscription_id, customize: { free_trial: { duration_length, duration_type, card_required, on_end } } }`. Never put `free_trial` at the top level of an update: the update endpoint rejects a request whose only change is a top-level `free_trial` ("At least one update parameter must be provided"), while `customize.free_trial` is accepted. The duration is counted from now, not from the original start. A 14-day extension on day 10 of a 14-day trial gives 14 more days, not 4.\n- For a bill-on-end trial, pass `customize: { free_trial: null }` to end the trial immediately and start paid billing. Never do this for a revert trial: it activates the trial plan at full price instead of restoring the old plan. Cancel a revert trial instead (see above).'
19698
+ contents: '### Trials\n\n- A trial gives a customer temporary, free access to a plan. It can be passed in during the billing call, or it can come with the plan configuration itself (which can be overriden).\n- Set a trial with `free_trial` on attach: `{ duration_length, duration_type (day|month|year), card_required, on_end }`. Always pass `duration_type` and `on_end`; never omit `on_end`, because it silently defaults to `"bill"`.\n- Default to card not required (if there is no paid plan), and on_end: revert (if there is a paid plan).\n- `on_end` must match what you tell the user happens when the trial ends. If you say the customer goes back to their current or previous plan (e.g. "if no card is added, they go back to Hobby"), pass `on_end: "revert"`. Pass `on_end: "bill"` only when the customer should be charged and keep the plan at trial end, and say that.\n\nIf the customer the customer is NOT on a paid plan (free plan or no plan at all). 2 options:\n\n- No-card trial (default to this): attach with `free_trial` and set `card_required` false. The subscription starts with no card and ends at trial end if none is added. While on it, the customer cannot upgrade or attach another plan until they add a card via the Stripe billing portal.\n- No-card trials cannot be combined with `invoice_mode` (attach rejects it). If an invoice is needed, use `card_required: true`.\n- Card-required trial: attach with `free_trial` and `card_required: true` and `long_lived_checkout` If the customer has no payment method, the attach returns a checkout URL to collect a card; they are charged when the trial ends. This should be done with a long-lived checkout URL param.\n\nThe customer already has an active (Stripe) subscription — common in sales-led trials.\n\n- On end: revert (default to this): attach the new plan with `on_end: "revert"` . This grants the plan in Autumn without touching the Stripe subscription; at trial end Autumn moves the customer back to their original plan, preserving the existing billing cycle.\n- For a revert trial on several entities at once (e.g. every deployment), use `setPlans` with one phase starting now, one plan per `entity_id`, and a top-level `free_trial` with `on_end: "revert"`. Each entity\'s current plan is paused and comes back at trial end. If `setPlans` rejects the revert, attach per entity instead: attach\'s revert trial pauses the current plan and keeps its scheduled switch. Never remove a scheduled switch or switch to `on_end: "bill"` without asking.\n- To end a revert trial early, cancel it with `updateSubscription` and `cancel_action: "cancel_immediately"`; Autumn restores the previous plan. Do not remove `free_trial` (that converts the trial to paid) or re-attach the old plan.\n- On end: bill -- attaching a plan with a trial (or updating the subscription to add one) resets the Stripe billing anchor/cycle. This can be undesired so warn the user if they request this.\n- Card required param is ignored if there is already an active sub.\n\n\nUpdating or ending a trial\n- Call update_subscription on the trialing plan with the new trial nested under `customize`: `{ customer_id, subscription_id, customize: { free_trial: { duration_length, duration_type, card_required, on_end } } }`. Never put `free_trial` at the top level of an update: the update endpoint rejects a request whose only change is a top-level `free_trial` ("At least one update parameter must be provided"), while `customize.free_trial` is accepted. The duration is counted from now, not from the original start. A 14-day extension on day 10 of a 14-day trial gives 14 more days, not 4.\n- For a bill-on-end trial, pass `customize: { free_trial: null }` to end the trial immediately and start paid billing. Never do this for a revert trial: it activates the trial plan at full price instead of restoring the old plan. Cancel a revert trial instead (see above).'
19683
19699
  },
19684
19700
  {
19685
19701
  path: "references/customer-entity.md",
package/dist/index.js CHANGED
@@ -319,6 +319,9 @@ var LINT_RULES = {
319
319
  "plans.billingControls.autoTopups.purchaseLimit": {
320
320
  required: ["interval", "limit"],
321
321
  fields: {
322
+ limitType: {
323
+ enum: ["count", "amount"]
324
+ },
322
325
  interval: {
323
326
  enum: ["hour", "day", "week", "month"]
324
327
  },
@@ -326,10 +329,13 @@ var LINT_RULES = {
326
329
  minimum: 1
327
330
  },
328
331
  limit: {
329
- minimum: 1
332
+ exclusiveMinimum: 0
330
333
  },
331
334
  count: {
332
335
  minimum: 0
336
+ },
337
+ amount: {
338
+ minimum: 0
333
339
  }
334
340
  }
335
341
  },
@@ -1311,6 +1317,9 @@ var LINT_RULES = {
1311
1317
  "plans.variants.customize.billingControls.autoTopups.purchaseLimit": {
1312
1318
  required: ["interval", "limit"],
1313
1319
  fields: {
1320
+ limitType: {
1321
+ enum: ["count", "amount"]
1322
+ },
1314
1323
  interval: {
1315
1324
  enum: ["hour", "day", "week", "month"]
1316
1325
  },
@@ -1318,10 +1327,13 @@ var LINT_RULES = {
1318
1327
  minimum: 1
1319
1328
  },
1320
1329
  limit: {
1321
- minimum: 1
1330
+ exclusiveMinimum: 0
1322
1331
  },
1323
1332
  count: {
1324
1333
  minimum: 0
1334
+ },
1335
+ amount: {
1336
+ minimum: 0
1325
1337
  }
1326
1338
  }
1327
1339
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmn",
3
- "version": "2.0.216",
3
+ "version": "2.0.218",
4
4
  "license": "MIT",
5
5
  "description": "The CLI for Autumn — define your pricing in code, sync it to Autumn, and keep everything in version control.",
6
6
  "bin": {
@@ -51,5 +51,5 @@
51
51
  "open": "10.2.0",
52
52
  "yaml": "2.9.0"
53
53
  },
54
- "gitHead": "62a069533e4037748fa276d39517787469c232c0"
54
+ "gitHead": "f9f4638c6a1206bee51943c2e7d85a2a2ec39a73"
55
55
  }