atmn 1.1.0 → 1.1.1

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/cli.js CHANGED
@@ -44671,11 +44671,18 @@ var init_planItem = __esm(() => {
44671
44671
  return;
44672
44672
  return {
44673
44673
  amount: api.price.amount,
44674
- tiers: api.price.tiers,
44674
+ tiers: api.price.tiers?.map((tier) => {
44675
+ const t = tier;
44676
+ return {
44677
+ to: t.to,
44678
+ amount: t.amount,
44679
+ ...t.flat_amount !== undefined && { flatAmount: t.flat_amount }
44680
+ };
44681
+ }),
44675
44682
  billingUnits: api.price.billing_units,
44676
44683
  maxPurchase: api.price.max_purchase ?? undefined,
44677
44684
  billingMethod: api.price.billing_method,
44678
- tierBehaviour: api.price.tier_behaviour,
44685
+ tierBehavior: api.price.tier_behavior,
44679
44686
  interval: api.price.interval,
44680
44687
  ...api.price.interval_count !== undefined && {
44681
44688
  intervalCount: api.price.interval_count
@@ -45005,8 +45012,8 @@ function buildPlanItemCode(planItem, _features, featureVarMap) {
45005
45012
  if (priceWithBilling.maxPurchase !== undefined) {
45006
45013
  lines.push(` maxPurchase: ${priceWithBilling.maxPurchase},`);
45007
45014
  }
45008
- if (priceWithBilling.tierBehaviour !== undefined) {
45009
- lines.push(` tierBehaviour: '${priceWithBilling.tierBehaviour}',`);
45015
+ if (priceWithBilling.tierBehavior !== undefined) {
45016
+ lines.push(` tierBehavior: '${priceWithBilling.tierBehavior}',`);
45010
45017
  }
45011
45018
  const priceWithInterval = planItem.price;
45012
45019
  if (priceWithInterval.interval) {
@@ -45512,7 +45519,7 @@ var init_pull = __esm(() => {
45512
45519
  });
45513
45520
 
45514
45521
  // src/lib/version.ts
45515
- var APP_VERSION = "1.1.0";
45522
+ var APP_VERSION = "1.1.1";
45516
45523
 
45517
45524
  // ../node_modules/.pnpm/@tanstack+query-core@5.90.17/node_modules/@tanstack/query-core/build/modern/subscribable.js
45518
45525
  var Subscribable = class {
@@ -61961,15 +61968,24 @@ function transformPlanItem(planItem) {
61961
61968
  ...planItem.price.amount !== undefined && {
61962
61969
  amount: planItem.price.amount
61963
61970
  },
61964
- ...planItem.price.tiers && { tiers: planItem.price.tiers },
61971
+ ...planItem.price.tiers && {
61972
+ tiers: planItem.price.tiers.map((tier) => {
61973
+ const t = tier;
61974
+ return {
61975
+ to: t.to,
61976
+ amount: t.amount,
61977
+ ...t.flatAmount !== undefined && { flat_amount: t.flatAmount }
61978
+ };
61979
+ })
61980
+ },
61965
61981
  ...intervalCount !== undefined && {
61966
61982
  interval_count: intervalCount
61967
61983
  },
61968
61984
  ...priceWithBilling.maxPurchase !== undefined && {
61969
61985
  max_purchase: priceWithBilling.maxPurchase
61970
61986
  },
61971
- ...priceWithBilling.tierBehaviour !== undefined && {
61972
- tier_behaviour: priceWithBilling.tierBehaviour
61987
+ ...priceWithBilling.tierBehavior !== undefined && {
61988
+ tier_behavior: priceWithBilling.tierBehavior
61973
61989
  }
61974
61990
  };
61975
61991
  }
@@ -17,7 +17,7 @@ export declare const PlanItemSchema: z.ZodObject<{
17
17
  to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
18
18
  amount: z.ZodNumber;
19
19
  }, z.core.$strip>>>;
20
- tier_behaviour: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
20
+ tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
21
21
  interval: z.ZodUnion<readonly [z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
22
22
  interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
23
23
  billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -65,7 +65,7 @@ export declare const PlanSchema: z.ZodObject<{
65
65
  to: z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"inf">]>;
66
66
  amount: z.ZodNumber;
67
67
  }, z.core.$strip>>>;
68
- tier_behaviour: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
68
+ tier_behavior: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"graduated">, z.ZodLiteral<"volume">]>>;
69
69
  interval: z.ZodUnion<readonly [z.ZodLiteral<"week">, z.ZodLiteral<"month">, z.ZodLiteral<"quarter">, z.ZodLiteral<"semi_annual">, z.ZodLiteral<"year">]>;
70
70
  interval_count: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
71
71
  billing_units: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
@@ -149,17 +149,32 @@ type PriceWithAmount = PriceBaseFields & {
149
149
  /** Cannot have tiers when using flat amount */
150
150
  tiers?: never;
151
151
  };
152
- type PriceWithTiers = PriceBaseFields & {
152
+ type PriceWithGraduatedTiers = PriceBaseFields & {
153
153
  /** Cannot have flat amount when using tiers */
154
154
  amount?: never;
155
- /** Tiered pricing structure based on usage ranges */
155
+ /** Graduated tiered pricing: each tier's amount applies only to units within that tier */
156
156
  tiers: Array<{
157
157
  to: number | "inf";
158
158
  amount: number;
159
159
  }>;
160
- /** Required when tiers is defined: how tiers are applied */
161
- tierBehaviour: "graduated" | "volume";
160
+ /** Graduated: each tier's rate applies only to usage within that tier */
161
+ tierBehavior: "graduated";
162
162
  };
163
+ type PriceWithVolumeTiers = Omit<PriceBaseFields, "billingMethod"> & {
164
+ /** Volume pricing does not support usage_based billing — use 'prepaid' */
165
+ billingMethod: Exclude<BillingMethod, "usage_based">;
166
+ /** Cannot have flat amount when using tiers */
167
+ amount?: never;
168
+ /** Volume tiered pricing: the tier the total usage falls into applies to all units */
169
+ tiers: Array<{
170
+ to: number | "inf";
171
+ amount: number;
172
+ flatAmount?: number;
173
+ }>;
174
+ /** Volume: the rate of the tier the total usage falls into applies to all units */
175
+ tierBehavior: "volume";
176
+ };
177
+ type PriceWithTiers = PriceWithGraduatedTiers | PriceWithVolumeTiers;
163
178
  type PriceAmountOrTiers = PriceWithAmount | PriceWithTiers;
164
179
  type PriceWithoutInterval = PriceAmountOrTiers & {
165
180
  /** Cannot have interval when using top-level reset */
package/package.json CHANGED
@@ -1,97 +1,102 @@
1
1
  {
2
- "name": "atmn",
3
- "version": "1.1.0",
4
- "license": "MIT",
5
- "bin": {
6
- "atmn": "dist/cli.js"
7
- },
8
- "main": "dist/compose/index.js",
9
- "types": "dist/src/compose/index.d.ts",
10
- "type": "module",
11
- "engines": {
12
- "node": ">=16"
13
- },
14
- "scripts": {
15
- "build": "bun run bun.config.ts",
16
- "dev": "nodemon -e ts,tsx --watch src --ignore dist --exec \"bun run bun.config.ts\"",
17
- "dev:bun": "bun run dev.ts",
18
- "test": "bun test",
19
- "test:watch": "bun test --watch",
20
- "test2": "prettier --check . && xo && ava",
21
- "test-cli": "node --trace-deprecation -- ./dist/cli.js"
22
- },
23
- "files": [
24
- "dist",
25
- "package.json",
26
- "README.md"
27
- ],
28
- "dependencies": {
29
- "@inkjs/ui": "^2.0.0",
30
- "@inquirer/prompts": "^7.6.0",
31
- "@mishieck/ink-titled-box": "^0.3.0",
32
- "@tanstack/react-query": "^5.90.17",
33
- "@types/prettier": "^3.0.0",
34
- "arctic": "^3.7.0",
35
- "axios": "^1.10.0",
36
- "cfonts": "^3.3.1",
37
- "chalk": "^5.2.0",
38
- "clipboardy": "^5.0.2",
39
- "commander": "^14.0.0",
40
- "dotenv": "^17.2.0",
41
- "ervy": "^1.0.7",
42
- "ink": "^6.6.0",
43
- "ink-big-text": "^2.0.0",
44
- "ink-chart": "^0.1.1",
45
- "ink-confirm-input": "^2.0.0",
46
- "ink-scroll-list": "^0.4.1",
47
- "ink-scroll-view": "^0.3.5",
48
- "ink-select-input": "^6.2.0",
49
- "ink-spinner": "^5.0.0",
50
- "ink-table": "^3.1.0",
51
- "ink-text-input": "^6.0.0",
52
- "inquirer": "^12.7.0",
53
- "jiti": "^2.4.2",
54
- "open": "^10.1.2",
55
- "prettier": "^3.6.2",
56
- "react": "^19.2.3",
57
- "yocto-spinner": "^1.0.0",
58
- "zod": "^4.0.0",
59
- "conf": "^13.0.1"
60
- },
61
- "devDependencies": {
62
- "@sindresorhus/tsconfig": "^3.0.1",
63
- "@types/bun": "^1.2.21",
64
- "@types/node": "^24.0.10",
65
- "@types/react": "^19.0.0",
66
- "@vdemedes/prettier-config": "^2.0.1",
67
- "ava": "^5.2.0",
68
- "cli-testing-library": "^3.0.1",
69
- "eslint-config-xo-react": "^0.27.0",
70
- "eslint-plugin-react": "^7.32.2",
71
- "eslint-plugin-react-hooks": "^4.6.0",
72
- "ink-testing-library": "^3.0.0",
73
- "nodemon": "^3.1.11",
74
- "react-devtools-core": "^6.1.2",
75
- "ts-node": "^10.9.1",
76
- "tsup": "^8.5.0",
77
- "typescript": "^5.0.3",
78
- "xo": "^0.53.1"
79
- },
80
- "ava": {
81
- "extensions": {
82
- "ts": "module",
83
- "tsx": "module"
84
- },
85
- "nodeArguments": [
86
- "--loader=ts-node/esm"
87
- ]
88
- },
89
- "xo": {
90
- "extends": "xo-react",
91
- "prettier": true,
92
- "rules": {
93
- "react/prop-types": "off"
94
- }
95
- },
96
- "prettier": "@vdemedes/prettier-config"
2
+ "name": "atmn",
3
+ "version": "1.1.1",
4
+ "license": "MIT",
5
+ "bin": {
6
+ "atmn": "dist/cli.js"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/useautumn/typescript"
11
+ },
12
+ "homepage": "https://docs.useautumn.com/api-reference/cli/getting-started",
13
+ "main": "dist/compose/index.js",
14
+ "types": "dist/src/compose/index.d.ts",
15
+ "type": "module",
16
+ "engines": {
17
+ "node": ">=16"
18
+ },
19
+ "scripts": {
20
+ "build": "bun run bun.config.ts",
21
+ "dev": "nodemon -e ts,tsx --watch src --ignore dist --exec \"bun run bun.config.ts\"",
22
+ "dev:bun": "bun run dev.ts",
23
+ "test": "bun test",
24
+ "test:watch": "bun test --watch",
25
+ "test2": "prettier --check . && xo && ava",
26
+ "test-cli": "node --trace-deprecation -- ./dist/cli.js"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "package.json",
31
+ "README.md"
32
+ ],
33
+ "dependencies": {
34
+ "@inkjs/ui": "^2.0.0",
35
+ "@inquirer/prompts": "^7.6.0",
36
+ "@mishieck/ink-titled-box": "^0.3.0",
37
+ "@tanstack/react-query": "^5.90.17",
38
+ "@types/prettier": "^3.0.0",
39
+ "arctic": "^3.7.0",
40
+ "axios": "^1.10.0",
41
+ "cfonts": "^3.3.1",
42
+ "chalk": "^5.2.0",
43
+ "clipboardy": "^5.0.2",
44
+ "commander": "^14.0.0",
45
+ "dotenv": "^17.2.0",
46
+ "ervy": "^1.0.7",
47
+ "ink": "^6.6.0",
48
+ "ink-big-text": "^2.0.0",
49
+ "ink-chart": "^0.1.1",
50
+ "ink-confirm-input": "^2.0.0",
51
+ "ink-scroll-list": "^0.4.1",
52
+ "ink-scroll-view": "^0.3.5",
53
+ "ink-select-input": "^6.2.0",
54
+ "ink-spinner": "^5.0.0",
55
+ "ink-table": "^3.1.0",
56
+ "ink-text-input": "^6.0.0",
57
+ "inquirer": "^12.7.0",
58
+ "jiti": "^2.4.2",
59
+ "open": "^10.1.2",
60
+ "prettier": "^3.6.2",
61
+ "react": "^19.2.3",
62
+ "yocto-spinner": "^1.0.0",
63
+ "zod": "^4.0.0",
64
+ "conf": "^13.0.1"
65
+ },
66
+ "devDependencies": {
67
+ "@sindresorhus/tsconfig": "^3.0.1",
68
+ "@types/bun": "^1.2.21",
69
+ "@types/node": "^24.0.10",
70
+ "@types/react": "^19.0.0",
71
+ "@vdemedes/prettier-config": "^2.0.1",
72
+ "ava": "^5.2.0",
73
+ "cli-testing-library": "^3.0.1",
74
+ "eslint-config-xo-react": "^0.27.0",
75
+ "eslint-plugin-react": "^7.32.2",
76
+ "eslint-plugin-react-hooks": "^4.6.0",
77
+ "ink-testing-library": "^3.0.0",
78
+ "nodemon": "^3.1.11",
79
+ "react-devtools-core": "^6.1.2",
80
+ "ts-node": "^10.9.1",
81
+ "tsup": "^8.5.0",
82
+ "typescript": "^5.0.3",
83
+ "xo": "^0.53.1"
84
+ },
85
+ "ava": {
86
+ "extensions": {
87
+ "ts": "module",
88
+ "tsx": "module"
89
+ },
90
+ "nodeArguments": [
91
+ "--loader=ts-node/esm"
92
+ ]
93
+ },
94
+ "xo": {
95
+ "extends": "xo-react",
96
+ "prettier": true,
97
+ "rules": {
98
+ "react/prop-types": "off"
99
+ }
100
+ },
101
+ "prettier": "@vdemedes/prettier-config"
97
102
  }