ce-storefront 0.3.9 → 0.3.11

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 (208) hide show
  1. package/docs/sdks/auth/README.md +2 -0
  2. package/docs/sdks/carts/README.md +22 -12
  3. package/docs/sdks/cestorefrontuser/README.md +30 -2
  4. package/docs/sdks/checkout/README.md +4 -0
  5. package/esm/funcs/cartsAddItem.js +1 -1
  6. package/esm/funcs/cartsAddItem.js.map +1 -1
  7. package/esm/lib/config.d.ts +2 -2
  8. package/esm/lib/config.js +2 -2
  9. package/esm/lib/config.js.map +1 -1
  10. package/esm/models/components/anonymoususer.d.ts +14 -14
  11. package/esm/models/components/anonymoususer.d.ts.map +1 -1
  12. package/esm/models/components/anonymoususer.js +14 -14
  13. package/esm/models/components/anonymoususer.js.map +1 -1
  14. package/esm/models/components/associatedoption.d.ts +4 -102
  15. package/esm/models/components/associatedoption.d.ts.map +1 -1
  16. package/esm/models/components/associatedoption.js +4 -82
  17. package/esm/models/components/associatedoption.js.map +1 -1
  18. package/esm/models/components/bundleproduct.d.ts +48 -48
  19. package/esm/models/components/bundleproduct.d.ts.map +1 -1
  20. package/esm/models/components/bundleproduct.js +46 -50
  21. package/esm/models/components/bundleproduct.js.map +1 -1
  22. package/esm/models/components/bundleproductdetail.d.ts +66 -66
  23. package/esm/models/components/bundleproductdetail.d.ts.map +1 -1
  24. package/esm/models/components/bundleproductdetail.js +62 -66
  25. package/esm/models/components/bundleproductdetail.js.map +1 -1
  26. package/esm/models/components/coloroption.d.ts +72 -0
  27. package/esm/models/components/coloroption.d.ts.map +1 -0
  28. package/esm/models/components/coloroption.js +62 -0
  29. package/esm/models/components/coloroption.js.map +1 -0
  30. package/esm/models/components/currency.d.ts +6 -6
  31. package/esm/models/components/currency.d.ts.map +1 -1
  32. package/esm/models/components/currency.js +6 -6
  33. package/esm/models/components/currency.js.map +1 -1
  34. package/esm/models/components/index.d.ts +3 -1
  35. package/esm/models/components/index.d.ts.map +1 -1
  36. package/esm/models/components/index.js +3 -1
  37. package/esm/models/components/index.js.map +1 -1
  38. package/esm/models/components/notificationpreferences.d.ts +6 -6
  39. package/esm/models/components/notificationpreferences.d.ts.map +1 -1
  40. package/esm/models/components/notificationpreferences.js +6 -6
  41. package/esm/models/components/notificationpreferences.js.map +1 -1
  42. package/esm/models/components/pagination.d.ts +8 -8
  43. package/esm/models/components/pagination.d.ts.map +1 -1
  44. package/esm/models/components/pagination.js +8 -8
  45. package/esm/models/components/pagination.js.map +1 -1
  46. package/esm/models/components/productattribute.d.ts +2 -2
  47. package/esm/models/components/productattribute.d.ts.map +1 -1
  48. package/esm/models/components/productattribute.js +2 -2
  49. package/esm/models/components/productattribute.js.map +1 -1
  50. package/esm/models/components/productcategory.d.ts +20 -20
  51. package/esm/models/components/productcategory.d.ts.map +1 -1
  52. package/esm/models/components/productcategory.js +20 -20
  53. package/esm/models/components/productcategory.js.map +1 -1
  54. package/esm/models/components/productdetail.d.ts +2 -14
  55. package/esm/models/components/productdetail.d.ts.map +1 -1
  56. package/esm/models/components/productdetail.js +4 -18
  57. package/esm/models/components/productdetail.js.map +1 -1
  58. package/esm/models/components/productimage.d.ts +14 -14
  59. package/esm/models/components/productimage.d.ts.map +1 -1
  60. package/esm/models/components/productimage.js +14 -14
  61. package/esm/models/components/productimage.js.map +1 -1
  62. package/esm/models/components/productpricing.d.ts +4 -4
  63. package/esm/models/components/productpricing.d.ts.map +1 -1
  64. package/esm/models/components/productpricing.js +4 -4
  65. package/esm/models/components/productpricing.js.map +1 -1
  66. package/esm/models/components/productshipping.d.ts +12 -12
  67. package/esm/models/components/productshipping.d.ts.map +1 -1
  68. package/esm/models/components/productshipping.js +12 -12
  69. package/esm/models/components/productshipping.js.map +1 -1
  70. package/esm/models/components/productvideo.d.ts +16 -16
  71. package/esm/models/components/productvideo.d.ts.map +1 -1
  72. package/esm/models/components/productvideo.js +16 -16
  73. package/esm/models/components/productvideo.js.map +1 -1
  74. package/esm/models/components/seo.d.ts +8 -8
  75. package/esm/models/components/seo.d.ts.map +1 -1
  76. package/esm/models/components/seo.js +8 -8
  77. package/esm/models/components/seo.js.map +1 -1
  78. package/esm/models/components/singleproduct.d.ts +18 -18
  79. package/esm/models/components/singleproduct.d.ts.map +1 -1
  80. package/esm/models/components/singleproduct.js +18 -18
  81. package/esm/models/components/singleproduct.js.map +1 -1
  82. package/esm/models/components/singleproductdetail.d.ts +36 -36
  83. package/esm/models/components/singleproductdetail.d.ts.map +1 -1
  84. package/esm/models/components/singleproductdetail.js +34 -34
  85. package/esm/models/components/singleproductdetail.js.map +1 -1
  86. package/esm/models/components/singleselectoption.d.ts +42 -0
  87. package/esm/models/components/singleselectoption.d.ts.map +1 -0
  88. package/esm/models/components/singleselectoption.js +35 -0
  89. package/esm/models/components/singleselectoption.js.map +1 -0
  90. package/esm/models/components/sku.d.ts +30 -30
  91. package/esm/models/components/sku.d.ts.map +1 -1
  92. package/esm/models/components/sku.js +28 -30
  93. package/esm/models/components/sku.js.map +1 -1
  94. package/esm/models/components/updatecartitem.d.ts +45 -0
  95. package/esm/models/components/updatecartitem.d.ts.map +1 -0
  96. package/esm/models/components/updatecartitem.js +46 -0
  97. package/esm/models/components/updatecartitem.js.map +1 -0
  98. package/esm/models/components/user.d.ts +116 -26
  99. package/esm/models/components/user.d.ts.map +1 -1
  100. package/esm/models/components/user.js +104 -30
  101. package/esm/models/components/user.js.map +1 -1
  102. package/esm/models/components/variant.d.ts +15 -12
  103. package/esm/models/components/variant.d.ts.map +1 -1
  104. package/esm/models/components/variant.js +12 -12
  105. package/esm/models/components/variant.js.map +1 -1
  106. package/esm/models/components/variantdetail.d.ts +41 -38
  107. package/esm/models/components/variantdetail.d.ts.map +1 -1
  108. package/esm/models/components/variantdetail.js +36 -36
  109. package/esm/models/components/variantdetail.js.map +1 -1
  110. package/esm/models/components/variantoption.d.ts +34 -26
  111. package/esm/models/components/variantoption.d.ts.map +1 -1
  112. package/esm/models/components/variantoption.js +32 -45
  113. package/esm/models/components/variantoption.js.map +1 -1
  114. package/esm/models/operations/getcrosssell.d.ts +6 -6
  115. package/esm/models/operations/getcrosssell.d.ts.map +1 -1
  116. package/esm/models/operations/getcrosssell.js +6 -6
  117. package/esm/models/operations/getcrosssell.js.map +1 -1
  118. package/esm/models/operations/getproductscategories.d.ts +4 -4
  119. package/esm/models/operations/getproductscategories.d.ts.map +1 -1
  120. package/esm/models/operations/getproductscategories.js +4 -4
  121. package/esm/models/operations/getproductscategories.js.map +1 -1
  122. package/esm/models/operations/getproductsidreviews.d.ts +4 -4
  123. package/esm/models/operations/getproductsidreviews.d.ts.map +1 -1
  124. package/esm/models/operations/getproductsidreviews.js +4 -4
  125. package/esm/models/operations/getproductsidreviews.js.map +1 -1
  126. package/esm/models/operations/getsimilar.d.ts +6 -6
  127. package/esm/models/operations/getsimilar.d.ts.map +1 -1
  128. package/esm/models/operations/getsimilar.js +6 -6
  129. package/esm/models/operations/getsimilar.js.map +1 -1
  130. package/esm/models/operations/getskus.d.ts +4 -4
  131. package/esm/models/operations/getskus.d.ts.map +1 -1
  132. package/esm/models/operations/getskus.js +4 -4
  133. package/esm/models/operations/getskus.js.map +1 -1
  134. package/esm/models/operations/getupsell.d.ts +6 -6
  135. package/esm/models/operations/getupsell.d.ts.map +1 -1
  136. package/esm/models/operations/getupsell.js +6 -6
  137. package/esm/models/operations/getupsell.js.map +1 -1
  138. package/esm/models/operations/postauthanonymous.d.ts +12 -12
  139. package/esm/models/operations/postauthanonymous.d.ts.map +1 -1
  140. package/esm/models/operations/postauthanonymous.js +12 -12
  141. package/esm/models/operations/postauthanonymous.js.map +1 -1
  142. package/esm/models/operations/postauthgenerateotp.d.ts +2 -2
  143. package/esm/models/operations/postauthgenerateotp.d.ts.map +1 -1
  144. package/esm/models/operations/postauthgenerateotp.js +2 -2
  145. package/esm/models/operations/postauthgenerateotp.js.map +1 -1
  146. package/esm/models/operations/postcartaddress.d.ts +8 -8
  147. package/esm/models/operations/postcartaddress.d.ts.map +1 -1
  148. package/esm/models/operations/postcartaddress.js +8 -12
  149. package/esm/models/operations/postcartaddress.js.map +1 -1
  150. package/esm/models/operations/postcartitemid.d.ts +2 -35
  151. package/esm/models/operations/postcartitemid.d.ts.map +1 -1
  152. package/esm/models/operations/postcartitemid.js +4 -49
  153. package/esm/models/operations/postcartitemid.js.map +1 -1
  154. package/esm/models/operations/postcartsid.d.ts +5 -31
  155. package/esm/models/operations/postcartsid.d.ts.map +1 -1
  156. package/esm/models/operations/postcartsid.js +2 -41
  157. package/esm/models/operations/postcartsid.js.map +1 -1
  158. package/esm/models/operations/postproductsidreviews.d.ts +4 -4
  159. package/esm/models/operations/postproductsidreviews.d.ts.map +1 -1
  160. package/esm/models/operations/postproductsidreviews.js +4 -4
  161. package/esm/models/operations/postproductsidreviews.js.map +1 -1
  162. package/jsr.json +1 -1
  163. package/package.json +1 -1
  164. package/src/funcs/cartsAddItem.ts +1 -1
  165. package/src/lib/config.ts +2 -2
  166. package/src/models/components/anonymoususer.ts +28 -28
  167. package/src/models/components/associatedoption.ts +19 -164
  168. package/src/models/components/bundleproduct.ts +92 -99
  169. package/src/models/components/bundleproductdetail.ts +124 -131
  170. package/src/models/components/coloroption.ts +144 -0
  171. package/src/models/components/currency.ts +12 -12
  172. package/src/models/components/index.ts +3 -1
  173. package/src/models/components/notificationpreferences.ts +12 -12
  174. package/src/models/components/pagination.ts +16 -16
  175. package/src/models/components/productattribute.ts +4 -4
  176. package/src/models/components/productcategory.ts +40 -40
  177. package/src/models/components/productdetail.ts +7 -37
  178. package/src/models/components/productimage.ts +28 -28
  179. package/src/models/components/productpricing.ts +8 -8
  180. package/src/models/components/productshipping.ts +24 -24
  181. package/src/models/components/productvideo.ts +32 -32
  182. package/src/models/components/seo.ts +16 -16
  183. package/src/models/components/singleproduct.ts +36 -36
  184. package/src/models/components/singleproductdetail.ts +68 -68
  185. package/src/models/components/singleselectoption.ts +83 -0
  186. package/src/models/components/sku.ts +56 -61
  187. package/src/models/components/updatecartitem.ts +93 -0
  188. package/src/models/components/user.ts +199 -56
  189. package/src/models/components/variant.ts +27 -24
  190. package/src/models/components/variantdetail.ts +75 -72
  191. package/src/models/components/variantoption.ts +54 -61
  192. package/src/models/operations/getcrosssell.ts +12 -12
  193. package/src/models/operations/getproductscategories.ts +8 -8
  194. package/src/models/operations/getproductsidreviews.ts +8 -8
  195. package/src/models/operations/getsimilar.ts +12 -12
  196. package/src/models/operations/getskus.ts +8 -8
  197. package/src/models/operations/getupsell.ts +12 -12
  198. package/src/models/operations/postauthanonymous.ts +24 -24
  199. package/src/models/operations/postauthgenerateotp.ts +4 -4
  200. package/src/models/operations/postcartaddress.ts +16 -23
  201. package/src/models/operations/postcartitemid.ts +6 -94
  202. package/src/models/operations/postcartsid.ts +7 -72
  203. package/src/models/operations/postproductsidreviews.ts +8 -8
  204. package/esm/models/components/userinput.d.ts +0 -63
  205. package/esm/models/components/userinput.d.ts.map +0 -1
  206. package/esm/models/components/userinput.js +0 -61
  207. package/esm/models/components/userinput.js.map +0 -1
  208. package/src/models/components/userinput.ts +0 -130
@@ -90,8 +90,8 @@ export type VariantDetail = {
90
90
  /**
91
91
  * variant sku
92
92
  */
93
- sku?: string | undefined;
94
- slug?: string | undefined;
93
+ sku: string | null;
94
+ slug: string | null;
95
95
  /**
96
96
  * variant name
97
97
  */
@@ -100,7 +100,7 @@ export type VariantDetail = {
100
100
  * variant name
101
101
  */
102
102
  productName: string;
103
- shortDescription: string;
103
+ shortDescription: string | null;
104
104
  active: boolean;
105
105
  stockAvailable: boolean;
106
106
  /**
@@ -113,25 +113,28 @@ export type VariantDetail = {
113
113
  * Indicates whether a variant is marked as the default variant for a product
114
114
  */
115
115
  isDefault: boolean;
116
+ /**
117
+ * An object where each key is an option name, and the value describes the option details.
118
+ */
116
119
  associatedOptions: { [k: string]: AssociatedOption };
117
- images?: Array<ProductImage> | undefined;
120
+ images: Array<ProductImage>;
118
121
  pricing: ProductPricing;
119
- subscription?: Array<ProductSubscription> | undefined;
120
- promotion?: Array<ProductPromotion> | undefined;
122
+ subscription: Array<ProductSubscription>;
123
+ promotion: Array<ProductPromotion>;
121
124
  productType: VariantDetailProductType;
122
- description?: string | undefined;
123
- categoryIds?: Array<string> | undefined;
124
- tags?: Array<string> | null | undefined;
125
- reviewRatingSum?: number | undefined;
126
- reviewsCount?: number | undefined;
127
- hsnCode?: string | undefined;
125
+ description: string | null;
126
+ categoryIds: Array<string>;
127
+ tags: Array<string> | null;
128
+ reviewRatingSum: number | null;
129
+ reviewsCount: number;
130
+ hsnCode: string | null;
128
131
  variantOptions: Array<VariantOption>;
129
- productAttributes?: Array<ProductAttribute> | undefined;
130
- variantAttributes?: Array<ProductAttribute> | undefined;
131
- videos?: Array<ProductVideo> | undefined;
132
- shipping?: ProductShipping | null | undefined;
133
- seo?: Seo | undefined;
134
- metadata?: { [k: string]: string } | undefined;
132
+ productAttributes: Array<ProductAttribute>;
133
+ variantAttributes: Array<ProductAttribute>;
134
+ videos: Array<ProductVideo>;
135
+ shipping: ProductShipping | null;
136
+ seo: Seo;
137
+ metadata: { [k: string]: string };
135
138
  };
136
139
 
137
140
  /** @internal */
@@ -163,11 +166,11 @@ export const VariantDetail$inboundSchema: z.ZodType<
163
166
  > = z.object({
164
167
  id: z.string(),
165
168
  product_id: z.string(),
166
- sku: z.string().optional(),
167
- slug: z.string().optional(),
169
+ sku: z.nullable(z.string()),
170
+ slug: z.nullable(z.string()),
168
171
  name: z.string(),
169
172
  product_name: z.string(),
170
- short_description: z.string(),
173
+ short_description: z.nullable(z.string()),
171
174
  active: z.boolean(),
172
175
  stock_available: z.boolean(),
173
176
  on_offer: z.boolean().default(false),
@@ -175,24 +178,24 @@ export const VariantDetail$inboundSchema: z.ZodType<
175
178
  on_subscription: z.boolean().default(false),
176
179
  is_default: z.boolean(),
177
180
  associated_options: z.record(AssociatedOption$inboundSchema),
178
- images: z.array(ProductImage$inboundSchema).optional(),
181
+ images: z.array(ProductImage$inboundSchema),
179
182
  pricing: ProductPricing$inboundSchema,
180
- subscription: z.array(ProductSubscription$inboundSchema).optional(),
181
- promotion: z.array(ProductPromotion$inboundSchema).optional(),
183
+ subscription: z.array(ProductSubscription$inboundSchema),
184
+ promotion: z.array(ProductPromotion$inboundSchema),
182
185
  product_type: VariantDetailProductType$inboundSchema,
183
- description: z.string().optional(),
184
- category_ids: z.array(z.string()).optional(),
185
- tags: z.nullable(z.array(z.string())).optional(),
186
- review_rating_sum: z.number().optional(),
187
- reviews_count: z.number().int().optional(),
188
- hsn_code: z.string().optional(),
186
+ description: z.nullable(z.string()),
187
+ category_ids: z.array(z.string()),
188
+ tags: z.nullable(z.array(z.string())),
189
+ review_rating_sum: z.nullable(z.number()),
190
+ reviews_count: z.number().int(),
191
+ hsn_code: z.nullable(z.string()),
189
192
  variant_options: z.array(VariantOption$inboundSchema),
190
- product_attributes: z.array(ProductAttribute$inboundSchema).optional(),
191
- variant_attributes: z.array(ProductAttribute$inboundSchema).optional(),
192
- videos: z.array(ProductVideo$inboundSchema).optional(),
193
- shipping: z.nullable(ProductShipping$inboundSchema).optional(),
194
- seo: Seo$inboundSchema.optional(),
195
- metadata: z.record(z.string()).optional(),
193
+ product_attributes: z.array(ProductAttribute$inboundSchema),
194
+ variant_attributes: z.array(ProductAttribute$inboundSchema),
195
+ videos: z.array(ProductVideo$inboundSchema),
196
+ shipping: z.nullable(ProductShipping$inboundSchema),
197
+ seo: Seo$inboundSchema,
198
+ metadata: z.record(z.string()),
196
199
  }).transform((v) => {
197
200
  return remap$(v, {
198
201
  "product_id": "productId",
@@ -219,11 +222,11 @@ export const VariantDetail$inboundSchema: z.ZodType<
219
222
  export type VariantDetail$Outbound = {
220
223
  id: string;
221
224
  product_id: string;
222
- sku?: string | undefined;
223
- slug?: string | undefined;
225
+ sku: string | null;
226
+ slug: string | null;
224
227
  name: string;
225
228
  product_name: string;
226
- short_description: string;
229
+ short_description: string | null;
227
230
  active: boolean;
228
231
  stock_available: boolean;
229
232
  on_offer: boolean;
@@ -231,24 +234,24 @@ export type VariantDetail$Outbound = {
231
234
  on_subscription: boolean;
232
235
  is_default: boolean;
233
236
  associated_options: { [k: string]: AssociatedOption$Outbound };
234
- images?: Array<ProductImage$Outbound> | undefined;
237
+ images: Array<ProductImage$Outbound>;
235
238
  pricing: ProductPricing$Outbound;
236
- subscription?: Array<ProductSubscription$Outbound> | undefined;
237
- promotion?: Array<ProductPromotion$Outbound> | undefined;
239
+ subscription: Array<ProductSubscription$Outbound>;
240
+ promotion: Array<ProductPromotion$Outbound>;
238
241
  product_type: string;
239
- description?: string | undefined;
240
- category_ids?: Array<string> | undefined;
241
- tags?: Array<string> | null | undefined;
242
- review_rating_sum?: number | undefined;
243
- reviews_count?: number | undefined;
244
- hsn_code?: string | undefined;
242
+ description: string | null;
243
+ category_ids: Array<string>;
244
+ tags: Array<string> | null;
245
+ review_rating_sum: number | null;
246
+ reviews_count: number;
247
+ hsn_code: string | null;
245
248
  variant_options: Array<VariantOption$Outbound>;
246
- product_attributes?: Array<ProductAttribute$Outbound> | undefined;
247
- variant_attributes?: Array<ProductAttribute$Outbound> | undefined;
248
- videos?: Array<ProductVideo$Outbound> | undefined;
249
- shipping?: ProductShipping$Outbound | null | undefined;
250
- seo?: Seo$Outbound | undefined;
251
- metadata?: { [k: string]: string } | undefined;
249
+ product_attributes: Array<ProductAttribute$Outbound>;
250
+ variant_attributes: Array<ProductAttribute$Outbound>;
251
+ videos: Array<ProductVideo$Outbound>;
252
+ shipping: ProductShipping$Outbound | null;
253
+ seo: Seo$Outbound;
254
+ metadata: { [k: string]: string };
252
255
  };
253
256
 
254
257
  /** @internal */
@@ -259,11 +262,11 @@ export const VariantDetail$outboundSchema: z.ZodType<
259
262
  > = z.object({
260
263
  id: z.string(),
261
264
  productId: z.string(),
262
- sku: z.string().optional(),
263
- slug: z.string().optional(),
265
+ sku: z.nullable(z.string()),
266
+ slug: z.nullable(z.string()),
264
267
  name: z.string(),
265
268
  productName: z.string(),
266
- shortDescription: z.string(),
269
+ shortDescription: z.nullable(z.string()),
267
270
  active: z.boolean(),
268
271
  stockAvailable: z.boolean(),
269
272
  onOffer: z.boolean().default(false),
@@ -271,24 +274,24 @@ export const VariantDetail$outboundSchema: z.ZodType<
271
274
  onSubscription: z.boolean().default(false),
272
275
  isDefault: z.boolean(),
273
276
  associatedOptions: z.record(AssociatedOption$outboundSchema),
274
- images: z.array(ProductImage$outboundSchema).optional(),
277
+ images: z.array(ProductImage$outboundSchema),
275
278
  pricing: ProductPricing$outboundSchema,
276
- subscription: z.array(ProductSubscription$outboundSchema).optional(),
277
- promotion: z.array(ProductPromotion$outboundSchema).optional(),
279
+ subscription: z.array(ProductSubscription$outboundSchema),
280
+ promotion: z.array(ProductPromotion$outboundSchema),
278
281
  productType: VariantDetailProductType$outboundSchema,
279
- description: z.string().optional(),
280
- categoryIds: z.array(z.string()).optional(),
281
- tags: z.nullable(z.array(z.string())).optional(),
282
- reviewRatingSum: z.number().optional(),
283
- reviewsCount: z.number().int().optional(),
284
- hsnCode: z.string().optional(),
282
+ description: z.nullable(z.string()),
283
+ categoryIds: z.array(z.string()),
284
+ tags: z.nullable(z.array(z.string())),
285
+ reviewRatingSum: z.nullable(z.number()),
286
+ reviewsCount: z.number().int(),
287
+ hsnCode: z.nullable(z.string()),
285
288
  variantOptions: z.array(VariantOption$outboundSchema),
286
- productAttributes: z.array(ProductAttribute$outboundSchema).optional(),
287
- variantAttributes: z.array(ProductAttribute$outboundSchema).optional(),
288
- videos: z.array(ProductVideo$outboundSchema).optional(),
289
- shipping: z.nullable(ProductShipping$outboundSchema).optional(),
290
- seo: Seo$outboundSchema.optional(),
291
- metadata: z.record(z.string()).optional(),
289
+ productAttributes: z.array(ProductAttribute$outboundSchema),
290
+ variantAttributes: z.array(ProductAttribute$outboundSchema),
291
+ videos: z.array(ProductVideo$outboundSchema),
292
+ shipping: z.nullable(ProductShipping$outboundSchema),
293
+ seo: Seo$outboundSchema,
294
+ metadata: z.record(z.string()),
292
295
  }).transform((v) => {
293
296
  return remap$(v, {
294
297
  productId: "product_id",
@@ -3,25 +3,31 @@
3
3
  */
4
4
 
5
5
  import * as z from "zod";
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";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
10
 
12
- export const OptionType = {
11
+ export const Type = {
13
12
  SingleSelect: "single-select",
14
13
  Color: "color",
15
14
  } as const;
16
- export type OptionType = ClosedEnum<typeof OptionType>;
15
+ export type Type = ClosedEnum<typeof Type>;
17
16
 
18
17
  export type Two = {};
19
18
 
20
- export type OptionValue = Two | string;
19
+ export type Value = Two | string;
21
20
 
22
21
  export type VariantOption = {
23
- optionName?: string | undefined;
24
- optionType?: OptionType | undefined;
22
+ /**
23
+ * The name of the associated option.
24
+ */
25
+ name: string;
26
+ /**
27
+ * A lookup safe version of the name that is lowercased and spaces are replaced with underscores. For instance, if name is `Product Type`, key will be `product_type`
28
+ */
29
+ key: string;
30
+ type: Type;
25
31
  /**
26
32
  * When option_type is color, value will contain an array of objects like:
27
33
  *
@@ -39,26 +45,27 @@ export type VariantOption = {
39
45
  * ]
40
46
  * ```
41
47
  */
42
- optionValue?: Array<Two | string> | undefined;
48
+ value: Array<Two | string>;
43
49
  };
44
50
 
45
51
  /** @internal */
46
- export const OptionType$inboundSchema: z.ZodNativeEnum<typeof OptionType> = z
47
- .nativeEnum(OptionType);
52
+ export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
53
+ Type,
54
+ );
48
55
 
49
56
  /** @internal */
50
- export const OptionType$outboundSchema: z.ZodNativeEnum<typeof OptionType> =
51
- OptionType$inboundSchema;
57
+ export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
58
+ Type$inboundSchema;
52
59
 
53
60
  /**
54
61
  * @internal
55
62
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
63
  */
57
- export namespace OptionType$ {
58
- /** @deprecated use `OptionType$inboundSchema` instead. */
59
- export const inboundSchema = OptionType$inboundSchema;
60
- /** @deprecated use `OptionType$outboundSchema` instead. */
61
- export const outboundSchema = OptionType$outboundSchema;
64
+ export namespace Type$ {
65
+ /** @deprecated use `Type$inboundSchema` instead. */
66
+ export const inboundSchema = Type$inboundSchema;
67
+ /** @deprecated use `Type$outboundSchema` instead. */
68
+ export const outboundSchema = Type$outboundSchema;
62
69
  }
63
70
 
64
71
  /** @internal */
@@ -100,46 +107,43 @@ export function twoFromJSON(
100
107
  }
101
108
 
102
109
  /** @internal */
103
- export const OptionValue$inboundSchema: z.ZodType<
104
- OptionValue,
105
- z.ZodTypeDef,
106
- unknown
107
- > = z.union([z.lazy(() => Two$inboundSchema), z.string()]);
110
+ export const Value$inboundSchema: z.ZodType<Value, z.ZodTypeDef, unknown> = z
111
+ .union([z.lazy(() => Two$inboundSchema), z.string()]);
108
112
 
109
113
  /** @internal */
110
- export type OptionValue$Outbound = Two$Outbound | string;
114
+ export type Value$Outbound = Two$Outbound | string;
111
115
 
112
116
  /** @internal */
113
- export const OptionValue$outboundSchema: z.ZodType<
114
- OptionValue$Outbound,
117
+ export const Value$outboundSchema: z.ZodType<
118
+ Value$Outbound,
115
119
  z.ZodTypeDef,
116
- OptionValue
120
+ Value
117
121
  > = z.union([z.lazy(() => Two$outboundSchema), z.string()]);
118
122
 
119
123
  /**
120
124
  * @internal
121
125
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
122
126
  */
123
- export namespace OptionValue$ {
124
- /** @deprecated use `OptionValue$inboundSchema` instead. */
125
- export const inboundSchema = OptionValue$inboundSchema;
126
- /** @deprecated use `OptionValue$outboundSchema` instead. */
127
- export const outboundSchema = OptionValue$outboundSchema;
128
- /** @deprecated use `OptionValue$Outbound` instead. */
129
- export type Outbound = OptionValue$Outbound;
127
+ export namespace Value$ {
128
+ /** @deprecated use `Value$inboundSchema` instead. */
129
+ export const inboundSchema = Value$inboundSchema;
130
+ /** @deprecated use `Value$outboundSchema` instead. */
131
+ export const outboundSchema = Value$outboundSchema;
132
+ /** @deprecated use `Value$Outbound` instead. */
133
+ export type Outbound = Value$Outbound;
130
134
  }
131
135
 
132
- export function optionValueToJSON(optionValue: OptionValue): string {
133
- return JSON.stringify(OptionValue$outboundSchema.parse(optionValue));
136
+ export function valueToJSON(value: Value): string {
137
+ return JSON.stringify(Value$outboundSchema.parse(value));
134
138
  }
135
139
 
136
- export function optionValueFromJSON(
140
+ export function valueFromJSON(
137
141
  jsonString: string,
138
- ): SafeParseResult<OptionValue, SDKValidationError> {
142
+ ): SafeParseResult<Value, SDKValidationError> {
139
143
  return safeParse(
140
144
  jsonString,
141
- (x) => OptionValue$inboundSchema.parse(JSON.parse(x)),
142
- `Failed to parse 'OptionValue' from JSON`,
145
+ (x) => Value$inboundSchema.parse(JSON.parse(x)),
146
+ `Failed to parse 'Value' from JSON`,
143
147
  );
144
148
  }
145
149
 
@@ -149,23 +153,18 @@ export const VariantOption$inboundSchema: z.ZodType<
149
153
  z.ZodTypeDef,
150
154
  unknown
151
155
  > = z.object({
152
- option_name: z.string().optional(),
153
- option_type: OptionType$inboundSchema.optional(),
154
- option_value: z.array(z.union([z.lazy(() => Two$inboundSchema), z.string()]))
155
- .optional(),
156
- }).transform((v) => {
157
- return remap$(v, {
158
- "option_name": "optionName",
159
- "option_type": "optionType",
160
- "option_value": "optionValue",
161
- });
156
+ name: z.string(),
157
+ key: z.string(),
158
+ type: Type$inboundSchema,
159
+ value: z.array(z.union([z.lazy(() => Two$inboundSchema), z.string()])),
162
160
  });
163
161
 
164
162
  /** @internal */
165
163
  export type VariantOption$Outbound = {
166
- option_name?: string | undefined;
167
- option_type?: string | undefined;
168
- option_value?: Array<Two$Outbound | string> | undefined;
164
+ name: string;
165
+ key: string;
166
+ type: string;
167
+ value: Array<Two$Outbound | string>;
169
168
  };
170
169
 
171
170
  /** @internal */
@@ -174,16 +173,10 @@ export const VariantOption$outboundSchema: z.ZodType<
174
173
  z.ZodTypeDef,
175
174
  VariantOption
176
175
  > = z.object({
177
- optionName: z.string().optional(),
178
- optionType: OptionType$outboundSchema.optional(),
179
- optionValue: z.array(z.union([z.lazy(() => Two$outboundSchema), z.string()]))
180
- .optional(),
181
- }).transform((v) => {
182
- return remap$(v, {
183
- optionName: "option_name",
184
- optionType: "option_type",
185
- optionValue: "option_value",
186
- });
176
+ name: z.string(),
177
+ key: z.string(),
178
+ type: Type$outboundSchema,
179
+ value: z.array(z.union([z.lazy(() => Two$outboundSchema), z.string()])),
187
180
  });
188
181
 
189
182
  /**
@@ -32,9 +32,9 @@ export type GetCrossSellRequest = {
32
32
  * Success response
33
33
  */
34
34
  export type GetCrossSellResponseBody = {
35
- message?: string | undefined;
36
- success?: boolean | undefined;
37
- content?: components.ProductListResponse | undefined;
35
+ message: string;
36
+ success: boolean;
37
+ content: components.ProductListResponse;
38
38
  };
39
39
 
40
40
  /** @internal */
@@ -116,16 +116,16 @@ export const GetCrossSellResponseBody$inboundSchema: z.ZodType<
116
116
  z.ZodTypeDef,
117
117
  unknown
118
118
  > = z.object({
119
- message: z.string().optional(),
120
- success: z.boolean().optional(),
121
- content: components.ProductListResponse$inboundSchema.optional(),
119
+ message: z.string(),
120
+ success: z.boolean(),
121
+ content: components.ProductListResponse$inboundSchema,
122
122
  });
123
123
 
124
124
  /** @internal */
125
125
  export type GetCrossSellResponseBody$Outbound = {
126
- message?: string | undefined;
127
- success?: boolean | undefined;
128
- content?: components.ProductListResponse$Outbound | undefined;
126
+ message: string;
127
+ success: boolean;
128
+ content: components.ProductListResponse$Outbound;
129
129
  };
130
130
 
131
131
  /** @internal */
@@ -134,9 +134,9 @@ export const GetCrossSellResponseBody$outboundSchema: z.ZodType<
134
134
  z.ZodTypeDef,
135
135
  GetCrossSellResponseBody
136
136
  > = z.object({
137
- message: z.string().optional(),
138
- success: z.boolean().optional(),
139
- content: components.ProductListResponse$outboundSchema.optional(),
137
+ message: z.string(),
138
+ success: z.boolean(),
139
+ content: components.ProductListResponse$outboundSchema,
140
140
  });
141
141
 
142
142
  /**
@@ -36,9 +36,9 @@ export type GetProductsCategoriesContent = {
36
36
  * OK
37
37
  */
38
38
  export type GetProductsCategoriesResponseBody = {
39
- message?: string | undefined;
39
+ message: string;
40
40
  success?: boolean | undefined;
41
- content?: GetProductsCategoriesContent | undefined;
41
+ content: GetProductsCategoriesContent;
42
42
  };
43
43
 
44
44
  /** @internal */
@@ -180,16 +180,16 @@ export const GetProductsCategoriesResponseBody$inboundSchema: z.ZodType<
180
180
  z.ZodTypeDef,
181
181
  unknown
182
182
  > = z.object({
183
- message: z.string().optional(),
183
+ message: z.string(),
184
184
  success: z.boolean().default(true),
185
- content: z.lazy(() => GetProductsCategoriesContent$inboundSchema).optional(),
185
+ content: z.lazy(() => GetProductsCategoriesContent$inboundSchema),
186
186
  });
187
187
 
188
188
  /** @internal */
189
189
  export type GetProductsCategoriesResponseBody$Outbound = {
190
- message?: string | undefined;
190
+ message: string;
191
191
  success: boolean;
192
- content?: GetProductsCategoriesContent$Outbound | undefined;
192
+ content: GetProductsCategoriesContent$Outbound;
193
193
  };
194
194
 
195
195
  /** @internal */
@@ -198,9 +198,9 @@ export const GetProductsCategoriesResponseBody$outboundSchema: z.ZodType<
198
198
  z.ZodTypeDef,
199
199
  GetProductsCategoriesResponseBody
200
200
  > = z.object({
201
- message: z.string().optional(),
201
+ message: z.string(),
202
202
  success: z.boolean().default(true),
203
- content: z.lazy(() => GetProductsCategoriesContent$outboundSchema).optional(),
203
+ content: z.lazy(() => GetProductsCategoriesContent$outboundSchema),
204
204
  });
205
205
 
206
206
  /**
@@ -37,8 +37,8 @@ export type GetProductsIdReviewsRequest = {
37
37
  };
38
38
 
39
39
  export type GetProductsIdReviewsContent = {
40
- reviews?: Array<components.ProductReview> | undefined;
41
- reviewTags?: Array<string> | undefined;
40
+ reviews: Array<components.ProductReview>;
41
+ reviewTags?: Array<string> | null | undefined;
42
42
  /**
43
43
  * pagination metadata structure
44
44
  */
@@ -143,8 +143,8 @@ export const GetProductsIdReviewsContent$inboundSchema: z.ZodType<
143
143
  z.ZodTypeDef,
144
144
  unknown
145
145
  > = z.object({
146
- reviews: z.array(components.ProductReview$inboundSchema).optional(),
147
- review_tags: z.array(z.string()).optional(),
146
+ reviews: z.array(components.ProductReview$inboundSchema),
147
+ review_tags: z.nullable(z.array(z.string())).optional(),
148
148
  pagination: components.Pagination$inboundSchema.optional(),
149
149
  }).transform((v) => {
150
150
  return remap$(v, {
@@ -154,8 +154,8 @@ export const GetProductsIdReviewsContent$inboundSchema: z.ZodType<
154
154
 
155
155
  /** @internal */
156
156
  export type GetProductsIdReviewsContent$Outbound = {
157
- reviews?: Array<components.ProductReview$Outbound> | undefined;
158
- review_tags?: Array<string> | undefined;
157
+ reviews: Array<components.ProductReview$Outbound>;
158
+ review_tags?: Array<string> | null | undefined;
159
159
  pagination?: components.Pagination$Outbound | undefined;
160
160
  };
161
161
 
@@ -165,8 +165,8 @@ export const GetProductsIdReviewsContent$outboundSchema: z.ZodType<
165
165
  z.ZodTypeDef,
166
166
  GetProductsIdReviewsContent
167
167
  > = z.object({
168
- reviews: z.array(components.ProductReview$outboundSchema).optional(),
169
- reviewTags: z.array(z.string()).optional(),
168
+ reviews: z.array(components.ProductReview$outboundSchema),
169
+ reviewTags: z.nullable(z.array(z.string())).optional(),
170
170
  pagination: components.Pagination$outboundSchema.optional(),
171
171
  }).transform((v) => {
172
172
  return remap$(v, {
@@ -32,9 +32,9 @@ export type GetSimilarRequest = {
32
32
  * Success response
33
33
  */
34
34
  export type GetSimilarResponseBody = {
35
- message?: string | undefined;
36
- success?: boolean | undefined;
37
- content?: components.ProductListResponse | undefined;
35
+ message: string;
36
+ success: boolean;
37
+ content: components.ProductListResponse;
38
38
  };
39
39
 
40
40
  /** @internal */
@@ -116,16 +116,16 @@ export const GetSimilarResponseBody$inboundSchema: z.ZodType<
116
116
  z.ZodTypeDef,
117
117
  unknown
118
118
  > = z.object({
119
- message: z.string().optional(),
120
- success: z.boolean().optional(),
121
- content: components.ProductListResponse$inboundSchema.optional(),
119
+ message: z.string(),
120
+ success: z.boolean(),
121
+ content: components.ProductListResponse$inboundSchema,
122
122
  });
123
123
 
124
124
  /** @internal */
125
125
  export type GetSimilarResponseBody$Outbound = {
126
- message?: string | undefined;
127
- success?: boolean | undefined;
128
- content?: components.ProductListResponse$Outbound | undefined;
126
+ message: string;
127
+ success: boolean;
128
+ content: components.ProductListResponse$Outbound;
129
129
  };
130
130
 
131
131
  /** @internal */
@@ -134,9 +134,9 @@ export const GetSimilarResponseBody$outboundSchema: z.ZodType<
134
134
  z.ZodTypeDef,
135
135
  GetSimilarResponseBody
136
136
  > = z.object({
137
- message: z.string().optional(),
138
- success: z.boolean().optional(),
139
- content: components.ProductListResponse$outboundSchema.optional(),
137
+ message: z.string(),
138
+ success: z.boolean(),
139
+ content: components.ProductListResponse$outboundSchema,
140
140
  });
141
141
 
142
142
  /**
@@ -37,11 +37,11 @@ export type GetSkusRequest = {
37
37
  };
38
38
 
39
39
  export type Content = {
40
- skus?: Array<components.Sku> | undefined;
40
+ skus: Array<components.Sku>;
41
41
  /**
42
42
  * pagination metadata structure
43
43
  */
44
- pagination?: components.Pagination | undefined;
44
+ pagination: components.Pagination;
45
45
  };
46
46
 
47
47
  /**
@@ -133,14 +133,14 @@ export function getSkusRequestFromJSON(
133
133
  /** @internal */
134
134
  export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
135
135
  z.object({
136
- skus: z.array(components.Sku$inboundSchema).optional(),
137
- pagination: components.Pagination$inboundSchema.optional(),
136
+ skus: z.array(components.Sku$inboundSchema),
137
+ pagination: components.Pagination$inboundSchema,
138
138
  });
139
139
 
140
140
  /** @internal */
141
141
  export type Content$Outbound = {
142
- skus?: Array<components.Sku$Outbound> | undefined;
143
- pagination?: components.Pagination$Outbound | undefined;
142
+ skus: Array<components.Sku$Outbound>;
143
+ pagination: components.Pagination$Outbound;
144
144
  };
145
145
 
146
146
  /** @internal */
@@ -149,8 +149,8 @@ export const Content$outboundSchema: z.ZodType<
149
149
  z.ZodTypeDef,
150
150
  Content
151
151
  > = z.object({
152
- skus: z.array(components.Sku$outboundSchema).optional(),
153
- pagination: components.Pagination$outboundSchema.optional(),
152
+ skus: z.array(components.Sku$outboundSchema),
153
+ pagination: components.Pagination$outboundSchema,
154
154
  });
155
155
 
156
156
  /**