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.
- package/README.md +120 -0
- package/dist/bin.js +23102 -0
- package/dist/index.js +2906 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -74
- package/src/actions/api/callApi.ts +280 -0
- package/src/actions/api/registerApiCommands.ts +121 -0
- package/src/actions/env/fetchOrgInfo.ts +32 -0
- package/src/actions/env/types/orgInfo.ts +18 -0
- package/src/actions/env.ts +94 -0
- package/src/actions/init/runInit.ts +401 -0
- package/src/actions/login/keyless.ts +135 -0
- package/src/actions/login.ts +144 -0
- package/src/actions/pull/appendPlanVersionFixture.ts +373 -0
- package/src/actions/pull/applyPreview.ts +553 -0
- package/src/actions/pull/applySettingsPreview.ts +114 -0
- package/src/actions/pull/changedFixtureKeys.ts +88 -0
- package/src/actions/pull/listSourceFiles.ts +29 -0
- package/src/actions/pull/locateFixture.ts +78 -0
- package/src/actions/pull/resolveCollectionTarget.ts +198 -0
- package/src/actions/pull/rewriteConfig.ts +57 -0
- package/src/actions/pull/scaffoldConfig.ts +118 -0
- package/src/actions/pull.ts +399 -0
- package/src/actions/push/backfillInternalIds.ts +394 -0
- package/src/actions/push/deprecatedFields.ts +55 -0
- package/src/actions/push.ts +294 -0
- package/src/actions/reset/runReset.ts +58 -0
- package/src/actions/sandbox/createSandbox.ts +83 -0
- package/src/actions/sandbox/deleteSandbox.ts +91 -0
- package/src/actions/sandbox/listSandboxes.ts +28 -0
- package/src/actions/sandbox/types/sandboxClient.ts +16 -0
- package/src/actions/sandbox/useSandbox.ts +157 -0
- package/src/actions/sandbox/withSandboxScopeHint.ts +27 -0
- package/src/actions/skills/skills.ts +246 -0
- package/src/auth/announceAuthorizationUrl.ts +26 -0
- package/src/auth/browser/openSystemBrowser.ts +7 -0
- package/src/auth/browser/tryOpenBrowser.ts +17 -0
- package/src/auth/browser/watchLauncher.ts +46 -0
- package/src/auth/buildAuthorizationUrl.ts +36 -0
- package/src/auth/callbackPages.ts +126 -0
- package/src/auth/createOrgApiKeys.ts +46 -0
- package/src/auth/keyless.ts +119 -0
- package/src/auth/oauthConfig.ts +63 -0
- package/src/auth/runOAuthFlow.ts +230 -0
- package/src/auth/types/browserOpener.ts +5 -0
- package/src/auth/types/impersonationTokens.ts +23 -0
- package/src/auth/types/oauthTokens.ts +13 -0
- package/src/auth/types/orgApiKeys.ts +6 -0
- package/src/bin.ts +9 -0
- package/src/cli.ts +648 -0
- package/src/config/configPackageName.ts +9 -0
- package/src/config/legacyConfig.ts +25 -0
- package/src/config/loadConfig.ts +231 -0
- package/src/env/assertSandboxTarget.ts +20 -0
- package/src/env/loadEnv.ts +184 -0
- package/src/env/resolveTarget.ts +134 -0
- package/src/env/sandboxKeyName.ts +18 -0
- package/src/generated/apiRoutes.ts +3787 -0
- package/src/generated/client.ts +51564 -0
- package/src/generated/emit.ts +1163 -0
- package/src/generated/emitRuntime.ts +522 -0
- package/src/generated/features.ts +146 -0
- package/src/generated/labels.ts +29 -0
- package/src/generated/licenses.ts +287 -0
- package/src/generated/lintRules.ts +2207 -0
- package/src/generated/lintRuntime.ts +865 -0
- package/src/generated/plans.ts +1628 -0
- package/src/generated/referralPrograms.ts +22 -0
- package/src/generated/rewards.ts +58 -0
- package/src/generated/settings.ts +21 -0
- package/src/generated/skills.ts +305 -0
- package/src/generated/variants.ts +934 -0
- package/src/generated/wire.ts +334 -0
- package/src/http/autumnFetch.ts +30 -0
- package/src/index.ts +20 -0
- package/src/project/chooseConfigDir.ts +41 -0
- package/src/project/resolveProject.ts +115 -0
- package/src/project/rootMarker.ts +40 -0
- package/src/prompt/prompt.ts +186 -0
- package/src/prompt/select.ts +162 -0
- package/src/render/renderEnv.ts +77 -0
- package/src/render/renderPreview.ts +945 -0
- package/src/render/renderSandboxes.ts +92 -0
- package/src/render/stripTerminalControls.ts +19 -0
- package/src/repo/findRepoRoot.ts +79 -0
- package/src/surgery/appendPropertyEdit.ts +67 -0
- package/src/surgery/appendToArray.ts +87 -0
- package/src/surgery/appendToBinding.ts +19 -0
- package/src/surgery/appendToCollection.ts +40 -0
- package/src/surgery/appendToFixtureArray.ts +71 -0
- package/src/surgery/arrayBinding.ts +30 -0
- package/src/surgery/deleteFixtureLiteral.ts +81 -0
- package/src/surgery/deleteReference.ts +48 -0
- package/src/surgery/ensureBuilderImport.ts +65 -0
- package/src/surgery/findFixture.ts +238 -0
- package/src/surgery/fixtureEdit.ts +156 -0
- package/src/surgery/fixtureLocation.ts +32 -0
- package/src/surgery/insertCollection.ts +86 -0
- package/src/surgery/insertFirstProperty.ts +73 -0
- package/src/surgery/patchFixtureProperty.ts +152 -0
- package/src/surgery/patchSingletonProperty.ts +221 -0
- package/src/surgery/replaceFixture.ts +28 -0
- package/src/surgery/setFixtureProperty.ts +55 -0
- package/src/surgery/staticFixtureRule.ts +48 -0
- package/src/version.ts +5 -0
- package/dist/cli.js +0 -146296
- package/dist/compose/index.js +0 -122
- package/dist/src/compose/builders/builderFunctions.d.ts +0 -84
- package/dist/src/compose/builders/rewardFunctions.d.ts +0 -5
- package/dist/src/compose/builders/variantFunctions.d.ts +0 -2
- package/dist/src/compose/index.d.ts +0 -19
- package/dist/src/compose/models/featureModels.d.ts +0 -262
- package/dist/src/compose/models/index.d.ts +0 -3
- package/dist/src/compose/models/planModels.d.ts +0 -562
- package/dist/src/compose/models/rewardModels.d.ts +0 -52
- package/dist/src/compose/models/variantModels.d.ts +0 -34
- package/readme.md +0 -186
|
@@ -0,0 +1,287 @@
|
|
|
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 License = {
|
|
5
|
+
licensePlanId: string;
|
|
6
|
+
versionSlug?: string;
|
|
7
|
+
included?: number;
|
|
8
|
+
prepaidOnly?: boolean;
|
|
9
|
+
customize?: {
|
|
10
|
+
price?: {
|
|
11
|
+
/** Base price amount for the plan, in major currency units (e.g. dollars). */
|
|
12
|
+
amount: number;
|
|
13
|
+
/** Billing interval (e.g. 'month', 'year'). */
|
|
14
|
+
interval:
|
|
15
|
+
| "one_off"
|
|
16
|
+
| "week"
|
|
17
|
+
| "month"
|
|
18
|
+
| "quarter"
|
|
19
|
+
| "semi_annual"
|
|
20
|
+
| "year";
|
|
21
|
+
/** Number of intervals per billing cycle. Defaults to 1. */
|
|
22
|
+
intervalCount?: number;
|
|
23
|
+
/** Base price amounts in additional currencies. The base 'amount' is in the org's default currency. */
|
|
24
|
+
additionalCurrencies?: Array<{
|
|
25
|
+
/** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
|
|
26
|
+
currency: string;
|
|
27
|
+
/** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
|
|
28
|
+
amount: number;
|
|
29
|
+
}>;
|
|
30
|
+
} | null;
|
|
31
|
+
addItems?: Array<{
|
|
32
|
+
/** Bills this many feature units when outstanding overage reaches it. */
|
|
33
|
+
thresholdBilling?: {
|
|
34
|
+
threshold: number;
|
|
35
|
+
} | null;
|
|
36
|
+
/** The ID of the feature to configure. */
|
|
37
|
+
featureId: string;
|
|
38
|
+
/** Number of free units included. Balance resets to this each interval for consumable features. */
|
|
39
|
+
included?: number;
|
|
40
|
+
/** If true, customer has unlimited access to this feature. */
|
|
41
|
+
unlimited?: boolean;
|
|
42
|
+
/** Whether entity-level grants contribute to a shared customer balance. Defaults to false. */
|
|
43
|
+
pooled?: boolean;
|
|
44
|
+
/** Reset configuration for consumable features. Omit for non-consumable features like seats. */
|
|
45
|
+
reset?: {
|
|
46
|
+
/** Interval at which balance resets (e.g. 'month', 'year'). For consumable features only. */
|
|
47
|
+
interval:
|
|
48
|
+
| "one_off"
|
|
49
|
+
| "minute"
|
|
50
|
+
| "hour"
|
|
51
|
+
| "day"
|
|
52
|
+
| "week"
|
|
53
|
+
| "month"
|
|
54
|
+
| "quarter"
|
|
55
|
+
| "semi_annual"
|
|
56
|
+
| "year";
|
|
57
|
+
/** Number of intervals between resets. Defaults to 1. */
|
|
58
|
+
intervalCount?: number;
|
|
59
|
+
};
|
|
60
|
+
/** Pricing for usage beyond included units. Omit for free features. */
|
|
61
|
+
price?: {
|
|
62
|
+
/** Price per billing_units after included usage. Either 'amount' or 'tiers' is required. */
|
|
63
|
+
amount?: number;
|
|
64
|
+
/** Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'. */
|
|
65
|
+
additionalCurrencies?: Array<{
|
|
66
|
+
/** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
|
|
67
|
+
currency: string;
|
|
68
|
+
/** Price amount in this currency. Set explicitly per currency, not converted from the base amount. */
|
|
69
|
+
amount: number;
|
|
70
|
+
}>;
|
|
71
|
+
/** Tiered pricing. Either 'amount' or 'tiers' is required. */
|
|
72
|
+
tiers?: Array<{
|
|
73
|
+
to: number | "inf";
|
|
74
|
+
amount?: number;
|
|
75
|
+
flatAmount?: number;
|
|
76
|
+
/** Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies. */
|
|
77
|
+
additionalCurrencies?: Array<{
|
|
78
|
+
/** Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp'). */
|
|
79
|
+
currency: string;
|
|
80
|
+
/** Per-unit amount for this tier in this currency. */
|
|
81
|
+
amount?: number;
|
|
82
|
+
/** Flat amount for this tier in this currency, if the tier uses one. */
|
|
83
|
+
flatAmount?: number;
|
|
84
|
+
}>;
|
|
85
|
+
}>;
|
|
86
|
+
tierBehavior?: "graduated" | "volume";
|
|
87
|
+
/** Billing interval. For consumable features, should match reset.interval. */
|
|
88
|
+
interval:
|
|
89
|
+
| "one_off"
|
|
90
|
+
| "week"
|
|
91
|
+
| "month"
|
|
92
|
+
| "quarter"
|
|
93
|
+
| "semi_annual"
|
|
94
|
+
| "year";
|
|
95
|
+
/** Number of intervals per billing cycle. Defaults to 1. */
|
|
96
|
+
intervalCount?: number;
|
|
97
|
+
/** Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200). Defaults to 1. */
|
|
98
|
+
billingUnits?: number;
|
|
99
|
+
/** 'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go. */
|
|
100
|
+
billingMethod: "prepaid" | "usage_based";
|
|
101
|
+
allocatedBilling?: "arrear" | "prorated_legacy";
|
|
102
|
+
/** Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit. */
|
|
103
|
+
maxPurchase?: number | null;
|
|
104
|
+
};
|
|
105
|
+
/** Proration settings for prepaid features. Controls mid-cycle quantity change billing. */
|
|
106
|
+
proration?: {
|
|
107
|
+
/** Billing behavior when quantity increases mid-cycle. */
|
|
108
|
+
onIncrease:
|
|
109
|
+
| "bill_immediately"
|
|
110
|
+
| "prorate_immediately"
|
|
111
|
+
| "prorate_next_cycle"
|
|
112
|
+
| "bill_next_cycle";
|
|
113
|
+
/** Credit behavior when quantity decreases mid-cycle. */
|
|
114
|
+
onDecrease:
|
|
115
|
+
| "prorate"
|
|
116
|
+
| "prorate_immediately"
|
|
117
|
+
| "prorate_next_cycle"
|
|
118
|
+
| "none"
|
|
119
|
+
| "no_prorations";
|
|
120
|
+
};
|
|
121
|
+
/** Rollover config for unused units. If set, unused included units carry over. */
|
|
122
|
+
rollover?: {
|
|
123
|
+
/** Max rollover units. Omit for unlimited rollover. */
|
|
124
|
+
max?: number;
|
|
125
|
+
/** Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max. */
|
|
126
|
+
maxPercentage?: number;
|
|
127
|
+
/** When rolled over units expire. */
|
|
128
|
+
expiryDurationType: "month" | "forever";
|
|
129
|
+
/** Number of periods before expiry. */
|
|
130
|
+
expiryDurationLength?: number;
|
|
131
|
+
};
|
|
132
|
+
/** Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema). */
|
|
133
|
+
featureOverride?: {
|
|
134
|
+
/** For credit system features: replaces the feature's credit_schema entirely for customers on this plan. */
|
|
135
|
+
creditSchema?: Array<
|
|
136
|
+
| {
|
|
137
|
+
/** ID of the metered feature that draws from this credit system. */
|
|
138
|
+
meteredFeatureId: string;
|
|
139
|
+
/** Number of metered-feature units priced together. Defaults to one when omitted. */
|
|
140
|
+
billingUnits?: number;
|
|
141
|
+
/** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
|
|
142
|
+
dimensions?: Record<
|
|
143
|
+
string,
|
|
144
|
+
| {
|
|
145
|
+
/** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
|
|
146
|
+
match: Record<string, string | number | boolean>;
|
|
147
|
+
/** Breaks ties between dimensions that match the same number of keys. Higher wins. */
|
|
148
|
+
priority?: number;
|
|
149
|
+
tierBehavior: "graduated";
|
|
150
|
+
tiers: Array<{
|
|
151
|
+
/** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
|
|
152
|
+
to: number | "inf";
|
|
153
|
+
/** Credits consumed per billing-unit group within this tier. */
|
|
154
|
+
creditCost: number;
|
|
155
|
+
}>;
|
|
156
|
+
}
|
|
157
|
+
| {
|
|
158
|
+
/** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
|
|
159
|
+
match: Record<string, string | number | boolean>;
|
|
160
|
+
/** Breaks ties between dimensions that match the same number of keys. Higher wins. */
|
|
161
|
+
priority?: number;
|
|
162
|
+
/** Credits consumed per billing-unit group when this dimension matches. */
|
|
163
|
+
creditCost: number;
|
|
164
|
+
}
|
|
165
|
+
>;
|
|
166
|
+
/** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
|
|
167
|
+
multipliers?: Record<
|
|
168
|
+
string,
|
|
169
|
+
{
|
|
170
|
+
/** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
|
|
171
|
+
match: Record<string, string | number | boolean>;
|
|
172
|
+
/** Multiplies the matched rate. All matching multipliers stack. */
|
|
173
|
+
factor?: number;
|
|
174
|
+
/** Added to the rate after every factor is applied, in credits per billing-unit group. */
|
|
175
|
+
add?: number;
|
|
176
|
+
}
|
|
177
|
+
>;
|
|
178
|
+
tierBehavior: "graduated";
|
|
179
|
+
tiers: Array<{
|
|
180
|
+
/** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
|
|
181
|
+
to: number | "inf";
|
|
182
|
+
/** Credits consumed per billing-unit group within this tier. */
|
|
183
|
+
creditCost: number;
|
|
184
|
+
}>;
|
|
185
|
+
}
|
|
186
|
+
| {
|
|
187
|
+
/** ID of the metered feature that draws from this credit system. */
|
|
188
|
+
meteredFeatureId: string;
|
|
189
|
+
/** Number of metered-feature units priced together. Defaults to one when omitted. */
|
|
190
|
+
billingUnits?: number;
|
|
191
|
+
/** Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies. */
|
|
192
|
+
dimensions?: Record<
|
|
193
|
+
string,
|
|
194
|
+
| {
|
|
195
|
+
/** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
|
|
196
|
+
match: Record<string, string | number | boolean>;
|
|
197
|
+
/** Breaks ties between dimensions that match the same number of keys. Higher wins. */
|
|
198
|
+
priority?: number;
|
|
199
|
+
tierBehavior: "graduated";
|
|
200
|
+
tiers: Array<{
|
|
201
|
+
/** Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'. */
|
|
202
|
+
to: number | "inf";
|
|
203
|
+
/** Credits consumed per billing-unit group within this tier. */
|
|
204
|
+
creditCost: number;
|
|
205
|
+
}>;
|
|
206
|
+
}
|
|
207
|
+
| {
|
|
208
|
+
/** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
|
|
209
|
+
match: Record<string, string | number | boolean>;
|
|
210
|
+
/** Breaks ties between dimensions that match the same number of keys. Higher wins. */
|
|
211
|
+
priority?: number;
|
|
212
|
+
/** Credits consumed per billing-unit group when this dimension matches. */
|
|
213
|
+
creditCost: number;
|
|
214
|
+
}
|
|
215
|
+
>;
|
|
216
|
+
/** Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed. */
|
|
217
|
+
multipliers?: Record<
|
|
218
|
+
string,
|
|
219
|
+
{
|
|
220
|
+
/** Event properties this entry applies to. Every key must equal the tracked property, compared as strings. */
|
|
221
|
+
match: Record<string, string | number | boolean>;
|
|
222
|
+
/** Multiplies the matched rate. All matching multipliers stack. */
|
|
223
|
+
factor?: number;
|
|
224
|
+
/** Added to the rate after every factor is applied, in credits per billing-unit group. */
|
|
225
|
+
add?: number;
|
|
226
|
+
}
|
|
227
|
+
>;
|
|
228
|
+
/** Credits consumed per billing-unit group. */
|
|
229
|
+
creditCost: number;
|
|
230
|
+
}
|
|
231
|
+
>;
|
|
232
|
+
/** 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. */
|
|
233
|
+
markups?: {
|
|
234
|
+
/** Default percentage markup for customers on this plan. Use -100 to make usage free. */
|
|
235
|
+
defaultMarkup?: number;
|
|
236
|
+
/** Per-provider markup percentages for customers on this plan. */
|
|
237
|
+
providerMarkups?: Record<
|
|
238
|
+
string,
|
|
239
|
+
{
|
|
240
|
+
markup: number;
|
|
241
|
+
}
|
|
242
|
+
> | null;
|
|
243
|
+
/** Per-model markup overrides for customers on this plan. */
|
|
244
|
+
modelMarkups?: Record<
|
|
245
|
+
string,
|
|
246
|
+
{
|
|
247
|
+
markup?: number;
|
|
248
|
+
inputCost?: number;
|
|
249
|
+
outputCost?: number;
|
|
250
|
+
}
|
|
251
|
+
> | null;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
entityFeatureId?: string;
|
|
255
|
+
}>;
|
|
256
|
+
removeItems?: Array<{
|
|
257
|
+
/** Match items linked to this feature. */
|
|
258
|
+
featureId?: string;
|
|
259
|
+
/** Match items with this billing method (prepaid or usage_based). */
|
|
260
|
+
billingMethod?: "prepaid" | "usage_based";
|
|
261
|
+
/** 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. */
|
|
262
|
+
interval?:
|
|
263
|
+
| "one_off"
|
|
264
|
+
| "week"
|
|
265
|
+
| "month"
|
|
266
|
+
| "quarter"
|
|
267
|
+
| "semi_annual"
|
|
268
|
+
| "year"
|
|
269
|
+
| "one_off"
|
|
270
|
+
| "minute"
|
|
271
|
+
| "hour"
|
|
272
|
+
| "day"
|
|
273
|
+
| "week"
|
|
274
|
+
| "month"
|
|
275
|
+
| "quarter"
|
|
276
|
+
| "semi_annual"
|
|
277
|
+
| "year";
|
|
278
|
+
/** Match items with this interval_count. Disambiguates between items that share an interval but differ in count. */
|
|
279
|
+
intervalCount?: number;
|
|
280
|
+
/** Match items whose grant equals this included usage. Omitted is a wildcard. */
|
|
281
|
+
included?: number;
|
|
282
|
+
}>;
|
|
283
|
+
} | null;
|
|
284
|
+
metadata?: Record<string, unknown>;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export const license = (input: License): License => input;
|