@schematichq/schematic-components 2.26.0 → 2.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3796,6 +3796,7 @@ var initialContext = {
3796
3796
  hydrate: stub,
3797
3797
  hydrateComponent: stub,
3798
3798
  hydrateExternal: stub,
3799
+ rehydrateWithParams: stub,
3799
3800
  getUpcomingInvoice: stub,
3800
3801
  getCustomerBalance: stub,
3801
3802
  listInvoices: stub,
@@ -5190,6 +5191,18 @@ function BillingSubscriptionViewFromJSONTyped(json, ignoreDiscriminator) {
5190
5191
  }
5191
5192
 
5192
5193
  // src/api/checkoutexternal/models/UpdatePayInAdvanceRequestBody.ts
5194
+ function UpdatePayInAdvanceRequestBodyFromJSON(json) {
5195
+ return UpdatePayInAdvanceRequestBodyFromJSONTyped(json, false);
5196
+ }
5197
+ function UpdatePayInAdvanceRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
5198
+ if (json == null) {
5199
+ return json;
5200
+ }
5201
+ return {
5202
+ priceId: json["price_id"],
5203
+ quantity: json["quantity"]
5204
+ };
5205
+ }
5193
5206
  function UpdatePayInAdvanceRequestBodyToJSON(json) {
5194
5207
  return UpdatePayInAdvanceRequestBodyToJSONTyped(json, false);
5195
5208
  }
@@ -5204,6 +5217,18 @@ function UpdatePayInAdvanceRequestBodyToJSONTyped(value, ignoreDiscriminator = f
5204
5217
  }
5205
5218
 
5206
5219
  // src/api/checkoutexternal/models/UpdateCreditBundleRequestBody.ts
5220
+ function UpdateCreditBundleRequestBodyFromJSON(json) {
5221
+ return UpdateCreditBundleRequestBodyFromJSONTyped(json, false);
5222
+ }
5223
+ function UpdateCreditBundleRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
5224
+ if (json == null) {
5225
+ return json;
5226
+ }
5227
+ return {
5228
+ bundleId: json["bundle_id"],
5229
+ quantity: json["quantity"]
5230
+ };
5231
+ }
5207
5232
  function UpdateCreditBundleRequestBodyToJSON(json) {
5208
5233
  return UpdateCreditBundleRequestBodyToJSONTyped(json, false);
5209
5234
  }
@@ -5218,6 +5243,18 @@ function UpdateCreditBundleRequestBodyToJSONTyped(value, ignoreDiscriminator = f
5218
5243
  }
5219
5244
 
5220
5245
  // src/api/checkoutexternal/models/CheckoutFieldValue.ts
5246
+ function CheckoutFieldValueFromJSON(json) {
5247
+ return CheckoutFieldValueFromJSONTyped(json, false);
5248
+ }
5249
+ function CheckoutFieldValueFromJSONTyped(json, ignoreDiscriminator) {
5250
+ if (json == null) {
5251
+ return json;
5252
+ }
5253
+ return {
5254
+ id: json["id"],
5255
+ value: json["value"]
5256
+ };
5257
+ }
5221
5258
  function CheckoutFieldValueToJSON(json) {
5222
5259
  return CheckoutFieldValueToJSONTyped(json, false);
5223
5260
  }
@@ -5232,6 +5269,18 @@ function CheckoutFieldValueToJSONTyped(value, ignoreDiscriminator = false) {
5232
5269
  }
5233
5270
 
5234
5271
  // src/api/checkoutexternal/models/UpdateAddOnRequestBody.ts
5272
+ function UpdateAddOnRequestBodyFromJSON(json) {
5273
+ return UpdateAddOnRequestBodyFromJSONTyped(json, false);
5274
+ }
5275
+ function UpdateAddOnRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
5276
+ if (json == null) {
5277
+ return json;
5278
+ }
5279
+ return {
5280
+ addOnId: json["add_on_id"],
5281
+ priceId: json["price_id"]
5282
+ };
5283
+ }
5235
5284
  function UpdateAddOnRequestBodyToJSON(json) {
5236
5285
  return UpdateAddOnRequestBodyToJSONTyped(json, false);
5237
5286
  }
@@ -5246,6 +5295,20 @@ function UpdateAddOnRequestBodyToJSONTyped(value, ignoreDiscriminator = false) {
5246
5295
  }
5247
5296
 
5248
5297
  // src/api/checkoutexternal/models/UpdateAutoTopupOverrideRequestBody.ts
5298
+ function UpdateAutoTopupOverrideRequestBodyFromJSON(json) {
5299
+ return UpdateAutoTopupOverrideRequestBodyFromJSONTyped(json, false);
5300
+ }
5301
+ function UpdateAutoTopupOverrideRequestBodyFromJSONTyped(json, ignoreDiscriminator) {
5302
+ if (json == null) {
5303
+ return json;
5304
+ }
5305
+ return {
5306
+ autoTopupAmount: json["auto_topup_amount"] == null ? void 0 : json["auto_topup_amount"],
5307
+ autoTopupEnabled: json["auto_topup_enabled"] == null ? void 0 : json["auto_topup_enabled"],
5308
+ autoTopupThresholdCredits: json["auto_topup_threshold_credits"] == null ? void 0 : json["auto_topup_threshold_credits"],
5309
+ planCreditGrantId: json["plan_credit_grant_id"]
5310
+ };
5311
+ }
5249
5312
  function UpdateAutoTopupOverrideRequestBodyToJSON(json) {
5250
5313
  return UpdateAutoTopupOverrideRequestBodyToJSONTyped(json, false);
5251
5314
  }
@@ -5281,6 +5344,7 @@ function ChangeSubscriptionRequestBodyToJSONTyped(value, ignoreDiscriminator = f
5281
5344
  credit_bundles: value["creditBundles"].map(
5282
5345
  UpdateCreditBundleRequestBodyToJSON
5283
5346
  ),
5347
+ currency: value["currency"],
5284
5348
  custom_field_values: value["customFieldValues"].map(
5285
5349
  CheckoutFieldValueToJSON
5286
5350
  ),
@@ -5316,6 +5380,143 @@ function CheckoutBundlePurchaseBehaviorFromJSONTyped(json, ignoreDiscriminator)
5316
5380
  return json;
5317
5381
  }
5318
5382
 
5383
+ // src/api/checkoutexternal/models/CheckoutPriceSnapshot.ts
5384
+ function CheckoutPriceSnapshotFromJSON(json) {
5385
+ return CheckoutPriceSnapshotFromJSONTyped(json, false);
5386
+ }
5387
+ function CheckoutPriceSnapshotFromJSONTyped(json, ignoreDiscriminator) {
5388
+ if (json == null) {
5389
+ return json;
5390
+ }
5391
+ return {
5392
+ amountOff: json["amount_off"],
5393
+ currency: json["currency"],
5394
+ dueNow: json["due_now"],
5395
+ isScheduledDowngrade: json["is_scheduled_downgrade"],
5396
+ newCharges: json["new_charges"],
5397
+ optInRequired: json["opt_in_required"],
5398
+ paymentMethodRequired: json["payment_method_required"],
5399
+ percentOff: json["percent_off"],
5400
+ periodStart: new Date(json["period_start"]),
5401
+ pricedAt: new Date(json["priced_at"]),
5402
+ promoCodeApplied: json["promo_code_applied"],
5403
+ proration: json["proration"],
5404
+ scheduledChangeTime: json["scheduled_change_time"] == null ? void 0 : new Date(json["scheduled_change_time"]),
5405
+ taxAmount: json["tax_amount"] == null ? void 0 : json["tax_amount"],
5406
+ totalPerBillingPeriod: json["total_per_billing_period"],
5407
+ trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
5408
+ };
5409
+ }
5410
+
5411
+ // src/api/checkoutexternal/models/CheckoutStatus.ts
5412
+ function CheckoutStatusFromJSON(json) {
5413
+ return CheckoutStatusFromJSONTyped(json, false);
5414
+ }
5415
+ function CheckoutStatusFromJSONTyped(json, ignoreDiscriminator) {
5416
+ return json;
5417
+ }
5418
+
5419
+ // src/api/checkoutexternal/models/CheckoutSelectionsResponseData.ts
5420
+ function CheckoutSelectionsResponseDataFromJSON(json) {
5421
+ return CheckoutSelectionsResponseDataFromJSONTyped(json, false);
5422
+ }
5423
+ function CheckoutSelectionsResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5424
+ if (json == null) {
5425
+ return json;
5426
+ }
5427
+ return {
5428
+ addOnIds: json["add_on_ids"].map(
5429
+ UpdateAddOnRequestBodyFromJSON
5430
+ ),
5431
+ autoTopupOverrides: json["auto_topup_overrides"].map(
5432
+ UpdateAutoTopupOverrideRequestBodyFromJSON
5433
+ ),
5434
+ billingEntityId: json["billing_entity_id"] == null ? void 0 : json["billing_entity_id"],
5435
+ couponExternalId: json["coupon_external_id"] == null ? void 0 : json["coupon_external_id"],
5436
+ creditBundles: json["credit_bundles"].map(
5437
+ UpdateCreditBundleRequestBodyFromJSON
5438
+ ),
5439
+ customFieldValues: json["custom_field_values"].map(
5440
+ CheckoutFieldValueFromJSON
5441
+ ),
5442
+ newPlanId: json["new_plan_id"] == null ? void 0 : json["new_plan_id"],
5443
+ newPriceId: json["new_price_id"] == null ? void 0 : json["new_price_id"],
5444
+ optInAccepted: json["opt_in_accepted"] == null ? void 0 : json["opt_in_accepted"],
5445
+ payInAdvance: json["pay_in_advance"].map(
5446
+ UpdatePayInAdvanceRequestBodyFromJSON
5447
+ ),
5448
+ paymentMethodId: json["payment_method_id"] == null ? void 0 : json["payment_method_id"],
5449
+ promoCode: json["promo_code"] == null ? void 0 : json["promo_code"],
5450
+ skipTrial: json["skip_trial"]
5451
+ };
5452
+ }
5453
+
5454
+ // src/api/checkoutexternal/models/CheckoutProblemSource.ts
5455
+ function CheckoutProblemSourceFromJSON(json) {
5456
+ return CheckoutProblemSourceFromJSONTyped(json, false);
5457
+ }
5458
+ function CheckoutProblemSourceFromJSONTyped(json, ignoreDiscriminator) {
5459
+ return json;
5460
+ }
5461
+
5462
+ // src/api/checkoutexternal/models/CheckoutProblemCode.ts
5463
+ function CheckoutProblemCodeFromJSON(json) {
5464
+ return CheckoutProblemCodeFromJSONTyped(json, false);
5465
+ }
5466
+ function CheckoutProblemCodeFromJSONTyped(json, ignoreDiscriminator) {
5467
+ return json;
5468
+ }
5469
+
5470
+ // src/api/checkoutexternal/models/Problem.ts
5471
+ function ProblemFromJSON(json) {
5472
+ return ProblemFromJSONTyped(json, false);
5473
+ }
5474
+ function ProblemFromJSONTyped(json, ignoreDiscriminator) {
5475
+ if (json == null) {
5476
+ return json;
5477
+ }
5478
+ return {
5479
+ blocking: json["blocking"],
5480
+ bundleId: json["bundle_id"] == null ? void 0 : json["bundle_id"],
5481
+ code: CheckoutProblemCodeFromJSON(json["code"]),
5482
+ currency: json["currency"] == null ? void 0 : json["currency"],
5483
+ detail: json["detail"] == null ? void 0 : json["detail"],
5484
+ featureId: json["feature_id"] == null ? void 0 : json["feature_id"],
5485
+ fieldId: json["field_id"] == null ? void 0 : json["field_id"],
5486
+ message: json["message"],
5487
+ paymentMethodId: json["payment_method_id"] == null ? void 0 : json["payment_method_id"],
5488
+ planId: json["plan_id"] == null ? void 0 : json["plan_id"],
5489
+ priceId: json["price_id"] == null ? void 0 : json["price_id"],
5490
+ source: CheckoutProblemSourceFromJSON(json["source"])
5491
+ };
5492
+ }
5493
+
5494
+ // src/api/checkoutexternal/models/CheckoutDraftResponseData.ts
5495
+ function CheckoutDraftResponseDataFromJSON(json) {
5496
+ return CheckoutDraftResponseDataFromJSONTyped(json, false);
5497
+ }
5498
+ function CheckoutDraftResponseDataFromJSONTyped(json, ignoreDiscriminator) {
5499
+ if (json == null) {
5500
+ return json;
5501
+ }
5502
+ return {
5503
+ companyId: json["company_id"],
5504
+ completedAt: json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
5505
+ createdAt: new Date(json["created_at"]),
5506
+ expiresAt: json["expires_at"] == null ? void 0 : new Date(json["expires_at"]),
5507
+ id: json["id"],
5508
+ lastActivityAt: new Date(json["last_activity_at"]),
5509
+ priceSnapshot: json["price_snapshot"] == null ? void 0 : CheckoutPriceSnapshotFromJSON(json["price_snapshot"]),
5510
+ pricedAt: json["priced_at"] == null ? void 0 : new Date(json["priced_at"]),
5511
+ problems: json["problems"].map(ProblemFromJSON),
5512
+ selections: CheckoutSelectionsResponseDataFromJSON(json["selections"]),
5513
+ shareToken: json["share_token"] == null ? void 0 : json["share_token"],
5514
+ status: CheckoutStatusFromJSON(json["status"]),
5515
+ updatedAt: new Date(json["updated_at"]),
5516
+ version: json["version"]
5517
+ };
5518
+ }
5519
+
5319
5520
  // src/api/checkoutexternal/models/CheckoutFieldWithValue.ts
5320
5521
  function CheckoutFieldWithValueFromJSON(json) {
5321
5522
  return CheckoutFieldWithValueFromJSONTyped(json, false);
@@ -7327,6 +7528,57 @@ function ComponentHydrateResponseDataFromJSONTyped(json, ignoreDiscriminator) {
7327
7528
  };
7328
7529
  }
7329
7530
 
7531
+ // src/api/checkoutexternal/models/CreateCheckoutRequest.ts
7532
+ function CreateCheckoutRequestToJSON(json) {
7533
+ return CreateCheckoutRequestToJSONTyped(json, false);
7534
+ }
7535
+ function CreateCheckoutRequestToJSONTyped(value, ignoreDiscriminator = false) {
7536
+ if (value == null) {
7537
+ return value;
7538
+ }
7539
+ return {
7540
+ add_on_ids: value["addOnIds"].map(
7541
+ UpdateAddOnRequestBodyToJSON
7542
+ ),
7543
+ auto_topup_overrides: value["autoTopupOverrides"].map(
7544
+ UpdateAutoTopupOverrideRequestBodyToJSON
7545
+ ),
7546
+ billing_entity_id: value["billingEntityId"],
7547
+ company_id: value["companyId"],
7548
+ coupon_external_id: value["couponExternalId"],
7549
+ credit_bundles: value["creditBundles"].map(
7550
+ UpdateCreditBundleRequestBodyToJSON
7551
+ ),
7552
+ currency: value["currency"],
7553
+ custom_field_values: value["customFieldValues"].map(
7554
+ CheckoutFieldValueToJSON
7555
+ ),
7556
+ new_plan_id: value["newPlanId"],
7557
+ new_price_id: value["newPriceId"],
7558
+ opt_in_accepted: value["optInAccepted"],
7559
+ pay_in_advance: value["payInAdvance"].map(
7560
+ UpdatePayInAdvanceRequestBodyToJSON
7561
+ ),
7562
+ payment_method_id: value["paymentMethodId"],
7563
+ promo_code: value["promoCode"],
7564
+ skip_trial: value["skipTrial"]
7565
+ };
7566
+ }
7567
+
7568
+ // src/api/checkoutexternal/models/CreateCheckoutResponse.ts
7569
+ function CreateCheckoutResponseFromJSON(json) {
7570
+ return CreateCheckoutResponseFromJSONTyped(json, false);
7571
+ }
7572
+ function CreateCheckoutResponseFromJSONTyped(json, ignoreDiscriminator) {
7573
+ if (json == null) {
7574
+ return json;
7575
+ }
7576
+ return {
7577
+ data: CheckoutDraftResponseDataFromJSON(json["data"]),
7578
+ params: json["params"]
7579
+ };
7580
+ }
7581
+
7330
7582
  // src/api/checkoutexternal/models/SetupIntentResponseData.ts
7331
7583
  function SetupIntentResponseDataFromJSON(json) {
7332
7584
  return SetupIntentResponseDataFromJSONTyped(json, false);
@@ -7482,6 +7734,47 @@ function FetchCustomerBalanceResponseFromJSONTyped(json, ignoreDiscriminator) {
7482
7734
  };
7483
7735
  }
7484
7736
 
7737
+ // src/api/checkoutexternal/models/FinalizeCheckoutRequest.ts
7738
+ function FinalizeCheckoutRequestToJSON(json) {
7739
+ return FinalizeCheckoutRequestToJSONTyped(json, false);
7740
+ }
7741
+ function FinalizeCheckoutRequestToJSONTyped(value, ignoreDiscriminator = false) {
7742
+ if (value == null) {
7743
+ return value;
7744
+ }
7745
+ return {
7746
+ version: value["version"]
7747
+ };
7748
+ }
7749
+
7750
+ // src/api/checkoutexternal/models/FinalizeCheckoutResponse.ts
7751
+ function FinalizeCheckoutResponseFromJSON(json) {
7752
+ return FinalizeCheckoutResponseFromJSONTyped(json, false);
7753
+ }
7754
+ function FinalizeCheckoutResponseFromJSONTyped(json, ignoreDiscriminator) {
7755
+ if (json == null) {
7756
+ return json;
7757
+ }
7758
+ return {
7759
+ data: CheckoutResponseDataFromJSON(json["data"]),
7760
+ params: json["params"]
7761
+ };
7762
+ }
7763
+
7764
+ // src/api/checkoutexternal/models/GetCheckoutResponse.ts
7765
+ function GetCheckoutResponseFromJSON(json) {
7766
+ return GetCheckoutResponseFromJSONTyped(json, false);
7767
+ }
7768
+ function GetCheckoutResponseFromJSONTyped(json, ignoreDiscriminator) {
7769
+ if (json == null) {
7770
+ return json;
7771
+ }
7772
+ return {
7773
+ data: CheckoutDraftResponseDataFromJSON(json["data"]),
7774
+ params: json["params"]
7775
+ };
7776
+ }
7777
+
7485
7778
  // src/api/checkoutexternal/models/UpdateCheckoutTaxIDResponseData.ts
7486
7779
  function UpdateCheckoutTaxIDResponseDataFromJSON(json) {
7487
7780
  return UpdateCheckoutTaxIDResponseDataFromJSONTyped(json, false);
@@ -7631,7 +7924,8 @@ function HydrateComponentParamsFromJSONTyped(json, ignoreDiscriminator) {
7631
7924
  return json;
7632
7925
  }
7633
7926
  return {
7634
- catalogId: json["catalog_id"] == null ? void 0 : json["catalog_id"]
7927
+ catalogId: json["catalog_id"] == null ? void 0 : json["catalog_id"],
7928
+ includeAddOnIds: json["include_add_on_ids"] == null ? void 0 : json["include_add_on_ids"]
7635
7929
  };
7636
7930
  }
7637
7931
 
@@ -7690,6 +7984,36 @@ function HydrateUpcomingInvoiceResponseFromJSONTyped(json, ignoreDiscriminator)
7690
7984
  };
7691
7985
  }
7692
7986
 
7987
+ // src/api/checkoutexternal/models/ListCheckoutsParams.ts
7988
+ function ListCheckoutsParamsFromJSON(json) {
7989
+ return ListCheckoutsParamsFromJSONTyped(json, false);
7990
+ }
7991
+ function ListCheckoutsParamsFromJSONTyped(json, ignoreDiscriminator) {
7992
+ if (json == null) {
7993
+ return json;
7994
+ }
7995
+ return {
7996
+ companyId: json["company_id"] == null ? void 0 : json["company_id"],
7997
+ limit: json["limit"] == null ? void 0 : json["limit"],
7998
+ offset: json["offset"] == null ? void 0 : json["offset"],
7999
+ statuses: json["statuses"] == null ? void 0 : json["statuses"].map(CheckoutStatusFromJSON)
8000
+ };
8001
+ }
8002
+
8003
+ // src/api/checkoutexternal/models/ListCheckoutsResponse.ts
8004
+ function ListCheckoutsResponseFromJSON(json) {
8005
+ return ListCheckoutsResponseFromJSONTyped(json, false);
8006
+ }
8007
+ function ListCheckoutsResponseFromJSONTyped(json, ignoreDiscriminator) {
8008
+ if (json == null) {
8009
+ return json;
8010
+ }
8011
+ return {
8012
+ data: json["data"].map(CheckoutDraftResponseDataFromJSON),
8013
+ params: ListCheckoutsParamsFromJSON(json["params"])
8014
+ };
8015
+ }
8016
+
7693
8017
  // src/api/checkoutexternal/models/ListInvoicesParams.ts
7694
8018
  function ListInvoicesParamsFromJSON(json) {
7695
8019
  return ListInvoicesParamsFromJSONTyped(json, false);
@@ -7768,6 +8092,7 @@ function PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, ignoreDiscrim
7768
8092
  }
7769
8093
  return {
7770
8094
  amountOff: json["amount_off"],
8095
+ currency: json["currency"],
7771
8096
  discountAmount: json["discount_amount"],
7772
8097
  discounts: json["discounts"].map(
7773
8098
  PreviewSubscriptionDiscountResponseDataFromJSON
@@ -7892,6 +8217,57 @@ function UpdateCheckoutFieldValuesResponseFromJSONTyped(json, ignoreDiscriminato
7892
8217
  };
7893
8218
  }
7894
8219
 
8220
+ // src/api/checkoutexternal/models/UpdateCheckoutRequest.ts
8221
+ function UpdateCheckoutRequestToJSON(json) {
8222
+ return UpdateCheckoutRequestToJSONTyped(json, false);
8223
+ }
8224
+ function UpdateCheckoutRequestToJSONTyped(value, ignoreDiscriminator = false) {
8225
+ if (value == null) {
8226
+ return value;
8227
+ }
8228
+ return {
8229
+ add_on_ids: value["addOnIds"].map(
8230
+ UpdateAddOnRequestBodyToJSON
8231
+ ),
8232
+ auto_topup_overrides: value["autoTopupOverrides"].map(
8233
+ UpdateAutoTopupOverrideRequestBodyToJSON
8234
+ ),
8235
+ billing_entity_id: value["billingEntityId"],
8236
+ coupon_external_id: value["couponExternalId"],
8237
+ credit_bundles: value["creditBundles"].map(
8238
+ UpdateCreditBundleRequestBodyToJSON
8239
+ ),
8240
+ currency: value["currency"],
8241
+ custom_field_values: value["customFieldValues"].map(
8242
+ CheckoutFieldValueToJSON
8243
+ ),
8244
+ new_plan_id: value["newPlanId"],
8245
+ new_price_id: value["newPriceId"],
8246
+ opt_in_accepted: value["optInAccepted"],
8247
+ pay_in_advance: value["payInAdvance"].map(
8248
+ UpdatePayInAdvanceRequestBodyToJSON
8249
+ ),
8250
+ payment_method_id: value["paymentMethodId"],
8251
+ promo_code: value["promoCode"],
8252
+ skip_trial: value["skipTrial"],
8253
+ version: value["version"]
8254
+ };
8255
+ }
8256
+
8257
+ // src/api/checkoutexternal/models/UpdateCheckoutResponse.ts
8258
+ function UpdateCheckoutResponseFromJSON(json) {
8259
+ return UpdateCheckoutResponseFromJSONTyped(json, false);
8260
+ }
8261
+ function UpdateCheckoutResponseFromJSONTyped(json, ignoreDiscriminator) {
8262
+ if (json == null) {
8263
+ return json;
8264
+ }
8265
+ return {
8266
+ data: CheckoutDraftResponseDataFromJSON(json["data"]),
8267
+ params: json["params"]
8268
+ };
8269
+ }
8270
+
7895
8271
  // src/api/checkoutexternal/models/UpdateCheckoutTaxIDRequestBody.ts
7896
8272
  function UpdateCheckoutTaxIDRequestBodyToJSON(json) {
7897
8273
  return UpdateCheckoutTaxIDRequestBodyToJSONTyped(json, false);
@@ -8022,6 +8398,51 @@ var CheckoutexternalApi = class extends BaseAPI {
8022
8398
  const response = await this.checkoutUnsubscribeRaw(initOverrides);
8023
8399
  return await response.value();
8024
8400
  }
8401
+ /**
8402
+ * Create checkout
8403
+ */
8404
+ async createCheckoutRaw(requestParameters, initOverrides) {
8405
+ if (requestParameters["createCheckoutRequest"] == null) {
8406
+ throw new RequiredError(
8407
+ "createCheckoutRequest",
8408
+ 'Required parameter "createCheckoutRequest" was null or undefined when calling createCheckout().'
8409
+ );
8410
+ }
8411
+ const queryParameters = {};
8412
+ const headerParameters = {};
8413
+ headerParameters["Content-Type"] = "application/json";
8414
+ if (this.configuration && this.configuration.apiKey) {
8415
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
8416
+ "X-Schematic-Api-Key"
8417
+ );
8418
+ }
8419
+ const response = await this.request(
8420
+ {
8421
+ path: `/checkouts`,
8422
+ method: "POST",
8423
+ headers: headerParameters,
8424
+ query: queryParameters,
8425
+ body: CreateCheckoutRequestToJSON(
8426
+ requestParameters["createCheckoutRequest"]
8427
+ )
8428
+ },
8429
+ initOverrides
8430
+ );
8431
+ return new JSONApiResponse(
8432
+ response,
8433
+ (jsonValue) => CreateCheckoutResponseFromJSON(jsonValue)
8434
+ );
8435
+ }
8436
+ /**
8437
+ * Create checkout
8438
+ */
8439
+ async createCheckout(requestParameters, initOverrides) {
8440
+ const response = await this.createCheckoutRaw(
8441
+ requestParameters,
8442
+ initOverrides
8443
+ );
8444
+ return await response.value();
8445
+ }
8025
8446
  /**
8026
8447
  * Create setup intent
8027
8448
  */
@@ -8130,6 +8551,104 @@ var CheckoutexternalApi = class extends BaseAPI {
8130
8551
  const response = await this.fetchCustomerBalanceRaw(initOverrides);
8131
8552
  return await response.value();
8132
8553
  }
8554
+ /**
8555
+ * Finalize checkout
8556
+ */
8557
+ async finalizeCheckoutRaw(requestParameters, initOverrides) {
8558
+ if (requestParameters["checkoutId"] == null) {
8559
+ throw new RequiredError(
8560
+ "checkoutId",
8561
+ 'Required parameter "checkoutId" was null or undefined when calling finalizeCheckout().'
8562
+ );
8563
+ }
8564
+ if (requestParameters["finalizeCheckoutRequest"] == null) {
8565
+ throw new RequiredError(
8566
+ "finalizeCheckoutRequest",
8567
+ 'Required parameter "finalizeCheckoutRequest" was null or undefined when calling finalizeCheckout().'
8568
+ );
8569
+ }
8570
+ const queryParameters = {};
8571
+ const headerParameters = {};
8572
+ headerParameters["Content-Type"] = "application/json";
8573
+ if (this.configuration && this.configuration.apiKey) {
8574
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
8575
+ "X-Schematic-Api-Key"
8576
+ );
8577
+ }
8578
+ const response = await this.request(
8579
+ {
8580
+ path: `/checkouts/{checkout_id}/finalize`.replace(
8581
+ `{${"checkout_id"}}`,
8582
+ encodeURIComponent(String(requestParameters["checkoutId"]))
8583
+ ),
8584
+ method: "POST",
8585
+ headers: headerParameters,
8586
+ query: queryParameters,
8587
+ body: FinalizeCheckoutRequestToJSON(
8588
+ requestParameters["finalizeCheckoutRequest"]
8589
+ )
8590
+ },
8591
+ initOverrides
8592
+ );
8593
+ return new JSONApiResponse(
8594
+ response,
8595
+ (jsonValue) => FinalizeCheckoutResponseFromJSON(jsonValue)
8596
+ );
8597
+ }
8598
+ /**
8599
+ * Finalize checkout
8600
+ */
8601
+ async finalizeCheckout(requestParameters, initOverrides) {
8602
+ const response = await this.finalizeCheckoutRaw(
8603
+ requestParameters,
8604
+ initOverrides
8605
+ );
8606
+ return await response.value();
8607
+ }
8608
+ /**
8609
+ * Get checkout
8610
+ */
8611
+ async getCheckoutRaw(requestParameters, initOverrides) {
8612
+ if (requestParameters["checkoutId"] == null) {
8613
+ throw new RequiredError(
8614
+ "checkoutId",
8615
+ 'Required parameter "checkoutId" was null or undefined when calling getCheckout().'
8616
+ );
8617
+ }
8618
+ const queryParameters = {};
8619
+ const headerParameters = {};
8620
+ if (this.configuration && this.configuration.apiKey) {
8621
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
8622
+ "X-Schematic-Api-Key"
8623
+ );
8624
+ }
8625
+ const response = await this.request(
8626
+ {
8627
+ path: `/checkouts/{checkout_id}`.replace(
8628
+ `{${"checkout_id"}}`,
8629
+ encodeURIComponent(String(requestParameters["checkoutId"]))
8630
+ ),
8631
+ method: "GET",
8632
+ headers: headerParameters,
8633
+ query: queryParameters
8634
+ },
8635
+ initOverrides
8636
+ );
8637
+ return new JSONApiResponse(
8638
+ response,
8639
+ (jsonValue) => GetCheckoutResponseFromJSON(jsonValue)
8640
+ );
8641
+ }
8642
+ /**
8643
+ * Get checkout
8644
+ */
8645
+ async getCheckout(requestParameters, initOverrides) {
8646
+ const response = await this.getCheckoutRaw(
8647
+ requestParameters,
8648
+ initOverrides
8649
+ );
8650
+ return await response.value();
8651
+ }
8133
8652
  /**
8134
8653
  * Get checkout tax ID
8135
8654
  */
@@ -8438,6 +8957,9 @@ var CheckoutexternalApi = class extends BaseAPI {
8438
8957
  if (requestParameters["catalogId"] != null) {
8439
8958
  queryParameters["catalog_id"] = requestParameters["catalogId"];
8440
8959
  }
8960
+ if (requestParameters["includeAddOnIds"] != null) {
8961
+ queryParameters["include_add_on_ids"] = requestParameters["includeAddOnIds"];
8962
+ }
8441
8963
  const headerParameters = {};
8442
8964
  if (this.configuration && this.configuration.apiKey) {
8443
8965
  headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
@@ -8515,6 +9037,53 @@ var CheckoutexternalApi = class extends BaseAPI {
8515
9037
  );
8516
9038
  return await response.value();
8517
9039
  }
9040
+ /**
9041
+ * List checkouts
9042
+ */
9043
+ async listCheckoutsRaw(requestParameters, initOverrides) {
9044
+ const queryParameters = {};
9045
+ if (requestParameters["companyId"] != null) {
9046
+ queryParameters["company_id"] = requestParameters["companyId"];
9047
+ }
9048
+ if (requestParameters["statuses"] != null) {
9049
+ queryParameters["statuses"] = requestParameters["statuses"];
9050
+ }
9051
+ if (requestParameters["limit"] != null) {
9052
+ queryParameters["limit"] = requestParameters["limit"];
9053
+ }
9054
+ if (requestParameters["offset"] != null) {
9055
+ queryParameters["offset"] = requestParameters["offset"];
9056
+ }
9057
+ const headerParameters = {};
9058
+ if (this.configuration && this.configuration.apiKey) {
9059
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
9060
+ "X-Schematic-Api-Key"
9061
+ );
9062
+ }
9063
+ const response = await this.request(
9064
+ {
9065
+ path: `/checkouts`,
9066
+ method: "GET",
9067
+ headers: headerParameters,
9068
+ query: queryParameters
9069
+ },
9070
+ initOverrides
9071
+ );
9072
+ return new JSONApiResponse(
9073
+ response,
9074
+ (jsonValue) => ListCheckoutsResponseFromJSON(jsonValue)
9075
+ );
9076
+ }
9077
+ /**
9078
+ * List checkouts
9079
+ */
9080
+ async listCheckouts(requestParameters = {}, initOverrides) {
9081
+ const response = await this.listCheckoutsRaw(
9082
+ requestParameters,
9083
+ initOverrides
9084
+ );
9085
+ return await response.value();
9086
+ }
8518
9087
  /**
8519
9088
  * List invoices
8520
9089
  */
@@ -8601,6 +9170,60 @@ var CheckoutexternalApi = class extends BaseAPI {
8601
9170
  );
8602
9171
  return await response.value();
8603
9172
  }
9173
+ /**
9174
+ * Update checkout
9175
+ */
9176
+ async updateCheckoutRaw(requestParameters, initOverrides) {
9177
+ if (requestParameters["checkoutId"] == null) {
9178
+ throw new RequiredError(
9179
+ "checkoutId",
9180
+ 'Required parameter "checkoutId" was null or undefined when calling updateCheckout().'
9181
+ );
9182
+ }
9183
+ if (requestParameters["updateCheckoutRequest"] == null) {
9184
+ throw new RequiredError(
9185
+ "updateCheckoutRequest",
9186
+ 'Required parameter "updateCheckoutRequest" was null or undefined when calling updateCheckout().'
9187
+ );
9188
+ }
9189
+ const queryParameters = {};
9190
+ const headerParameters = {};
9191
+ headerParameters["Content-Type"] = "application/json";
9192
+ if (this.configuration && this.configuration.apiKey) {
9193
+ headerParameters["X-Schematic-Api-Key"] = await this.configuration.apiKey(
9194
+ "X-Schematic-Api-Key"
9195
+ );
9196
+ }
9197
+ const response = await this.request(
9198
+ {
9199
+ path: `/checkouts/{checkout_id}`.replace(
9200
+ `{${"checkout_id"}}`,
9201
+ encodeURIComponent(String(requestParameters["checkoutId"]))
9202
+ ),
9203
+ method: "PUT",
9204
+ headers: headerParameters,
9205
+ query: queryParameters,
9206
+ body: UpdateCheckoutRequestToJSON(
9207
+ requestParameters["updateCheckoutRequest"]
9208
+ )
9209
+ },
9210
+ initOverrides
9211
+ );
9212
+ return new JSONApiResponse(
9213
+ response,
9214
+ (jsonValue) => UpdateCheckoutResponseFromJSON(jsonValue)
9215
+ );
9216
+ }
9217
+ /**
9218
+ * Update checkout
9219
+ */
9220
+ async updateCheckout(requestParameters, initOverrides) {
9221
+ const response = await this.updateCheckoutRaw(
9222
+ requestParameters,
9223
+ initOverrides
9224
+ );
9225
+ return await response.value();
9226
+ }
8604
9227
  /**
8605
9228
  * Update checkout field values
8606
9229
  */
@@ -13374,6 +13997,12 @@ function getSubscriptionPeriod(billingSubscription) {
13374
13997
  );
13375
13998
  return derivePeriod(product?.interval, product?.intervalCount) ?? derivePeriod(billingSubscription.interval);
13376
13999
  }
14000
+ function getDefaultPlanPeriod(plans = []) {
14001
+ if (plans.some((plan) => plan.monthlyPrice)) return "month";
14002
+ if (plans.some((plan) => plan.quarterlyPrice)) return "quarter";
14003
+ if (plans.some((plan) => plan.yearlyPrice)) return "year";
14004
+ return "month";
14005
+ }
13377
14006
  var ChargeType = {
13378
14007
  oneTime: "one_time",
13379
14008
  recurring: "recurring",
@@ -15242,7 +15871,7 @@ var reducer = (state, action) => {
15242
15871
  // src/context/EmbedProvider.tsx
15243
15872
  var import_jsx_runtime4 = require("react/jsx-runtime");
15244
15873
  var getCustomHeaders = (sessionId) => ({
15245
- "X-Schematic-Components-Version": "2.26.0",
15874
+ "X-Schematic-Components-Version": "2.28.0",
15246
15875
  "X-Schematic-Session-ID": sessionId
15247
15876
  });
15248
15877
  var normalizeCurrencyFilter = (filter) => {
@@ -15440,6 +16069,34 @@ var EmbedProvider = ({
15440
16069
  ),
15441
16070
  [hydrateExternal]
15442
16071
  );
16072
+ const rehydrateWithParams = (0, import_react4.useCallback)(
16073
+ async (params) => {
16074
+ const componentId = state.data?.component?.id;
16075
+ if (!componentId || !checkoutApi) {
16076
+ throw new Error(
16077
+ "[Schematic] `rehydrateWithParams` needs a `SchematicEmbed` that has loaded."
16078
+ );
16079
+ }
16080
+ const response = await checkoutApi.hydrateComponent({
16081
+ componentId,
16082
+ includeAddOnIds: params.includeAddOnIds
16083
+ });
16084
+ const returnedIds = new Set(
16085
+ response.data.activeAddOns.map((addOn) => addOn.id)
16086
+ );
16087
+ const missingIds = (params.includeAddOnIds ?? []).filter(
16088
+ (id) => !returnedIds.has(id)
16089
+ );
16090
+ if (missingIds.length > 0) {
16091
+ console.warn(
16092
+ `[Schematic] These included add-ons were left out because each must be an add-on with a billing product: ${missingIds.join(", ")}`
16093
+ );
16094
+ }
16095
+ dispatch({ type: "HYDRATE_COMPONENT", data: response.data });
16096
+ return response.data;
16097
+ },
16098
+ [checkoutApi, state.data?.component?.id]
16099
+ );
15443
16100
  const createSetupIntent = (0, import_react4.useCallback)(async () => {
15444
16101
  return checkoutApi?.createSetupIntent();
15445
16102
  }, [checkoutApi]);
@@ -15783,6 +16440,7 @@ var EmbedProvider = ({
15783
16440
  hydrate: debouncedHydrate,
15784
16441
  hydrateComponent: debouncedHydrateComponent,
15785
16442
  hydrateExternal: debouncedHydrateExternal,
16443
+ rehydrateWithParams,
15786
16444
  createSetupIntent: debouncedCreateSetupIntent,
15787
16445
  updatePaymentMethod: debouncedUpdatePaymentMethod,
15788
16446
  deletePaymentMethod: debouncedDeletePaymentMethod,
@@ -19570,7 +20228,7 @@ var CheckoutDialog = ({ top }) => {
19570
20228
  [data?.featureUsage?.features]
19571
20229
  );
19572
20230
  const getValidatedPeriod = () => {
19573
- const requestedPeriod = checkoutState?.period || getSubscriptionPeriod(data?.company?.billingSubscription) || data?.company?.plan?.planPeriod || "month";
20231
+ const requestedPeriod = checkoutState?.period || getSubscriptionPeriod(data?.company?.billingSubscription) || data?.company?.plan?.planPeriod || getDefaultPlanPeriod(data?.activePlans);
19574
20232
  if (checkoutState?.planId) {
19575
20233
  const requestedPlan = data?.activePlans?.find(
19576
20234
  (plan) => plan.id === checkoutState.planId
@@ -25989,7 +26647,7 @@ PaymentMethod.displayName = "PaymentMethod";
25989
26647
  // src/components/elements/payment-method/PaymentMethodDetails.tsx
25990
26648
  var import_react_stripe_js2 = require("@stripe/react-stripe-js");
25991
26649
 
25992
- // node_modules/.pnpm/@stripe+stripe-js@9.16.0/node_modules/@stripe/stripe-js/dist/index.mjs
26650
+ // node_modules/.pnpm/@stripe+stripe-js@9.17.0/node_modules/@stripe/stripe-js/dist/index.mjs
25993
26651
  function _typeof(obj) {
25994
26652
  "@babel/helpers - typeof";
25995
26653
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
@@ -26043,7 +26701,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
26043
26701
  }
26044
26702
  stripe._registerWrapper({
26045
26703
  name: "stripe-js",
26046
- version: "9.16.0",
26704
+ version: "9.17.0",
26047
26705
  startTime
26048
26706
  });
26049
26707
  };
@@ -26121,7 +26779,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
26121
26779
  var version = runtimeVersionToUrlVersion(maybeStripe.version);
26122
26780
  var expectedVersion = RELEASE_TRAIN;
26123
26781
  if (isTestKey && version !== expectedVersion) {
26124
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.16.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
26782
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.17.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
26125
26783
  }
26126
26784
  var stripe = maybeStripe.apply(void 0, args);
26127
26785
  registerWrapper(stripe, startTime);
@@ -28367,7 +29025,7 @@ var PricingTable = (0, import_react53.forwardRef)(({ className, ...rest }, ref)
28367
29025
  []
28368
29026
  );
28369
29027
  const [selectedPeriod, setSelectedPeriod] = (0, import_react53.useState)(
28370
- () => getSubscriptionPeriod(data?.company?.billingSubscription) || data?.company?.plan?.planPeriod || "month"
29028
+ () => getSubscriptionPeriod(data?.company?.billingSubscription) || data?.company?.plan?.planPeriod || getDefaultPlanPeriod(data?.activePlans)
28371
29029
  );
28372
29030
  const { currencies, invalidFilterEntries } = useAvailableCurrenciesWithInvalid();
28373
29031
  const [selectedCurrency, setSelectedCurrency] = (0, import_react53.useState)(