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,22 @@
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 ReferralProgram = {
5
+ id: string;
6
+ rewardId: string;
7
+ /** When the reward is granted: on redemption, or when the redeemer checks out. */
8
+ redeemOn: "customer_creation" | "checkout";
9
+ /** Who receives the reward: the referrer only, or both parties. */
10
+ receivedBy: "referrer" | "all";
11
+ /** A positive redemption limit, or null for unlimited redemptions. */
12
+ maxRedemptions?: number | null;
13
+ /** Required when redeem_on is checkout. Plan IDs must be unique. */
14
+ planIds?: Array<string> | null;
15
+ /** Whether checkouts that start a trial should skip granting the reward. */
16
+ excludeTrial?: boolean | null;
17
+ /** Address an existing referral program by its stable id. Omit when creating — the server generates one. */
18
+ internalId?: string;
19
+ };
20
+
21
+ export const referralProgram = (input: ReferralProgram): ReferralProgram =>
22
+ input;
@@ -0,0 +1,58 @@
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 Coupon = {
5
+ id: string;
6
+ name: string;
7
+ /** Use a positive integer length for months, and null for one_off or forever. */
8
+ duration: {
9
+ type: "one_off" | "months" | "forever";
10
+ length: number | null;
11
+ };
12
+ /** Plan IDs must be unique. */
13
+ planIds: Array<string> | null;
14
+ /** Promo code values must be unique. */
15
+ promoCodes: Array<{
16
+ code: string;
17
+ globalMaxRedemption?: number | null;
18
+ firstTimeTransaction?: boolean | null;
19
+ }>;
20
+ /** Address an existing reward by its stable id. Omit when creating — the server generates one. */
21
+ internalId?: string;
22
+ type: "percentage_discount" | "fixed_discount";
23
+ /** Percentage discounts must be at most 100; fixed discounts must be positive. */
24
+ value: number;
25
+ };
26
+
27
+ export type FeatureGrant = {
28
+ id: string;
29
+ name: string;
30
+ /** Feature IDs must be unique. */
31
+ grants: Array<{
32
+ featureId: string;
33
+ /** A non-negative amount to grant, or null for boolean features. */
34
+ included: number | null;
35
+ expiry: {
36
+ /** The unit of time the grant lasts. */
37
+ type: "day" | "week" | "month" | "year";
38
+ /** The positive integer count of periods before the grant expires. */
39
+ length: number;
40
+ } | null;
41
+ }>;
42
+ /** Promo code values must be unique. */
43
+ promoCodes: Array<{
44
+ code: string;
45
+ /** A positive redemption limit, or null for unlimited uses. */
46
+ maxUses: number | null;
47
+ }>;
48
+ /** Address an existing reward by its stable id. Omit when creating — the server generates one. */
49
+ internalId?: string;
50
+ };
51
+
52
+ export type Reward = { coupon: Coupon } | { featureGrant: FeatureGrant };
53
+
54
+ export const coupon = (input: Coupon): Reward => ({ coupon: input });
55
+
56
+ export const featureGrant = (input: FeatureGrant): Reward => ({
57
+ featureGrant: input,
58
+ });
@@ -0,0 +1,21 @@
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 Settings = {
5
+ /** Cancel on past due. Defaults to false. */
6
+ cancelOnPastDue?: boolean;
7
+ /** Reverse deduction order. Defaults to false. */
8
+ reverseDeductionOrder?: boolean;
9
+ /** Block access while overdue. Defaults to false. */
10
+ blockOverdueEntitlements?: boolean;
11
+ /** Invoice memos. Defaults to false. */
12
+ invoiceMemos?: boolean;
13
+ /** Disable overage billing. Defaults to false. */
14
+ disableOverageBilling?: boolean;
15
+ /** Pay down overages. Defaults to false. */
16
+ paydownOverages?: boolean;
17
+ /** Automatic tax. Defaults to false. */
18
+ automaticTax?: boolean;
19
+ /** Multi-currency. Defaults to false. */
20
+ multiCurrency?: boolean;
21
+ };