@polar-sh/sdk 0.45.2 → 0.46.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.
Files changed (95) hide show
  1. package/dist/commonjs/lib/config.d.ts +3 -3
  2. package/dist/commonjs/lib/config.js +3 -3
  3. package/dist/commonjs/lib/config.js.map +1 -1
  4. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  5. package/dist/commonjs/lib/matchers.js +0 -1
  6. package/dist/commonjs/lib/matchers.js.map +1 -1
  7. package/dist/commonjs/lib/security.d.ts.map +1 -1
  8. package/dist/commonjs/lib/security.js +1 -2
  9. package/dist/commonjs/lib/security.js.map +1 -1
  10. package/dist/commonjs/models/components/checkout.d.ts +23 -0
  11. package/dist/commonjs/models/components/checkout.d.ts.map +1 -1
  12. package/dist/commonjs/models/components/checkout.js +33 -1
  13. package/dist/commonjs/models/components/checkout.js.map +1 -1
  14. package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts +7 -0
  15. package/dist/commonjs/models/components/checkoutconfirmstripe.d.ts.map +1 -1
  16. package/dist/commonjs/models/components/checkoutconfirmstripe.js +2 -0
  17. package/dist/commonjs/models/components/checkoutconfirmstripe.js.map +1 -1
  18. package/dist/commonjs/models/components/checkoutpublic.d.ts +16 -0
  19. package/dist/commonjs/models/components/checkoutpublic.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/checkoutpublic.js +17 -1
  21. package/dist/commonjs/models/components/checkoutpublic.js.map +1 -1
  22. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts +17 -1
  23. package/dist/commonjs/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/checkoutpublicconfirmed.js +18 -2
  25. package/dist/commonjs/models/components/checkoutpublicconfirmed.js.map +1 -1
  26. package/dist/commonjs/models/components/checkoutupdate.d.ts +7 -0
  27. package/dist/commonjs/models/components/checkoutupdate.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/checkoutupdate.js +2 -0
  29. package/dist/commonjs/models/components/checkoutupdate.js.map +1 -1
  30. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts +7 -0
  31. package/dist/commonjs/models/components/checkoutupdatepublic.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/checkoutupdatepublic.js +2 -0
  33. package/dist/commonjs/models/components/checkoutupdatepublic.js.map +1 -1
  34. package/dist/commonjs/models/components/organizationfeaturesettings.d.ts +5 -0
  35. package/dist/commonjs/models/components/organizationfeaturesettings.d.ts.map +1 -1
  36. package/dist/commonjs/models/components/organizationfeaturesettings.js +4 -0
  37. package/dist/commonjs/models/components/organizationfeaturesettings.js.map +1 -1
  38. package/dist/commonjs/models/components/taxidformat.d.ts +1 -0
  39. package/dist/commonjs/models/components/taxidformat.d.ts.map +1 -1
  40. package/dist/commonjs/models/components/taxidformat.js +1 -0
  41. package/dist/commonjs/models/components/taxidformat.js.map +1 -1
  42. package/dist/esm/lib/config.d.ts +3 -3
  43. package/dist/esm/lib/config.js +3 -3
  44. package/dist/esm/lib/config.js.map +1 -1
  45. package/dist/esm/lib/matchers.d.ts.map +1 -1
  46. package/dist/esm/lib/matchers.js +0 -1
  47. package/dist/esm/lib/matchers.js.map +1 -1
  48. package/dist/esm/lib/security.d.ts.map +1 -1
  49. package/dist/esm/lib/security.js +1 -2
  50. package/dist/esm/lib/security.js.map +1 -1
  51. package/dist/esm/models/components/checkout.d.ts +23 -0
  52. package/dist/esm/models/components/checkout.d.ts.map +1 -1
  53. package/dist/esm/models/components/checkout.js +30 -0
  54. package/dist/esm/models/components/checkout.js.map +1 -1
  55. package/dist/esm/models/components/checkoutconfirmstripe.d.ts +7 -0
  56. package/dist/esm/models/components/checkoutconfirmstripe.d.ts.map +1 -1
  57. package/dist/esm/models/components/checkoutconfirmstripe.js +2 -0
  58. package/dist/esm/models/components/checkoutconfirmstripe.js.map +1 -1
  59. package/dist/esm/models/components/checkoutpublic.d.ts +16 -0
  60. package/dist/esm/models/components/checkoutpublic.d.ts.map +1 -1
  61. package/dist/esm/models/components/checkoutpublic.js +15 -0
  62. package/dist/esm/models/components/checkoutpublic.js.map +1 -1
  63. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts +17 -1
  64. package/dist/esm/models/components/checkoutpublicconfirmed.d.ts.map +1 -1
  65. package/dist/esm/models/components/checkoutpublicconfirmed.js +16 -1
  66. package/dist/esm/models/components/checkoutpublicconfirmed.js.map +1 -1
  67. package/dist/esm/models/components/checkoutupdate.d.ts +7 -0
  68. package/dist/esm/models/components/checkoutupdate.d.ts.map +1 -1
  69. package/dist/esm/models/components/checkoutupdate.js +2 -0
  70. package/dist/esm/models/components/checkoutupdate.js.map +1 -1
  71. package/dist/esm/models/components/checkoutupdatepublic.d.ts +7 -0
  72. package/dist/esm/models/components/checkoutupdatepublic.d.ts.map +1 -1
  73. package/dist/esm/models/components/checkoutupdatepublic.js +2 -0
  74. package/dist/esm/models/components/checkoutupdatepublic.js.map +1 -1
  75. package/dist/esm/models/components/organizationfeaturesettings.d.ts +5 -0
  76. package/dist/esm/models/components/organizationfeaturesettings.d.ts.map +1 -1
  77. package/dist/esm/models/components/organizationfeaturesettings.js +4 -0
  78. package/dist/esm/models/components/organizationfeaturesettings.js.map +1 -1
  79. package/dist/esm/models/components/taxidformat.d.ts +1 -0
  80. package/dist/esm/models/components/taxidformat.d.ts.map +1 -1
  81. package/dist/esm/models/components/taxidformat.js +1 -0
  82. package/dist/esm/models/components/taxidformat.js.map +1 -1
  83. package/jsr.json +1 -1
  84. package/package.json +2 -2
  85. package/src/lib/config.ts +3 -3
  86. package/src/lib/matchers.ts +3 -2
  87. package/src/lib/security.ts +1 -2
  88. package/src/models/components/checkout.ts +76 -0
  89. package/src/models/components/checkoutconfirmstripe.ts +9 -0
  90. package/src/models/components/checkoutpublic.ts +44 -0
  91. package/src/models/components/checkoutpublicconfirmed.ts +47 -2
  92. package/src/models/components/checkoutupdate.ts +9 -0
  93. package/src/models/components/checkoutupdatepublic.ts +9 -0
  94. package/src/models/components/organizationfeaturesettings.ts +9 -0
  95. package/src/models/components/taxidformat.ts +1 -0
@@ -92,6 +92,8 @@ import {
92
92
 
93
93
  export type CheckoutCustomFieldData = string | number | boolean | Date;
94
94
 
95
+ export type CheckoutProductPrice = LegacyRecurringProductPrice | ProductPrice;
96
+
95
97
  export type CheckoutPrices = LegacyRecurringProductPrice | ProductPrice;
96
98
 
97
99
  export type CheckoutDiscount =
@@ -214,6 +216,12 @@ export type Checkout = {
214
216
  * ID of the product to checkout.
215
217
  */
216
218
  productId: string | null;
219
+ /**
220
+ * ID of the product price to checkout.
221
+ *
222
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
223
+ */
224
+ productPriceId: string | null;
217
225
  /**
218
226
  * ID of the discount applied to the checkout.
219
227
  */
@@ -287,6 +295,12 @@ export type Checkout = {
287
295
  * Product selected to checkout.
288
296
  */
289
297
  product: CheckoutProduct | null;
298
+ /**
299
+ * Price of the selected product.
300
+ *
301
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
302
+ */
303
+ productPrice: LegacyRecurringProductPrice | ProductPrice | null;
290
304
  /**
291
305
  * Mapping of product IDs to their list of prices.
292
306
  */
@@ -349,6 +363,45 @@ export function checkoutCustomFieldDataFromJSON(
349
363
  );
350
364
  }
351
365
 
366
+ /** @internal */
367
+ export const CheckoutProductPrice$inboundSchema: z.ZodMiniType<
368
+ CheckoutProductPrice,
369
+ unknown
370
+ > = smartUnion([
371
+ LegacyRecurringProductPrice$inboundSchema,
372
+ ProductPrice$inboundSchema,
373
+ ]);
374
+ /** @internal */
375
+ export type CheckoutProductPrice$Outbound =
376
+ | LegacyRecurringProductPrice$Outbound
377
+ | ProductPrice$Outbound;
378
+
379
+ /** @internal */
380
+ export const CheckoutProductPrice$outboundSchema: z.ZodMiniType<
381
+ CheckoutProductPrice$Outbound,
382
+ CheckoutProductPrice
383
+ > = smartUnion([
384
+ LegacyRecurringProductPrice$outboundSchema,
385
+ ProductPrice$outboundSchema,
386
+ ]);
387
+
388
+ export function checkoutProductPriceToJSON(
389
+ checkoutProductPrice: CheckoutProductPrice,
390
+ ): string {
391
+ return JSON.stringify(
392
+ CheckoutProductPrice$outboundSchema.parse(checkoutProductPrice),
393
+ );
394
+ }
395
+ export function checkoutProductPriceFromJSON(
396
+ jsonString: string,
397
+ ): SafeParseResult<CheckoutProductPrice, SDKValidationError> {
398
+ return safeParse(
399
+ jsonString,
400
+ (x) => CheckoutProductPrice$inboundSchema.parse(JSON.parse(x)),
401
+ `Failed to parse 'CheckoutProductPrice' from JSON`,
402
+ );
403
+ }
404
+
352
405
  /** @internal */
353
406
  export const CheckoutPrices$inboundSchema: z.ZodMiniType<
354
407
  CheckoutPrices,
@@ -516,6 +569,7 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
516
569
  ),
517
570
  organization_id: z.string(),
518
571
  product_id: z.nullable(z.string()),
572
+ product_price_id: z.nullable(z.string()),
519
573
  discount_id: z.nullable(z.string()),
520
574
  allow_discount_codes: z.boolean(),
521
575
  require_billing_address: z.boolean(),
@@ -541,6 +595,12 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
541
595
  external_customer_id: z.nullable(z.string()),
542
596
  products: z.array(CheckoutProduct$inboundSchema),
543
597
  product: z.nullable(CheckoutProduct$inboundSchema),
598
+ product_price: z.nullable(
599
+ smartUnion([
600
+ LegacyRecurringProductPrice$inboundSchema,
601
+ ProductPrice$inboundSchema,
602
+ ]),
603
+ ),
544
604
  prices: z.nullable(
545
605
  z.record(
546
606
  z.string(),
@@ -593,6 +653,7 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
593
653
  "trial_end": "trialEnd",
594
654
  "organization_id": "organizationId",
595
655
  "product_id": "productId",
656
+ "product_price_id": "productPriceId",
596
657
  "discount_id": "discountId",
597
658
  "allow_discount_codes": "allowDiscountCodes",
598
659
  "require_billing_address": "requireBillingAddress",
@@ -614,6 +675,7 @@ export const Checkout$inboundSchema: z.ZodMiniType<Checkout, unknown> = z.pipe(
614
675
  "trial_interval": "trialInterval",
615
676
  "trial_interval_count": "trialIntervalCount",
616
677
  "external_customer_id": "externalCustomerId",
678
+ "product_price": "productPrice",
617
679
  "subscription_id": "subscriptionId",
618
680
  "attached_custom_fields": "attachedCustomFields",
619
681
  "customer_metadata": "customerMetadata",
@@ -652,6 +714,7 @@ export type Checkout$Outbound = {
652
714
  trial_end: string | null;
653
715
  organization_id: string;
654
716
  product_id: string | null;
717
+ product_price_id: string | null;
655
718
  discount_id: string | null;
656
719
  allow_discount_codes: boolean;
657
720
  require_billing_address: boolean;
@@ -677,6 +740,10 @@ export type Checkout$Outbound = {
677
740
  external_customer_id: string | null;
678
741
  products: Array<CheckoutProduct$Outbound>;
679
742
  product: CheckoutProduct$Outbound | null;
743
+ product_price:
744
+ | LegacyRecurringProductPrice$Outbound
745
+ | ProductPrice$Outbound
746
+ | null;
680
747
  prices: {
681
748
  [k: string]: Array<
682
749
  LegacyRecurringProductPrice$Outbound | ProductPrice$Outbound
@@ -739,6 +806,7 @@ export const Checkout$outboundSchema: z.ZodMiniType<
739
806
  trialEnd: z.nullable(z.pipe(z.date(), z.transform(v => v.toISOString()))),
740
807
  organizationId: z.string(),
741
808
  productId: z.nullable(z.string()),
809
+ productPriceId: z.nullable(z.string()),
742
810
  discountId: z.nullable(z.string()),
743
811
  allowDiscountCodes: z.boolean(),
744
812
  requireBillingAddress: z.boolean(),
@@ -764,6 +832,12 @@ export const Checkout$outboundSchema: z.ZodMiniType<
764
832
  externalCustomerId: z.nullable(z.string()),
765
833
  products: z.array(CheckoutProduct$outboundSchema),
766
834
  product: z.nullable(CheckoutProduct$outboundSchema),
835
+ productPrice: z.nullable(
836
+ smartUnion([
837
+ LegacyRecurringProductPrice$outboundSchema,
838
+ ProductPrice$outboundSchema,
839
+ ]),
840
+ ),
767
841
  prices: z.nullable(
768
842
  z.record(
769
843
  z.string(),
@@ -816,6 +890,7 @@ export const Checkout$outboundSchema: z.ZodMiniType<
816
890
  trialEnd: "trial_end",
817
891
  organizationId: "organization_id",
818
892
  productId: "product_id",
893
+ productPriceId: "product_price_id",
819
894
  discountId: "discount_id",
820
895
  allowDiscountCodes: "allow_discount_codes",
821
896
  requireBillingAddress: "require_billing_address",
@@ -837,6 +912,7 @@ export const Checkout$outboundSchema: z.ZodMiniType<
837
912
  trialInterval: "trial_interval",
838
913
  trialIntervalCount: "trial_interval_count",
839
914
  externalCustomerId: "external_customer_id",
915
+ productPrice: "product_price",
840
916
  subscriptionId: "subscription_id",
841
917
  attachedCustomFields: "attached_custom_fields",
842
918
  customerMetadata: "customer_metadata",
@@ -31,6 +31,12 @@ export type CheckoutConfirmStripe = {
31
31
  * ID of the product to checkout. Must be present in the checkout's product list.
32
32
  */
33
33
  productId?: string | null | undefined;
34
+ /**
35
+ * ID of the product price to checkout. Must correspond to a price present in the checkout's product list.
36
+ *
37
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
38
+ */
39
+ productPriceId?: string | null | undefined;
34
40
  amount?: number | null | undefined;
35
41
  /**
36
42
  * Number of seats for seat-based pricing.
@@ -91,6 +97,7 @@ export type CheckoutConfirmStripe$Outbound = {
91
97
  | { [k: string]: string | number | boolean | string | null }
92
98
  | undefined;
93
99
  product_id?: string | null | undefined;
100
+ product_price_id?: string | null | undefined;
94
101
  amount?: number | null | undefined;
95
102
  seats?: number | null | undefined;
96
103
  is_business_customer?: boolean | null | undefined;
@@ -125,6 +132,7 @@ export const CheckoutConfirmStripe$outboundSchema: z.ZodMiniType<
125
132
  ),
126
133
  ),
127
134
  productId: z.optional(z.nullable(z.string())),
135
+ productPriceId: z.optional(z.nullable(z.string())),
128
136
  amount: z.optional(z.nullable(z.int())),
129
137
  seats: z.optional(z.nullable(z.int())),
130
138
  isBusinessCustomer: z.optional(z.nullable(z.boolean())),
@@ -142,6 +150,7 @@ export const CheckoutConfirmStripe$outboundSchema: z.ZodMiniType<
142
150
  return remap$(v, {
143
151
  customFieldData: "custom_field_data",
144
152
  productId: "product_id",
153
+ productPriceId: "product_price_id",
145
154
  isBusinessCustomer: "is_business_customer",
146
155
  customerName: "customer_name",
147
156
  customerEmail: "customer_email",
@@ -58,6 +58,10 @@ import { TrialInterval, TrialInterval$inboundSchema } from "./trialinterval.js";
58
58
 
59
59
  export type CheckoutPublicCustomFieldData = string | number | boolean | Date;
60
60
 
61
+ export type CheckoutPublicProductPrice =
62
+ | LegacyRecurringProductPrice
63
+ | ProductPrice;
64
+
61
65
  export type CheckoutPublicPrices = LegacyRecurringProductPrice | ProductPrice;
62
66
 
63
67
  export type CheckoutPublicDiscount =
@@ -178,6 +182,12 @@ export type CheckoutPublic = {
178
182
  * ID of the product to checkout.
179
183
  */
180
184
  productId: string | null;
185
+ /**
186
+ * ID of the product price to checkout.
187
+ *
188
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
189
+ */
190
+ productPriceId: string | null;
181
191
  /**
182
192
  * ID of the discount applied to the checkout.
183
193
  */
@@ -238,6 +248,12 @@ export type CheckoutPublic = {
238
248
  * Product selected to checkout.
239
249
  */
240
250
  product: CheckoutProduct | null;
251
+ /**
252
+ * Price of the selected product.
253
+ *
254
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
255
+ */
256
+ productPrice: LegacyRecurringProductPrice | ProductPrice | null;
241
257
  /**
242
258
  * Mapping of product IDs to their list of prices.
243
259
  */
@@ -275,6 +291,25 @@ export function checkoutPublicCustomFieldDataFromJSON(
275
291
  );
276
292
  }
277
293
 
294
+ /** @internal */
295
+ export const CheckoutPublicProductPrice$inboundSchema: z.ZodMiniType<
296
+ CheckoutPublicProductPrice,
297
+ unknown
298
+ > = smartUnion([
299
+ LegacyRecurringProductPrice$inboundSchema,
300
+ ProductPrice$inboundSchema,
301
+ ]);
302
+
303
+ export function checkoutPublicProductPriceFromJSON(
304
+ jsonString: string,
305
+ ): SafeParseResult<CheckoutPublicProductPrice, SDKValidationError> {
306
+ return safeParse(
307
+ jsonString,
308
+ (x) => CheckoutPublicProductPrice$inboundSchema.parse(JSON.parse(x)),
309
+ `Failed to parse 'CheckoutPublicProductPrice' from JSON`,
310
+ );
311
+ }
312
+
278
313
  /** @internal */
279
314
  export const CheckoutPublicPrices$inboundSchema: z.ZodMiniType<
280
315
  CheckoutPublicPrices,
@@ -374,6 +409,7 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
374
409
  ),
375
410
  organization_id: z.string(),
376
411
  product_id: z.nullable(z.string()),
412
+ product_price_id: z.nullable(z.string()),
377
413
  discount_id: z.nullable(z.string()),
378
414
  allow_discount_codes: z.boolean(),
379
415
  require_billing_address: z.boolean(),
@@ -395,6 +431,12 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
395
431
  billing_address_fields: CheckoutBillingAddressFields$inboundSchema,
396
432
  products: z.array(CheckoutProduct$inboundSchema),
397
433
  product: z.nullable(CheckoutProduct$inboundSchema),
434
+ product_price: z.nullable(
435
+ smartUnion([
436
+ LegacyRecurringProductPrice$inboundSchema,
437
+ ProductPrice$inboundSchema,
438
+ ]),
439
+ ),
398
440
  prices: z.nullable(
399
441
  z.record(
400
442
  z.string(),
@@ -443,6 +485,7 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
443
485
  "trial_end": "trialEnd",
444
486
  "organization_id": "organizationId",
445
487
  "product_id": "productId",
488
+ "product_price_id": "productPriceId",
446
489
  "discount_id": "discountId",
447
490
  "allow_discount_codes": "allowDiscountCodes",
448
491
  "require_billing_address": "requireBillingAddress",
@@ -461,6 +504,7 @@ export const CheckoutPublic$inboundSchema: z.ZodMiniType<
461
504
  "customer_tax_id": "customerTaxId",
462
505
  "payment_processor_metadata": "paymentProcessorMetadata",
463
506
  "billing_address_fields": "billingAddressFields",
507
+ "product_price": "productPrice",
464
508
  "attached_custom_fields": "attachedCustomFields",
465
509
  });
466
510
  }),
@@ -58,6 +58,10 @@ export type CheckoutPublicConfirmedCustomFieldData =
58
58
  | boolean
59
59
  | Date;
60
60
 
61
+ export type CheckoutPublicConfirmedProductPrice =
62
+ | LegacyRecurringProductPrice
63
+ | ProductPrice;
64
+
61
65
  export type CheckoutPublicConfirmedPrices =
62
66
  | LegacyRecurringProductPrice
63
67
  | ProductPrice;
@@ -185,6 +189,12 @@ export type CheckoutPublicConfirmed = {
185
189
  * ID of the product to checkout.
186
190
  */
187
191
  productId: string | null;
192
+ /**
193
+ * ID of the product price to checkout.
194
+ *
195
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
196
+ */
197
+ productPriceId: string | null;
188
198
  /**
189
199
  * ID of the discount applied to the checkout.
190
200
  */
@@ -245,6 +255,12 @@ export type CheckoutPublicConfirmed = {
245
255
  * Product selected to checkout.
246
256
  */
247
257
  product: CheckoutProduct | null;
258
+ /**
259
+ * Price of the selected product.
260
+ *
261
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
262
+ */
263
+ productPrice: LegacyRecurringProductPrice | ProductPrice | null;
248
264
  /**
249
265
  * Mapping of product IDs to their list of prices.
250
266
  */
@@ -259,7 +275,7 @@ export type CheckoutPublicConfirmed = {
259
275
  | null;
260
276
  organization: CheckoutOrganization;
261
277
  attachedCustomFields: Array<AttachedCustomField> | null;
262
- customerSessionToken: string;
278
+ customerSessionToken: string | null;
263
279
  };
264
280
 
265
281
  /** @internal */
@@ -282,6 +298,26 @@ export function checkoutPublicConfirmedCustomFieldDataFromJSON(
282
298
  );
283
299
  }
284
300
 
301
+ /** @internal */
302
+ export const CheckoutPublicConfirmedProductPrice$inboundSchema: z.ZodMiniType<
303
+ CheckoutPublicConfirmedProductPrice,
304
+ unknown
305
+ > = smartUnion([
306
+ LegacyRecurringProductPrice$inboundSchema,
307
+ ProductPrice$inboundSchema,
308
+ ]);
309
+
310
+ export function checkoutPublicConfirmedProductPriceFromJSON(
311
+ jsonString: string,
312
+ ): SafeParseResult<CheckoutPublicConfirmedProductPrice, SDKValidationError> {
313
+ return safeParse(
314
+ jsonString,
315
+ (x) =>
316
+ CheckoutPublicConfirmedProductPrice$inboundSchema.parse(JSON.parse(x)),
317
+ `Failed to parse 'CheckoutPublicConfirmedProductPrice' from JSON`,
318
+ );
319
+ }
320
+
285
321
  /** @internal */
286
322
  export const CheckoutPublicConfirmedPrices$inboundSchema: z.ZodMiniType<
287
323
  CheckoutPublicConfirmedPrices,
@@ -381,6 +417,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
381
417
  ),
382
418
  organization_id: z.string(),
383
419
  product_id: z.nullable(z.string()),
420
+ product_price_id: z.nullable(z.string()),
384
421
  discount_id: z.nullable(z.string()),
385
422
  allow_discount_codes: z.boolean(),
386
423
  require_billing_address: z.boolean(),
@@ -402,6 +439,12 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
402
439
  billing_address_fields: CheckoutBillingAddressFields$inboundSchema,
403
440
  products: z.array(CheckoutProduct$inboundSchema),
404
441
  product: z.nullable(CheckoutProduct$inboundSchema),
442
+ product_price: z.nullable(
443
+ smartUnion([
444
+ LegacyRecurringProductPrice$inboundSchema,
445
+ ProductPrice$inboundSchema,
446
+ ]),
447
+ ),
405
448
  prices: z.nullable(
406
449
  z.record(
407
450
  z.string(),
@@ -425,7 +468,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
425
468
  attached_custom_fields: z.nullable(
426
469
  z.array(AttachedCustomField$inboundSchema),
427
470
  ),
428
- customer_session_token: z.string(),
471
+ customer_session_token: z.nullable(z.string()),
429
472
  }),
430
473
  z.transform((v) => {
431
474
  return remap$(v, {
@@ -451,6 +494,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
451
494
  "trial_end": "trialEnd",
452
495
  "organization_id": "organizationId",
453
496
  "product_id": "productId",
497
+ "product_price_id": "productPriceId",
454
498
  "discount_id": "discountId",
455
499
  "allow_discount_codes": "allowDiscountCodes",
456
500
  "require_billing_address": "requireBillingAddress",
@@ -469,6 +513,7 @@ export const CheckoutPublicConfirmed$inboundSchema: z.ZodMiniType<
469
513
  "customer_tax_id": "customerTaxId",
470
514
  "payment_processor_metadata": "paymentProcessorMetadata",
471
515
  "billing_address_fields": "billingAddressFields",
516
+ "product_price": "productPrice",
472
517
  "attached_custom_fields": "attachedCustomFields",
473
518
  "customer_session_token": "customerSessionToken",
474
519
  });
@@ -39,6 +39,12 @@ export type CheckoutUpdate = {
39
39
  * ID of the product to checkout. Must be present in the checkout's product list.
40
40
  */
41
41
  productId?: string | null | undefined;
42
+ /**
43
+ * ID of the product price to checkout. Must correspond to a price present in the checkout's product list.
44
+ *
45
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
46
+ */
47
+ productPriceId?: string | null | undefined;
42
48
  amount?: number | null | undefined;
43
49
  /**
44
50
  * Number of seats for seat-based pricing.
@@ -204,6 +210,7 @@ export type CheckoutUpdate$Outbound = {
204
210
  | { [k: string]: string | number | boolean | string | null }
205
211
  | undefined;
206
212
  product_id?: string | null | undefined;
213
+ product_price_id?: string | null | undefined;
207
214
  amount?: number | null | undefined;
208
215
  seats?: number | null | undefined;
209
216
  is_business_customer?: boolean | null | undefined;
@@ -251,6 +258,7 @@ export const CheckoutUpdate$outboundSchema: z.ZodMiniType<
251
258
  ),
252
259
  ),
253
260
  productId: z.optional(z.nullable(z.string())),
261
+ productPriceId: z.optional(z.nullable(z.string())),
254
262
  amount: z.optional(z.nullable(z.int())),
255
263
  seats: z.optional(z.nullable(z.int())),
256
264
  isBusinessCustomer: z.optional(z.nullable(z.boolean())),
@@ -290,6 +298,7 @@ export const CheckoutUpdate$outboundSchema: z.ZodMiniType<
290
298
  return remap$(v, {
291
299
  customFieldData: "custom_field_data",
292
300
  productId: "product_id",
301
+ productPriceId: "product_price_id",
293
302
  isBusinessCustomer: "is_business_customer",
294
303
  customerName: "customer_name",
295
304
  customerEmail: "customer_email",
@@ -31,6 +31,12 @@ export type CheckoutUpdatePublic = {
31
31
  * ID of the product to checkout. Must be present in the checkout's product list.
32
32
  */
33
33
  productId?: string | null | undefined;
34
+ /**
35
+ * ID of the product price to checkout. Must correspond to a price present in the checkout's product list.
36
+ *
37
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
38
+ */
39
+ productPriceId?: string | null | undefined;
34
40
  amount?: number | null | undefined;
35
41
  /**
36
42
  * Number of seats for seat-based pricing.
@@ -87,6 +93,7 @@ export type CheckoutUpdatePublic$Outbound = {
87
93
  | { [k: string]: string | number | boolean | string | null }
88
94
  | undefined;
89
95
  product_id?: string | null | undefined;
96
+ product_price_id?: string | null | undefined;
90
97
  amount?: number | null | undefined;
91
98
  seats?: number | null | undefined;
92
99
  is_business_customer?: boolean | null | undefined;
@@ -120,6 +127,7 @@ export const CheckoutUpdatePublic$outboundSchema: z.ZodMiniType<
120
127
  ),
121
128
  ),
122
129
  productId: z.optional(z.nullable(z.string())),
130
+ productPriceId: z.optional(z.nullable(z.string())),
123
131
  amount: z.optional(z.nullable(z.int())),
124
132
  seats: z.optional(z.nullable(z.int())),
125
133
  isBusinessCustomer: z.optional(z.nullable(z.boolean())),
@@ -136,6 +144,7 @@ export const CheckoutUpdatePublic$outboundSchema: z.ZodMiniType<
136
144
  return remap$(v, {
137
145
  customFieldData: "custom_field_data",
138
146
  productId: "product_id",
147
+ productPriceId: "product_price_id",
139
148
  isBusinessCustomer: "is_business_customer",
140
149
  customerName: "customer_name",
141
150
  customerEmail: "customer_email",
@@ -41,6 +41,10 @@ export type OrganizationFeatureSettings = {
41
41
  * If this organization has checkout localization enabled
42
42
  */
43
43
  checkoutLocalizationEnabled?: boolean | undefined;
44
+ /**
45
+ * Ordered list of metric slugs shown on the dashboard overview.
46
+ */
47
+ overviewMetrics?: Array<string> | null | undefined;
44
48
  };
45
49
 
46
50
  /** @internal */
@@ -57,6 +61,7 @@ export const OrganizationFeatureSettings$inboundSchema: z.ZodMiniType<
57
61
  tinybird_read: z._default(z.boolean(), false),
58
62
  tinybird_compare: z._default(z.boolean(), false),
59
63
  checkout_localization_enabled: z._default(z.boolean(), false),
64
+ overview_metrics: z.optional(z.nullable(z.array(z.string()))),
60
65
  }),
61
66
  z.transform((v) => {
62
67
  return remap$(v, {
@@ -68,6 +73,7 @@ export const OrganizationFeatureSettings$inboundSchema: z.ZodMiniType<
68
73
  "tinybird_read": "tinybirdRead",
69
74
  "tinybird_compare": "tinybirdCompare",
70
75
  "checkout_localization_enabled": "checkoutLocalizationEnabled",
76
+ "overview_metrics": "overviewMetrics",
71
77
  });
72
78
  }),
73
79
  );
@@ -81,6 +87,7 @@ export type OrganizationFeatureSettings$Outbound = {
81
87
  tinybird_read: boolean;
82
88
  tinybird_compare: boolean;
83
89
  checkout_localization_enabled: boolean;
90
+ overview_metrics?: Array<string> | null | undefined;
84
91
  };
85
92
 
86
93
  /** @internal */
@@ -97,6 +104,7 @@ export const OrganizationFeatureSettings$outboundSchema: z.ZodMiniType<
97
104
  tinybirdRead: z._default(z.boolean(), false),
98
105
  tinybirdCompare: z._default(z.boolean(), false),
99
106
  checkoutLocalizationEnabled: z._default(z.boolean(), false),
107
+ overviewMetrics: z.optional(z.nullable(z.array(z.string()))),
100
108
  }),
101
109
  z.transform((v) => {
102
110
  return remap$(v, {
@@ -108,6 +116,7 @@ export const OrganizationFeatureSettings$outboundSchema: z.ZodMiniType<
108
116
  tinybirdRead: "tinybird_read",
109
117
  tinybirdCompare: "tinybird_compare",
110
118
  checkoutLocalizationEnabled: "checkout_localization_enabled",
119
+ overviewMetrics: "overview_metrics",
111
120
  });
112
121
  }),
113
122
  );
@@ -59,6 +59,7 @@ export const TaxIDFormat = {
59
59
  KrBrn: "kr_brn",
60
60
  KzBin: "kz_bin",
61
61
  LiUid: "li_uid",
62
+ MkVat: "mk_vat",
62
63
  MxRfc: "mx_rfc",
63
64
  MyFrp: "my_frp",
64
65
  MyItn: "my_itn",