@schematichq/schematic-components 2.10.0 → 2.10.1

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.
@@ -2264,6 +2264,7 @@ var Logger = class _Logger {
2264
2264
  }
2265
2265
  forward(args, lvl, prefix2, debugOnly) {
2266
2266
  if (debugOnly && !this.debug) return null;
2267
+ args = args.map((a3) => isString(a3) ? a3.replace(/[\r\n\x00-\x1F\x7F]/g, " ") : a3);
2267
2268
  if (isString(args[0])) args[0] = `${prefix2}${this.prefix} ${args[0]}`;
2268
2269
  return this.logger[lvl](args);
2269
2270
  }
@@ -3162,8 +3163,8 @@ var Interpolator = class {
3162
3163
  this.prefix = prefix2 ? regexEscape(prefix2) : prefixEscaped || "{{";
3163
3164
  this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || "}}";
3164
3165
  this.formatSeparator = formatSeparator || ",";
3165
- this.unescapePrefix = unescapeSuffix ? "" : unescapePrefix || "-";
3166
- this.unescapeSuffix = this.unescapePrefix ? "" : unescapeSuffix || "";
3166
+ this.unescapePrefix = unescapeSuffix ? "" : unescapePrefix ? regexEscape(unescapePrefix) : "-";
3167
+ this.unescapeSuffix = this.unescapePrefix ? "" : unescapeSuffix ? regexEscape(unescapeSuffix) : "";
3167
3168
  this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape("$t(");
3168
3169
  this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(")");
3169
3170
  this.nestingOptionsSeparator = nestingOptionsSeparator || ",";
@@ -3210,6 +3211,9 @@ var Interpolator = class {
3210
3211
  });
3211
3212
  };
3212
3213
  this.resetRegExp();
3214
+ if (!this.escapeValue && typeof str === "string" && /\$t\([^)]*\{[^}]*\{\{/.test(str)) {
3215
+ this.logger.warn("nesting options string contains interpolated variables with escapeValue: false \u2014 if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");
3216
+ }
3213
3217
  const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
3214
3218
  const skipOnVariables = options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
3215
3219
  const todos = [{
@@ -7574,23 +7578,18 @@ function unsafeStringify(arr, offset = 0) {
7574
7578
  }
7575
7579
 
7576
7580
  // node_modules/uuid/dist/rng.js
7577
- var getRandomValues;
7578
7581
  var rnds8 = new Uint8Array(16);
7579
7582
  function rng() {
7580
- if (!getRandomValues) {
7581
- if (typeof crypto === "undefined" || !crypto.getRandomValues) {
7582
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
7583
- }
7584
- getRandomValues = crypto.getRandomValues.bind(crypto);
7585
- }
7586
- return getRandomValues(rnds8);
7583
+ return crypto.getRandomValues(rnds8);
7587
7584
  }
7588
7585
 
7589
- // node_modules/uuid/dist/native.js
7590
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
7591
- var native_default = { randomUUID };
7592
-
7593
7586
  // node_modules/uuid/dist/v4.js
7587
+ function v4(options, buf, offset) {
7588
+ if (!buf && !options && crypto.randomUUID) {
7589
+ return crypto.randomUUID();
7590
+ }
7591
+ return _v4(options, buf, offset);
7592
+ }
7594
7593
  function _v4(options, buf, offset) {
7595
7594
  options = options || {};
7596
7595
  const rnds = options.random ?? options.rng?.() ?? rng();
@@ -7611,12 +7610,6 @@ function _v4(options, buf, offset) {
7611
7610
  }
7612
7611
  return unsafeStringify(rnds);
7613
7612
  }
7614
- function v4(options, buf, offset) {
7615
- if (native_default.randomUUID && !buf && !options) {
7616
- return native_default.randomUUID();
7617
- }
7618
- return _v4(options, buf, offset);
7619
- }
7620
7613
  var v4_default = v4;
7621
7614
 
7622
7615
  // src/api/checkoutexternal/runtime.ts
@@ -7973,6 +7966,7 @@ function BillingProductPriceResponseDataFromJSONTyped(json, ignoreDiscriminator)
7973
7966
  interval: BillingProductPriceIntervalFromJSON(json["interval"]),
7974
7967
  isActive: json["is_active"],
7975
7968
  meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
7969
+ nickname: json["nickname"] == null ? void 0 : json["nickname"],
7976
7970
  packageSize: json["package_size"],
7977
7971
  price: json["price"],
7978
7972
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
@@ -8019,6 +8013,7 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
8019
8013
  meterEventName: json["meter_event_name"] == null ? void 0 : json["meter_event_name"],
8020
8014
  meterEventPayloadKey: json["meter_event_payload_key"] == null ? void 0 : json["meter_event_payload_key"],
8021
8015
  meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
8016
+ nickname: json["nickname"] == null ? void 0 : json["nickname"],
8022
8017
  packageSize: json["package_size"],
8023
8018
  price: json["price"],
8024
8019
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
@@ -8137,6 +8132,7 @@ function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8137
8132
  externalPriceId: json["external_price_id"],
8138
8133
  id: json["id"],
8139
8134
  interval: BillingProductPriceIntervalFromJSON(json["interval"]),
8135
+ nickname: json["nickname"] == null ? void 0 : json["nickname"],
8140
8136
  price: json["price"],
8141
8137
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
8142
8138
  providerType: BillingProviderTypeFromJSON(json["provider_type"]),
@@ -8766,6 +8762,22 @@ function CompanyCustomerBalanceFromJSONTyped(json, ignoreDiscriminator) {
8766
8762
  };
8767
8763
  }
8768
8764
 
8765
+ // src/api/checkoutexternal/models/MetricPeriodMonthReset.ts
8766
+ function MetricPeriodMonthResetFromJSON(json) {
8767
+ return MetricPeriodMonthResetFromJSONTyped(json, false);
8768
+ }
8769
+ function MetricPeriodMonthResetFromJSONTyped(json, ignoreDiscriminator) {
8770
+ return json;
8771
+ }
8772
+
8773
+ // src/api/checkoutexternal/models/MetricPeriod.ts
8774
+ function MetricPeriodFromJSON(json) {
8775
+ return MetricPeriodFromJSONTyped(json, false);
8776
+ }
8777
+ function MetricPeriodFromJSONTyped(json, ignoreDiscriminator) {
8778
+ return json;
8779
+ }
8780
+
8769
8781
  // src/api/checkoutexternal/models/CompanyEventPeriodMetricsResponseData.ts
8770
8782
  function CompanyEventPeriodMetricsResponseDataFromJSON(json) {
8771
8783
  return CompanyEventPeriodMetricsResponseDataFromJSONTyped(json, false);
@@ -8782,8 +8794,8 @@ function CompanyEventPeriodMetricsResponseDataFromJSONTyped(json, ignoreDiscrimi
8782
8794
  createdAt: new Date(json["created_at"]),
8783
8795
  environmentId: json["environment_id"],
8784
8796
  eventSubtype: json["event_subtype"],
8785
- monthReset: json["month_reset"],
8786
- period: json["period"],
8797
+ monthReset: MetricPeriodMonthResetFromJSON(json["month_reset"]),
8798
+ period: MetricPeriodFromJSON(json["period"]),
8787
8799
  validUntil: json["valid_until"] == null ? void 0 : new Date(json["valid_until"]),
8788
8800
  value: json["value"]
8789
8801
  };
@@ -8907,9 +8919,9 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
8907
8919
  eventName: json["event_name"] == null ? void 0 : json["event_name"],
8908
8920
  featureId: json["feature_id"],
8909
8921
  featureKey: json["feature_key"],
8910
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
8922
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
8911
8923
  metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
8912
- monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
8924
+ monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
8913
8925
  softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
8914
8926
  usage: json["usage"] == null ? void 0 : json["usage"],
8915
8927
  valueType: EntitlementValueTypeFromJSON(json["value_type"])
@@ -9047,6 +9059,22 @@ function TraitDefinitionFromJSONTyped(json, ignoreDiscriminator) {
9047
9059
  };
9048
9060
  }
9049
9061
 
9062
+ // src/api/checkoutexternal/models/ComparableOperator.ts
9063
+ function ComparableOperatorFromJSON(json) {
9064
+ return ComparableOperatorFromJSONTyped(json, false);
9065
+ }
9066
+ function ComparableOperatorFromJSONTyped(json, ignoreDiscriminator) {
9067
+ return json;
9068
+ }
9069
+
9070
+ // src/api/checkoutexternal/models/ConditionType.ts
9071
+ function ConditionTypeFromJSON(json) {
9072
+ return ConditionTypeFromJSONTyped(json, false);
9073
+ }
9074
+ function ConditionTypeFromJSONTyped(json, ignoreDiscriminator) {
9075
+ return json;
9076
+ }
9077
+
9050
9078
  // src/api/checkoutexternal/models/Condition.ts
9051
9079
  function ConditionFromJSON(json) {
9052
9080
  return ConditionFromJSONTyped(json, false);
@@ -9058,22 +9086,30 @@ function ConditionFromJSONTyped(json, ignoreDiscriminator) {
9058
9086
  return {
9059
9087
  accountId: json["account_id"],
9060
9088
  comparisonTraitDefinition: json["comparison_trait_definition"] == null ? void 0 : TraitDefinitionFromJSON(json["comparison_trait_definition"]),
9061
- conditionType: json["condition_type"],
9089
+ conditionType: ConditionTypeFromJSON(json["condition_type"]),
9062
9090
  consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
9063
9091
  creditId: json["credit_id"] == null ? void 0 : json["credit_id"],
9064
9092
  environmentId: json["environment_id"],
9065
9093
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
9066
9094
  id: json["id"],
9067
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
9068
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
9095
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
9096
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
9069
9097
  metricValue: json["metric_value"] == null ? void 0 : json["metric_value"],
9070
- operator: json["operator"],
9098
+ operator: ComparableOperatorFromJSON(json["operator"]),
9071
9099
  resourceIds: json["resource_ids"],
9072
9100
  traitDefinition: json["trait_definition"] == null ? void 0 : TraitDefinitionFromJSON(json["trait_definition"]),
9073
9101
  traitValue: json["trait_value"]
9074
9102
  };
9075
9103
  }
9076
9104
 
9105
+ // src/api/checkoutexternal/models/RuleType.ts
9106
+ function RuleTypeFromJSON(json) {
9107
+ return RuleTypeFromJSONTyped(json, false);
9108
+ }
9109
+ function RuleTypeFromJSONTyped(json, ignoreDiscriminator) {
9110
+ return json;
9111
+ }
9112
+
9077
9113
  // src/api/checkoutexternal/models/ConditionGroup.ts
9078
9114
  function ConditionGroupFromJSON(json) {
9079
9115
  return ConditionGroupFromJSONTyped(json, false);
@@ -9106,7 +9142,7 @@ function RuleFromJSONTyped(json, ignoreDiscriminator) {
9106
9142
  id: json["id"],
9107
9143
  name: json["name"],
9108
9144
  priority: json["priority"],
9109
- ruleType: json["rule_type"],
9145
+ ruleType: RuleTypeFromJSON(json["rule_type"]),
9110
9146
  value: json["value"]
9111
9147
  };
9112
9148
  }
@@ -9257,7 +9293,7 @@ function FeatureResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9257
9293
  icon: json["icon"],
9258
9294
  id: json["id"],
9259
9295
  lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON(json["lifecycle_phase"]),
9260
- maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
9296
+ maintainerAccountMemberId: json["maintainer_account_member_id"] == null ? void 0 : json["maintainer_account_member_id"],
9261
9297
  name: json["name"],
9262
9298
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
9263
9299
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
@@ -9284,8 +9320,8 @@ function CompanyOverrideResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9284
9320
  feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON(json["feature"]),
9285
9321
  featureId: json["feature_id"],
9286
9322
  id: json["id"],
9287
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
9288
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
9323
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
9324
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
9289
9325
  notes: json["notes"].map(
9290
9326
  CompanyOverrideNoteResponseDataFromJSON
9291
9327
  ),
@@ -9312,6 +9348,117 @@ function CompanyPlanInvalidReasonFromJSONTyped(json, ignoreDiscriminator) {
9312
9348
  return json;
9313
9349
  }
9314
9350
 
9351
+ // src/api/checkoutexternal/models/EntitlementCurrencyPricesResponseData.ts
9352
+ function EntitlementCurrencyPricesResponseDataFromJSON(json) {
9353
+ return EntitlementCurrencyPricesResponseDataFromJSONTyped(json, false);
9354
+ }
9355
+ function EntitlementCurrencyPricesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9356
+ if (json == null) {
9357
+ return json;
9358
+ }
9359
+ return {
9360
+ currency: json["currency"],
9361
+ monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_price"]),
9362
+ yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_price"])
9363
+ };
9364
+ }
9365
+
9366
+ // src/api/checkoutexternal/models/EntitlementPriceBehavior.ts
9367
+ var EntitlementPriceBehavior = {
9368
+ CreditBurndown: "credit_burndown",
9369
+ Overage: "overage",
9370
+ PayAsYouGo: "pay_as_you_go",
9371
+ PayInAdvance: "pay_in_advance",
9372
+ Tier: "tier"
9373
+ };
9374
+ function EntitlementPriceBehaviorFromJSON(json) {
9375
+ return EntitlementPriceBehaviorFromJSONTyped(json, false);
9376
+ }
9377
+ function EntitlementPriceBehaviorFromJSONTyped(json, ignoreDiscriminator) {
9378
+ return json;
9379
+ }
9380
+
9381
+ // src/api/checkoutexternal/models/PlanIcon.ts
9382
+ function PlanIconFromJSON(json) {
9383
+ return PlanIconFromJSONTyped(json, false);
9384
+ }
9385
+ function PlanIconFromJSONTyped(json, ignoreDiscriminator) {
9386
+ return json;
9387
+ }
9388
+
9389
+ // src/api/checkoutexternal/models/PlanType.ts
9390
+ function PlanTypeFromJSON(json) {
9391
+ return PlanTypeFromJSONTyped(json, false);
9392
+ }
9393
+ function PlanTypeFromJSONTyped(json, ignoreDiscriminator) {
9394
+ return json;
9395
+ }
9396
+
9397
+ // src/api/checkoutexternal/models/PlanResponseData.ts
9398
+ function PlanResponseDataFromJSON(json) {
9399
+ return PlanResponseDataFromJSONTyped(json, false);
9400
+ }
9401
+ function PlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9402
+ if (json == null) {
9403
+ return json;
9404
+ }
9405
+ return {
9406
+ audienceType: json["audience_type"] == null ? void 0 : json["audience_type"],
9407
+ companyId: json["company_id"] == null ? void 0 : json["company_id"],
9408
+ copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
9409
+ createdAt: new Date(json["created_at"]),
9410
+ description: json["description"],
9411
+ icon: PlanIconFromJSON(json["icon"]),
9412
+ id: json["id"],
9413
+ name: json["name"],
9414
+ planType: PlanTypeFromJSON(json["plan_type"]),
9415
+ updatedAt: new Date(json["updated_at"])
9416
+ };
9417
+ }
9418
+
9419
+ // src/api/checkoutexternal/models/PlanEntitlementResponseData.ts
9420
+ function PlanEntitlementResponseDataFromJSON(json) {
9421
+ return PlanEntitlementResponseDataFromJSONTyped(json, false);
9422
+ }
9423
+ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9424
+ if (json == null) {
9425
+ return json;
9426
+ }
9427
+ return {
9428
+ billingLinkedResource: json["billing_linked_resource"] == null ? void 0 : BillingLinkedResourceResponseDataFromJSON(
9429
+ json["billing_linked_resource"]
9430
+ ),
9431
+ billingThreshold: json["billing_threshold"] == null ? void 0 : json["billing_threshold"],
9432
+ consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
9433
+ createdAt: new Date(json["created_at"]),
9434
+ currencyPrices: json["currency_prices"].map(
9435
+ EntitlementCurrencyPricesResponseDataFromJSON
9436
+ ),
9437
+ environmentId: json["environment_id"],
9438
+ feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON(json["feature"]),
9439
+ featureId: json["feature_id"],
9440
+ id: json["id"],
9441
+ meteredMonthlyPrice: json["metered_monthly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["metered_monthly_price"]),
9442
+ meteredYearlyPrice: json["metered_yearly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["metered_yearly_price"]),
9443
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
9444
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
9445
+ plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
9446
+ planId: json["plan_id"],
9447
+ priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
9448
+ ruleId: json["rule_id"],
9449
+ ruleIdUsageExceeded: json["rule_id_usage_exceeded"] == null ? void 0 : json["rule_id_usage_exceeded"],
9450
+ softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
9451
+ updatedAt: new Date(json["updated_at"]),
9452
+ usageBasedProduct: json["usage_based_product"] == null ? void 0 : BillingProductResponseDataFromJSON(json["usage_based_product"]),
9453
+ valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
9454
+ valueCredit: json["value_credit"] == null ? void 0 : BillingCreditResponseDataFromJSON(json["value_credit"]),
9455
+ valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
9456
+ valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["value_trait"]),
9457
+ valueTraitId: json["value_trait_id"] == null ? void 0 : json["value_trait_id"],
9458
+ valueType: EntitlementValueTypeFromJSON(json["value_type"])
9459
+ };
9460
+ }
9461
+
9315
9462
  // src/api/checkoutexternal/models/PreviewObject.ts
9316
9463
  function PreviewObjectFromJSON(json) {
9317
9464
  return PreviewObjectFromJSONTyped(json, false);
@@ -9358,16 +9505,16 @@ function RuleConditionDetailResponseDataFromJSONTyped(json, ignoreDiscriminator)
9358
9505
  comparisonTrait: json["comparison_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["comparison_trait"]),
9359
9506
  comparisonTraitId: json["comparison_trait_id"] == null ? void 0 : json["comparison_trait_id"],
9360
9507
  conditionGroupId: json["condition_group_id"] == null ? void 0 : json["condition_group_id"],
9361
- conditionType: json["condition_type"],
9508
+ conditionType: ConditionTypeFromJSON(json["condition_type"]),
9362
9509
  createdAt: new Date(json["created_at"]),
9363
9510
  environmentId: json["environment_id"],
9364
9511
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
9365
9512
  flagId: json["flag_id"] == null ? void 0 : json["flag_id"],
9366
9513
  id: json["id"],
9367
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
9368
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
9514
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
9515
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
9369
9516
  metricValue: json["metric_value"] == null ? void 0 : json["metric_value"],
9370
- operator: json["operator"],
9517
+ operator: ComparableOperatorFromJSON(json["operator"]),
9371
9518
  resourceIds: json["resource_ids"],
9372
9519
  resources: json["resources"].map(
9373
9520
  PreviewObjectResponseDataFromJSON
@@ -9423,7 +9570,7 @@ function RuleDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9423
9570
  id: json["id"],
9424
9571
  name: json["name"],
9425
9572
  priority: json["priority"],
9426
- ruleType: json["rule_type"],
9573
+ ruleType: RuleTypeFromJSON(json["rule_type"]),
9427
9574
  updatedAt: new Date(json["updated_at"]),
9428
9575
  value: json["value"]
9429
9576
  };
@@ -9437,11 +9584,11 @@ function FlagTypeFromJSONTyped(json, ignoreDiscriminator) {
9437
9584
  return json;
9438
9585
  }
9439
9586
 
9440
- // src/api/checkoutexternal/models/FlagDetailResponseData.ts
9441
- function FlagDetailResponseDataFromJSON(json) {
9442
- return FlagDetailResponseDataFromJSONTyped(json, false);
9587
+ // src/api/checkoutexternal/models/FlagInPlanResponseData.ts
9588
+ function FlagInPlanResponseDataFromJSON(json) {
9589
+ return FlagInPlanResponseDataFromJSONTyped(json, false);
9443
9590
  }
9444
- function FlagDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9591
+ function FlagInPlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9445
9592
  if (json == null) {
9446
9593
  return json;
9447
9594
  }
@@ -9455,18 +9602,18 @@ function FlagDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9455
9602
  id: json["id"],
9456
9603
  key: json["key"],
9457
9604
  lastCheckedAt: json["last_checked_at"] == null ? void 0 : new Date(json["last_checked_at"]),
9458
- maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
9605
+ maintainerAccountMemberId: json["maintainer_account_member_id"] == null ? void 0 : json["maintainer_account_member_id"],
9459
9606
  name: json["name"],
9460
9607
  rules: json["rules"].map(RuleDetailResponseDataFromJSON),
9461
9608
  updatedAt: new Date(json["updated_at"])
9462
9609
  };
9463
9610
  }
9464
9611
 
9465
- // src/api/checkoutexternal/models/FeatureDetailResponseData.ts
9466
- function FeatureDetailResponseDataFromJSON(json) {
9467
- return FeatureDetailResponseDataFromJSONTyped(json, false);
9612
+ // src/api/checkoutexternal/models/FeatureInPlanResponseData.ts
9613
+ function FeatureInPlanResponseDataFromJSON(json) {
9614
+ return FeatureInPlanResponseDataFromJSONTyped(json, false);
9468
9615
  }
9469
- function FeatureDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9616
+ function FeatureInPlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9470
9617
  if (json == null) {
9471
9618
  return json;
9472
9619
  }
@@ -9479,11 +9626,11 @@ function FeatureDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9479
9626
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
9480
9627
  eventSummary: json["event_summary"] == null ? void 0 : EventSummaryResponseDataFromJSON(json["event_summary"]),
9481
9628
  featureType: FeatureTypeFromJSON(json["feature_type"]),
9482
- flags: json["flags"].map(FlagDetailResponseDataFromJSON),
9629
+ flags: json["flags"].map(FlagInPlanResponseDataFromJSON),
9483
9630
  icon: json["icon"],
9484
9631
  id: json["id"],
9485
9632
  lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON(json["lifecycle_phase"]),
9486
- maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
9633
+ maintainerAccountMemberId: json["maintainer_account_member_id"] == null ? void 0 : json["maintainer_account_member_id"],
9487
9634
  name: json["name"],
9488
9635
  plans: json["plans"].map(PreviewObjectFromJSON),
9489
9636
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
@@ -9494,117 +9641,6 @@ function FeatureDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9494
9641
  };
9495
9642
  }
9496
9643
 
9497
- // src/api/checkoutexternal/models/EntitlementCurrencyPricesResponseData.ts
9498
- function EntitlementCurrencyPricesResponseDataFromJSON(json) {
9499
- return EntitlementCurrencyPricesResponseDataFromJSONTyped(json, false);
9500
- }
9501
- function EntitlementCurrencyPricesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9502
- if (json == null) {
9503
- return json;
9504
- }
9505
- return {
9506
- currency: json["currency"],
9507
- monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_price"]),
9508
- yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["yearly_price"])
9509
- };
9510
- }
9511
-
9512
- // src/api/checkoutexternal/models/EntitlementPriceBehavior.ts
9513
- var EntitlementPriceBehavior = {
9514
- CreditBurndown: "credit_burndown",
9515
- Overage: "overage",
9516
- PayAsYouGo: "pay_as_you_go",
9517
- PayInAdvance: "pay_in_advance",
9518
- Tier: "tier"
9519
- };
9520
- function EntitlementPriceBehaviorFromJSON(json) {
9521
- return EntitlementPriceBehaviorFromJSONTyped(json, false);
9522
- }
9523
- function EntitlementPriceBehaviorFromJSONTyped(json, ignoreDiscriminator) {
9524
- return json;
9525
- }
9526
-
9527
- // src/api/checkoutexternal/models/PlanIcon.ts
9528
- function PlanIconFromJSON(json) {
9529
- return PlanIconFromJSONTyped(json, false);
9530
- }
9531
- function PlanIconFromJSONTyped(json, ignoreDiscriminator) {
9532
- return json;
9533
- }
9534
-
9535
- // src/api/checkoutexternal/models/PlanType.ts
9536
- function PlanTypeFromJSON(json) {
9537
- return PlanTypeFromJSONTyped(json, false);
9538
- }
9539
- function PlanTypeFromJSONTyped(json, ignoreDiscriminator) {
9540
- return json;
9541
- }
9542
-
9543
- // src/api/checkoutexternal/models/PlanResponseData.ts
9544
- function PlanResponseDataFromJSON(json) {
9545
- return PlanResponseDataFromJSONTyped(json, false);
9546
- }
9547
- function PlanResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9548
- if (json == null) {
9549
- return json;
9550
- }
9551
- return {
9552
- audienceType: json["audience_type"] == null ? void 0 : json["audience_type"],
9553
- companyId: json["company_id"] == null ? void 0 : json["company_id"],
9554
- copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
9555
- createdAt: new Date(json["created_at"]),
9556
- description: json["description"],
9557
- icon: PlanIconFromJSON(json["icon"]),
9558
- id: json["id"],
9559
- name: json["name"],
9560
- planType: PlanTypeFromJSON(json["plan_type"]),
9561
- updatedAt: new Date(json["updated_at"])
9562
- };
9563
- }
9564
-
9565
- // src/api/checkoutexternal/models/PlanEntitlementResponseData.ts
9566
- function PlanEntitlementResponseDataFromJSON(json) {
9567
- return PlanEntitlementResponseDataFromJSONTyped(json, false);
9568
- }
9569
- function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9570
- if (json == null) {
9571
- return json;
9572
- }
9573
- return {
9574
- billingLinkedResource: json["billing_linked_resource"] == null ? void 0 : BillingLinkedResourceResponseDataFromJSON(
9575
- json["billing_linked_resource"]
9576
- ),
9577
- billingThreshold: json["billing_threshold"] == null ? void 0 : json["billing_threshold"],
9578
- consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
9579
- createdAt: new Date(json["created_at"]),
9580
- currencyPrices: json["currency_prices"].map(
9581
- EntitlementCurrencyPricesResponseDataFromJSON
9582
- ),
9583
- environmentId: json["environment_id"],
9584
- feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON(json["feature"]),
9585
- featureId: json["feature_id"],
9586
- id: json["id"],
9587
- meteredMonthlyPrice: json["metered_monthly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["metered_monthly_price"]),
9588
- meteredYearlyPrice: json["metered_yearly_price"] == null ? void 0 : BillingPriceViewFromJSON(json["metered_yearly_price"]),
9589
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
9590
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
9591
- plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
9592
- planId: json["plan_id"],
9593
- priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
9594
- ruleId: json["rule_id"],
9595
- ruleIdUsageExceeded: json["rule_id_usage_exceeded"] == null ? void 0 : json["rule_id_usage_exceeded"],
9596
- softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
9597
- updatedAt: new Date(json["updated_at"]),
9598
- usageBasedProduct: json["usage_based_product"] == null ? void 0 : BillingProductResponseDataFromJSON(json["usage_based_product"]),
9599
- valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
9600
- valueCredit: json["value_credit"] == null ? void 0 : BillingCreditResponseDataFromJSON(json["value_credit"]),
9601
- valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
9602
- valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["value_trait"]),
9603
- valueTraitId: json["value_trait_id"] == null ? void 0 : json["value_trait_id"],
9604
- valueType: EntitlementValueTypeFromJSON(json["value_type"])
9605
- };
9606
- }
9607
-
9608
9644
  // src/api/checkoutexternal/models/CustomPlanConfig.ts
9609
9645
  function CustomPlanConfigFromJSON(json) {
9610
9646
  return CustomPlanConfigFromJSONTyped(json, false);
@@ -9737,15 +9773,15 @@ function FeatureUsageResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9737
9773
  entitlementId: json["entitlement_id"],
9738
9774
  entitlementSource: json["entitlement_source"] == null ? void 0 : json["entitlement_source"],
9739
9775
  entitlementType: EntitlementTypeFromJSON(json["entitlement_type"]),
9740
- feature: json["feature"] == null ? void 0 : FeatureDetailResponseDataFromJSON(json["feature"]),
9776
+ feature: json["feature"] == null ? void 0 : FeatureInPlanResponseDataFromJSON(json["feature"]),
9741
9777
  hasValidAllocation: json["has_valid_allocation"] == null ? void 0 : json["has_valid_allocation"],
9742
9778
  isUnlimited: json["is_unlimited"] == null ? void 0 : json["is_unlimited"],
9743
9779
  metricResetAt: json["metric_reset_at"] == null ? void 0 : new Date(json["metric_reset_at"]),
9744
- monthReset: json["month_reset"] == null ? void 0 : json["month_reset"],
9780
+ monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
9745
9781
  monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
9746
9782
  overuse: json["overuse"] == null ? void 0 : json["overuse"],
9747
9783
  percentUsed: json["percent_used"] == null ? void 0 : json["percent_used"],
9748
- period: json["period"] == null ? void 0 : json["period"],
9784
+ period: json["period"] == null ? void 0 : MetricPeriodFromJSON(json["period"]),
9749
9785
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
9750
9786
  planEntitlement: json["plan_entitlement"] == null ? void 0 : PlanEntitlementResponseDataFromJSON(json["plan_entitlement"]),
9751
9787
  priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
@@ -9776,7 +9812,7 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9776
9812
  companyId: json["company_id"] == null ? void 0 : json["company_id"],
9777
9813
  companyName: json["company_name"] == null ? void 0 : json["company_name"],
9778
9814
  compatiblePlanIds: json["compatible_plan_ids"],
9779
- controlledBy: json["controlled_by"],
9815
+ controlledBy: BillingProviderTypeFromJSON(json["controlled_by"]),
9780
9816
  copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
9781
9817
  createdAt: new Date(json["created_at"]),
9782
9818
  currencyPrices: json["currency_prices"].map(
@@ -9791,7 +9827,7 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9791
9827
  PlanEntitlementResponseDataFromJSON
9792
9828
  ),
9793
9829
  features: json["features"].map(
9794
- FeatureDetailResponseDataFromJSON
9830
+ FeatureInPlanResponseDataFromJSON
9795
9831
  ),
9796
9832
  icon: PlanIconFromJSON(json["icon"]),
9797
9833
  id: json["id"],
@@ -9843,6 +9879,7 @@ function CompanySubscriptionResponseDataFromJSONTyped(json, ignoreDiscriminator)
9843
9879
  products: json["products"].map(
9844
9880
  BillingProductForSubscriptionResponseDataFromJSON
9845
9881
  ),
9882
+ providerType: BillingProviderTypeFromJSON(json["provider_type"]),
9846
9883
  status: json["status"],
9847
9884
  subscriptionExternalId: json["subscription_external_id"],
9848
9885
  totalPrice: json["total_price"],
@@ -9939,7 +9976,7 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9939
9976
  companyCount: json["company_count"],
9940
9977
  companyId: json["company_id"] == null ? void 0 : json["company_id"],
9941
9978
  companyName: json["company_name"] == null ? void 0 : json["company_name"],
9942
- controlledBy: json["controlled_by"],
9979
+ controlledBy: BillingProviderTypeFromJSON(json["controlled_by"]),
9943
9980
  copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
9944
9981
  createdAt: new Date(json["created_at"]),
9945
9982
  currencyPrices: json["currency_prices"].map(
@@ -9948,7 +9985,7 @@ function PlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9948
9985
  description: json["description"],
9949
9986
  draftVersion: json["draft_version"] == null ? void 0 : PlanVersionResponseDataFromJSON(json["draft_version"]),
9950
9987
  features: json["features"].map(
9951
- FeatureDetailResponseDataFromJSON
9988
+ FeatureInPlanResponseDataFromJSON
9952
9989
  ),
9953
9990
  icon: PlanIconFromJSON(json["icon"]),
9954
9991
  id: json["id"],
@@ -10062,8 +10099,8 @@ function UsageBasedEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminato
10062
10099
  consumptionRate: json["consumption_rate"] == null ? void 0 : json["consumption_rate"],
10063
10100
  featureId: json["feature_id"],
10064
10101
  meteredPrice: json["metered_price"] == null ? void 0 : BillingPriceViewFromJSON(json["metered_price"]),
10065
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
10066
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
10102
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON(json["metric_period"]),
10103
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["metric_period_month_reset"]),
10067
10104
  monthlyUsageBasedPrice: json["monthly_usage_based_price"] == null ? void 0 : BillingPriceViewFromJSON(json["monthly_usage_based_price"]),
10068
10105
  priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON(json["price_behavior"]),
10069
10106
  valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
@@ -11188,9 +11225,9 @@ function BillingProductPriceIntervalFromJSONTyped5(json, ignoreDiscriminator) {
11188
11225
 
11189
11226
  // src/api/componentspublic/models/BillingProviderType.ts
11190
11227
  function BillingProviderTypeFromJSON2(json) {
11191
- return BillingProviderTypeFromJSONTyped14(json, false);
11228
+ return BillingProviderTypeFromJSONTyped18(json, false);
11192
11229
  }
11193
- function BillingProviderTypeFromJSONTyped14(json, ignoreDiscriminator) {
11230
+ function BillingProviderTypeFromJSONTyped18(json, ignoreDiscriminator) {
11194
11231
  return json;
11195
11232
  }
11196
11233
 
@@ -11215,6 +11252,7 @@ function BillingPriceResponseDataFromJSONTyped9(json, ignoreDiscriminator) {
11215
11252
  externalPriceId: json["external_price_id"],
11216
11253
  id: json["id"],
11217
11254
  interval: BillingProductPriceIntervalFromJSON2(json["interval"]),
11255
+ nickname: json["nickname"] == null ? void 0 : json["nickname"],
11218
11256
  price: json["price"],
11219
11257
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
11220
11258
  providerType: BillingProviderTypeFromJSON2(json["provider_type"]),
@@ -11353,6 +11391,7 @@ function BillingPriceViewFromJSONTyped8(json, ignoreDiscriminator) {
11353
11391
  meterEventName: json["meter_event_name"] == null ? void 0 : json["meter_event_name"],
11354
11392
  meterEventPayloadKey: json["meter_event_payload_key"] == null ? void 0 : json["meter_event_payload_key"],
11355
11393
  meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
11394
+ nickname: json["nickname"] == null ? void 0 : json["nickname"],
11356
11395
  packageSize: json["package_size"],
11357
11396
  price: json["price"],
11358
11397
  priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
@@ -11506,6 +11545,38 @@ function EntitlementValueTypeFromJSONTyped7(json, ignoreDiscriminator) {
11506
11545
  return json;
11507
11546
  }
11508
11547
 
11548
+ // src/api/componentspublic/models/MetricPeriodMonthReset.ts
11549
+ function MetricPeriodMonthResetFromJSON2(json) {
11550
+ return MetricPeriodMonthResetFromJSONTyped11(json, false);
11551
+ }
11552
+ function MetricPeriodMonthResetFromJSONTyped11(json, ignoreDiscriminator) {
11553
+ return json;
11554
+ }
11555
+
11556
+ // src/api/componentspublic/models/MetricPeriod.ts
11557
+ function MetricPeriodFromJSON2(json) {
11558
+ return MetricPeriodFromJSONTyped11(json, false);
11559
+ }
11560
+ function MetricPeriodFromJSONTyped11(json, ignoreDiscriminator) {
11561
+ return json;
11562
+ }
11563
+
11564
+ // src/api/componentspublic/models/RuleType.ts
11565
+ function RuleTypeFromJSON2(json) {
11566
+ return RuleTypeFromJSONTyped5(json, false);
11567
+ }
11568
+ function RuleTypeFromJSONTyped5(json, ignoreDiscriminator) {
11569
+ return json;
11570
+ }
11571
+
11572
+ // src/api/componentspublic/models/ComparableOperator.ts
11573
+ function ComparableOperatorFromJSON2(json) {
11574
+ return ComparableOperatorFromJSONTyped5(json, false);
11575
+ }
11576
+ function ComparableOperatorFromJSONTyped5(json, ignoreDiscriminator) {
11577
+ return json;
11578
+ }
11579
+
11509
11580
  // src/api/componentspublic/models/CompatiblePlans.ts
11510
11581
  function CompatiblePlansFromJSON2(json) {
11511
11582
  return CompatiblePlansFromJSONTyped3(json, false);
@@ -11552,6 +11623,14 @@ function ComponentDisplaySettingsFromJSONTyped3(json, ignoreDiscriminator) {
11552
11623
  };
11553
11624
  }
11554
11625
 
11626
+ // src/api/componentspublic/models/ConditionType.ts
11627
+ function ConditionTypeFromJSON2(json) {
11628
+ return ConditionTypeFromJSONTyped5(json, false);
11629
+ }
11630
+ function ConditionTypeFromJSONTyped5(json, ignoreDiscriminator) {
11631
+ return json;
11632
+ }
11633
+
11555
11634
  // src/api/componentspublic/models/CustomPlanConfig.ts
11556
11635
  function CustomPlanConfigFromJSON2(json) {
11557
11636
  return CustomPlanConfigFromJSONTyped3(json, false);
@@ -11687,16 +11766,16 @@ function RuleConditionDetailResponseDataFromJSONTyped4(json, ignoreDiscriminator
11687
11766
  comparisonTrait: json["comparison_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON2(json["comparison_trait"]),
11688
11767
  comparisonTraitId: json["comparison_trait_id"] == null ? void 0 : json["comparison_trait_id"],
11689
11768
  conditionGroupId: json["condition_group_id"] == null ? void 0 : json["condition_group_id"],
11690
- conditionType: json["condition_type"],
11769
+ conditionType: ConditionTypeFromJSON2(json["condition_type"]),
11691
11770
  createdAt: new Date(json["created_at"]),
11692
11771
  environmentId: json["environment_id"],
11693
11772
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
11694
11773
  flagId: json["flag_id"] == null ? void 0 : json["flag_id"],
11695
11774
  id: json["id"],
11696
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
11697
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
11775
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON2(json["metric_period"]),
11776
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON2(json["metric_period_month_reset"]),
11698
11777
  metricValue: json["metric_value"] == null ? void 0 : json["metric_value"],
11699
- operator: json["operator"],
11778
+ operator: ComparableOperatorFromJSON2(json["operator"]),
11700
11779
  resourceIds: json["resource_ids"],
11701
11780
  resources: json["resources"].map(
11702
11781
  PreviewObjectResponseDataFromJSON2
@@ -11752,7 +11831,7 @@ function RuleDetailResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
11752
11831
  id: json["id"],
11753
11832
  name: json["name"],
11754
11833
  priority: json["priority"],
11755
- ruleType: json["rule_type"],
11834
+ ruleType: RuleTypeFromJSON2(json["rule_type"]),
11756
11835
  updatedAt: new Date(json["updated_at"]),
11757
11836
  value: json["value"]
11758
11837
  };
@@ -11774,7 +11853,7 @@ function FeatureResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11774
11853
  icon: json["icon"],
11775
11854
  id: json["id"],
11776
11855
  lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON2(json["lifecycle_phase"]),
11777
- maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
11856
+ maintainerAccountMemberId: json["maintainer_account_member_id"] == null ? void 0 : json["maintainer_account_member_id"],
11778
11857
  name: json["name"],
11779
11858
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
11780
11859
  singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
@@ -11791,11 +11870,11 @@ function FlagTypeFromJSONTyped4(json, ignoreDiscriminator) {
11791
11870
  return json;
11792
11871
  }
11793
11872
 
11794
- // src/api/componentspublic/models/FlagDetailResponseData.ts
11795
- function FlagDetailResponseDataFromJSON2(json) {
11796
- return FlagDetailResponseDataFromJSONTyped3(json, false);
11873
+ // src/api/componentspublic/models/FlagInPlanResponseData.ts
11874
+ function FlagInPlanResponseDataFromJSON2(json) {
11875
+ return FlagInPlanResponseDataFromJSONTyped3(json, false);
11797
11876
  }
11798
- function FlagDetailResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
11877
+ function FlagInPlanResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
11799
11878
  if (json == null) {
11800
11879
  return json;
11801
11880
  }
@@ -11809,18 +11888,18 @@ function FlagDetailResponseDataFromJSONTyped3(json, ignoreDiscriminator) {
11809
11888
  id: json["id"],
11810
11889
  key: json["key"],
11811
11890
  lastCheckedAt: json["last_checked_at"] == null ? void 0 : new Date(json["last_checked_at"]),
11812
- maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
11891
+ maintainerAccountMemberId: json["maintainer_account_member_id"] == null ? void 0 : json["maintainer_account_member_id"],
11813
11892
  name: json["name"],
11814
11893
  rules: json["rules"].map(RuleDetailResponseDataFromJSON2),
11815
11894
  updatedAt: new Date(json["updated_at"])
11816
11895
  };
11817
11896
  }
11818
11897
 
11819
- // src/api/componentspublic/models/FeatureDetailResponseData.ts
11820
- function FeatureDetailResponseDataFromJSON2(json) {
11821
- return FeatureDetailResponseDataFromJSONTyped6(json, false);
11898
+ // src/api/componentspublic/models/FeatureInPlanResponseData.ts
11899
+ function FeatureInPlanResponseDataFromJSON2(json) {
11900
+ return FeatureInPlanResponseDataFromJSONTyped6(json, false);
11822
11901
  }
11823
- function FeatureDetailResponseDataFromJSONTyped6(json, ignoreDiscriminator) {
11902
+ function FeatureInPlanResponseDataFromJSONTyped6(json, ignoreDiscriminator) {
11824
11903
  if (json == null) {
11825
11904
  return json;
11826
11905
  }
@@ -11833,11 +11912,11 @@ function FeatureDetailResponseDataFromJSONTyped6(json, ignoreDiscriminator) {
11833
11912
  eventSubtype: json["event_subtype"] == null ? void 0 : json["event_subtype"],
11834
11913
  eventSummary: json["event_summary"] == null ? void 0 : EventSummaryResponseDataFromJSON2(json["event_summary"]),
11835
11914
  featureType: FeatureTypeFromJSON2(json["feature_type"]),
11836
- flags: json["flags"].map(FlagDetailResponseDataFromJSON2),
11915
+ flags: json["flags"].map(FlagInPlanResponseDataFromJSON2),
11837
11916
  icon: json["icon"],
11838
11917
  id: json["id"],
11839
11918
  lifecyclePhase: json["lifecycle_phase"] == null ? void 0 : FeatureLifecyclePhaseFromJSON2(json["lifecycle_phase"]),
11840
- maintainerId: json["maintainer_id"] == null ? void 0 : json["maintainer_id"],
11919
+ maintainerAccountMemberId: json["maintainer_account_member_id"] == null ? void 0 : json["maintainer_account_member_id"],
11841
11920
  name: json["name"],
11842
11921
  plans: json["plans"].map(PreviewObjectFromJSON2),
11843
11922
  pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
@@ -11864,66 +11943,6 @@ function GenericPreviewObjectFromJSONTyped4(json, ignoreDiscriminator) {
11864
11943
  };
11865
11944
  }
11866
11945
 
11867
- // src/api/componentspublic/models/PlanCreditGrantView.ts
11868
- function PlanCreditGrantViewFromJSON2(json) {
11869
- return PlanCreditGrantViewFromJSONTyped4(json, false);
11870
- }
11871
- function PlanCreditGrantViewFromJSONTyped4(json, ignoreDiscriminator) {
11872
- if (json == null) {
11873
- return json;
11874
- }
11875
- return {
11876
- billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
11877
- billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
11878
- billingCreditAutoTopupEnabled: json["billing_credit_auto_topup_enabled"],
11879
- billingCreditAutoTopupExpiryType: json["billing_credit_auto_topup_expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON2(
11880
- json["billing_credit_auto_topup_expiry_type"]
11881
- ),
11882
- billingCreditAutoTopupExpiryUnit: json["billing_credit_auto_topup_expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON2(
11883
- json["billing_credit_auto_topup_expiry_unit"]
11884
- ),
11885
- billingCreditAutoTopupExpiryUnitCount: json["billing_credit_auto_topup_expiry_unit_count"] == null ? void 0 : json["billing_credit_auto_topup_expiry_unit_count"],
11886
- billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
11887
- billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
11888
- createdAt: new Date(json["created_at"]),
11889
- credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON2(json["credit"]),
11890
- creditAmount: json["credit_amount"],
11891
- creditDescription: json["credit_description"],
11892
- creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
11893
- creditId: json["credit_id"],
11894
- creditName: json["credit_name"],
11895
- expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON2(json["expiry_type"]),
11896
- expiryUnit: json["expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON2(json["expiry_unit"]),
11897
- expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
11898
- id: json["id"],
11899
- plan: json["plan"] == null ? void 0 : GenericPreviewObjectFromJSON2(json["plan"]),
11900
- planId: json["plan_id"],
11901
- planVersionId: json["plan_version_id"] == null ? void 0 : json["plan_version_id"],
11902
- pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
11903
- resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON2(json["reset_cadence"]),
11904
- resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON2(json["reset_start"]),
11905
- resetType: BillingPlanCreditGrantResetTypeFromJSON2(json["reset_type"]),
11906
- singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
11907
- updatedAt: new Date(json["updated_at"])
11908
- };
11909
- }
11910
-
11911
- // src/api/componentspublic/models/PlanCurrencyPricesResponseData.ts
11912
- function PlanCurrencyPricesResponseDataFromJSON2(json) {
11913
- return PlanCurrencyPricesResponseDataFromJSONTyped5(json, false);
11914
- }
11915
- function PlanCurrencyPricesResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11916
- if (json == null) {
11917
- return json;
11918
- }
11919
- return {
11920
- currency: json["currency"],
11921
- monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["monthly_price"]),
11922
- oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["one_time_price"]),
11923
- yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["yearly_price"])
11924
- };
11925
- }
11926
-
11927
11946
  // src/api/componentspublic/models/PlanIcon.ts
11928
11947
  function PlanIconFromJSON2(json) {
11929
11948
  return PlanIconFromJSONTyped7(json, false);
@@ -11986,8 +12005,8 @@ function PlanEntitlementResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
11986
12005
  id: json["id"],
11987
12006
  meteredMonthlyPrice: json["metered_monthly_price"] == null ? void 0 : BillingPriceViewFromJSON2(json["metered_monthly_price"]),
11988
12007
  meteredYearlyPrice: json["metered_yearly_price"] == null ? void 0 : BillingPriceViewFromJSON2(json["metered_yearly_price"]),
11989
- metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
11990
- metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
12008
+ metricPeriod: json["metric_period"] == null ? void 0 : MetricPeriodFromJSON2(json["metric_period"]),
12009
+ metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON2(json["metric_period_month_reset"]),
11991
12010
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON2(json["plan"]),
11992
12011
  planId: json["plan_id"],
11993
12012
  priceBehavior: json["price_behavior"] == null ? void 0 : EntitlementPriceBehaviorFromJSON2(json["price_behavior"]),
@@ -12005,6 +12024,66 @@ function PlanEntitlementResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
12005
12024
  };
12006
12025
  }
12007
12026
 
12027
+ // src/api/componentspublic/models/PlanCreditGrantView.ts
12028
+ function PlanCreditGrantViewFromJSON2(json) {
12029
+ return PlanCreditGrantViewFromJSONTyped4(json, false);
12030
+ }
12031
+ function PlanCreditGrantViewFromJSONTyped4(json, ignoreDiscriminator) {
12032
+ if (json == null) {
12033
+ return json;
12034
+ }
12035
+ return {
12036
+ billingCreditAutoTopupAmount: json["billing_credit_auto_topup_amount"] == null ? void 0 : json["billing_credit_auto_topup_amount"],
12037
+ billingCreditAutoTopupAmountType: json["billing_credit_auto_topup_amount_type"] == null ? void 0 : json["billing_credit_auto_topup_amount_type"],
12038
+ billingCreditAutoTopupEnabled: json["billing_credit_auto_topup_enabled"],
12039
+ billingCreditAutoTopupExpiryType: json["billing_credit_auto_topup_expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON2(
12040
+ json["billing_credit_auto_topup_expiry_type"]
12041
+ ),
12042
+ billingCreditAutoTopupExpiryUnit: json["billing_credit_auto_topup_expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON2(
12043
+ json["billing_credit_auto_topup_expiry_unit"]
12044
+ ),
12045
+ billingCreditAutoTopupExpiryUnitCount: json["billing_credit_auto_topup_expiry_unit_count"] == null ? void 0 : json["billing_credit_auto_topup_expiry_unit_count"],
12046
+ billingCreditAutoTopupThresholdCredits: json["billing_credit_auto_topup_threshold_credits"] == null ? void 0 : json["billing_credit_auto_topup_threshold_credits"],
12047
+ billingCreditAutoTopupThresholdPercent: json["billing_credit_auto_topup_threshold_percent"] == null ? void 0 : json["billing_credit_auto_topup_threshold_percent"],
12048
+ createdAt: new Date(json["created_at"]),
12049
+ credit: json["credit"] == null ? void 0 : BillingCreditViewFromJSON2(json["credit"]),
12050
+ creditAmount: json["credit_amount"],
12051
+ creditDescription: json["credit_description"],
12052
+ creditIcon: json["credit_icon"] == null ? void 0 : json["credit_icon"],
12053
+ creditId: json["credit_id"],
12054
+ creditName: json["credit_name"],
12055
+ expiryType: json["expiry_type"] == null ? void 0 : BillingCreditExpiryTypeFromJSON2(json["expiry_type"]),
12056
+ expiryUnit: json["expiry_unit"] == null ? void 0 : BillingCreditExpiryUnitFromJSON2(json["expiry_unit"]),
12057
+ expiryUnitCount: json["expiry_unit_count"] == null ? void 0 : json["expiry_unit_count"],
12058
+ id: json["id"],
12059
+ plan: json["plan"] == null ? void 0 : GenericPreviewObjectFromJSON2(json["plan"]),
12060
+ planId: json["plan_id"],
12061
+ planVersionId: json["plan_version_id"] == null ? void 0 : json["plan_version_id"],
12062
+ pluralName: json["plural_name"] == null ? void 0 : json["plural_name"],
12063
+ resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON2(json["reset_cadence"]),
12064
+ resetStart: json["reset_start"] == null ? void 0 : BillingPlanCreditGrantResetStartFromJSON2(json["reset_start"]),
12065
+ resetType: BillingPlanCreditGrantResetTypeFromJSON2(json["reset_type"]),
12066
+ singularName: json["singular_name"] == null ? void 0 : json["singular_name"],
12067
+ updatedAt: new Date(json["updated_at"])
12068
+ };
12069
+ }
12070
+
12071
+ // src/api/componentspublic/models/PlanCurrencyPricesResponseData.ts
12072
+ function PlanCurrencyPricesResponseDataFromJSON2(json) {
12073
+ return PlanCurrencyPricesResponseDataFromJSONTyped5(json, false);
12074
+ }
12075
+ function PlanCurrencyPricesResponseDataFromJSONTyped5(json, ignoreDiscriminator) {
12076
+ if (json == null) {
12077
+ return json;
12078
+ }
12079
+ return {
12080
+ currency: json["currency"],
12081
+ monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["monthly_price"]),
12082
+ oneTimePrice: json["one_time_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["one_time_price"]),
12083
+ yearlyPrice: json["yearly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON2(json["yearly_price"])
12084
+ };
12085
+ }
12086
+
12008
12087
  // src/api/componentspublic/models/PlanVersionStatus.ts
12009
12088
  function PlanVersionStatusFromJSON2(json) {
12010
12089
  return PlanVersionStatusFromJSONTyped3(json, false);
@@ -12056,7 +12135,7 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
12056
12135
  companyId: json["company_id"] == null ? void 0 : json["company_id"],
12057
12136
  companyName: json["company_name"] == null ? void 0 : json["company_name"],
12058
12137
  compatiblePlanIds: json["compatible_plan_ids"],
12059
- controlledBy: json["controlled_by"],
12138
+ controlledBy: BillingProviderTypeFromJSON2(json["controlled_by"]),
12060
12139
  copiedFromPlanId: json["copied_from_plan_id"] == null ? void 0 : json["copied_from_plan_id"],
12061
12140
  createdAt: new Date(json["created_at"]),
12062
12141
  currencyPrices: json["currency_prices"].map(
@@ -12070,7 +12149,7 @@ function PlanViewPublicResponseDataFromJSONTyped(json, ignoreDiscriminator) {
12070
12149
  PlanEntitlementResponseDataFromJSON2
12071
12150
  ),
12072
12151
  features: json["features"].map(
12073
- FeatureDetailResponseDataFromJSON2
12152
+ FeatureInPlanResponseDataFromJSON2
12074
12153
  ),
12075
12154
  icon: PlanIconFromJSON2(json["icon"]),
12076
12155
  id: json["id"],
@@ -13467,7 +13546,7 @@ var reducer = (state, action) => {
13467
13546
  // src/context/EmbedProvider.tsx
13468
13547
  var import_jsx_runtime2 = require("react/jsx-runtime");
13469
13548
  var getCustomHeaders = (sessionId) => ({
13470
- "X-Schematic-Components-Version": "2.10.0",
13549
+ "X-Schematic-Components-Version": "2.10.1",
13471
13550
  "X-Schematic-Session-ID": sessionId
13472
13551
  });
13473
13552
  var normalizeCurrencyFilter = (filter2) => {
@@ -14620,6 +14699,7 @@ var Dialog = ut2.dialog(
14620
14699
  height: fit-content;
14621
14700
  max-height: 100dvh;
14622
14701
  margin: ${$top}px 0 0;
14702
+ padding: 0;
14623
14703
  background-color: ${theme.card.background};
14624
14704
  box-shadow:
14625
14705
  0px 1px 20px 0px #1018280f,
@@ -16830,7 +16910,7 @@ var createActiveUsageBasedEntitlementsReducer = (entitlements, period) => (acc,
16830
16910
  );
16831
16911
  const allocation = featureUsage?.allocation ?? entitlement.valueNumeric ?? 0;
16832
16912
  const usage = featureUsage?.usage ?? 0;
16833
- const quantity = featureUsage?.priceBehavior === EntitlementPriceBehavior.PayInAdvance ? allocation : 0;
16913
+ const quantity = entitlement.priceBehavior === EntitlementPriceBehavior.PayInAdvance ? allocation : 0;
16834
16914
  acc.push({
16835
16915
  ...entitlement,
16836
16916
  allocation,
@@ -19076,7 +19156,7 @@ var SubscriptionSidebar = (0, import_react41.forwardRef)(
19076
19156
  total += planPrice;
19077
19157
  }
19078
19158
  const addOnCost = addOns.reduce((sum, addOn) => {
19079
- if (addOn.isSelected) {
19159
+ if (addOn.isSelected && addOn.chargeType !== ChargeType.oneTime) {
19080
19160
  sum += getAddOnPrice(addOn, planPeriod, currency)?.price ?? 0;
19081
19161
  }
19082
19162
  return sum;
@@ -19087,6 +19167,11 @@ var SubscriptionSidebar = (0, import_react41.forwardRef)(
19087
19167
  0
19088
19168
  );
19089
19169
  total += payInAdvanceCost;
19170
+ const addOnPayInAdvanceCost = addOnPayInAdvanceEntitlements.reduce(
19171
+ (sum, entitlement) => sum + entitlement.quantity * (getEntitlementPrice(entitlement, planPeriod, currency)?.price ?? 0),
19172
+ 0
19173
+ );
19174
+ total += addOnPayInAdvanceCost;
19090
19175
  return formatCurrency(total, resolvedCurrency);
19091
19176
  }, [
19092
19177
  selectedPlan,
@@ -19094,6 +19179,7 @@ var SubscriptionSidebar = (0, import_react41.forwardRef)(
19094
19179
  planPeriod,
19095
19180
  addOns,
19096
19181
  payInAdvanceEntitlements,
19182
+ addOnPayInAdvanceEntitlements,
19097
19183
  currency
19098
19184
  ]);
19099
19185
  const {
@@ -19322,7 +19408,8 @@ var SubscriptionSidebar = (0, import_react41.forwardRef)(
19322
19408
  }, [t3, unsubscribe, setError, setIsLoading, setLayout]);
19323
19409
  const isSelectedPlanTrialable = selectedPlan?.companyCanTrial === true && selectedPlan?.isTrialable === true;
19324
19410
  const button = (0, import_react41.useMemo)(() => {
19325
- const canCheckout = error !== t3("Downgrade not permitted.");
19411
+ const hasEntitlementDowngrade = payInAdvanceEntitlements.some((e2) => e2.quantity < e2.usage) || addOnPayInAdvanceEntitlements.some((e2) => e2.quantity < e2.usage);
19412
+ const canCheckout = error !== t3("Downgrade not permitted.") && !hasEntitlementDowngrade;
19326
19413
  const isSticky = !isButtonInView;
19327
19414
  switch (layout) {
19328
19415
  case "checkout":
@@ -19382,7 +19469,9 @@ var SubscriptionSidebar = (0, import_react41.forwardRef)(
19382
19469
  paymentMethod,
19383
19470
  paymentMethodId,
19384
19471
  handleCheckout,
19385
- handleUnsubscribe
19472
+ handleUnsubscribe,
19473
+ payInAdvanceEntitlements,
19474
+ addOnPayInAdvanceEntitlements
19386
19475
  ]);
19387
19476
  (0, import_react41.useLayoutEffect)(() => {
19388
19477
  const element = buttonRef.current;