@schematichq/schematic-components 2.34.1 → 2.36.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.
@@ -3526,6 +3526,18 @@ declare const CheckoutBundlePurchaseBehavior: {
3526
3526
 
3527
3527
  declare type CheckoutBundlePurchaseBehavior = (typeof CheckoutBundlePurchaseBehavior)[keyof typeof CheckoutBundlePurchaseBehavior];
3528
3528
 
3529
+ /**
3530
+ *
3531
+ * @export
3532
+ */
3533
+ declare const CheckoutChargeTiming: {
3534
+ readonly AtRenewal: "at_renewal";
3535
+ readonly None: "none";
3536
+ readonly Now: "now";
3537
+ };
3538
+
3539
+ declare type CheckoutChargeTiming = (typeof CheckoutChargeTiming)[keyof typeof CheckoutChargeTiming];
3540
+
3529
3541
  export declare const CheckoutDialog: ({ top }: CheckoutDialogProps) => JSX.Element | null;
3530
3542
 
3531
3543
  declare interface CheckoutDialogProps {
@@ -13510,6 +13522,18 @@ declare interface PreviewSubscriptionFinanceResponseData {
13510
13522
  * @memberof PreviewSubscriptionFinanceResponseData
13511
13523
  */
13512
13524
  currency: Currency;
13525
+ /**
13526
+ * What the company's stored credit covers of this invoice, in minor units.
13527
+ * @type {number}
13528
+ * @memberof PreviewSubscriptionFinanceResponseData
13529
+ */
13530
+ customerBalanceApplied: number;
13531
+ /**
13532
+ * Credit left on the company's balance after this invoice, in minor units: what it did not consume, plus what a total below zero adds, which the provider applies to later invoices.
13533
+ * @type {number}
13534
+ * @memberof PreviewSubscriptionFinanceResponseData
13535
+ */
13536
+ customerBalanceRemaining: number;
13513
13537
  /**
13514
13538
  *
13515
13539
  * @type {number}
@@ -13570,6 +13594,12 @@ declare interface PreviewSubscriptionFinanceResponseData {
13570
13594
  * @memberof PreviewSubscriptionFinanceResponseData
13571
13595
  */
13572
13596
  prorationBilledAt?: Date | null;
13597
+ /**
13598
+ * The proration itemized in the cart's terms, by plan and price. Null when the change prorates nothing. upcoming_invoice_line_items stays as the billing provider reported it.
13599
+ * @type {PreviewSubscriptionProrationResponseData}
13600
+ * @memberof PreviewSubscriptionFinanceResponseData
13601
+ */
13602
+ prorationDetail?: PreviewSubscriptionProrationResponseData;
13573
13603
  /**
13574
13604
  *
13575
13605
  * @type {number}
@@ -13608,6 +13638,106 @@ declare interface PreviewSubscriptionFinanceResponseData {
13608
13638
  upcomingInvoiceLineItems: Array<PreviewSubscriptionUpcomingInvoiceLineItems>;
13609
13639
  }
13610
13640
 
13641
+ /**
13642
+ *
13643
+ * @export
13644
+ * @interface PreviewSubscriptionProrationLineResponseData
13645
+ */
13646
+ declare interface PreviewSubscriptionProrationLineResponseData {
13647
+ /**
13648
+ * In minor units of the block's currency; negative on a credit.
13649
+ * @type {number}
13650
+ * @memberof PreviewSubscriptionProrationLineResponseData
13651
+ */
13652
+ amount: number;
13653
+ /**
13654
+ *
13655
+ * @type {ProrationLineKind}
13656
+ * @memberof PreviewSubscriptionProrationLineResponseData
13657
+ */
13658
+ kind: ProrationLineKind;
13659
+ /**
13660
+ *
13661
+ * @type {Date}
13662
+ * @memberof PreviewSubscriptionProrationLineResponseData
13663
+ */
13664
+ periodEnd?: Date | null;
13665
+ /**
13666
+ *
13667
+ * @type {Date}
13668
+ * @memberof PreviewSubscriptionProrationLineResponseData
13669
+ */
13670
+ periodStart?: Date | null;
13671
+ /**
13672
+ * The plan or add-on in the cart the price belongs to. Null for a price the subscription carries outside the cart.
13673
+ * @type {string}
13674
+ * @memberof PreviewSubscriptionProrationLineResponseData
13675
+ */
13676
+ planId?: string | null;
13677
+ /**
13678
+ * The Schematic price. Null when the provider priced something Schematic does not carry.
13679
+ * @type {string}
13680
+ * @memberof PreviewSubscriptionProrationLineResponseData
13681
+ */
13682
+ priceId?: string | null;
13683
+ /**
13684
+ *
13685
+ * @type {number}
13686
+ * @memberof PreviewSubscriptionProrationLineResponseData
13687
+ */
13688
+ quantity?: number | null;
13689
+ }
13690
+
13691
+ /**
13692
+ *
13693
+ * @export
13694
+ * @interface PreviewSubscriptionProrationResponseData
13695
+ */
13696
+ declare interface PreviewSubscriptionProrationResponseData {
13697
+ /**
13698
+ * When the proration is charged: the change for now, the period's end for at_renewal. Null when nothing is charged.
13699
+ * @type {Date}
13700
+ * @memberof PreviewSubscriptionProrationResponseData
13701
+ */
13702
+ billedAt?: Date | null;
13703
+ /**
13704
+ * Sum of the charge lines, in minor units, before tax.
13705
+ * @type {number}
13706
+ * @memberof PreviewSubscriptionProrationResponseData
13707
+ */
13708
+ charge: number;
13709
+ /**
13710
+ * Sum of the credit lines, in minor units, before tax: zero or below.
13711
+ * @type {number}
13712
+ * @memberof PreviewSubscriptionProrationResponseData
13713
+ */
13714
+ credit: number;
13715
+ /**
13716
+ *
13717
+ * @type {Currency}
13718
+ * @memberof PreviewSubscriptionProrationResponseData
13719
+ */
13720
+ currency: Currency;
13721
+ /**
13722
+ *
13723
+ * @type {Array<PreviewSubscriptionProrationLineResponseData>}
13724
+ * @memberof PreviewSubscriptionProrationResponseData
13725
+ */
13726
+ lines: Array<PreviewSubscriptionProrationLineResponseData>;
13727
+ /**
13728
+ * When the proration is charged: now, at_renewal, or none when it nets to nothing.
13729
+ * @type {CheckoutChargeTiming}
13730
+ * @memberof PreviewSubscriptionProrationResponseData
13731
+ */
13732
+ timing: CheckoutChargeTiming;
13733
+ /**
13734
+ * credit plus charge, before tax. Equals proration.
13735
+ * @type {number}
13736
+ * @memberof PreviewSubscriptionProrationResponseData
13737
+ */
13738
+ total: number;
13739
+ }
13740
+
13611
13741
  /**
13612
13742
  * Schematic API
13613
13743
  * Schematic API
@@ -13692,6 +13822,17 @@ declare const ProrationBehavior: {
13692
13822
 
13693
13823
  declare type ProrationBehavior = (typeof ProrationBehavior)[keyof typeof ProrationBehavior];
13694
13824
 
13825
+ /**
13826
+ *
13827
+ * @export
13828
+ */
13829
+ declare const ProrationLineKind: {
13830
+ readonly Charge: "charge";
13831
+ readonly Credit: "credit";
13832
+ };
13833
+
13834
+ declare type ProrationLineKind = (typeof ProrationLineKind)[keyof typeof ProrationLineKind];
13835
+
13695
13836
  /**
13696
13837
  *
13697
13838
  * @export
@@ -5251,7 +5251,8 @@ function CatalogCreditGrantResponseDataFromJSONTyped(json, ignoreDiscriminator)
5251
5251
  id: json["id"],
5252
5252
  licenseId: json["license_id"] == null ? void 0 : json["license_id"],
5253
5253
  resetCadence: json["reset_cadence"] == null ? void 0 : BillingPlanCreditGrantResetCadenceFromJSON(json["reset_cadence"]),
5254
- scaling: PlanCreditGrantScalingFromJSON(json["scaling"])
5254
+ scaling: PlanCreditGrantScalingFromJSON(json["scaling"]),
5255
+ visible: json["visible"]
5255
5256
  };
5256
5257
  }
5257
5258
 
@@ -5525,6 +5526,14 @@ function ChangeSubscriptionRequestBodyToJSONTyped(value, ignoreDiscriminator = f
5525
5526
  };
5526
5527
  }
5527
5528
 
5529
+ // src/api/checkoutexternal/models/CheckoutChargeTiming.ts
5530
+ function CheckoutChargeTimingFromJSON(json) {
5531
+ return CheckoutChargeTimingFromJSONTyped(json, false);
5532
+ }
5533
+ function CheckoutChargeTimingFromJSONTyped(json, ignoreDiscriminator) {
5534
+ return json;
5535
+ }
5536
+
5528
5537
  // src/api/checkoutexternal/models/CheckoutPriceSnapshotDiscount.ts
5529
5538
  function CheckoutPriceSnapshotDiscountFromJSON(json) {
5530
5539
  return CheckoutPriceSnapshotDiscountFromJSONTyped(json, false);
@@ -5546,6 +5555,53 @@ function CheckoutPriceSnapshotDiscountFromJSONTyped(json, ignoreDiscriminator) {
5546
5555
  };
5547
5556
  }
5548
5557
 
5558
+ // src/api/checkoutexternal/models/ProrationLineKind.ts
5559
+ function ProrationLineKindFromJSON(json) {
5560
+ return ProrationLineKindFromJSONTyped(json, false);
5561
+ }
5562
+ function ProrationLineKindFromJSONTyped(json, ignoreDiscriminator) {
5563
+ return json;
5564
+ }
5565
+
5566
+ // src/api/checkoutexternal/models/CheckoutPriceSnapshotProrationLine.ts
5567
+ function CheckoutPriceSnapshotProrationLineFromJSON(json) {
5568
+ return CheckoutPriceSnapshotProrationLineFromJSONTyped(json, false);
5569
+ }
5570
+ function CheckoutPriceSnapshotProrationLineFromJSONTyped(json, ignoreDiscriminator) {
5571
+ if (json == null) {
5572
+ return json;
5573
+ }
5574
+ return {
5575
+ amount: json["amount"],
5576
+ kind: ProrationLineKindFromJSON(json["kind"]),
5577
+ periodEnd: json["period_end"] == null ? void 0 : new Date(json["period_end"]),
5578
+ periodStart: json["period_start"] == null ? void 0 : new Date(json["period_start"]),
5579
+ planId: json["plan_id"] == null ? void 0 : json["plan_id"],
5580
+ priceId: json["price_id"] == null ? void 0 : json["price_id"],
5581
+ quantity: json["quantity"] == null ? void 0 : json["quantity"]
5582
+ };
5583
+ }
5584
+
5585
+ // src/api/checkoutexternal/models/CheckoutPriceSnapshotProration.ts
5586
+ function CheckoutPriceSnapshotProrationFromJSON(json) {
5587
+ return CheckoutPriceSnapshotProrationFromJSONTyped(json, false);
5588
+ }
5589
+ function CheckoutPriceSnapshotProrationFromJSONTyped(json, ignoreDiscriminator) {
5590
+ if (json == null) {
5591
+ return json;
5592
+ }
5593
+ return {
5594
+ billedAt: json["billed_at"] == null ? void 0 : new Date(json["billed_at"]),
5595
+ charge: json["charge"],
5596
+ credit: json["credit"],
5597
+ lines: json["lines"].map(
5598
+ CheckoutPriceSnapshotProrationLineFromJSON
5599
+ ),
5600
+ timing: CheckoutChargeTimingFromJSON(json["timing"]),
5601
+ total: json["total"]
5602
+ };
5603
+ }
5604
+
5549
5605
  // src/api/checkoutexternal/models/CheckoutPriceSnapshot.ts
5550
5606
  function CheckoutPriceSnapshotFromJSON(json) {
5551
5607
  return CheckoutPriceSnapshotFromJSONTyped(json, false);
@@ -5557,6 +5613,8 @@ function CheckoutPriceSnapshotFromJSONTyped(json, ignoreDiscriminator) {
5557
5613
  return {
5558
5614
  amountOff: json["amount_off"],
5559
5615
  currency: CurrencyFromJSON(json["currency"]),
5616
+ customerBalanceApplied: json["customer_balance_applied"],
5617
+ customerBalanceRemaining: json["customer_balance_remaining"],
5560
5618
  discountAmount: json["discount_amount"],
5561
5619
  discounts: json["discounts"].map(
5562
5620
  CheckoutPriceSnapshotDiscountFromJSON
@@ -5573,6 +5631,7 @@ function CheckoutPriceSnapshotFromJSONTyped(json, ignoreDiscriminator) {
5573
5631
  pricedAt: new Date(json["priced_at"]),
5574
5632
  promoCodeApplied: json["promo_code_applied"],
5575
5633
  proration: json["proration"],
5634
+ prorationDetail: json["proration_detail"] == null ? void 0 : CheckoutPriceSnapshotProrationFromJSON(json["proration_detail"]),
5576
5635
  scheduledChangeTime: json["scheduled_change_time"] == null ? void 0 : new Date(json["scheduled_change_time"]),
5577
5636
  taxAmount: json["tax_amount"] == null ? void 0 : json["tax_amount"],
5578
5637
  totalPerBillingPeriod: json["total_per_billing_period"],
@@ -8845,6 +8904,46 @@ function PreviewSubscriptionDiscountResponseDataFromJSONTyped(json, ignoreDiscri
8845
8904
  };
8846
8905
  }
8847
8906
 
8907
+ // src/api/checkoutexternal/models/PreviewSubscriptionProrationLineResponseData.ts
8908
+ function PreviewSubscriptionProrationLineResponseDataFromJSON(json) {
8909
+ return PreviewSubscriptionProrationLineResponseDataFromJSONTyped(json, false);
8910
+ }
8911
+ function PreviewSubscriptionProrationLineResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8912
+ if (json == null) {
8913
+ return json;
8914
+ }
8915
+ return {
8916
+ amount: json["amount"],
8917
+ kind: ProrationLineKindFromJSON(json["kind"]),
8918
+ periodEnd: json["period_end"] == null ? void 0 : new Date(json["period_end"]),
8919
+ periodStart: json["period_start"] == null ? void 0 : new Date(json["period_start"]),
8920
+ planId: json["plan_id"] == null ? void 0 : json["plan_id"],
8921
+ priceId: json["price_id"] == null ? void 0 : json["price_id"],
8922
+ quantity: json["quantity"] == null ? void 0 : json["quantity"]
8923
+ };
8924
+ }
8925
+
8926
+ // src/api/checkoutexternal/models/PreviewSubscriptionProrationResponseData.ts
8927
+ function PreviewSubscriptionProrationResponseDataFromJSON(json) {
8928
+ return PreviewSubscriptionProrationResponseDataFromJSONTyped(json, false);
8929
+ }
8930
+ function PreviewSubscriptionProrationResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8931
+ if (json == null) {
8932
+ return json;
8933
+ }
8934
+ return {
8935
+ billedAt: json["billed_at"] == null ? void 0 : new Date(json["billed_at"]),
8936
+ charge: json["charge"],
8937
+ credit: json["credit"],
8938
+ currency: CurrencyFromJSON(json["currency"]),
8939
+ lines: json["lines"].map(
8940
+ PreviewSubscriptionProrationLineResponseDataFromJSON
8941
+ ),
8942
+ timing: CheckoutChargeTimingFromJSON(json["timing"]),
8943
+ total: json["total"]
8944
+ };
8945
+ }
8946
+
8848
8947
  // src/api/checkoutexternal/models/PreviewSubscriptionFinanceResponseData.ts
8849
8948
  function PreviewSubscriptionFinanceResponseDataFromJSON(json) {
8850
8949
  return PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, false);
@@ -8856,6 +8955,8 @@ function PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, ignoreDiscrim
8856
8955
  return {
8857
8956
  amountOff: json["amount_off"],
8858
8957
  currency: CurrencyFromJSON(json["currency"]),
8958
+ customerBalanceApplied: json["customer_balance_applied"],
8959
+ customerBalanceRemaining: json["customer_balance_remaining"],
8859
8960
  discountAmount: json["discount_amount"],
8860
8961
  discounts: json["discounts"].map(
8861
8962
  PreviewSubscriptionDiscountResponseDataFromJSON
@@ -8868,6 +8969,9 @@ function PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, ignoreDiscrim
8868
8969
  promoCodeApplied: json["promo_code_applied"],
8869
8970
  proration: json["proration"],
8870
8971
  prorationBilledAt: json["proration_billed_at"] == null ? void 0 : new Date(json["proration_billed_at"]),
8972
+ prorationDetail: json["proration_detail"] == null ? void 0 : PreviewSubscriptionProrationResponseDataFromJSON(
8973
+ json["proration_detail"]
8974
+ ),
8871
8975
  taxAmount: json["tax_amount"] == null ? void 0 : json["tax_amount"],
8872
8976
  taxDisplayName: json["tax_display_name"] == null ? void 0 : json["tax_display_name"],
8873
8977
  taxRequireBillingDetails: json["tax_require_billing_details"],
@@ -10756,9 +10860,9 @@ function BillingCreditLedgerAuthorityFromJSONTyped4(json, ignoreDiscriminator) {
10756
10860
 
10757
10861
  // src/api/componentspublic/models/Currency.ts
10758
10862
  function CurrencyFromJSON2(json) {
10759
- return CurrencyFromJSONTyped40(json, false);
10863
+ return CurrencyFromJSONTyped41(json, false);
10760
10864
  }
10761
- function CurrencyFromJSONTyped40(json, ignoreDiscriminator) {
10865
+ function CurrencyFromJSONTyped41(json, ignoreDiscriminator) {
10762
10866
  return json;
10763
10867
  }
10764
10868
 
@@ -17430,7 +17534,7 @@ var reducer = (state, action) => {
17430
17534
  // src/context/EmbedProvider.tsx
17431
17535
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
17432
17536
  var getCustomHeaders = (sessionId) => ({
17433
- "X-Schematic-Components-Version": "2.34.1",
17537
+ "X-Schematic-Components-Version": "2.36.0",
17434
17538
  "X-Schematic-Session-ID": sessionId
17435
17539
  });
17436
17540
  var normalizeCurrencyFilter = (filter2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematichq/schematic-components",
3
- "version": "2.34.1",
3
+ "version": "2.36.0",
4
4
  "main": "dist/schematic-components.cjs.js",
5
5
  "module": "dist/schematic-components.esm.js",
6
6
  "types": "dist/schematic-components.d.ts",
@@ -83,8 +83,8 @@
83
83
  "@eslint/markdown": "^8.0.3",
84
84
  "@microsoft/api-extractor": "^7.59.4",
85
85
  "@openapitools/openapi-generator-cli": "^2.41.0",
86
- "@schematichq/schematic-js": "^1.14.0",
87
- "@schematichq/schematic-react": "^1.14.0",
86
+ "@schematichq/schematic-js": "^1.16.0",
87
+ "@schematichq/schematic-react": "^1.16.0",
88
88
  "@stripe/react-stripe-js": "^6.12.0",
89
89
  "@swc/core": "^1.16.13",
90
90
  "@testing-library/dom": "^10.4.2",
@@ -93,7 +93,7 @@
93
93
  "@types/lodash": "^4.17.26",
94
94
  "@types/react": "^19.3.0",
95
95
  "@types/react-dom": "^19.3.0",
96
- "@vitest/browser": "^5.0.3",
96
+ "@vitest/browser": "^5.0.5",
97
97
  "csstype": "^3.2.3",
98
98
  "esbuild": "^0.28.2",
99
99
  "eslint": "^10.12.0",
@@ -110,10 +110,10 @@
110
110
  "react-dom": "^19.3.0",
111
111
  "typescript": "^6.0.3",
112
112
  "typescript-eslint": "^8.71.1",
113
- "vitest": "^5.0.3"
113
+ "vitest": "^5.0.5"
114
114
  },
115
115
  "peerDependencies": {
116
- "@schematichq/schematic-react": "^1.14.0",
116
+ "@schematichq/schematic-react": "^1.16.0",
117
117
  "@stripe/react-stripe-js": ">=3",
118
118
  "@stripe/stripe-js": ">=4",
119
119
  "react": ">=18",