atmn 1.1.22 → 1.1.23

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 (2) hide show
  1. package/dist/cli.js +89 -89
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -69057,6 +69057,91 @@ var init_basePrice = __esm(() => {
69057
69057
  });
69058
69058
  });
69059
69059
 
69060
+ // ../../shared/api/features/creditRateCard.ts
69061
+ var ApiCreditSchemaItemBaseSchema, ApiCreditTierSchema, ApiFlatCreditSchemaItemSchema, ApiGraduatedCreditSchemaItemSchema, ApiCreditSchemaItemSchema, ApiLegacyFlatCreditSchemaItemSchema, ApiCreditSchemaResponseItemSchema, isGraduatedCreditSchemaItem = (item) => ("tier_behavior" in item) && item.tier_behavior === "graduated";
69062
+ var init_creditRateCard = __esm(() => {
69063
+ init_v4();
69064
+ ApiCreditSchemaItemBaseSchema = exports_external.object({
69065
+ metered_feature_id: exports_external.string().nonempty().meta({
69066
+ description: "ID of the metered feature that draws from this credit system."
69067
+ }),
69068
+ billing_units: exports_external.number().positive().optional().meta({
69069
+ description: "Number of metered-feature units priced together. Defaults to one when omitted."
69070
+ })
69071
+ });
69072
+ ApiCreditTierSchema = exports_external.object({
69073
+ to: exports_external.union([exports_external.number().positive(), exports_external.enum(["inf"])]).meta({
69074
+ description: "Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'."
69075
+ }),
69076
+ credit_cost: exports_external.number().min(0).meta({
69077
+ description: "Credits consumed per billing-unit group within this tier."
69078
+ })
69079
+ });
69080
+ ApiFlatCreditSchemaItemSchema = ApiCreditSchemaItemBaseSchema.extend({
69081
+ credit_cost: exports_external.number().min(0).meta({
69082
+ description: "Credits consumed per billing-unit group."
69083
+ })
69084
+ }).strict();
69085
+ ApiGraduatedCreditSchemaItemSchema = ApiCreditSchemaItemBaseSchema.extend({
69086
+ tier_behavior: exports_external.literal("graduated"),
69087
+ tiers: exports_external.array(ApiCreditTierSchema).min(1)
69088
+ }).strict().superRefine((item, ctx) => {
69089
+ let previousBoundary = 0;
69090
+ for (const [index3, tier] of item.tiers.entries()) {
69091
+ const isLastTier = index3 === item.tiers.length - 1;
69092
+ if (tier.to === "inf") {
69093
+ if (!isLastTier) {
69094
+ ctx.addIssue({
69095
+ code: "custom",
69096
+ message: "Only the final tier may use an 'inf' boundary.",
69097
+ path: ["tiers", index3, "to"]
69098
+ });
69099
+ }
69100
+ continue;
69101
+ }
69102
+ if (tier.to <= previousBoundary) {
69103
+ ctx.addIssue({
69104
+ code: "custom",
69105
+ message: "Tier boundaries must be strictly increasing.",
69106
+ path: ["tiers", index3, "to"]
69107
+ });
69108
+ }
69109
+ previousBoundary = tier.to;
69110
+ if (isLastTier) {
69111
+ ctx.addIssue({
69112
+ code: "custom",
69113
+ message: "The final tier must use an 'inf' boundary.",
69114
+ path: ["tiers", index3, "to"]
69115
+ });
69116
+ }
69117
+ }
69118
+ });
69119
+ ApiCreditSchemaItemSchema = exports_external.union([
69120
+ ApiGraduatedCreditSchemaItemSchema,
69121
+ ApiFlatCreditSchemaItemSchema
69122
+ ]);
69123
+ ApiLegacyFlatCreditSchemaItemSchema = ApiFlatCreditSchemaItemSchema.extend({
69124
+ metered_feature_id: exports_external.literal("")
69125
+ }).strict();
69126
+ ApiCreditSchemaResponseItemSchema = exports_external.union([
69127
+ ApiGraduatedCreditSchemaItemSchema,
69128
+ ApiFlatCreditSchemaItemSchema,
69129
+ ApiLegacyFlatCreditSchemaItemSchema
69130
+ ]);
69131
+ });
69132
+
69133
+ // ../../shared/api/features/apiFeatureOverride.ts
69134
+ var ApiFeatureOverrideSchema;
69135
+ var init_apiFeatureOverride = __esm(() => {
69136
+ init_v4();
69137
+ init_creditRateCard();
69138
+ ApiFeatureOverrideSchema = exports_external.strictObject({
69139
+ credit_schema: exports_external.array(ApiCreditSchemaItemSchema).optional().meta({
69140
+ description: "For credit system features: replaces the feature's credit_schema entirely for customers on this plan."
69141
+ })
69142
+ });
69143
+ });
69144
+
69060
69145
  // ../../shared/api/products/components/billingMethod.ts
69061
69146
  var BillingMethod;
69062
69147
  var init_billingMethod = __esm(() => {
@@ -69158,91 +69243,6 @@ var init_usagePriceConfig = __esm(() => {
69158
69243
  });
69159
69244
  });
69160
69245
 
69161
- // ../../shared/api/features/creditRateCard.ts
69162
- var ApiCreditSchemaItemBaseSchema, ApiCreditTierSchema, ApiFlatCreditSchemaItemSchema, ApiGraduatedCreditSchemaItemSchema, ApiCreditSchemaItemSchema, ApiLegacyFlatCreditSchemaItemSchema, ApiCreditSchemaResponseItemSchema, isGraduatedCreditSchemaItem = (item) => ("tier_behavior" in item) && item.tier_behavior === "graduated";
69163
- var init_creditRateCard = __esm(() => {
69164
- init_v4();
69165
- ApiCreditSchemaItemBaseSchema = exports_external.object({
69166
- metered_feature_id: exports_external.string().nonempty().meta({
69167
- description: "ID of the metered feature that draws from this credit system."
69168
- }),
69169
- billing_units: exports_external.number().positive().optional().meta({
69170
- description: "Number of metered-feature units priced together. Defaults to one when omitted."
69171
- })
69172
- });
69173
- ApiCreditTierSchema = exports_external.object({
69174
- to: exports_external.union([exports_external.number().positive(), exports_external.enum(["inf"])]).meta({
69175
- description: "Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'."
69176
- }),
69177
- credit_cost: exports_external.number().min(0).meta({
69178
- description: "Credits consumed per billing-unit group within this tier."
69179
- })
69180
- });
69181
- ApiFlatCreditSchemaItemSchema = ApiCreditSchemaItemBaseSchema.extend({
69182
- credit_cost: exports_external.number().min(0).meta({
69183
- description: "Credits consumed per billing-unit group."
69184
- })
69185
- }).strict();
69186
- ApiGraduatedCreditSchemaItemSchema = ApiCreditSchemaItemBaseSchema.extend({
69187
- tier_behavior: exports_external.literal("graduated"),
69188
- tiers: exports_external.array(ApiCreditTierSchema).min(1)
69189
- }).strict().superRefine((item, ctx) => {
69190
- let previousBoundary = 0;
69191
- for (const [index3, tier] of item.tiers.entries()) {
69192
- const isLastTier = index3 === item.tiers.length - 1;
69193
- if (tier.to === "inf") {
69194
- if (!isLastTier) {
69195
- ctx.addIssue({
69196
- code: "custom",
69197
- message: "Only the final tier may use an 'inf' boundary.",
69198
- path: ["tiers", index3, "to"]
69199
- });
69200
- }
69201
- continue;
69202
- }
69203
- if (tier.to <= previousBoundary) {
69204
- ctx.addIssue({
69205
- code: "custom",
69206
- message: "Tier boundaries must be strictly increasing.",
69207
- path: ["tiers", index3, "to"]
69208
- });
69209
- }
69210
- previousBoundary = tier.to;
69211
- if (isLastTier) {
69212
- ctx.addIssue({
69213
- code: "custom",
69214
- message: "The final tier must use an 'inf' boundary.",
69215
- path: ["tiers", index3, "to"]
69216
- });
69217
- }
69218
- }
69219
- });
69220
- ApiCreditSchemaItemSchema = exports_external.union([
69221
- ApiGraduatedCreditSchemaItemSchema,
69222
- ApiFlatCreditSchemaItemSchema
69223
- ]);
69224
- ApiLegacyFlatCreditSchemaItemSchema = ApiFlatCreditSchemaItemSchema.extend({
69225
- metered_feature_id: exports_external.literal("")
69226
- }).strict();
69227
- ApiCreditSchemaResponseItemSchema = exports_external.union([
69228
- ApiGraduatedCreditSchemaItemSchema,
69229
- ApiFlatCreditSchemaItemSchema,
69230
- ApiLegacyFlatCreditSchemaItemSchema
69231
- ]);
69232
- });
69233
-
69234
- // ../../shared/api/features/apiFeatureOverride.ts
69235
- var ApiFeatureOverrideSchema;
69236
- var init_apiFeatureOverride = __esm(() => {
69237
- init_v4();
69238
- init_creditRateCard();
69239
- ApiFeatureOverrideSchema = exports_external.strictObject({
69240
- credit_schema: exports_external.array(ApiCreditSchemaItemSchema).optional().meta({
69241
- description: "For credit system features: replaces the feature's credit_schema entirely for customers on this plan."
69242
- })
69243
- });
69244
- });
69245
-
69246
69246
  // ../../shared/api/products/items/crud/createPlanItemParamsV1.ts
69247
69247
  var IncludedUsageParamsSchema, PlanItemPriceParamsSchema, PLAN_ITEM_PRICE_DESCRIPTION = "Pricing for usage beyond included units. Omit for free features.", PlanItemParamsObjectSchema, planItemParamsIssues = (value) => {
69248
69248
  const issues = [];
@@ -69320,6 +69320,7 @@ var IncludedUsageParamsSchema, PlanItemPriceParamsSchema, PLAN_ITEM_PRICE_DESCRI
69320
69320
  return issues;
69321
69321
  }, CreatePlanItemParamsV1Schema;
69322
69322
  var init_createPlanItemParamsV1 = __esm(() => {
69323
+ init_apiFeatureOverride();
69323
69324
  init_additionalCurrencies();
69324
69325
  init_billingMethod();
69325
69326
  init_rolloverExpiryDurationType();
@@ -69328,15 +69329,14 @@ var init_createPlanItemParamsV1 = __esm(() => {
69328
69329
  init_usagePriceConfig();
69329
69330
  init_productItemEnums();
69330
69331
  init_v4();
69331
- init_apiFeatureOverride();
69332
69332
  IncludedUsageParamsSchema = exports_external.number().max(10000000000000, {
69333
69333
  error: "Included usage cannot exceed 10 trillion; use unlimited usage instead"
69334
69334
  });
69335
69335
  PlanItemPriceParamsSchema = exports_external.object({
69336
- stripe_price_id: exports_external.string().nullish().transform((value) => value ?? undefined).optional().meta({
69336
+ stripe_price_id: exports_external.string().nullish().transform((value) => value ?? undefined).meta({
69337
69337
  description: "Stripe price id this feature price is billed under. Set by sync flows to preserve an existing Stripe price.",
69338
69338
  internal: true
69339
- }),
69339
+ }).optional(),
69340
69340
  amount: exports_external.number().optional().meta({
69341
69341
  description: "Price per billing_units after included usage. Either 'amount' or 'tiers' is required."
69342
69342
  }),
@@ -98492,7 +98492,7 @@ var init_pull = __esm(() => {
98492
98492
  });
98493
98493
 
98494
98494
  // src/lib/version.ts
98495
- var APP_VERSION = "1.1.22";
98495
+ var APP_VERSION = "1.1.23";
98496
98496
 
98497
98497
  // ../../node_modules/.bun/@tanstack+query-core@5.101.1/node_modules/@tanstack/query-core/build/modern/subscribable.js
98498
98498
  var Subscribable = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atmn",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "atmn": "dist/cli.js"