@crevio/sdk 0.3.2 → 0.3.5

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 (220) hide show
  1. package/dist/commonjs/lib/config.d.ts +2 -2
  2. package/dist/commonjs/lib/config.js +2 -2
  3. package/dist/commonjs/models/account.d.ts.map +1 -1
  4. package/dist/commonjs/models/account.js +4 -12
  5. package/dist/commonjs/models/account.js.map +1 -1
  6. package/dist/commonjs/models/blogpost.d.ts.map +1 -1
  7. package/dist/commonjs/models/blogpost.js +5 -14
  8. package/dist/commonjs/models/blogpost.js.map +1 -1
  9. package/dist/commonjs/models/cart.d.ts.map +1 -1
  10. package/dist/commonjs/models/cart.js +4 -12
  11. package/dist/commonjs/models/cart.js.map +1 -1
  12. package/dist/commonjs/models/cartcreaterequest.d.ts +1 -1
  13. package/dist/commonjs/models/cartcreaterequest.d.ts.map +1 -1
  14. package/dist/commonjs/models/cartcreaterequest.js +0 -5
  15. package/dist/commonjs/models/cartcreaterequest.js.map +1 -1
  16. package/dist/commonjs/models/cartitem.d.ts.map +1 -1
  17. package/dist/commonjs/models/cartitem.js +1 -6
  18. package/dist/commonjs/models/cartitem.js.map +1 -1
  19. package/dist/commonjs/models/cartupdaterequest.d.ts +4 -4
  20. package/dist/commonjs/models/cartupdaterequest.d.ts.map +1 -1
  21. package/dist/commonjs/models/cartupdaterequest.js +0 -7
  22. package/dist/commonjs/models/cartupdaterequest.js.map +1 -1
  23. package/dist/commonjs/models/checkout.d.ts.map +1 -1
  24. package/dist/commonjs/models/checkout.js +7 -18
  25. package/dist/commonjs/models/checkout.js.map +1 -1
  26. package/dist/commonjs/models/checkoutcreaterequest.d.ts +8 -8
  27. package/dist/commonjs/models/checkoutcreaterequest.d.ts.map +1 -1
  28. package/dist/commonjs/models/checkoutcreaterequest.js +2 -15
  29. package/dist/commonjs/models/checkoutcreaterequest.js.map +1 -1
  30. package/dist/commonjs/models/checkoutitem.d.ts.map +1 -1
  31. package/dist/commonjs/models/checkoutitem.js +1 -6
  32. package/dist/commonjs/models/checkoutitem.js.map +1 -1
  33. package/dist/commonjs/models/checkoutlink.d.ts.map +1 -1
  34. package/dist/commonjs/models/checkoutlink.js +6 -16
  35. package/dist/commonjs/models/checkoutlink.js.map +1 -1
  36. package/dist/commonjs/models/checkoutlinkrequest.d.ts +7 -7
  37. package/dist/commonjs/models/checkoutlinkrequest.d.ts.map +1 -1
  38. package/dist/commonjs/models/checkoutlinkrequest.js +3 -14
  39. package/dist/commonjs/models/checkoutlinkrequest.js.map +1 -1
  40. package/dist/commonjs/models/checkoutupdaterequest.d.ts +1 -1
  41. package/dist/commonjs/models/checkoutupdaterequest.d.ts.map +1 -1
  42. package/dist/commonjs/models/checkoutupdaterequest.js +0 -5
  43. package/dist/commonjs/models/checkoutupdaterequest.js.map +1 -1
  44. package/dist/commonjs/models/customer.d.ts +3 -2
  45. package/dist/commonjs/models/customer.d.ts.map +1 -1
  46. package/dist/commonjs/models/customer.js +10 -21
  47. package/dist/commonjs/models/customer.js.map +1 -1
  48. package/dist/commonjs/models/customerrequest.d.ts +5 -4
  49. package/dist/commonjs/models/customerrequest.d.ts.map +1 -1
  50. package/dist/commonjs/models/customerrequest.js +2 -8
  51. package/dist/commonjs/models/customerrequest.js.map +1 -1
  52. package/dist/commonjs/models/discount.d.ts.map +1 -1
  53. package/dist/commonjs/models/discount.js +11 -26
  54. package/dist/commonjs/models/discount.js.map +1 -1
  55. package/dist/commonjs/models/discountrequest.d.ts +8 -8
  56. package/dist/commonjs/models/discountrequest.d.ts.map +1 -1
  57. package/dist/commonjs/models/discountrequest.js +1 -12
  58. package/dist/commonjs/models/discountrequest.js.map +1 -1
  59. package/dist/commonjs/models/experience.d.ts.map +1 -1
  60. package/dist/commonjs/models/experience.js +9 -25
  61. package/dist/commonjs/models/experience.js.map +1 -1
  62. package/dist/commonjs/models/fileattachment.d.ts.map +1 -1
  63. package/dist/commonjs/models/fileattachment.js +2 -8
  64. package/dist/commonjs/models/fileattachment.js.map +1 -1
  65. package/dist/commonjs/models/imageattachment.d.ts.map +1 -1
  66. package/dist/commonjs/models/imageattachment.js +2 -8
  67. package/dist/commonjs/models/imageattachment.js.map +1 -1
  68. package/dist/commonjs/models/operations/listcustomers.d.ts +2 -1
  69. package/dist/commonjs/models/operations/listcustomers.d.ts.map +1 -1
  70. package/dist/commonjs/models/operations/listcustomers.js +2 -1
  71. package/dist/commonjs/models/operations/listcustomers.js.map +1 -1
  72. package/dist/commonjs/models/operations/listorders.d.ts +2 -3
  73. package/dist/commonjs/models/operations/listorders.d.ts.map +1 -1
  74. package/dist/commonjs/models/operations/listorders.js +2 -3
  75. package/dist/commonjs/models/operations/listorders.js.map +1 -1
  76. package/dist/commonjs/models/order.d.ts +2 -3
  77. package/dist/commonjs/models/order.d.ts.map +1 -1
  78. package/dist/commonjs/models/order.js +13 -25
  79. package/dist/commonjs/models/order.js.map +1 -1
  80. package/dist/commonjs/models/orderlineitem.d.ts.map +1 -1
  81. package/dist/commonjs/models/orderlineitem.js +1 -6
  82. package/dist/commonjs/models/orderlineitem.js.map +1 -1
  83. package/dist/commonjs/models/pricevariant.d.ts.map +1 -1
  84. package/dist/commonjs/models/pricevariant.js +3 -10
  85. package/dist/commonjs/models/pricevariant.js.map +1 -1
  86. package/dist/commonjs/models/product.d.ts.map +1 -1
  87. package/dist/commonjs/models/product.js +8 -20
  88. package/dist/commonjs/models/product.js.map +1 -1
  89. package/dist/commonjs/models/review.d.ts.map +1 -1
  90. package/dist/commonjs/models/review.js +4 -10
  91. package/dist/commonjs/models/review.js.map +1 -1
  92. package/dist/commonjs/models/user.d.ts.map +1 -1
  93. package/dist/commonjs/models/user.js +12 -26
  94. package/dist/commonjs/models/user.js.map +1 -1
  95. package/dist/esm/lib/config.d.ts +2 -2
  96. package/dist/esm/lib/config.js +2 -2
  97. package/dist/esm/models/account.d.ts.map +1 -1
  98. package/dist/esm/models/account.js +4 -12
  99. package/dist/esm/models/account.js.map +1 -1
  100. package/dist/esm/models/blogpost.d.ts.map +1 -1
  101. package/dist/esm/models/blogpost.js +5 -14
  102. package/dist/esm/models/blogpost.js.map +1 -1
  103. package/dist/esm/models/cart.d.ts.map +1 -1
  104. package/dist/esm/models/cart.js +4 -12
  105. package/dist/esm/models/cart.js.map +1 -1
  106. package/dist/esm/models/cartcreaterequest.d.ts +1 -1
  107. package/dist/esm/models/cartcreaterequest.d.ts.map +1 -1
  108. package/dist/esm/models/cartcreaterequest.js +0 -5
  109. package/dist/esm/models/cartcreaterequest.js.map +1 -1
  110. package/dist/esm/models/cartitem.d.ts.map +1 -1
  111. package/dist/esm/models/cartitem.js +1 -6
  112. package/dist/esm/models/cartitem.js.map +1 -1
  113. package/dist/esm/models/cartupdaterequest.d.ts +4 -4
  114. package/dist/esm/models/cartupdaterequest.d.ts.map +1 -1
  115. package/dist/esm/models/cartupdaterequest.js +0 -7
  116. package/dist/esm/models/cartupdaterequest.js.map +1 -1
  117. package/dist/esm/models/checkout.d.ts.map +1 -1
  118. package/dist/esm/models/checkout.js +7 -18
  119. package/dist/esm/models/checkout.js.map +1 -1
  120. package/dist/esm/models/checkoutcreaterequest.d.ts +8 -8
  121. package/dist/esm/models/checkoutcreaterequest.d.ts.map +1 -1
  122. package/dist/esm/models/checkoutcreaterequest.js +2 -15
  123. package/dist/esm/models/checkoutcreaterequest.js.map +1 -1
  124. package/dist/esm/models/checkoutitem.d.ts.map +1 -1
  125. package/dist/esm/models/checkoutitem.js +1 -6
  126. package/dist/esm/models/checkoutitem.js.map +1 -1
  127. package/dist/esm/models/checkoutlink.d.ts.map +1 -1
  128. package/dist/esm/models/checkoutlink.js +6 -16
  129. package/dist/esm/models/checkoutlink.js.map +1 -1
  130. package/dist/esm/models/checkoutlinkrequest.d.ts +7 -7
  131. package/dist/esm/models/checkoutlinkrequest.d.ts.map +1 -1
  132. package/dist/esm/models/checkoutlinkrequest.js +3 -14
  133. package/dist/esm/models/checkoutlinkrequest.js.map +1 -1
  134. package/dist/esm/models/checkoutupdaterequest.d.ts +1 -1
  135. package/dist/esm/models/checkoutupdaterequest.d.ts.map +1 -1
  136. package/dist/esm/models/checkoutupdaterequest.js +0 -5
  137. package/dist/esm/models/checkoutupdaterequest.js.map +1 -1
  138. package/dist/esm/models/customer.d.ts +3 -2
  139. package/dist/esm/models/customer.d.ts.map +1 -1
  140. package/dist/esm/models/customer.js +10 -21
  141. package/dist/esm/models/customer.js.map +1 -1
  142. package/dist/esm/models/customerrequest.d.ts +5 -4
  143. package/dist/esm/models/customerrequest.d.ts.map +1 -1
  144. package/dist/esm/models/customerrequest.js +2 -8
  145. package/dist/esm/models/customerrequest.js.map +1 -1
  146. package/dist/esm/models/discount.d.ts.map +1 -1
  147. package/dist/esm/models/discount.js +11 -26
  148. package/dist/esm/models/discount.js.map +1 -1
  149. package/dist/esm/models/discountrequest.d.ts +8 -8
  150. package/dist/esm/models/discountrequest.d.ts.map +1 -1
  151. package/dist/esm/models/discountrequest.js +1 -12
  152. package/dist/esm/models/discountrequest.js.map +1 -1
  153. package/dist/esm/models/experience.d.ts.map +1 -1
  154. package/dist/esm/models/experience.js +9 -25
  155. package/dist/esm/models/experience.js.map +1 -1
  156. package/dist/esm/models/fileattachment.d.ts.map +1 -1
  157. package/dist/esm/models/fileattachment.js +2 -8
  158. package/dist/esm/models/fileattachment.js.map +1 -1
  159. package/dist/esm/models/imageattachment.d.ts.map +1 -1
  160. package/dist/esm/models/imageattachment.js +2 -8
  161. package/dist/esm/models/imageattachment.js.map +1 -1
  162. package/dist/esm/models/operations/listcustomers.d.ts +2 -1
  163. package/dist/esm/models/operations/listcustomers.d.ts.map +1 -1
  164. package/dist/esm/models/operations/listcustomers.js +2 -1
  165. package/dist/esm/models/operations/listcustomers.js.map +1 -1
  166. package/dist/esm/models/operations/listorders.d.ts +2 -3
  167. package/dist/esm/models/operations/listorders.d.ts.map +1 -1
  168. package/dist/esm/models/operations/listorders.js +2 -3
  169. package/dist/esm/models/operations/listorders.js.map +1 -1
  170. package/dist/esm/models/order.d.ts +2 -3
  171. package/dist/esm/models/order.d.ts.map +1 -1
  172. package/dist/esm/models/order.js +13 -25
  173. package/dist/esm/models/order.js.map +1 -1
  174. package/dist/esm/models/orderlineitem.d.ts.map +1 -1
  175. package/dist/esm/models/orderlineitem.js +1 -6
  176. package/dist/esm/models/orderlineitem.js.map +1 -1
  177. package/dist/esm/models/pricevariant.d.ts.map +1 -1
  178. package/dist/esm/models/pricevariant.js +3 -10
  179. package/dist/esm/models/pricevariant.js.map +1 -1
  180. package/dist/esm/models/product.d.ts.map +1 -1
  181. package/dist/esm/models/product.js +8 -20
  182. package/dist/esm/models/product.js.map +1 -1
  183. package/dist/esm/models/review.d.ts.map +1 -1
  184. package/dist/esm/models/review.js +4 -10
  185. package/dist/esm/models/review.js.map +1 -1
  186. package/dist/esm/models/user.d.ts.map +1 -1
  187. package/dist/esm/models/user.js +12 -26
  188. package/dist/esm/models/user.js.map +1 -1
  189. package/examples/node_modules/.package-lock.json +1 -1
  190. package/examples/package-lock.json +1 -1
  191. package/jsr.json +1 -1
  192. package/package.json +1 -1
  193. package/src/lib/config.ts +2 -2
  194. package/src/models/account.ts +4 -12
  195. package/src/models/blogpost.ts +5 -14
  196. package/src/models/cart.ts +4 -12
  197. package/src/models/cartcreaterequest.ts +1 -6
  198. package/src/models/cartitem.ts +1 -6
  199. package/src/models/cartupdaterequest.ts +4 -11
  200. package/src/models/checkout.ts +7 -18
  201. package/src/models/checkoutcreaterequest.ts +10 -23
  202. package/src/models/checkoutitem.ts +1 -6
  203. package/src/models/checkoutlink.ts +6 -16
  204. package/src/models/checkoutlinkrequest.ts +10 -21
  205. package/src/models/checkoutupdaterequest.ts +1 -6
  206. package/src/models/customer.ts +11 -22
  207. package/src/models/customerrequest.ts +5 -11
  208. package/src/models/discount.ts +11 -26
  209. package/src/models/discountrequest.ts +9 -20
  210. package/src/models/experience.ts +9 -25
  211. package/src/models/fileattachment.ts +2 -8
  212. package/src/models/imageattachment.ts +2 -8
  213. package/src/models/operations/listcustomers.ts +2 -1
  214. package/src/models/operations/listorders.ts +2 -3
  215. package/src/models/order.ts +13 -29
  216. package/src/models/orderlineitem.ts +1 -6
  217. package/src/models/pricevariant.ts +3 -10
  218. package/src/models/product.ts +8 -20
  219. package/src/models/review.ts +4 -12
  220. package/src/models/user.ts +12 -28
@@ -31,9 +31,9 @@ export type CartUpdateRequest = {
31
31
  /** @internal */
32
32
  export type CartItemsAttribute$Outbound = {
33
33
  id?: number | undefined;
34
- price_variant_id?: number | undefined;
34
+ priceVariantId?: number | undefined;
35
35
  quantity?: number | undefined;
36
- custom_amount?: number | undefined;
36
+ customAmount?: number | undefined;
37
37
  _destroy?: boolean | undefined;
38
38
  };
39
39
 
@@ -50,8 +50,6 @@ export const CartItemsAttribute$outboundSchema: z.ZodType<
50
50
  destroy: z.boolean().optional(),
51
51
  }).transform((v) => {
52
52
  return remap$(v, {
53
- priceVariantId: "price_variant_id",
54
- customAmount: "custom_amount",
55
53
  destroy: "_destroy",
56
54
  });
57
55
  });
@@ -66,8 +64,8 @@ export function cartItemsAttributeToJSON(
66
64
 
67
65
  /** @internal */
68
66
  export type CartUpdateRequestCart$Outbound = {
69
- customer_id?: number | undefined;
70
- cart_items_attributes?: Array<CartItemsAttribute$Outbound> | undefined;
67
+ customerId?: number | undefined;
68
+ cartItemsAttributes?: Array<CartItemsAttribute$Outbound> | undefined;
71
69
  };
72
70
 
73
71
  /** @internal */
@@ -79,11 +77,6 @@ export const CartUpdateRequestCart$outboundSchema: z.ZodType<
79
77
  customerId: z.number().int().optional(),
80
78
  cartItemsAttributes: z.array(z.lazy(() => CartItemsAttribute$outboundSchema))
81
79
  .optional(),
82
- }).transform((v) => {
83
- return remap$(v, {
84
- customerId: "customer_id",
85
- cartItemsAttributes: "cart_items_attributes",
86
- });
87
80
  });
88
81
 
89
82
  export function cartUpdateRequestCartToJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../types/fp.js";
9
8
  import { AccountSlim, AccountSlim$inboundSchema } from "./accountslim.js";
@@ -36,26 +35,16 @@ export const Checkout$inboundSchema: z.ZodType<
36
35
  > = z.object({
37
36
  id: z.number().int().optional(),
38
37
  status: z.string().optional(),
39
- processor_id: z.nullable(z.string()).optional(),
40
- client_secret: z.nullable(z.string()).optional(),
41
- prefix_id: z.string().optional(),
38
+ processorId: z.nullable(z.string()).optional(),
39
+ clientSecret: z.nullable(z.string()).optional(),
40
+ prefixId: z.string().optional(),
42
41
  mode: z.string().optional(),
43
42
  currency: z.string().optional(),
44
43
  total: z.number().int().optional(),
45
- is_free: z.boolean().optional(),
46
- prefilled_email: z.nullable(z.string()).optional(),
47
- checkout_items: z.array(CheckoutItem$inboundSchema).optional(),
48
- seller_account: AccountSlim$inboundSchema.optional(),
49
- }).transform((v) => {
50
- return remap$(v, {
51
- "processor_id": "processorId",
52
- "client_secret": "clientSecret",
53
- "prefix_id": "prefixId",
54
- "is_free": "isFree",
55
- "prefilled_email": "prefilledEmail",
56
- "checkout_items": "checkoutItems",
57
- "seller_account": "sellerAccount",
58
- });
44
+ isFree: z.boolean().optional(),
45
+ prefilledEmail: z.nullable(z.string()).optional(),
46
+ checkoutItems: z.array(CheckoutItem$inboundSchema).optional(),
47
+ sellerAccount: AccountSlim$inboundSchema.optional(),
59
48
  });
60
49
 
61
50
  export function checkoutFromJSON(
@@ -3,10 +3,9 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
 
8
7
  export type CheckoutItemsAttribute = {
9
- priceVariantId: number;
8
+ priceVariantId?: number | undefined;
10
9
  quantity?: number | undefined;
11
10
  /**
12
11
  * Custom amount in cents (pay-what-you-want)
@@ -19,7 +18,7 @@ export type CheckoutCreateRequestCheckout = {
19
18
  returnUrl?: string | undefined;
20
19
  cancelUrl?: string | undefined;
21
20
  discountCode?: string | undefined;
22
- checkoutItemsAttributes: Array<CheckoutItemsAttribute>;
21
+ checkoutItemsAttributes?: Array<CheckoutItemsAttribute> | undefined;
23
22
  };
24
23
 
25
24
  export type CheckoutCreateRequest = {
@@ -28,9 +27,9 @@ export type CheckoutCreateRequest = {
28
27
 
29
28
  /** @internal */
30
29
  export type CheckoutItemsAttribute$Outbound = {
31
- price_variant_id: number;
30
+ priceVariantId?: number | undefined;
32
31
  quantity?: number | undefined;
33
- custom_amount?: number | undefined;
32
+ customAmount?: number | undefined;
34
33
  };
35
34
 
36
35
  /** @internal */
@@ -39,14 +38,9 @@ export const CheckoutItemsAttribute$outboundSchema: z.ZodType<
39
38
  z.ZodTypeDef,
40
39
  CheckoutItemsAttribute
41
40
  > = z.object({
42
- priceVariantId: z.number().int(),
41
+ priceVariantId: z.number().int().optional(),
43
42
  quantity: z.number().int().optional(),
44
43
  customAmount: z.number().int().optional(),
45
- }).transform((v) => {
46
- return remap$(v, {
47
- priceVariantId: "price_variant_id",
48
- customAmount: "custom_amount",
49
- });
50
44
  });
51
45
 
52
46
  export function checkoutItemsAttributeToJSON(
@@ -60,10 +54,10 @@ export function checkoutItemsAttributeToJSON(
60
54
  /** @internal */
61
55
  export type CheckoutCreateRequestCheckout$Outbound = {
62
56
  email?: string | undefined;
63
- return_url?: string | undefined;
64
- cancel_url?: string | undefined;
65
- discount_code?: string | undefined;
66
- checkout_items_attributes: Array<CheckoutItemsAttribute$Outbound>;
57
+ returnUrl?: string | undefined;
58
+ cancelUrl?: string | undefined;
59
+ discountCode?: string | undefined;
60
+ checkoutItemsAttributes?: Array<CheckoutItemsAttribute$Outbound> | undefined;
67
61
  };
68
62
 
69
63
  /** @internal */
@@ -78,14 +72,7 @@ export const CheckoutCreateRequestCheckout$outboundSchema: z.ZodType<
78
72
  discountCode: z.string().optional(),
79
73
  checkoutItemsAttributes: z.array(
80
74
  z.lazy(() => CheckoutItemsAttribute$outboundSchema),
81
- ),
82
- }).transform((v) => {
83
- return remap$(v, {
84
- returnUrl: "return_url",
85
- cancelUrl: "cancel_url",
86
- discountCode: "discount_code",
87
- checkoutItemsAttributes: "checkout_items_attributes",
88
- });
75
+ ).optional(),
89
76
  });
90
77
 
91
78
  export function checkoutCreateRequestCheckoutToJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../types/fp.js";
9
8
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
@@ -23,11 +22,7 @@ export const CheckoutItem$inboundSchema: z.ZodType<
23
22
  > = z.object({
24
23
  id: z.number().int().optional(),
25
24
  quantity: z.number().int().optional(),
26
- price_variant: PriceVariant$inboundSchema.optional(),
27
- }).transform((v) => {
28
- return remap$(v, {
29
- "price_variant": "priceVariant",
30
- });
25
+ priceVariant: PriceVariant$inboundSchema.optional(),
31
26
  });
32
27
 
33
28
  export function checkoutItemFromJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../types/fp.js";
9
8
  import { Discount, Discount$inboundSchema } from "./discount.js";
@@ -32,24 +31,15 @@ export const CheckoutLink$inboundSchema: z.ZodType<
32
31
  id: z.number().int().optional(),
33
32
  name: z.string().optional(),
34
33
  url: z.string().optional(),
35
- success_url: z.nullable(z.string()).optional(),
36
- allow_discount_codes: z.boolean().optional(),
37
- prefix_id: z.string().optional(),
38
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
34
+ successUrl: z.nullable(z.string()).optional(),
35
+ allowDiscountCodes: z.boolean().optional(),
36
+ prefixId: z.string().optional(),
37
+ createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
39
38
  .optional(),
40
- updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
39
+ updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
41
40
  .optional(),
42
41
  discount: Discount$inboundSchema.optional(),
43
- price_variants: z.array(PriceVariant$inboundSchema).optional(),
44
- }).transform((v) => {
45
- return remap$(v, {
46
- "success_url": "successUrl",
47
- "allow_discount_codes": "allowDiscountCodes",
48
- "prefix_id": "prefixId",
49
- "created_at": "createdAt",
50
- "updated_at": "updatedAt",
51
- "price_variants": "priceVariants",
52
- });
42
+ priceVariants: z.array(PriceVariant$inboundSchema).optional(),
53
43
  });
54
44
 
55
45
  export function checkoutLinkFromJSON(
@@ -3,27 +3,26 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
 
8
7
  export type CheckoutLinkRequestCheckoutLink = {
9
8
  name?: string | undefined;
10
9
  discountId?: number | null | undefined;
11
10
  allowDiscountCodes?: boolean | undefined;
12
11
  successUrl?: string | undefined;
13
- priceVariantIds: Array<number>;
12
+ priceVariantIds?: Array<number> | undefined;
14
13
  };
15
14
 
16
15
  export type CheckoutLinkRequest = {
17
- checkoutLink: CheckoutLinkRequestCheckoutLink;
16
+ checkoutLink?: CheckoutLinkRequestCheckoutLink | undefined;
18
17
  };
19
18
 
20
19
  /** @internal */
21
20
  export type CheckoutLinkRequestCheckoutLink$Outbound = {
22
21
  name?: string | undefined;
23
- discount_id?: number | null | undefined;
24
- allow_discount_codes?: boolean | undefined;
25
- success_url?: string | undefined;
26
- price_variant_ids: Array<number>;
22
+ discountId?: number | null | undefined;
23
+ allowDiscountCodes?: boolean | undefined;
24
+ successUrl?: string | undefined;
25
+ priceVariantIds?: Array<number> | undefined;
27
26
  };
28
27
 
29
28
  /** @internal */
@@ -36,14 +35,7 @@ export const CheckoutLinkRequestCheckoutLink$outboundSchema: z.ZodType<
36
35
  discountId: z.nullable(z.number().int()).optional(),
37
36
  allowDiscountCodes: z.boolean().optional(),
38
37
  successUrl: z.string().optional(),
39
- priceVariantIds: z.array(z.number().int()),
40
- }).transform((v) => {
41
- return remap$(v, {
42
- discountId: "discount_id",
43
- allowDiscountCodes: "allow_discount_codes",
44
- successUrl: "success_url",
45
- priceVariantIds: "price_variant_ids",
46
- });
38
+ priceVariantIds: z.array(z.number().int()).optional(),
47
39
  });
48
40
 
49
41
  export function checkoutLinkRequestCheckoutLinkToJSON(
@@ -58,7 +50,7 @@ export function checkoutLinkRequestCheckoutLinkToJSON(
58
50
 
59
51
  /** @internal */
60
52
  export type CheckoutLinkRequest$Outbound = {
61
- checkout_link: CheckoutLinkRequestCheckoutLink$Outbound;
53
+ checkoutLink?: CheckoutLinkRequestCheckoutLink$Outbound | undefined;
62
54
  };
63
55
 
64
56
  /** @internal */
@@ -67,11 +59,8 @@ export const CheckoutLinkRequest$outboundSchema: z.ZodType<
67
59
  z.ZodTypeDef,
68
60
  CheckoutLinkRequest
69
61
  > = z.object({
70
- checkoutLink: z.lazy(() => CheckoutLinkRequestCheckoutLink$outboundSchema),
71
- }).transform((v) => {
72
- return remap$(v, {
73
- checkoutLink: "checkout_link",
74
- });
62
+ checkoutLink: z.lazy(() => CheckoutLinkRequestCheckoutLink$outboundSchema)
63
+ .optional(),
75
64
  });
76
65
 
77
66
  export function checkoutLinkRequestToJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
 
8
7
  export type CheckoutUpdateRequestCheckout = {
9
8
  email?: string | undefined;
@@ -17,7 +16,7 @@ export type CheckoutUpdateRequest = {
17
16
  /** @internal */
18
17
  export type CheckoutUpdateRequestCheckout$Outbound = {
19
18
  email?: string | undefined;
20
- discount_code?: string | undefined;
19
+ discountCode?: string | undefined;
21
20
  };
22
21
 
23
22
  /** @internal */
@@ -28,10 +27,6 @@ export const CheckoutUpdateRequestCheckout$outboundSchema: z.ZodType<
28
27
  > = z.object({
29
28
  email: z.string().optional(),
30
29
  discountCode: z.string().optional(),
31
- }).transform((v) => {
32
- return remap$(v, {
33
- discountCode: "discount_code",
34
- });
35
30
  });
36
31
 
37
32
  export function checkoutUpdateRequestCheckoutToJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { ClosedEnum } from "../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../types/fp.js";
@@ -11,7 +10,8 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
11
10
 
12
11
  export const CustomerCustomerType = {
13
12
  Lead: "lead",
14
- Buyer: "buyer",
13
+ Free: "free",
14
+ Paid: "paid",
15
15
  } as const;
16
16
  export type CustomerCustomerType = ClosedEnum<typeof CustomerCustomerType>;
17
17
 
@@ -20,7 +20,7 @@ export type Customer = {
20
20
  email?: string | undefined;
21
21
  name?: string | undefined;
22
22
  firstName?: string | undefined;
23
- lastName?: string | undefined;
23
+ lastName?: string | null | undefined;
24
24
  customerType?: CustomerCustomerType | undefined;
25
25
  prefixId?: string | undefined;
26
26
  ordersCount?: number | undefined;
@@ -46,27 +46,16 @@ export const Customer$inboundSchema: z.ZodType<
46
46
  id: z.number().int().optional(),
47
47
  email: z.string().optional(),
48
48
  name: z.string().optional(),
49
- first_name: z.string().optional(),
50
- last_name: z.string().optional(),
51
- customer_type: CustomerCustomerType$inboundSchema.optional(),
52
- prefix_id: z.string().optional(),
53
- orders_count: z.number().int().optional(),
54
- total_spend: z.number().int().optional(),
55
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
49
+ firstName: z.string().optional(),
50
+ lastName: z.nullable(z.string()).optional(),
51
+ customerType: CustomerCustomerType$inboundSchema.optional(),
52
+ prefixId: z.string().optional(),
53
+ ordersCount: z.number().int().optional(),
54
+ totalSpend: z.number().int().optional(),
55
+ createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
56
56
  .optional(),
57
- updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
57
+ updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
58
58
  .optional(),
59
- }).transform((v) => {
60
- return remap$(v, {
61
- "first_name": "firstName",
62
- "last_name": "lastName",
63
- "customer_type": "customerType",
64
- "prefix_id": "prefixId",
65
- "orders_count": "ordersCount",
66
- "total_spend": "totalSpend",
67
- "created_at": "createdAt",
68
- "updated_at": "updatedAt",
69
- });
70
59
  });
71
60
 
72
61
  export function customerFromJSON(
@@ -3,12 +3,12 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { ClosedEnum } from "../types/enums.js";
8
7
 
9
8
  export const CustomerRequestCustomerType = {
10
9
  Lead: "lead",
11
- Buyer: "buyer",
10
+ Free: "free",
11
+ Paid: "paid",
12
12
  } as const;
13
13
  export type CustomerRequestCustomerType = ClosedEnum<
14
14
  typeof CustomerRequestCustomerType
@@ -35,9 +35,9 @@ export const CustomerRequestCustomerType$outboundSchema: z.ZodNativeEnum<
35
35
  export type CustomerRequestCustomer$Outbound = {
36
36
  email: string;
37
37
  name?: string | undefined;
38
- first_name?: string | undefined;
39
- last_name?: string | undefined;
40
- customer_type?: string | undefined;
38
+ firstName?: string | undefined;
39
+ lastName?: string | undefined;
40
+ customerType?: string | undefined;
41
41
  };
42
42
 
43
43
  /** @internal */
@@ -51,12 +51,6 @@ export const CustomerRequestCustomer$outboundSchema: z.ZodType<
51
51
  firstName: z.string().optional(),
52
52
  lastName: z.string().optional(),
53
53
  customerType: CustomerRequestCustomerType$outboundSchema.optional(),
54
- }).transform((v) => {
55
- return remap$(v, {
56
- firstName: "first_name",
57
- lastName: "last_name",
58
- customerType: "customer_type",
59
- });
60
54
  });
61
55
 
62
56
  export function customerRequestCustomerToJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { ClosedEnum } from "../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../types/fp.js";
@@ -76,39 +75,25 @@ export const Discount$inboundSchema: z.ZodType<
76
75
  > = z.object({
77
76
  id: z.number().int().optional(),
78
77
  status: DiscountStatus$inboundSchema.optional(),
79
- discount_type: DiscountDiscountType$inboundSchema.optional(),
78
+ discountType: DiscountDiscountType$inboundSchema.optional(),
80
79
  code: z.string().optional(),
81
- redeem_by: z.nullable(
80
+ redeemBy: z.nullable(
82
81
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
83
82
  ).optional(),
84
- max_redemptions: z.nullable(z.number().int()).optional(),
85
- times_redeemed: z.number().int().optional(),
83
+ maxRedemptions: z.nullable(z.number().int()).optional(),
84
+ timesRedeemed: z.number().int().optional(),
86
85
  duration: z.nullable(DiscountDuration$inboundSchema).optional(),
87
- duration_in_months: z.nullable(z.number().int()).optional(),
88
- amount_off: z.nullable(z.number().int()).optional(),
89
- percent_off: z.nullable(z.number()).optional(),
86
+ durationInMonths: z.nullable(z.number().int()).optional(),
87
+ amountOff: z.nullable(z.number().int()).optional(),
88
+ percentOff: z.nullable(z.number()).optional(),
90
89
  currency: z.nullable(z.string()).optional(),
91
- prefix_id: z.string().optional(),
90
+ prefixId: z.string().optional(),
92
91
  destroyable: z.boolean().optional(),
93
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
92
+ createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
94
93
  .optional(),
95
- updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
94
+ updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
96
95
  .optional(),
97
- price_variants: z.array(PriceVariant$inboundSchema).optional(),
98
- }).transform((v) => {
99
- return remap$(v, {
100
- "discount_type": "discountType",
101
- "redeem_by": "redeemBy",
102
- "max_redemptions": "maxRedemptions",
103
- "times_redeemed": "timesRedeemed",
104
- "duration_in_months": "durationInMonths",
105
- "amount_off": "amountOff",
106
- "percent_off": "percentOff",
107
- "prefix_id": "prefixId",
108
- "created_at": "createdAt",
109
- "updated_at": "updatedAt",
110
- "price_variants": "priceVariants",
111
- });
96
+ priceVariants: z.array(PriceVariant$inboundSchema).optional(),
112
97
  });
113
98
 
114
99
  export function discountFromJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { ClosedEnum } from "../types/enums.js";
8
7
 
9
8
  export const DiscountRequestDiscountType = {
@@ -25,7 +24,7 @@ export type DiscountRequestDuration = ClosedEnum<
25
24
 
26
25
  export type DiscountRequestDiscount = {
27
26
  code: string;
28
- discountType: DiscountRequestDiscountType;
27
+ discountType?: DiscountRequestDiscountType | undefined;
29
28
  /**
30
29
  * Discount amount in cents (required if discount_type=amount_off)
31
30
  */
@@ -62,15 +61,15 @@ export const DiscountRequestDuration$outboundSchema: z.ZodNativeEnum<
62
61
  /** @internal */
63
62
  export type DiscountRequestDiscount$Outbound = {
64
63
  code: string;
65
- discount_type: string;
66
- amount_off?: number | undefined;
67
- percent_off?: number | undefined;
64
+ discountType?: string | undefined;
65
+ amountOff?: number | undefined;
66
+ percentOff?: number | undefined;
68
67
  currency?: string | undefined;
69
68
  duration?: string | undefined;
70
- duration_in_months?: number | undefined;
71
- redeem_by?: string | undefined;
72
- max_redemptions?: number | undefined;
73
- price_variants?: Array<number> | undefined;
69
+ durationInMonths?: number | undefined;
70
+ redeemBy?: string | undefined;
71
+ maxRedemptions?: number | undefined;
72
+ priceVariants?: Array<number> | undefined;
74
73
  };
75
74
 
76
75
  /** @internal */
@@ -80,7 +79,7 @@ export const DiscountRequestDiscount$outboundSchema: z.ZodType<
80
79
  DiscountRequestDiscount
81
80
  > = z.object({
82
81
  code: z.string(),
83
- discountType: DiscountRequestDiscountType$outboundSchema,
82
+ discountType: DiscountRequestDiscountType$outboundSchema.optional(),
84
83
  amountOff: z.number().int().optional(),
85
84
  percentOff: z.number().optional(),
86
85
  currency: z.string().optional(),
@@ -89,16 +88,6 @@ export const DiscountRequestDiscount$outboundSchema: z.ZodType<
89
88
  redeemBy: z.date().transform(v => v.toISOString()).optional(),
90
89
  maxRedemptions: z.number().int().optional(),
91
90
  priceVariants: z.array(z.number().int()).optional(),
92
- }).transform((v) => {
93
- return remap$(v, {
94
- discountType: "discount_type",
95
- amountOff: "amount_off",
96
- percentOff: "percent_off",
97
- durationInMonths: "duration_in_months",
98
- redeemBy: "redeem_by",
99
- maxRedemptions: "max_redemptions",
100
- priceVariants: "price_variants",
101
- });
102
91
  });
103
92
 
104
93
  export function discountRequestDiscountToJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../types/fp.js";
9
8
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
@@ -64,14 +63,9 @@ export const Image$inboundSchema: z.ZodType<Image, z.ZodTypeDef, unknown> = z
64
63
  .object({
65
64
  id: z.number().int().optional(),
66
65
  filename: z.string().optional(),
67
- content_type: z.string().optional(),
68
- byte_size: z.number().int().optional(),
66
+ contentType: z.string().optional(),
67
+ byteSize: z.number().int().optional(),
69
68
  url: z.string().optional(),
70
- }).transform((v) => {
71
- return remap$(v, {
72
- "content_type": "contentType",
73
- "byte_size": "byteSize",
74
- });
75
69
  });
76
70
 
77
71
  export function imageFromJSON(
@@ -94,27 +88,17 @@ export const Experience$inboundSchema: z.ZodType<
94
88
  name: z.string().optional(),
95
89
  slug: z.string().optional(),
96
90
  description: z.nullable(z.string()).optional(),
97
- access_type: z.string().optional(),
98
- item_type: z.string().optional(),
99
- prefix_id: z.string().optional(),
100
- type_for_display: z.string().optional(),
101
- active_users_count: z.number().int().optional(),
91
+ accessType: z.string().optional(),
92
+ itemType: z.string().optional(),
93
+ prefixId: z.string().optional(),
94
+ typeForDisplay: z.string().optional(),
95
+ activeUsersCount: z.number().int().optional(),
102
96
  seo: z.nullable(z.lazy(() => ExperienceSeo$inboundSchema)).optional(),
103
97
  image: z.nullable(z.lazy(() => Image$inboundSchema)).optional(),
104
- created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
98
+ createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
105
99
  .optional(),
106
- updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
100
+ updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
107
101
  .optional(),
108
- }).transform((v) => {
109
- return remap$(v, {
110
- "access_type": "accessType",
111
- "item_type": "itemType",
112
- "prefix_id": "prefixId",
113
- "type_for_display": "typeForDisplay",
114
- "active_users_count": "activeUsersCount",
115
- "created_at": "createdAt",
116
- "updated_at": "updatedAt",
117
- });
118
102
  });
119
103
 
120
104
  export function experienceFromJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../types/fp.js";
9
8
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
@@ -24,14 +23,9 @@ export const FileAttachment$inboundSchema: z.ZodType<
24
23
  > = z.object({
25
24
  id: z.number().int().optional(),
26
25
  filename: z.string().optional(),
27
- content_type: z.string().optional(),
28
- byte_size: z.number().int().optional(),
26
+ contentType: z.string().optional(),
27
+ byteSize: z.number().int().optional(),
29
28
  url: z.string().optional(),
30
- }).transform((v) => {
31
- return remap$(v, {
32
- "content_type": "contentType",
33
- "byte_size": "byteSize",
34
- });
35
29
  });
36
30
 
37
31
  export function fileAttachmentFromJSON(
@@ -3,7 +3,6 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod/v3";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
6
  import { safeParse } from "../lib/schemas.js";
8
7
  import { Result as SafeParseResult } from "../types/fp.js";
9
8
  import { SDKValidationError } from "./errors/sdkvalidationerror.js";
@@ -24,14 +23,9 @@ export const ImageAttachment$inboundSchema: z.ZodType<
24
23
  > = z.object({
25
24
  id: z.number().int().optional(),
26
25
  filename: z.string().optional(),
27
- content_type: z.string().optional(),
28
- byte_size: z.number().int().optional(),
26
+ contentType: z.string().optional(),
27
+ byteSize: z.number().int().optional(),
29
28
  url: z.string().optional(),
30
- }).transform((v) => {
31
- return remap$(v, {
32
- "content_type": "contentType",
33
- "byte_size": "byteSize",
34
- });
35
29
  });
36
30
 
37
31
  export function imageAttachmentFromJSON(
@@ -11,7 +11,8 @@ import { ClosedEnum } from "../../types/enums.js";
11
11
  */
12
12
  export const CustomerType = {
13
13
  Lead: "lead",
14
- Buyer: "buyer",
14
+ Free: "free",
15
+ Paid: "paid",
15
16
  } as const;
16
17
  /**
17
18
  * Filter by customer type