@tinkerlandai/indiana-cli 0.3.9 → 0.3.11
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/CHANGELOG.md +9 -0
- package/README.md +2 -2
- package/dist/{chunk-4MAMIKAR.js → chunk-A5HJK2OY.js} +52 -21
- package/dist/{io-OZLYPXWR.js → io-COF7BMWZ.js} +1 -1
- package/dist/main.js +1347 -1338
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
readJsonFile,
|
|
12
12
|
readJsonStream,
|
|
13
13
|
schemaError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A5HJK2OY.js";
|
|
15
15
|
|
|
16
16
|
// src/program.ts
|
|
17
17
|
import {
|
|
@@ -5099,7 +5099,7 @@ function managementOperationPolicy(operation, input) {
|
|
|
5099
5099
|
// package.json
|
|
5100
5100
|
var package_default = {
|
|
5101
5101
|
name: "@indiana/cli",
|
|
5102
|
-
version: "0.3.
|
|
5102
|
+
version: "0.3.11",
|
|
5103
5103
|
private: true,
|
|
5104
5104
|
description: "Indiana management CLI",
|
|
5105
5105
|
type: "module",
|
|
@@ -5169,8 +5169,8 @@ var { PurchaseLimitInterval: a8_PurchaseLimitInterval } = (() => {
|
|
|
5169
5169
|
})(PurchaseLimitInterval || (PurchaseLimitInterval = {}));
|
|
5170
5170
|
return { PurchaseLimitInterval };
|
|
5171
5171
|
})();
|
|
5172
|
-
var { SpendLimitType: a10_SpendLimitType } = ((
|
|
5173
|
-
const SpendLimitType =
|
|
5172
|
+
var { SpendLimitType: a10_SpendLimitType } = ((z100) => {
|
|
5173
|
+
const SpendLimitType = z100.enum(["absolute", "usage_percentage"]);
|
|
5174
5174
|
return { SpendLimitType };
|
|
5175
5175
|
})(external0);
|
|
5176
5176
|
var { ResetInterval: a13_ResetInterval } = (() => {
|
|
@@ -5208,8 +5208,8 @@ var { USAGE_LIMIT_FILTER_MAX_KEYS: a20_USAGE_LIMIT_FILTER_MAX_KEYS } = /* @__PUR
|
|
|
5208
5208
|
const USAGE_LIMIT_FILTER_MAX_KEYS = 4;
|
|
5209
5209
|
return { USAGE_LIMIT_FILTER_MAX_KEYS };
|
|
5210
5210
|
})();
|
|
5211
|
-
var { UsageAlertThresholdType: a22_UsageAlertThresholdType } = ((
|
|
5212
|
-
const UsageAlertThresholdType =
|
|
5211
|
+
var { UsageAlertThresholdType: a22_UsageAlertThresholdType } = ((z100) => {
|
|
5212
|
+
const UsageAlertThresholdType = z100.enum([
|
|
5213
5213
|
"usage",
|
|
5214
5214
|
"usage_percentage",
|
|
5215
5215
|
"remaining",
|
|
@@ -5225,19 +5225,19 @@ var { DEFAULT_USAGE_ALERT_BASIS: a26_DEFAULT_USAGE_ALERT_BASIS } = /* @__PURE__
|
|
|
5225
5225
|
const DEFAULT_USAGE_ALERT_BASIS = "balance";
|
|
5226
5226
|
return { DEFAULT_USAGE_ALERT_BASIS };
|
|
5227
5227
|
})();
|
|
5228
|
-
var { DbOverageAllowedSchema: a27_DbOverageAllowedSchema } = ((
|
|
5229
|
-
const DbOverageAllowedSchema =
|
|
5230
|
-
feature_id:
|
|
5228
|
+
var { DbOverageAllowedSchema: a27_DbOverageAllowedSchema } = ((z100) => {
|
|
5229
|
+
const DbOverageAllowedSchema = z100.object({
|
|
5230
|
+
feature_id: z100.string().meta({
|
|
5231
5231
|
description: "The feature ID this overage allowed control applies to."
|
|
5232
5232
|
}),
|
|
5233
|
-
enabled:
|
|
5233
|
+
enabled: z100.boolean().default(false).meta({
|
|
5234
5234
|
description: "Whether overage is allowed for this feature."
|
|
5235
5235
|
})
|
|
5236
5236
|
});
|
|
5237
5237
|
return { DbOverageAllowedSchema };
|
|
5238
5238
|
})(external0);
|
|
5239
|
-
var { ProductMetadataSchema: a28_ProductMetadataSchema } = ((
|
|
5240
|
-
const ProductMetadataSchema =
|
|
5239
|
+
var { ProductMetadataSchema: a28_ProductMetadataSchema } = ((z100) => {
|
|
5240
|
+
const ProductMetadataSchema = z100.record(z100.string(), z100.any());
|
|
5241
5241
|
return { ProductMetadataSchema };
|
|
5242
5242
|
})(external0);
|
|
5243
5243
|
var { findDuplicate: a32_findDuplicate } = /* @__PURE__ */ (() => {
|
|
@@ -5263,12 +5263,12 @@ var { BillingInterval: a36_BillingInterval } = (() => {
|
|
|
5263
5263
|
})(BillingInterval || (BillingInterval = {}));
|
|
5264
5264
|
return { BillingInterval };
|
|
5265
5265
|
})();
|
|
5266
|
-
var { DisplaySchema: a37_DisplaySchema } = ((
|
|
5267
|
-
const DisplaySchema =
|
|
5268
|
-
primary_text:
|
|
5266
|
+
var { DisplaySchema: a37_DisplaySchema } = ((z100) => {
|
|
5267
|
+
const DisplaySchema = z100.object({
|
|
5268
|
+
primary_text: z100.string().meta({
|
|
5269
5269
|
description: "Main display text (e.g. '$10' or '100 messages')."
|
|
5270
5270
|
}),
|
|
5271
|
-
secondary_text:
|
|
5271
|
+
secondary_text: z100.string().optional().meta({
|
|
5272
5272
|
description: "Secondary display text (e.g. 'per month' or 'then $0.5 per 100')."
|
|
5273
5273
|
})
|
|
5274
5274
|
});
|
|
@@ -5456,8 +5456,8 @@ var { DUPLICATE_CURRENCY_MESSAGE: a49_DUPLICATE_CURRENCY_MESSAGE } = /* @__PURE_
|
|
|
5456
5456
|
const DUPLICATE_CURRENCY_MESSAGE = "Each currency may appear at most once in additional_currencies.";
|
|
5457
5457
|
return { DUPLICATE_CURRENCY_MESSAGE };
|
|
5458
5458
|
})();
|
|
5459
|
-
var { IncludedUsageParamsSchema: a52_IncludedUsageParamsSchema } = ((
|
|
5460
|
-
const IncludedUsageParamsSchema =
|
|
5459
|
+
var { IncludedUsageParamsSchema: a52_IncludedUsageParamsSchema } = ((z100) => {
|
|
5460
|
+
const IncludedUsageParamsSchema = z100.number().max(1e13, {
|
|
5461
5461
|
error: "Included usage cannot exceed 10 trillion; use unlimited usage instead"
|
|
5462
5462
|
});
|
|
5463
5463
|
return { IncludedUsageParamsSchema };
|
|
@@ -5545,21 +5545,21 @@ var {
|
|
|
5545
5545
|
const USAGE_ATTRIBUTION_DIMENSION_SEPARATOR = "::";
|
|
5546
5546
|
return { USAGE_ATTRIBUTION_DIMENSION_SEPARATOR };
|
|
5547
5547
|
})();
|
|
5548
|
-
var { CreditMatchSchema: a78_CreditMatchSchema } = ((
|
|
5549
|
-
const CreditMatchSchema =
|
|
5550
|
-
|
|
5548
|
+
var { CreditMatchSchema: a78_CreditMatchSchema } = ((z100) => {
|
|
5549
|
+
const CreditMatchSchema = z100.record(
|
|
5550
|
+
z100.string(),
|
|
5551
5551
|
// `.pipe(z.string())` gives the OpenAPI exporter a plain output schema; a bare
|
|
5552
5552
|
// transform is rejected when this record appears in response bodies.
|
|
5553
|
-
|
|
5553
|
+
z100.union([z100.string(), z100.number(), z100.boolean()]).transform(String).pipe(z100.string())
|
|
5554
5554
|
);
|
|
5555
5555
|
return { CreditMatchSchema };
|
|
5556
5556
|
})(external0);
|
|
5557
|
-
var { ApiCreditTierSchema: a79_ApiCreditTierSchema } = ((
|
|
5558
|
-
const ApiCreditTierSchema =
|
|
5559
|
-
to:
|
|
5557
|
+
var { ApiCreditTierSchema: a79_ApiCreditTierSchema } = ((z100) => {
|
|
5558
|
+
const ApiCreditTierSchema = z100.object({
|
|
5559
|
+
to: z100.union([z100.number().positive(), z100.enum(["inf"])]).meta({
|
|
5560
5560
|
description: "Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'."
|
|
5561
5561
|
}),
|
|
5562
|
-
credit_cost:
|
|
5562
|
+
credit_cost: z100.number().min(0).meta({
|
|
5563
5563
|
description: "Credits consumed per billing-unit group within this tier."
|
|
5564
5564
|
})
|
|
5565
5565
|
});
|
|
@@ -5573,25 +5573,25 @@ var { VIOLATION_MESSAGES: a82_VIOLATION_MESSAGES } = /* @__PURE__ */ (() => {
|
|
|
5573
5573
|
};
|
|
5574
5574
|
return { VIOLATION_MESSAGES };
|
|
5575
5575
|
})();
|
|
5576
|
-
var { MarkupEntrySchema: a87_MarkupEntrySchema } = ((
|
|
5577
|
-
const MarkupEntrySchema =
|
|
5578
|
-
markup:
|
|
5576
|
+
var { MarkupEntrySchema: a87_MarkupEntrySchema } = ((z100) => {
|
|
5577
|
+
const MarkupEntrySchema = z100.object({
|
|
5578
|
+
markup: z100.number().min(-100)
|
|
5579
5579
|
// percentage markup, e.g. 20 for 20%, -100 for free
|
|
5580
5580
|
});
|
|
5581
5581
|
return { MarkupEntrySchema };
|
|
5582
5582
|
})(external0);
|
|
5583
|
-
var { ModelMarkupsSchema: a88_ModelMarkupsSchema } = ((
|
|
5584
|
-
const ModelMarkupsSchema =
|
|
5585
|
-
|
|
5583
|
+
var { ModelMarkupsSchema: a88_ModelMarkupsSchema } = ((z100, MarkupEntrySchema) => {
|
|
5584
|
+
const ModelMarkupsSchema = z100.record(
|
|
5585
|
+
z100.string().regex(
|
|
5586
5586
|
/.+\/.+/,
|
|
5587
5587
|
'Model keys are "<provider>/<model>", e.g. "openai/gpt-4o" or "custom/my-model".'
|
|
5588
5588
|
),
|
|
5589
5589
|
MarkupEntrySchema.extend({
|
|
5590
|
-
markup:
|
|
5590
|
+
markup: z100.number().min(-100).optional(),
|
|
5591
5591
|
// Omit to inherit provider/global markup
|
|
5592
|
-
input_cost:
|
|
5592
|
+
input_cost: z100.number().min(0).optional(),
|
|
5593
5593
|
// $/M tokens, required for custom/ models
|
|
5594
|
-
output_cost:
|
|
5594
|
+
output_cost: z100.number().min(0).optional()
|
|
5595
5595
|
// $/M tokens, required for custom/ models
|
|
5596
5596
|
})
|
|
5597
5597
|
).nullish();
|
|
@@ -5630,18 +5630,18 @@ var {
|
|
|
5630
5630
|
};
|
|
5631
5631
|
return { additionalCurrencyPlanItemIssues };
|
|
5632
5632
|
})();
|
|
5633
|
-
var { PlanItemFilterSchema: a91_PlanItemFilterSchema } = ((
|
|
5634
|
-
const PlanItemFilterSchema =
|
|
5635
|
-
feature_id:
|
|
5633
|
+
var { PlanItemFilterSchema: a91_PlanItemFilterSchema } = ((z100, BillingMethod, BillingInterval, ResetInterval, IncludedUsageParamsSchema) => {
|
|
5634
|
+
const PlanItemFilterSchema = z100.object({
|
|
5635
|
+
feature_id: z100.string().optional().meta({
|
|
5636
5636
|
description: "Match items linked to this feature."
|
|
5637
5637
|
}),
|
|
5638
|
-
billing_method:
|
|
5638
|
+
billing_method: z100.enum(BillingMethod).optional().meta({
|
|
5639
5639
|
description: "Match items with this billing method (prepaid or usage_based)."
|
|
5640
5640
|
}),
|
|
5641
|
-
interval:
|
|
5641
|
+
interval: z100.union([z100.enum(BillingInterval), z100.enum(ResetInterval)]).optional().meta({
|
|
5642
5642
|
description: "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."
|
|
5643
5643
|
}),
|
|
5644
|
-
interval_count:
|
|
5644
|
+
interval_count: z100.number().int().positive().optional().meta({
|
|
5645
5645
|
description: "Match items with this interval_count. Disambiguates between items that share an interval but differ in count."
|
|
5646
5646
|
}),
|
|
5647
5647
|
included: IncludedUsageParamsSchema.optional().meta({
|
|
@@ -5662,15 +5662,15 @@ var { PlanItemFilterSchema: a91_PlanItemFilterSchema } = ((z99, BillingMethod, B
|
|
|
5662
5662
|
a13_ResetInterval,
|
|
5663
5663
|
a52_IncludedUsageParamsSchema
|
|
5664
5664
|
);
|
|
5665
|
-
var { UpdatePlanItemParamsV1Schema: a92_UpdatePlanItemParamsV1Schema } = ((
|
|
5666
|
-
const UpdatePlanItemParamsV1Schema =
|
|
5665
|
+
var { UpdatePlanItemParamsV1Schema: a92_UpdatePlanItemParamsV1Schema } = ((z100, PlanItemFilterSchema, ResetInterval) => {
|
|
5666
|
+
const UpdatePlanItemParamsV1Schema = z100.object({
|
|
5667
5667
|
filter: PlanItemFilterSchema.meta({
|
|
5668
5668
|
description: "Filter selecting which existing plan item(s) to update. Same shape as remove_items filters."
|
|
5669
5669
|
}),
|
|
5670
|
-
included:
|
|
5670
|
+
included: z100.number().nonnegative().optional().meta({
|
|
5671
5671
|
description: "Override the matched item's included usage / allowance. Existing usage carries forward."
|
|
5672
5672
|
}),
|
|
5673
|
-
interval:
|
|
5673
|
+
interval: z100.enum(ResetInterval).optional().meta({
|
|
5674
5674
|
description: "Override the matched item's reset interval. Use 'one_off' for non-resetting balances."
|
|
5675
5675
|
})
|
|
5676
5676
|
}).meta({
|
|
@@ -5689,9 +5689,9 @@ var { FreeTrialDuration: a94_FreeTrialDuration } = (() => {
|
|
|
5689
5689
|
})(FreeTrialDuration || (FreeTrialDuration = {}));
|
|
5690
5690
|
return { FreeTrialDuration };
|
|
5691
5691
|
})();
|
|
5692
|
-
var { laneParam: a96_laneParam } = /* @__PURE__ */ ((withSpecDefault,
|
|
5692
|
+
var { laneParam: a96_laneParam } = /* @__PURE__ */ ((withSpecDefault, z100) => {
|
|
5693
5693
|
const laneParam = ({ schema, description }) => withSpecDefault({
|
|
5694
|
-
schema:
|
|
5694
|
+
schema: z100.array(schema).optional(),
|
|
5695
5695
|
defaultValue: [],
|
|
5696
5696
|
description
|
|
5697
5697
|
});
|
|
@@ -5738,15 +5738,15 @@ var { usageAlertIdentity: a107_usageAlertIdentity } = /* @__PURE__ */ ((DEFAULT_
|
|
|
5738
5738
|
].join("|");
|
|
5739
5739
|
return { usageAlertIdentity };
|
|
5740
5740
|
})(a26_DEFAULT_USAGE_ALERT_BASIS, a106_usageLimitFilterKey);
|
|
5741
|
-
var { RemovePlanLicenseSchema: a110_RemovePlanLicenseSchema } = ((
|
|
5742
|
-
const RemovePlanLicenseSchema =
|
|
5743
|
-
license_plan_id:
|
|
5741
|
+
var { RemovePlanLicenseSchema: a110_RemovePlanLicenseSchema } = ((z100) => {
|
|
5742
|
+
const RemovePlanLicenseSchema = z100.object({
|
|
5743
|
+
license_plan_id: z100.string()
|
|
5744
5744
|
});
|
|
5745
5745
|
return { RemovePlanLicenseSchema };
|
|
5746
5746
|
})(external0);
|
|
5747
|
-
var { ApiStripePriceProcessorSchema: a113_ApiStripePriceProcessorSchema } = ((
|
|
5748
|
-
const ApiStripePriceProcessorSchema =
|
|
5749
|
-
price_id:
|
|
5747
|
+
var { ApiStripePriceProcessorSchema: a113_ApiStripePriceProcessorSchema } = ((z100) => {
|
|
5748
|
+
const ApiStripePriceProcessorSchema = z100.object({
|
|
5749
|
+
price_id: z100.string().meta({
|
|
5750
5750
|
description: "Stripe price ID. For prepaid with included > 0 this is the V2 price."
|
|
5751
5751
|
})
|
|
5752
5752
|
});
|
|
@@ -5764,26 +5764,26 @@ var { ApiFeatureType: a116_ApiFeatureType } = (() => {
|
|
|
5764
5764
|
})(ApiFeatureType || (ApiFeatureType = {}));
|
|
5765
5765
|
return { ApiFeatureType };
|
|
5766
5766
|
})();
|
|
5767
|
-
var { ApiStripePlanProcessorSchema: a118_ApiStripePlanProcessorSchema } = ((
|
|
5768
|
-
const ApiStripePlanProcessorSchema =
|
|
5769
|
-
product_id:
|
|
5767
|
+
var { ApiStripePlanProcessorSchema: a118_ApiStripePlanProcessorSchema } = ((z100) => {
|
|
5768
|
+
const ApiStripePlanProcessorSchema = z100.object({
|
|
5769
|
+
product_id: z100.string().meta({
|
|
5770
5770
|
description: "Stripe product ID this plan is billed under."
|
|
5771
5771
|
}),
|
|
5772
|
-
additional_product_ids:
|
|
5772
|
+
additional_product_ids: z100.array(z100.string()).optional().meta({
|
|
5773
5773
|
description: "Extra Stripe product IDs aliased to this plan."
|
|
5774
5774
|
})
|
|
5775
5775
|
});
|
|
5776
5776
|
return { ApiStripePlanProcessorSchema };
|
|
5777
5777
|
})(external0);
|
|
5778
|
-
var { ApiRevenueCatProductSchema: a120_ApiRevenueCatProductSchema } = ((
|
|
5779
|
-
const ApiRevenueCatProductSchema =
|
|
5780
|
-
product_id:
|
|
5778
|
+
var { ApiRevenueCatProductSchema: a120_ApiRevenueCatProductSchema } = ((z100) => {
|
|
5779
|
+
const ApiRevenueCatProductSchema = z100.object({
|
|
5780
|
+
product_id: z100.string().meta({
|
|
5781
5781
|
description: "RevenueCat product ID that grants this plan when purchased."
|
|
5782
5782
|
}),
|
|
5783
|
-
feature_quantities:
|
|
5784
|
-
|
|
5785
|
-
feature_id:
|
|
5786
|
-
quantity:
|
|
5783
|
+
feature_quantities: z100.array(
|
|
5784
|
+
z100.object({
|
|
5785
|
+
feature_id: z100.string(),
|
|
5786
|
+
quantity: z100.number().nonnegative().optional()
|
|
5787
5787
|
})
|
|
5788
5788
|
).optional().meta({
|
|
5789
5789
|
description: "Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units."
|
|
@@ -5830,12 +5830,12 @@ var { AttachScenario: a127_AttachScenario } = (() => {
|
|
|
5830
5830
|
})(AttachScenario || (AttachScenario = {}));
|
|
5831
5831
|
return { AttachScenario };
|
|
5832
5832
|
})();
|
|
5833
|
-
var { UsageWindowDimensionSchema: a130_UsageWindowDimensionSchema } = ((
|
|
5834
|
-
const UsageWindowDimensionSchema =
|
|
5833
|
+
var { UsageWindowDimensionSchema: a130_UsageWindowDimensionSchema } = ((z100) => {
|
|
5834
|
+
const UsageWindowDimensionSchema = z100.enum(["balance", "metered_feature"]);
|
|
5835
5835
|
return { UsageWindowDimensionSchema };
|
|
5836
5836
|
})(external0);
|
|
5837
|
-
var { UsageWindowScopeSchema: a131_UsageWindowScopeSchema } = ((
|
|
5838
|
-
const UsageWindowScopeSchema =
|
|
5837
|
+
var { UsageWindowScopeSchema: a131_UsageWindowScopeSchema } = ((z100) => {
|
|
5838
|
+
const UsageWindowScopeSchema = z100.enum(["customer", "entity"]);
|
|
5839
5839
|
return { UsageWindowScopeSchema };
|
|
5840
5840
|
})(external0);
|
|
5841
5841
|
var { EntInterval: a132_EntInterval } = (() => {
|
|
@@ -5863,24 +5863,24 @@ var { FeatureType: a134_FeatureType } = (() => {
|
|
|
5863
5863
|
})(FeatureType || (FeatureType = {}));
|
|
5864
5864
|
return { FeatureType };
|
|
5865
5865
|
})();
|
|
5866
|
-
var { FeatureStripeMeterSchema: a135_FeatureStripeMeterSchema } = ((
|
|
5867
|
-
const FeatureStripeMeterSchema =
|
|
5868
|
-
id:
|
|
5869
|
-
event_name:
|
|
5866
|
+
var { FeatureStripeMeterSchema: a135_FeatureStripeMeterSchema } = ((z100) => {
|
|
5867
|
+
const FeatureStripeMeterSchema = z100.object({
|
|
5868
|
+
id: z100.string(),
|
|
5869
|
+
event_name: z100.string()
|
|
5870
5870
|
});
|
|
5871
5871
|
return { FeatureStripeMeterSchema };
|
|
5872
5872
|
})(external0);
|
|
5873
|
-
var { FreeTrialSchema: a136_FreeTrialSchema } = ((
|
|
5874
|
-
const FreeTrialSchema =
|
|
5875
|
-
id:
|
|
5876
|
-
duration:
|
|
5877
|
-
length:
|
|
5878
|
-
unique_fingerprint:
|
|
5879
|
-
created_at:
|
|
5880
|
-
internal_product_id:
|
|
5881
|
-
is_custom:
|
|
5882
|
-
card_required:
|
|
5883
|
-
on_end:
|
|
5873
|
+
var { FreeTrialSchema: a136_FreeTrialSchema } = ((z100, FreeTrialDuration, TrialOnEnd) => {
|
|
5874
|
+
const FreeTrialSchema = z100.object({
|
|
5875
|
+
id: z100.string(),
|
|
5876
|
+
duration: z100.enum(FreeTrialDuration),
|
|
5877
|
+
length: z100.number(),
|
|
5878
|
+
unique_fingerprint: z100.boolean(),
|
|
5879
|
+
created_at: z100.number(),
|
|
5880
|
+
internal_product_id: z100.string(),
|
|
5881
|
+
is_custom: z100.boolean(),
|
|
5882
|
+
card_required: z100.boolean(),
|
|
5883
|
+
on_end: z100.enum(TrialOnEnd).nullish()
|
|
5884
5884
|
});
|
|
5885
5885
|
return { FreeTrialSchema };
|
|
5886
5886
|
})(external0, a94_FreeTrialDuration, a122_TrialOnEnd);
|
|
@@ -5896,11 +5896,11 @@ var { BillingType: a139_BillingType } = (() => {
|
|
|
5896
5896
|
})(BillingType || (BillingType = {}));
|
|
5897
5897
|
return { BillingType };
|
|
5898
5898
|
})();
|
|
5899
|
-
var { UsageTierSchema: a142_UsageTierSchema } = ((
|
|
5900
|
-
const UsageTierSchema =
|
|
5901
|
-
to:
|
|
5902
|
-
amount:
|
|
5903
|
-
flat_amount:
|
|
5899
|
+
var { UsageTierSchema: a142_UsageTierSchema } = ((z100, Infinite) => {
|
|
5900
|
+
const UsageTierSchema = z100.object({
|
|
5901
|
+
to: z100.number().or(z100.literal(Infinite)),
|
|
5902
|
+
amount: z100.number().optional(),
|
|
5903
|
+
flat_amount: z100.number().optional()
|
|
5904
5904
|
}).refine(
|
|
5905
5905
|
(val) => val.amount !== void 0 || val.flat_amount !== void 0,
|
|
5906
5906
|
{
|
|
@@ -5911,20 +5911,20 @@ var { UsageTierSchema: a142_UsageTierSchema } = ((z99, Infinite) => {
|
|
|
5911
5911
|
...val,
|
|
5912
5912
|
amount: val.amount ?? 0
|
|
5913
5913
|
})).pipe(
|
|
5914
|
-
|
|
5915
|
-
to:
|
|
5916
|
-
amount:
|
|
5917
|
-
flat_amount:
|
|
5914
|
+
z100.object({
|
|
5915
|
+
to: z100.number().or(z100.literal(Infinite)),
|
|
5916
|
+
amount: z100.number(),
|
|
5917
|
+
flat_amount: z100.number().optional()
|
|
5918
5918
|
})
|
|
5919
5919
|
);
|
|
5920
5920
|
return { UsageTierSchema };
|
|
5921
5921
|
})(external0, a55_Infinite);
|
|
5922
5922
|
var {
|
|
5923
5923
|
IgnoredFixedPriceMetadataSchema: a143_IgnoredFixedPriceMetadataSchema
|
|
5924
|
-
} = ((
|
|
5925
|
-
const IgnoredFixedPriceMetadataSchema =
|
|
5924
|
+
} = ((z100) => {
|
|
5925
|
+
const IgnoredFixedPriceMetadataSchema = z100.preprocess(
|
|
5926
5926
|
(value) => typeof value === "string" ? null : value,
|
|
5927
|
-
|
|
5927
|
+
z100.null().or(z100.undefined())
|
|
5928
5928
|
);
|
|
5929
5929
|
return { IgnoredFixedPriceMetadataSchema };
|
|
5930
5930
|
})(external0);
|
|
@@ -5945,10 +5945,10 @@ var { AllocatedBillingBehavior: a146_AllocatedBillingBehavior } = (() => {
|
|
|
5945
5945
|
})(AllocatedBillingBehavior || (AllocatedBillingBehavior = {}));
|
|
5946
5946
|
return { AllocatedBillingBehavior };
|
|
5947
5947
|
})();
|
|
5948
|
-
var { ProrationConfigSchema: a147_ProrationConfigSchema } = ((
|
|
5949
|
-
const ProrationConfigSchema =
|
|
5950
|
-
on_increase:
|
|
5951
|
-
on_decrease:
|
|
5948
|
+
var { ProrationConfigSchema: a147_ProrationConfigSchema } = ((z100, OnIncrease, OnDecrease) => {
|
|
5949
|
+
const ProrationConfigSchema = z100.object({
|
|
5950
|
+
on_increase: z100.nativeEnum(OnIncrease).default(OnIncrease.ProrateImmediately),
|
|
5951
|
+
on_decrease: z100.nativeEnum(OnDecrease).default(OnDecrease.ProrateImmediately)
|
|
5952
5952
|
});
|
|
5953
5953
|
return { ProrationConfigSchema };
|
|
5954
5954
|
})(external0, a63_OnIncrease, a64_OnDecrease);
|
|
@@ -5961,42 +5961,42 @@ var { AllowanceType: a149_AllowanceType } = (() => {
|
|
|
5961
5961
|
})(AllowanceType || (AllowanceType = {}));
|
|
5962
5962
|
return { AllowanceType };
|
|
5963
5963
|
})();
|
|
5964
|
-
var { RolloverConfigSchema: a150_RolloverConfigSchema } = ((
|
|
5965
|
-
const RolloverConfigSchema =
|
|
5966
|
-
max:
|
|
5967
|
-
max_percentage:
|
|
5968
|
-
duration:
|
|
5969
|
-
length:
|
|
5964
|
+
var { RolloverConfigSchema: a150_RolloverConfigSchema } = ((z100, RolloverExpiryDurationType) => {
|
|
5965
|
+
const RolloverConfigSchema = z100.object({
|
|
5966
|
+
max: z100.number().nullable().optional(),
|
|
5967
|
+
max_percentage: z100.number().nullable().optional(),
|
|
5968
|
+
duration: z100.enum(RolloverExpiryDurationType).default(RolloverExpiryDurationType.Month),
|
|
5969
|
+
length: z100.number()
|
|
5970
5970
|
});
|
|
5971
5971
|
return { RolloverConfigSchema };
|
|
5972
5972
|
})(external0, a65_RolloverExpiryDurationType);
|
|
5973
|
-
var { CreditDimensionBaseSchema: a156_CreditDimensionBaseSchema } = ((
|
|
5974
|
-
const CreditDimensionBaseSchema =
|
|
5973
|
+
var { CreditDimensionBaseSchema: a156_CreditDimensionBaseSchema } = ((z100, CreditMatchSchema) => {
|
|
5974
|
+
const CreditDimensionBaseSchema = z100.object({
|
|
5975
5975
|
match: CreditMatchSchema,
|
|
5976
|
-
priority:
|
|
5976
|
+
priority: z100.number().int().optional()
|
|
5977
5977
|
});
|
|
5978
5978
|
return { CreditDimensionBaseSchema };
|
|
5979
5979
|
})(external0, a78_CreditMatchSchema);
|
|
5980
|
-
var { flatCreditRateShape: a157_flatCreditRateShape } = ((
|
|
5980
|
+
var { flatCreditRateShape: a157_flatCreditRateShape } = ((z100) => {
|
|
5981
5981
|
const flatCreditRateShape = {
|
|
5982
|
-
credit_amount:
|
|
5983
|
-
tier_behavior:
|
|
5984
|
-
tiers:
|
|
5982
|
+
credit_amount: z100.number(),
|
|
5983
|
+
tier_behavior: z100.never().optional(),
|
|
5984
|
+
tiers: z100.never().optional()
|
|
5985
5985
|
};
|
|
5986
5986
|
return { flatCreditRateShape };
|
|
5987
5987
|
})(external0);
|
|
5988
|
-
var { CreditTierSchema: a159_CreditTierSchema } = ((
|
|
5989
|
-
const CreditTierSchema =
|
|
5990
|
-
to:
|
|
5991
|
-
credit_amount:
|
|
5988
|
+
var { CreditTierSchema: a159_CreditTierSchema } = ((z100) => {
|
|
5989
|
+
const CreditTierSchema = z100.object({
|
|
5990
|
+
to: z100.union([z100.number(), z100.literal("inf")]),
|
|
5991
|
+
credit_amount: z100.number()
|
|
5992
5992
|
});
|
|
5993
5993
|
return { CreditTierSchema };
|
|
5994
5994
|
})(external0);
|
|
5995
|
-
var { CreditMultiplierSchema: a160_CreditMultiplierSchema } = ((
|
|
5996
|
-
const CreditMultiplierSchema =
|
|
5995
|
+
var { CreditMultiplierSchema: a160_CreditMultiplierSchema } = ((z100, CreditMatchSchema) => {
|
|
5996
|
+
const CreditMultiplierSchema = z100.object({
|
|
5997
5997
|
match: CreditMatchSchema,
|
|
5998
|
-
factor:
|
|
5999
|
-
add:
|
|
5998
|
+
factor: z100.number().positive().optional(),
|
|
5999
|
+
add: z100.number().optional()
|
|
6000
6000
|
}).refine(
|
|
6001
6001
|
(multiplier) => multiplier.factor !== void 0 || multiplier.add !== void 0,
|
|
6002
6002
|
{
|
|
@@ -6070,22 +6070,22 @@ var { TierInfinite: a173_TierInfinite } = /* @__PURE__ */ (() => {
|
|
|
6070
6070
|
const TierInfinite = "inf";
|
|
6071
6071
|
return { TierInfinite };
|
|
6072
6072
|
})();
|
|
6073
|
-
var { CreateFreeTrialSchema: a176_CreateFreeTrialSchema } = ((
|
|
6074
|
-
const CreateFreeTrialSchema =
|
|
6075
|
-
length:
|
|
6073
|
+
var { CreateFreeTrialSchema: a176_CreateFreeTrialSchema } = ((z100, FreeTrialDuration, TrialOnEnd) => {
|
|
6074
|
+
const CreateFreeTrialSchema = z100.object({
|
|
6075
|
+
length: z100.string().or(z100.number()).transform((val) => Number(val)).refine((val) => val > 0, {
|
|
6076
6076
|
message: "Free trial length must be greater than 0"
|
|
6077
6077
|
}),
|
|
6078
|
-
unique_fingerprint:
|
|
6079
|
-
duration:
|
|
6080
|
-
card_required:
|
|
6081
|
-
on_end:
|
|
6078
|
+
unique_fingerprint: z100.boolean().default(false),
|
|
6079
|
+
duration: z100.enum(FreeTrialDuration).default(FreeTrialDuration.Day),
|
|
6080
|
+
card_required: z100.boolean().default(true),
|
|
6081
|
+
on_end: z100.enum(TrialOnEnd).nullish()
|
|
6082
6082
|
});
|
|
6083
6083
|
return { CreateFreeTrialSchema };
|
|
6084
6084
|
})(external0, a94_FreeTrialDuration, a122_TrialOnEnd);
|
|
6085
|
-
var { ProductConfigParamsSchema: a177_ProductConfigParamsSchema } = ((
|
|
6086
|
-
const ProductConfigParamsSchema =
|
|
6085
|
+
var { ProductConfigParamsSchema: a177_ProductConfigParamsSchema } = ((z100, withSpecDefault, IGNORE_PAST_DUE_DESCRIPTION) => {
|
|
6086
|
+
const ProductConfigParamsSchema = z100.object({
|
|
6087
6087
|
ignore_past_due: withSpecDefault({
|
|
6088
|
-
schema:
|
|
6088
|
+
schema: z100.boolean().optional(),
|
|
6089
6089
|
defaultValue: false,
|
|
6090
6090
|
description: IGNORE_PAST_DUE_DESCRIPTION
|
|
6091
6091
|
})
|
|
@@ -6122,38 +6122,38 @@ var { CREATE_PRODUCT_EXAMPLE: a178_CREATE_PRODUCT_EXAMPLE } = /* @__PURE__ */ ((
|
|
|
6122
6122
|
};
|
|
6123
6123
|
return { CREATE_PRODUCT_EXAMPLE };
|
|
6124
6124
|
})();
|
|
6125
|
-
var { ApiFreeTrialSchema: a181_ApiFreeTrialSchema } = ((
|
|
6126
|
-
const ApiFreeTrialSchema =
|
|
6127
|
-
duration:
|
|
6125
|
+
var { ApiFreeTrialSchema: a181_ApiFreeTrialSchema } = ((z100, FreeTrialDuration, TrialOnEnd) => {
|
|
6126
|
+
const ApiFreeTrialSchema = z100.object({
|
|
6127
|
+
duration: z100.enum(FreeTrialDuration).meta({
|
|
6128
6128
|
description: "The duration type of the free trial"
|
|
6129
6129
|
}),
|
|
6130
|
-
length:
|
|
6130
|
+
length: z100.number().meta({
|
|
6131
6131
|
description: "The length of the duration type specified"
|
|
6132
6132
|
}),
|
|
6133
|
-
unique_fingerprint:
|
|
6133
|
+
unique_fingerprint: z100.boolean().meta({
|
|
6134
6134
|
description: "Whether the free trial is limited to one per customer fingerprint"
|
|
6135
6135
|
}),
|
|
6136
|
-
card_required:
|
|
6136
|
+
card_required: z100.boolean().meta({
|
|
6137
6137
|
description: "Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file."
|
|
6138
6138
|
}),
|
|
6139
|
-
on_end:
|
|
6139
|
+
on_end: z100.enum(TrialOnEnd).nullish().meta({
|
|
6140
6140
|
description: "Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan."
|
|
6141
6141
|
}),
|
|
6142
6142
|
// For Cus Product
|
|
6143
|
-
trial_available:
|
|
6143
|
+
trial_available: z100.boolean().default(true).nullish().meta({
|
|
6144
6144
|
description: "Used in customer context. Whether the free trial is available for the customer if they were to attach the product."
|
|
6145
6145
|
})
|
|
6146
6146
|
});
|
|
6147
6147
|
return { ApiFreeTrialSchema };
|
|
6148
6148
|
})(external0, a94_FreeTrialDuration, a122_TrialOnEnd);
|
|
6149
|
-
var { CreateProductSchema: a182_CreateProductSchema } = ((
|
|
6150
|
-
const CreateProductSchema =
|
|
6151
|
-
id:
|
|
6152
|
-
name:
|
|
6153
|
-
is_add_on:
|
|
6154
|
-
is_default:
|
|
6155
|
-
version:
|
|
6156
|
-
group:
|
|
6149
|
+
var { CreateProductSchema: a182_CreateProductSchema } = ((z100) => {
|
|
6150
|
+
const CreateProductSchema = z100.object({
|
|
6151
|
+
id: z100.string(),
|
|
6152
|
+
name: z100.string().min(1, "Product name cannot be empty").default("Untitled Product"),
|
|
6153
|
+
is_add_on: z100.boolean().default(false),
|
|
6154
|
+
is_default: z100.boolean().default(false),
|
|
6155
|
+
version: z100.number().optional().default(1),
|
|
6156
|
+
group: z100.string().optional().default("")
|
|
6157
6157
|
});
|
|
6158
6158
|
return { CreateProductSchema };
|
|
6159
6159
|
})(external0);
|
|
@@ -6161,14 +6161,14 @@ var { isUsageLimitBasisAlert: a187_isUsageLimitBasisAlert } = /* @__PURE__ */ ((
|
|
|
6161
6161
|
const isUsageLimitBasisAlert = (alert) => alert.basis === "usage_limit";
|
|
6162
6162
|
return { isUsageLimitBasisAlert };
|
|
6163
6163
|
})();
|
|
6164
|
-
var { PromoCodeSchema: a191_PromoCodeSchema } = ((
|
|
6165
|
-
const PromoCodeSchema =
|
|
6166
|
-
code:
|
|
6167
|
-
global_max_redemption:
|
|
6164
|
+
var { PromoCodeSchema: a191_PromoCodeSchema } = ((z100) => {
|
|
6165
|
+
const PromoCodeSchema = z100.object({
|
|
6166
|
+
code: z100.string(),
|
|
6167
|
+
global_max_redemption: z100.number().positive().optional(),
|
|
6168
6168
|
/** Only redeemable by customers with no prior successful payments or invoices */
|
|
6169
|
-
first_time_transaction:
|
|
6169
|
+
first_time_transaction: z100.boolean().optional(),
|
|
6170
6170
|
/** @deprecated Use global_max_redemption. */
|
|
6171
|
-
max_redemptions:
|
|
6171
|
+
max_redemptions: z100.number().positive().optional()
|
|
6172
6172
|
});
|
|
6173
6173
|
return { PromoCodeSchema };
|
|
6174
6174
|
})(external0);
|
|
@@ -6192,10 +6192,10 @@ var { CouponDurationType: a194_CouponDurationType } = (() => {
|
|
|
6192
6192
|
})(CouponDurationType || (CouponDurationType = {}));
|
|
6193
6193
|
return { CouponDurationType };
|
|
6194
6194
|
})();
|
|
6195
|
-
var { FreeProductConfigSchema: a195_FreeProductConfigSchema } = ((
|
|
6196
|
-
const FreeProductConfigSchema =
|
|
6197
|
-
duration_type:
|
|
6198
|
-
duration_value:
|
|
6195
|
+
var { FreeProductConfigSchema: a195_FreeProductConfigSchema } = ((z100, CouponDurationType) => {
|
|
6196
|
+
const FreeProductConfigSchema = z100.object({
|
|
6197
|
+
duration_type: z100.nativeEnum(CouponDurationType),
|
|
6198
|
+
duration_value: z100.number()
|
|
6199
6199
|
});
|
|
6200
6200
|
return { FreeProductConfigSchema };
|
|
6201
6201
|
})(external0, a194_CouponDurationType);
|
|
@@ -6215,33 +6215,33 @@ var { RewardReceivedBy: a200_RewardReceivedBy } = (() => {
|
|
|
6215
6215
|
})(RewardReceivedBy || (RewardReceivedBy = {}));
|
|
6216
6216
|
return { RewardReceivedBy };
|
|
6217
6217
|
})();
|
|
6218
|
-
var { ProductConfigSchema: a2_ProductConfigSchema } = ((
|
|
6219
|
-
const ProductConfigSchema =
|
|
6220
|
-
ignore_past_due:
|
|
6218
|
+
var { ProductConfigSchema: a2_ProductConfigSchema } = ((z100, IGNORE_PAST_DUE_DESCRIPTION) => {
|
|
6219
|
+
const ProductConfigSchema = z100.object({
|
|
6220
|
+
ignore_past_due: z100.boolean().default(false).meta({
|
|
6221
6221
|
description: IGNORE_PAST_DUE_DESCRIPTION
|
|
6222
6222
|
})
|
|
6223
6223
|
});
|
|
6224
6224
|
return { ProductConfigSchema };
|
|
6225
6225
|
})(external0, a3_IGNORE_PAST_DUE_DESCRIPTION);
|
|
6226
|
-
var { PurchaseLimitIntervalEnum: a7_PurchaseLimitIntervalEnum } = ((
|
|
6227
|
-
const PurchaseLimitIntervalEnum =
|
|
6226
|
+
var { PurchaseLimitIntervalEnum: a7_PurchaseLimitIntervalEnum } = ((z100, PurchaseLimitInterval) => {
|
|
6227
|
+
const PurchaseLimitIntervalEnum = z100.enum(PurchaseLimitInterval);
|
|
6228
6228
|
return { PurchaseLimitIntervalEnum };
|
|
6229
6229
|
})(external0, a8_PurchaseLimitInterval);
|
|
6230
|
-
var { DbSpendLimitSchema: a9_DbSpendLimitSchema } = ((
|
|
6231
|
-
const DbSpendLimitSchema =
|
|
6232
|
-
feature_id:
|
|
6230
|
+
var { DbSpendLimitSchema: a9_DbSpendLimitSchema } = ((z100, SpendLimitType) => {
|
|
6231
|
+
const DbSpendLimitSchema = z100.object({
|
|
6232
|
+
feature_id: z100.string().optional().meta({
|
|
6233
6233
|
description: "Optional feature ID this spend limit applies to."
|
|
6234
6234
|
}),
|
|
6235
|
-
enabled:
|
|
6235
|
+
enabled: z100.boolean().default(false).meta({
|
|
6236
6236
|
description: "Whether the overage spend limit is enabled."
|
|
6237
6237
|
}),
|
|
6238
6238
|
limit_type: SpendLimitType.optional().meta({
|
|
6239
6239
|
description: "How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance."
|
|
6240
6240
|
}),
|
|
6241
|
-
overage_limit:
|
|
6241
|
+
overage_limit: z100.number().min(0).optional().meta({
|
|
6242
6242
|
description: "Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage."
|
|
6243
6243
|
}),
|
|
6244
|
-
skip_overage_billing:
|
|
6244
|
+
skip_overage_billing: z100.boolean().optional().meta({
|
|
6245
6245
|
description: "When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally."
|
|
6246
6246
|
})
|
|
6247
6247
|
}).refine(
|
|
@@ -6262,16 +6262,16 @@ var { USAGE_LIMIT_INTERVALS: a12_USAGE_LIMIT_INTERVALS } = ((ResetInterval) => {
|
|
|
6262
6262
|
];
|
|
6263
6263
|
return { USAGE_LIMIT_INTERVALS };
|
|
6264
6264
|
})(a13_ResetInterval);
|
|
6265
|
-
var { UsageLimitAnchorSchema: a14_UsageLimitAnchorSchema } = ((
|
|
6266
|
-
const UsageLimitAnchorSchema =
|
|
6265
|
+
var { UsageLimitAnchorSchema: a14_UsageLimitAnchorSchema } = ((z100, USAGE_LIMIT_ANCHORS) => {
|
|
6266
|
+
const UsageLimitAnchorSchema = z100.enum(USAGE_LIMIT_ANCHORS);
|
|
6267
6267
|
return { UsageLimitAnchorSchema };
|
|
6268
6268
|
})(external0, a15_USAGE_LIMIT_ANCHORS);
|
|
6269
|
-
var { UsageLimitFilterValueSchema: a18_UsageLimitFilterValueSchema } = ((
|
|
6270
|
-
const UsageLimitFilterValueSchema =
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
]).transform(String).pipe(
|
|
6269
|
+
var { UsageLimitFilterValueSchema: a18_UsageLimitFilterValueSchema } = ((z100, USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH) => {
|
|
6270
|
+
const UsageLimitFilterValueSchema = z100.union([
|
|
6271
|
+
z100.string().min(1).max(USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH),
|
|
6272
|
+
z100.number(),
|
|
6273
|
+
z100.boolean()
|
|
6274
|
+
]).transform(String).pipe(z100.string());
|
|
6275
6275
|
return { UsageLimitFilterValueSchema };
|
|
6276
6276
|
})(external0, a19_USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH);
|
|
6277
6277
|
var { USAGE_ALERT_BASES: a24_USAGE_ALERT_BASES } = ((BALANCE_BASES) => {
|
|
@@ -6293,15 +6293,15 @@ var { licensePatchIssues: a31_licensePatchIssues } = /* @__PURE__ */ ((findDupli
|
|
|
6293
6293
|
};
|
|
6294
6294
|
return { licensePatchIssues };
|
|
6295
6295
|
})(a32_findDuplicate);
|
|
6296
|
-
var { BasePriceSchema: a35_BasePriceSchema } = ((
|
|
6297
|
-
const BasePriceSchema =
|
|
6298
|
-
amount:
|
|
6296
|
+
var { BasePriceSchema: a35_BasePriceSchema } = ((z100, BillingInterval, DisplaySchema) => {
|
|
6297
|
+
const BasePriceSchema = z100.object({
|
|
6298
|
+
amount: z100.number().meta({
|
|
6299
6299
|
description: "Base price amount for the plan, in major currency units (e.g. dollars)."
|
|
6300
6300
|
}),
|
|
6301
|
-
interval:
|
|
6301
|
+
interval: z100.enum(BillingInterval).meta({
|
|
6302
6302
|
description: "Billing interval (e.g. 'month', 'year')."
|
|
6303
6303
|
}),
|
|
6304
|
-
interval_count:
|
|
6304
|
+
interval_count: z100.number().optional().meta({
|
|
6305
6305
|
description: "Number of intervals per billing cycle. Defaults to 1."
|
|
6306
6306
|
}),
|
|
6307
6307
|
display: DisplaySchema.optional().meta({
|
|
@@ -6317,22 +6317,22 @@ var { CURRENCY_CODES: a44_CURRENCY_CODES } = ((COMMON, STRIPE_PRESENTMENT_CURREN
|
|
|
6317
6317
|
];
|
|
6318
6318
|
return { CURRENCY_CODES };
|
|
6319
6319
|
})(a45_COMMON, a46_STRIPE_PRESENTMENT_CURRENCIES, a47_COMMON_SET);
|
|
6320
|
-
var { AllocatedBillingFieldSchema: a60_AllocatedBillingFieldSchema } = ((
|
|
6321
|
-
const AllocatedBillingFieldSchema =
|
|
6320
|
+
var { AllocatedBillingFieldSchema: a60_AllocatedBillingFieldSchema } = ((z100, AllocatedBilling) => {
|
|
6321
|
+
const AllocatedBillingFieldSchema = z100.enum(AllocatedBilling).optional().meta({
|
|
6322
6322
|
internal: true,
|
|
6323
6323
|
description: "How an allocated usage_based price bills mid-cycle quantity changes. 'arrear' (default) bills at period end. 'prorated_legacy' is only returned for prices still on the legacy immediate-proration behavior; omit it to migrate the price to 'arrear'."
|
|
6324
6324
|
});
|
|
6325
6325
|
return { AllocatedBillingFieldSchema };
|
|
6326
6326
|
})(external0, a61_AllocatedBilling);
|
|
6327
|
-
var { EntitlementExpirySchema: a66_EntitlementExpirySchema } = ((
|
|
6328
|
-
const EntitlementExpirySchema =
|
|
6329
|
-
duration:
|
|
6330
|
-
length:
|
|
6327
|
+
var { EntitlementExpirySchema: a66_EntitlementExpirySchema } = ((z100, EntitlementDuration) => {
|
|
6328
|
+
const EntitlementExpirySchema = z100.object({
|
|
6329
|
+
duration: z100.enum(EntitlementDuration),
|
|
6330
|
+
length: z100.number()
|
|
6331
6331
|
});
|
|
6332
6332
|
return { EntitlementExpirySchema };
|
|
6333
6333
|
})(external0, a67_EntitlementDuration);
|
|
6334
|
-
var { CreditDimensionNameSchema: a72_CreditDimensionNameSchema } = ((
|
|
6335
|
-
const CreditDimensionNameSchema =
|
|
6334
|
+
var { CreditDimensionNameSchema: a72_CreditDimensionNameSchema } = ((z100, CREDIT_DIMENSION_NAME_MAX_LENGTH, USAGE_ATTRIBUTION_DIMENSION_SEPARATOR) => {
|
|
6335
|
+
const CreditDimensionNameSchema = z100.string().min(1).max(CREDIT_DIMENSION_NAME_MAX_LENGTH).refine((name2) => !name2.includes(USAGE_ATTRIBUTION_DIMENSION_SEPARATOR), {
|
|
6336
6336
|
message: `Dimension names cannot contain "${USAGE_ATTRIBUTION_DIMENSION_SEPARATOR}"`
|
|
6337
6337
|
});
|
|
6338
6338
|
return { CreditDimensionNameSchema };
|
|
@@ -6368,13 +6368,13 @@ var { findCreditTierViolations: a81_findCreditTierViolations } = /* @__PURE__ */
|
|
|
6368
6368
|
};
|
|
6369
6369
|
return { findCreditTierViolations };
|
|
6370
6370
|
})(a82_VIOLATION_MESSAGES);
|
|
6371
|
-
var { ApiCreditMultiplierSchema: a83_ApiCreditMultiplierSchema } = ((
|
|
6372
|
-
const ApiCreditMultiplierSchema =
|
|
6371
|
+
var { ApiCreditMultiplierSchema: a83_ApiCreditMultiplierSchema } = ((z100, ApiCreditMatchSchema) => {
|
|
6372
|
+
const ApiCreditMultiplierSchema = z100.object({
|
|
6373
6373
|
match: ApiCreditMatchSchema,
|
|
6374
|
-
factor:
|
|
6374
|
+
factor: z100.number().positive().optional().meta({
|
|
6375
6375
|
description: "Multiplies the matched rate. All matching multipliers stack."
|
|
6376
6376
|
}),
|
|
6377
|
-
add:
|
|
6377
|
+
add: z100.number().optional().meta({
|
|
6378
6378
|
description: "Added to the rate after every factor is applied, in credits per billing-unit group."
|
|
6379
6379
|
})
|
|
6380
6380
|
}).strict().refine(
|
|
@@ -6383,9 +6383,9 @@ var { ApiCreditMultiplierSchema: a83_ApiCreditMultiplierSchema } = ((z99, ApiCre
|
|
|
6383
6383
|
);
|
|
6384
6384
|
return { ApiCreditMultiplierSchema };
|
|
6385
6385
|
})(external0, a77_ApiCreditMatchSchema);
|
|
6386
|
-
var { ProviderMarkupsSchema: a86_ProviderMarkupsSchema } = ((
|
|
6387
|
-
const ProviderMarkupsSchema =
|
|
6388
|
-
|
|
6386
|
+
var { ProviderMarkupsSchema: a86_ProviderMarkupsSchema } = ((z100, MarkupEntrySchema) => {
|
|
6387
|
+
const ProviderMarkupsSchema = z100.record(
|
|
6388
|
+
z100.string(),
|
|
6389
6389
|
// Provider key from the model name, e.g. "openrouter" in "openrouter/anthropic/claude"
|
|
6390
6390
|
MarkupEntrySchema
|
|
6391
6391
|
).nullish();
|
|
@@ -6525,19 +6525,19 @@ var { planItemParamsIssues: a89_planItemParamsIssues } = /* @__PURE__ */ ((Billi
|
|
|
6525
6525
|
a58_TierBehavior,
|
|
6526
6526
|
a90_additionalCurrencyPlanItemIssues
|
|
6527
6527
|
);
|
|
6528
|
-
var { FreeTrialParamsV1Schema: a93_FreeTrialParamsV1Schema } = ((
|
|
6529
|
-
const FreeTrialParamsV1Schema =
|
|
6530
|
-
duration_length:
|
|
6528
|
+
var { FreeTrialParamsV1Schema: a93_FreeTrialParamsV1Schema } = ((z100, FreeTrialDuration, withSpecDefault) => {
|
|
6529
|
+
const FreeTrialParamsV1Schema = z100.object({
|
|
6530
|
+
duration_length: z100.number().meta({
|
|
6531
6531
|
description: "Number of duration_type periods the trial lasts."
|
|
6532
6532
|
}),
|
|
6533
|
-
duration_type:
|
|
6533
|
+
duration_type: z100.enum(FreeTrialDuration).default(FreeTrialDuration.Month).meta({
|
|
6534
6534
|
description: "Unit of time for the trial ('day', 'month', 'year')."
|
|
6535
6535
|
}),
|
|
6536
|
-
card_required:
|
|
6536
|
+
card_required: z100.boolean().default(false).meta({
|
|
6537
6537
|
description: "If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false."
|
|
6538
6538
|
}),
|
|
6539
6539
|
on_end: withSpecDefault({
|
|
6540
|
-
schema:
|
|
6540
|
+
schema: z100.enum(["bill", "revert"]).optional(),
|
|
6541
6541
|
defaultValue: "bill",
|
|
6542
6542
|
description: "Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan."
|
|
6543
6543
|
})
|
|
@@ -6559,47 +6559,47 @@ var { usageLimitIdentity: a105_usageLimitIdentity } = /* @__PURE__ */ ((usageLim
|
|
|
6559
6559
|
const usageLimitIdentity = (usageLimit) => `${usageLimit.feature_id}|${usageLimitFilterKey(usageLimit.filter)}`;
|
|
6560
6560
|
return { usageLimitIdentity };
|
|
6561
6561
|
})(a106_usageLimitFilterKey);
|
|
6562
|
-
var { ApiPriceProcessorsSchema: a112_ApiPriceProcessorsSchema } = ((
|
|
6563
|
-
const ApiPriceProcessorsSchema =
|
|
6562
|
+
var { ApiPriceProcessorsSchema: a112_ApiPriceProcessorsSchema } = ((z100, ApiStripePriceProcessorSchema) => {
|
|
6563
|
+
const ApiPriceProcessorsSchema = z100.object({
|
|
6564
6564
|
/** Omit to keep the current mapping; null unlinks it. */
|
|
6565
6565
|
stripe: ApiStripePriceProcessorSchema.nullish()
|
|
6566
6566
|
}).meta({ "x-atmn-mapping": true });
|
|
6567
6567
|
return { ApiPriceProcessorsSchema };
|
|
6568
6568
|
})(external0, a113_ApiStripePriceProcessorSchema);
|
|
6569
|
-
var { ApiFeatureV0Schema: a115_ApiFeatureV0Schema } = ((
|
|
6570
|
-
const ApiFeatureV0Schema =
|
|
6571
|
-
id:
|
|
6569
|
+
var { ApiFeatureV0Schema: a115_ApiFeatureV0Schema } = ((z100, ApiFeatureType) => {
|
|
6570
|
+
const ApiFeatureV0Schema = z100.object({
|
|
6571
|
+
id: z100.string().meta({
|
|
6572
6572
|
description: "The ID of the feature, used to refer to it in other API calls like /track or /check."
|
|
6573
6573
|
}),
|
|
6574
|
-
name:
|
|
6574
|
+
name: z100.string().nullish().meta({
|
|
6575
6575
|
description: "The name of the feature."
|
|
6576
6576
|
}),
|
|
6577
|
-
type:
|
|
6577
|
+
type: z100.enum(ApiFeatureType).meta({
|
|
6578
6578
|
description: "The type of the feature"
|
|
6579
6579
|
}),
|
|
6580
|
-
display:
|
|
6581
|
-
singular:
|
|
6580
|
+
display: z100.object({
|
|
6581
|
+
singular: z100.string().meta({
|
|
6582
6582
|
description: "The singular display name for the feature."
|
|
6583
6583
|
}),
|
|
6584
|
-
plural:
|
|
6584
|
+
plural: z100.string().meta({
|
|
6585
6585
|
description: "The plural display name for the feature."
|
|
6586
6586
|
})
|
|
6587
6587
|
}).nullish().meta({
|
|
6588
6588
|
description: "Singular and plural display names for the feature."
|
|
6589
6589
|
}),
|
|
6590
|
-
credit_schema:
|
|
6591
|
-
|
|
6592
|
-
metered_feature_id:
|
|
6590
|
+
credit_schema: z100.array(
|
|
6591
|
+
z100.object({
|
|
6592
|
+
metered_feature_id: z100.string().meta({
|
|
6593
6593
|
description: "The ID of the metered feature (should be a single_use feature)."
|
|
6594
6594
|
}),
|
|
6595
|
-
credit_cost:
|
|
6595
|
+
credit_cost: z100.number().meta({
|
|
6596
6596
|
description: "The credit cost of the metered feature."
|
|
6597
6597
|
})
|
|
6598
6598
|
})
|
|
6599
6599
|
).nullish().meta({
|
|
6600
6600
|
description: "Credit cost schema for credit system features."
|
|
6601
6601
|
}),
|
|
6602
|
-
archived:
|
|
6602
|
+
archived: z100.boolean().nullish().meta({
|
|
6603
6603
|
description: "Whether or not the feature is archived."
|
|
6604
6604
|
})
|
|
6605
6605
|
});
|
|
@@ -6607,87 +6607,87 @@ var { ApiFeatureV0Schema: a115_ApiFeatureV0Schema } = ((z99, ApiFeatureType) =>
|
|
|
6607
6607
|
})(external0, a116_ApiFeatureType);
|
|
6608
6608
|
var {
|
|
6609
6609
|
ApiRevenueCatPlanProcessorSchema: a119_ApiRevenueCatPlanProcessorSchema
|
|
6610
|
-
} = ((
|
|
6611
|
-
const ApiRevenueCatPlanProcessorSchema =
|
|
6612
|
-
products:
|
|
6610
|
+
} = ((z100, ApiRevenueCatProductSchema) => {
|
|
6611
|
+
const ApiRevenueCatPlanProcessorSchema = z100.object({
|
|
6612
|
+
products: z100.array(ApiRevenueCatProductSchema).meta({
|
|
6613
6613
|
description: "Every RevenueCat product that maps to this plan. Replaces the current set."
|
|
6614
6614
|
})
|
|
6615
6615
|
});
|
|
6616
6616
|
return { ApiRevenueCatPlanProcessorSchema };
|
|
6617
6617
|
})(external0, a120_ApiRevenueCatProductSchema);
|
|
6618
|
-
var { ApiFreeTrialV2Schema: a121_ApiFreeTrialV2Schema } = ((
|
|
6619
|
-
const ApiFreeTrialV2Schema =
|
|
6620
|
-
duration_length:
|
|
6618
|
+
var { ApiFreeTrialV2Schema: a121_ApiFreeTrialV2Schema } = ((z100, FreeTrialDuration, TrialOnEnd) => {
|
|
6619
|
+
const ApiFreeTrialV2Schema = z100.object({
|
|
6620
|
+
duration_length: z100.number().meta({
|
|
6621
6621
|
description: "Number of duration_type periods the trial lasts."
|
|
6622
6622
|
}),
|
|
6623
|
-
duration_type:
|
|
6623
|
+
duration_type: z100.enum(FreeTrialDuration).meta({
|
|
6624
6624
|
description: "Unit of time for the trial duration ('day', 'month', 'year')."
|
|
6625
6625
|
}),
|
|
6626
|
-
card_required:
|
|
6626
|
+
card_required: z100.boolean().meta({
|
|
6627
6627
|
description: "Whether a payment method is required to start the trial. If true, customer will be charged after trial ends."
|
|
6628
6628
|
}),
|
|
6629
|
-
on_end:
|
|
6629
|
+
on_end: z100.enum(TrialOnEnd).nullish().meta({
|
|
6630
6630
|
description: "Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan."
|
|
6631
6631
|
})
|
|
6632
6632
|
});
|
|
6633
6633
|
return { ApiFreeTrialV2Schema };
|
|
6634
6634
|
})(external0, a94_FreeTrialDuration, a122_TrialOnEnd);
|
|
6635
|
-
var { CustomerEligibilitySchema: a124_CustomerEligibilitySchema } = ((
|
|
6636
|
-
const CustomerEligibilitySchema =
|
|
6637
|
-
object:
|
|
6638
|
-
trial_available:
|
|
6635
|
+
var { CustomerEligibilitySchema: a124_CustomerEligibilitySchema } = ((z100, EligibilityStatus, AttachAction, AttachScenario) => {
|
|
6636
|
+
const CustomerEligibilitySchema = z100.object({
|
|
6637
|
+
object: z100.literal("customer_eligibility").optional().meta({ internal: true }),
|
|
6638
|
+
trial_available: z100.boolean().optional().meta({
|
|
6639
6639
|
description: "Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false."
|
|
6640
6640
|
}),
|
|
6641
|
-
status:
|
|
6641
|
+
status: z100.enum(EligibilityStatus).optional().meta({
|
|
6642
6642
|
description: "The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation."
|
|
6643
6643
|
}),
|
|
6644
|
-
canceling:
|
|
6644
|
+
canceling: z100.boolean().optional().meta({
|
|
6645
6645
|
description: "Whether the customer's active instance of this plan is set to cancel."
|
|
6646
6646
|
}),
|
|
6647
|
-
trialing:
|
|
6647
|
+
trialing: z100.boolean().optional().meta({
|
|
6648
6648
|
description: "Whether the customer is currently on a free trial of this plan."
|
|
6649
6649
|
}),
|
|
6650
|
-
attach_action:
|
|
6650
|
+
attach_action: z100.enum(AttachAction).meta({
|
|
6651
6651
|
description: "The action that would occur if this plan were attached to the customer."
|
|
6652
6652
|
}),
|
|
6653
|
-
scenario:
|
|
6653
|
+
scenario: z100.enum(AttachScenario).optional().meta({
|
|
6654
6654
|
description: "Legacy attach scenario. Internal use only.",
|
|
6655
6655
|
internal: true
|
|
6656
6656
|
})
|
|
6657
6657
|
});
|
|
6658
6658
|
return { CustomerEligibilitySchema };
|
|
6659
6659
|
})(external0, a125_EligibilityStatus, a126_AttachAction, a127_AttachScenario);
|
|
6660
|
-
var { UsageWindowLimitSchema: a129_UsageWindowLimitSchema } = ((
|
|
6661
|
-
const UsageWindowLimitSchema =
|
|
6662
|
-
feature_id:
|
|
6663
|
-
internal_feature_id:
|
|
6664
|
-
internal_customer_id:
|
|
6665
|
-
key:
|
|
6660
|
+
var { UsageWindowLimitSchema: a129_UsageWindowLimitSchema } = ((z100, UsageWindowDimensionSchema, UsageWindowScopeSchema, EntInterval, UsageLimitAnchorSchema) => {
|
|
6661
|
+
const UsageWindowLimitSchema = z100.object({
|
|
6662
|
+
feature_id: z100.string(),
|
|
6663
|
+
internal_feature_id: z100.string(),
|
|
6664
|
+
internal_customer_id: z100.string(),
|
|
6665
|
+
key: z100.string(),
|
|
6666
6666
|
dimension_type: UsageWindowDimensionSchema,
|
|
6667
|
-
dimension_feature_id:
|
|
6667
|
+
dimension_feature_id: z100.string().nullable(),
|
|
6668
6668
|
scope_type: UsageWindowScopeSchema,
|
|
6669
|
-
entity_id:
|
|
6670
|
-
internal_entity_id:
|
|
6669
|
+
entity_id: z100.string().nullable(),
|
|
6670
|
+
internal_entity_id: z100.string().nullable(),
|
|
6671
6671
|
// Canonical filter identity (sorted key=value pairs); null = unfiltered.
|
|
6672
6672
|
// Counter rows are matched on this, never on config-object hashes.
|
|
6673
|
-
filter_key:
|
|
6673
|
+
filter_key: z100.string().nullable(),
|
|
6674
6674
|
// Equality conditions the event's properties must satisfy for this limit to
|
|
6675
6675
|
// apply; evaluated TS-side, the deduction script never sees non-matching limits.
|
|
6676
|
-
filter_properties:
|
|
6677
|
-
interval:
|
|
6678
|
-
window_start_at:
|
|
6679
|
-
window_end_at:
|
|
6680
|
-
limit:
|
|
6676
|
+
filter_properties: z100.record(z100.string(), z100.string()).nullable(),
|
|
6677
|
+
interval: z100.enum(EntInterval),
|
|
6678
|
+
window_start_at: z100.number(),
|
|
6679
|
+
window_end_at: z100.number(),
|
|
6680
|
+
limit: z100.number(),
|
|
6681
6681
|
// Bounds/interval provenance: the entitlement whose reset interval and
|
|
6682
6682
|
// billing-cycle anchor shaped this window. Stamped onto the counter row at
|
|
6683
6683
|
// creation; storage no longer depends on it, so null just means calendar
|
|
6684
6684
|
// bounds with no provenance.
|
|
6685
|
-
anchor_customer_entitlement_id:
|
|
6685
|
+
anchor_customer_entitlement_id: z100.string().nullable(),
|
|
6686
6686
|
anchor_mode: UsageLimitAnchorSchema.default("billing_cycle"),
|
|
6687
6687
|
// Candidate row id (ksuid) minted server-side per request. Lua uses it ONLY
|
|
6688
6688
|
// when this request creates the counter row; lookups match the logical key
|
|
6689
6689
|
// (window_start_at + entity), never the id.
|
|
6690
|
-
new_window_id:
|
|
6690
|
+
new_window_id: z100.string().optional()
|
|
6691
6691
|
});
|
|
6692
6692
|
return { UsageWindowLimitSchema };
|
|
6693
6693
|
})(
|
|
@@ -6697,27 +6697,27 @@ var { UsageWindowLimitSchema: a129_UsageWindowLimitSchema } = ((z99, UsageWindow
|
|
|
6697
6697
|
a132_EntInterval,
|
|
6698
6698
|
a14_UsageLimitAnchorSchema
|
|
6699
6699
|
);
|
|
6700
|
-
var { FeatureSchema: a133_FeatureSchema } = ((
|
|
6701
|
-
const FeatureSchema =
|
|
6702
|
-
internal_id:
|
|
6703
|
-
org_id:
|
|
6704
|
-
created_at:
|
|
6705
|
-
env:
|
|
6706
|
-
id:
|
|
6707
|
-
name:
|
|
6708
|
-
type:
|
|
6700
|
+
var { FeatureSchema: a133_FeatureSchema } = ((z100, AppEnv, FeatureType, ModelMarkupsSchema, FeatureStripeMeterSchema) => {
|
|
6701
|
+
const FeatureSchema = z100.object({
|
|
6702
|
+
internal_id: z100.string(),
|
|
6703
|
+
org_id: z100.string(),
|
|
6704
|
+
created_at: z100.number(),
|
|
6705
|
+
env: z100.nativeEnum(AppEnv),
|
|
6706
|
+
id: z100.string().nonempty("Features must have an ID"),
|
|
6707
|
+
name: z100.string().nonempty("Features must have a name"),
|
|
6708
|
+
type: z100.nativeEnum(FeatureType, {
|
|
6709
6709
|
message: "Features must have a type"
|
|
6710
6710
|
}),
|
|
6711
|
-
config:
|
|
6712
|
-
display:
|
|
6713
|
-
singular:
|
|
6714
|
-
plural:
|
|
6711
|
+
config: z100.any(),
|
|
6712
|
+
display: z100.object({
|
|
6713
|
+
singular: z100.string().optional(),
|
|
6714
|
+
plural: z100.string().optional()
|
|
6715
6715
|
}).nullish(),
|
|
6716
|
-
archived:
|
|
6717
|
-
event_names:
|
|
6716
|
+
archived: z100.boolean(),
|
|
6717
|
+
event_names: z100.array(z100.string()).default([]),
|
|
6718
6718
|
model_markups: ModelMarkupsSchema.nullish(),
|
|
6719
6719
|
stripe_meter: FeatureStripeMeterSchema.nullish(),
|
|
6720
|
-
stripe_product_id:
|
|
6720
|
+
stripe_product_id: z100.string().nullish()
|
|
6721
6721
|
});
|
|
6722
6722
|
return { FeatureSchema };
|
|
6723
6723
|
})(
|
|
@@ -6727,43 +6727,43 @@ var { FeatureSchema: a133_FeatureSchema } = ((z99, AppEnv, FeatureType, ModelMar
|
|
|
6727
6727
|
a88_ModelMarkupsSchema,
|
|
6728
6728
|
a135_FeatureStripeMeterSchema
|
|
6729
6729
|
);
|
|
6730
|
-
var { PriceCurrencyConfigSchema: a141_PriceCurrencyConfigSchema } = ((
|
|
6731
|
-
const PriceCurrencyConfigSchema =
|
|
6732
|
-
amount:
|
|
6733
|
-
usage_tiers:
|
|
6734
|
-
stripe_price_id:
|
|
6735
|
-
stripe_empty_price_id:
|
|
6736
|
-
stripe_placeholder_price_id:
|
|
6737
|
-
stripe_prepaid_price_v2_id:
|
|
6730
|
+
var { PriceCurrencyConfigSchema: a141_PriceCurrencyConfigSchema } = ((z100, UsageTierSchema) => {
|
|
6731
|
+
const PriceCurrencyConfigSchema = z100.object({
|
|
6732
|
+
amount: z100.number().nullish(),
|
|
6733
|
+
usage_tiers: z100.array(UsageTierSchema).nullish(),
|
|
6734
|
+
stripe_price_id: z100.string().nullish(),
|
|
6735
|
+
stripe_empty_price_id: z100.string().nullish(),
|
|
6736
|
+
stripe_placeholder_price_id: z100.string().nullish(),
|
|
6737
|
+
stripe_prepaid_price_v2_id: z100.string().nullish()
|
|
6738
6738
|
});
|
|
6739
6739
|
return { PriceCurrencyConfigSchema };
|
|
6740
6740
|
})(external0, a142_UsageTierSchema);
|
|
6741
|
-
var { UsagePriceConfigSchema: a144_UsagePriceConfigSchema } = ((
|
|
6742
|
-
const UsagePriceConfigSchema =
|
|
6743
|
-
threshold_billing:
|
|
6744
|
-
type:
|
|
6745
|
-
bill_when:
|
|
6746
|
-
billing_units:
|
|
6747
|
-
internal_feature_id:
|
|
6748
|
-
feature_id:
|
|
6749
|
-
usage_tiers:
|
|
6750
|
-
interval:
|
|
6751
|
-
interval_count:
|
|
6741
|
+
var { UsagePriceConfigSchema: a144_UsagePriceConfigSchema } = ((z100, BillWhen, UsageTierSchema, BillingInterval, PriceCurrencyConfigSchema, AllocatedBillingBehavior) => {
|
|
6742
|
+
const UsagePriceConfigSchema = z100.object({
|
|
6743
|
+
threshold_billing: z100.object({ threshold: z100.number().finite().positive() }).nullish(),
|
|
6744
|
+
type: z100.string(),
|
|
6745
|
+
bill_when: z100.nativeEnum(BillWhen),
|
|
6746
|
+
billing_units: z100.number().nullish(),
|
|
6747
|
+
internal_feature_id: z100.string(),
|
|
6748
|
+
feature_id: z100.string(),
|
|
6749
|
+
usage_tiers: z100.array(UsageTierSchema),
|
|
6750
|
+
interval: z100.enum(BillingInterval),
|
|
6751
|
+
interval_count: z100.number().optional(),
|
|
6752
6752
|
// Multi-currency: base amounts above are in `base_currency`; `currencies`
|
|
6753
6753
|
// holds per-currency overrides keyed by lowercase currency.
|
|
6754
|
-
base_currency:
|
|
6755
|
-
currencies:
|
|
6754
|
+
base_currency: z100.string().nullish(),
|
|
6755
|
+
currencies: z100.record(z100.string(), PriceCurrencyConfigSchema).nullish(),
|
|
6756
6756
|
// For usage in arrear
|
|
6757
|
-
stripe_meter_id:
|
|
6758
|
-
stripe_price_id:
|
|
6759
|
-
stripe_empty_price_id:
|
|
6760
|
-
stripe_product_id:
|
|
6761
|
-
stripe_placeholder_price_id:
|
|
6762
|
-
stripe_event_name:
|
|
6757
|
+
stripe_meter_id: z100.string().nullish(),
|
|
6758
|
+
stripe_price_id: z100.string().nullish(),
|
|
6759
|
+
stripe_empty_price_id: z100.string().nullish(),
|
|
6760
|
+
stripe_product_id: z100.string().nullish(),
|
|
6761
|
+
stripe_placeholder_price_id: z100.string().nullish(),
|
|
6762
|
+
stripe_event_name: z100.string().nullish(),
|
|
6763
6763
|
// V2 prepaid price
|
|
6764
|
-
stripe_prepaid_price_v2_id:
|
|
6765
|
-
should_prorate:
|
|
6766
|
-
allocated_billing_behavior:
|
|
6764
|
+
stripe_prepaid_price_v2_id: z100.string().nullish(),
|
|
6765
|
+
should_prorate: z100.boolean().optional(),
|
|
6766
|
+
allocated_billing_behavior: z100.enum(AllocatedBillingBehavior).optional()
|
|
6767
6767
|
});
|
|
6768
6768
|
return { UsagePriceConfigSchema };
|
|
6769
6769
|
})(
|
|
@@ -6774,17 +6774,17 @@ var { UsagePriceConfigSchema: a144_UsagePriceConfigSchema } = ((z99, BillWhen, U
|
|
|
6774
6774
|
a141_PriceCurrencyConfigSchema,
|
|
6775
6775
|
a146_AllocatedBillingBehavior
|
|
6776
6776
|
);
|
|
6777
|
-
var { graduatedCreditRateShape: a158_graduatedCreditRateShape } = ((
|
|
6777
|
+
var { graduatedCreditRateShape: a158_graduatedCreditRateShape } = ((z100, CreditTierSchema) => {
|
|
6778
6778
|
const graduatedCreditRateShape = {
|
|
6779
|
-
credit_amount:
|
|
6780
|
-
tier_behavior:
|
|
6781
|
-
tiers:
|
|
6779
|
+
credit_amount: z100.never().optional(),
|
|
6780
|
+
tier_behavior: z100.literal("graduated"),
|
|
6781
|
+
tiers: z100.array(CreditTierSchema)
|
|
6782
6782
|
};
|
|
6783
6783
|
return { graduatedCreditRateShape };
|
|
6784
6784
|
})(external0, a159_CreditTierSchema);
|
|
6785
|
-
var { FeatureMarkupsOverrideSchema: a162_FeatureMarkupsOverrideSchema } = ((
|
|
6786
|
-
const FeatureMarkupsOverrideSchema =
|
|
6787
|
-
default_markup:
|
|
6785
|
+
var { FeatureMarkupsOverrideSchema: a162_FeatureMarkupsOverrideSchema } = ((z100, ProviderMarkupsSchema, ModelMarkupsSchema) => {
|
|
6786
|
+
const FeatureMarkupsOverrideSchema = z100.strictObject({
|
|
6787
|
+
default_markup: z100.number().min(-100).optional(),
|
|
6788
6788
|
provider_markups: ProviderMarkupsSchema,
|
|
6789
6789
|
model_markups: ModelMarkupsSchema
|
|
6790
6790
|
});
|
|
@@ -6797,37 +6797,37 @@ var { usageAlertTargetLimitIdentity: a188_usageAlertTargetLimitIdentity } = /* @
|
|
|
6797
6797
|
});
|
|
6798
6798
|
return { usageAlertTargetLimitIdentity };
|
|
6799
6799
|
})(a105_usageLimitIdentity);
|
|
6800
|
-
var { DiscountConfigSchema: a193_DiscountConfigSchema } = ((
|
|
6801
|
-
const DiscountConfigSchema =
|
|
6802
|
-
discount_value:
|
|
6803
|
-
duration_type:
|
|
6804
|
-
duration_value:
|
|
6805
|
-
should_rollover:
|
|
6806
|
-
apply_to_all:
|
|
6807
|
-
price_ids:
|
|
6808
|
-
product_ids:
|
|
6800
|
+
var { DiscountConfigSchema: a193_DiscountConfigSchema } = ((z100, CouponDurationType) => {
|
|
6801
|
+
const DiscountConfigSchema = z100.object({
|
|
6802
|
+
discount_value: z100.number(),
|
|
6803
|
+
duration_type: z100.nativeEnum(CouponDurationType),
|
|
6804
|
+
duration_value: z100.number(),
|
|
6805
|
+
should_rollover: z100.boolean().optional(),
|
|
6806
|
+
apply_to_all: z100.boolean().optional(),
|
|
6807
|
+
price_ids: z100.array(z100.string()).optional(),
|
|
6808
|
+
product_ids: z100.array(z100.string()).optional()
|
|
6809
6809
|
});
|
|
6810
6810
|
return { DiscountConfigSchema };
|
|
6811
6811
|
})(external0, a194_CouponDurationType);
|
|
6812
|
-
var { RewardEntitlementSchema: a196_RewardEntitlementSchema } = ((
|
|
6813
|
-
const RewardEntitlementSchema =
|
|
6814
|
-
internal_feature_id:
|
|
6812
|
+
var { RewardEntitlementSchema: a196_RewardEntitlementSchema } = ((z100, EntitlementExpirySchema) => {
|
|
6813
|
+
const RewardEntitlementSchema = z100.object({
|
|
6814
|
+
internal_feature_id: z100.string().min(1),
|
|
6815
6815
|
// Optional: boolean features grant on/off access with no allowance
|
|
6816
|
-
allowance:
|
|
6816
|
+
allowance: z100.number().nonnegative().optional(),
|
|
6817
6817
|
expiry: EntitlementExpirySchema.optional()
|
|
6818
6818
|
});
|
|
6819
6819
|
return { RewardEntitlementSchema };
|
|
6820
6820
|
})(external0, a66_EntitlementExpirySchema);
|
|
6821
|
-
var { UpdateRewardSchema: a197_UpdateRewardSchema } = ((
|
|
6822
|
-
const UpdateRewardSchema =
|
|
6823
|
-
name:
|
|
6824
|
-
promo_codes:
|
|
6825
|
-
id:
|
|
6826
|
-
type:
|
|
6821
|
+
var { UpdateRewardSchema: a197_UpdateRewardSchema } = ((z100, PromoCodeSchema, RewardType, DiscountConfigSchema, FreeProductConfigSchema, RewardEntitlementSchema) => {
|
|
6822
|
+
const UpdateRewardSchema = z100.object({
|
|
6823
|
+
name: z100.string().nullish(),
|
|
6824
|
+
promo_codes: z100.array(PromoCodeSchema).optional(),
|
|
6825
|
+
id: z100.string().optional(),
|
|
6826
|
+
type: z100.nativeEnum(RewardType).optional(),
|
|
6827
6827
|
discount_config: DiscountConfigSchema.nullish(),
|
|
6828
6828
|
free_product_config: FreeProductConfigSchema.nullish(),
|
|
6829
|
-
free_product_id:
|
|
6830
|
-
entitlements:
|
|
6829
|
+
free_product_id: z100.string().nullish(),
|
|
6830
|
+
entitlements: z100.array(RewardEntitlementSchema).nullish()
|
|
6831
6831
|
});
|
|
6832
6832
|
return { UpdateRewardSchema };
|
|
6833
6833
|
})(
|
|
@@ -6838,36 +6838,36 @@ var { UpdateRewardSchema: a197_UpdateRewardSchema } = ((z99, PromoCodeSchema, Re
|
|
|
6838
6838
|
a195_FreeProductConfigSchema,
|
|
6839
6839
|
a196_RewardEntitlementSchema
|
|
6840
6840
|
);
|
|
6841
|
-
var { CreateRewardProgram: a198_CreateRewardProgram } = ((
|
|
6842
|
-
const CreateRewardProgram =
|
|
6843
|
-
id:
|
|
6844
|
-
when:
|
|
6845
|
-
product_ids:
|
|
6846
|
-
exclude_trial:
|
|
6847
|
-
internal_reward_id:
|
|
6848
|
-
max_redemptions:
|
|
6849
|
-
received_by:
|
|
6841
|
+
var { CreateRewardProgram: a198_CreateRewardProgram } = ((z100, RewardTriggerEvent, RewardReceivedBy) => {
|
|
6842
|
+
const CreateRewardProgram = z100.object({
|
|
6843
|
+
id: z100.string(),
|
|
6844
|
+
when: z100.enum(RewardTriggerEvent),
|
|
6845
|
+
product_ids: z100.array(z100.string()).optional(),
|
|
6846
|
+
exclude_trial: z100.boolean().optional(),
|
|
6847
|
+
internal_reward_id: z100.string(),
|
|
6848
|
+
max_redemptions: z100.number().optional(),
|
|
6849
|
+
received_by: z100.enum(RewardReceivedBy)
|
|
6850
6850
|
});
|
|
6851
6851
|
return { CreateRewardProgram };
|
|
6852
6852
|
})(external0, a199_RewardTriggerEvent, a200_RewardReceivedBy);
|
|
6853
|
-
var { AutoTopupPurchaseLimitSchema: a6_AutoTopupPurchaseLimitSchema } = ((
|
|
6854
|
-
const AutoTopupPurchaseLimitSchema =
|
|
6853
|
+
var { AutoTopupPurchaseLimitSchema: a6_AutoTopupPurchaseLimitSchema } = ((z100, PurchaseLimitIntervalEnum) => {
|
|
6854
|
+
const AutoTopupPurchaseLimitSchema = z100.object({
|
|
6855
6855
|
interval: PurchaseLimitIntervalEnum.meta({
|
|
6856
6856
|
description: "The time interval for the purchase limit window."
|
|
6857
6857
|
}),
|
|
6858
|
-
interval_count:
|
|
6858
|
+
interval_count: z100.number().min(1).default(1).meta({
|
|
6859
6859
|
description: "Number of intervals in the purchase limit window."
|
|
6860
6860
|
}),
|
|
6861
|
-
limit:
|
|
6861
|
+
limit: z100.number().min(1).meta({
|
|
6862
6862
|
description: "Maximum number of auto top-ups allowed within the interval."
|
|
6863
6863
|
})
|
|
6864
6864
|
});
|
|
6865
6865
|
return { AutoTopupPurchaseLimitSchema };
|
|
6866
6866
|
})(external0, a7_PurchaseLimitIntervalEnum);
|
|
6867
|
-
var { UsageLimitFilterSchema: a16_UsageLimitFilterSchema } = ((
|
|
6868
|
-
const UsageLimitFilterSchema =
|
|
6869
|
-
properties:
|
|
6870
|
-
|
|
6867
|
+
var { UsageLimitFilterSchema: a16_UsageLimitFilterSchema } = ((z100, USAGE_LIMIT_FILTER_MAX_KEY_LENGTH, UsageLimitFilterValueSchema, USAGE_LIMIT_FILTER_MAX_KEYS) => {
|
|
6868
|
+
const UsageLimitFilterSchema = z100.object({
|
|
6869
|
+
properties: z100.record(
|
|
6870
|
+
z100.string().min(1).max(USAGE_LIMIT_FILTER_MAX_KEY_LENGTH),
|
|
6871
6871
|
UsageLimitFilterValueSchema
|
|
6872
6872
|
).meta({
|
|
6873
6873
|
description: "Event property equality conditions. A usage event counts toward this cap only when every listed property matches (AND)."
|
|
@@ -6889,8 +6889,8 @@ var { UsageLimitFilterSchema: a16_UsageLimitFilterSchema } = ((z99, USAGE_LIMIT_
|
|
|
6889
6889
|
a18_UsageLimitFilterValueSchema,
|
|
6890
6890
|
a20_USAGE_LIMIT_FILTER_MAX_KEYS
|
|
6891
6891
|
);
|
|
6892
|
-
var { UsageAlertBasisSchema: a23_UsageAlertBasisSchema } = ((
|
|
6893
|
-
const UsageAlertBasisSchema =
|
|
6892
|
+
var { UsageAlertBasisSchema: a23_UsageAlertBasisSchema } = ((z100, USAGE_ALERT_BASES) => {
|
|
6893
|
+
const UsageAlertBasisSchema = z100.enum(USAGE_ALERT_BASES);
|
|
6894
6894
|
return { UsageAlertBasisSchema };
|
|
6895
6895
|
})(external0, a24_USAGE_ALERT_BASES);
|
|
6896
6896
|
var { refineCustomizePlanV1Schema: a30_refineCustomizePlanV1Schema } = /* @__PURE__ */ ((licensePatchIssues) => {
|
|
@@ -6938,10 +6938,10 @@ var { SUPPORTED_SET: a43_SUPPORTED_SET } = ((CURRENCY_CODES) => {
|
|
|
6938
6938
|
const SUPPORTED_SET = new Set(CURRENCY_CODES);
|
|
6939
6939
|
return { SUPPORTED_SET };
|
|
6940
6940
|
})(a44_CURRENCY_CODES);
|
|
6941
|
-
var { ApiCreditDimensionBaseSchema: a76_ApiCreditDimensionBaseSchema } = ((
|
|
6942
|
-
const ApiCreditDimensionBaseSchema =
|
|
6941
|
+
var { ApiCreditDimensionBaseSchema: a76_ApiCreditDimensionBaseSchema } = ((z100, ApiCreditMatchSchema) => {
|
|
6942
|
+
const ApiCreditDimensionBaseSchema = z100.object({
|
|
6943
6943
|
match: ApiCreditMatchSchema,
|
|
6944
|
-
priority:
|
|
6944
|
+
priority: z100.number().int().optional().meta({
|
|
6945
6945
|
description: "Breaks ties between dimensions that match the same number of keys. Higher wins."
|
|
6946
6946
|
})
|
|
6947
6947
|
});
|
|
@@ -6962,9 +6962,9 @@ var { refineGraduatedTiers: a80_refineGraduatedTiers } = /* @__PURE__ */ ((findC
|
|
|
6962
6962
|
};
|
|
6963
6963
|
return { refineGraduatedTiers };
|
|
6964
6964
|
})(a81_findCreditTierViolations);
|
|
6965
|
-
var { ApiFeatureMarkupsOverrideSchema: a85_ApiFeatureMarkupsOverrideSchema } = ((
|
|
6966
|
-
const ApiFeatureMarkupsOverrideSchema =
|
|
6967
|
-
default_markup:
|
|
6965
|
+
var { ApiFeatureMarkupsOverrideSchema: a85_ApiFeatureMarkupsOverrideSchema } = ((z100, ProviderMarkupsSchema, ModelMarkupsSchema) => {
|
|
6966
|
+
const ApiFeatureMarkupsOverrideSchema = z100.strictObject({
|
|
6967
|
+
default_markup: z100.number().min(-100).optional().meta({
|
|
6968
6968
|
description: "Default percentage markup for customers on this plan. Use -100 to make usage free."
|
|
6969
6969
|
}),
|
|
6970
6970
|
provider_markups: ProviderMarkupsSchema.meta({
|
|
@@ -6978,9 +6978,9 @@ var { ApiFeatureMarkupsOverrideSchema: a85_ApiFeatureMarkupsOverrideSchema } = (
|
|
|
6978
6978
|
})(external0, a86_ProviderMarkupsSchema, a88_ModelMarkupsSchema);
|
|
6979
6979
|
var {
|
|
6980
6980
|
AutoTopupPurchaseLimitParamsSchema: a98_AutoTopupPurchaseLimitParamsSchema
|
|
6981
|
-
} = ((AutoTopupPurchaseLimitSchema,
|
|
6981
|
+
} = ((AutoTopupPurchaseLimitSchema, z100) => {
|
|
6982
6982
|
const AutoTopupPurchaseLimitParamsSchema = AutoTopupPurchaseLimitSchema.extend({
|
|
6983
|
-
count:
|
|
6983
|
+
count: z100.number().min(0).optional().meta({
|
|
6984
6984
|
description: "Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged."
|
|
6985
6985
|
})
|
|
6986
6986
|
});
|
|
@@ -7026,8 +7026,8 @@ var { DUPLICATE_CHECKS: a101_DUPLICATE_CHECKS } = ((duplicateCheck, featureIdIde
|
|
|
7026
7026
|
a105_usageLimitIdentity,
|
|
7027
7027
|
a107_usageAlertIdentity
|
|
7028
7028
|
);
|
|
7029
|
-
var { ApiPlanProcessorsSchema: a117_ApiPlanProcessorsSchema } = ((
|
|
7030
|
-
const ApiPlanProcessorsSchema =
|
|
7029
|
+
var { ApiPlanProcessorsSchema: a117_ApiPlanProcessorsSchema } = ((z100, ApiStripePlanProcessorSchema, ApiRevenueCatPlanProcessorSchema) => {
|
|
7030
|
+
const ApiPlanProcessorsSchema = z100.object({
|
|
7031
7031
|
/** Omit to keep the current mapping; null unlinks it. */
|
|
7032
7032
|
stripe: ApiStripePlanProcessorSchema.nullish(),
|
|
7033
7033
|
revenuecat: ApiRevenueCatPlanProcessorSchema.nullish()
|
|
@@ -7038,22 +7038,22 @@ var { ApiPlanProcessorsSchema: a117_ApiPlanProcessorsSchema } = ((z99, ApiStripe
|
|
|
7038
7038
|
a118_ApiStripePlanProcessorSchema,
|
|
7039
7039
|
a119_ApiRevenueCatPlanProcessorSchema
|
|
7040
7040
|
);
|
|
7041
|
-
var { FixedPriceConfigSchema: a140_FixedPriceConfigSchema } = ((
|
|
7042
|
-
const FixedPriceConfigSchema =
|
|
7043
|
-
type:
|
|
7044
|
-
amount:
|
|
7045
|
-
interval:
|
|
7046
|
-
interval_count:
|
|
7041
|
+
var { FixedPriceConfigSchema: a140_FixedPriceConfigSchema } = ((z100, BillingInterval, PriceCurrencyConfigSchema, UsageTierSchema, IgnoredFixedPriceMetadataSchema) => {
|
|
7042
|
+
const FixedPriceConfigSchema = z100.object({
|
|
7043
|
+
type: z100.string(),
|
|
7044
|
+
amount: z100.number().min(0),
|
|
7045
|
+
interval: z100.enum(BillingInterval),
|
|
7046
|
+
interval_count: z100.number().optional(),
|
|
7047
7047
|
// Multi-currency: `amount` above is in `base_currency`; `currencies` holds
|
|
7048
7048
|
// per-currency overrides keyed by lowercase currency.
|
|
7049
|
-
base_currency:
|
|
7050
|
-
currencies:
|
|
7049
|
+
base_currency: z100.string().nullish(),
|
|
7050
|
+
currencies: z100.record(z100.string(), PriceCurrencyConfigSchema).nullish(),
|
|
7051
7051
|
// Usage price fields
|
|
7052
|
-
billing_units:
|
|
7053
|
-
usage_tiers:
|
|
7054
|
-
stripe_price_id:
|
|
7055
|
-
stripe_empty_price_id:
|
|
7056
|
-
stripe_product_id:
|
|
7052
|
+
billing_units: z100.number().nullish(),
|
|
7053
|
+
usage_tiers: z100.array(UsageTierSchema).nullish(),
|
|
7054
|
+
stripe_price_id: z100.string().nullish(),
|
|
7055
|
+
stripe_empty_price_id: z100.string().nullish(),
|
|
7056
|
+
stripe_product_id: z100.string().nullish(),
|
|
7057
7057
|
feature_id: IgnoredFixedPriceMetadataSchema,
|
|
7058
7058
|
internal_feature_id: IgnoredFixedPriceMetadataSchema
|
|
7059
7059
|
});
|
|
@@ -7065,8 +7065,8 @@ var { FixedPriceConfigSchema: a140_FixedPriceConfigSchema } = ((z99, BillingInte
|
|
|
7065
7065
|
a142_UsageTierSchema,
|
|
7066
7066
|
a143_IgnoredFixedPriceMetadataSchema
|
|
7067
7067
|
);
|
|
7068
|
-
var { CreditDimensionSchema: a155_CreditDimensionSchema } = ((
|
|
7069
|
-
const CreditDimensionSchema =
|
|
7068
|
+
var { CreditDimensionSchema: a155_CreditDimensionSchema } = ((z100, CreditDimensionBaseSchema, flatCreditRateShape, graduatedCreditRateShape) => {
|
|
7069
|
+
const CreditDimensionSchema = z100.union([
|
|
7070
7070
|
CreditDimensionBaseSchema.extend(flatCreditRateShape),
|
|
7071
7071
|
CreditDimensionBaseSchema.extend(graduatedCreditRateShape)
|
|
7072
7072
|
]);
|
|
@@ -7097,16 +7097,16 @@ var {
|
|
|
7097
7097
|
a187_isUsageLimitBasisAlert,
|
|
7098
7098
|
a188_usageAlertTargetLimitIdentity
|
|
7099
7099
|
);
|
|
7100
|
-
var { CreateRewardSchema: a190_CreateRewardSchema } = ((
|
|
7101
|
-
const CreateRewardSchema =
|
|
7102
|
-
name:
|
|
7103
|
-
promo_codes:
|
|
7104
|
-
id:
|
|
7105
|
-
type:
|
|
7100
|
+
var { CreateRewardSchema: a190_CreateRewardSchema } = ((z100, PromoCodeSchema, RewardType, DiscountConfigSchema, FreeProductConfigSchema, RewardEntitlementSchema) => {
|
|
7101
|
+
const CreateRewardSchema = z100.object({
|
|
7102
|
+
name: z100.string(),
|
|
7103
|
+
promo_codes: z100.array(PromoCodeSchema),
|
|
7104
|
+
id: z100.string(),
|
|
7105
|
+
type: z100.nativeEnum(RewardType).nullish(),
|
|
7106
7106
|
discount_config: DiscountConfigSchema.nullish(),
|
|
7107
7107
|
free_product_config: FreeProductConfigSchema.nullish(),
|
|
7108
|
-
free_product_id:
|
|
7109
|
-
entitlements:
|
|
7108
|
+
free_product_id: z100.string().nullish(),
|
|
7109
|
+
entitlements: z100.array(RewardEntitlementSchema).nullish()
|
|
7110
7110
|
}).refine(
|
|
7111
7111
|
(data) => {
|
|
7112
7112
|
if (data.type !== RewardType.FeatureGrant) return true;
|
|
@@ -7129,41 +7129,41 @@ var { CreateRewardSchema: a190_CreateRewardSchema } = ((z99, PromoCodeSchema, Re
|
|
|
7129
7129
|
a195_FreeProductConfigSchema,
|
|
7130
7130
|
a196_RewardEntitlementSchema
|
|
7131
7131
|
);
|
|
7132
|
-
var { AutoTopupSchema: a5_AutoTopupSchema } = ((
|
|
7133
|
-
const AutoTopupSchema =
|
|
7134
|
-
feature_id:
|
|
7132
|
+
var { AutoTopupSchema: a5_AutoTopupSchema } = ((z100, AutoTopupPurchaseLimitSchema) => {
|
|
7133
|
+
const AutoTopupSchema = z100.object({
|
|
7134
|
+
feature_id: z100.string().meta({
|
|
7135
7135
|
description: "The ID of the feature (credit balance) to auto top-up."
|
|
7136
7136
|
}),
|
|
7137
|
-
enabled:
|
|
7137
|
+
enabled: z100.boolean().default(false).meta({
|
|
7138
7138
|
description: "Whether auto top-up is enabled."
|
|
7139
7139
|
}),
|
|
7140
|
-
threshold:
|
|
7140
|
+
threshold: z100.number().meta({
|
|
7141
7141
|
description: "When the balance drops below this threshold, an auto top-up will be purchased."
|
|
7142
7142
|
}),
|
|
7143
|
-
quantity:
|
|
7143
|
+
quantity: z100.number().min(1).meta({
|
|
7144
7144
|
description: "Amount of credits to add per auto top-up."
|
|
7145
7145
|
}),
|
|
7146
7146
|
purchase_limit: AutoTopupPurchaseLimitSchema.optional().meta({
|
|
7147
7147
|
description: "Optional rate limit to cap how often auto top-ups occur."
|
|
7148
7148
|
}),
|
|
7149
|
-
invoice_mode:
|
|
7149
|
+
invoice_mode: z100.boolean().optional().meta({
|
|
7150
7150
|
description: "When true, auto top-up creates a send_invoice invoice instead of auto-charging."
|
|
7151
7151
|
})
|
|
7152
7152
|
});
|
|
7153
7153
|
return { AutoTopupSchema };
|
|
7154
7154
|
})(external0, a6_AutoTopupPurchaseLimitSchema);
|
|
7155
|
-
var { DbUsageLimitSchema: a11_DbUsageLimitSchema } = ((
|
|
7156
|
-
const DbUsageLimitSchema =
|
|
7157
|
-
feature_id:
|
|
7155
|
+
var { DbUsageLimitSchema: a11_DbUsageLimitSchema } = ((z100, USAGE_LIMIT_INTERVALS, UsageLimitAnchorSchema, UsageLimitFilterSchema) => {
|
|
7156
|
+
const DbUsageLimitSchema = z100.object({
|
|
7157
|
+
feature_id: z100.string().meta({
|
|
7158
7158
|
description: "The feature this usage limit applies to."
|
|
7159
7159
|
}),
|
|
7160
|
-
enabled:
|
|
7160
|
+
enabled: z100.boolean().default(true).meta({
|
|
7161
7161
|
description: "Whether this usage limit is enabled."
|
|
7162
7162
|
}),
|
|
7163
|
-
limit:
|
|
7163
|
+
limit: z100.number().min(0).meta({
|
|
7164
7164
|
description: "Maximum units allowed per interval."
|
|
7165
7165
|
}),
|
|
7166
|
-
interval:
|
|
7166
|
+
interval: z100.enum(USAGE_LIMIT_INTERVALS).meta({
|
|
7167
7167
|
description: "Interval for the cap, aligned to the customer's billing cycle."
|
|
7168
7168
|
}),
|
|
7169
7169
|
anchor: UsageLimitAnchorSchema.optional().meta({
|
|
@@ -7180,15 +7180,15 @@ var { DbUsageLimitSchema: a11_DbUsageLimitSchema } = ((z99, USAGE_LIMIT_INTERVAL
|
|
|
7180
7180
|
a14_UsageLimitAnchorSchema,
|
|
7181
7181
|
a16_UsageLimitFilterSchema
|
|
7182
7182
|
);
|
|
7183
|
-
var { DbUsageAlertSchema: a21_DbUsageAlertSchema } = ((
|
|
7184
|
-
const DbUsageAlertSchema =
|
|
7185
|
-
feature_id:
|
|
7183
|
+
var { DbUsageAlertSchema: a21_DbUsageAlertSchema } = ((z100, UsageAlertThresholdType, UsageAlertBasisSchema, DEFAULT_USAGE_ALERT_BASIS, UsageLimitFilterSchema) => {
|
|
7184
|
+
const DbUsageAlertSchema = z100.object({
|
|
7185
|
+
feature_id: z100.string().optional().meta({
|
|
7186
7186
|
description: "The feature ID this alert applies to."
|
|
7187
7187
|
}),
|
|
7188
|
-
enabled:
|
|
7188
|
+
enabled: z100.boolean().default(true).meta({
|
|
7189
7189
|
description: "Whether this usage alert is enabled."
|
|
7190
7190
|
}),
|
|
7191
|
-
threshold:
|
|
7191
|
+
threshold: z100.number().min(0).meta({
|
|
7192
7192
|
description: "The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage_percentage or remaining_percentage, this is a percentage (0-100)."
|
|
7193
7193
|
}),
|
|
7194
7194
|
threshold_type: UsageAlertThresholdType.meta({
|
|
@@ -7200,7 +7200,7 @@ var { DbUsageAlertSchema: a21_DbUsageAlertSchema } = ((z99, UsageAlertThresholdT
|
|
|
7200
7200
|
filter: UsageLimitFilterSchema.optional().meta({
|
|
7201
7201
|
description: "Only valid with basis usage_limit. Points the alert at the usage limit carrying the same filter."
|
|
7202
7202
|
}),
|
|
7203
|
-
name:
|
|
7203
|
+
name: z100.string().optional().meta({
|
|
7204
7204
|
description: "Optional user-defined label to distinguish multiple alerts on the same feature."
|
|
7205
7205
|
})
|
|
7206
7206
|
}).check((ctx) => {
|
|
@@ -7242,14 +7242,14 @@ var { isValidCurrencyCode: a42_isValidCurrencyCode } = /* @__PURE__ */ ((SUPPORT
|
|
|
7242
7242
|
const isValidCurrencyCode = (code) => !!code && SUPPORTED_SET.has(code.toLowerCase());
|
|
7243
7243
|
return { isValidCurrencyCode };
|
|
7244
7244
|
})(a43_SUPPORTED_SET);
|
|
7245
|
-
var { ApiCreditDimensionSchema: a75_ApiCreditDimensionSchema } = ((
|
|
7246
|
-
const ApiCreditDimensionSchema =
|
|
7245
|
+
var { ApiCreditDimensionSchema: a75_ApiCreditDimensionSchema } = ((z100, ApiCreditDimensionBaseSchema, ApiCreditTierSchema, refineGraduatedTiers) => {
|
|
7246
|
+
const ApiCreditDimensionSchema = z100.union([
|
|
7247
7247
|
ApiCreditDimensionBaseSchema.extend({
|
|
7248
|
-
tier_behavior:
|
|
7249
|
-
tiers:
|
|
7248
|
+
tier_behavior: z100.literal("graduated"),
|
|
7249
|
+
tiers: z100.array(ApiCreditTierSchema).min(1)
|
|
7250
7250
|
}).strict().superRefine(refineGraduatedTiers),
|
|
7251
7251
|
ApiCreditDimensionBaseSchema.extend({
|
|
7252
|
-
credit_cost:
|
|
7252
|
+
credit_cost: z100.number().min(0).meta({
|
|
7253
7253
|
description: "Credits consumed per billing-unit group when this dimension matches."
|
|
7254
7254
|
})
|
|
7255
7255
|
}).strict()
|
|
@@ -7281,21 +7281,21 @@ var {
|
|
|
7281
7281
|
};
|
|
7282
7282
|
return { findDuplicateBillingControlIssue };
|
|
7283
7283
|
})(a101_DUPLICATE_CHECKS);
|
|
7284
|
-
var { CustomerBillingControlsSchema: a123_CustomerBillingControlsSchema } = ((
|
|
7285
|
-
const CustomerBillingControlsSchema =
|
|
7286
|
-
auto_topups:
|
|
7284
|
+
var { CustomerBillingControlsSchema: a123_CustomerBillingControlsSchema } = ((z100, AutoTopupSchema, DbSpendLimitSchema, DbUsageLimitSchema, DbUsageAlertSchema, DbOverageAllowedSchema) => {
|
|
7285
|
+
const CustomerBillingControlsSchema = z100.object({
|
|
7286
|
+
auto_topups: z100.array(AutoTopupSchema).optional().meta({
|
|
7287
7287
|
description: "List of auto top-up configurations per feature."
|
|
7288
7288
|
}),
|
|
7289
|
-
spend_limits:
|
|
7289
|
+
spend_limits: z100.array(DbSpendLimitSchema).optional().meta({
|
|
7290
7290
|
description: "List of overage spend limits per feature (caps overage spend)."
|
|
7291
7291
|
}),
|
|
7292
|
-
usage_limits:
|
|
7292
|
+
usage_limits: z100.array(DbUsageLimitSchema).optional().meta({
|
|
7293
7293
|
description: "List of hard usage caps per feature (max units per interval)."
|
|
7294
7294
|
}),
|
|
7295
|
-
usage_alerts:
|
|
7295
|
+
usage_alerts: z100.array(DbUsageAlertSchema).optional().meta({
|
|
7296
7296
|
description: "List of usage alert configurations per feature."
|
|
7297
7297
|
}),
|
|
7298
|
-
overage_allowed:
|
|
7298
|
+
overage_allowed: z100.array(DbOverageAllowedSchema).optional().meta({
|
|
7299
7299
|
description: "List of overage allowed controls per feature. When enabled, usage can exceed balance."
|
|
7300
7300
|
})
|
|
7301
7301
|
});
|
|
@@ -7308,18 +7308,18 @@ var { CustomerBillingControlsSchema: a123_CustomerBillingControlsSchema } = ((z9
|
|
|
7308
7308
|
a21_DbUsageAlertSchema,
|
|
7309
7309
|
a27_DbOverageAllowedSchema
|
|
7310
7310
|
);
|
|
7311
|
-
var { PriceSchema: a138_PriceSchema } = ((
|
|
7312
|
-
const PriceSchema =
|
|
7313
|
-
id:
|
|
7314
|
-
internal_product_id:
|
|
7315
|
-
org_id:
|
|
7316
|
-
created_at:
|
|
7311
|
+
var { PriceSchema: a138_PriceSchema } = ((z100, BillingType, TierBehavior, FixedPriceConfigSchema, UsagePriceConfigSchema, ProrationConfigSchema) => {
|
|
7312
|
+
const PriceSchema = z100.object({
|
|
7313
|
+
id: z100.string(),
|
|
7314
|
+
internal_product_id: z100.string().nullable(),
|
|
7315
|
+
org_id: z100.string().optional(),
|
|
7316
|
+
created_at: z100.number().optional(),
|
|
7317
7317
|
/** @deprecated Derive this with getBillingType(price.config). */
|
|
7318
|
-
billing_type:
|
|
7319
|
-
tier_behavior:
|
|
7320
|
-
is_custom:
|
|
7318
|
+
billing_type: z100.nativeEnum(BillingType).nullish(),
|
|
7319
|
+
tier_behavior: z100.nativeEnum(TierBehavior).nullish(),
|
|
7320
|
+
is_custom: z100.boolean().optional(),
|
|
7321
7321
|
config: FixedPriceConfigSchema.or(UsagePriceConfigSchema),
|
|
7322
|
-
entitlement_id:
|
|
7322
|
+
entitlement_id: z100.string().nullish(),
|
|
7323
7323
|
proration_config: ProrationConfigSchema.nullable()
|
|
7324
7324
|
});
|
|
7325
7325
|
return { PriceSchema };
|
|
@@ -7331,12 +7331,12 @@ var { PriceSchema: a138_PriceSchema } = ((z99, BillingType, TierBehavior, FixedP
|
|
|
7331
7331
|
a144_UsagePriceConfigSchema,
|
|
7332
7332
|
a147_ProrationConfigSchema
|
|
7333
7333
|
);
|
|
7334
|
-
var { CreditSchemaItemBaseSchema: a154_CreditSchemaItemBaseSchema } = ((
|
|
7335
|
-
const CreditSchemaItemBaseSchema =
|
|
7336
|
-
metered_feature_id:
|
|
7337
|
-
feature_amount:
|
|
7338
|
-
dimensions:
|
|
7339
|
-
multipliers:
|
|
7334
|
+
var { CreditSchemaItemBaseSchema: a154_CreditSchemaItemBaseSchema } = ((z100, CreditDimensionNameSchema, CreditDimensionSchema, CreditMultiplierSchema) => {
|
|
7335
|
+
const CreditSchemaItemBaseSchema = z100.object({
|
|
7336
|
+
metered_feature_id: z100.string(),
|
|
7337
|
+
feature_amount: z100.number().optional(),
|
|
7338
|
+
dimensions: z100.record(CreditDimensionNameSchema, CreditDimensionSchema).optional(),
|
|
7339
|
+
multipliers: z100.record(CreditDimensionNameSchema, CreditMultiplierSchema).optional()
|
|
7340
7340
|
});
|
|
7341
7341
|
return { CreditSchemaItemBaseSchema };
|
|
7342
7342
|
})(
|
|
@@ -7353,27 +7353,27 @@ var {
|
|
|
7353
7353
|
);
|
|
7354
7354
|
return { GraduatedCreditSchemaItemSchema };
|
|
7355
7355
|
})(a154_CreditSchemaItemBaseSchema, a158_graduatedCreditRateShape);
|
|
7356
|
-
var { UpdateProductSchema: a183_UpdateProductSchema } = ((
|
|
7357
|
-
const UpdateProductSchema =
|
|
7358
|
-
id:
|
|
7359
|
-
name:
|
|
7360
|
-
description:
|
|
7361
|
-
is_add_on:
|
|
7362
|
-
is_default:
|
|
7363
|
-
group:
|
|
7364
|
-
archived:
|
|
7356
|
+
var { UpdateProductSchema: a183_UpdateProductSchema } = ((z100, ProductConfigSchema, CustomerBillingControlsSchema) => {
|
|
7357
|
+
const UpdateProductSchema = z100.object({
|
|
7358
|
+
id: z100.string().nullish(),
|
|
7359
|
+
name: z100.string().min(1, "Product name cannot be empty").optional(),
|
|
7360
|
+
description: z100.string().nullish(),
|
|
7361
|
+
is_add_on: z100.boolean().optional(),
|
|
7362
|
+
is_default: z100.boolean().optional(),
|
|
7363
|
+
group: z100.string().nullish(),
|
|
7364
|
+
archived: z100.boolean().optional(),
|
|
7365
7365
|
config: ProductConfigSchema.partial().optional(),
|
|
7366
7366
|
billing_controls: CustomerBillingControlsSchema.optional()
|
|
7367
7367
|
});
|
|
7368
7368
|
return { UpdateProductSchema };
|
|
7369
7369
|
})(external0, a2_ProductConfigSchema, a123_CustomerBillingControlsSchema);
|
|
7370
|
-
var { DbBillingControlsSchema: a4_DbBillingControlsSchema } = ((
|
|
7371
|
-
const DbBillingControlsSchema =
|
|
7372
|
-
auto_topups:
|
|
7373
|
-
spend_limits:
|
|
7374
|
-
usage_limits:
|
|
7375
|
-
usage_alerts:
|
|
7376
|
-
overage_allowed:
|
|
7370
|
+
var { DbBillingControlsSchema: a4_DbBillingControlsSchema } = ((z100, AutoTopupSchema, DbSpendLimitSchema, DbUsageLimitSchema, DbUsageAlertSchema, DbOverageAllowedSchema) => {
|
|
7371
|
+
const DbBillingControlsSchema = z100.object({
|
|
7372
|
+
auto_topups: z100.array(AutoTopupSchema).nullish(),
|
|
7373
|
+
spend_limits: z100.array(DbSpendLimitSchema).nullish(),
|
|
7374
|
+
usage_limits: z100.array(DbUsageLimitSchema).nullish(),
|
|
7375
|
+
usage_alerts: z100.array(DbUsageAlertSchema).nullish(),
|
|
7376
|
+
overage_allowed: z100.array(DbOverageAllowedSchema).nullish()
|
|
7377
7377
|
});
|
|
7378
7378
|
return { DbBillingControlsSchema };
|
|
7379
7379
|
})(
|
|
@@ -7384,19 +7384,19 @@ var { DbBillingControlsSchema: a4_DbBillingControlsSchema } = ((z99, AutoTopupSc
|
|
|
7384
7384
|
a21_DbUsageAlertSchema,
|
|
7385
7385
|
a27_DbOverageAllowedSchema
|
|
7386
7386
|
);
|
|
7387
|
-
var { CurrencyCodeSchema: a41_CurrencyCodeSchema } = ((
|
|
7388
|
-
const CurrencyCodeSchema =
|
|
7387
|
+
var { CurrencyCodeSchema: a41_CurrencyCodeSchema } = ((z100, isValidCurrencyCode) => {
|
|
7388
|
+
const CurrencyCodeSchema = z100.string().refine(isValidCurrencyCode, "must be a Stripe-supported currency code").meta({
|
|
7389
7389
|
description: "Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp')."
|
|
7390
7390
|
});
|
|
7391
7391
|
return { CurrencyCodeSchema };
|
|
7392
7392
|
})(external0, a42_isValidCurrencyCode);
|
|
7393
|
-
var { AdditionalCurrencyTierSchema: a57_AdditionalCurrencyTierSchema } = ((
|
|
7394
|
-
const AdditionalCurrencyTierSchema =
|
|
7393
|
+
var { AdditionalCurrencyTierSchema: a57_AdditionalCurrencyTierSchema } = ((z100, CurrencyCodeSchema) => {
|
|
7394
|
+
const AdditionalCurrencyTierSchema = z100.object({
|
|
7395
7395
|
currency: CurrencyCodeSchema,
|
|
7396
|
-
amount:
|
|
7396
|
+
amount: z100.number().optional().meta({
|
|
7397
7397
|
description: "Per-unit amount for this tier in this currency."
|
|
7398
7398
|
}),
|
|
7399
|
-
flat_amount:
|
|
7399
|
+
flat_amount: z100.number().optional().meta({
|
|
7400
7400
|
description: "Flat amount for this tier in this currency, if the tier uses one."
|
|
7401
7401
|
})
|
|
7402
7402
|
}).refine(
|
|
@@ -7408,18 +7408,18 @@ var { AdditionalCurrencyTierSchema: a57_AdditionalCurrencyTierSchema } = ((z99,
|
|
|
7408
7408
|
);
|
|
7409
7409
|
return { AdditionalCurrencyTierSchema };
|
|
7410
7410
|
})(external0, a41_CurrencyCodeSchema);
|
|
7411
|
-
var { ApiCreditSchemaItemBaseSchema: a71_ApiCreditSchemaItemBaseSchema } = ((
|
|
7412
|
-
const ApiCreditSchemaItemBaseSchema =
|
|
7413
|
-
metered_feature_id:
|
|
7411
|
+
var { ApiCreditSchemaItemBaseSchema: a71_ApiCreditSchemaItemBaseSchema } = ((z100, CreditDimensionNameSchema, ApiCreditDimensionSchema, ApiCreditMultiplierSchema) => {
|
|
7412
|
+
const ApiCreditSchemaItemBaseSchema = z100.object({
|
|
7413
|
+
metered_feature_id: z100.string().nonempty().meta({
|
|
7414
7414
|
description: "ID of the metered feature that draws from this credit system."
|
|
7415
7415
|
}),
|
|
7416
|
-
billing_units:
|
|
7416
|
+
billing_units: z100.number().positive().optional().meta({
|
|
7417
7417
|
description: "Number of metered-feature units priced together. Defaults to one when omitted."
|
|
7418
7418
|
}),
|
|
7419
|
-
dimensions:
|
|
7419
|
+
dimensions: z100.record(CreditDimensionNameSchema, ApiCreditDimensionSchema).optional().meta({
|
|
7420
7420
|
description: "Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies."
|
|
7421
7421
|
}),
|
|
7422
|
-
multipliers:
|
|
7422
|
+
multipliers: z100.record(CreditDimensionNameSchema, ApiCreditMultiplierSchema).optional().meta({
|
|
7423
7423
|
description: "Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed."
|
|
7424
7424
|
})
|
|
7425
7425
|
});
|
|
@@ -7430,9 +7430,9 @@ var { ApiCreditSchemaItemBaseSchema: a71_ApiCreditSchemaItemBaseSchema } = ((z99
|
|
|
7430
7430
|
a75_ApiCreditDimensionSchema,
|
|
7431
7431
|
a83_ApiCreditMultiplierSchema
|
|
7432
7432
|
);
|
|
7433
|
-
var { ApiFlatCreditSchemaItemSchema: a84_ApiFlatCreditSchemaItemSchema } = ((ApiCreditSchemaItemBaseSchema,
|
|
7433
|
+
var { ApiFlatCreditSchemaItemSchema: a84_ApiFlatCreditSchemaItemSchema } = ((ApiCreditSchemaItemBaseSchema, z100) => {
|
|
7434
7434
|
const ApiFlatCreditSchemaItemSchema = ApiCreditSchemaItemBaseSchema.extend({
|
|
7435
|
-
credit_cost:
|
|
7435
|
+
credit_cost: z100.number().min(0).meta({
|
|
7436
7436
|
description: "Credits consumed per billing-unit group."
|
|
7437
7437
|
})
|
|
7438
7438
|
}).strict();
|
|
@@ -7449,32 +7449,32 @@ var { FlatCreditSchemaItemSchema: a153_FlatCreditSchemaItemSchema } = ((CreditSc
|
|
|
7449
7449
|
const FlatCreditSchemaItemSchema = CreditSchemaItemBaseSchema.extend(flatCreditRateShape);
|
|
7450
7450
|
return { FlatCreditSchemaItemSchema };
|
|
7451
7451
|
})(a154_CreditSchemaItemBaseSchema, a157_flatCreditRateShape);
|
|
7452
|
-
var { ProductSchema: a0_ProductSchema } = ((
|
|
7453
|
-
const ProductSchema =
|
|
7454
|
-
id:
|
|
7455
|
-
name:
|
|
7456
|
-
description:
|
|
7457
|
-
is_add_on:
|
|
7458
|
-
is_default:
|
|
7459
|
-
version:
|
|
7452
|
+
var { ProductSchema: a0_ProductSchema } = ((z100, AppEnv, ProductConfigSchema, DbBillingControlsSchema, ProductMetadataSchema) => {
|
|
7453
|
+
const ProductSchema = z100.object({
|
|
7454
|
+
id: z100.string(),
|
|
7455
|
+
name: z100.string().min(1, "Product name cannot be empty"),
|
|
7456
|
+
description: z100.string().nullable(),
|
|
7457
|
+
is_add_on: z100.boolean(),
|
|
7458
|
+
is_default: z100.boolean(),
|
|
7459
|
+
version: z100.number(),
|
|
7460
7460
|
// Missing keys parse as null/false; hydrate still fills slug to v{version}.
|
|
7461
|
-
version_slug:
|
|
7462
|
-
active:
|
|
7463
|
-
deleted_at:
|
|
7464
|
-
previous_version_slug:
|
|
7465
|
-
group:
|
|
7466
|
-
env:
|
|
7467
|
-
internal_id:
|
|
7468
|
-
org_id:
|
|
7469
|
-
created_at:
|
|
7470
|
-
processor:
|
|
7471
|
-
type:
|
|
7472
|
-
id:
|
|
7473
|
-
additional_ids:
|
|
7461
|
+
version_slug: z100.string().nullable().default(null),
|
|
7462
|
+
active: z100.boolean().default(false),
|
|
7463
|
+
deleted_at: z100.number().nullable().default(null),
|
|
7464
|
+
previous_version_slug: z100.string().nullable().default(null),
|
|
7465
|
+
group: z100.string(),
|
|
7466
|
+
env: z100.enum(AppEnv),
|
|
7467
|
+
internal_id: z100.string(),
|
|
7468
|
+
org_id: z100.string(),
|
|
7469
|
+
created_at: z100.number(),
|
|
7470
|
+
processor: z100.object({
|
|
7471
|
+
type: z100.string(),
|
|
7472
|
+
id: z100.string(),
|
|
7473
|
+
additional_ids: z100.array(z100.string()).optional()
|
|
7474
7474
|
}).nullish(),
|
|
7475
|
-
base_variant_id:
|
|
7476
|
-
base_internal_product_id:
|
|
7477
|
-
archived:
|
|
7475
|
+
base_variant_id: z100.string().nullable(),
|
|
7476
|
+
base_internal_product_id: z100.string().nullish(),
|
|
7477
|
+
archived: z100.boolean().default(false),
|
|
7478
7478
|
config: ProductConfigSchema.default(() => ({ ignore_past_due: false })),
|
|
7479
7479
|
...DbBillingControlsSchema.shape,
|
|
7480
7480
|
metadata: ProductMetadataSchema.default(() => ({}))
|
|
@@ -7487,10 +7487,10 @@ var { ProductSchema: a0_ProductSchema } = ((z99, AppEnv, ProductConfigSchema, Db
|
|
|
7487
7487
|
a4_DbBillingControlsSchema,
|
|
7488
7488
|
a28_ProductMetadataSchema
|
|
7489
7489
|
);
|
|
7490
|
-
var { AdditionalCurrencyPriceSchema: a40_AdditionalCurrencyPriceSchema } = ((
|
|
7491
|
-
const AdditionalCurrencyPriceSchema =
|
|
7490
|
+
var { AdditionalCurrencyPriceSchema: a40_AdditionalCurrencyPriceSchema } = ((z100, CurrencyCodeSchema) => {
|
|
7491
|
+
const AdditionalCurrencyPriceSchema = z100.object({
|
|
7492
7492
|
currency: CurrencyCodeSchema,
|
|
7493
|
-
amount:
|
|
7493
|
+
amount: z100.number().meta({
|
|
7494
7494
|
description: "Price amount in this currency. Set explicitly per currency, not converted from the base amount."
|
|
7495
7495
|
})
|
|
7496
7496
|
});
|
|
@@ -7498,8 +7498,8 @@ var { AdditionalCurrencyPriceSchema: a40_AdditionalCurrencyPriceSchema } = ((z99
|
|
|
7498
7498
|
})(external0, a41_CurrencyCodeSchema);
|
|
7499
7499
|
var {
|
|
7500
7500
|
AdditionalCurrencyTierArraySchema: a56_AdditionalCurrencyTierArraySchema
|
|
7501
|
-
} = ((
|
|
7502
|
-
const AdditionalCurrencyTierArraySchema =
|
|
7501
|
+
} = ((z100, AdditionalCurrencyTierSchema, hasNoDuplicateCurrencies, DUPLICATE_CURRENCY_MESSAGE) => {
|
|
7502
|
+
const AdditionalCurrencyTierArraySchema = z100.array(AdditionalCurrencyTierSchema).refine(hasNoDuplicateCurrencies, { message: DUPLICATE_CURRENCY_MESSAGE });
|
|
7503
7503
|
return { AdditionalCurrencyTierArraySchema };
|
|
7504
7504
|
})(
|
|
7505
7505
|
external0,
|
|
@@ -7509,10 +7509,10 @@ var {
|
|
|
7509
7509
|
);
|
|
7510
7510
|
var {
|
|
7511
7511
|
ApiGraduatedCreditSchemaItemSchema: a70_ApiGraduatedCreditSchemaItemSchema
|
|
7512
|
-
} = ((ApiCreditSchemaItemBaseSchema,
|
|
7512
|
+
} = ((ApiCreditSchemaItemBaseSchema, z100, ApiCreditTierSchema, refineGraduatedTiers) => {
|
|
7513
7513
|
const ApiGraduatedCreditSchemaItemSchema = ApiCreditSchemaItemBaseSchema.extend({
|
|
7514
|
-
tier_behavior:
|
|
7515
|
-
tiers:
|
|
7514
|
+
tier_behavior: z100.literal("graduated"),
|
|
7515
|
+
tiers: z100.array(ApiCreditTierSchema).min(1)
|
|
7516
7516
|
}).strict().superRefine(refineGraduatedTiers);
|
|
7517
7517
|
return { ApiGraduatedCreditSchemaItemSchema };
|
|
7518
7518
|
})(
|
|
@@ -7523,8 +7523,8 @@ var {
|
|
|
7523
7523
|
);
|
|
7524
7524
|
var {
|
|
7525
7525
|
CustomerBillingControlsParamsSchema: a95_CustomerBillingControlsParamsSchema
|
|
7526
|
-
} = ((
|
|
7527
|
-
const CustomerBillingControlsParamsSchema =
|
|
7526
|
+
} = ((z100, laneParam, AutoTopupParamsSchema, DbSpendLimitSchema, DbUsageLimitSchema, DbUsageAlertSchema, DbOverageAllowedSchema, rejectDuplicateBillingControls) => {
|
|
7527
|
+
const CustomerBillingControlsParamsSchema = z100.object({
|
|
7528
7528
|
auto_topups: laneParam({
|
|
7529
7529
|
schema: AutoTopupParamsSchema,
|
|
7530
7530
|
description: "List of auto top-up configurations per feature."
|
|
@@ -7557,8 +7557,8 @@ var {
|
|
|
7557
7557
|
a27_DbOverageAllowedSchema,
|
|
7558
7558
|
a99_rejectDuplicateBillingControls
|
|
7559
7559
|
);
|
|
7560
|
-
var { CreditSchemaItemSchema: a152_CreditSchemaItemSchema } = ((
|
|
7561
|
-
const CreditSchemaItemSchema =
|
|
7560
|
+
var { CreditSchemaItemSchema: a152_CreditSchemaItemSchema } = ((z100, FlatCreditSchemaItemSchema, GraduatedCreditSchemaItemSchema) => {
|
|
7561
|
+
const CreditSchemaItemSchema = z100.union([
|
|
7562
7562
|
FlatCreditSchemaItemSchema,
|
|
7563
7563
|
GraduatedCreditSchemaItemSchema
|
|
7564
7564
|
]);
|
|
@@ -7568,17 +7568,17 @@ var { CreditSchemaItemSchema: a152_CreditSchemaItemSchema } = ((z99, FlatCreditS
|
|
|
7568
7568
|
a153_FlatCreditSchemaItemSchema,
|
|
7569
7569
|
a161_GraduatedCreditSchemaItemSchema
|
|
7570
7570
|
);
|
|
7571
|
-
var { PriceTierSchema: a172_PriceTierSchema } = ((
|
|
7572
|
-
const PriceTierSchema =
|
|
7573
|
-
to:
|
|
7571
|
+
var { PriceTierSchema: a172_PriceTierSchema } = ((z100, TierInfinite, AdditionalCurrencyTierArraySchema) => {
|
|
7572
|
+
const PriceTierSchema = z100.object({
|
|
7573
|
+
to: z100.number().or(z100.literal(TierInfinite)).meta({
|
|
7574
7574
|
description: "The maximum amount of usage for this tier.",
|
|
7575
7575
|
example: 100
|
|
7576
7576
|
}),
|
|
7577
|
-
amount:
|
|
7577
|
+
amount: z100.number().optional().meta({
|
|
7578
7578
|
description: "The price of the product item for this tier.",
|
|
7579
7579
|
example: 10
|
|
7580
7580
|
}),
|
|
7581
|
-
flat_amount:
|
|
7581
|
+
flat_amount: z100.number().optional().meta({
|
|
7582
7582
|
description: "A flat fee charged for this tier, in addition to the per-unit amount."
|
|
7583
7583
|
}),
|
|
7584
7584
|
additional_currencies: AdditionalCurrencyTierArraySchema.nullish().meta({
|
|
@@ -7617,8 +7617,8 @@ var {
|
|
|
7617
7617
|
);
|
|
7618
7618
|
var {
|
|
7619
7619
|
AdditionalCurrencyPriceArraySchema: a39_AdditionalCurrencyPriceArraySchema
|
|
7620
|
-
} = ((
|
|
7621
|
-
const AdditionalCurrencyPriceArraySchema =
|
|
7620
|
+
} = ((z100, AdditionalCurrencyPriceSchema, hasNoDuplicateCurrencies, DUPLICATE_CURRENCY_MESSAGE) => {
|
|
7621
|
+
const AdditionalCurrencyPriceArraySchema = z100.array(AdditionalCurrencyPriceSchema).refine(hasNoDuplicateCurrencies, { message: DUPLICATE_CURRENCY_MESSAGE });
|
|
7622
7622
|
return { AdditionalCurrencyPriceArraySchema };
|
|
7623
7623
|
})(
|
|
7624
7624
|
external0,
|
|
@@ -7628,11 +7628,11 @@ var {
|
|
|
7628
7628
|
);
|
|
7629
7629
|
var {
|
|
7630
7630
|
ApiUsageTierWithCurrenciesSchema: a54_ApiUsageTierWithCurrenciesSchema
|
|
7631
|
-
} = ((
|
|
7632
|
-
const ApiUsageTierWithCurrenciesSchema =
|
|
7633
|
-
to:
|
|
7634
|
-
amount:
|
|
7635
|
-
flat_amount:
|
|
7631
|
+
} = ((z100, Infinite, AdditionalCurrencyTierArraySchema) => {
|
|
7632
|
+
const ApiUsageTierWithCurrenciesSchema = z100.object({
|
|
7633
|
+
to: z100.number().or(z100.literal(Infinite)),
|
|
7634
|
+
amount: z100.number().optional(),
|
|
7635
|
+
flat_amount: z100.number().optional(),
|
|
7636
7636
|
additional_currencies: AdditionalCurrencyTierArraySchema.optional().meta({
|
|
7637
7637
|
description: "Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies."
|
|
7638
7638
|
})
|
|
@@ -7643,17 +7643,17 @@ var {
|
|
|
7643
7643
|
path: ["amount", "flat_amount"]
|
|
7644
7644
|
}
|
|
7645
7645
|
).transform((val) => ({ ...val, amount: val.amount ?? 0 })).pipe(
|
|
7646
|
-
|
|
7647
|
-
to:
|
|
7648
|
-
amount:
|
|
7649
|
-
flat_amount:
|
|
7646
|
+
z100.object({
|
|
7647
|
+
to: z100.number().or(z100.literal(Infinite)),
|
|
7648
|
+
amount: z100.number(),
|
|
7649
|
+
flat_amount: z100.number().optional(),
|
|
7650
7650
|
additional_currencies: AdditionalCurrencyTierArraySchema.optional()
|
|
7651
7651
|
})
|
|
7652
7652
|
);
|
|
7653
7653
|
return { ApiUsageTierWithCurrenciesSchema };
|
|
7654
7654
|
})(external0, a55_Infinite, a56_AdditionalCurrencyTierArraySchema);
|
|
7655
|
-
var { ApiCreditSchemaItemSchema: a69_ApiCreditSchemaItemSchema } = ((
|
|
7656
|
-
const ApiCreditSchemaItemSchema =
|
|
7655
|
+
var { ApiCreditSchemaItemSchema: a69_ApiCreditSchemaItemSchema } = ((z100, ApiGraduatedCreditSchemaItemSchema, ApiFlatCreditSchemaItemSchema) => {
|
|
7656
|
+
const ApiCreditSchemaItemSchema = z100.union([
|
|
7657
7657
|
ApiGraduatedCreditSchemaItemSchema,
|
|
7658
7658
|
ApiFlatCreditSchemaItemSchema
|
|
7659
7659
|
]);
|
|
@@ -7663,21 +7663,21 @@ var { ApiCreditSchemaItemSchema: a69_ApiCreditSchemaItemSchema } = ((z99, ApiGra
|
|
|
7663
7663
|
a70_ApiGraduatedCreditSchemaItemSchema,
|
|
7664
7664
|
a84_ApiFlatCreditSchemaItemSchema
|
|
7665
7665
|
);
|
|
7666
|
-
var { FeatureConfigOverrideSchema: a151_FeatureConfigOverrideSchema } = ((
|
|
7667
|
-
const FeatureConfigOverrideSchema =
|
|
7668
|
-
schema:
|
|
7666
|
+
var { FeatureConfigOverrideSchema: a151_FeatureConfigOverrideSchema } = ((z100, CreditSchemaItemSchema, FeatureMarkupsOverrideSchema) => {
|
|
7667
|
+
const FeatureConfigOverrideSchema = z100.strictObject({
|
|
7668
|
+
schema: z100.array(CreditSchemaItemSchema).optional(),
|
|
7669
7669
|
markups: FeatureMarkupsOverrideSchema.optional()
|
|
7670
7670
|
});
|
|
7671
7671
|
return { FeatureConfigOverrideSchema };
|
|
7672
7672
|
})(external0, a152_CreditSchemaItemSchema, a162_FeatureMarkupsOverrideSchema);
|
|
7673
|
-
var { ProductItemConfigSchema: a174_ProductItemConfigSchema } = ((
|
|
7674
|
-
const ProductItemConfigSchema =
|
|
7675
|
-
threshold_billing:
|
|
7673
|
+
var { ProductItemConfigSchema: a174_ProductItemConfigSchema } = ((z100, AllocatedBillingBehavior, OnIncrease, OnDecrease, RolloverConfigSchema, ItemExpiryConfigSchema, FeatureConfigOverrideSchema) => {
|
|
7674
|
+
const ProductItemConfigSchema = z100.object({
|
|
7675
|
+
threshold_billing: z100.object({ threshold: z100.number().finite().positive() }).nullish().meta({
|
|
7676
7676
|
description: "Bills this many feature units when outstanding overage reaches it."
|
|
7677
7677
|
}),
|
|
7678
|
-
allocated_billing_behavior:
|
|
7679
|
-
on_increase:
|
|
7680
|
-
on_decrease:
|
|
7678
|
+
allocated_billing_behavior: z100.enum(AllocatedBillingBehavior).nullish(),
|
|
7679
|
+
on_increase: z100.enum(OnIncrease).nullish(),
|
|
7680
|
+
on_decrease: z100.enum(OnDecrease).nullish(),
|
|
7681
7681
|
rollover: RolloverConfigSchema.nullish(),
|
|
7682
7682
|
/** Purchased balance expires this long after each purchase. One-off prepaid
|
|
7683
7683
|
* consumable items only — the cadence of recurring items already bounds them. */
|
|
@@ -7696,12 +7696,12 @@ var { ProductItemConfigSchema: a174_ProductItemConfigSchema } = ((z99, Allocated
|
|
|
7696
7696
|
a66_EntitlementExpirySchema,
|
|
7697
7697
|
a151_FeatureConfigOverrideSchema
|
|
7698
7698
|
);
|
|
7699
|
-
var { BasePriceParamsSchema: a34_BasePriceParamsSchema } = ((BasePriceSchema, withSpecDefault,
|
|
7699
|
+
var { BasePriceParamsSchema: a34_BasePriceParamsSchema } = ((BasePriceSchema, withSpecDefault, z100, AdditionalCurrencyPriceArraySchema) => {
|
|
7700
7700
|
const BasePriceParamsSchema = BasePriceSchema.omit({
|
|
7701
7701
|
display: true
|
|
7702
7702
|
}).extend({
|
|
7703
7703
|
interval_count: withSpecDefault({
|
|
7704
|
-
schema:
|
|
7704
|
+
schema: z100.number().optional(),
|
|
7705
7705
|
defaultValue: 1,
|
|
7706
7706
|
description: "Number of intervals per billing cycle. Defaults to 1."
|
|
7707
7707
|
}),
|
|
@@ -7710,16 +7710,16 @@ var { BasePriceParamsSchema: a34_BasePriceParamsSchema } = ((BasePriceSchema, wi
|
|
|
7710
7710
|
description: "Base price amounts in additional currencies. The base 'amount' is in the org's default currency."
|
|
7711
7711
|
}
|
|
7712
7712
|
),
|
|
7713
|
-
base_currency:
|
|
7713
|
+
base_currency: z100.string().optional().meta({
|
|
7714
7714
|
internal: true
|
|
7715
7715
|
}),
|
|
7716
|
-
entitlement_id:
|
|
7716
|
+
entitlement_id: z100.string().optional().meta({
|
|
7717
7717
|
internal: true
|
|
7718
7718
|
}),
|
|
7719
|
-
price_id:
|
|
7719
|
+
price_id: z100.string().optional().meta({
|
|
7720
7720
|
internal: true
|
|
7721
7721
|
}),
|
|
7722
|
-
stripe_price_id:
|
|
7722
|
+
stripe_price_id: z100.string().optional().meta({
|
|
7723
7723
|
description: "Stripe price id this base price is billed under. Set by sync flows to capture the actual Stripe price when it differs from the catalog default.",
|
|
7724
7724
|
internal: true
|
|
7725
7725
|
})
|
|
@@ -7734,36 +7734,36 @@ var { BasePriceParamsSchema: a34_BasePriceParamsSchema } = ((BasePriceSchema, wi
|
|
|
7734
7734
|
external0,
|
|
7735
7735
|
a39_AdditionalCurrencyPriceArraySchema
|
|
7736
7736
|
);
|
|
7737
|
-
var { PlanItemPriceParamsSchema: a53_PlanItemPriceParamsSchema } = ((
|
|
7738
|
-
const PlanItemPriceParamsSchema =
|
|
7739
|
-
stripe_price_id:
|
|
7737
|
+
var { PlanItemPriceParamsSchema: a53_PlanItemPriceParamsSchema } = ((z100, AdditionalCurrencyPriceArraySchema, ApiUsageTierWithCurrenciesSchema, TierBehavior, BillingInterval, BillingMethod, AllocatedBillingFieldSchema) => {
|
|
7738
|
+
const PlanItemPriceParamsSchema = z100.object({
|
|
7739
|
+
stripe_price_id: z100.string().nullish().transform((value) => value ?? void 0).meta({
|
|
7740
7740
|
description: "Stripe price id this feature price is billed under. Set by sync flows to preserve an existing Stripe price.",
|
|
7741
7741
|
internal: true
|
|
7742
7742
|
}).optional(),
|
|
7743
|
-
amount:
|
|
7743
|
+
amount: z100.number().optional().meta({
|
|
7744
7744
|
description: "Price per billing_units after included usage. Either 'amount' or 'tiers' is required."
|
|
7745
7745
|
}),
|
|
7746
7746
|
additional_currencies: AdditionalCurrencyPriceArraySchema.optional().meta({
|
|
7747
7747
|
description: "Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'."
|
|
7748
7748
|
}),
|
|
7749
|
-
tiers:
|
|
7749
|
+
tiers: z100.array(ApiUsageTierWithCurrenciesSchema).optional().meta({
|
|
7750
7750
|
description: "Tiered pricing. Either 'amount' or 'tiers' is required."
|
|
7751
7751
|
}),
|
|
7752
|
-
tier_behavior:
|
|
7753
|
-
interval:
|
|
7752
|
+
tier_behavior: z100.enum(TierBehavior).optional(),
|
|
7753
|
+
interval: z100.enum(BillingInterval).meta({
|
|
7754
7754
|
description: "Billing interval. For consumable features, should match reset.interval."
|
|
7755
7755
|
}),
|
|
7756
|
-
interval_count:
|
|
7756
|
+
interval_count: z100.number().default(1).optional().meta({
|
|
7757
7757
|
description: "Number of intervals per billing cycle. Defaults to 1."
|
|
7758
7758
|
}),
|
|
7759
|
-
billing_units:
|
|
7759
|
+
billing_units: z100.number().default(1).optional().meta({
|
|
7760
7760
|
description: "Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200)."
|
|
7761
7761
|
}),
|
|
7762
|
-
billing_method:
|
|
7762
|
+
billing_method: z100.enum(BillingMethod).meta({
|
|
7763
7763
|
description: "'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go."
|
|
7764
7764
|
}),
|
|
7765
7765
|
allocated_billing: AllocatedBillingFieldSchema,
|
|
7766
|
-
max_purchase:
|
|
7766
|
+
max_purchase: z100.number().nullish().meta({
|
|
7767
7767
|
description: "Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit."
|
|
7768
7768
|
})
|
|
7769
7769
|
});
|
|
@@ -7777,9 +7777,9 @@ var { PlanItemPriceParamsSchema: a53_PlanItemPriceParamsSchema } = ((z99, Additi
|
|
|
7777
7777
|
a59_BillingMethod,
|
|
7778
7778
|
a60_AllocatedBillingFieldSchema
|
|
7779
7779
|
);
|
|
7780
|
-
var { ApiFeatureOverrideSchema: a68_ApiFeatureOverrideSchema } = ((
|
|
7781
|
-
const ApiFeatureOverrideSchema =
|
|
7782
|
-
credit_schema:
|
|
7780
|
+
var { ApiFeatureOverrideSchema: a68_ApiFeatureOverrideSchema } = ((z100, ApiCreditSchemaItemSchema, ApiFeatureMarkupsOverrideSchema) => {
|
|
7781
|
+
const ApiFeatureOverrideSchema = z100.strictObject({
|
|
7782
|
+
credit_schema: z100.array(ApiCreditSchemaItemSchema).optional().meta({
|
|
7783
7783
|
description: "For credit system features: replaces the feature's credit_schema entirely for customers on this plan."
|
|
7784
7784
|
}),
|
|
7785
7785
|
markups: ApiFeatureMarkupsOverrideSchema.optional().meta({
|
|
@@ -7792,61 +7792,61 @@ var { ApiFeatureOverrideSchema: a68_ApiFeatureOverrideSchema } = ((z99, ApiCredi
|
|
|
7792
7792
|
a69_ApiCreditSchemaItemSchema,
|
|
7793
7793
|
a85_ApiFeatureMarkupsOverrideSchema
|
|
7794
7794
|
);
|
|
7795
|
-
var { ApiPlanItemV1Schema: a114_ApiPlanItemV1Schema } = ((
|
|
7796
|
-
const ApiPlanItemV1Schema =
|
|
7797
|
-
threshold_billing:
|
|
7795
|
+
var { ApiPlanItemV1Schema: a114_ApiPlanItemV1Schema } = ((z100, ApiFeatureV0Schema, ResetInterval, AdditionalCurrencyPriceArraySchema, ApiUsageTierWithCurrenciesSchema, TierBehavior, BillingInterval, BillingMethod, AllocatedBillingFieldSchema, ApiPriceProcessorsSchema, DisplaySchema, RolloverExpiryDurationType, OnIncrease, OnDecrease, EntitlementExpirySchema, ApiFeatureOverrideSchema, additionalCurrencyPlanItemIssues) => {
|
|
7796
|
+
const ApiPlanItemV1Schema = z100.object({
|
|
7797
|
+
threshold_billing: z100.object({ threshold: z100.number().finite().positive() }).nullish().meta({
|
|
7798
7798
|
description: "Bills this many feature units when outstanding overage reaches it."
|
|
7799
7799
|
}),
|
|
7800
|
-
feature_id:
|
|
7800
|
+
feature_id: z100.string().meta({
|
|
7801
7801
|
description: "The ID of the feature this item configures."
|
|
7802
7802
|
}),
|
|
7803
7803
|
feature: ApiFeatureV0Schema.optional().meta({
|
|
7804
7804
|
description: "The full feature object if expanded."
|
|
7805
7805
|
}),
|
|
7806
|
-
included:
|
|
7806
|
+
included: z100.number().meta({
|
|
7807
7807
|
description: "Number of free units included. For consumable features, balance resets to this number each interval."
|
|
7808
7808
|
}),
|
|
7809
|
-
unlimited:
|
|
7809
|
+
unlimited: z100.boolean().meta({
|
|
7810
7810
|
description: "Whether the customer has unlimited access to this feature."
|
|
7811
7811
|
}),
|
|
7812
|
-
pooled:
|
|
7812
|
+
pooled: z100.boolean().default(false).optional().meta({
|
|
7813
7813
|
description: "Whether entity-level grants contribute to a shared customer balance."
|
|
7814
7814
|
}),
|
|
7815
|
-
reset:
|
|
7816
|
-
interval:
|
|
7815
|
+
reset: z100.object({
|
|
7816
|
+
interval: z100.enum(ResetInterval).meta({
|
|
7817
7817
|
description: "The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored."
|
|
7818
7818
|
}),
|
|
7819
|
-
interval_count:
|
|
7819
|
+
interval_count: z100.number().optional().meta({
|
|
7820
7820
|
description: "Number of intervals between resets. Defaults to 1."
|
|
7821
7821
|
})
|
|
7822
7822
|
}).nullable().meta({
|
|
7823
7823
|
description: "Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles."
|
|
7824
7824
|
}),
|
|
7825
|
-
price:
|
|
7826
|
-
amount:
|
|
7825
|
+
price: z100.object({
|
|
7826
|
+
amount: z100.number().optional().meta({
|
|
7827
7827
|
description: "Price per billing_units after included usage is consumed. Mutually exclusive with tiers."
|
|
7828
7828
|
}),
|
|
7829
7829
|
additional_currencies: AdditionalCurrencyPriceArraySchema.optional().meta({
|
|
7830
7830
|
description: "Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier)."
|
|
7831
7831
|
}),
|
|
7832
|
-
tiers:
|
|
7832
|
+
tiers: z100.array(ApiUsageTierWithCurrenciesSchema).optional().meta({
|
|
7833
7833
|
description: "Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required."
|
|
7834
7834
|
}),
|
|
7835
|
-
tier_behavior:
|
|
7836
|
-
interval:
|
|
7835
|
+
tier_behavior: z100.enum(TierBehavior).optional(),
|
|
7836
|
+
interval: z100.enum(BillingInterval).meta({
|
|
7837
7837
|
description: "Billing interval for this price. For consumable features, should match reset.interval."
|
|
7838
7838
|
}),
|
|
7839
|
-
interval_count:
|
|
7839
|
+
interval_count: z100.number().optional().meta({
|
|
7840
7840
|
description: "Number of intervals per billing cycle. Defaults to 1."
|
|
7841
7841
|
}),
|
|
7842
|
-
billing_units:
|
|
7842
|
+
billing_units: z100.number().meta({
|
|
7843
7843
|
description: "Number of units per price increment. Usage is rounded UP to the nearest billing_units when billed (e.g. billing_units=100 means 101 usage rounds to 200)."
|
|
7844
7844
|
}),
|
|
7845
|
-
billing_method:
|
|
7845
|
+
billing_method: z100.enum(BillingMethod).meta({
|
|
7846
7846
|
description: "'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage."
|
|
7847
7847
|
}),
|
|
7848
7848
|
allocated_billing: AllocatedBillingFieldSchema,
|
|
7849
|
-
max_purchase:
|
|
7849
|
+
max_purchase: z100.number().nullable().meta({
|
|
7850
7850
|
description: "Maximum units a customer can purchase beyond included. E.g. if included=100 and max_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit."
|
|
7851
7851
|
}),
|
|
7852
7852
|
processors: ApiPriceProcessorsSchema.optional().meta({
|
|
@@ -7858,27 +7858,27 @@ var { ApiPlanItemV1Schema: a114_ApiPlanItemV1Schema } = ((z99, ApiFeatureV0Schem
|
|
|
7858
7858
|
display: DisplaySchema.optional().meta({
|
|
7859
7859
|
description: "Display text for showing this item in pricing pages."
|
|
7860
7860
|
}),
|
|
7861
|
-
rollover:
|
|
7862
|
-
max:
|
|
7861
|
+
rollover: z100.object({
|
|
7862
|
+
max: z100.number().nullable().meta({
|
|
7863
7863
|
description: "Maximum rollover units. Null for unlimited rollover."
|
|
7864
7864
|
}),
|
|
7865
|
-
max_percentage:
|
|
7865
|
+
max_percentage: z100.number().nullable().optional().meta({
|
|
7866
7866
|
description: "Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max."
|
|
7867
7867
|
}),
|
|
7868
|
-
expiry_duration_type:
|
|
7868
|
+
expiry_duration_type: z100.enum(RolloverExpiryDurationType).meta({
|
|
7869
7869
|
description: "When rolled over units expire."
|
|
7870
7870
|
}),
|
|
7871
|
-
expiry_duration_length:
|
|
7871
|
+
expiry_duration_length: z100.number().optional().meta({
|
|
7872
7872
|
description: "Number of periods before expiry."
|
|
7873
7873
|
})
|
|
7874
7874
|
}).optional().meta({
|
|
7875
7875
|
description: "Rollover configuration for unused units. If set, unused included units roll over to the next period."
|
|
7876
7876
|
}),
|
|
7877
|
-
proration:
|
|
7878
|
-
on_increase:
|
|
7877
|
+
proration: z100.object({
|
|
7878
|
+
on_increase: z100.enum(OnIncrease).optional().meta({
|
|
7879
7879
|
description: "How to handle billing when quantity increases mid-cycle."
|
|
7880
7880
|
}),
|
|
7881
|
-
on_decrease:
|
|
7881
|
+
on_decrease: z100.enum(OnDecrease).optional().meta({
|
|
7882
7882
|
description: "How to handle credits when quantity decreases mid-cycle."
|
|
7883
7883
|
})
|
|
7884
7884
|
}).optional().meta({
|
|
@@ -7890,14 +7890,14 @@ var { ApiPlanItemV1Schema: a114_ApiPlanItemV1Schema } = ((z99, ApiFeatureV0Schem
|
|
|
7890
7890
|
feature_override: ApiFeatureOverrideSchema.optional().meta({
|
|
7891
7891
|
description: "Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema)."
|
|
7892
7892
|
}),
|
|
7893
|
-
entity_feature_id:
|
|
7893
|
+
entity_feature_id: z100.string().optional().meta({
|
|
7894
7894
|
internal: true
|
|
7895
7895
|
}),
|
|
7896
|
-
mapping_identity:
|
|
7897
|
-
entitlement_id:
|
|
7896
|
+
mapping_identity: z100.string().optional().meta({ internal: true }),
|
|
7897
|
+
entitlement_id: z100.string().optional().meta({
|
|
7898
7898
|
internal: true
|
|
7899
7899
|
}),
|
|
7900
|
-
price_id:
|
|
7900
|
+
price_id: z100.string().optional().meta({
|
|
7901
7901
|
internal: true
|
|
7902
7902
|
})
|
|
7903
7903
|
}).check((ctx) => {
|
|
@@ -7952,28 +7952,28 @@ var { ApiPlanItemV1Schema: a114_ApiPlanItemV1Schema } = ((z99, ApiFeatureV0Schem
|
|
|
7952
7952
|
a68_ApiFeatureOverrideSchema,
|
|
7953
7953
|
a90_additionalCurrencyPlanItemIssues
|
|
7954
7954
|
);
|
|
7955
|
-
var { EntitlementSchema: a148_EntitlementSchema } = ((
|
|
7956
|
-
const EntitlementSchema =
|
|
7955
|
+
var { EntitlementSchema: a148_EntitlementSchema } = ((z100, AllowanceType, EntInterval, EntitlementDuration, RolloverConfigSchema, FeatureConfigOverrideSchema) => {
|
|
7956
|
+
const EntitlementSchema = z100.object({
|
|
7957
7957
|
// Required fields - no .optional()
|
|
7958
|
-
id:
|
|
7959
|
-
created_at:
|
|
7960
|
-
internal_feature_id:
|
|
7961
|
-
internal_product_id:
|
|
7962
|
-
internal_reward_id:
|
|
7963
|
-
is_custom:
|
|
7964
|
-
allowance_type:
|
|
7965
|
-
allowance:
|
|
7966
|
-
interval:
|
|
7967
|
-
interval_count:
|
|
7968
|
-
carry_from_previous:
|
|
7969
|
-
entity_feature_id:
|
|
7970
|
-
pooled:
|
|
7958
|
+
id: z100.string(),
|
|
7959
|
+
created_at: z100.number(),
|
|
7960
|
+
internal_feature_id: z100.string(),
|
|
7961
|
+
internal_product_id: z100.string().nullable(),
|
|
7962
|
+
internal_reward_id: z100.string().nullish(),
|
|
7963
|
+
is_custom: z100.boolean().default(false),
|
|
7964
|
+
allowance_type: z100.nativeEnum(AllowanceType).optional().nullable(),
|
|
7965
|
+
allowance: z100.number().nullish(),
|
|
7966
|
+
interval: z100.nativeEnum(EntInterval).optional().nullable(),
|
|
7967
|
+
interval_count: z100.number().default(1),
|
|
7968
|
+
carry_from_previous: z100.boolean().default(false).optional(),
|
|
7969
|
+
entity_feature_id: z100.string().nullish(),
|
|
7970
|
+
pooled: z100.boolean().default(false).optional(),
|
|
7971
7971
|
// Part of create entitlement
|
|
7972
|
-
org_id:
|
|
7973
|
-
feature_id:
|
|
7974
|
-
usage_limit:
|
|
7975
|
-
expiry_duration:
|
|
7976
|
-
expiry_length:
|
|
7972
|
+
org_id: z100.string().optional(),
|
|
7973
|
+
feature_id: z100.string().optional(),
|
|
7974
|
+
usage_limit: z100.number().nullable().optional().default(null),
|
|
7975
|
+
expiry_duration: z100.nativeEnum(EntitlementDuration).nullish(),
|
|
7976
|
+
expiry_length: z100.number().nullish(),
|
|
7977
7977
|
rollover: RolloverConfigSchema.nullish(),
|
|
7978
7978
|
feature_override: FeatureConfigOverrideSchema.nullish()
|
|
7979
7979
|
});
|
|
@@ -7986,116 +7986,116 @@ var { EntitlementSchema: a148_EntitlementSchema } = ((z99, AllowanceType, EntInt
|
|
|
7986
7986
|
a150_RolloverConfigSchema,
|
|
7987
7987
|
a151_FeatureConfigOverrideSchema
|
|
7988
7988
|
);
|
|
7989
|
-
var { ProductItemSchema: a167_ProductItemSchema } = ((
|
|
7990
|
-
const ProductItemSchema =
|
|
7991
|
-
type:
|
|
7989
|
+
var { ProductItemSchema: a167_ProductItemSchema } = ((z100, ProductItemType, ProductItemFeatureType, ApiFeatureV0Schema, Infinite, ProductItemInterval, UsageModel, PriceTierSchema, AdditionalCurrencyPriceArraySchema, TierBehavior, ProductItemConfigSchema) => {
|
|
7990
|
+
const ProductItemSchema = z100.object({
|
|
7991
|
+
type: z100.enum(ProductItemType).nullish().meta({
|
|
7992
7992
|
description: "The type of the product item."
|
|
7993
7993
|
}),
|
|
7994
7994
|
// Feature stuff
|
|
7995
|
-
feature_id:
|
|
7995
|
+
feature_id: z100.string().nullish().meta({
|
|
7996
7996
|
description: "The feature ID of the product item. Should be null for fixed price items."
|
|
7997
7997
|
}),
|
|
7998
|
-
feature_type:
|
|
7998
|
+
feature_type: z100.enum(ProductItemFeatureType).nullish().meta({
|
|
7999
7999
|
internal: true
|
|
8000
8000
|
}),
|
|
8001
8001
|
feature: ApiFeatureV0Schema.nullish().meta({
|
|
8002
8002
|
internal: true
|
|
8003
8003
|
}),
|
|
8004
|
-
included_usage:
|
|
8004
|
+
included_usage: z100.union([z100.number(), z100.literal(Infinite)]).nullish().meta({
|
|
8005
8005
|
description: "The amount of usage included for this feature (per interval)."
|
|
8006
8006
|
}),
|
|
8007
|
-
interval:
|
|
8007
|
+
interval: z100.preprocess((val) => {
|
|
8008
8008
|
if (val === "") {
|
|
8009
8009
|
throw new Error("Interval cannot be empty.");
|
|
8010
8010
|
}
|
|
8011
8011
|
return val;
|
|
8012
|
-
},
|
|
8012
|
+
}, z100.enum(ProductItemInterval).nullish()).meta({
|
|
8013
8013
|
description: "The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off."
|
|
8014
8014
|
}),
|
|
8015
|
-
interval_count:
|
|
8015
|
+
interval_count: z100.number().nullish().meta({
|
|
8016
8016
|
description: "Interval count of the feature."
|
|
8017
8017
|
}),
|
|
8018
|
-
entity_feature_id:
|
|
8018
|
+
entity_feature_id: z100.string().nullish().meta({
|
|
8019
8019
|
description: "The feature ID of the entity (like seats) to track sub-balances for."
|
|
8020
8020
|
}),
|
|
8021
|
-
pooled:
|
|
8021
|
+
pooled: z100.boolean().default(false).optional().meta({
|
|
8022
8022
|
description: "Whether entity-level grants contribute to a shared customer balance."
|
|
8023
8023
|
}),
|
|
8024
8024
|
// Price config
|
|
8025
|
-
usage_model:
|
|
8025
|
+
usage_model: z100.enum(UsageModel).nullish().meta({
|
|
8026
8026
|
description: "Whether the feature should be prepaid upfront or billed for how much they use end of billing period."
|
|
8027
8027
|
}),
|
|
8028
|
-
price:
|
|
8028
|
+
price: z100.number().nullish().meta({
|
|
8029
8029
|
description: "The price of the product item. Should be null if tiered pricing is set."
|
|
8030
8030
|
}),
|
|
8031
|
-
tiers:
|
|
8031
|
+
tiers: z100.array(PriceTierSchema).nullish().meta({
|
|
8032
8032
|
description: "Tiered pricing for the product item. Not applicable for fixed price items."
|
|
8033
8033
|
}),
|
|
8034
8034
|
// Multi-currency: the flat `price` above is in `base_currency`;
|
|
8035
8035
|
// `additional_currencies` holds the same flat price in other currencies.
|
|
8036
|
-
base_currency:
|
|
8036
|
+
base_currency: z100.string().nullish().meta({
|
|
8037
8037
|
internal: true
|
|
8038
8038
|
}),
|
|
8039
8039
|
additional_currencies: AdditionalCurrencyPriceArraySchema.nullish().meta({
|
|
8040
8040
|
description: "Amounts in additional currencies for a flat-priced item. Tiered items carry per-currency amounts on each tier."
|
|
8041
8041
|
}),
|
|
8042
|
-
billing_units:
|
|
8042
|
+
billing_units: z100.number().nullish().meta({
|
|
8043
8043
|
description: "The billing units of the product item (eg $1 for 30 credits)."
|
|
8044
8044
|
}),
|
|
8045
|
-
tier_behavior:
|
|
8045
|
+
tier_behavior: z100.enum(TierBehavior).nullish().meta({
|
|
8046
8046
|
description: "The type of tiered pricing: graduated or volume-based."
|
|
8047
8047
|
}),
|
|
8048
8048
|
// Others
|
|
8049
8049
|
// carry_over_usage: z.boolean().nullish(),
|
|
8050
|
-
reset_usage_when_enabled:
|
|
8050
|
+
reset_usage_when_enabled: z100.boolean().nullish().meta({
|
|
8051
8051
|
description: "Whether the usage should be reset when the product is enabled."
|
|
8052
8052
|
}),
|
|
8053
|
-
display:
|
|
8054
|
-
primary_text:
|
|
8055
|
-
secondary_text:
|
|
8053
|
+
display: z100.object({
|
|
8054
|
+
primary_text: z100.string(),
|
|
8055
|
+
secondary_text: z100.string().nullish()
|
|
8056
8056
|
}).nullish().meta({
|
|
8057
8057
|
internal: true
|
|
8058
8058
|
}),
|
|
8059
8059
|
// Hidden from users for now.
|
|
8060
|
-
usage_limit:
|
|
8060
|
+
usage_limit: z100.number().nullish().meta({
|
|
8061
8061
|
internal: true
|
|
8062
8062
|
}),
|
|
8063
8063
|
config: ProductItemConfigSchema.nullish().meta({
|
|
8064
8064
|
internal: true
|
|
8065
8065
|
}),
|
|
8066
8066
|
// Stored in backend
|
|
8067
|
-
created_at:
|
|
8067
|
+
created_at: z100.number().nullish().meta({
|
|
8068
8068
|
internal: true
|
|
8069
8069
|
}),
|
|
8070
|
-
entitlement_id:
|
|
8070
|
+
entitlement_id: z100.string().nullish().meta({
|
|
8071
8071
|
internal: true
|
|
8072
8072
|
}),
|
|
8073
|
-
price_id:
|
|
8073
|
+
price_id: z100.string().nullish().meta({
|
|
8074
8074
|
internal: true
|
|
8075
8075
|
}),
|
|
8076
8076
|
/** Set only by producers that know the item corresponds to an existing
|
|
8077
8077
|
* Stripe price of the same shape. Flows into Price.config when rebuilt. */
|
|
8078
|
-
stripe_price_id:
|
|
8078
|
+
stripe_price_id: z100.string().nullish().meta({
|
|
8079
8079
|
internal: true
|
|
8080
8080
|
}),
|
|
8081
8081
|
/** Caller-adopted Stripe price. Validated to exist before it is honoured. */
|
|
8082
|
-
stripe_prepaid_price_v2_id:
|
|
8082
|
+
stripe_prepaid_price_v2_id: z100.string().nullish().meta({
|
|
8083
8083
|
internal: true
|
|
8084
8084
|
}),
|
|
8085
|
-
price_interval:
|
|
8085
|
+
price_interval: z100.enum(ProductItemInterval).nullish().meta({
|
|
8086
8086
|
internal: true
|
|
8087
8087
|
}),
|
|
8088
|
-
price_interval_count:
|
|
8088
|
+
price_interval_count: z100.number().nullish().meta({
|
|
8089
8089
|
internal: true
|
|
8090
8090
|
}),
|
|
8091
8091
|
/** One-way Price → ProductItem display context. Never read this back when
|
|
8092
8092
|
* rebuilding a price because an edited item may carry stale Stripe IDs. */
|
|
8093
|
-
price_config:
|
|
8093
|
+
price_config: z100.any().nullish().meta({
|
|
8094
8094
|
internal: true
|
|
8095
8095
|
}),
|
|
8096
8096
|
/** Editor-only handle for items with no persisted entitlement/price id yet,
|
|
8097
8097
|
* so two unsaved items for one feature stay individually addressable. */
|
|
8098
|
-
_uid:
|
|
8098
|
+
_uid: z100.string().nullish().meta({
|
|
8099
8099
|
internal: true
|
|
8100
8100
|
})
|
|
8101
8101
|
});
|
|
@@ -8113,27 +8113,27 @@ var { ProductItemSchema: a167_ProductItemSchema } = ((z99, ProductItemType, Prod
|
|
|
8113
8113
|
a58_TierBehavior,
|
|
8114
8114
|
a174_ProductItemConfigSchema
|
|
8115
8115
|
);
|
|
8116
|
-
var { ProductV2Schema: a180_ProductV2Schema } = ((
|
|
8117
|
-
const ProductV2Schema =
|
|
8118
|
-
internal_id:
|
|
8119
|
-
id:
|
|
8120
|
-
name:
|
|
8121
|
-
description:
|
|
8122
|
-
is_add_on:
|
|
8123
|
-
is_default:
|
|
8124
|
-
version:
|
|
8125
|
-
version_slug:
|
|
8126
|
-
active:
|
|
8127
|
-
group:
|
|
8128
|
-
env:
|
|
8116
|
+
var { ProductV2Schema: a180_ProductV2Schema } = ((z100, AppEnv, ApiFreeTrialSchema, ProductItemSchema, ProductConfigSchema, CustomerBillingControlsSchema, ProductMetadataSchema) => {
|
|
8117
|
+
const ProductV2Schema = z100.object({
|
|
8118
|
+
internal_id: z100.string().nullish(),
|
|
8119
|
+
id: z100.string(),
|
|
8120
|
+
name: z100.string(),
|
|
8121
|
+
description: z100.string().nullish(),
|
|
8122
|
+
is_add_on: z100.boolean(),
|
|
8123
|
+
is_default: z100.boolean(),
|
|
8124
|
+
version: z100.number().default(1),
|
|
8125
|
+
version_slug: z100.string().nullable().optional(),
|
|
8126
|
+
active: z100.boolean().optional(),
|
|
8127
|
+
group: z100.string().nullable(),
|
|
8128
|
+
env: z100.nativeEnum(AppEnv),
|
|
8129
8129
|
// free_trial: FreeTrialSchema.nullish(),
|
|
8130
8130
|
free_trial: ApiFreeTrialSchema.nullish(),
|
|
8131
|
-
items:
|
|
8132
|
-
created_at:
|
|
8133
|
-
stripe_id:
|
|
8134
|
-
archived:
|
|
8135
|
-
base_internal_product_id:
|
|
8136
|
-
base_id:
|
|
8131
|
+
items: z100.array(ProductItemSchema),
|
|
8132
|
+
created_at: z100.number(),
|
|
8133
|
+
stripe_id: z100.string().nullish(),
|
|
8134
|
+
archived: z100.boolean().default(false).nullish(),
|
|
8135
|
+
base_internal_product_id: z100.string().nullish(),
|
|
8136
|
+
base_id: z100.string().nullish(),
|
|
8137
8137
|
config: ProductConfigSchema.partial().optional(),
|
|
8138
8138
|
billing_controls: CustomerBillingControlsSchema.optional(),
|
|
8139
8139
|
metadata: ProductMetadataSchema.optional()
|
|
@@ -8148,29 +8148,29 @@ var { ProductV2Schema: a180_ProductV2Schema } = ((z99, AppEnv, ApiFreeTrialSchem
|
|
|
8148
8148
|
a123_CustomerBillingControlsSchema,
|
|
8149
8149
|
a28_ProductMetadataSchema
|
|
8150
8150
|
);
|
|
8151
|
-
var { PlanItemParamsObjectSchema: a51_PlanItemParamsObjectSchema } = ((
|
|
8152
|
-
const PlanItemParamsObjectSchema =
|
|
8153
|
-
threshold_billing:
|
|
8151
|
+
var { PlanItemParamsObjectSchema: a51_PlanItemParamsObjectSchema } = ((z100, IncludedUsageParamsSchema, ResetInterval, withSpecDefault, PlanItemPriceParamsSchema, PLAN_ITEM_PRICE_DESCRIPTION, OnIncrease, OnDecrease, RolloverExpiryDurationType, EntitlementExpirySchema, ApiFeatureOverrideSchema) => {
|
|
8152
|
+
const PlanItemParamsObjectSchema = z100.object({
|
|
8153
|
+
threshold_billing: z100.object({ threshold: z100.number().finite().positive() }).nullish().meta({
|
|
8154
8154
|
description: "Bills this many feature units when outstanding overage reaches it."
|
|
8155
8155
|
}),
|
|
8156
|
-
feature_id:
|
|
8156
|
+
feature_id: z100.string().meta({
|
|
8157
8157
|
description: "The ID of the feature to configure."
|
|
8158
8158
|
}),
|
|
8159
8159
|
included: IncludedUsageParamsSchema.optional().meta({
|
|
8160
8160
|
description: "Number of free units included. Balance resets to this each interval for consumable features."
|
|
8161
8161
|
}),
|
|
8162
|
-
unlimited:
|
|
8162
|
+
unlimited: z100.boolean().optional().meta({
|
|
8163
8163
|
description: "If true, customer has unlimited access to this feature."
|
|
8164
8164
|
}),
|
|
8165
|
-
pooled:
|
|
8165
|
+
pooled: z100.boolean().default(false).optional().meta({
|
|
8166
8166
|
description: "Whether entity-level grants contribute to a shared customer balance."
|
|
8167
8167
|
}),
|
|
8168
|
-
reset:
|
|
8169
|
-
interval:
|
|
8168
|
+
reset: z100.object({
|
|
8169
|
+
interval: z100.enum(ResetInterval).meta({
|
|
8170
8170
|
description: "Interval at which balance resets (e.g. 'month', 'year'). For consumable features only."
|
|
8171
8171
|
}),
|
|
8172
8172
|
interval_count: withSpecDefault({
|
|
8173
|
-
schema:
|
|
8173
|
+
schema: z100.number().optional(),
|
|
8174
8174
|
defaultValue: 1,
|
|
8175
8175
|
description: "Number of intervals between resets. Defaults to 1."
|
|
8176
8176
|
})
|
|
@@ -8180,27 +8180,27 @@ var { PlanItemParamsObjectSchema: a51_PlanItemParamsObjectSchema } = ((z99, Incl
|
|
|
8180
8180
|
price: PlanItemPriceParamsSchema.optional().meta({
|
|
8181
8181
|
description: PLAN_ITEM_PRICE_DESCRIPTION
|
|
8182
8182
|
}),
|
|
8183
|
-
proration:
|
|
8184
|
-
on_increase:
|
|
8183
|
+
proration: z100.object({
|
|
8184
|
+
on_increase: z100.enum(OnIncrease).meta({
|
|
8185
8185
|
description: "Billing behavior when quantity increases mid-cycle."
|
|
8186
8186
|
}),
|
|
8187
|
-
on_decrease:
|
|
8187
|
+
on_decrease: z100.enum(OnDecrease).meta({
|
|
8188
8188
|
description: "Credit behavior when quantity decreases mid-cycle."
|
|
8189
8189
|
})
|
|
8190
8190
|
}).optional().meta({
|
|
8191
8191
|
description: "Proration settings for prepaid features. Controls mid-cycle quantity change billing."
|
|
8192
8192
|
}),
|
|
8193
|
-
rollover:
|
|
8194
|
-
max:
|
|
8193
|
+
rollover: z100.object({
|
|
8194
|
+
max: z100.number().optional().meta({
|
|
8195
8195
|
description: "Max rollover units. Omit for unlimited rollover."
|
|
8196
8196
|
}),
|
|
8197
|
-
max_percentage:
|
|
8197
|
+
max_percentage: z100.number().optional().meta({
|
|
8198
8198
|
description: "Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max."
|
|
8199
8199
|
}),
|
|
8200
|
-
expiry_duration_type:
|
|
8200
|
+
expiry_duration_type: z100.enum(RolloverExpiryDurationType).meta({
|
|
8201
8201
|
description: "When rolled over units expire."
|
|
8202
8202
|
}),
|
|
8203
|
-
expiry_duration_length:
|
|
8203
|
+
expiry_duration_length: z100.number().optional().meta({
|
|
8204
8204
|
description: "Number of periods before expiry."
|
|
8205
8205
|
})
|
|
8206
8206
|
}).optional().meta({
|
|
@@ -8212,13 +8212,13 @@ var { PlanItemParamsObjectSchema: a51_PlanItemParamsObjectSchema } = ((z99, Incl
|
|
|
8212
8212
|
feature_override: ApiFeatureOverrideSchema.optional().meta({
|
|
8213
8213
|
description: "Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema)."
|
|
8214
8214
|
}),
|
|
8215
|
-
entity_feature_id:
|
|
8215
|
+
entity_feature_id: z100.string().optional().meta({
|
|
8216
8216
|
internal: true
|
|
8217
8217
|
}),
|
|
8218
|
-
entitlement_id:
|
|
8218
|
+
entitlement_id: z100.string().optional().meta({
|
|
8219
8219
|
internal: true
|
|
8220
8220
|
}),
|
|
8221
|
-
price_id:
|
|
8221
|
+
price_id: z100.string().optional().meta({
|
|
8222
8222
|
internal: true
|
|
8223
8223
|
})
|
|
8224
8224
|
});
|
|
@@ -8238,14 +8238,14 @@ var { PlanItemParamsObjectSchema: a51_PlanItemParamsObjectSchema } = ((z99, Incl
|
|
|
8238
8238
|
);
|
|
8239
8239
|
var {
|
|
8240
8240
|
FullProductWithoutLicensesSchema: a137_FullProductWithoutLicensesSchema
|
|
8241
|
-
} = ((ProductSchema,
|
|
8241
|
+
} = ((ProductSchema, z100, PriceSchema, EntitlementSchema, FeatureSchema, FreeTrialSchema) => {
|
|
8242
8242
|
const FullProductWithoutLicensesSchema = ProductSchema.extend({
|
|
8243
|
-
description:
|
|
8244
|
-
prices:
|
|
8245
|
-
entitlements:
|
|
8243
|
+
description: z100.string().nullable().optional().default(null),
|
|
8244
|
+
prices: z100.array(PriceSchema),
|
|
8245
|
+
entitlements: z100.array(EntitlementSchema.extend({ feature: FeatureSchema })),
|
|
8246
8246
|
free_trial: FreeTrialSchema.nullish(),
|
|
8247
|
-
free_trials:
|
|
8248
|
-
free_trial_ids:
|
|
8247
|
+
free_trials: z100.array(FreeTrialSchema).nullish(),
|
|
8248
|
+
free_trial_ids: z100.array(z100.string()).nullish()
|
|
8249
8249
|
});
|
|
8250
8250
|
return { FullProductWithoutLicensesSchema };
|
|
8251
8251
|
})(
|
|
@@ -8256,9 +8256,9 @@ var {
|
|
|
8256
8256
|
a133_FeatureSchema,
|
|
8257
8257
|
a136_FreeTrialSchema
|
|
8258
8258
|
);
|
|
8259
|
-
var { CreateProductItemParamsSchema: a166_CreateProductItemParamsSchema } = ((ProductItemSchema, IncludedUsageParamsSchema,
|
|
8259
|
+
var { CreateProductItemParamsSchema: a166_CreateProductItemParamsSchema } = ((ProductItemSchema, IncludedUsageParamsSchema, z100, Infinite) => {
|
|
8260
8260
|
const CreateProductItemParamsSchema = ProductItemSchema.extend({
|
|
8261
|
-
included_usage: IncludedUsageParamsSchema.or(
|
|
8261
|
+
included_usage: IncludedUsageParamsSchema.or(z100.literal(Infinite)).nullish()
|
|
8262
8262
|
});
|
|
8263
8263
|
return { CreateProductItemParamsSchema };
|
|
8264
8264
|
})(
|
|
@@ -8280,11 +8280,11 @@ var { CreatePlanItemParamsV1Schema: a50_CreatePlanItemParamsV1Schema } = ((PlanI
|
|
|
8280
8280
|
});
|
|
8281
8281
|
return { CreatePlanItemParamsV1Schema };
|
|
8282
8282
|
})(a51_PlanItemParamsObjectSchema, a89_planItemParamsIssues);
|
|
8283
|
-
var { LicenseCustomizeSchema: a109_LicenseCustomizeSchema } = ((
|
|
8284
|
-
const LicenseCustomizeSchema =
|
|
8283
|
+
var { LicenseCustomizeSchema: a109_LicenseCustomizeSchema } = ((z100, BasePriceParamsSchema, CreatePlanItemParamsV1Schema, PlanItemFilterSchema) => {
|
|
8284
|
+
const LicenseCustomizeSchema = z100.object({
|
|
8285
8285
|
price: BasePriceParamsSchema.nullable().optional(),
|
|
8286
|
-
add_items:
|
|
8287
|
-
remove_items:
|
|
8286
|
+
add_items: z100.array(CreatePlanItemParamsV1Schema).optional(),
|
|
8287
|
+
remove_items: z100.array(PlanItemFilterSchema).optional()
|
|
8288
8288
|
});
|
|
8289
8289
|
return { LicenseCustomizeSchema };
|
|
8290
8290
|
})(
|
|
@@ -8293,51 +8293,51 @@ var { LicenseCustomizeSchema: a109_LicenseCustomizeSchema } = ((z99, BasePricePa
|
|
|
8293
8293
|
a50_CreatePlanItemParamsV1Schema,
|
|
8294
8294
|
a91_PlanItemFilterSchema
|
|
8295
8295
|
);
|
|
8296
|
-
var { PlanLicenseParamsSchema: a175_PlanLicenseParamsSchema } = ((
|
|
8297
|
-
const PlanLicenseParamsSchema =
|
|
8298
|
-
license_plan_id:
|
|
8296
|
+
var { PlanLicenseParamsSchema: a175_PlanLicenseParamsSchema } = ((z100, LicenseCustomizeSchema) => {
|
|
8297
|
+
const PlanLicenseParamsSchema = z100.object({
|
|
8298
|
+
license_plan_id: z100.string(),
|
|
8299
8299
|
/** Child version to anchor to. Stated = that slug's row; omitted keeps the existing link (new links use the child's active row). */
|
|
8300
|
-
version_slug:
|
|
8301
|
-
included:
|
|
8302
|
-
prepaid_only:
|
|
8300
|
+
version_slug: z100.string().optional(),
|
|
8301
|
+
included: z100.number().int().min(0).optional(),
|
|
8302
|
+
prepaid_only: z100.boolean().optional(),
|
|
8303
8303
|
customize: LicenseCustomizeSchema.nullish(),
|
|
8304
|
-
metadata:
|
|
8304
|
+
metadata: z100.record(z100.string(), z100.unknown()).optional()
|
|
8305
8305
|
});
|
|
8306
8306
|
return { PlanLicenseParamsSchema };
|
|
8307
8307
|
})(external0, a109_LicenseCustomizeSchema);
|
|
8308
|
-
var { UpdateProductV2ParamsSchema: a179_UpdateProductV2ParamsSchema } = ((
|
|
8309
|
-
const UpdateProductV2ParamsSchema =
|
|
8310
|
-
id:
|
|
8308
|
+
var { UpdateProductV2ParamsSchema: a179_UpdateProductV2ParamsSchema } = ((z100, idRegex, descriptions, CreateProductItemParamsSchema, PlanLicenseParamsSchema, CreateFreeTrialSchema, ProductConfigParamsSchema, CustomerBillingControlsParamsSchema, ProductMetadataSchema) => {
|
|
8309
|
+
const UpdateProductV2ParamsSchema = z100.object({
|
|
8310
|
+
id: z100.string().nonempty().regex(idRegex).optional().meta({
|
|
8311
8311
|
description: descriptions.id
|
|
8312
8312
|
}),
|
|
8313
|
-
name:
|
|
8313
|
+
name: z100.string().refine((val) => val.length > 0, {
|
|
8314
8314
|
message: "name must be a non-empty string"
|
|
8315
8315
|
}).optional().meta({
|
|
8316
8316
|
description: descriptions.name
|
|
8317
8317
|
}),
|
|
8318
|
-
is_add_on:
|
|
8318
|
+
is_add_on: z100.boolean().optional().meta({
|
|
8319
8319
|
description: descriptions.is_add_on
|
|
8320
8320
|
}),
|
|
8321
|
-
is_default:
|
|
8321
|
+
is_default: z100.boolean().optional().meta({
|
|
8322
8322
|
description: descriptions.is_default
|
|
8323
8323
|
}),
|
|
8324
|
-
base_plan_id:
|
|
8324
|
+
base_plan_id: z100.string().nonempty().regex(idRegex).nullable().optional().meta({
|
|
8325
8325
|
description: "The base plan this plan should be linked to as a variant. Set to null to detach it from its base plan."
|
|
8326
8326
|
}),
|
|
8327
|
-
description:
|
|
8327
|
+
description: z100.string().nullish().optional().meta({
|
|
8328
8328
|
description: descriptions.description
|
|
8329
8329
|
}),
|
|
8330
8330
|
// version: z.number().optional().meta({
|
|
8331
8331
|
// internal: true,
|
|
8332
8332
|
// }),
|
|
8333
|
-
group:
|
|
8333
|
+
group: z100.string().nonempty().nullable().optional().meta({
|
|
8334
8334
|
description: descriptions.group
|
|
8335
8335
|
}),
|
|
8336
|
-
archived:
|
|
8336
|
+
archived: z100.boolean().optional().meta({
|
|
8337
8337
|
description: descriptions.archived
|
|
8338
8338
|
}),
|
|
8339
|
-
items:
|
|
8340
|
-
licenses:
|
|
8339
|
+
items: z100.array(CreateProductItemParamsSchema).optional(),
|
|
8340
|
+
licenses: z100.array(PlanLicenseParamsSchema).optional().meta({
|
|
8341
8341
|
internal: true,
|
|
8342
8342
|
description: "Plans offered as assignable licenses under this plan. The full set replaces existing links."
|
|
8343
8343
|
}),
|
|
@@ -8366,34 +8366,34 @@ var { UpdateProductV2ParamsSchema: a179_UpdateProductV2ParamsSchema } = ((z99, i
|
|
|
8366
8366
|
a95_CustomerBillingControlsParamsSchema,
|
|
8367
8367
|
a28_ProductMetadataSchema
|
|
8368
8368
|
);
|
|
8369
|
-
var { CreatePlanParamsV1Schema: a184_CreatePlanParamsV1Schema } = ((
|
|
8370
|
-
const CreatePlanParamsV1Schema =
|
|
8371
|
-
id:
|
|
8369
|
+
var { CreatePlanParamsV1Schema: a184_CreatePlanParamsV1Schema } = ((z100, idRegex, BasePriceParamsSchema, CreatePlanItemParamsV1Schema, PlanLicenseParamsSchema, FreeTrialParamsV1Schema, ProductConfigParamsSchema, PlanBillingControlsParamsSchema, ProductMetadataSchema) => {
|
|
8370
|
+
const CreatePlanParamsV1Schema = z100.object({
|
|
8371
|
+
id: z100.string().nonempty().regex(idRegex).meta({
|
|
8372
8372
|
description: "Unique identifier for the plan."
|
|
8373
8373
|
}),
|
|
8374
|
-
group:
|
|
8374
|
+
group: z100.string().default("").meta({
|
|
8375
8375
|
description: "Group identifier for organizing related plans. Plans in the same group are mutually exclusive."
|
|
8376
8376
|
}),
|
|
8377
|
-
name:
|
|
8377
|
+
name: z100.string().nonempty().meta({
|
|
8378
8378
|
description: "Display name of the plan."
|
|
8379
8379
|
}),
|
|
8380
|
-
description:
|
|
8380
|
+
description: z100.string().nullable().default(null).meta({
|
|
8381
8381
|
description: "Optional description of the plan."
|
|
8382
8382
|
}),
|
|
8383
|
-
add_on:
|
|
8383
|
+
add_on: z100.boolean().default(false).meta({
|
|
8384
8384
|
description: "If true, this plan can be attached alongside other plans. Otherwise, attaching replaces existing plans in the same group."
|
|
8385
8385
|
}),
|
|
8386
|
-
auto_enable:
|
|
8386
|
+
auto_enable: z100.boolean().default(false).meta({
|
|
8387
8387
|
description: "If true, plan is automatically attached when a customer is created. Use for free tiers."
|
|
8388
8388
|
}),
|
|
8389
8389
|
price: BasePriceParamsSchema.optional().meta({
|
|
8390
8390
|
description: "Base recurring price for the plan. Omit for free or usage-only plans."
|
|
8391
8391
|
}),
|
|
8392
|
-
items:
|
|
8392
|
+
items: z100.array(CreatePlanItemParamsV1Schema).optional().meta({
|
|
8393
8393
|
description: "Feature configurations for this plan. Each item defines included units, pricing, and reset behavior."
|
|
8394
8394
|
}),
|
|
8395
8395
|
// internal: dashboard-only license catalog surface, not part of the public plan API yet.
|
|
8396
|
-
licenses:
|
|
8396
|
+
licenses: z100.array(PlanLicenseParamsSchema).optional().meta({
|
|
8397
8397
|
internal: true,
|
|
8398
8398
|
description: "Plans offered as assignable licenses under this plan. The full set replaces existing links."
|
|
8399
8399
|
}),
|
|
@@ -8409,7 +8409,7 @@ var { CreatePlanParamsV1Schema: a184_CreatePlanParamsV1Schema } = ((z99, idRegex
|
|
|
8409
8409
|
metadata: ProductMetadataSchema.optional().meta({
|
|
8410
8410
|
description: "Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan."
|
|
8411
8411
|
}),
|
|
8412
|
-
create_in_stripe:
|
|
8412
|
+
create_in_stripe: z100.boolean().default(true).meta({
|
|
8413
8413
|
internal: true
|
|
8414
8414
|
})
|
|
8415
8415
|
});
|
|
@@ -8425,18 +8425,18 @@ var { CreatePlanParamsV1Schema: a184_CreatePlanParamsV1Schema } = ((z99, idRegex
|
|
|
8425
8425
|
a185_PlanBillingControlsParamsSchema,
|
|
8426
8426
|
a28_ProductMetadataSchema
|
|
8427
8427
|
);
|
|
8428
|
-
var { UpdatePlanParamsV1Schema: a189_UpdatePlanParamsV1Schema } = ((CreatePlanParamsV1Schema,
|
|
8428
|
+
var { UpdatePlanParamsV1Schema: a189_UpdatePlanParamsV1Schema } = ((CreatePlanParamsV1Schema, z100, BasePriceParamsSchema, FreeTrialParamsV1Schema, idRegex) => {
|
|
8429
8429
|
const UpdatePlanParamsV1Schema = CreatePlanParamsV1Schema.partial().extend({
|
|
8430
8430
|
group: CreatePlanParamsV1Schema.shape.group.removeDefault().optional(),
|
|
8431
|
-
version:
|
|
8432
|
-
archived:
|
|
8431
|
+
version: z100.number().optional(),
|
|
8432
|
+
archived: z100.boolean().default(false).optional(),
|
|
8433
8433
|
price: BasePriceParamsSchema.nullable().optional().meta({
|
|
8434
8434
|
description: "The price of the plan. Set to null to remove the base price."
|
|
8435
8435
|
}),
|
|
8436
8436
|
free_trial: FreeTrialParamsV1Schema.nullable().optional().meta({
|
|
8437
8437
|
description: "The free trial of the plan. Set to null to remove the free trial."
|
|
8438
8438
|
}),
|
|
8439
|
-
base_plan_id:
|
|
8439
|
+
base_plan_id: z100.string().nonempty().regex(idRegex).nullable().optional().meta({
|
|
8440
8440
|
description: "The base plan this plan should be linked to as a variant. Set to null to detach it from its base plan."
|
|
8441
8441
|
})
|
|
8442
8442
|
});
|
|
@@ -8448,45 +8448,45 @@ var { UpdatePlanParamsV1Schema: a189_UpdatePlanParamsV1Schema } = ((CreatePlanPa
|
|
|
8448
8448
|
a93_FreeTrialParamsV1Schema,
|
|
8449
8449
|
a164_idRegex
|
|
8450
8450
|
);
|
|
8451
|
-
var { CustomizePlanLicenseSchema: a108_CustomizePlanLicenseSchema } = ((
|
|
8452
|
-
const CustomizePlanLicenseSchema =
|
|
8453
|
-
license_plan_id:
|
|
8451
|
+
var { CustomizePlanLicenseSchema: a108_CustomizePlanLicenseSchema } = ((z100, LicenseCustomizeSchema) => {
|
|
8452
|
+
const CustomizePlanLicenseSchema = z100.object({
|
|
8453
|
+
license_plan_id: z100.string(),
|
|
8454
8454
|
/** Child version to anchor to. Stated = that slug's row; omitted keeps the existing link (new links use the child's active row). */
|
|
8455
|
-
version_slug:
|
|
8456
|
-
included:
|
|
8457
|
-
prepaid_only:
|
|
8455
|
+
version_slug: z100.string().optional(),
|
|
8456
|
+
included: z100.number().int().min(0).optional(),
|
|
8457
|
+
prepaid_only: z100.boolean().optional(),
|
|
8458
8458
|
customize: LicenseCustomizeSchema.nullish(),
|
|
8459
|
-
metadata:
|
|
8459
|
+
metadata: z100.record(z100.string(), z100.unknown()).optional()
|
|
8460
8460
|
});
|
|
8461
8461
|
return { CustomizePlanLicenseSchema };
|
|
8462
8462
|
})(external0, a109_LicenseCustomizeSchema);
|
|
8463
|
-
var { CreateProductV2ParamsSchema: a163_CreateProductV2ParamsSchema } = ((
|
|
8464
|
-
const CreateProductV2ParamsSchema =
|
|
8465
|
-
id:
|
|
8463
|
+
var { CreateProductV2ParamsSchema: a163_CreateProductV2ParamsSchema } = ((z100, idRegex, descriptions, CreateProductItemParamsSchema, PlanLicenseParamsSchema, CreateFreeTrialSchema, ProductConfigParamsSchema, CustomerBillingControlsParamsSchema, ProductMetadataSchema, CREATE_PRODUCT_EXAMPLE) => {
|
|
8464
|
+
const CreateProductV2ParamsSchema = z100.object({
|
|
8465
|
+
id: z100.string().nonempty().regex(idRegex).meta({
|
|
8466
8466
|
description: descriptions.id
|
|
8467
8467
|
}),
|
|
8468
|
-
name:
|
|
8468
|
+
name: z100.string().refine((val) => val.length > 0, {
|
|
8469
8469
|
message: "name must be a non-empty string"
|
|
8470
8470
|
}).meta({
|
|
8471
8471
|
description: descriptions.name
|
|
8472
8472
|
}),
|
|
8473
|
-
description:
|
|
8473
|
+
description: z100.string().nullish().meta({
|
|
8474
8474
|
description: descriptions.description
|
|
8475
8475
|
}),
|
|
8476
|
-
is_add_on:
|
|
8476
|
+
is_add_on: z100.boolean().default(false).meta({
|
|
8477
8477
|
description: descriptions.is_add_on
|
|
8478
8478
|
}),
|
|
8479
|
-
is_default:
|
|
8479
|
+
is_default: z100.boolean().default(false).meta({
|
|
8480
8480
|
description: descriptions.is_default
|
|
8481
8481
|
}),
|
|
8482
|
-
group:
|
|
8482
|
+
group: z100.string().nullable().default("").meta({
|
|
8483
8483
|
description: descriptions.group
|
|
8484
8484
|
}),
|
|
8485
|
-
items:
|
|
8485
|
+
items: z100.array(CreateProductItemParamsSchema).optional().meta({
|
|
8486
8486
|
description: descriptions.items
|
|
8487
8487
|
}),
|
|
8488
8488
|
// internal: dashboard-only license catalog surface, not part of the public product API yet.
|
|
8489
|
-
licenses:
|
|
8489
|
+
licenses: z100.array(PlanLicenseParamsSchema).optional().meta({
|
|
8490
8490
|
internal: true,
|
|
8491
8491
|
description: "Plans offered as assignable licenses under this plan. The full set replaces existing links."
|
|
8492
8492
|
}),
|
|
@@ -8502,13 +8502,13 @@ var { CreateProductV2ParamsSchema: a163_CreateProductV2ParamsSchema } = ((z99, i
|
|
|
8502
8502
|
metadata: ProductMetadataSchema.optional().meta({
|
|
8503
8503
|
description: descriptions.metadata
|
|
8504
8504
|
}),
|
|
8505
|
-
create_in_stripe:
|
|
8505
|
+
create_in_stripe: z100.boolean().optional().meta({
|
|
8506
8506
|
internal: true
|
|
8507
8507
|
}),
|
|
8508
|
-
archived:
|
|
8508
|
+
archived: z100.boolean().optional().meta({
|
|
8509
8509
|
internal: true
|
|
8510
8510
|
}),
|
|
8511
|
-
base_internal_product_id:
|
|
8511
|
+
base_internal_product_id: z100.string().nullable().optional().meta({
|
|
8512
8512
|
internal: true
|
|
8513
8513
|
})
|
|
8514
8514
|
}).meta({
|
|
@@ -8527,21 +8527,21 @@ var { CreateProductV2ParamsSchema: a163_CreateProductV2ParamsSchema } = ((z99, i
|
|
|
8527
8527
|
a28_ProductMetadataSchema,
|
|
8528
8528
|
a178_CREATE_PRODUCT_EXAMPLE
|
|
8529
8529
|
);
|
|
8530
|
-
var { CustomizePlanV1BaseSchema: a33_CustomizePlanV1BaseSchema } = ((
|
|
8531
|
-
const CustomizePlanV1BaseSchema =
|
|
8530
|
+
var { CustomizePlanV1BaseSchema: a33_CustomizePlanV1BaseSchema } = ((z100, BasePriceParamsSchema, CreatePlanItemParamsV1Schema, PlanItemFilterSchema, UpdatePlanItemParamsV1Schema, FreeTrialParamsV1Schema, CustomerBillingControlsParamsSchema, CustomizePlanLicenseSchema, RemovePlanLicenseSchema) => {
|
|
8531
|
+
const CustomizePlanV1BaseSchema = z100.object({
|
|
8532
8532
|
price: BasePriceParamsSchema.nullable().optional().meta({
|
|
8533
8533
|
description: "Override the base price of the plan. Pass null to remove the base price."
|
|
8534
8534
|
}),
|
|
8535
|
-
items:
|
|
8535
|
+
items: z100.array(CreatePlanItemParamsV1Schema).optional().meta({
|
|
8536
8536
|
description: "Override the items in the plan (PUT-style \u2014 replaces all existing items). Mutually exclusive with add_items / remove_items / deprecated update_items."
|
|
8537
8537
|
}),
|
|
8538
|
-
add_items:
|
|
8538
|
+
add_items: z100.array(CreatePlanItemParamsV1Schema).optional().meta({
|
|
8539
8539
|
description: "Items to add to the plan."
|
|
8540
8540
|
}),
|
|
8541
|
-
remove_items:
|
|
8541
|
+
remove_items: z100.array(PlanItemFilterSchema).optional().meta({
|
|
8542
8542
|
description: "Filters selecting items to remove from the plan."
|
|
8543
8543
|
}),
|
|
8544
|
-
update_items:
|
|
8544
|
+
update_items: z100.array(UpdatePlanItemParamsV1Schema).optional().meta({
|
|
8545
8545
|
description: "Deprecated. Use remove_items and add_items to replace matched plan items.",
|
|
8546
8546
|
internal: true,
|
|
8547
8547
|
deprecated: true
|
|
@@ -8552,10 +8552,10 @@ var { CustomizePlanV1BaseSchema: a33_CustomizePlanV1BaseSchema } = ((z99, BasePr
|
|
|
8552
8552
|
billing_controls: CustomerBillingControlsParamsSchema.optional().meta({
|
|
8553
8553
|
description: "Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer."
|
|
8554
8554
|
}),
|
|
8555
|
-
upsert_licenses:
|
|
8555
|
+
upsert_licenses: z100.array(CustomizePlanLicenseSchema).optional().meta({
|
|
8556
8556
|
description: "License links to add or override for this customer, keyed by license_plan_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance."
|
|
8557
8557
|
}),
|
|
8558
|
-
remove_licenses:
|
|
8558
|
+
remove_licenses: z100.array(RemovePlanLicenseSchema).optional().meta({
|
|
8559
8559
|
description: "License links to drop, keyed by license_plan_id. Parallel to remove_items."
|
|
8560
8560
|
})
|
|
8561
8561
|
});
|
|
@@ -8587,59 +8587,59 @@ var { DiffedCustomizePlanV1Schema: a29_DiffedCustomizePlanV1Schema } = ((refineC
|
|
|
8587
8587
|
);
|
|
8588
8588
|
return { DiffedCustomizePlanV1Schema };
|
|
8589
8589
|
})(a30_refineCustomizePlanV1Schema, a33_CustomizePlanV1BaseSchema);
|
|
8590
|
-
var { ApiPlanV1Schema: a111_ApiPlanV1Schema } = ((
|
|
8591
|
-
const ApiPlanV1Schema =
|
|
8590
|
+
var { ApiPlanV1Schema: a111_ApiPlanV1Schema } = ((z100, AdditionalCurrencyPriceArraySchema, BillingInterval, DisplaySchema, ApiPriceProcessorsSchema, ApiPlanItemV1Schema, ApiPlanProcessorsSchema, ApiFreeTrialV2Schema, AppEnv, ProductConfigSchema, CustomerBillingControlsSchema, ProductMetadataSchema, CustomerEligibilitySchema, VariantCustomizeSchema) => {
|
|
8591
|
+
const ApiPlanV1Schema = z100.object({
|
|
8592
8592
|
// Identity
|
|
8593
|
-
id:
|
|
8593
|
+
id: z100.string().meta({
|
|
8594
8594
|
description: "Unique identifier for the plan."
|
|
8595
8595
|
}),
|
|
8596
|
-
internal_id:
|
|
8596
|
+
internal_id: z100.string().nullable().optional().meta({
|
|
8597
8597
|
description: "Stable row id. Survives renames of plan_id and version_slug, so config files address rows by it.",
|
|
8598
8598
|
internal: true
|
|
8599
8599
|
}),
|
|
8600
|
-
name:
|
|
8600
|
+
name: z100.string().meta({
|
|
8601
8601
|
description: "Display name of the plan."
|
|
8602
8602
|
}),
|
|
8603
|
-
description:
|
|
8603
|
+
description: z100.string().nullable().meta({
|
|
8604
8604
|
description: "Optional description of the plan."
|
|
8605
8605
|
}),
|
|
8606
|
-
group:
|
|
8606
|
+
group: z100.string().nullable().meta({
|
|
8607
8607
|
description: "Group identifier for organizing related plans. Plans in the same group are mutually exclusive."
|
|
8608
8608
|
}),
|
|
8609
8609
|
// Flags
|
|
8610
|
-
version:
|
|
8610
|
+
version: z100.number().meta({
|
|
8611
8611
|
description: "Version number of the plan. Incremented when plan configuration changes."
|
|
8612
8612
|
}),
|
|
8613
|
-
version_slug:
|
|
8613
|
+
version_slug: z100.string().nullable().optional().meta({
|
|
8614
8614
|
description: "User-facing version identity. Defaults to v{n} when the version is minted."
|
|
8615
8615
|
}),
|
|
8616
|
-
active:
|
|
8616
|
+
active: z100.boolean().optional().meta({
|
|
8617
8617
|
description: "Whether this is the active version of the plan. At most one version is active."
|
|
8618
8618
|
}),
|
|
8619
|
-
add_on:
|
|
8619
|
+
add_on: z100.boolean().meta({
|
|
8620
8620
|
description: "Whether this is an add-on plan that can be attached alongside a main plan."
|
|
8621
8621
|
}),
|
|
8622
|
-
auto_enable:
|
|
8622
|
+
auto_enable: z100.boolean().meta({
|
|
8623
8623
|
description: "If true, this plan is automatically attached when a customer is created. Used for free plans."
|
|
8624
8624
|
}),
|
|
8625
8625
|
// Pricing
|
|
8626
|
-
price:
|
|
8627
|
-
amount:
|
|
8626
|
+
price: z100.object({
|
|
8627
|
+
amount: z100.number().meta({
|
|
8628
8628
|
description: "Base price amount for the plan, in major currency units (e.g. dollars)."
|
|
8629
8629
|
}),
|
|
8630
8630
|
additional_currencies: AdditionalCurrencyPriceArraySchema.optional().meta({
|
|
8631
8631
|
description: "Base price amounts in additional currencies. The base 'amount' is in the org's default currency."
|
|
8632
8632
|
}),
|
|
8633
|
-
interval:
|
|
8633
|
+
interval: z100.enum(BillingInterval).meta({
|
|
8634
8634
|
description: "Billing interval (e.g. 'month', 'year')."
|
|
8635
8635
|
}),
|
|
8636
|
-
interval_count:
|
|
8636
|
+
interval_count: z100.number().optional().meta({
|
|
8637
8637
|
description: "Number of intervals per billing cycle. Defaults to 1."
|
|
8638
8638
|
}),
|
|
8639
|
-
entitlement_id:
|
|
8639
|
+
entitlement_id: z100.string().optional().meta({
|
|
8640
8640
|
internal: true
|
|
8641
8641
|
}),
|
|
8642
|
-
price_id:
|
|
8642
|
+
price_id: z100.string().optional().meta({
|
|
8643
8643
|
internal: true
|
|
8644
8644
|
}),
|
|
8645
8645
|
display: DisplaySchema.optional().meta({
|
|
@@ -8651,7 +8651,7 @@ var { ApiPlanV1Schema: a111_ApiPlanV1Schema } = ((z99, AdditionalCurrencyPriceAr
|
|
|
8651
8651
|
}).nullable().meta({
|
|
8652
8652
|
description: "Base recurring price for the plan. Null for free plans or usage-only plans."
|
|
8653
8653
|
}),
|
|
8654
|
-
items:
|
|
8654
|
+
items: z100.array(ApiPlanItemV1Schema).meta({
|
|
8655
8655
|
description: "Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature."
|
|
8656
8656
|
}),
|
|
8657
8657
|
processors: ApiPlanProcessorsSchema.optional().meta({
|
|
@@ -8661,13 +8661,13 @@ var { ApiPlanV1Schema: a111_ApiPlanV1Schema } = ((z99, AdditionalCurrencyPriceAr
|
|
|
8661
8661
|
description: "Free trial configuration. If set, new customers can try this plan before being charged."
|
|
8662
8662
|
}),
|
|
8663
8663
|
// Meta
|
|
8664
|
-
created_at:
|
|
8664
|
+
created_at: z100.number().meta({
|
|
8665
8665
|
description: "Unix timestamp (ms) when the plan was created."
|
|
8666
8666
|
}),
|
|
8667
|
-
env:
|
|
8667
|
+
env: z100.enum(AppEnv).meta({
|
|
8668
8668
|
description: "Environment this plan belongs to ('sandbox' or 'live')."
|
|
8669
8669
|
}),
|
|
8670
|
-
archived:
|
|
8670
|
+
archived: z100.boolean().meta({
|
|
8671
8671
|
description: "Whether the plan is archived. Archived plans cannot be attached to new customers."
|
|
8672
8672
|
}),
|
|
8673
8673
|
config: ProductConfigSchema.meta({
|
|
@@ -8681,12 +8681,12 @@ var { ApiPlanV1Schema: a111_ApiPlanV1Schema } = ((z99, AdditionalCurrencyPriceAr
|
|
|
8681
8681
|
}),
|
|
8682
8682
|
customer_eligibility: CustomerEligibilitySchema.optional(),
|
|
8683
8683
|
// Variant identity — this plan as a variant of a base
|
|
8684
|
-
base_variant_id:
|
|
8684
|
+
base_variant_id: z100.string().nullable().meta({
|
|
8685
8685
|
description: "Deprecated. Use variant_details.base_plan_id instead. If this is a variant, the ID of the base plan it was created from.",
|
|
8686
8686
|
deprecated: true
|
|
8687
8687
|
}),
|
|
8688
|
-
variant_details:
|
|
8689
|
-
base_plan_id:
|
|
8688
|
+
variant_details: z100.object({
|
|
8689
|
+
base_plan_id: z100.string().meta({
|
|
8690
8690
|
description: "The ID of the base plan this variant was derived from."
|
|
8691
8691
|
}),
|
|
8692
8692
|
customize: VariantCustomizeSchema.optional().meta({
|
|
@@ -16255,7 +16255,7 @@ function jsonStorageBytes(value) {
|
|
|
16255
16255
|
}
|
|
16256
16256
|
|
|
16257
16257
|
// ../contracts/src/funnel-graph.ts
|
|
16258
|
-
import { z as
|
|
16258
|
+
import { z as z84 } from "zod";
|
|
16259
16259
|
|
|
16260
16260
|
// ../contracts/src/app-manifest.ts
|
|
16261
16261
|
import { z as z73 } from "zod";
|
|
@@ -16758,7 +16758,7 @@ var appManifestDeliverySchema = z73.strictObject({
|
|
|
16758
16758
|
});
|
|
16759
16759
|
|
|
16760
16760
|
// ../contracts/src/funnel-orchestration.ts
|
|
16761
|
-
import { z as
|
|
16761
|
+
import { z as z78 } from "zod";
|
|
16762
16762
|
|
|
16763
16763
|
// ../contracts/src/funnel-variable.ts
|
|
16764
16764
|
import { z as z74 } from "zod";
|
|
@@ -16889,155 +16889,160 @@ var screenRendererInputSchema = z75.object({
|
|
|
16889
16889
|
values: z75.record(z75.string(), jsonValueSchema).optional()
|
|
16890
16890
|
}).strict();
|
|
16891
16891
|
|
|
16892
|
-
// ../contracts/src/funnel-
|
|
16892
|
+
// ../contracts/src/funnel-identifier.ts
|
|
16893
16893
|
import { z as z76 } from "zod";
|
|
16894
|
-
var
|
|
16894
|
+
var funnelIdentifierSchema = z76.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/);
|
|
16895
|
+
|
|
16896
|
+
// ../contracts/src/funnel-bindings.ts
|
|
16897
|
+
import { z as z77 } from "zod";
|
|
16898
|
+
var funnelValuePathSchema = z77.string().min(1).max(255).regex(/^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+){0,9}$/).refine(
|
|
16895
16899
|
(path) => path.split(".").every(
|
|
16896
16900
|
(part) => !["__proto__", "constructor", "prototype"].includes(part)
|
|
16897
16901
|
),
|
|
16898
16902
|
"Reserved value path"
|
|
16899
16903
|
);
|
|
16900
|
-
var funnelValueBindingSchema =
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
source:
|
|
16904
|
-
key:
|
|
16904
|
+
var funnelValueBindingSchema = z77.discriminatedUnion("source", [
|
|
16905
|
+
z77.strictObject({ source: z77.literal("literal"), value: jsonValueSchema }),
|
|
16906
|
+
z77.strictObject({
|
|
16907
|
+
source: z77.literal("variable"),
|
|
16908
|
+
key: z77.string().min(1).max(255),
|
|
16905
16909
|
path: funnelValuePathSchema.optional()
|
|
16906
16910
|
})
|
|
16907
16911
|
]);
|
|
16908
16912
|
|
|
16909
16913
|
// ../contracts/src/funnel-orchestration.ts
|
|
16910
|
-
var field =
|
|
16911
|
-
var reference =
|
|
16914
|
+
var field = z78.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/);
|
|
16915
|
+
var reference = z78.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,128}$/);
|
|
16912
16916
|
var funnelTaskDataSchema = screenParametersSchema.refine(
|
|
16913
16917
|
(value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 8192,
|
|
16914
16918
|
"Task data exceeds 8 KiB"
|
|
16915
16919
|
);
|
|
16916
|
-
var funnelTaskOutputsSchema =
|
|
16920
|
+
var funnelTaskOutputsSchema = z78.record(field, z78.enum(["string", "number", "boolean", "strings"])).refine((v) => Object.keys(v).length <= 20, "Too many output fields");
|
|
16917
16921
|
var funnelTaskBindingSchema = funnelValueBindingSchema;
|
|
16918
|
-
var funnelExternalTaskSchema =
|
|
16919
|
-
type:
|
|
16920
|
-
endpointId:
|
|
16922
|
+
var funnelExternalTaskSchema = z78.strictObject({
|
|
16923
|
+
type: z78.literal("external_task"),
|
|
16924
|
+
endpointId: z78.uuid(),
|
|
16921
16925
|
taskKey: field,
|
|
16922
|
-
inputs:
|
|
16926
|
+
inputs: z78.record(field, funnelTaskBindingSchema).refine((v) => Object.keys(v).length <= 20),
|
|
16923
16927
|
outputs: funnelTaskOutputsSchema
|
|
16924
16928
|
});
|
|
16925
|
-
var funnelExecutionPolicySchema =
|
|
16926
|
-
maxAttempts:
|
|
16927
|
-
retryDelaySeconds:
|
|
16928
|
-
backoff:
|
|
16929
|
-
requestTimeoutSeconds:
|
|
16930
|
-
timeoutSeconds:
|
|
16929
|
+
var funnelExecutionPolicySchema = z78.strictObject({
|
|
16930
|
+
maxAttempts: z78.number().int().min(1).max(5),
|
|
16931
|
+
retryDelaySeconds: z78.number().int().min(1).max(30),
|
|
16932
|
+
backoff: z78.enum(["fixed", "exponential"]),
|
|
16933
|
+
requestTimeoutSeconds: z78.number().int().min(1).max(10),
|
|
16934
|
+
timeoutSeconds: z78.number().int().min(1).max(300)
|
|
16931
16935
|
}).refine(
|
|
16932
16936
|
(v) => v.requestTimeoutSeconds <= v.timeoutSeconds,
|
|
16933
16937
|
"Request timeout exceeds action deadline"
|
|
16934
16938
|
);
|
|
16935
|
-
var funnelTaskResponseSchema =
|
|
16936
|
-
outcome:
|
|
16939
|
+
var funnelTaskResponseSchema = z78.strictObject({
|
|
16940
|
+
outcome: z78.enum(["success", "failure"]),
|
|
16937
16941
|
data: funnelTaskDataSchema
|
|
16938
16942
|
});
|
|
16939
|
-
var funnelOrchestrationCommandSchema =
|
|
16943
|
+
var funnelOrchestrationCommandSchema = z78.discriminatedUnion(
|
|
16940
16944
|
"operation",
|
|
16941
16945
|
[
|
|
16942
|
-
|
|
16943
|
-
operation:
|
|
16944
|
-
runId:
|
|
16946
|
+
z78.strictObject({
|
|
16947
|
+
operation: z78.literal("signal"),
|
|
16948
|
+
runId: z78.uuid(),
|
|
16945
16949
|
nodeId: reference,
|
|
16946
|
-
|
|
16947
|
-
|
|
16950
|
+
// The event wait node's name, matched exactly.
|
|
16951
|
+
eventName: funnelIdentifierSchema,
|
|
16952
|
+
eventId: z78.uuid(),
|
|
16948
16953
|
data: funnelTaskDataSchema
|
|
16949
16954
|
}),
|
|
16950
|
-
|
|
16955
|
+
z78.strictObject({ operation: z78.literal("read_results"), runId: z78.uuid() })
|
|
16951
16956
|
]
|
|
16952
16957
|
);
|
|
16953
|
-
var funnelSignalResponseSchema =
|
|
16958
|
+
var funnelSignalResponseSchema = z78.strictObject({
|
|
16954
16959
|
scope: scopeSchema,
|
|
16955
|
-
runId:
|
|
16956
|
-
eventId:
|
|
16957
|
-
accepted:
|
|
16960
|
+
runId: z78.uuid(),
|
|
16961
|
+
eventId: z78.uuid(),
|
|
16962
|
+
accepted: z78.boolean()
|
|
16958
16963
|
});
|
|
16959
|
-
var funnelTaskResultsSchema =
|
|
16960
|
-
var funnelResultsResponseSchema =
|
|
16964
|
+
var funnelTaskResultsSchema = z78.record(reference, funnelValueSchema);
|
|
16965
|
+
var funnelResultsResponseSchema = z78.strictObject({
|
|
16961
16966
|
scope: scopeSchema,
|
|
16962
|
-
runId:
|
|
16967
|
+
runId: z78.uuid(),
|
|
16963
16968
|
results: funnelTaskResultsSchema
|
|
16964
16969
|
});
|
|
16965
16970
|
|
|
16966
16971
|
// ../contracts/src/funnel-decision.ts
|
|
16967
|
-
import { z as
|
|
16972
|
+
import { z as z80 } from "zod";
|
|
16968
16973
|
|
|
16969
16974
|
// ../contracts/src/funnel-evaluation.ts
|
|
16970
|
-
import { z as
|
|
16971
|
-
var funnelEvaluationModeSchema =
|
|
16972
|
-
var funnelEvaluationResultSchema =
|
|
16973
|
-
port:
|
|
16975
|
+
import { z as z79 } from "zod";
|
|
16976
|
+
var funnelEvaluationModeSchema = z79.enum(["local", "remote"]);
|
|
16977
|
+
var funnelEvaluationResultSchema = z79.strictObject({
|
|
16978
|
+
port: z79.string().regex(/^[a-zA-Z0-9_.:-]{1,128}$/),
|
|
16974
16979
|
value: jsonValueSchema.optional(),
|
|
16975
|
-
sticky:
|
|
16976
|
-
|
|
16980
|
+
sticky: z79.array(
|
|
16981
|
+
z79.strictObject({
|
|
16977
16982
|
expected: stickyAssignmentDocumentSchema.nullable(),
|
|
16978
16983
|
next: stickyAssignmentDocumentSchema
|
|
16979
16984
|
})
|
|
16980
16985
|
).max(100),
|
|
16981
|
-
exposures:
|
|
16982
|
-
features:
|
|
16986
|
+
exposures: z79.array(jsonValueSchema).max(100),
|
|
16987
|
+
features: z79.array(jsonValueSchema).max(100)
|
|
16983
16988
|
});
|
|
16984
|
-
var funnelEvaluationInstructionSchema =
|
|
16985
|
-
type:
|
|
16986
|
-
receiptId:
|
|
16987
|
-
environmentId:
|
|
16988
|
-
policyRevision:
|
|
16989
|
+
var funnelEvaluationInstructionSchema = z79.strictObject({
|
|
16990
|
+
type: z79.literal("evaluate"),
|
|
16991
|
+
receiptId: z79.uuid(),
|
|
16992
|
+
environmentId: z79.uuid(),
|
|
16993
|
+
policyRevision: z79.number().int().nonnegative(),
|
|
16989
16994
|
attributes: growthAttributesSchema,
|
|
16990
|
-
sticky:
|
|
16995
|
+
sticky: z79.record(z79.string(), stickyAssignmentDocumentSchema)
|
|
16991
16996
|
});
|
|
16992
16997
|
var funnelDecisionEvaluationSchema = funnelEvaluationInstructionSchema.extend({
|
|
16993
|
-
runId:
|
|
16994
|
-
versionId:
|
|
16995
|
-
nodeId:
|
|
16996
|
-
visit:
|
|
16997
|
-
revision:
|
|
16998
|
+
runId: z79.uuid(),
|
|
16999
|
+
versionId: z79.uuid(),
|
|
17000
|
+
nodeId: z79.string().min(1).max(64),
|
|
17001
|
+
visit: z79.number().int().nonnegative(),
|
|
17002
|
+
revision: z79.number().int().nonnegative()
|
|
16998
17003
|
});
|
|
16999
|
-
var funnelSegmentEvaluationInstructionSchema = funnelEvaluationInstructionSchema.omit({ type: true, receiptId: true }).extend({ type:
|
|
17000
|
-
var funnelLocalSegmentStepSchema =
|
|
17001
|
-
nodeId:
|
|
17004
|
+
var funnelSegmentEvaluationInstructionSchema = funnelEvaluationInstructionSchema.omit({ type: true, receiptId: true }).extend({ type: z79.literal("evaluate_segment") });
|
|
17005
|
+
var funnelLocalSegmentStepSchema = z79.strictObject({
|
|
17006
|
+
nodeId: z79.string().min(1).max(64),
|
|
17002
17007
|
result: funnelEvaluationResultSchema
|
|
17003
17008
|
});
|
|
17004
17009
|
var funnelDecisionSegmentEvaluationSchema = funnelSegmentEvaluationInstructionSchema.extend({
|
|
17005
|
-
runId:
|
|
17006
|
-
versionId:
|
|
17007
|
-
nodeId:
|
|
17008
|
-
visit:
|
|
17009
|
-
revision:
|
|
17010
|
+
runId: z79.uuid(),
|
|
17011
|
+
versionId: z79.uuid(),
|
|
17012
|
+
nodeId: z79.string().min(1).max(64),
|
|
17013
|
+
visit: z79.number().int().nonnegative(),
|
|
17014
|
+
revision: z79.number().int().nonnegative(),
|
|
17010
17015
|
parameters: screenParametersSchema,
|
|
17011
17016
|
answers: screenAnswersSchema,
|
|
17012
|
-
variables:
|
|
17017
|
+
variables: z79.record(z79.string(), jsonValueSchema)
|
|
17013
17018
|
});
|
|
17014
17019
|
|
|
17015
17020
|
// ../contracts/src/funnel-decision.ts
|
|
17016
|
-
var funnelDecisionOutputSchema =
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
type:
|
|
17021
|
+
var funnelDecisionOutputSchema = z80.discriminatedUnion("type", [
|
|
17022
|
+
z80.strictObject({ type: z80.literal("literal"), value: jsonValueSchema }),
|
|
17023
|
+
z80.strictObject({
|
|
17024
|
+
type: z80.literal("variable"),
|
|
17020
17025
|
key: funnelVariableKeySchema,
|
|
17021
17026
|
path: funnelValuePathSchema.optional()
|
|
17022
17027
|
}),
|
|
17023
|
-
|
|
17024
|
-
type:
|
|
17025
|
-
featureKey:
|
|
17028
|
+
z80.strictObject({
|
|
17029
|
+
type: z80.literal("feature"),
|
|
17030
|
+
featureKey: z80.string().min(1).max(128)
|
|
17026
17031
|
})
|
|
17027
17032
|
]);
|
|
17028
|
-
var funnelDecisionSchema =
|
|
17029
|
-
requestId:
|
|
17030
|
-
decisionId:
|
|
17031
|
-
customerId:
|
|
17033
|
+
var funnelDecisionSchema = z80.strictObject({
|
|
17034
|
+
requestId: z80.uuid(),
|
|
17035
|
+
decisionId: z80.uuid(),
|
|
17036
|
+
customerId: z80.uuid(),
|
|
17032
17037
|
// The Customer's business ID; null for an email-only reservation.
|
|
17033
|
-
externalUserId:
|
|
17034
|
-
versionId:
|
|
17035
|
-
receiptId:
|
|
17038
|
+
externalUserId: z80.string().min(1).max(255).nullable(),
|
|
17039
|
+
versionId: z80.uuid(),
|
|
17040
|
+
receiptId: z80.uuid(),
|
|
17036
17041
|
value: jsonValueSchema
|
|
17037
17042
|
});
|
|
17038
17043
|
var funnelDecideShape = {
|
|
17039
|
-
funnelId:
|
|
17040
|
-
requestId:
|
|
17044
|
+
funnelId: z80.uuid(),
|
|
17045
|
+
requestId: z80.uuid(),
|
|
17041
17046
|
customer: customerReferenceSchema,
|
|
17042
17047
|
customerData: customerDataSchema.optional(),
|
|
17043
17048
|
attributes: growthAttributesSchema.refine(
|
|
@@ -17047,72 +17052,72 @@ var funnelDecideShape = {
|
|
|
17047
17052
|
"parameters, answers, results and variables are reserved flow namespaces"
|
|
17048
17053
|
)
|
|
17049
17054
|
};
|
|
17050
|
-
var funnelDecisionCommandSchema =
|
|
17051
|
-
|
|
17052
|
-
|
|
17053
|
-
operation:
|
|
17054
|
-
decisionId:
|
|
17055
|
+
var funnelDecisionCommandSchema = z80.discriminatedUnion("operation", [
|
|
17056
|
+
z80.strictObject({ operation: z80.literal("decide"), ...funnelDecideShape }).refine(customerDataReferenced, customerDataReferenceMessage),
|
|
17057
|
+
z80.strictObject({
|
|
17058
|
+
operation: z80.literal("read_decision"),
|
|
17059
|
+
decisionId: z80.uuid()
|
|
17055
17060
|
}),
|
|
17056
|
-
|
|
17057
|
-
operation:
|
|
17058
|
-
decisionId:
|
|
17059
|
-
requestId:
|
|
17060
|
-
nodeId:
|
|
17061
|
-
visit:
|
|
17062
|
-
revision:
|
|
17063
|
-
receiptId:
|
|
17064
|
-
policyRevision:
|
|
17065
|
-
generation:
|
|
17061
|
+
z80.strictObject({
|
|
17062
|
+
operation: z80.literal("evaluate_decision"),
|
|
17063
|
+
decisionId: z80.uuid(),
|
|
17064
|
+
requestId: z80.uuid(),
|
|
17065
|
+
nodeId: z80.string().min(1).max(64),
|
|
17066
|
+
visit: z80.number().int().nonnegative(),
|
|
17067
|
+
revision: z80.number().int().nonnegative(),
|
|
17068
|
+
receiptId: z80.uuid(),
|
|
17069
|
+
policyRevision: z80.number().int().nonnegative(),
|
|
17070
|
+
generation: z80.string().min(1).max(256),
|
|
17066
17071
|
result: funnelEvaluationResultSchema
|
|
17067
17072
|
}),
|
|
17068
|
-
|
|
17069
|
-
operation:
|
|
17070
|
-
funnelId:
|
|
17073
|
+
z80.strictObject({
|
|
17074
|
+
operation: z80.literal("feature_config"),
|
|
17075
|
+
funnelId: z80.uuid()
|
|
17071
17076
|
}),
|
|
17072
|
-
|
|
17073
|
-
operation:
|
|
17074
|
-
decisionId:
|
|
17075
|
-
requestId:
|
|
17076
|
-
nodeId:
|
|
17077
|
-
visit:
|
|
17078
|
-
revision:
|
|
17079
|
-
policyRevision:
|
|
17080
|
-
generation:
|
|
17081
|
-
steps:
|
|
17082
|
-
boundary:
|
|
17083
|
-
nodeId:
|
|
17084
|
-
visit:
|
|
17077
|
+
z80.strictObject({
|
|
17078
|
+
operation: z80.literal("commit_decision_segment"),
|
|
17079
|
+
decisionId: z80.uuid(),
|
|
17080
|
+
requestId: z80.uuid(),
|
|
17081
|
+
nodeId: z80.string().min(1).max(64),
|
|
17082
|
+
visit: z80.number().int().nonnegative(),
|
|
17083
|
+
revision: z80.number().int().nonnegative(),
|
|
17084
|
+
policyRevision: z80.number().int().nonnegative(),
|
|
17085
|
+
generation: z80.string().min(1).max(256),
|
|
17086
|
+
steps: z80.array(funnelLocalSegmentStepSchema).max(32),
|
|
17087
|
+
boundary: z80.strictObject({
|
|
17088
|
+
nodeId: z80.string().min(1).max(64),
|
|
17089
|
+
visit: z80.number().int().nonnegative()
|
|
17085
17090
|
}).optional()
|
|
17086
17091
|
}),
|
|
17087
|
-
|
|
17088
|
-
operation:
|
|
17089
|
-
funnelId:
|
|
17090
|
-
versionId:
|
|
17092
|
+
z80.strictObject({
|
|
17093
|
+
operation: z80.literal("segment_configuration"),
|
|
17094
|
+
funnelId: z80.uuid(),
|
|
17095
|
+
versionId: z80.uuid()
|
|
17091
17096
|
}),
|
|
17092
|
-
|
|
17093
|
-
operation:
|
|
17094
|
-
funnelId:
|
|
17095
|
-
versionId:
|
|
17097
|
+
z80.strictObject({
|
|
17098
|
+
operation: z80.literal("configuration"),
|
|
17099
|
+
funnelId: z80.uuid(),
|
|
17100
|
+
versionId: z80.uuid().optional()
|
|
17096
17101
|
}),
|
|
17097
|
-
|
|
17098
|
-
operation:
|
|
17099
|
-
funnelId:
|
|
17102
|
+
z80.strictObject({
|
|
17103
|
+
operation: z80.literal("local_configuration"),
|
|
17104
|
+
funnelId: z80.uuid()
|
|
17100
17105
|
}),
|
|
17101
|
-
|
|
17102
|
-
operation:
|
|
17103
|
-
decisionId:
|
|
17104
|
-
eventId:
|
|
17105
|
-
occurredAt:
|
|
17106
|
-
reference:
|
|
17106
|
+
z80.strictObject({
|
|
17107
|
+
operation: z80.literal("report_used"),
|
|
17108
|
+
decisionId: z80.uuid(),
|
|
17109
|
+
eventId: z80.uuid(),
|
|
17110
|
+
occurredAt: z80.iso.datetime({ offset: true }),
|
|
17111
|
+
reference: z80.string().min(1).max(128).optional()
|
|
17107
17112
|
})
|
|
17108
17113
|
]);
|
|
17109
|
-
var funnelDecisionResponseSchema =
|
|
17114
|
+
var funnelDecisionResponseSchema = z80.strictObject({
|
|
17110
17115
|
scope: scopeSchema,
|
|
17111
|
-
decisionId:
|
|
17112
|
-
requestId:
|
|
17113
|
-
status:
|
|
17116
|
+
decisionId: z80.uuid(),
|
|
17117
|
+
requestId: z80.uuid(),
|
|
17118
|
+
status: z80.enum(["pending", "completed", "failed"]),
|
|
17114
17119
|
decision: funnelDecisionSchema.nullable(),
|
|
17115
|
-
evaluation:
|
|
17120
|
+
evaluation: z80.discriminatedUnion("type", [
|
|
17116
17121
|
funnelDecisionEvaluationSchema,
|
|
17117
17122
|
funnelDecisionSegmentEvaluationSchema
|
|
17118
17123
|
]).optional()
|
|
@@ -17120,63 +17125,63 @@ var funnelDecisionResponseSchema = z79.strictObject({
|
|
|
17120
17125
|
(r) => r.status === "completed" === (r.decision !== null) && (!r.decision || r.decision.decisionId === r.decisionId && r.decision.requestId === r.requestId),
|
|
17121
17126
|
"Completed decisions carry their committed result"
|
|
17122
17127
|
);
|
|
17123
|
-
var funnelDecisionUsedResponseSchema =
|
|
17128
|
+
var funnelDecisionUsedResponseSchema = z80.strictObject({
|
|
17124
17129
|
scope: scopeSchema,
|
|
17125
|
-
decisionId:
|
|
17126
|
-
eventId:
|
|
17127
|
-
source:
|
|
17130
|
+
decisionId: z80.uuid(),
|
|
17131
|
+
eventId: z80.uuid(),
|
|
17132
|
+
source: z80.literal("caller_reported")
|
|
17128
17133
|
});
|
|
17129
17134
|
|
|
17130
17135
|
// ../contracts/src/funnel-bundle.ts
|
|
17131
|
-
import { z as
|
|
17132
|
-
var funnelBundleDefinitionSchema =
|
|
17133
|
-
type:
|
|
17136
|
+
import { z as z81 } from "zod";
|
|
17137
|
+
var funnelBundleDefinitionSchema = z81.strictObject({
|
|
17138
|
+
type: z81.literal("bundle"),
|
|
17134
17139
|
paywall: funnelValueBindingSchema.optional(),
|
|
17135
17140
|
offering: funnelValueBindingSchema.optional(),
|
|
17136
17141
|
coupons: funnelValueBindingSchema,
|
|
17137
17142
|
data: funnelValueBindingSchema
|
|
17138
17143
|
});
|
|
17139
|
-
var reference2 = (type) =>
|
|
17140
|
-
var funnelBundleSelectionSchema =
|
|
17141
|
-
type:
|
|
17142
|
-
paywallVersionId:
|
|
17143
|
-
offeringVersionId:
|
|
17144
|
-
couponIds:
|
|
17144
|
+
var reference2 = (type) => z81.strictObject({ type: z81.literal(type), id: z81.uuid() });
|
|
17145
|
+
var funnelBundleSelectionSchema = z81.strictObject({
|
|
17146
|
+
type: z81.literal("bundle"),
|
|
17147
|
+
paywallVersionId: z81.uuid().optional(),
|
|
17148
|
+
offeringVersionId: z81.uuid().optional(),
|
|
17149
|
+
couponIds: z81.array(z81.uuid()).max(20).refine((ids) => new Set(ids).size === ids.length),
|
|
17145
17150
|
data: jsonValueSchema
|
|
17146
17151
|
});
|
|
17147
|
-
var funnelBundleResultSchema =
|
|
17148
|
-
type:
|
|
17152
|
+
var funnelBundleResultSchema = z81.strictObject({
|
|
17153
|
+
type: z81.literal("bundle"),
|
|
17149
17154
|
offering: reference2("offering_version").nullable(),
|
|
17150
|
-
paywall:
|
|
17151
|
-
versionId:
|
|
17152
|
-
paywallId:
|
|
17153
|
-
offeringVersionId:
|
|
17155
|
+
paywall: z81.strictObject({
|
|
17156
|
+
versionId: z81.uuid(),
|
|
17157
|
+
paywallId: z81.uuid(),
|
|
17158
|
+
offeringVersionId: z81.uuid()
|
|
17154
17159
|
}).nullable(),
|
|
17155
|
-
coupons:
|
|
17160
|
+
coupons: z81.array(offerSchema).max(20),
|
|
17156
17161
|
data: jsonValueSchema
|
|
17157
17162
|
});
|
|
17158
17163
|
|
|
17159
17164
|
// ../contracts/src/funnel-capabilities.ts
|
|
17160
|
-
import { z as
|
|
17165
|
+
import { z as z83 } from "zod";
|
|
17161
17166
|
|
|
17162
17167
|
// ../contracts/src/funnel-projections.ts
|
|
17163
|
-
import { z as
|
|
17164
|
-
var scalar2 =
|
|
17165
|
-
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17168
|
+
import { z as z82 } from "zod";
|
|
17169
|
+
var scalar2 = z82.union([
|
|
17170
|
+
z82.string(),
|
|
17171
|
+
z82.number().finite(),
|
|
17172
|
+
z82.boolean(),
|
|
17173
|
+
z82.null()
|
|
17169
17174
|
]);
|
|
17170
|
-
var funnelProjectionFilterValueSchema =
|
|
17175
|
+
var funnelProjectionFilterValueSchema = z82.union([
|
|
17171
17176
|
scalar2,
|
|
17172
|
-
|
|
17177
|
+
z82.array(scalar2).min(1).max(20)
|
|
17173
17178
|
]);
|
|
17174
|
-
var funnelProjectionWhereSchema =
|
|
17175
|
-
var funnelApiProjectionSchema =
|
|
17179
|
+
var funnelProjectionWhereSchema = z82.record(funnelValuePathSchema, funnelProjectionFilterValueSchema).refine((value) => Object.keys(value).length <= 10);
|
|
17180
|
+
var funnelApiProjectionSchema = z82.strictObject({
|
|
17176
17181
|
path: funnelValuePathSchema,
|
|
17177
|
-
type:
|
|
17178
|
-
nullable:
|
|
17179
|
-
aggregation:
|
|
17182
|
+
type: z82.enum(["string", "number", "boolean", "strings"]),
|
|
17183
|
+
nullable: z82.boolean().optional(),
|
|
17184
|
+
aggregation: z82.enum(["count", "exists"]).optional(),
|
|
17180
17185
|
where: funnelProjectionWhereSchema.optional()
|
|
17181
17186
|
}).superRefine((value, ctx) => {
|
|
17182
17187
|
if (value.aggregation === "count" && value.type !== "number" || value.aggregation === "exists" && value.type !== "boolean" || !value.aggregation && value.where)
|
|
@@ -17238,31 +17243,31 @@ var FUNNEL_API_CAPABILITIES = [
|
|
|
17238
17243
|
"createReferralCode",
|
|
17239
17244
|
"claimRewardProduct"
|
|
17240
17245
|
];
|
|
17241
|
-
var identifier2 =
|
|
17246
|
+
var identifier2 = z83.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/);
|
|
17242
17247
|
var funnelApiBindingSchema = funnelValueBindingSchema;
|
|
17243
|
-
var funnelCapabilitySchema =
|
|
17248
|
+
var funnelCapabilitySchema = z83.discriminatedUnion("type", [
|
|
17244
17249
|
funnelExternalTaskSchema,
|
|
17245
|
-
|
|
17246
|
-
type:
|
|
17250
|
+
z83.strictObject({
|
|
17251
|
+
type: z83.literal("claim_offer"),
|
|
17247
17252
|
coupon: funnelValueBindingSchema
|
|
17248
17253
|
}),
|
|
17249
|
-
|
|
17250
|
-
|
|
17251
|
-
type:
|
|
17252
|
-
operation:
|
|
17253
|
-
inputs:
|
|
17254
|
+
z83.strictObject({ type: z83.literal("event"), event: identifier2 }),
|
|
17255
|
+
z83.strictObject({
|
|
17256
|
+
type: z83.literal("api"),
|
|
17257
|
+
operation: z83.enum(FUNNEL_API_CAPABILITIES),
|
|
17258
|
+
inputs: z83.record(funnelValuePathSchema, funnelApiBindingSchema).refine((value) => Object.keys(value).length <= 40),
|
|
17254
17259
|
/** Safe consumed values only. A whole Checkout, Customer, ledger or provider response is never copied. */
|
|
17255
|
-
outputs:
|
|
17260
|
+
outputs: z83.record(identifier2, funnelApiProjectionSchema).refine((value) => Object.keys(value).length <= 20)
|
|
17256
17261
|
})
|
|
17257
17262
|
]);
|
|
17258
17263
|
|
|
17259
17264
|
// ../contracts/src/funnel-graph.ts
|
|
17260
|
-
var identifier3 =
|
|
17261
|
-
var variantKey =
|
|
17265
|
+
var identifier3 = funnelIdentifierSchema;
|
|
17266
|
+
var variantKey = z84.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/);
|
|
17262
17267
|
var base = {
|
|
17263
17268
|
id: identifier3,
|
|
17264
|
-
name:
|
|
17265
|
-
position:
|
|
17269
|
+
name: z84.string().trim().min(1).max(80),
|
|
17270
|
+
position: z84.strictObject({ x: z84.number().finite(), y: z84.number().finite() }).optional()
|
|
17266
17271
|
};
|
|
17267
17272
|
var resultPorts = {
|
|
17268
17273
|
success: identifier3,
|
|
@@ -17270,7 +17275,7 @@ var resultPorts = {
|
|
|
17270
17275
|
unavailable: identifier3,
|
|
17271
17276
|
failure: identifier3
|
|
17272
17277
|
};
|
|
17273
|
-
var funnelExternalPageUrlSchema =
|
|
17278
|
+
var funnelExternalPageUrlSchema = z84.url().max(2048).refine(
|
|
17274
17279
|
(value) => {
|
|
17275
17280
|
try {
|
|
17276
17281
|
return new URL(value).protocol === "https:";
|
|
@@ -17280,101 +17285,101 @@ var funnelExternalPageUrlSchema = z83.url().max(2048).refine(
|
|
|
17280
17285
|
},
|
|
17281
17286
|
{ message: "External pages require HTTPS" }
|
|
17282
17287
|
);
|
|
17283
|
-
var funnelOpenInSchema =
|
|
17284
|
-
var funnelGraphNodeSchema =
|
|
17285
|
-
|
|
17286
|
-
|
|
17288
|
+
var funnelOpenInSchema = z84.enum(["same_window", "new_window"]);
|
|
17289
|
+
var funnelGraphNodeSchema = z84.discriminatedUnion("type", [
|
|
17290
|
+
z84.strictObject({ ...base, type: z84.literal("entry"), next: identifier3 }),
|
|
17291
|
+
z84.strictObject({
|
|
17287
17292
|
...base,
|
|
17288
|
-
type:
|
|
17293
|
+
type: z84.literal("screen"),
|
|
17289
17294
|
screenId: identifier3,
|
|
17290
17295
|
presentation: screenPresentationSchema,
|
|
17291
|
-
outputs:
|
|
17292
|
-
offering:
|
|
17293
|
-
|
|
17294
|
-
source:
|
|
17296
|
+
outputs: z84.record(identifier3, identifier3),
|
|
17297
|
+
offering: z84.discriminatedUnion("source", [
|
|
17298
|
+
z84.strictObject({
|
|
17299
|
+
source: z84.literal("variable"),
|
|
17295
17300
|
key: funnelVariableKeySchema
|
|
17296
17301
|
}),
|
|
17297
|
-
|
|
17302
|
+
z84.strictObject({ source: z84.literal("fixed"), versionId: z84.uuid() })
|
|
17298
17303
|
]).optional()
|
|
17299
17304
|
}),
|
|
17300
|
-
|
|
17305
|
+
z84.strictObject({
|
|
17301
17306
|
...base,
|
|
17302
|
-
type:
|
|
17303
|
-
configuration:
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
source:
|
|
17307
|
-
featureKey:
|
|
17307
|
+
type: z84.literal("offering"),
|
|
17308
|
+
configuration: z84.discriminatedUnion("source", [
|
|
17309
|
+
z84.strictObject({ source: z84.literal("fixed"), versionId: z84.uuid() }),
|
|
17310
|
+
z84.strictObject({
|
|
17311
|
+
source: z84.literal("feature"),
|
|
17312
|
+
featureKey: z84.string().min(1).max(128)
|
|
17308
17313
|
})
|
|
17309
17314
|
]),
|
|
17310
|
-
writes:
|
|
17315
|
+
writes: z84.strictObject({ value: funnelVariableKeySchema }),
|
|
17311
17316
|
next: identifier3
|
|
17312
17317
|
}),
|
|
17313
|
-
|
|
17318
|
+
z84.strictObject({
|
|
17314
17319
|
...base,
|
|
17315
|
-
type:
|
|
17316
|
-
couponId:
|
|
17317
|
-
writes:
|
|
17320
|
+
type: z84.literal("coupon"),
|
|
17321
|
+
couponId: z84.uuid(),
|
|
17322
|
+
writes: z84.strictObject({ value: funnelVariableKeySchema }),
|
|
17318
17323
|
next: identifier3
|
|
17319
17324
|
}),
|
|
17320
|
-
|
|
17325
|
+
z84.strictObject({
|
|
17321
17326
|
...base,
|
|
17322
|
-
type:
|
|
17323
|
-
couponIds:
|
|
17324
|
-
writes:
|
|
17327
|
+
type: z84.literal("coupons"),
|
|
17328
|
+
couponIds: z84.array(z84.uuid()).max(20).refine((ids) => new Set(ids).size === ids.length),
|
|
17329
|
+
writes: z84.strictObject({ value: funnelVariableKeySchema }),
|
|
17325
17330
|
next: identifier3
|
|
17326
17331
|
}),
|
|
17327
|
-
|
|
17332
|
+
z84.strictObject({
|
|
17328
17333
|
...base,
|
|
17329
|
-
type:
|
|
17330
|
-
value:
|
|
17334
|
+
type: z84.literal("output"),
|
|
17335
|
+
value: z84.discriminatedUnion("type", [
|
|
17331
17336
|
...funnelDecisionOutputSchema.options,
|
|
17332
17337
|
funnelBundleDefinitionSchema,
|
|
17333
|
-
|
|
17334
|
-
type:
|
|
17338
|
+
z84.strictObject({
|
|
17339
|
+
type: z84.literal("selection"),
|
|
17335
17340
|
screenId: identifier3,
|
|
17336
17341
|
offeringKey: funnelVariableKeySchema
|
|
17337
17342
|
})
|
|
17338
17343
|
])
|
|
17339
17344
|
}),
|
|
17340
|
-
|
|
17345
|
+
z84.strictObject({
|
|
17341
17346
|
...base,
|
|
17342
|
-
type:
|
|
17343
|
-
cases:
|
|
17344
|
-
|
|
17347
|
+
type: z84.literal("condition"),
|
|
17348
|
+
cases: z84.array(
|
|
17349
|
+
z84.strictObject({
|
|
17345
17350
|
condition: growthConditionSchema,
|
|
17346
17351
|
target: identifier3
|
|
17347
17352
|
})
|
|
17348
17353
|
).min(1).max(50),
|
|
17349
17354
|
default: identifier3
|
|
17350
17355
|
}),
|
|
17351
|
-
|
|
17356
|
+
z84.strictObject({
|
|
17352
17357
|
...base,
|
|
17353
|
-
type:
|
|
17354
|
-
featureKey:
|
|
17355
|
-
writes:
|
|
17358
|
+
type: z84.literal("feature"),
|
|
17359
|
+
featureKey: z84.string().min(1).max(128),
|
|
17360
|
+
writes: z84.strictObject({ value: funnelVariableKeySchema }),
|
|
17356
17361
|
next: identifier3
|
|
17357
17362
|
}),
|
|
17358
|
-
|
|
17363
|
+
z84.strictObject({
|
|
17359
17364
|
...base,
|
|
17360
|
-
type:
|
|
17361
|
-
experimentId:
|
|
17362
|
-
routes:
|
|
17365
|
+
type: z84.literal("split"),
|
|
17366
|
+
experimentId: z84.uuid(),
|
|
17367
|
+
routes: z84.record(variantKey, identifier3).refine(
|
|
17363
17368
|
(value) => Object.keys(value).length >= 2 && Object.keys(value).length <= 20
|
|
17364
17369
|
),
|
|
17365
17370
|
notParticipating: identifier3
|
|
17366
17371
|
}),
|
|
17367
|
-
|
|
17372
|
+
z84.strictObject({
|
|
17368
17373
|
...base,
|
|
17369
|
-
type:
|
|
17374
|
+
type: z84.literal("action"),
|
|
17370
17375
|
...resultPorts,
|
|
17371
17376
|
execution: funnelExecutionPolicySchema,
|
|
17372
17377
|
action: funnelCapabilitySchema,
|
|
17373
17378
|
writes: funnelNodeWritesSchema.optional()
|
|
17374
17379
|
}),
|
|
17375
|
-
|
|
17380
|
+
z84.strictObject({
|
|
17376
17381
|
...base,
|
|
17377
|
-
type:
|
|
17382
|
+
type: z84.literal("external_page"),
|
|
17378
17383
|
appManifest: appManifestReferenceSchema.optional(),
|
|
17379
17384
|
url: funnelExternalPageUrlSchema,
|
|
17380
17385
|
openIn: funnelOpenInSchema,
|
|
@@ -17383,37 +17388,37 @@ var funnelGraphNodeSchema = z83.discriminatedUnion("type", [
|
|
|
17383
17388
|
/** The host refused, a new window was blocked or navigation failed. */
|
|
17384
17389
|
failed: identifier3
|
|
17385
17390
|
}),
|
|
17386
|
-
|
|
17391
|
+
z84.strictObject({
|
|
17387
17392
|
...base,
|
|
17388
|
-
type:
|
|
17389
|
-
outcome:
|
|
17393
|
+
type: z84.literal("end"),
|
|
17394
|
+
outcome: z84.enum(["completed", "closed", "ineligible", "failed"]),
|
|
17390
17395
|
output: funnelDecisionOutputSchema.optional()
|
|
17391
17396
|
}),
|
|
17392
|
-
|
|
17397
|
+
z84.strictObject({
|
|
17393
17398
|
...base,
|
|
17394
|
-
type:
|
|
17399
|
+
type: z84.literal("wait"),
|
|
17395
17400
|
writes: funnelNodeWritesSchema.optional(),
|
|
17396
|
-
wait:
|
|
17397
|
-
|
|
17398
|
-
type:
|
|
17399
|
-
delaySeconds:
|
|
17401
|
+
wait: z84.discriminatedUnion("type", [
|
|
17402
|
+
z84.strictObject({
|
|
17403
|
+
type: z84.literal("duration"),
|
|
17404
|
+
delaySeconds: z84.number().int().min(1).max(2592e3),
|
|
17400
17405
|
elapsed: identifier3
|
|
17401
17406
|
}),
|
|
17402
|
-
|
|
17403
|
-
type:
|
|
17407
|
+
z84.strictObject({
|
|
17408
|
+
type: z84.literal("event"),
|
|
17404
17409
|
eventName: identifier3,
|
|
17405
17410
|
outputs: funnelTaskOutputsSchema,
|
|
17406
|
-
timeoutSeconds:
|
|
17411
|
+
timeoutSeconds: z84.number().int().min(1).max(2592e3),
|
|
17407
17412
|
received: identifier3,
|
|
17408
17413
|
timeout: identifier3
|
|
17409
17414
|
})
|
|
17410
17415
|
])
|
|
17411
17416
|
})
|
|
17412
17417
|
]);
|
|
17413
|
-
var funnelGraphDraftSchema =
|
|
17414
|
-
version:
|
|
17418
|
+
var funnelGraphDraftSchema = z84.strictObject({
|
|
17419
|
+
version: z84.literal(5),
|
|
17415
17420
|
entry: identifier3,
|
|
17416
|
-
nodes:
|
|
17421
|
+
nodes: z84.array(funnelGraphNodeSchema).min(1).max(FUNNEL_LIMITS.flowNodes)
|
|
17417
17422
|
});
|
|
17418
17423
|
var funnelGraphSchema = funnelGraphDraftSchema.superRefine(
|
|
17419
17424
|
(graph, ctx) => {
|
|
@@ -17506,8 +17511,8 @@ function validateFunnelGraph(graph, onIssue) {
|
|
|
17506
17511
|
}
|
|
17507
17512
|
|
|
17508
17513
|
// ../contracts/src/coupon-public-content.ts
|
|
17509
|
-
import { z as
|
|
17510
|
-
var couponContentDigestSchema =
|
|
17514
|
+
import { z as z85 } from "zod";
|
|
17515
|
+
var couponContentDigestSchema = z85.string().regex(/^[a-f0-9]{64}$/);
|
|
17511
17516
|
var publicValue = surfaceValueSchema.pick({
|
|
17512
17517
|
text: true,
|
|
17513
17518
|
label: true,
|
|
@@ -17517,14 +17522,14 @@ var publicValue = surfaceValueSchema.pick({
|
|
|
17517
17522
|
countdownAt: true,
|
|
17518
17523
|
missing: true
|
|
17519
17524
|
});
|
|
17520
|
-
var publicCouponScreenDataSchema =
|
|
17521
|
-
couponDigests:
|
|
17522
|
-
variables:
|
|
17525
|
+
var publicCouponScreenDataSchema = z85.strictObject({
|
|
17526
|
+
couponDigests: z85.record(z85.uuid(), couponContentDigestSchema),
|
|
17527
|
+
variables: z85.record(
|
|
17523
17528
|
localeSchema,
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
|
|
17529
|
+
z85.record(
|
|
17530
|
+
z85.uuid(),
|
|
17531
|
+
z85.partialRecord(
|
|
17532
|
+
z85.enum([
|
|
17528
17533
|
"offer.name",
|
|
17529
17534
|
"offer.description",
|
|
17530
17535
|
"offer.headline",
|
|
@@ -17535,22 +17540,22 @@ var publicCouponScreenDataSchema = z84.strictObject({
|
|
|
17535
17540
|
"offer.months",
|
|
17536
17541
|
"offer.ends_at"
|
|
17537
17542
|
]),
|
|
17538
|
-
|
|
17543
|
+
z85.string()
|
|
17539
17544
|
)
|
|
17540
17545
|
)
|
|
17541
17546
|
),
|
|
17542
|
-
locales:
|
|
17547
|
+
locales: z85.record(
|
|
17543
17548
|
localeSchema,
|
|
17544
17549
|
surfaceDataSchema.extend({
|
|
17545
|
-
nodes:
|
|
17546
|
-
plans:
|
|
17547
|
-
pickers:
|
|
17550
|
+
nodes: z85.record(z85.string(), z85.strictObject({ base: publicValue })),
|
|
17551
|
+
plans: z85.object({}).strict(),
|
|
17552
|
+
pickers: z85.object({}).strict()
|
|
17548
17553
|
}).omit({ paywall: true })
|
|
17549
17554
|
)
|
|
17550
17555
|
});
|
|
17551
17556
|
|
|
17552
17557
|
// ../contracts/src/funnel-document.ts
|
|
17553
|
-
import { z as
|
|
17558
|
+
import { z as z87 } from "zod";
|
|
17554
17559
|
|
|
17555
17560
|
// ../contracts/src/public-screen.ts
|
|
17556
17561
|
function publicScreenIssues(doc, unsupported = []) {
|
|
@@ -17675,13 +17680,13 @@ function funnelConsumedVariables(node, declarations, route) {
|
|
|
17675
17680
|
}
|
|
17676
17681
|
|
|
17677
17682
|
// ../contracts/src/funnel-storage.ts
|
|
17678
|
-
import { z as
|
|
17679
|
-
var identifier4 =
|
|
17680
|
-
var bounded2 = (bytes) =>
|
|
17683
|
+
import { z as z86 } from "zod";
|
|
17684
|
+
var identifier4 = z86.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/);
|
|
17685
|
+
var bounded2 = (bytes) => z86.record(z86.string(), jsonValueSchema).refine(
|
|
17681
17686
|
(value) => jsonStorageBytes(value) <= bytes,
|
|
17682
17687
|
"Funnel evidence exceeds its byte budget"
|
|
17683
17688
|
);
|
|
17684
|
-
var funnelWaitKindSchema =
|
|
17689
|
+
var funnelWaitKindSchema = z86.enum([
|
|
17685
17690
|
"local_segment",
|
|
17686
17691
|
"evaluation",
|
|
17687
17692
|
"presentation",
|
|
@@ -17689,7 +17694,7 @@ var funnelWaitKindSchema = z85.enum([
|
|
|
17689
17694
|
"event",
|
|
17690
17695
|
"operation"
|
|
17691
17696
|
]);
|
|
17692
|
-
var funnelNodeKindSchema =
|
|
17697
|
+
var funnelNodeKindSchema = z86.enum([
|
|
17693
17698
|
"entry",
|
|
17694
17699
|
"presentation",
|
|
17695
17700
|
"decision",
|
|
@@ -17698,40 +17703,40 @@ var funnelNodeKindSchema = z85.enum([
|
|
|
17698
17703
|
"wait",
|
|
17699
17704
|
"terminal"
|
|
17700
17705
|
]);
|
|
17701
|
-
var funnelResourceReferenceSchema =
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
type:
|
|
17707
|
-
key:
|
|
17706
|
+
var funnelResourceReferenceSchema = z86.discriminatedUnion("type", [
|
|
17707
|
+
z86.strictObject({ type: z86.literal("flag"), key: z86.string().min(1).max(128) }),
|
|
17708
|
+
z86.strictObject({ type: z86.literal("experiment"), id: z86.uuid() }),
|
|
17709
|
+
z86.strictObject({ type: z86.literal("saved_group"), id: z86.uuid() }),
|
|
17710
|
+
z86.strictObject({
|
|
17711
|
+
type: z86.literal("config"),
|
|
17712
|
+
key: z86.string().min(1).max(128)
|
|
17708
17713
|
}),
|
|
17709
|
-
|
|
17710
|
-
type:
|
|
17711
|
-
key:
|
|
17714
|
+
z86.strictObject({
|
|
17715
|
+
type: z86.literal("constant"),
|
|
17716
|
+
key: z86.string().min(1).max(128)
|
|
17712
17717
|
}),
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17718
|
+
z86.strictObject({ type: z86.literal("paywall_version"), id: z86.uuid() }),
|
|
17719
|
+
z86.strictObject({ type: z86.literal("offering_version"), id: z86.uuid() }),
|
|
17720
|
+
z86.strictObject({ type: z86.literal("reward"), id: z86.uuid() })
|
|
17716
17721
|
]);
|
|
17717
|
-
var funnelNodeInputSchema =
|
|
17718
|
-
schemaVersion:
|
|
17722
|
+
var funnelNodeInputSchema = z86.strictObject({
|
|
17723
|
+
schemaVersion: z86.literal(1),
|
|
17719
17724
|
kind: funnelNodeKindSchema,
|
|
17720
17725
|
selector: funnelResourceReferenceSchema.nullable(),
|
|
17721
17726
|
context: bounded2(131072),
|
|
17722
|
-
contract:
|
|
17723
|
-
version:
|
|
17724
|
-
evaluator:
|
|
17725
|
-
policyRevision:
|
|
17727
|
+
contract: z86.strictObject({
|
|
17728
|
+
version: z86.number().int().positive(),
|
|
17729
|
+
evaluator: z86.string().min(1).max(128),
|
|
17730
|
+
policyRevision: z86.number().int().nonnegative()
|
|
17726
17731
|
})
|
|
17727
17732
|
}).refine(
|
|
17728
17733
|
(value) => jsonStorageBytes(value) <= 131072,
|
|
17729
17734
|
"Node input exceeds its byte budget"
|
|
17730
17735
|
);
|
|
17731
|
-
var funnelNodeResultSchema =
|
|
17732
|
-
schemaVersion:
|
|
17736
|
+
var funnelNodeResultSchema = z86.strictObject({
|
|
17737
|
+
schemaVersion: z86.literal(1),
|
|
17733
17738
|
kind: funnelNodeKindSchema,
|
|
17734
|
-
outcome:
|
|
17739
|
+
outcome: z86.enum([
|
|
17735
17740
|
"success",
|
|
17736
17741
|
"cancel",
|
|
17737
17742
|
"failure",
|
|
@@ -17742,120 +17747,120 @@ var funnelNodeResultSchema = z85.strictObject({
|
|
|
17742
17747
|
"not_participating"
|
|
17743
17748
|
]),
|
|
17744
17749
|
data: bounded2(131072),
|
|
17745
|
-
route:
|
|
17750
|
+
route: z86.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/).nullable(),
|
|
17746
17751
|
evidence: bounded2(131072)
|
|
17747
17752
|
}).refine(
|
|
17748
17753
|
(value) => jsonStorageBytes(value) <= 131072,
|
|
17749
17754
|
"Node result exceeds its byte budget"
|
|
17750
17755
|
);
|
|
17751
|
-
var funnelExecutionStateSchema =
|
|
17752
|
-
schemaVersion:
|
|
17753
|
-
operations:
|
|
17756
|
+
var funnelExecutionStateSchema = z86.strictObject({
|
|
17757
|
+
schemaVersion: z86.literal(1),
|
|
17758
|
+
operations: z86.record(
|
|
17754
17759
|
identifier4,
|
|
17755
|
-
|
|
17756
|
-
attempts:
|
|
17757
|
-
maxAttempts:
|
|
17758
|
-
deadlineAt:
|
|
17759
|
-
retryAt:
|
|
17760
|
-
error:
|
|
17761
|
-
reference:
|
|
17760
|
+
z86.strictObject({
|
|
17761
|
+
attempts: z86.number().int().nonnegative(),
|
|
17762
|
+
maxAttempts: z86.number().int().min(1).max(5),
|
|
17763
|
+
deadlineAt: z86.iso.datetime({ offset: true }),
|
|
17764
|
+
retryAt: z86.iso.datetime({ offset: true }).nullable(),
|
|
17765
|
+
error: z86.string().regex(/^[a-z_]{1,64}$/).nullable(),
|
|
17766
|
+
reference: z86.strictObject({ type: identifier4, id: z86.uuid() }).nullable()
|
|
17762
17767
|
})
|
|
17763
17768
|
)
|
|
17764
17769
|
}).refine(
|
|
17765
17770
|
(value) => jsonStorageBytes(value) <= 65536,
|
|
17766
17771
|
"Execution state exceeds its byte budget"
|
|
17767
17772
|
);
|
|
17768
|
-
var receipt = { receiptId:
|
|
17769
|
-
var occurredAt =
|
|
17770
|
-
var funnelTraceEventSchema =
|
|
17771
|
-
|
|
17772
|
-
type:
|
|
17773
|
-
details:
|
|
17773
|
+
var receipt = { receiptId: z86.uuid() };
|
|
17774
|
+
var occurredAt = z86.iso.datetime({ offset: true });
|
|
17775
|
+
var funnelTraceEventSchema = z86.discriminatedUnion("type", [
|
|
17776
|
+
z86.strictObject({
|
|
17777
|
+
type: z86.literal("node_entered"),
|
|
17778
|
+
details: z86.strictObject({ kind: funnelNodeKindSchema })
|
|
17774
17779
|
}),
|
|
17775
|
-
|
|
17776
|
-
type:
|
|
17777
|
-
details:
|
|
17780
|
+
z86.strictObject({
|
|
17781
|
+
type: z86.literal("presentation_shown"),
|
|
17782
|
+
details: z86.strictObject({
|
|
17778
17783
|
...receipt,
|
|
17779
|
-
source:
|
|
17784
|
+
source: z86.literal("client"),
|
|
17780
17785
|
occurredAt: occurredAt.optional()
|
|
17781
17786
|
})
|
|
17782
17787
|
}),
|
|
17783
|
-
|
|
17784
|
-
type:
|
|
17785
|
-
details:
|
|
17788
|
+
z86.strictObject({
|
|
17789
|
+
type: z86.literal("decision_accepted"),
|
|
17790
|
+
details: z86.strictObject(receipt)
|
|
17786
17791
|
}),
|
|
17787
|
-
|
|
17788
|
-
type:
|
|
17789
|
-
details:
|
|
17790
|
-
signalId:
|
|
17792
|
+
z86.strictObject({
|
|
17793
|
+
type: z86.literal("signal_received"),
|
|
17794
|
+
details: z86.strictObject({
|
|
17795
|
+
signalId: z86.uuid(),
|
|
17791
17796
|
nodeId: identifier4,
|
|
17792
17797
|
eventName: identifier4,
|
|
17793
17798
|
data: bounded2(8192),
|
|
17794
|
-
source:
|
|
17799
|
+
source: z86.literal("server"),
|
|
17795
17800
|
occurredAt
|
|
17796
17801
|
})
|
|
17797
17802
|
}),
|
|
17798
|
-
|
|
17799
|
-
type:
|
|
17800
|
-
details:
|
|
17803
|
+
z86.strictObject({
|
|
17804
|
+
type: z86.literal("signal_consumed"),
|
|
17805
|
+
details: z86.strictObject({ ...receipt, signalId: z86.uuid() })
|
|
17801
17806
|
}),
|
|
17802
|
-
|
|
17803
|
-
type:
|
|
17804
|
-
details:
|
|
17807
|
+
z86.strictObject({
|
|
17808
|
+
type: z86.literal("wait_elapsed"),
|
|
17809
|
+
details: z86.strictObject(receipt)
|
|
17805
17810
|
}),
|
|
17806
|
-
|
|
17807
|
-
type:
|
|
17808
|
-
details:
|
|
17811
|
+
z86.strictObject({
|
|
17812
|
+
type: z86.literal("wait_timeout"),
|
|
17813
|
+
details: z86.strictObject(receipt)
|
|
17809
17814
|
}),
|
|
17810
|
-
|
|
17811
|
-
type:
|
|
17812
|
-
details:
|
|
17815
|
+
z86.strictObject({
|
|
17816
|
+
type: z86.literal("operation_completed"),
|
|
17817
|
+
details: z86.strictObject({
|
|
17813
17818
|
...receipt,
|
|
17814
17819
|
operation: identifier4,
|
|
17815
|
-
reference:
|
|
17820
|
+
reference: z86.strictObject({ type: identifier4, id: z86.uuid() }).nullable()
|
|
17816
17821
|
})
|
|
17817
17822
|
}),
|
|
17818
|
-
|
|
17819
|
-
type:
|
|
17820
|
-
details:
|
|
17821
|
-
generation:
|
|
17822
|
-
reason:
|
|
17823
|
+
z86.strictObject({
|
|
17824
|
+
type: z86.literal("execution_recovered"),
|
|
17825
|
+
details: z86.strictObject({
|
|
17826
|
+
generation: z86.number().int().positive(),
|
|
17827
|
+
reason: z86.enum(["interrupted", "expired_lease", "delivery_failed"])
|
|
17823
17828
|
})
|
|
17824
17829
|
}),
|
|
17825
|
-
|
|
17826
|
-
type:
|
|
17827
|
-
details:
|
|
17828
|
-
generation:
|
|
17829
|
-
code:
|
|
17830
|
+
z86.strictObject({
|
|
17831
|
+
type: z86.literal("execution_failed"),
|
|
17832
|
+
details: z86.strictObject({
|
|
17833
|
+
generation: z86.number().int().positive(),
|
|
17834
|
+
code: z86.string().regex(/^[a-z_]{1,64}$/)
|
|
17830
17835
|
})
|
|
17831
17836
|
}),
|
|
17832
|
-
|
|
17833
|
-
type:
|
|
17834
|
-
details:
|
|
17835
|
-
outcome:
|
|
17837
|
+
z86.strictObject({
|
|
17838
|
+
type: z86.literal("run_completed"),
|
|
17839
|
+
details: z86.strictObject({
|
|
17840
|
+
outcome: z86.enum(["completed", "ineligible", "failed"])
|
|
17836
17841
|
})
|
|
17837
17842
|
}),
|
|
17838
|
-
|
|
17839
|
-
type:
|
|
17840
|
-
details:
|
|
17843
|
+
z86.strictObject({
|
|
17844
|
+
type: z86.literal("run_closed"),
|
|
17845
|
+
details: z86.strictObject({ source: z86.enum(["client", "server", "expiry"]) })
|
|
17841
17846
|
}),
|
|
17842
|
-
|
|
17843
|
-
type:
|
|
17844
|
-
details:
|
|
17847
|
+
z86.strictObject({
|
|
17848
|
+
type: z86.literal("treatment_used"),
|
|
17849
|
+
details: z86.strictObject({
|
|
17845
17850
|
...receipt,
|
|
17846
|
-
source:
|
|
17851
|
+
source: z86.enum(["client", "server"]),
|
|
17847
17852
|
occurredAt,
|
|
17848
|
-
reference:
|
|
17853
|
+
reference: z86.string().min(1).max(128).optional()
|
|
17849
17854
|
})
|
|
17850
17855
|
})
|
|
17851
17856
|
]);
|
|
17852
17857
|
|
|
17853
17858
|
// ../contracts/src/funnel-document.ts
|
|
17854
|
-
var screenId =
|
|
17855
|
-
var ownedFunnelScreenSchema =
|
|
17856
|
-
|
|
17859
|
+
var screenId = z87.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/);
|
|
17860
|
+
var ownedFunnelScreenSchema = z87.discriminatedUnion("type", [
|
|
17861
|
+
z87.strictObject({
|
|
17857
17862
|
id: screenId,
|
|
17858
|
-
type:
|
|
17863
|
+
type: z87.literal("owned"),
|
|
17859
17864
|
/** Generated at reviewed public publication, never accepted as authored Coupon truth. */
|
|
17860
17865
|
publicData: publicCouponScreenDataSchema.optional(),
|
|
17861
17866
|
document: screenDocumentSchema.refine(
|
|
@@ -17865,33 +17870,33 @@ var ownedFunnelScreenSchema = z86.discriminatedUnion("type", [
|
|
|
17865
17870
|
"A Funnel owns one Page or Popup per screen and emits outputs; Paywall owns its purchase policies"
|
|
17866
17871
|
)
|
|
17867
17872
|
}),
|
|
17868
|
-
|
|
17873
|
+
z87.strictObject({
|
|
17869
17874
|
id: screenId,
|
|
17870
|
-
type:
|
|
17871
|
-
paywallVersionId:
|
|
17875
|
+
type: z87.literal("paywall"),
|
|
17876
|
+
paywallVersionId: z87.uuid()
|
|
17872
17877
|
})
|
|
17873
17878
|
]);
|
|
17874
17879
|
var base2 = {
|
|
17875
|
-
kind:
|
|
17876
|
-
schemaVersion:
|
|
17877
|
-
screens:
|
|
17878
|
-
references:
|
|
17879
|
-
inputs:
|
|
17880
|
-
|
|
17880
|
+
kind: z87.literal("funnel"),
|
|
17881
|
+
schemaVersion: z87.literal(4),
|
|
17882
|
+
screens: z87.array(ownedFunnelScreenSchema).max(FUNNEL_LIMITS.pages),
|
|
17883
|
+
references: z87.record(screenId, funnelResourceReferenceSchema).refine((value) => Object.keys(value).length <= 500),
|
|
17884
|
+
inputs: z87.array(
|
|
17885
|
+
z87.strictObject({
|
|
17881
17886
|
variable: screenId,
|
|
17882
17887
|
screenId,
|
|
17883
17888
|
componentId: screenId,
|
|
17884
|
-
required:
|
|
17889
|
+
required: z87.boolean()
|
|
17885
17890
|
})
|
|
17886
17891
|
).max(FUNNEL_LIMITS.questions),
|
|
17887
|
-
variables:
|
|
17892
|
+
variables: z87.record(funnelVariableKeySchema, funnelVariableDeclarationSchema).refine((value) => Object.keys(value).length <= FUNNEL_LIMITS.logicNodes),
|
|
17888
17893
|
outputSchema: funnelValueDeclarationSchema,
|
|
17889
|
-
execution:
|
|
17890
|
-
runTimeoutSeconds:
|
|
17891
|
-
maxTransitions:
|
|
17894
|
+
execution: z87.strictObject({
|
|
17895
|
+
runTimeoutSeconds: z87.number().int().min(1).max(FUNNEL_EXECUTION_LIMITS.runTimeoutSeconds),
|
|
17896
|
+
maxTransitions: z87.number().int().min(1).max(FUNNEL_EXECUTION_LIMITS.maxTransitions)
|
|
17892
17897
|
})
|
|
17893
17898
|
};
|
|
17894
|
-
var funnelDocumentDraftSchema =
|
|
17899
|
+
var funnelDocumentDraftSchema = z87.strictObject({
|
|
17895
17900
|
...base2,
|
|
17896
17901
|
graph: funnelGraphDraftSchema
|
|
17897
17902
|
});
|
|
@@ -18327,60 +18332,60 @@ function validateDocument(document, ctx) {
|
|
|
18327
18332
|
if (components > FUNNEL_LIMITS.components || actions > FUNNEL_LIMITS.actions || jsonStorageBytes(document) > FUNNEL_LIMITS.documentBytes)
|
|
18328
18333
|
issue("Funnel document exceeds its budget", "budget");
|
|
18329
18334
|
}
|
|
18330
|
-
var funnelPublishableDraftSchema =
|
|
18331
|
-
var funnelDocumentSchema =
|
|
18335
|
+
var funnelPublishableDraftSchema = z87.strictObject({ ...base2, graph: funnelGraphSchema }).superRefine(validateDocument);
|
|
18336
|
+
var funnelDocumentSchema = z87.strictObject({
|
|
18332
18337
|
...base2,
|
|
18333
18338
|
graph: funnelGraphSchema,
|
|
18334
|
-
displayName:
|
|
18339
|
+
displayName: z87.string().trim().min(1).max(80)
|
|
18335
18340
|
}).superRefine(validateDocument);
|
|
18336
18341
|
var funnelPublicationSchema = funnelDocumentSchema.superRefine(publicationRules);
|
|
18337
18342
|
var funnelPublicationDraftSchema = funnelPublishableDraftSchema.superRefine(publicationRules);
|
|
18338
|
-
var customerToken =
|
|
18343
|
+
var customerToken = z87.string().regex(/^gg_ct_[A-Za-z0-9_-]{43}$/);
|
|
18339
18344
|
var expected = {
|
|
18340
|
-
requestId:
|
|
18345
|
+
requestId: z87.uuid(),
|
|
18341
18346
|
nodeId: screenId,
|
|
18342
|
-
visit:
|
|
18343
|
-
revision:
|
|
18347
|
+
visit: z87.number().int().nonnegative(),
|
|
18348
|
+
revision: z87.number().int().nonnegative(),
|
|
18344
18349
|
customerToken: customerToken.optional()
|
|
18345
18350
|
};
|
|
18346
|
-
var funnelPresentationSubmissionSchema =
|
|
18347
|
-
|
|
18348
|
-
type:
|
|
18351
|
+
var funnelPresentationSubmissionSchema = z87.discriminatedUnion("type", [
|
|
18352
|
+
z87.strictObject({
|
|
18353
|
+
type: z87.literal("screen"),
|
|
18349
18354
|
output: screenId,
|
|
18350
18355
|
answers: screenAnswersSchema,
|
|
18351
|
-
selection:
|
|
18356
|
+
selection: z87.record(screenId, z87.union([z87.string().max(200), z87.boolean()])).optional()
|
|
18352
18357
|
}),
|
|
18353
|
-
|
|
18354
|
-
type:
|
|
18358
|
+
z87.strictObject({
|
|
18359
|
+
type: z87.literal("paywall_quote"),
|
|
18355
18360
|
actionId: screenId,
|
|
18356
|
-
productVersionId:
|
|
18357
|
-
offerId:
|
|
18361
|
+
productVersionId: z87.uuid(),
|
|
18362
|
+
offerId: z87.uuid().optional(),
|
|
18358
18363
|
nativeOffer: nativeStoreOfferSelectionSchema.optional(),
|
|
18359
|
-
predecessor:
|
|
18360
|
-
operationId:
|
|
18361
|
-
generation:
|
|
18364
|
+
predecessor: z87.strictObject({
|
|
18365
|
+
operationId: z87.uuid().nullable(),
|
|
18366
|
+
generation: z87.number().int().positive()
|
|
18362
18367
|
}).optional()
|
|
18363
18368
|
}),
|
|
18364
|
-
|
|
18365
|
-
|
|
18369
|
+
z87.strictObject({ type: z87.literal("paywall_confirm"), operationId: z87.uuid() }),
|
|
18370
|
+
z87.strictObject({ type: z87.literal("paywall_cancel"), operationId: z87.uuid() }),
|
|
18366
18371
|
/** Event Actions acknowledge success, cancel or failure; external pages acknowledge opened or failed. */
|
|
18367
|
-
|
|
18368
|
-
type:
|
|
18369
|
-
receiptId:
|
|
18370
|
-
outcome:
|
|
18372
|
+
z87.strictObject({
|
|
18373
|
+
type: z87.literal("client_action"),
|
|
18374
|
+
receiptId: z87.uuid(),
|
|
18375
|
+
outcome: z87.enum(["success", "cancel", "failure", "opened", "failed"])
|
|
18371
18376
|
})
|
|
18372
18377
|
]);
|
|
18373
|
-
var funnelDataQueriesSchema =
|
|
18378
|
+
var funnelDataQueriesSchema = z87.object({
|
|
18374
18379
|
nodeId: screenId,
|
|
18375
|
-
visit:
|
|
18376
|
-
revision:
|
|
18377
|
-
components:
|
|
18380
|
+
visit: z87.number().int().nonnegative(),
|
|
18381
|
+
revision: z87.number().int().nonnegative(),
|
|
18382
|
+
components: z87.record(
|
|
18378
18383
|
screenId,
|
|
18379
|
-
|
|
18380
|
-
resourceKey:
|
|
18381
|
-
page:
|
|
18384
|
+
z87.object({
|
|
18385
|
+
resourceKey: z87.string().regex(/^[a-z][a-z0-9_]{0,63}$/).optional(),
|
|
18386
|
+
page: z87.number().int().min(1).max(1e5),
|
|
18382
18387
|
after: screenDataCursorSchema.nullable(),
|
|
18383
|
-
filter:
|
|
18388
|
+
filter: z87.enum([
|
|
18384
18389
|
"all",
|
|
18385
18390
|
"purchase",
|
|
18386
18391
|
"refund",
|
|
@@ -18397,61 +18402,61 @@ var funnelDataQueriesSchema = z86.object({
|
|
|
18397
18402
|
}).strict()
|
|
18398
18403
|
).refine((v) => Object.keys(v).length <= 150)
|
|
18399
18404
|
}).strict();
|
|
18400
|
-
var funnelCommandSchema =
|
|
18405
|
+
var funnelCommandSchema = z87.discriminatedUnion("operation", [
|
|
18401
18406
|
// A server start names its Customer (get-or-create by externalUserId with creation-only customerData);
|
|
18402
18407
|
// a Customer credential always starts as its own Customer and names none.
|
|
18403
|
-
|
|
18404
|
-
operation:
|
|
18405
|
-
funnelId:
|
|
18406
|
-
requestId:
|
|
18408
|
+
z87.strictObject({
|
|
18409
|
+
operation: z87.literal("start"),
|
|
18410
|
+
funnelId: z87.uuid(),
|
|
18411
|
+
requestId: z87.uuid(),
|
|
18407
18412
|
customer: customerReferenceSchema.optional(),
|
|
18408
18413
|
customerData: customerDataSchema.optional(),
|
|
18409
|
-
locale:
|
|
18414
|
+
locale: z87.string().min(1).max(35),
|
|
18410
18415
|
parameters: screenParametersSchema
|
|
18411
18416
|
}).refine(customerDataReferenced, customerDataReferenceMessage),
|
|
18412
|
-
|
|
18413
|
-
operation:
|
|
18414
|
-
settlementRequestId:
|
|
18417
|
+
z87.strictObject({
|
|
18418
|
+
operation: z87.literal("get"),
|
|
18419
|
+
settlementRequestId: z87.uuid().optional(),
|
|
18415
18420
|
data: funnelDataQueriesSchema.optional(),
|
|
18416
|
-
purchase:
|
|
18421
|
+
purchase: z87.strictObject({ receiptId: z87.uuid(), operationId: z87.uuid() }).optional(),
|
|
18417
18422
|
customerToken: customerToken.optional()
|
|
18418
18423
|
}),
|
|
18419
|
-
|
|
18420
|
-
operation:
|
|
18421
|
-
requestId:
|
|
18424
|
+
z87.strictObject({
|
|
18425
|
+
operation: z87.literal("resume"),
|
|
18426
|
+
requestId: z87.uuid(),
|
|
18422
18427
|
customerToken: customerToken.optional()
|
|
18423
18428
|
}),
|
|
18424
|
-
|
|
18425
|
-
operation:
|
|
18429
|
+
z87.strictObject({
|
|
18430
|
+
operation: z87.literal("submit"),
|
|
18426
18431
|
...expected,
|
|
18427
18432
|
input: funnelPresentationSubmissionSchema
|
|
18428
18433
|
}),
|
|
18429
|
-
|
|
18430
|
-
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
operation:
|
|
18434
|
+
z87.strictObject({ operation: z87.literal("back"), ...expected }),
|
|
18435
|
+
z87.strictObject({ operation: z87.literal("shown"), ...expected }),
|
|
18436
|
+
z87.strictObject({ operation: z87.literal("close"), ...expected }),
|
|
18437
|
+
z87.strictObject({
|
|
18438
|
+
operation: z87.literal("commit_segment"),
|
|
18434
18439
|
...expected,
|
|
18435
|
-
policyRevision:
|
|
18436
|
-
generation:
|
|
18437
|
-
steps:
|
|
18438
|
-
boundary:
|
|
18439
|
-
nodeId:
|
|
18440
|
-
visit:
|
|
18440
|
+
policyRevision: z87.number().int().nonnegative(),
|
|
18441
|
+
generation: z87.string().min(1).max(256),
|
|
18442
|
+
steps: z87.array(funnelLocalSegmentStepSchema).max(32),
|
|
18443
|
+
boundary: z87.strictObject({
|
|
18444
|
+
nodeId: z87.string().min(1).max(64),
|
|
18445
|
+
visit: z87.number().int().nonnegative()
|
|
18441
18446
|
}).optional()
|
|
18442
18447
|
}),
|
|
18443
|
-
|
|
18444
|
-
operation:
|
|
18448
|
+
z87.strictObject({
|
|
18449
|
+
operation: z87.literal("evaluate"),
|
|
18445
18450
|
...expected,
|
|
18446
|
-
receiptId:
|
|
18447
|
-
policyRevision:
|
|
18448
|
-
generation:
|
|
18451
|
+
receiptId: z87.uuid(),
|
|
18452
|
+
policyRevision: z87.number().int().nonnegative(),
|
|
18453
|
+
generation: z87.string().min(1).max(256),
|
|
18449
18454
|
result: funnelEvaluationResultSchema
|
|
18450
18455
|
}),
|
|
18451
18456
|
/** Historical projection only; it never acknowledges or resumes execution. */
|
|
18452
|
-
|
|
18453
|
-
operation:
|
|
18454
|
-
receiptId:
|
|
18457
|
+
z87.strictObject({
|
|
18458
|
+
operation: z87.literal("review"),
|
|
18459
|
+
receiptId: z87.uuid().optional(),
|
|
18455
18460
|
customerToken: customerToken.optional()
|
|
18456
18461
|
})
|
|
18457
18462
|
]);
|
|
@@ -18638,7 +18643,11 @@ async function withLock(path, work) {
|
|
|
18638
18643
|
return await work();
|
|
18639
18644
|
} finally {
|
|
18640
18645
|
await unlink(join(lock, owner));
|
|
18641
|
-
await rmdir(lock)
|
|
18646
|
+
await rmdir(lock).catch((error) => {
|
|
18647
|
+
if (missing(error) || error instanceof Error && "code" in error && ["ENOTEMPTY", "EEXIST"].includes(String(error.code)))
|
|
18648
|
+
return;
|
|
18649
|
+
throw error;
|
|
18650
|
+
});
|
|
18642
18651
|
}
|
|
18643
18652
|
}
|
|
18644
18653
|
|
|
@@ -19067,7 +19076,7 @@ async function diffDocuments(kind, file, against) {
|
|
|
19067
19076
|
}
|
|
19068
19077
|
|
|
19069
19078
|
// src/auth/preflight.ts
|
|
19070
|
-
import { z as
|
|
19079
|
+
import { z as z89 } from "zod";
|
|
19071
19080
|
|
|
19072
19081
|
// src/client/response.ts
|
|
19073
19082
|
async function responseJson(response, signal, limit) {
|
|
@@ -19124,7 +19133,7 @@ function cancelResponse(response) {
|
|
|
19124
19133
|
}
|
|
19125
19134
|
|
|
19126
19135
|
// src/client/diagnostics.ts
|
|
19127
|
-
import { z as
|
|
19136
|
+
import { z as z88 } from "zod";
|
|
19128
19137
|
var failures = [
|
|
19129
19138
|
{
|
|
19130
19139
|
kind: "tls",
|
|
@@ -19216,7 +19225,7 @@ function networkFailure(error, context) {
|
|
|
19216
19225
|
const kind = match?.kind ?? "unknown";
|
|
19217
19226
|
const safeDetails = details(context);
|
|
19218
19227
|
const transportCode = match?.codes.find((code) => codes.has(code));
|
|
19219
|
-
const requestId =
|
|
19228
|
+
const requestId = z88.uuid().safeParse(context.response?.headers.get("X-Request-Id")).data;
|
|
19220
19229
|
return new CliError(
|
|
19221
19230
|
kind === "timeout" ? "TIMEOUT" : "NETWORK_ERROR",
|
|
19222
19231
|
`${match?.message ?? "The network request failed"} for ${safeDetails.host}${kind === "timeout" ? ` (deadline ${context.timeout} ms)` : ""}.${recoveryHint(context)}`,
|
|
@@ -19241,7 +19250,7 @@ function networkFailure(error, context) {
|
|
|
19241
19250
|
function httpFailure(response, context) {
|
|
19242
19251
|
const proxy = response.status === 407;
|
|
19243
19252
|
const code = proxy ? "NETWORK_ERROR" : apiErrorCodeForStatus(response.status);
|
|
19244
|
-
const requestId =
|
|
19253
|
+
const requestId = z88.uuid().safeParse(response.headers.get("X-Request-Id")).data;
|
|
19245
19254
|
const metadata2 = errorMetadata(code, response.status, {
|
|
19246
19255
|
retryAfter: response.headers.get("Retry-After")
|
|
19247
19256
|
});
|
|
@@ -19301,12 +19310,12 @@ async function publicJson(url2, timeout2, fetcher = fetch, stage = "preflight")
|
|
|
19301
19310
|
}
|
|
19302
19311
|
|
|
19303
19312
|
// src/auth/preflight.ts
|
|
19304
|
-
var discoverySchema =
|
|
19305
|
-
issuer:
|
|
19306
|
-
authorization_endpoint:
|
|
19307
|
-
token_endpoint:
|
|
19308
|
-
code_challenge_methods_supported:
|
|
19309
|
-
grant_types_supported:
|
|
19313
|
+
var discoverySchema = z89.object({
|
|
19314
|
+
issuer: z89.string(),
|
|
19315
|
+
authorization_endpoint: z89.string(),
|
|
19316
|
+
token_endpoint: z89.string(),
|
|
19317
|
+
code_challenge_methods_supported: z89.array(z89.string()).max(20),
|
|
19318
|
+
grant_types_supported: z89.array(z89.string()).max(20)
|
|
19310
19319
|
});
|
|
19311
19320
|
async function authorizationPreflight(apiOrigin, timeout2 = 1e4, fetcher = fetch) {
|
|
19312
19321
|
const response = await publicJson(
|
|
@@ -19399,14 +19408,14 @@ async function authorizationPreflight(apiOrigin, timeout2 = 1e4, fetcher = fetch
|
|
|
19399
19408
|
import { hostname as hostname2 } from "os";
|
|
19400
19409
|
import open2 from "open";
|
|
19401
19410
|
import * as oauth2 from "openid-client";
|
|
19402
|
-
import { z as
|
|
19411
|
+
import { z as z92 } from "zod";
|
|
19403
19412
|
|
|
19404
19413
|
// src/client/management-http.ts
|
|
19405
|
-
import { z as
|
|
19414
|
+
import { z as z90 } from "zod";
|
|
19406
19415
|
async function failure(response, signal) {
|
|
19407
19416
|
const status = response.status;
|
|
19408
19417
|
let code = status === 501 ? "CAPABILITY_UNAVAILABLE" : apiErrorCodeForStatus(status);
|
|
19409
|
-
let requestId =
|
|
19418
|
+
let requestId = z90.uuid().safeParse(response.headers.get("X-Request-Id")).data;
|
|
19410
19419
|
let metadata2 = errorMetadata(code, status, {
|
|
19411
19420
|
retryAfter: response.headers.get("Retry-After")
|
|
19412
19421
|
});
|
|
@@ -19473,7 +19482,7 @@ async function managementJson(origin2, path, token, method, schema, body, timeou
|
|
|
19473
19482
|
);
|
|
19474
19483
|
if (!response.ok) throw await failure(response, signal);
|
|
19475
19484
|
const parsed = await responseJson(response, signal, responseLimit);
|
|
19476
|
-
const result =
|
|
19485
|
+
const result = z90.object({ data: schema }).safeParse(parsed);
|
|
19477
19486
|
if (!result.success)
|
|
19478
19487
|
throw new CliError(
|
|
19479
19488
|
"INVALID_SERVER_RESPONSE",
|
|
@@ -19500,19 +19509,19 @@ async function managementJson(origin2, path, token, method, schema, body, timeou
|
|
|
19500
19509
|
import { createHash as createHash2 } from "crypto";
|
|
19501
19510
|
import { lstat as lstat3, readFile as readFile2, unlink as unlink3 } from "fs/promises";
|
|
19502
19511
|
import { join as join3 } from "path";
|
|
19503
|
-
import { z as
|
|
19504
|
-
var credentialSchema =
|
|
19505
|
-
schemaVersion:
|
|
19512
|
+
import { z as z91 } from "zod";
|
|
19513
|
+
var credentialSchema = z91.strictObject({
|
|
19514
|
+
schemaVersion: z91.literal(1),
|
|
19506
19515
|
apiOrigin: managementOriginSchema,
|
|
19507
|
-
issuer:
|
|
19508
|
-
clientId:
|
|
19509
|
-
redirectUri:
|
|
19510
|
-
userId:
|
|
19511
|
-
sessionId:
|
|
19512
|
-
authorizationId:
|
|
19513
|
-
accessToken:
|
|
19514
|
-
refreshToken:
|
|
19515
|
-
expiresAt:
|
|
19516
|
+
issuer: z91.url(),
|
|
19517
|
+
clientId: z91.uuid(),
|
|
19518
|
+
redirectUri: z91.literal("http://127.0.0.1:43187/callback"),
|
|
19519
|
+
userId: z91.uuid(),
|
|
19520
|
+
sessionId: z91.uuid(),
|
|
19521
|
+
authorizationId: z91.uuid(),
|
|
19522
|
+
accessToken: z91.string().min(1).max(16384),
|
|
19523
|
+
refreshToken: z91.string().min(1).max(16384),
|
|
19524
|
+
expiresAt: z91.number().int().positive()
|
|
19516
19525
|
});
|
|
19517
19526
|
async function credentials(location2, origin2, profile, store) {
|
|
19518
19527
|
const account = createHash2("sha256").update(JSON.stringify([origin2, profile ?? null])).digest("hex");
|
|
@@ -19888,9 +19897,9 @@ async function oauthCode(configuration, redirectUri, openBrowser, waitMs = 6e5)
|
|
|
19888
19897
|
|
|
19889
19898
|
// src/auth/session.ts
|
|
19890
19899
|
var endpoint = (id) => `/api/console/auth/authorizations/${encodeURIComponent(id)}`;
|
|
19891
|
-
var resultSchema =
|
|
19892
|
-
id:
|
|
19893
|
-
state:
|
|
19900
|
+
var resultSchema = z92.strictObject({
|
|
19901
|
+
id: z92.uuid(),
|
|
19902
|
+
state: z92.literal("revoked")
|
|
19894
19903
|
});
|
|
19895
19904
|
function tokenExpiration(tokens) {
|
|
19896
19905
|
if (!tokens.refresh_token || !tokens.expires_in || tokens.expires_in <= 0)
|
|
@@ -20291,7 +20300,7 @@ async function logout(options, localOnly = false) {
|
|
|
20291
20300
|
c.accessToken,
|
|
20292
20301
|
"DELETE",
|
|
20293
20302
|
resultSchema.extend({
|
|
20294
|
-
nativeSessionRevocation:
|
|
20303
|
+
nativeSessionRevocation: z92.literal("complete")
|
|
20295
20304
|
}),
|
|
20296
20305
|
{ refreshToken: c.refreshToken },
|
|
20297
20306
|
options.timeout,
|
|
@@ -20333,7 +20342,7 @@ import { Command } from "commander";
|
|
|
20333
20342
|
import { open as open3, unlink as unlink4, lstat as lstat4 } from "fs/promises";
|
|
20334
20343
|
import { resolve, extname, basename } from "path";
|
|
20335
20344
|
import { constants } from "fs";
|
|
20336
|
-
import { z as
|
|
20345
|
+
import { z as z93 } from "zod";
|
|
20337
20346
|
function queryInput(values = []) {
|
|
20338
20347
|
const query = {};
|
|
20339
20348
|
for (const value of values) {
|
|
@@ -20380,7 +20389,7 @@ async function callOperation(options, operation, input) {
|
|
|
20380
20389
|
`/api/management/v1/operations/${encodeURIComponent(operation.operationId)}?${query}`,
|
|
20381
20390
|
credential.accessToken,
|
|
20382
20391
|
"POST",
|
|
20383
|
-
|
|
20392
|
+
z93.json(),
|
|
20384
20393
|
input,
|
|
20385
20394
|
options.timeout,
|
|
20386
20395
|
options.fetcher,
|
|
@@ -20533,7 +20542,7 @@ function registerOperations(program, session, success) {
|
|
|
20533
20542
|
);
|
|
20534
20543
|
if (file) {
|
|
20535
20544
|
if (operation.binaryResponse) {
|
|
20536
|
-
const blob =
|
|
20545
|
+
const blob = z93.strictObject({ contentType: z93.string(), base64: z93.string() }).parse(result);
|
|
20537
20546
|
await file.writeFile(Buffer.from(blob.base64, "base64"));
|
|
20538
20547
|
} else await file.writeFile(JSON.stringify(result, null, 2) + "\n");
|
|
20539
20548
|
await file.sync();
|
|
@@ -20661,7 +20670,7 @@ function registerOperations(program, session, success) {
|
|
|
20661
20670
|
const args2 = command2.opts();
|
|
20662
20671
|
let snapshotId;
|
|
20663
20672
|
if (snapshotIdentity) {
|
|
20664
|
-
const parsed =
|
|
20673
|
+
const parsed = z93.uuid().safeParse(values[0]);
|
|
20665
20674
|
if (!parsed.success)
|
|
20666
20675
|
throw new CliError("INVALID_ARGUMENT", "Use a valid Snapshot UUID.");
|
|
20667
20676
|
snapshotId = parsed.data;
|
|
@@ -20790,21 +20799,21 @@ import { open as open4 } from "fs/promises";
|
|
|
20790
20799
|
import { resolve as resolve2 } from "path";
|
|
20791
20800
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "crypto";
|
|
20792
20801
|
import "commander";
|
|
20793
|
-
import { z as
|
|
20794
|
-
var iamPreflightSchema =
|
|
20795
|
-
format:
|
|
20796
|
-
schemaVersion:
|
|
20797
|
-
app:
|
|
20798
|
-
pages:
|
|
20799
|
-
documents:
|
|
20800
|
-
|
|
20801
|
-
kind:
|
|
20802
|
-
evidence:
|
|
20802
|
+
import { z as z94 } from "zod";
|
|
20803
|
+
var iamPreflightSchema = z94.looseObject({
|
|
20804
|
+
format: z94.literal("indiana-app-manifest"),
|
|
20805
|
+
schemaVersion: z94.literal(2),
|
|
20806
|
+
app: z94.looseObject({ platforms: z94.tuple([z94.literal("web")]) }),
|
|
20807
|
+
pages: z94.array(z94.unknown()).min(1),
|
|
20808
|
+
documents: z94.array(
|
|
20809
|
+
z94.looseObject({
|
|
20810
|
+
kind: z94.literal("source_projection"),
|
|
20811
|
+
evidence: z94.enum(["source_inferred", "uncovered"])
|
|
20803
20812
|
})
|
|
20804
20813
|
),
|
|
20805
|
-
coverage:
|
|
20806
|
-
runtimeObserved:
|
|
20807
|
-
gaps:
|
|
20814
|
+
coverage: z94.looseObject({
|
|
20815
|
+
runtimeObserved: z94.literal(false),
|
|
20816
|
+
gaps: z94.array(z94.unknown())
|
|
20808
20817
|
})
|
|
20809
20818
|
});
|
|
20810
20819
|
var IAM_FULL_VALIDATION = "Not run by the CLI. Run `node <skill-folder>/scripts/iam.mjs validate --file <file>` from the IAM skill; the server validates the file again when the version is uploaded.";
|
|
@@ -20864,7 +20873,7 @@ async function remote(options, method, body, query = {}) {
|
|
|
20864
20873
|
return await callOperation(options, iamOperation(method), {
|
|
20865
20874
|
params: {},
|
|
20866
20875
|
query,
|
|
20867
|
-
...body === void 0 ? {} : { body:
|
|
20876
|
+
...body === void 0 ? {} : { body: z94.json().parse(body) }
|
|
20868
20877
|
});
|
|
20869
20878
|
} catch (error) {
|
|
20870
20879
|
if (error instanceof CliError && error.code === "CAPABILITY_UNAVAILABLE")
|
|
@@ -20873,7 +20882,7 @@ async function remote(options, method, body, query = {}) {
|
|
|
20873
20882
|
}
|
|
20874
20883
|
}
|
|
20875
20884
|
async function uploadIam(options, file, label, requestId, uploadTimeout = 12e4) {
|
|
20876
|
-
if (!
|
|
20885
|
+
if (!z94.uuid().safeParse(requestId).success || !label.trim() || label.trim().length > 100)
|
|
20877
20886
|
throw new CliError(
|
|
20878
20887
|
"INVALID_ARGUMENT",
|
|
20879
20888
|
"Use a UUID request ID and a version label of 1\u2013100 characters."
|
|
@@ -20911,7 +20920,7 @@ async function uploadIam(options, file, label, requestId, uploadTimeout = 12e4)
|
|
|
20911
20920
|
if (!response.ok && response.status !== 412)
|
|
20912
20921
|
throw new Error("Upload failed");
|
|
20913
20922
|
}
|
|
20914
|
-
const result = registered.version.state === "ready" ? registered :
|
|
20923
|
+
const result = registered.version.state === "ready" ? registered : z94.strictObject({ version: appManifestVersionSchema }).parse(
|
|
20915
20924
|
await remote(options, "post", {
|
|
20916
20925
|
action: "complete",
|
|
20917
20926
|
versionId: registered.version.id
|
|
@@ -20996,7 +21005,7 @@ function registerIam(program, session, success, cwd) {
|
|
|
20996
21005
|
}
|
|
20997
21006
|
);
|
|
20998
21007
|
iam.command("list").description("List uploaded versions and the value for current --expected").option("--after <uuid>", "Version cursor").action(async (flags, command) => {
|
|
20999
|
-
if (flags.after && !
|
|
21008
|
+
if (flags.after && !z94.uuid().safeParse(flags.after).success)
|
|
21000
21009
|
throw new CliError("INVALID_ARGUMENT", "Use a UUID cursor.");
|
|
21001
21010
|
iamOperation("get");
|
|
21002
21011
|
success(
|
|
@@ -21017,13 +21026,13 @@ function registerIam(program, session, success, cwd) {
|
|
|
21017
21026
|
"The expected value from indiana iam list (the current version ID, or none)"
|
|
21018
21027
|
).action(
|
|
21019
21028
|
async (version2, flags, command) => {
|
|
21020
|
-
if (!
|
|
21029
|
+
if (!z94.uuid().safeParse(version2).success || flags.expected !== "none" && !z94.uuid().safeParse(flags.expected).success)
|
|
21021
21030
|
throw new CliError(
|
|
21022
21031
|
"INVALID_ARGUMENT",
|
|
21023
21032
|
"Use version UUIDs, or none for an empty current pointer."
|
|
21024
21033
|
);
|
|
21025
21034
|
iamOperation("post");
|
|
21026
|
-
const result =
|
|
21035
|
+
const result = z94.strictObject({ version: appManifestVersionSchema }).parse(
|
|
21027
21036
|
await remote(await session(command), "post", {
|
|
21028
21037
|
action: "current",
|
|
21029
21038
|
versionId: version2,
|
|
@@ -21051,7 +21060,7 @@ function registerIam(program, session, success, cwd) {
|
|
|
21051
21060
|
|
|
21052
21061
|
// src/commands/code.ts
|
|
21053
21062
|
import "commander";
|
|
21054
|
-
import { z as
|
|
21063
|
+
import { z as z96 } from "zod";
|
|
21055
21064
|
import { constants as constants3 } from "fs";
|
|
21056
21065
|
import {
|
|
21057
21066
|
lstat as lstat5,
|
|
@@ -21066,7 +21075,7 @@ import { join as join4, resolve as resolve3 } from "path";
|
|
|
21066
21075
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
21067
21076
|
|
|
21068
21077
|
// ../contracts/src/code-source.ts
|
|
21069
|
-
import { z as
|
|
21078
|
+
import { z as z95 } from "zod";
|
|
21070
21079
|
|
|
21071
21080
|
// ../contracts/src/screen-css.ts
|
|
21072
21081
|
import parse from "css-tree/parser";
|
|
@@ -21101,7 +21110,7 @@ function sanitizeScreenCss(css) {
|
|
|
21101
21110
|
// ../contracts/src/code-source.ts
|
|
21102
21111
|
var CODE_SOURCE_LIMIT = 2e6;
|
|
21103
21112
|
var uuid3 = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
|
|
21104
|
-
var codeTargetSchema =
|
|
21113
|
+
var codeTargetSchema = z95.string().max(300).regex(
|
|
21105
21114
|
new RegExp(
|
|
21106
21115
|
`^(paywall/${uuid3}|template/${uuid3}|funnel/${uuid3}/screen/[A-Za-z0-9_-]{1,100})$`
|
|
21107
21116
|
)
|
|
@@ -21111,24 +21120,24 @@ function sourcePath(value) {
|
|
|
21111
21120
|
value
|
|
21112
21121
|
);
|
|
21113
21122
|
}
|
|
21114
|
-
var fileMap =
|
|
21115
|
-
|
|
21116
|
-
|
|
21123
|
+
var fileMap = z95.record(
|
|
21124
|
+
z95.string().refine(sourcePath, "Invalid source path"),
|
|
21125
|
+
z95.string().max(4e5)
|
|
21117
21126
|
);
|
|
21118
|
-
var codeManifestSchema =
|
|
21119
|
-
format:
|
|
21127
|
+
var codeManifestSchema = z95.strictObject({
|
|
21128
|
+
format: z95.literal(1),
|
|
21120
21129
|
target: codeTargetSchema,
|
|
21121
|
-
projectId:
|
|
21122
|
-
environmentId:
|
|
21123
|
-
revision:
|
|
21124
|
-
baseHash:
|
|
21125
|
-
label:
|
|
21126
|
-
description:
|
|
21127
|
-
category:
|
|
21130
|
+
projectId: z95.uuid(),
|
|
21131
|
+
environmentId: z95.uuid(),
|
|
21132
|
+
revision: z95.number().int().nonnegative(),
|
|
21133
|
+
baseHash: z95.string().regex(/^[a-f0-9]{64}$/),
|
|
21134
|
+
label: z95.string().min(1).max(200),
|
|
21135
|
+
description: z95.string().max(300).default(""),
|
|
21136
|
+
category: z95.string().max(40).default("Custom"),
|
|
21128
21137
|
previewPresentation: screenPresentationSchema.optional(),
|
|
21129
21138
|
baseline: fileMap
|
|
21130
21139
|
});
|
|
21131
|
-
var codeSourceSchema =
|
|
21140
|
+
var codeSourceSchema = z95.strictObject({
|
|
21132
21141
|
manifest: codeManifestSchema,
|
|
21133
21142
|
files: fileMap
|
|
21134
21143
|
});
|
|
@@ -21437,7 +21446,7 @@ function requireValidSource(source2) {
|
|
|
21437
21446
|
return result.document;
|
|
21438
21447
|
}
|
|
21439
21448
|
function codeSourceJson(source2) {
|
|
21440
|
-
return
|
|
21449
|
+
return z96.json().parse(JSON.parse(JSON.stringify(source2)));
|
|
21441
21450
|
}
|
|
21442
21451
|
async function remote2(options, method, input) {
|
|
21443
21452
|
const operation = findManagementOperation(`console.code-source.${method}`);
|
|
@@ -21597,7 +21606,7 @@ import { randomUUID as randomUUID5 } from "crypto";
|
|
|
21597
21606
|
import { constants as constants4 } from "fs";
|
|
21598
21607
|
import { open as open6, realpath, writeFile as writeFile3 } from "fs/promises";
|
|
21599
21608
|
import { relative, resolve as resolve4, sep } from "path";
|
|
21600
|
-
import { z as
|
|
21609
|
+
import { z as z97 } from "zod";
|
|
21601
21610
|
function git(root, args2) {
|
|
21602
21611
|
return execFileSync("git", ["-C", root, ...args2], {
|
|
21603
21612
|
encoding: "utf8",
|
|
@@ -21723,18 +21732,18 @@ async function scanCodeReferences(configInput, options) {
|
|
|
21723
21732
|
);
|
|
21724
21733
|
return report;
|
|
21725
21734
|
}
|
|
21726
|
-
var localOptionsSchema =
|
|
21727
|
-
keyEnv:
|
|
21728
|
-
upload:
|
|
21729
|
-
out:
|
|
21730
|
-
file:
|
|
21731
|
-
repositoryId:
|
|
21732
|
-
branch:
|
|
21733
|
-
workflow:
|
|
21734
|
-
root:
|
|
21735
|
-
runNumber:
|
|
21736
|
-
runAttempt:
|
|
21737
|
-
config:
|
|
21735
|
+
var localOptionsSchema = z97.object({
|
|
21736
|
+
keyEnv: z97.string(),
|
|
21737
|
+
upload: z97.boolean().optional(),
|
|
21738
|
+
out: z97.string().optional(),
|
|
21739
|
+
file: z97.string().optional(),
|
|
21740
|
+
repositoryId: z97.string().optional(),
|
|
21741
|
+
branch: z97.string().optional(),
|
|
21742
|
+
workflow: z97.string().optional(),
|
|
21743
|
+
root: z97.string().optional(),
|
|
21744
|
+
runNumber: z97.string().optional(),
|
|
21745
|
+
runAttempt: z97.string().optional(),
|
|
21746
|
+
config: z97.string().optional()
|
|
21738
21747
|
});
|
|
21739
21748
|
async function codeReferenceApi(options, operation, input) {
|
|
21740
21749
|
const url2 = new URL(options.server);
|
|
@@ -21743,7 +21752,7 @@ async function codeReferenceApi(options, operation, input) {
|
|
|
21743
21752
|
"INVALID_ARGUMENT",
|
|
21744
21753
|
"Select an exact HTTPS server origin or HTTP loopback origin."
|
|
21745
21754
|
);
|
|
21746
|
-
const app =
|
|
21755
|
+
const app = z97.uuid().parse(options.app);
|
|
21747
21756
|
if (!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(options.key))
|
|
21748
21757
|
throw new CliError(
|
|
21749
21758
|
"CREDENTIAL_REQUIRED",
|
|
@@ -21844,7 +21853,7 @@ function registerCodeReferences(program, runtime, success) {
|
|
|
21844
21853
|
if (name2 === "upload") {
|
|
21845
21854
|
const report2 = codeReferenceReportSchema.parse(
|
|
21846
21855
|
await readJsonFile(
|
|
21847
|
-
resolve4(runtime.cwd,
|
|
21856
|
+
resolve4(runtime.cwd, z97.string().parse(local.file)),
|
|
21848
21857
|
CODE_REFERENCE_LIMITS.reportBytes
|
|
21849
21858
|
)
|
|
21850
21859
|
);
|
|
@@ -21876,8 +21885,8 @@ function registerCodeReferences(program, runtime, success) {
|
|
|
21876
21885
|
4
|
|
21877
21886
|
);
|
|
21878
21887
|
const report = await scanCodeReferences(config, {
|
|
21879
|
-
root: resolve4(runtime.cwd,
|
|
21880
|
-
workflow:
|
|
21888
|
+
root: resolve4(runtime.cwd, z97.string().parse(local.root)),
|
|
21889
|
+
workflow: z97.string().parse(local.workflow),
|
|
21881
21890
|
runNumber: Number(local.runNumber),
|
|
21882
21891
|
runAttempt: Number(local.runAttempt)
|
|
21883
21892
|
});
|
|
@@ -21916,7 +21925,7 @@ function registerCodeReferences(program, runtime, success) {
|
|
|
21916
21925
|
|
|
21917
21926
|
// src/commands/rewards.ts
|
|
21918
21927
|
import "commander";
|
|
21919
|
-
import { z as
|
|
21928
|
+
import { z as z98 } from "zod";
|
|
21920
21929
|
async function resourceCall(options, resource, method, schema, body, query = {}, child = "") {
|
|
21921
21930
|
if (!options.selection)
|
|
21922
21931
|
throw new CliError(
|
|
@@ -21943,13 +21952,13 @@ async function resourceCall(options, resource, method, schema, body, query = {},
|
|
|
21943
21952
|
);
|
|
21944
21953
|
});
|
|
21945
21954
|
}
|
|
21946
|
-
var deleted =
|
|
21947
|
-
var rewardResult =
|
|
21948
|
-
|
|
21955
|
+
var deleted = z98.strictObject({ id: z98.uuid(), deleted: z98.literal(true) });
|
|
21956
|
+
var rewardResult = z98.union([
|
|
21957
|
+
z98.strictObject({ record: rewardRecordSchema }),
|
|
21949
21958
|
deleted
|
|
21950
21959
|
]);
|
|
21951
|
-
var programResult =
|
|
21952
|
-
|
|
21960
|
+
var programResult = z98.union([
|
|
21961
|
+
z98.strictObject({ record: referralProgramRecordSchema }),
|
|
21953
21962
|
deleted
|
|
21954
21963
|
]);
|
|
21955
21964
|
function registerRewards(program, session, success) {
|
|
@@ -21961,7 +21970,7 @@ function registerRewards(program, session, success) {
|
|
|
21961
21970
|
"Manage the approved App/environment; writes require explicit resource write permission"
|
|
21962
21971
|
);
|
|
21963
21972
|
group.command("list").option("--after <uuid>", "Continue the returned cursor").action(async (options, command) => {
|
|
21964
|
-
const after = options.after === void 0 ? void 0 :
|
|
21973
|
+
const after = options.after === void 0 ? void 0 : z98.uuid().parse(options.after);
|
|
21965
21974
|
success(
|
|
21966
21975
|
await resourceCall(
|
|
21967
21976
|
await session(command),
|
|
@@ -21981,7 +21990,7 @@ function registerRewards(program, session, success) {
|
|
|
21981
21990
|
"GET",
|
|
21982
21991
|
collection,
|
|
21983
21992
|
void 0,
|
|
21984
|
-
{ id:
|
|
21993
|
+
{ id: z98.uuid().parse(id) }
|
|
21985
21994
|
)
|
|
21986
21995
|
)
|
|
21987
21996
|
);
|
|
@@ -22025,9 +22034,9 @@ function registerRewards(program, session, success) {
|
|
|
22025
22034
|
group.command("activity <id>").option("--codes-after <uuid>", "Code cursor").option("--redemptions-after <uuid>", "Redemption cursor").action(
|
|
22026
22035
|
async (id, options, command) => {
|
|
22027
22036
|
const query = {
|
|
22028
|
-
id:
|
|
22029
|
-
codesAfter: options.codesAfter ?
|
|
22030
|
-
redemptionsAfter: options.redemptionsAfter ?
|
|
22037
|
+
id: z98.uuid().parse(id),
|
|
22038
|
+
codesAfter: options.codesAfter ? z98.uuid().parse(options.codesAfter) : void 0,
|
|
22039
|
+
redemptionsAfter: options.redemptionsAfter ? z98.uuid().parse(options.redemptionsAfter) : void 0
|
|
22031
22040
|
};
|
|
22032
22041
|
success(
|
|
22033
22042
|
await resourceCall(
|
|
@@ -22051,9 +22060,9 @@ function registerRewards(program, session, success) {
|
|
|
22051
22060
|
const body = rewardCodeWriteSchema.parse(
|
|
22052
22061
|
await readJsonFile(options.file, 2e4)
|
|
22053
22062
|
);
|
|
22054
|
-
const schema =
|
|
22063
|
+
const schema = z98.strictObject({
|
|
22055
22064
|
record: rewardRecordSchema,
|
|
22056
|
-
codeId:
|
|
22065
|
+
codeId: z98.uuid()
|
|
22057
22066
|
});
|
|
22058
22067
|
success(
|
|
22059
22068
|
await resourceCall(
|
|
@@ -22085,7 +22094,7 @@ import { tmpdir } from "os";
|
|
|
22085
22094
|
import { delimiter, dirname, isAbsolute, join as join5, resolve as resolve5 } from "path";
|
|
22086
22095
|
import { fileURLToPath } from "url";
|
|
22087
22096
|
import { promisify } from "util";
|
|
22088
|
-
import { z as
|
|
22097
|
+
import { z as z99 } from "zod";
|
|
22089
22098
|
|
|
22090
22099
|
// src/distribution.ts
|
|
22091
22100
|
var cliNpmPackage = "@tinkerlandai/indiana-cli";
|
|
@@ -22096,47 +22105,47 @@ var cliNpmRegistry = "https://registry.npmjs.org";
|
|
|
22096
22105
|
var origin = "https://tinker.cash";
|
|
22097
22106
|
var installationHelp = `Install the public npm CLI with:
|
|
22098
22107
|
npm install -g ${cliNpmPackage}`;
|
|
22099
|
-
var version =
|
|
22100
|
-
var sha2562 =
|
|
22101
|
-
var releaseSchema =
|
|
22102
|
-
schemaVersion:
|
|
22103
|
-
name:
|
|
22104
|
-
executable:
|
|
22108
|
+
var version = z99.string().max(40).regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/).refine((v) => v.split(".").every((n) => Number.isSafeInteger(Number(n))));
|
|
22109
|
+
var sha2562 = z99.string().regex(/^[a-f0-9]{64}$/);
|
|
22110
|
+
var releaseSchema = z99.object({
|
|
22111
|
+
schemaVersion: z99.literal(1),
|
|
22112
|
+
name: z99.literal("@indiana/cli"),
|
|
22113
|
+
executable: z99.literal("indiana"),
|
|
22105
22114
|
version,
|
|
22106
|
-
node:
|
|
22107
|
-
url:
|
|
22115
|
+
node: z99.string().regex(/^>=\d{1,3}$/),
|
|
22116
|
+
url: z99.string(),
|
|
22108
22117
|
sha256: sha2562,
|
|
22109
|
-
integrity:
|
|
22110
|
-
bytes:
|
|
22118
|
+
integrity: z99.string().regex(/^sha512-[A-Za-z0-9+/]{86}==$/),
|
|
22119
|
+
bytes: z99.number().int().positive().max(8 * 1024 * 1024)
|
|
22111
22120
|
}).strict().refine(
|
|
22112
22121
|
(r) => r.url === `${origin}/downloads/cli/${r.version}/indiana-cli-${r.version}.tgz`
|
|
22113
22122
|
);
|
|
22114
|
-
var npmReleaseSchema =
|
|
22115
|
-
name:
|
|
22123
|
+
var npmReleaseSchema = z99.object({
|
|
22124
|
+
name: z99.literal(cliNpmPackage),
|
|
22116
22125
|
version,
|
|
22117
|
-
engines:
|
|
22118
|
-
dist:
|
|
22119
|
-
tarball:
|
|
22120
|
-
integrity:
|
|
22126
|
+
engines: z99.object({ node: z99.string().regex(/^>=\d{1,3}$/) }),
|
|
22127
|
+
dist: z99.object({
|
|
22128
|
+
tarball: z99.string(),
|
|
22129
|
+
integrity: z99.string().regex(/^sha512-[A-Za-z0-9+/]{86}==$/)
|
|
22121
22130
|
})
|
|
22122
22131
|
}).refine(
|
|
22123
22132
|
(r) => r.dist.tarball === `${cliNpmRegistry}/${cliNpmPackage}/-/indiana-cli-${r.version}.tgz`
|
|
22124
22133
|
);
|
|
22125
22134
|
async function installedChannel(entryPoint = fileURLToPath(import.meta.url)) {
|
|
22126
22135
|
const entry2 = await realpath2(entryPoint);
|
|
22127
|
-
const metadata2 =
|
|
22128
|
-
name:
|
|
22129
|
-
version:
|
|
22136
|
+
const metadata2 = z99.object({
|
|
22137
|
+
name: z99.enum([cliWebsitePackage, cliNpmPackage]),
|
|
22138
|
+
version: z99.literal(CLI_VERSION)
|
|
22130
22139
|
}).parse(await readJsonFile(join5(dirname(entry2), "../package.json"), 65536));
|
|
22131
22140
|
return metadata2.name === cliNpmPackage ? "npm" : "website";
|
|
22132
22141
|
}
|
|
22133
|
-
var receiptSchema =
|
|
22134
|
-
schemaVersion:
|
|
22135
|
-
method:
|
|
22142
|
+
var receiptSchema = z99.object({
|
|
22143
|
+
schemaVersion: z99.literal(1),
|
|
22144
|
+
method: z99.literal("curl"),
|
|
22136
22145
|
version,
|
|
22137
|
-
binDir:
|
|
22138
|
-
installRoot:
|
|
22139
|
-
target:
|
|
22146
|
+
binDir: z99.string(),
|
|
22147
|
+
installRoot: z99.string(),
|
|
22148
|
+
target: z99.string().regex(/^(darwin-(arm64|x64)|linux-(arm64|x64)-(gnu|musl))$/),
|
|
22140
22149
|
sha256: sha2562
|
|
22141
22150
|
}).strict();
|
|
22142
22151
|
function newerVersion(candidate, current) {
|
|
@@ -22348,12 +22357,12 @@ async function updateCli(options = {}) {
|
|
|
22348
22357
|
timeout2,
|
|
22349
22358
|
fetcher
|
|
22350
22359
|
);
|
|
22351
|
-
const manifest =
|
|
22352
|
-
schemaVersion:
|
|
22360
|
+
const manifest = z99.object({
|
|
22361
|
+
schemaVersion: z99.literal(1),
|
|
22353
22362
|
version,
|
|
22354
|
-
node:
|
|
22363
|
+
node: z99.string(),
|
|
22355
22364
|
sourcePackageSha256: sha2562,
|
|
22356
|
-
installer:
|
|
22365
|
+
installer: z99.literal(`${origin}/install.sh`),
|
|
22357
22366
|
installerSha256: sha2562
|
|
22358
22367
|
}).safeParse(response.body);
|
|
22359
22368
|
if (response.status !== 200 || !manifest.success || manifest.data.version !== release.version || manifest.data.node !== release.node || manifest.data.sourcePackageSha256 !== release.sha256)
|
|
@@ -22416,7 +22425,7 @@ async function updateCli(options = {}) {
|
|
|
22416
22425
|
{ env, timeout: 15e3, maxBuffer: 65536 }
|
|
22417
22426
|
);
|
|
22418
22427
|
const installed = JSON.parse(verified.stdout);
|
|
22419
|
-
const verifiedVersion =
|
|
22428
|
+
const verifiedVersion = z99.object({ data: z99.object({ version: z99.string() }) }).safeParse(installed);
|
|
22420
22429
|
if (!verifiedVersion.success || verifiedVersion.data.data.version !== release.version)
|
|
22421
22430
|
throw new CliError(
|
|
22422
22431
|
"UPDATE_VERIFICATION_FAILED",
|
|
@@ -22464,18 +22473,18 @@ async function notifyUpdate(options) {
|
|
|
22464
22473
|
channel === "npm" ? "update-check-npm.json" : "update-check.json"
|
|
22465
22474
|
);
|
|
22466
22475
|
const cached = await readJsonFile(path, 65536).catch(() => void 0);
|
|
22467
|
-
const parsed =
|
|
22468
|
-
checkedAt:
|
|
22469
|
-
release:
|
|
22476
|
+
const parsed = z99.object({
|
|
22477
|
+
checkedAt: z99.number().nonnegative(),
|
|
22478
|
+
release: z99.union([
|
|
22470
22479
|
releaseSchema,
|
|
22471
|
-
|
|
22472
|
-
schemaVersion:
|
|
22473
|
-
name:
|
|
22474
|
-
executable:
|
|
22480
|
+
z99.object({
|
|
22481
|
+
schemaVersion: z99.literal(1),
|
|
22482
|
+
name: z99.literal(cliNpmPackage),
|
|
22483
|
+
executable: z99.literal("indiana"),
|
|
22475
22484
|
version,
|
|
22476
|
-
node:
|
|
22477
|
-
url:
|
|
22478
|
-
integrity:
|
|
22485
|
+
node: z99.string().regex(/^>=\d{1,3}$/),
|
|
22486
|
+
url: z99.string(),
|
|
22487
|
+
integrity: z99.string().regex(/^sha512-[A-Za-z0-9+/]{86}==$/)
|
|
22479
22488
|
}).strict().refine(
|
|
22480
22489
|
(r) => r.url === `${cliNpmRegistry}/${cliNpmPackage}/-/indiana-cli-${r.version}.tgz`
|
|
22481
22490
|
)
|
|
@@ -22692,7 +22701,7 @@ async function runCli(argv, runtime = {
|
|
|
22692
22701
|
if (options.scopesFile) {
|
|
22693
22702
|
const parsed = managementRequestSchema.safeParse({
|
|
22694
22703
|
label: "scope validation",
|
|
22695
|
-
scopes: await import("./io-
|
|
22704
|
+
scopes: await import("./io-COF7BMWZ.js").then(
|
|
22696
22705
|
(m) => m.readJsonFile(options.scopesFile, 65536)
|
|
22697
22706
|
)
|
|
22698
22707
|
});
|