atmn 1.1.13 → 1.1.15
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 +389 -52
- package/dist/src/compose/models/planModels.d.ts +1 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -48187,7 +48187,7 @@ var init_pull = __esm(() => {
|
|
|
48187
48187
|
});
|
|
48188
48188
|
|
|
48189
48189
|
// src/lib/version.ts
|
|
48190
|
-
var APP_VERSION = "1.1.
|
|
48190
|
+
var APP_VERSION = "1.1.15";
|
|
48191
48191
|
|
|
48192
48192
|
// ../../node_modules/@tanstack/query-core/build/modern/subscribable.js
|
|
48193
48193
|
var Subscribable = class {
|
|
@@ -103885,6 +103885,7 @@ var init_usageWindowTable = __esm(() => {
|
|
|
103885
103885
|
internal_entity_id: exports_external.string().nullable(),
|
|
103886
103886
|
feature_id: exports_external.string(),
|
|
103887
103887
|
internal_feature_id: exports_external.string(),
|
|
103888
|
+
filter_key: exports_external.string().nullable().default(null),
|
|
103888
103889
|
anchor_customer_entitlement_id: exports_external.string().nullable(),
|
|
103889
103890
|
window_start_at: exports_external.number(),
|
|
103890
103891
|
window_end_at: exports_external.number(),
|
|
@@ -103897,6 +103898,7 @@ var init_usageWindowTable = __esm(() => {
|
|
|
103897
103898
|
internal_entity_id: text("internal_entity_id"),
|
|
103898
103899
|
feature_id: text("feature_id").notNull(),
|
|
103899
103900
|
internal_feature_id: text("internal_feature_id").notNull(),
|
|
103901
|
+
filter_key: text("filter_key"),
|
|
103900
103902
|
anchor_customer_entitlement_id: text("anchor_customer_entitlement_id"),
|
|
103901
103903
|
window_start_at: numeric({ mode: "number" }).notNull(),
|
|
103902
103904
|
window_end_at: numeric({ mode: "number" }).notNull(),
|
|
@@ -103925,7 +103927,7 @@ var init_usageWindowTable = __esm(() => {
|
|
|
103925
103927
|
}).onUpdate("cascade").onDelete("set null"),
|
|
103926
103928
|
index("idx_usage_windows_internal_customer_id").on(table3.internal_customer_id),
|
|
103927
103929
|
index("idx_uw_internal_feature_id").on(table3.internal_feature_id).concurrently(),
|
|
103928
|
-
uniqueIndex("idx_usage_windows_customer_feature_scope").on(table3.internal_customer_id, table3.internal_feature_id, sql`COALESCE(${table3.internal_entity_id}, '')`)
|
|
103930
|
+
uniqueIndex("idx_usage_windows_customer_feature_scope").on(table3.internal_customer_id, table3.internal_feature_id, sql`COALESCE(${table3.internal_entity_id}, '')`, sql`COALESCE(${table3.filter_key}, '')`).concurrently()
|
|
103929
103931
|
]).enableRLS();
|
|
103930
103932
|
});
|
|
103931
103933
|
|
|
@@ -104502,10 +104504,12 @@ var init_harnessSessionsTable = __esm(() => {
|
|
|
104502
104504
|
thread_key: text("thread_key").notNull(),
|
|
104503
104505
|
session_id: text("session_id").notNull(),
|
|
104504
104506
|
resume_state: jsonb("resume_state"),
|
|
104507
|
+
title: text("title"),
|
|
104505
104508
|
braintrust_parent: text("braintrust_parent"),
|
|
104506
104509
|
updated_at: numeric({ mode: "number" }).notNull().default(sqlNow)
|
|
104507
104510
|
}, (table3) => [
|
|
104508
|
-
primaryKey({ columns: [table3.org_id, table3.env, table3.thread_key] })
|
|
104511
|
+
primaryKey({ columns: [table3.org_id, table3.env, table3.thread_key] }),
|
|
104512
|
+
index("idx_harness_sessions_session_id").on(table3.session_id).concurrently()
|
|
104509
104513
|
]);
|
|
104510
104514
|
});
|
|
104511
104515
|
|
|
@@ -104631,6 +104635,7 @@ var init_migrationItemRunTable = __esm(() => {
|
|
|
104631
104635
|
updated_at: numeric({ mode: "number" })
|
|
104632
104636
|
}, (table3) => [
|
|
104633
104637
|
uniqueIndex("migration_item_runs_live_unique").on(table3.migration_internal_id, table3.item_kind, table3.item_id).where(sql`${table3.dry_run} = false`),
|
|
104638
|
+
index("migration_item_runs_live_c_idx").on(table3.migration_internal_id, table3.item_kind, sql`${table3.item_id} COLLATE "C"`).where(sql`${table3.dry_run} = false`).concurrently(),
|
|
104634
104639
|
uniqueIndex("migration_item_runs_dry_run_unique").on(table3.migration_internal_id, table3.migration_run_id, table3.item_kind, table3.item_id).where(sql`${table3.dry_run} = true`),
|
|
104635
104640
|
index("migration_item_runs_customer_recent_idx").on(table3.item_id, sql`${table3.updated_at} DESC`).where(sql`${table3.item_kind} = 'customer'`)
|
|
104636
104641
|
]);
|
|
@@ -105477,9 +105482,12 @@ var init_spendLimit = __esm(() => {
|
|
|
105477
105482
|
}),
|
|
105478
105483
|
overage_limit: exports_external.number().min(0).optional().meta({
|
|
105479
105484
|
description: "Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage."
|
|
105485
|
+
}),
|
|
105486
|
+
skip_overage_billing: exports_external.boolean().optional().meta({
|
|
105487
|
+
description: "When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally."
|
|
105480
105488
|
})
|
|
105481
|
-
}).refine((data) => data.overage_limit === undefined || data.feature_id !== undefined, {
|
|
105482
|
-
message: "feature_id is required when overage_limit is provided",
|
|
105489
|
+
}).refine((data) => data.overage_limit === undefined && data.skip_overage_billing === undefined || data.feature_id !== undefined, {
|
|
105490
|
+
message: "feature_id is required when overage_limit or skip_overage_billing is provided",
|
|
105483
105491
|
path: ["feature_id"]
|
|
105484
105492
|
});
|
|
105485
105493
|
});
|
|
@@ -105540,7 +105548,11 @@ var init_resetInterval = __esm(() => {
|
|
|
105540
105548
|
});
|
|
105541
105549
|
|
|
105542
105550
|
// ../../shared/models/cusModels/billingControls/usageLimit.ts
|
|
105543
|
-
var USAGE_LIMIT_INTERVALS, DbUsageLimitSchema,
|
|
105551
|
+
var USAGE_LIMIT_INTERVALS, USAGE_LIMIT_FILTER_MAX_KEYS = 4, USAGE_LIMIT_FILTER_MAX_KEY_LENGTH = 64, USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH = 128, UsageLimitFilterValueSchema, UsageLimitFilterSchema, DbUsageLimitSchema, usageLimitFilterKey = (filter2) => {
|
|
105552
|
+
if (!filter2?.properties)
|
|
105553
|
+
return "";
|
|
105554
|
+
return Object.entries(filter2.properties).map(([key, value]) => [key, String(value)]).sort(([left], [right]) => left.localeCompare(right)).map(([key, value]) => `${key}=${value}`).join("&");
|
|
105555
|
+
}, USAGE_LIMIT_INTERVAL_DAYS;
|
|
105544
105556
|
var init_usageLimit = __esm(() => {
|
|
105545
105557
|
init_v4();
|
|
105546
105558
|
init_resetInterval();
|
|
@@ -105550,6 +105562,25 @@ var init_usageLimit = __esm(() => {
|
|
|
105550
105562
|
"month" /* Month */,
|
|
105551
105563
|
"year" /* Year */
|
|
105552
105564
|
];
|
|
105565
|
+
UsageLimitFilterValueSchema = exports_external.union([
|
|
105566
|
+
exports_external.string().min(1).max(USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH),
|
|
105567
|
+
exports_external.number(),
|
|
105568
|
+
exports_external.boolean()
|
|
105569
|
+
]).transform(String);
|
|
105570
|
+
UsageLimitFilterSchema = exports_external.object({
|
|
105571
|
+
properties: exports_external.record(exports_external.string().min(1).max(USAGE_LIMIT_FILTER_MAX_KEY_LENGTH), UsageLimitFilterValueSchema).meta({
|
|
105572
|
+
description: "Event property equality conditions. A usage event counts toward this cap only when every listed property matches (AND)."
|
|
105573
|
+
}).check((ctx) => {
|
|
105574
|
+
const keyCount = Object.keys(ctx.value).length;
|
|
105575
|
+
if (keyCount < 1 || keyCount > USAGE_LIMIT_FILTER_MAX_KEYS) {
|
|
105576
|
+
ctx.issues.push({
|
|
105577
|
+
code: "custom",
|
|
105578
|
+
message: `filter.properties must have between 1 and ${USAGE_LIMIT_FILTER_MAX_KEYS} keys`,
|
|
105579
|
+
input: ctx.value
|
|
105580
|
+
});
|
|
105581
|
+
}
|
|
105582
|
+
})
|
|
105583
|
+
});
|
|
105553
105584
|
DbUsageLimitSchema = exports_external.object({
|
|
105554
105585
|
feature_id: exports_external.string().meta({
|
|
105555
105586
|
description: "The feature this usage limit applies to."
|
|
@@ -105562,6 +105593,9 @@ var init_usageLimit = __esm(() => {
|
|
|
105562
105593
|
}),
|
|
105563
105594
|
interval: exports_external.enum(USAGE_LIMIT_INTERVALS).meta({
|
|
105564
105595
|
description: "Interval for the cap, aligned to the customer's billing cycle."
|
|
105596
|
+
}),
|
|
105597
|
+
filter: UsageLimitFilterSchema.optional().meta({
|
|
105598
|
+
description: "When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature."
|
|
105565
105599
|
})
|
|
105566
105600
|
});
|
|
105567
105601
|
USAGE_LIMIT_INTERVAL_DAYS = {
|
|
@@ -105619,6 +105653,7 @@ var init_customerBillingControls = __esm(() => {
|
|
|
105619
105653
|
init_spendLimit();
|
|
105620
105654
|
init_usageAlert();
|
|
105621
105655
|
init_usageLimit();
|
|
105656
|
+
init_usageLimit();
|
|
105622
105657
|
AutoTopupPurchaseLimitSchema = exports_external.object({
|
|
105623
105658
|
interval: PurchaseLimitIntervalEnum.meta({
|
|
105624
105659
|
description: "The time interval for the purchase limit window."
|
|
@@ -105668,7 +105703,7 @@ var init_customerBillingControls = __esm(() => {
|
|
|
105668
105703
|
})
|
|
105669
105704
|
});
|
|
105670
105705
|
AutoTopupResponseSchema = AutoTopupSchema.extend({
|
|
105671
|
-
purchase_limit: exports_external.union([
|
|
105706
|
+
purchase_limit: exports_external.union([ExpandedPurchaseLimitSchema, AutoTopupPurchaseLimitSchema]).optional().meta({
|
|
105672
105707
|
description: "Optional rate limit to cap how often auto top-ups occur. Expand billing_controls.auto_topups.purchase_limit for a count of top ups and the next_reset_at."
|
|
105673
105708
|
})
|
|
105674
105709
|
});
|
|
@@ -105714,18 +105749,19 @@ var init_customerBillingControls = __esm(() => {
|
|
|
105714
105749
|
}
|
|
105715
105750
|
spendLimitFeatureIds.add(spendLimit.feature_id);
|
|
105716
105751
|
}
|
|
105717
|
-
const
|
|
105752
|
+
const usageLimitIdentities = new Set;
|
|
105718
105753
|
for (const [index3, usageLimit] of (billingControls.usage_limits ?? []).entries()) {
|
|
105719
|
-
|
|
105754
|
+
const identity4 = `${usageLimit.feature_id}|${usageLimitFilterKey(usageLimit.filter)}`;
|
|
105755
|
+
if (usageLimitIdentities.has(identity4)) {
|
|
105720
105756
|
ctx.issues.push({
|
|
105721
105757
|
code: "custom",
|
|
105722
|
-
message: "Only one usage limit entry is allowed per feature_id",
|
|
105758
|
+
message: "Only one usage limit entry is allowed per feature_id and filter",
|
|
105723
105759
|
input: usageLimit.feature_id,
|
|
105724
105760
|
path: ["usage_limits", index3, "feature_id"]
|
|
105725
105761
|
});
|
|
105726
105762
|
return;
|
|
105727
105763
|
}
|
|
105728
|
-
|
|
105764
|
+
usageLimitIdentities.add(identity4);
|
|
105729
105765
|
}
|
|
105730
105766
|
const overageAllowedFeatureIds = new Set;
|
|
105731
105767
|
for (const [index3, overageAllowed] of (billingControls.overage_allowed ?? []).entries()) {
|
|
@@ -106893,8 +106929,13 @@ var init_billingBehavior = __esm(() => {
|
|
|
106893
106929
|
var PaymentFailureCodeEnum, BillingResponseRequiredActionSchema, BillingResponseSchema;
|
|
106894
106930
|
var init_billingResponse = __esm(() => {
|
|
106895
106931
|
init_v4();
|
|
106896
|
-
PaymentFailureCodeEnum = exports_external.enum([
|
|
106897
|
-
|
|
106932
|
+
PaymentFailureCodeEnum = exports_external.enum([
|
|
106933
|
+
"3ds_required",
|
|
106934
|
+
"payment_method_required",
|
|
106935
|
+
"payment_failed",
|
|
106936
|
+
"payment_processing"
|
|
106937
|
+
]).meta({
|
|
106938
|
+
description: "The type of payment action. '3ds_required' means 3D Secure authentication is needed, 'payment_method_required' means the customer needs to add a payment method, 'payment_failed' means the payment was declined, 'payment_processing' means payment is still settling."
|
|
106898
106939
|
});
|
|
106899
106940
|
BillingResponseRequiredActionSchema = exports_external.object({
|
|
106900
106941
|
code: PaymentFailureCodeEnum.meta({
|
|
@@ -107297,11 +107338,53 @@ var init_previewUpdateSubscriptionResponse = __esm(() => {
|
|
|
107297
107338
|
});
|
|
107298
107339
|
});
|
|
107299
107340
|
|
|
107341
|
+
// ../../shared/api/billingControls/billingControlSource.ts
|
|
107342
|
+
var BillingControlSourceSchema;
|
|
107343
|
+
var init_billingControlSource = __esm(() => {
|
|
107344
|
+
init_v4();
|
|
107345
|
+
BillingControlSourceSchema = exports_external.enum(["customer", "plan"]).meta({
|
|
107346
|
+
description: "Response-only: whether the entry is a customer-level override or inherited from an attached plan's defaults."
|
|
107347
|
+
});
|
|
107348
|
+
});
|
|
107349
|
+
|
|
107350
|
+
// ../../shared/api/billingControls/autoTopup.ts
|
|
107351
|
+
var ApiAutoTopupSchema;
|
|
107352
|
+
var init_autoTopup = __esm(() => {
|
|
107353
|
+
init_customerBillingControls();
|
|
107354
|
+
init_billingControlSource();
|
|
107355
|
+
ApiAutoTopupSchema = AutoTopupResponseSchema.extend({
|
|
107356
|
+
source: BillingControlSourceSchema.optional()
|
|
107357
|
+
});
|
|
107358
|
+
});
|
|
107359
|
+
|
|
107360
|
+
// ../../shared/api/billingControls/overageAllowed.ts
|
|
107361
|
+
var ApiOverageAllowedSchema;
|
|
107362
|
+
var init_overageAllowed2 = __esm(() => {
|
|
107363
|
+
init_overageAllowed();
|
|
107364
|
+
init_billingControlSource();
|
|
107365
|
+
ApiOverageAllowedSchema = DbOverageAllowedSchema.extend({
|
|
107366
|
+
source: BillingControlSourceSchema.optional()
|
|
107367
|
+
});
|
|
107368
|
+
});
|
|
107369
|
+
|
|
107300
107370
|
// ../../shared/api/billingControls/spendLimit.ts
|
|
107301
107371
|
var ApiSpendLimitSchema;
|
|
107302
107372
|
var init_spendLimit2 = __esm(() => {
|
|
107303
107373
|
init_spendLimit();
|
|
107304
|
-
|
|
107374
|
+
init_billingControlSource();
|
|
107375
|
+
ApiSpendLimitSchema = DbSpendLimitSchema.extend({
|
|
107376
|
+
source: BillingControlSourceSchema.optional()
|
|
107377
|
+
});
|
|
107378
|
+
});
|
|
107379
|
+
|
|
107380
|
+
// ../../shared/api/billingControls/usageAlert.ts
|
|
107381
|
+
var ApiUsageAlertSchema;
|
|
107382
|
+
var init_usageAlert2 = __esm(() => {
|
|
107383
|
+
init_usageAlert();
|
|
107384
|
+
init_billingControlSource();
|
|
107385
|
+
ApiUsageAlertSchema = DbUsageAlertSchema.extend({
|
|
107386
|
+
source: BillingControlSourceSchema.optional()
|
|
107387
|
+
});
|
|
107305
107388
|
});
|
|
107306
107389
|
|
|
107307
107390
|
// ../../shared/api/billingControls/usageLimit.ts
|
|
@@ -107309,10 +107392,12 @@ var ApiUsageLimitSchema;
|
|
|
107309
107392
|
var init_usageLimit2 = __esm(() => {
|
|
107310
107393
|
init_v4();
|
|
107311
107394
|
init_usageLimit();
|
|
107395
|
+
init_billingControlSource();
|
|
107312
107396
|
ApiUsageLimitSchema = DbUsageLimitSchema.extend({
|
|
107313
107397
|
usage: exports_external.number().min(0).optional().meta({
|
|
107314
107398
|
description: "Current usage already consumed in the active interval. Response-only; not stored on billing controls."
|
|
107315
|
-
})
|
|
107399
|
+
}),
|
|
107400
|
+
source: BillingControlSourceSchema.optional()
|
|
107316
107401
|
});
|
|
107317
107402
|
});
|
|
107318
107403
|
|
|
@@ -107320,11 +107405,13 @@ var init_usageLimit2 = __esm(() => {
|
|
|
107320
107405
|
var CustomerBillingControlsResponseSchema;
|
|
107321
107406
|
var init_customerBillingControls2 = __esm(() => {
|
|
107322
107407
|
init_v4();
|
|
107323
|
-
|
|
107408
|
+
init_autoTopup();
|
|
107409
|
+
init_overageAllowed2();
|
|
107324
107410
|
init_spendLimit2();
|
|
107411
|
+
init_usageAlert2();
|
|
107325
107412
|
init_usageLimit2();
|
|
107326
107413
|
CustomerBillingControlsResponseSchema = exports_external.object({
|
|
107327
|
-
auto_topups: exports_external.array(
|
|
107414
|
+
auto_topups: exports_external.array(ApiAutoTopupSchema).optional().meta({
|
|
107328
107415
|
description: "List of auto top-up configurations per feature."
|
|
107329
107416
|
}),
|
|
107330
107417
|
spend_limits: exports_external.array(ApiSpendLimitSchema).optional().meta({
|
|
@@ -107333,34 +107420,22 @@ var init_customerBillingControls2 = __esm(() => {
|
|
|
107333
107420
|
usage_limits: exports_external.array(ApiUsageLimitSchema).optional().meta({
|
|
107334
107421
|
description: "List of hard usage caps per feature, with current interval usage."
|
|
107335
107422
|
}),
|
|
107336
|
-
usage_alerts: exports_external.array(
|
|
107423
|
+
usage_alerts: exports_external.array(ApiUsageAlertSchema).optional().meta({
|
|
107337
107424
|
description: "List of usage alert configurations per feature."
|
|
107338
107425
|
}),
|
|
107339
|
-
overage_allowed: exports_external.array(
|
|
107426
|
+
overage_allowed: exports_external.array(ApiOverageAllowedSchema).optional().meta({
|
|
107340
107427
|
description: "List of overage allowed controls per feature. When enabled, usage can exceed balance."
|
|
107341
107428
|
})
|
|
107342
107429
|
});
|
|
107343
107430
|
});
|
|
107344
107431
|
|
|
107345
|
-
// ../../shared/api/billingControls/overageAllowed.ts
|
|
107346
|
-
var ApiOverageAllowedSchema;
|
|
107347
|
-
var init_overageAllowed2 = __esm(() => {
|
|
107348
|
-
init_overageAllowed();
|
|
107349
|
-
ApiOverageAllowedSchema = DbOverageAllowedSchema;
|
|
107350
|
-
});
|
|
107351
|
-
|
|
107352
|
-
// ../../shared/api/billingControls/usageAlert.ts
|
|
107353
|
-
var ApiUsageAlertSchema;
|
|
107354
|
-
var init_usageAlert2 = __esm(() => {
|
|
107355
|
-
init_usageAlert();
|
|
107356
|
-
ApiUsageAlertSchema = DbUsageAlertSchema;
|
|
107357
|
-
});
|
|
107358
|
-
|
|
107359
107432
|
// ../../shared/api/billingControls/entityBillingControls.ts
|
|
107360
107433
|
var ApiEntityBillingControlsSchema, ApiEntityBillingControlsParamsBaseSchema, ApiEntityBillingControlsParamsSchema;
|
|
107361
107434
|
var init_entityBillingControls2 = __esm(() => {
|
|
107362
107435
|
init_v4();
|
|
107436
|
+
init_overageAllowed();
|
|
107363
107437
|
init_spendLimit();
|
|
107438
|
+
init_usageAlert();
|
|
107364
107439
|
init_usageLimit();
|
|
107365
107440
|
init_overageAllowed2();
|
|
107366
107441
|
init_spendLimit2();
|
|
@@ -107387,10 +107462,10 @@ var init_entityBillingControls2 = __esm(() => {
|
|
|
107387
107462
|
usage_limits: exports_external.array(DbUsageLimitSchema).optional().meta({
|
|
107388
107463
|
description: "List of hard usage caps per feature for this entity. An entity entry overrides the customer's for that feature."
|
|
107389
107464
|
}),
|
|
107390
|
-
usage_alerts: exports_external.array(
|
|
107465
|
+
usage_alerts: exports_external.array(DbUsageAlertSchema).optional().meta({
|
|
107391
107466
|
description: "List of usage alert configurations per feature."
|
|
107392
107467
|
}),
|
|
107393
|
-
overage_allowed: exports_external.array(
|
|
107468
|
+
overage_allowed: exports_external.array(DbOverageAllowedSchema).optional().meta({
|
|
107394
107469
|
description: "List of overage allowed controls per feature. When enabled, usage can exceed balance."
|
|
107395
107470
|
})
|
|
107396
107471
|
});
|
|
@@ -107443,6 +107518,8 @@ var init_entityBillingControls2 = __esm(() => {
|
|
|
107443
107518
|
|
|
107444
107519
|
// ../../shared/api/billingControls/index.ts
|
|
107445
107520
|
var init_billingControls = __esm(() => {
|
|
107521
|
+
init_autoTopup();
|
|
107522
|
+
init_billingControlSource();
|
|
107446
107523
|
init_customerBillingControls2();
|
|
107447
107524
|
init_entityBillingControls2();
|
|
107448
107525
|
init_overageAllowed2();
|
|
@@ -107552,7 +107629,6 @@ var init_ErrCode = __esm(() => {
|
|
|
107552
107629
|
CreateEntitlementFailed: "create_entitlement_failed",
|
|
107553
107630
|
DeleteEntitlementFailed: "delete_entitlement_failed",
|
|
107554
107631
|
InsufficientBalance: "insufficient_balance",
|
|
107555
|
-
SetUsageNotAllowedWithUsageLimit: "set_usage_not_allowed_with_usage_limit",
|
|
107556
107632
|
CreateInvoiceFailed: "create_invoice_failed",
|
|
107557
107633
|
InvalidEvent: "invalid_event",
|
|
107558
107634
|
CreateEventFailed: "create_event_failed",
|
|
@@ -107562,6 +107638,7 @@ var init_ErrCode = __esm(() => {
|
|
|
107562
107638
|
GetCusPriceFailed: "get_cus_price_failed",
|
|
107563
107639
|
PayInvoiceFailed: "invoice_payment_failed",
|
|
107564
107640
|
InvalidReward: "invalid_reward",
|
|
107641
|
+
ProductNotInStripe: "product_not_in_stripe",
|
|
107565
107642
|
DuplicateRewardId: "duplicate_reward_id",
|
|
107566
107643
|
DuplicatePromoCode: "duplicate_promo_code",
|
|
107567
107644
|
PromoCodeAlreadyExistsInStripe: "promo_code_already_exists_in_stripe",
|
|
@@ -107895,7 +107972,7 @@ var init_processorSchemas = __esm(() => {
|
|
|
107895
107972
|
});
|
|
107896
107973
|
|
|
107897
107974
|
// ../../shared/api/common/customerData.ts
|
|
107898
|
-
var CreateCustomerInternalOptionsSchema, CustomerDataSchema;
|
|
107975
|
+
var CreateCustomerInternalOptionsSchema, CustomerEmailSchema, CustomerDataSchema;
|
|
107899
107976
|
var init_customerData = __esm(() => {
|
|
107900
107977
|
init_v4();
|
|
107901
107978
|
init_customerBillingControls();
|
|
@@ -107908,14 +107985,15 @@ var init_customerData = __esm(() => {
|
|
|
107908
107985
|
description: "Whether to disable default products"
|
|
107909
107986
|
})
|
|
107910
107987
|
});
|
|
107988
|
+
CustomerEmailSchema = exports_external.email({
|
|
107989
|
+
pattern: exports_external.regexes.unicodeEmail,
|
|
107990
|
+
message: "not a valid email address"
|
|
107991
|
+
});
|
|
107911
107992
|
CustomerDataSchema = exports_external.object({
|
|
107912
107993
|
name: exports_external.string().nullish().meta({
|
|
107913
107994
|
description: "Customer's name"
|
|
107914
107995
|
}),
|
|
107915
|
-
email:
|
|
107916
|
-
pattern: exports_external.regexes.unicodeEmail,
|
|
107917
|
-
message: "not a valid email address"
|
|
107918
|
-
}).nullish().meta({
|
|
107996
|
+
email: CustomerEmailSchema.nullish().meta({
|
|
107919
107997
|
description: "Customer's email address"
|
|
107920
107998
|
}),
|
|
107921
107999
|
fingerprint: exports_external.string().nullish().meta({
|
|
@@ -116665,6 +116743,50 @@ var init_V2_0_CustomerChange = __esm(() => {
|
|
|
116665
116743
|
});
|
|
116666
116744
|
});
|
|
116667
116745
|
|
|
116746
|
+
// ../../shared/api/customers/changes/V2.2_PlanInheritedBillingControls.ts
|
|
116747
|
+
var stripPlanInherited = (entries) => {
|
|
116748
|
+
if (entries === undefined)
|
|
116749
|
+
return;
|
|
116750
|
+
const customerEntries = entries.filter((entry) => entry.source !== "plan").map(({ source: _source, ...rest2 }) => rest2);
|
|
116751
|
+
if (customerEntries.length === 0 && entries.length > 0)
|
|
116752
|
+
return;
|
|
116753
|
+
return customerEntries;
|
|
116754
|
+
}, V2_2_PlanInheritedBillingControls;
|
|
116755
|
+
var init_V2_2_PlanInheritedBillingControls = __esm(() => {
|
|
116756
|
+
init_ApiVersion();
|
|
116757
|
+
init_VersionChange();
|
|
116758
|
+
init_apiCustomerV5();
|
|
116759
|
+
V2_2_PlanInheritedBillingControls = defineVersionChange({
|
|
116760
|
+
name: "V2_2 Plan Inherited Billing Controls",
|
|
116761
|
+
newVersion: "2.3.0" /* V2_3 */,
|
|
116762
|
+
oldVersion: "2.2.0" /* V2_2 */,
|
|
116763
|
+
description: [
|
|
116764
|
+
"2.3.0 merges plan-default billing controls into the customer's billing_controls with a `source` tag; older versions receive customer-level entries only, without `source`"
|
|
116765
|
+
],
|
|
116766
|
+
affectedResources: ["customer" /* Customer */],
|
|
116767
|
+
newSchema: ApiCustomerV5Schema,
|
|
116768
|
+
oldSchema: ApiCustomerV5Schema,
|
|
116769
|
+
affectsResponse: true,
|
|
116770
|
+
transformResponse: ({
|
|
116771
|
+
input
|
|
116772
|
+
}) => {
|
|
116773
|
+
const billingControls = input.billing_controls;
|
|
116774
|
+
if (!billingControls)
|
|
116775
|
+
return input;
|
|
116776
|
+
return {
|
|
116777
|
+
...input,
|
|
116778
|
+
billing_controls: {
|
|
116779
|
+
auto_topups: stripPlanInherited(billingControls.auto_topups),
|
|
116780
|
+
spend_limits: stripPlanInherited(billingControls.spend_limits),
|
|
116781
|
+
usage_limits: stripPlanInherited(billingControls.usage_limits),
|
|
116782
|
+
usage_alerts: stripPlanInherited(billingControls.usage_alerts),
|
|
116783
|
+
overage_allowed: stripPlanInherited(billingControls.overage_allowed)
|
|
116784
|
+
}
|
|
116785
|
+
};
|
|
116786
|
+
}
|
|
116787
|
+
});
|
|
116788
|
+
});
|
|
116789
|
+
|
|
116668
116790
|
// ../../shared/utils/productV3Utils/productItemUtils/productV3ItemUtils.ts
|
|
116669
116791
|
function productV2ToBasePrice({
|
|
116670
116792
|
product
|
|
@@ -118672,9 +118794,7 @@ var init_updateSubscriptionV1Params = __esm(() => {
|
|
|
118672
118794
|
no_billing_changes: exports_external.boolean().optional().meta({
|
|
118673
118795
|
description: "If true, the subscription is updated internally without applying billing changes in Stripe."
|
|
118674
118796
|
}),
|
|
118675
|
-
refund_last_payment: RefundLastPaymentSchema.optional()
|
|
118676
|
-
internal: true
|
|
118677
|
-
}),
|
|
118797
|
+
refund_last_payment: RefundLastPaymentSchema.optional(),
|
|
118678
118798
|
recalculate_balances: exports_external.object({
|
|
118679
118799
|
enabled: exports_external.boolean().meta({
|
|
118680
118800
|
description: "If true, recalculates balances during the subscription update. Only applicable when updating feature quantities."
|
|
@@ -118916,6 +119036,7 @@ var init_versionChangeRegistry = __esm(() => {
|
|
|
118916
119036
|
init_V1_2_FeatureParamsChange();
|
|
118917
119037
|
init_V1_2_InvoiceChange();
|
|
118918
119038
|
init_V2_0_CustomerChange();
|
|
119039
|
+
init_V2_2_PlanInheritedBillingControls();
|
|
118919
119040
|
init_V1_2_ProductChanges();
|
|
118920
119041
|
init_V2_0_PlanChanges();
|
|
118921
119042
|
init_V2_1_PlanChanges();
|
|
@@ -118932,7 +119053,9 @@ var init_versionChangeRegistry = __esm(() => {
|
|
|
118932
119053
|
init_V2_0_AggregateEventsChange();
|
|
118933
119054
|
init_ApiVersion();
|
|
118934
119055
|
init_VersionChangeRegistryClass();
|
|
118935
|
-
V2_3_CHANGES = [
|
|
119056
|
+
V2_3_CHANGES = [
|
|
119057
|
+
V2_2_PlanInheritedBillingControls
|
|
119058
|
+
];
|
|
118936
119059
|
V2_2_CHANGES = [
|
|
118937
119060
|
V2_1_PlanChanges
|
|
118938
119061
|
];
|
|
@@ -119978,6 +120101,11 @@ var init_fullCustomerToOverageAllowed = __esm(() => {
|
|
|
119978
120101
|
init_planBillingControlUtils();
|
|
119979
120102
|
});
|
|
119980
120103
|
|
|
120104
|
+
// ../../shared/utils/cusUtils/fullCusUtils/fullCustomerToSkipOverageBilling.ts
|
|
120105
|
+
var init_fullCustomerToSkipOverageBilling = __esm(() => {
|
|
120106
|
+
init_planBillingControlUtils();
|
|
120107
|
+
});
|
|
120108
|
+
|
|
119981
120109
|
// ../../shared/utils/cusUtils/fullCusUtils/fullCustomerToSpendLimit.ts
|
|
119982
120110
|
var init_fullCustomerToSpendLimit = __esm(() => {
|
|
119983
120111
|
init_cusEntUtils2();
|
|
@@ -119993,6 +120121,7 @@ var init_cusUtils = __esm(() => {
|
|
|
119993
120121
|
init_enrichFullCustomer();
|
|
119994
120122
|
init_fullCustomerToCustomerEntitlements();
|
|
119995
120123
|
init_fullCustomerToOverageAllowed();
|
|
120124
|
+
init_fullCustomerToSkipOverageBilling();
|
|
119996
120125
|
init_fullCustomerToSpendLimit();
|
|
119997
120126
|
init_fullCustomerToTags();
|
|
119998
120127
|
});
|
|
@@ -120131,6 +120260,7 @@ var init_diffPlanV1 = __esm(() => {
|
|
|
120131
120260
|
|
|
120132
120261
|
// ../../shared/utils/planV1Utils/diff/diffPlanV1PreviewFields.ts
|
|
120133
120262
|
var init_diffPlanV1PreviewFields = __esm(() => {
|
|
120263
|
+
init_customerBillingControls();
|
|
120134
120264
|
init_diffPlanV1();
|
|
120135
120265
|
});
|
|
120136
120266
|
|
|
@@ -120213,6 +120343,7 @@ var init_apiBalanceV1ToAvailableOverage = __esm(() => {
|
|
|
120213
120343
|
});
|
|
120214
120344
|
// ../../shared/api/customers/utils/apiSubjectToUsageLimitHeadroom.ts
|
|
120215
120345
|
var init_apiSubjectToUsageLimitHeadroom = __esm(() => {
|
|
120346
|
+
init_usageLimit();
|
|
120216
120347
|
init_decimal();
|
|
120217
120348
|
});
|
|
120218
120349
|
|
|
@@ -122467,6 +122598,9 @@ var init_updateBalanceParams = __esm(() => {
|
|
|
122467
122598
|
}),
|
|
122468
122599
|
next_reset_at: exports_external.number().optional().meta({
|
|
122469
122600
|
description: "The next reset time for the balance. If there are multiple breakdowns, this will update the breakdown with the next reset time."
|
|
122601
|
+
}),
|
|
122602
|
+
expires_at: exports_external.number().optional().meta({
|
|
122603
|
+
description: "Unix timestamp (milliseconds) when the balance expires. Targets a specific balance via balance_id / interval when the customer has multiple balances for the same feature."
|
|
122470
122604
|
})
|
|
122471
122605
|
});
|
|
122472
122606
|
UpdateBalanceParamsV0Schema = ExtUpdateBalanceParamsV0Schema.extend({
|
|
@@ -123000,15 +123134,107 @@ var init_common3 = __esm(() => {
|
|
|
123000
123134
|
init_transitionRules();
|
|
123001
123135
|
});
|
|
123002
123136
|
|
|
123137
|
+
// ../../shared/api/billing/multiUpdate/multiUpdateParamsV0.ts
|
|
123138
|
+
var ExtMultiUpdateItemV0Schema, MultiUpdateItemV0Schema, multiUpdateParamsBase, updatesMeta, ExtMultiUpdateParamsV0Schema, MultiUpdateParamsV0Schema;
|
|
123139
|
+
var init_multiUpdateParamsV0 = __esm(() => {
|
|
123140
|
+
init_v4();
|
|
123141
|
+
init_billingBehavior();
|
|
123142
|
+
init_cancelAction();
|
|
123143
|
+
ExtMultiUpdateItemV0Schema = exports_external.object({
|
|
123144
|
+
plan_id: exports_external.string().optional().meta({
|
|
123145
|
+
description: "The ID of the plan to update. Optional if subscription_id is provided."
|
|
123146
|
+
}),
|
|
123147
|
+
subscription_id: exports_external.string().optional().meta({
|
|
123148
|
+
description: "A unique ID to identify the subscription to update. Useful when a customer has multiple products with the same plan."
|
|
123149
|
+
}),
|
|
123150
|
+
entity_id: exports_external.string().optional().meta({
|
|
123151
|
+
description: "The ID of the entity this update targets. Overrides the top-level entity_id for this update."
|
|
123152
|
+
}),
|
|
123153
|
+
cancel_action: CancelActionSchema.meta({
|
|
123154
|
+
description: "Action to perform for cancellation. 'cancel_immediately' cancels now with prorated refund, 'cancel_end_of_cycle' cancels at period end, 'uncancel' reverses a pending cancellation."
|
|
123155
|
+
}),
|
|
123156
|
+
proration_behavior: BillingBehaviorSchema.optional().meta({
|
|
123157
|
+
description: "How to handle proration for this update. 'prorate_immediately' charges/credits prorated amounts now, 'none' skips creating any charges."
|
|
123158
|
+
})
|
|
123159
|
+
});
|
|
123160
|
+
MultiUpdateItemV0Schema = ExtMultiUpdateItemV0Schema.extend({
|
|
123161
|
+
customer_product_id: exports_external.string().optional().meta({
|
|
123162
|
+
internal: true
|
|
123163
|
+
})
|
|
123164
|
+
});
|
|
123165
|
+
multiUpdateParamsBase = {
|
|
123166
|
+
customer_id: exports_external.string().meta({
|
|
123167
|
+
description: "The ID of the customer to update plans for."
|
|
123168
|
+
}),
|
|
123169
|
+
entity_id: exports_external.string().optional().meta({
|
|
123170
|
+
description: "The ID of the entity to update plans for. Individual updates can override this with their own entity_id."
|
|
123171
|
+
})
|
|
123172
|
+
};
|
|
123173
|
+
updatesMeta = {
|
|
123174
|
+
description: "The list of plan updates to apply to the customer."
|
|
123175
|
+
};
|
|
123176
|
+
ExtMultiUpdateParamsV0Schema = exports_external.object({
|
|
123177
|
+
...multiUpdateParamsBase,
|
|
123178
|
+
updates: exports_external.array(ExtMultiUpdateItemV0Schema).min(1, "At least one update must be provided").meta(updatesMeta)
|
|
123179
|
+
});
|
|
123180
|
+
MultiUpdateParamsV0Schema = exports_external.object({
|
|
123181
|
+
...multiUpdateParamsBase,
|
|
123182
|
+
updates: exports_external.array(MultiUpdateItemV0Schema).min(1, "At least one update must be provided").meta(updatesMeta)
|
|
123183
|
+
});
|
|
123184
|
+
});
|
|
123185
|
+
|
|
123186
|
+
// ../../shared/api/billing/multiUpdate/multiUpdatePreviewResponseV0.ts
|
|
123187
|
+
var planIdsField, MultiUpdateSubscriptionPreviewV0Schema, ExtMultiUpdateSubscriptionPreviewV0Schema, multiUpdatePreviewBase, subscriptionsMeta, ExtMultiUpdatePreviewResponseV0Schema, MultiUpdatePreviewResponseV0Schema;
|
|
123188
|
+
var init_multiUpdatePreviewResponseV0 = __esm(() => {
|
|
123189
|
+
init_v4();
|
|
123190
|
+
init_billingPreviewResponse();
|
|
123191
|
+
planIdsField = exports_external.array(exports_external.string()).meta({
|
|
123192
|
+
description: "The IDs of the plans updated on this subscription."
|
|
123193
|
+
});
|
|
123194
|
+
MultiUpdateSubscriptionPreviewV0Schema = BillingPreviewResponseSchema.extend({
|
|
123195
|
+
plan_ids: planIdsField
|
|
123196
|
+
});
|
|
123197
|
+
ExtMultiUpdateSubscriptionPreviewV0Schema = ExtBillingPreviewResponseSchema.extend({
|
|
123198
|
+
plan_ids: planIdsField
|
|
123199
|
+
});
|
|
123200
|
+
multiUpdatePreviewBase = {
|
|
123201
|
+
customer_id: exports_external.string().meta({
|
|
123202
|
+
description: "The ID of the customer the preview applies to."
|
|
123203
|
+
}),
|
|
123204
|
+
currency: exports_external.string().meta({
|
|
123205
|
+
description: "The three-letter ISO currency code (e.g., 'usd')."
|
|
123206
|
+
}),
|
|
123207
|
+
total: exports_external.number().meta({
|
|
123208
|
+
description: "The combined amount due today across all subscriptions (sum of subscriptions[].total)."
|
|
123209
|
+
})
|
|
123210
|
+
};
|
|
123211
|
+
subscriptionsMeta = {
|
|
123212
|
+
description: "One preview per affected Stripe subscription. Updates to plans without a subscription (free plans) produce no entry."
|
|
123213
|
+
};
|
|
123214
|
+
ExtMultiUpdatePreviewResponseV0Schema = exports_external.object({
|
|
123215
|
+
...multiUpdatePreviewBase,
|
|
123216
|
+
subscriptions: exports_external.array(ExtMultiUpdateSubscriptionPreviewV0Schema).meta(subscriptionsMeta)
|
|
123217
|
+
});
|
|
123218
|
+
MultiUpdatePreviewResponseV0Schema = exports_external.object({
|
|
123219
|
+
object: exports_external.literal("multi_update_preview").meta({ internal: true }),
|
|
123220
|
+
...multiUpdatePreviewBase,
|
|
123221
|
+
subscriptions: exports_external.array(MultiUpdateSubscriptionPreviewV0Schema).meta(subscriptionsMeta)
|
|
123222
|
+
});
|
|
123223
|
+
});
|
|
123224
|
+
|
|
123003
123225
|
// ../../shared/api/billing/dfu/dfuFlashParams.ts
|
|
123004
123226
|
var ProcessorTypeSchema, FlashCustomerDataSchema, FlashProcessorIdentitySchema, FlashLinkSchema, FlashStartingAfterSchema, FlashBalanceFilterSchema, FlashRolloverSchema, FlashBalanceSchema, FlashFeatureQuantitySchema, FlashPlanSchema, FlashPhaseSchema, FlashBillableSchema, FlashEntitySchema, DfuFlashParamsSchema, DfuFlashedPlanSchema, DfuFlashResultSchema;
|
|
123005
123227
|
var init_dfuFlashParams = __esm(() => {
|
|
123228
|
+
init_entitlementInterval();
|
|
123006
123229
|
init_v4();
|
|
123230
|
+
init_customerData();
|
|
123007
123231
|
init_apiCustomerV5();
|
|
123008
123232
|
ProcessorTypeSchema = exports_external.enum(["stripe", "revenuecat"]);
|
|
123009
123233
|
FlashCustomerDataSchema = exports_external.object({
|
|
123010
123234
|
name: exports_external.string().optional().meta({ description: "Display name for the customer." }),
|
|
123011
|
-
email:
|
|
123235
|
+
email: CustomerEmailSchema.optional().meta({
|
|
123236
|
+
description: "Email address for the customer."
|
|
123237
|
+
}),
|
|
123012
123238
|
fingerprint: exports_external.string().optional().meta({ description: "Anti-fraud fingerprint for the customer." })
|
|
123013
123239
|
});
|
|
123014
123240
|
FlashProcessorIdentitySchema = exports_external.object({
|
|
@@ -123032,11 +123258,11 @@ var init_dfuFlashParams = __esm(() => {
|
|
|
123032
123258
|
duration_count: exports_external.number()
|
|
123033
123259
|
}).meta({ internal: true });
|
|
123034
123260
|
FlashBalanceFilterSchema = exports_external.object({
|
|
123035
|
-
interval: exports_external.enum(
|
|
123036
|
-
description: "Reset interval selecting which entitlement line to target when a feature has several (null = the non-resetting one-off line)."
|
|
123261
|
+
interval: exports_external.enum(EntInterval).nullable().optional().meta({
|
|
123262
|
+
description: "Reset interval selecting which entitlement line to target when a feature has several ('lifetime' or null = the non-resetting one-off line)."
|
|
123037
123263
|
}),
|
|
123038
|
-
billing_behavior: exports_external.enum(["included", "prepaid"]).optional().meta({
|
|
123039
|
-
description: "Selects the included vs prepaid entitlement line when a feature has
|
|
123264
|
+
billing_behavior: exports_external.enum(["included", "prepaid", "usage_based"]).optional().meta({
|
|
123265
|
+
description: "Selects the included vs prepaid vs usage-based (pay-per-use) entitlement line when a feature has several."
|
|
123040
123266
|
})
|
|
123041
123267
|
});
|
|
123042
123268
|
FlashRolloverSchema = exports_external.object({
|
|
@@ -123125,7 +123351,7 @@ var init_dfuFlashParams = __esm(() => {
|
|
|
123125
123351
|
description: "Autumn customer to image into."
|
|
123126
123352
|
}),
|
|
123127
123353
|
customer_data: FlashCustomerDataSchema.optional().meta({
|
|
123128
|
-
description: "Optional identity fields
|
|
123354
|
+
description: "Optional identity fields upserted onto the customer (applied to existing customers too)."
|
|
123129
123355
|
}),
|
|
123130
123356
|
processors: exports_external.array(FlashProcessorIdentitySchema).optional().meta({
|
|
123131
123357
|
description: "The customer's processor identities (e.g. Stripe customer id, RevenueCat app_user_id). Omit for customers with no processor, e.g. those only ever on a free plan."
|
|
@@ -123482,6 +123708,8 @@ var init_billing = __esm(() => {
|
|
|
123482
123708
|
init_common3();
|
|
123483
123709
|
init_createScheduleParamsV0();
|
|
123484
123710
|
init_createScheduleResponse();
|
|
123711
|
+
init_multiUpdateParamsV0();
|
|
123712
|
+
init_multiUpdatePreviewResponseV0();
|
|
123485
123713
|
init_dfuFlashParams();
|
|
123486
123714
|
init_openBillingPortalParamsV1();
|
|
123487
123715
|
init_openBillingPortalResponse();
|
|
@@ -124170,6 +124398,83 @@ var init_balancesUsageAlertTriggered = __esm(() => {
|
|
|
124170
124398
|
});
|
|
124171
124399
|
});
|
|
124172
124400
|
|
|
124401
|
+
// ../../shared/api/webhooks/billing/billingAutoTopupFailed.ts
|
|
124402
|
+
var BillingAutoTopupFailureReasonSchema, BillingAutoTopupFailedErrorSchema, BILLING_AUTO_TOPUP_FAILED_EXAMPLE, BillingAutoTopupFailedSchema;
|
|
124403
|
+
var init_billingAutoTopupFailed = __esm(() => {
|
|
124404
|
+
init_v4();
|
|
124405
|
+
BillingAutoTopupFailureReasonSchema = exports_external.enum([
|
|
124406
|
+
"charge_failed",
|
|
124407
|
+
"purchase_limit_reached",
|
|
124408
|
+
"attempt_limit_reached",
|
|
124409
|
+
"failed_attempt_limit_reached",
|
|
124410
|
+
"customer_unavailable",
|
|
124411
|
+
"configuration_unavailable",
|
|
124412
|
+
"missing_payment_method",
|
|
124413
|
+
"missing_customer_product",
|
|
124414
|
+
"invalid_amount",
|
|
124415
|
+
"lock_contention",
|
|
124416
|
+
"redis_unavailable",
|
|
124417
|
+
"execution_error"
|
|
124418
|
+
]).meta({
|
|
124419
|
+
description: "Machine-readable reason the automatic top-up did not grant balance."
|
|
124420
|
+
});
|
|
124421
|
+
BillingAutoTopupFailedErrorSchema = exports_external.object({
|
|
124422
|
+
code: exports_external.string().nullish().meta({
|
|
124423
|
+
description: "Machine-readable error code when one is available (for example, a Stripe or Autumn error code)."
|
|
124424
|
+
}),
|
|
124425
|
+
message: exports_external.string().nullish().meta({
|
|
124426
|
+
description: "Sanitized error message with details about why the auto top-up failed."
|
|
124427
|
+
}),
|
|
124428
|
+
type: exports_external.string().nullish().meta({
|
|
124429
|
+
description: "Provider error type when one is available."
|
|
124430
|
+
}),
|
|
124431
|
+
decline_code: exports_external.string().nullish().meta({
|
|
124432
|
+
description: "Stripe decline code when the failure came from a card decline."
|
|
124433
|
+
})
|
|
124434
|
+
});
|
|
124435
|
+
BILLING_AUTO_TOPUP_FAILED_EXAMPLE = {
|
|
124436
|
+
customer_id: "cus_123",
|
|
124437
|
+
feature_id: "messages",
|
|
124438
|
+
reason: "charge_failed",
|
|
124439
|
+
quantity: 100,
|
|
124440
|
+
threshold: 20,
|
|
124441
|
+
balance: 15,
|
|
124442
|
+
invoice_mode: false,
|
|
124443
|
+
error: {
|
|
124444
|
+
code: "card_declined",
|
|
124445
|
+
message: "Your card was declined.",
|
|
124446
|
+
type: "card_error",
|
|
124447
|
+
decline_code: "generic_decline"
|
|
124448
|
+
}
|
|
124449
|
+
};
|
|
124450
|
+
BillingAutoTopupFailedSchema = exports_external.object({
|
|
124451
|
+
customer_id: exports_external.string().meta({
|
|
124452
|
+
description: "The ID of the customer whose auto top-up failed."
|
|
124453
|
+
}),
|
|
124454
|
+
feature_id: exports_external.string().meta({
|
|
124455
|
+
description: "The feature ID that Autumn attempted to auto top-up."
|
|
124456
|
+
}),
|
|
124457
|
+
reason: BillingAutoTopupFailureReasonSchema,
|
|
124458
|
+
quantity: exports_external.number().nullish().meta({
|
|
124459
|
+
description: "The normalized amount of balance Autumn attempted to grant, when a matching auto top-up config was available."
|
|
124460
|
+
}),
|
|
124461
|
+
threshold: exports_external.number().nullish().meta({
|
|
124462
|
+
description: "The configured balance threshold for the auto top-up, when available."
|
|
124463
|
+
}),
|
|
124464
|
+
balance: exports_external.number().nullish().meta({
|
|
124465
|
+
description: "The customer's remaining balance for the feature at the time the failure was detected, when available."
|
|
124466
|
+
}),
|
|
124467
|
+
invoice_mode: exports_external.boolean().nullish().meta({
|
|
124468
|
+
description: "Whether the auto top-up was configured to create a send_invoice invoice instead of auto-charging."
|
|
124469
|
+
}),
|
|
124470
|
+
error: BillingAutoTopupFailedErrorSchema.nullish().meta({
|
|
124471
|
+
description: "Sanitized provider or Autumn error metadata, when the failure came from an exception or declined charge."
|
|
124472
|
+
})
|
|
124473
|
+
}).meta({
|
|
124474
|
+
examples: [BILLING_AUTO_TOPUP_FAILED_EXAMPLE]
|
|
124475
|
+
});
|
|
124476
|
+
});
|
|
124477
|
+
|
|
124173
124478
|
// ../../shared/api/webhooks/billing/billingAutoTopupSucceeded.ts
|
|
124174
124479
|
var BillingAutoTopupSucceededInvoiceSchema, BILLING_AUTO_TOPUP_SUCCEEDED_EXAMPLE, BillingAutoTopupSucceededSchema;
|
|
124175
124480
|
var init_billingAutoTopupSucceeded = __esm(() => {
|
|
@@ -124369,6 +124674,7 @@ var webhookRegistry;
|
|
|
124369
124674
|
var init_webhookRegistry = __esm(() => {
|
|
124370
124675
|
init_balancesLimitReached();
|
|
124371
124676
|
init_balancesUsageAlertTriggered();
|
|
124677
|
+
init_billingAutoTopupFailed();
|
|
124372
124678
|
init_billingAutoTopupSucceeded();
|
|
124373
124679
|
init_billingUpdated();
|
|
124374
124680
|
init_vercelResourceDeleted();
|
|
@@ -124393,6 +124699,14 @@ var init_webhookRegistry = __esm(() => {
|
|
|
124393
124699
|
group: "Balances",
|
|
124394
124700
|
description: "Fired when a customer reaches the limit for a feature (included allowance, max purchase, or spend limit)."
|
|
124395
124701
|
},
|
|
124702
|
+
{
|
|
124703
|
+
eventType: "billing.auto_topup_failed" /* BillingAutoTopupFailed */,
|
|
124704
|
+
operationId: "billingAutoTopupFailed",
|
|
124705
|
+
title: "Auto Top-Up Failed",
|
|
124706
|
+
schema: BillingAutoTopupFailedSchema,
|
|
124707
|
+
group: "Billing",
|
|
124708
|
+
description: "Fired when an automatic top-up is blocked, declined, or fails before granting additional prepaid balance."
|
|
124709
|
+
},
|
|
124396
124710
|
{
|
|
124397
124711
|
eventType: "billing.auto_topup_succeeded" /* BillingAutoTopupSucceeded */,
|
|
124398
124712
|
operationId: "billingAutoTopupSucceeded",
|
|
@@ -124452,6 +124766,7 @@ var init_webhookRegistry = __esm(() => {
|
|
|
124452
124766
|
var init_webhooks = __esm(() => {
|
|
124453
124767
|
init_balancesLimitReached();
|
|
124454
124768
|
init_balancesUsageAlertTriggered();
|
|
124769
|
+
init_billingAutoTopupFailed();
|
|
124455
124770
|
init_billingAutoTopupSucceeded();
|
|
124456
124771
|
init_billingUpdated();
|
|
124457
124772
|
init_vercel();
|
|
@@ -129445,6 +129760,8 @@ var init_usageWindowModels = __esm(() => {
|
|
|
129445
129760
|
scope_type: UsageWindowScopeSchema,
|
|
129446
129761
|
entity_id: exports_external.string().nullable(),
|
|
129447
129762
|
internal_entity_id: exports_external.string().nullable(),
|
|
129763
|
+
filter_key: exports_external.string().nullable(),
|
|
129764
|
+
filter_properties: exports_external.record(exports_external.string(), exports_external.string()).nullable(),
|
|
129448
129765
|
interval: exports_external.enum(EntInterval),
|
|
129449
129766
|
window_start_at: exports_external.number(),
|
|
129450
129767
|
window_end_at: exports_external.number(),
|
|
@@ -130911,6 +131228,13 @@ var init_fullSubjectToCustomerEntitlements = __esm(() => {
|
|
|
130911
131228
|
init_utils11();
|
|
130912
131229
|
});
|
|
130913
131230
|
|
|
131231
|
+
// ../../shared/utils/fullSubjectUtils/buildNormalizeSpendLimitForCompare.ts
|
|
131232
|
+
var init_buildNormalizeSpendLimitForCompare = __esm(() => {
|
|
131233
|
+
init_resolveSpendLimitOverageLimit();
|
|
131234
|
+
init_fullSubjectToCustomerEntitlements();
|
|
131235
|
+
init_planBillingControlUtils();
|
|
131236
|
+
});
|
|
131237
|
+
|
|
130914
131238
|
// ../../shared/utils/fullSubjectUtils/classifyFullSubject.ts
|
|
130915
131239
|
var init_classifyFullSubject = __esm(() => {
|
|
130916
131240
|
init_classifyCusEntUtils();
|
|
@@ -130954,6 +131278,7 @@ var init_getUsageWindowDimension = __esm(() => {
|
|
|
130954
131278
|
// ../../shared/utils/usageWindowUtils/convertUsageWindow/usageLimitToUsageWindowLimit.ts
|
|
130955
131279
|
var init_usageLimitToUsageWindowLimit = __esm(() => {
|
|
130956
131280
|
init_planItemIntervals();
|
|
131281
|
+
init_usageLimit();
|
|
130957
131282
|
init_findUsageWindowAnchor();
|
|
130958
131283
|
init_getUsageWindowBounds();
|
|
130959
131284
|
init_getUsageWindowDimension();
|
|
@@ -130962,11 +131287,13 @@ var init_usageLimitToUsageWindowLimit = __esm(() => {
|
|
|
130962
131287
|
// ../../shared/utils/fullSubjectUtils/fullSubjectToUsageWindowLimits.ts
|
|
130963
131288
|
var init_fullSubjectToUsageWindowLimits = __esm(() => {
|
|
130964
131289
|
init_usageLimitToUsageWindowLimit();
|
|
131290
|
+
init_usageLimit();
|
|
130965
131291
|
init_planBillingControlUtils();
|
|
130966
131292
|
});
|
|
130967
131293
|
|
|
130968
131294
|
// ../../shared/utils/fullSubjectUtils/fullSubjectToApiUsageLimits.ts
|
|
130969
131295
|
var init_fullSubjectToApiUsageLimits = __esm(() => {
|
|
131296
|
+
init_usageLimit();
|
|
130970
131297
|
init_getCurrentUsageWindowUsage();
|
|
130971
131298
|
init_fullSubjectToUsageWindowLimits();
|
|
130972
131299
|
});
|
|
@@ -130983,21 +131310,31 @@ var init_fullSubjectToSpendLimit = __esm(() => {
|
|
|
130983
131310
|
});
|
|
130984
131311
|
// ../../shared/utils/fullSubjectUtils/mergeCustomerBillingControlsForCheck.ts
|
|
130985
131312
|
var init_mergeCustomerBillingControlsForCheck = __esm(() => {
|
|
131313
|
+
init_usageLimit();
|
|
130986
131314
|
init_getCurrentUsageWindowUsage();
|
|
130987
131315
|
init_fullSubjectToUsageWindowLimits();
|
|
130988
131316
|
init_planBillingControlUtils();
|
|
130989
131317
|
});
|
|
131318
|
+
|
|
131319
|
+
// ../../shared/utils/fullSubjectUtils/mergePlanBillingControlsForResponse.ts
|
|
131320
|
+
var init_mergePlanBillingControlsForResponse = __esm(() => {
|
|
131321
|
+
init_buildNormalizeSpendLimitForCompare();
|
|
131322
|
+
init_mergeCustomerBillingControlsForCheck();
|
|
131323
|
+
init_planBillingControlUtils();
|
|
131324
|
+
});
|
|
130990
131325
|
// ../../shared/utils/fullSubjectUtils/index.ts
|
|
130991
131326
|
var init_fullSubjectUtils = __esm(() => {
|
|
131327
|
+
init_buildNormalizeSpendLimitForCompare();
|
|
130992
131328
|
init_classifyFullSubject();
|
|
130993
131329
|
init_fullCustomerToFullSubject();
|
|
130994
131330
|
init_fullSubjectToApiUsageLimits();
|
|
130995
|
-
init_planBillingControlUtils();
|
|
130996
131331
|
init_fullSubjectToCustomerEntitlements();
|
|
130997
131332
|
init_fullSubjectToOverageAllowed();
|
|
130998
131333
|
init_fullSubjectToSpendLimit();
|
|
130999
131334
|
init_fullSubjectToUsageWindowLimits();
|
|
131000
131335
|
init_mergeCustomerBillingControlsForCheck();
|
|
131336
|
+
init_mergePlanBillingControlsForResponse();
|
|
131337
|
+
init_planBillingControlUtils();
|
|
131001
131338
|
init_aggregatedUtils();
|
|
131002
131339
|
});
|
|
131003
131340
|
// ../../shared/utils/invoices/invoiceLineItems/index.ts
|