ce-storefront 0.3.5 → 0.3.7

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 (158) hide show
  1. package/esm/lib/config.d.ts +3 -3
  2. package/esm/lib/config.js +3 -3
  3. package/esm/models/components/analyticsevent.d.ts +8 -8
  4. package/esm/models/components/analyticsevent.d.ts.map +1 -1
  5. package/esm/models/components/analyticsevent.js +12 -12
  6. package/esm/models/components/analyticsevent.js.map +1 -1
  7. package/esm/models/components/associatedoption.d.ts +125 -0
  8. package/esm/models/components/associatedoption.d.ts.map +1 -0
  9. package/esm/models/components/associatedoption.js +107 -0
  10. package/esm/models/components/associatedoption.js.map +1 -0
  11. package/esm/models/components/bundleproduct.d.ts +236 -0
  12. package/esm/models/components/bundleproduct.d.ts.map +1 -0
  13. package/esm/models/components/bundleproduct.js +262 -0
  14. package/esm/models/components/bundleproduct.js.map +1 -0
  15. package/esm/models/components/bundleproductdetail.d.ts +265 -0
  16. package/esm/models/components/bundleproductdetail.d.ts.map +1 -0
  17. package/esm/models/components/bundleproductdetail.js +288 -0
  18. package/esm/models/components/bundleproductdetail.js.map +1 -0
  19. package/esm/models/components/cart.d.ts +15 -15
  20. package/esm/models/components/cart.d.ts.map +1 -1
  21. package/esm/models/components/cart.js +15 -15
  22. package/esm/models/components/cart.js.map +1 -1
  23. package/esm/models/components/discountbasedpromotion.d.ts +0 -2
  24. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  25. package/esm/models/components/discountbasedpromotion.js +0 -4
  26. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  27. package/esm/models/components/fixedpricepromotion.d.ts +0 -2
  28. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  29. package/esm/models/components/fixedpricepromotion.js +0 -4
  30. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  31. package/esm/models/components/freegoodspromotion.d.ts +0 -5
  32. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  33. package/esm/models/components/freegoodspromotion.js +0 -4
  34. package/esm/models/components/freegoodspromotion.js.map +1 -1
  35. package/esm/models/components/index.d.ts +8 -6
  36. package/esm/models/components/index.d.ts.map +1 -1
  37. package/esm/models/components/index.js +8 -6
  38. package/esm/models/components/index.js.map +1 -1
  39. package/esm/models/components/productattribute.d.ts +97 -64
  40. package/esm/models/components/productattribute.d.ts.map +1 -1
  41. package/esm/models/components/productattribute.js +67 -128
  42. package/esm/models/components/productattribute.js.map +1 -1
  43. package/esm/models/components/productcategory.d.ts +2 -2
  44. package/esm/models/components/productcategory.d.ts.map +1 -1
  45. package/esm/models/components/productcategory.js +2 -2
  46. package/esm/models/components/productcategory.js.map +1 -1
  47. package/esm/models/components/productdetail.d.ts +16 -188
  48. package/esm/models/components/productdetail.d.ts.map +1 -1
  49. package/esm/models/components/productdetail.js +26 -228
  50. package/esm/models/components/productdetail.js.map +1 -1
  51. package/esm/models/components/productlistresponse.d.ts +49 -3
  52. package/esm/models/components/productlistresponse.d.ts.map +1 -1
  53. package/esm/models/components/productlistresponse.js +65 -3
  54. package/esm/models/components/productlistresponse.js.map +1 -1
  55. package/esm/models/components/productshipping.d.ts +13 -15
  56. package/esm/models/components/productshipping.d.ts.map +1 -1
  57. package/esm/models/components/productshipping.js +14 -18
  58. package/esm/models/components/productshipping.js.map +1 -1
  59. package/esm/models/components/{promotion.d.ts → promotiondetail.d.ts} +29 -29
  60. package/esm/models/components/promotiondetail.d.ts.map +1 -0
  61. package/esm/models/components/{promotion.js → promotiondetail.js} +29 -29
  62. package/esm/models/components/promotiondetail.js.map +1 -0
  63. package/esm/models/components/seo.d.ts +6 -6
  64. package/esm/models/components/seo.d.ts.map +1 -1
  65. package/esm/models/components/seo.js +6 -19
  66. package/esm/models/components/seo.js.map +1 -1
  67. package/esm/models/components/{product.d.ts → singleproduct.d.ts} +52 -75
  68. package/esm/models/components/singleproduct.d.ts.map +1 -0
  69. package/esm/models/components/{product.js → singleproduct.js} +37 -95
  70. package/esm/models/components/singleproduct.js.map +1 -0
  71. package/esm/models/components/singleproductdetail.d.ts +159 -0
  72. package/esm/models/components/singleproductdetail.d.ts.map +1 -0
  73. package/esm/models/components/singleproductdetail.js +156 -0
  74. package/esm/models/components/singleproductdetail.js.map +1 -0
  75. package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +59 -48
  76. package/esm/models/components/sku.d.ts.map +1 -0
  77. package/esm/models/components/{skuinfo.js → sku.js} +67 -57
  78. package/esm/models/components/sku.js.map +1 -0
  79. package/esm/models/components/variant.d.ts +42 -72
  80. package/esm/models/components/variant.d.ts.map +1 -1
  81. package/esm/models/components/variant.js +39 -82
  82. package/esm/models/components/variant.js.map +1 -1
  83. package/esm/models/components/variantdetail.d.ts +101 -68
  84. package/esm/models/components/variantdetail.d.ts.map +1 -1
  85. package/esm/models/components/variantdetail.js +99 -71
  86. package/esm/models/components/variantdetail.js.map +1 -1
  87. package/esm/models/components/variantoption.d.ts +118 -0
  88. package/esm/models/components/variantoption.d.ts.map +1 -0
  89. package/esm/models/components/variantoption.js +114 -0
  90. package/esm/models/components/variantoption.js.map +1 -0
  91. package/esm/models/components/volumebasedpromotion.d.ts +0 -5
  92. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  93. package/esm/models/components/volumebasedpromotion.js +0 -4
  94. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  95. package/esm/models/operations/getpromotions.d.ts +2 -2
  96. package/esm/models/operations/getpromotions.d.ts.map +1 -1
  97. package/esm/models/operations/getpromotions.js +2 -2
  98. package/esm/models/operations/getpromotions.js.map +1 -1
  99. package/esm/models/operations/getskus.d.ts +2 -2
  100. package/esm/models/operations/getskus.d.ts.map +1 -1
  101. package/esm/models/operations/getskus.js +2 -2
  102. package/esm/models/operations/getskus.js.map +1 -1
  103. package/esm/models/operations/getwishtlist.d.ts +2 -2
  104. package/esm/models/operations/getwishtlist.d.ts.map +1 -1
  105. package/esm/models/operations/getwishtlist.js +2 -2
  106. package/esm/models/operations/getwishtlist.js.map +1 -1
  107. package/jsr.json +1 -1
  108. package/package.json +1 -1
  109. package/src/lib/config.ts +3 -3
  110. package/src/models/components/analyticsevent.ts +16 -15
  111. package/src/models/components/associatedoption.ts +217 -0
  112. package/src/models/components/bundleproduct.ts +501 -0
  113. package/src/models/components/bundleproductdetail.ts +567 -0
  114. package/src/models/components/cart.ts +24 -24
  115. package/src/models/components/discountbasedpromotion.ts +0 -6
  116. package/src/models/components/fixedpricepromotion.ts +0 -6
  117. package/src/models/components/freegoodspromotion.ts +0 -9
  118. package/src/models/components/index.ts +8 -6
  119. package/src/models/components/productattribute.ts +162 -188
  120. package/src/models/components/productcategory.ts +4 -4
  121. package/src/models/components/productdetail.ts +52 -475
  122. package/src/models/components/productlistresponse.ts +147 -9
  123. package/src/models/components/productshipping.ts +27 -33
  124. package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
  125. package/src/models/components/seo.ts +12 -25
  126. package/src/models/components/singleproduct.ts +269 -0
  127. package/src/models/components/singleproductdetail.ts +339 -0
  128. package/src/models/components/sku.ts +252 -0
  129. package/src/models/components/variant.ts +81 -170
  130. package/src/models/components/variantdetail.ts +189 -168
  131. package/src/models/components/variantoption.ts +214 -0
  132. package/src/models/components/volumebasedpromotion.ts +0 -9
  133. package/src/models/operations/getpromotions.ts +4 -4
  134. package/src/models/operations/getskus.ts +4 -4
  135. package/src/models/operations/getwishtlist.ts +4 -4
  136. package/esm/models/components/product.d.ts.map +0 -1
  137. package/esm/models/components/product.js.map +0 -1
  138. package/esm/models/components/productbundleitem.d.ts +0 -47
  139. package/esm/models/components/productbundleitem.d.ts.map +0 -1
  140. package/esm/models/components/productbundleitem.js +0 -66
  141. package/esm/models/components/productbundleitem.js.map +0 -1
  142. package/esm/models/components/productpackaging.d.ts +0 -68
  143. package/esm/models/components/productpackaging.d.ts.map +0 -1
  144. package/esm/models/components/productpackaging.js +0 -88
  145. package/esm/models/components/productpackaging.js.map +0 -1
  146. package/esm/models/components/promotion.d.ts.map +0 -1
  147. package/esm/models/components/promotion.js.map +0 -1
  148. package/esm/models/components/saleschannel.d.ts +0 -39
  149. package/esm/models/components/saleschannel.d.ts.map +0 -1
  150. package/esm/models/components/saleschannel.js +0 -53
  151. package/esm/models/components/saleschannel.js.map +0 -1
  152. package/esm/models/components/skuinfo.d.ts.map +0 -1
  153. package/esm/models/components/skuinfo.js.map +0 -1
  154. package/src/models/components/product.ts +0 -363
  155. package/src/models/components/productbundleitem.ts +0 -127
  156. package/src/models/components/productpackaging.ts +0 -162
  157. package/src/models/components/saleschannel.ts +0 -96
  158. package/src/models/components/skuinfo.ts +0 -237
@@ -1,363 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
- import {
12
- ProductAttribute,
13
- ProductAttribute$inboundSchema,
14
- ProductAttribute$Outbound,
15
- ProductAttribute$outboundSchema,
16
- } from "./productattribute.js";
17
- import {
18
- ProductBundleItem,
19
- ProductBundleItem$inboundSchema,
20
- ProductBundleItem$Outbound,
21
- ProductBundleItem$outboundSchema,
22
- } from "./productbundleitem.js";
23
- import {
24
- ProductImage,
25
- ProductImage$inboundSchema,
26
- ProductImage$Outbound,
27
- ProductImage$outboundSchema,
28
- } from "./productimage.js";
29
- import {
30
- ProductPricing,
31
- ProductPricing$inboundSchema,
32
- ProductPricing$Outbound,
33
- ProductPricing$outboundSchema,
34
- } from "./productpricing.js";
35
- import {
36
- ProductPromotion,
37
- ProductPromotion$inboundSchema,
38
- ProductPromotion$Outbound,
39
- ProductPromotion$outboundSchema,
40
- } from "./productpromotion.js";
41
- import {
42
- ProductShipping,
43
- ProductShipping$inboundSchema,
44
- ProductShipping$Outbound,
45
- ProductShipping$outboundSchema,
46
- } from "./productshipping.js";
47
- import {
48
- ProductSubscription,
49
- ProductSubscription$inboundSchema,
50
- ProductSubscription$Outbound,
51
- ProductSubscription$outboundSchema,
52
- } from "./productsubscription.js";
53
- import {
54
- Variant,
55
- Variant$inboundSchema,
56
- Variant$Outbound,
57
- Variant$outboundSchema,
58
- } from "./variant.js";
59
-
60
- export const ProductType = {
61
- Physical: "physical",
62
- Digital: "digital",
63
- Bundle: "bundle",
64
- } as const;
65
- export type ProductType = ClosedEnum<typeof ProductType>;
66
-
67
- export type VariantOptions = {
68
- optionName?: string | undefined;
69
- optionValue?: Array<string> | undefined;
70
- };
71
-
72
- export type Product = {
73
- /**
74
- * The ULID of the product
75
- */
76
- id?: string | undefined;
77
- name?: string | undefined;
78
- shortDescription?: string | undefined;
79
- productType?: ProductType | undefined;
80
- active?: boolean | undefined;
81
- sku?: string | undefined;
82
- stockAvailable?: boolean | undefined;
83
- isFeatured?: boolean | undefined;
84
- onOffer?: boolean | undefined;
85
- onSubscription?: boolean | undefined;
86
- onPromotion?: boolean | undefined;
87
- hasVariant?: boolean | undefined;
88
- /**
89
- * this will be used if has_variant is true, to auto set default values.
90
- */
91
- variantOptions?: Array<VariantOptions> | null | undefined;
92
- attributes?: Array<ProductAttribute> | undefined;
93
- images?: Array<ProductImage> | undefined;
94
- pricing?: ProductPricing | undefined;
95
- shipping?: ProductShipping | undefined;
96
- tags?: Array<string> | null | undefined;
97
- categoryIds?: Array<string> | undefined;
98
- reviewsRatingSum?: number | undefined;
99
- reviewsCount?: number | undefined;
100
- hsnCode?: string | undefined;
101
- createdAt?: Date | undefined;
102
- modifiedAt?: Date | undefined;
103
- promotion?: Array<ProductPromotion> | undefined;
104
- subscription?: Array<ProductSubscription> | undefined;
105
- bundleItems?: Array<ProductBundleItem> | undefined;
106
- variants?: Array<Variant> | undefined;
107
- };
108
-
109
- /** @internal */
110
- export const ProductType$inboundSchema: z.ZodNativeEnum<typeof ProductType> = z
111
- .nativeEnum(ProductType);
112
-
113
- /** @internal */
114
- export const ProductType$outboundSchema: z.ZodNativeEnum<typeof ProductType> =
115
- ProductType$inboundSchema;
116
-
117
- /**
118
- * @internal
119
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
120
- */
121
- export namespace ProductType$ {
122
- /** @deprecated use `ProductType$inboundSchema` instead. */
123
- export const inboundSchema = ProductType$inboundSchema;
124
- /** @deprecated use `ProductType$outboundSchema` instead. */
125
- export const outboundSchema = ProductType$outboundSchema;
126
- }
127
-
128
- /** @internal */
129
- export const VariantOptions$inboundSchema: z.ZodType<
130
- VariantOptions,
131
- z.ZodTypeDef,
132
- unknown
133
- > = z.object({
134
- option_name: z.string().optional(),
135
- option_value: z.array(z.string()).optional(),
136
- }).transform((v) => {
137
- return remap$(v, {
138
- "option_name": "optionName",
139
- "option_value": "optionValue",
140
- });
141
- });
142
-
143
- /** @internal */
144
- export type VariantOptions$Outbound = {
145
- option_name?: string | undefined;
146
- option_value?: Array<string> | undefined;
147
- };
148
-
149
- /** @internal */
150
- export const VariantOptions$outboundSchema: z.ZodType<
151
- VariantOptions$Outbound,
152
- z.ZodTypeDef,
153
- VariantOptions
154
- > = z.object({
155
- optionName: z.string().optional(),
156
- optionValue: z.array(z.string()).optional(),
157
- }).transform((v) => {
158
- return remap$(v, {
159
- optionName: "option_name",
160
- optionValue: "option_value",
161
- });
162
- });
163
-
164
- /**
165
- * @internal
166
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
167
- */
168
- export namespace VariantOptions$ {
169
- /** @deprecated use `VariantOptions$inboundSchema` instead. */
170
- export const inboundSchema = VariantOptions$inboundSchema;
171
- /** @deprecated use `VariantOptions$outboundSchema` instead. */
172
- export const outboundSchema = VariantOptions$outboundSchema;
173
- /** @deprecated use `VariantOptions$Outbound` instead. */
174
- export type Outbound = VariantOptions$Outbound;
175
- }
176
-
177
- export function variantOptionsToJSON(variantOptions: VariantOptions): string {
178
- return JSON.stringify(VariantOptions$outboundSchema.parse(variantOptions));
179
- }
180
-
181
- export function variantOptionsFromJSON(
182
- jsonString: string,
183
- ): SafeParseResult<VariantOptions, SDKValidationError> {
184
- return safeParse(
185
- jsonString,
186
- (x) => VariantOptions$inboundSchema.parse(JSON.parse(x)),
187
- `Failed to parse 'VariantOptions' from JSON`,
188
- );
189
- }
190
-
191
- /** @internal */
192
- export const Product$inboundSchema: z.ZodType<Product, z.ZodTypeDef, unknown> =
193
- z.object({
194
- id: z.string().optional(),
195
- name: z.string().optional(),
196
- short_description: z.string().optional(),
197
- product_type: ProductType$inboundSchema.optional(),
198
- active: z.boolean().default(true),
199
- sku: z.string().optional(),
200
- stock_available: z.boolean().default(true),
201
- is_featured: z.boolean().default(false),
202
- on_offer: z.boolean().default(false),
203
- on_subscription: z.boolean().default(false),
204
- on_promotion: z.boolean().default(false),
205
- has_variant: z.boolean().default(false),
206
- variant_options: z.nullable(
207
- z.array(z.lazy(() => VariantOptions$inboundSchema)),
208
- ).optional(),
209
- attributes: z.array(ProductAttribute$inboundSchema).optional(),
210
- images: z.array(ProductImage$inboundSchema).optional(),
211
- pricing: ProductPricing$inboundSchema.optional(),
212
- shipping: ProductShipping$inboundSchema.optional(),
213
- tags: z.nullable(z.array(z.string())).optional(),
214
- category_ids: z.array(z.string()).optional(),
215
- reviews_rating_sum: z.number().optional(),
216
- reviews_count: z.number().int().optional(),
217
- hsn_code: z.string().optional(),
218
- created_at: z.string().datetime({ offset: true }).transform(v =>
219
- new Date(v)
220
- ).optional(),
221
- modified_at: z.string().datetime({ offset: true }).transform(v =>
222
- new Date(v)
223
- ).optional(),
224
- promotion: z.array(ProductPromotion$inboundSchema).optional(),
225
- subscription: z.array(ProductSubscription$inboundSchema).optional(),
226
- bundle_items: z.array(ProductBundleItem$inboundSchema).optional(),
227
- variants: z.array(Variant$inboundSchema).optional(),
228
- }).transform((v) => {
229
- return remap$(v, {
230
- "short_description": "shortDescription",
231
- "product_type": "productType",
232
- "stock_available": "stockAvailable",
233
- "is_featured": "isFeatured",
234
- "on_offer": "onOffer",
235
- "on_subscription": "onSubscription",
236
- "on_promotion": "onPromotion",
237
- "has_variant": "hasVariant",
238
- "variant_options": "variantOptions",
239
- "category_ids": "categoryIds",
240
- "reviews_rating_sum": "reviewsRatingSum",
241
- "reviews_count": "reviewsCount",
242
- "hsn_code": "hsnCode",
243
- "created_at": "createdAt",
244
- "modified_at": "modifiedAt",
245
- "bundle_items": "bundleItems",
246
- });
247
- });
248
-
249
- /** @internal */
250
- export type Product$Outbound = {
251
- id?: string | undefined;
252
- name?: string | undefined;
253
- short_description?: string | undefined;
254
- product_type?: string | undefined;
255
- active: boolean;
256
- sku?: string | undefined;
257
- stock_available: boolean;
258
- is_featured: boolean;
259
- on_offer: boolean;
260
- on_subscription: boolean;
261
- on_promotion: boolean;
262
- has_variant: boolean;
263
- variant_options?: Array<VariantOptions$Outbound> | null | undefined;
264
- attributes?: Array<ProductAttribute$Outbound> | undefined;
265
- images?: Array<ProductImage$Outbound> | undefined;
266
- pricing?: ProductPricing$Outbound | undefined;
267
- shipping?: ProductShipping$Outbound | undefined;
268
- tags?: Array<string> | null | undefined;
269
- category_ids?: Array<string> | undefined;
270
- reviews_rating_sum?: number | undefined;
271
- reviews_count?: number | undefined;
272
- hsn_code?: string | undefined;
273
- created_at?: string | undefined;
274
- modified_at?: string | undefined;
275
- promotion?: Array<ProductPromotion$Outbound> | undefined;
276
- subscription?: Array<ProductSubscription$Outbound> | undefined;
277
- bundle_items?: Array<ProductBundleItem$Outbound> | undefined;
278
- variants?: Array<Variant$Outbound> | undefined;
279
- };
280
-
281
- /** @internal */
282
- export const Product$outboundSchema: z.ZodType<
283
- Product$Outbound,
284
- z.ZodTypeDef,
285
- Product
286
- > = z.object({
287
- id: z.string().optional(),
288
- name: z.string().optional(),
289
- shortDescription: z.string().optional(),
290
- productType: ProductType$outboundSchema.optional(),
291
- active: z.boolean().default(true),
292
- sku: z.string().optional(),
293
- stockAvailable: z.boolean().default(true),
294
- isFeatured: z.boolean().default(false),
295
- onOffer: z.boolean().default(false),
296
- onSubscription: z.boolean().default(false),
297
- onPromotion: z.boolean().default(false),
298
- hasVariant: z.boolean().default(false),
299
- variantOptions: z.nullable(
300
- z.array(z.lazy(() => VariantOptions$outboundSchema)),
301
- ).optional(),
302
- attributes: z.array(ProductAttribute$outboundSchema).optional(),
303
- images: z.array(ProductImage$outboundSchema).optional(),
304
- pricing: ProductPricing$outboundSchema.optional(),
305
- shipping: ProductShipping$outboundSchema.optional(),
306
- tags: z.nullable(z.array(z.string())).optional(),
307
- categoryIds: z.array(z.string()).optional(),
308
- reviewsRatingSum: z.number().optional(),
309
- reviewsCount: z.number().int().optional(),
310
- hsnCode: z.string().optional(),
311
- createdAt: z.date().transform(v => v.toISOString()).optional(),
312
- modifiedAt: z.date().transform(v => v.toISOString()).optional(),
313
- promotion: z.array(ProductPromotion$outboundSchema).optional(),
314
- subscription: z.array(ProductSubscription$outboundSchema).optional(),
315
- bundleItems: z.array(ProductBundleItem$outboundSchema).optional(),
316
- variants: z.array(Variant$outboundSchema).optional(),
317
- }).transform((v) => {
318
- return remap$(v, {
319
- shortDescription: "short_description",
320
- productType: "product_type",
321
- stockAvailable: "stock_available",
322
- isFeatured: "is_featured",
323
- onOffer: "on_offer",
324
- onSubscription: "on_subscription",
325
- onPromotion: "on_promotion",
326
- hasVariant: "has_variant",
327
- variantOptions: "variant_options",
328
- categoryIds: "category_ids",
329
- reviewsRatingSum: "reviews_rating_sum",
330
- reviewsCount: "reviews_count",
331
- hsnCode: "hsn_code",
332
- createdAt: "created_at",
333
- modifiedAt: "modified_at",
334
- bundleItems: "bundle_items",
335
- });
336
- });
337
-
338
- /**
339
- * @internal
340
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
341
- */
342
- export namespace Product$ {
343
- /** @deprecated use `Product$inboundSchema` instead. */
344
- export const inboundSchema = Product$inboundSchema;
345
- /** @deprecated use `Product$outboundSchema` instead. */
346
- export const outboundSchema = Product$outboundSchema;
347
- /** @deprecated use `Product$Outbound` instead. */
348
- export type Outbound = Product$Outbound;
349
- }
350
-
351
- export function productToJSON(product: Product): string {
352
- return JSON.stringify(Product$outboundSchema.parse(product));
353
- }
354
-
355
- export function productFromJSON(
356
- jsonString: string,
357
- ): SafeParseResult<Product, SDKValidationError> {
358
- return safeParse(
359
- jsonString,
360
- (x) => Product$inboundSchema.parse(JSON.parse(x)),
361
- `Failed to parse 'Product' from JSON`,
362
- );
363
- }
@@ -1,127 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
- import {
11
- ProductImage,
12
- ProductImage$inboundSchema,
13
- ProductImage$Outbound,
14
- ProductImage$outboundSchema,
15
- } from "./productimage.js";
16
- import {
17
- ProductPricing,
18
- ProductPricing$inboundSchema,
19
- ProductPricing$Outbound,
20
- ProductPricing$outboundSchema,
21
- } from "./productpricing.js";
22
-
23
- export type ProductBundleItem = {
24
- productId: string;
25
- productName: string;
26
- quantity: number;
27
- sku?: string | undefined;
28
- stockAvailable?: boolean | undefined;
29
- pricing?: ProductPricing | undefined;
30
- images?: Array<ProductImage> | undefined;
31
- reviewsRatingSum?: number | undefined;
32
- reviewsCount?: number | undefined;
33
- };
34
-
35
- /** @internal */
36
- export const ProductBundleItem$inboundSchema: z.ZodType<
37
- ProductBundleItem,
38
- z.ZodTypeDef,
39
- unknown
40
- > = z.object({
41
- product_id: z.string(),
42
- product_name: z.string(),
43
- quantity: z.number().int(),
44
- sku: z.string().optional(),
45
- stock_available: z.boolean().optional(),
46
- pricing: ProductPricing$inboundSchema.optional(),
47
- images: z.array(ProductImage$inboundSchema).optional(),
48
- reviews_rating_sum: z.number().optional(),
49
- reviews_count: z.number().int().optional(),
50
- }).transform((v) => {
51
- return remap$(v, {
52
- "product_id": "productId",
53
- "product_name": "productName",
54
- "stock_available": "stockAvailable",
55
- "reviews_rating_sum": "reviewsRatingSum",
56
- "reviews_count": "reviewsCount",
57
- });
58
- });
59
-
60
- /** @internal */
61
- export type ProductBundleItem$Outbound = {
62
- product_id: string;
63
- product_name: string;
64
- quantity: number;
65
- sku?: string | undefined;
66
- stock_available?: boolean | undefined;
67
- pricing?: ProductPricing$Outbound | undefined;
68
- images?: Array<ProductImage$Outbound> | undefined;
69
- reviews_rating_sum?: number | undefined;
70
- reviews_count?: number | undefined;
71
- };
72
-
73
- /** @internal */
74
- export const ProductBundleItem$outboundSchema: z.ZodType<
75
- ProductBundleItem$Outbound,
76
- z.ZodTypeDef,
77
- ProductBundleItem
78
- > = z.object({
79
- productId: z.string(),
80
- productName: z.string(),
81
- quantity: z.number().int(),
82
- sku: z.string().optional(),
83
- stockAvailable: z.boolean().optional(),
84
- pricing: ProductPricing$outboundSchema.optional(),
85
- images: z.array(ProductImage$outboundSchema).optional(),
86
- reviewsRatingSum: z.number().optional(),
87
- reviewsCount: z.number().int().optional(),
88
- }).transform((v) => {
89
- return remap$(v, {
90
- productId: "product_id",
91
- productName: "product_name",
92
- stockAvailable: "stock_available",
93
- reviewsRatingSum: "reviews_rating_sum",
94
- reviewsCount: "reviews_count",
95
- });
96
- });
97
-
98
- /**
99
- * @internal
100
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
- */
102
- export namespace ProductBundleItem$ {
103
- /** @deprecated use `ProductBundleItem$inboundSchema` instead. */
104
- export const inboundSchema = ProductBundleItem$inboundSchema;
105
- /** @deprecated use `ProductBundleItem$outboundSchema` instead. */
106
- export const outboundSchema = ProductBundleItem$outboundSchema;
107
- /** @deprecated use `ProductBundleItem$Outbound` instead. */
108
- export type Outbound = ProductBundleItem$Outbound;
109
- }
110
-
111
- export function productBundleItemToJSON(
112
- productBundleItem: ProductBundleItem,
113
- ): string {
114
- return JSON.stringify(
115
- ProductBundleItem$outboundSchema.parse(productBundleItem),
116
- );
117
- }
118
-
119
- export function productBundleItemFromJSON(
120
- jsonString: string,
121
- ): SafeParseResult<ProductBundleItem, SDKValidationError> {
122
- return safeParse(
123
- jsonString,
124
- (x) => ProductBundleItem$inboundSchema.parse(JSON.parse(x)),
125
- `Failed to parse 'ProductBundleItem' from JSON`,
126
- );
127
- }
@@ -1,162 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- export type ProductPackaging = {
12
- /**
13
- * in cm
14
- */
15
- packWidth?: number | undefined;
16
- /**
17
- * in cm
18
- */
19
- packHeight?: number | undefined;
20
- /**
21
- * in cm
22
- */
23
- packLength?: number | undefined;
24
- /**
25
- * in kg
26
- */
27
- packDryWeight?: number | undefined;
28
- /**
29
- * in kg
30
- */
31
- calculatedWeight?: number | undefined;
32
- unitsPerPack?: number | undefined;
33
- volumeOfPacksize?: number | undefined;
34
- verticalRotation?: boolean | undefined;
35
- shipperWidth?: number | undefined;
36
- shipperHeight?: number | undefined;
37
- shipperLength?: number | undefined;
38
- shipperDryWeight?: number | undefined;
39
- unitsPerShipper?: number | undefined;
40
- };
41
-
42
- /** @internal */
43
- export const ProductPackaging$inboundSchema: z.ZodType<
44
- ProductPackaging,
45
- z.ZodTypeDef,
46
- unknown
47
- > = z.object({
48
- pack_width: z.number().optional(),
49
- pack_height: z.number().optional(),
50
- pack_length: z.number().optional(),
51
- pack_dry_weight: z.number().optional(),
52
- calculated_weight: z.number().optional(),
53
- units_per_pack: z.number().int().optional(),
54
- volume_of_packsize: z.number().optional(),
55
- vertical_rotation: z.boolean().optional(),
56
- shipper_width: z.number().optional(),
57
- shipper_height: z.number().optional(),
58
- shipper_length: z.number().optional(),
59
- shipper_dry_weight: z.number().optional(),
60
- units_per_shipper: z.number().int().optional(),
61
- }).transform((v) => {
62
- return remap$(v, {
63
- "pack_width": "packWidth",
64
- "pack_height": "packHeight",
65
- "pack_length": "packLength",
66
- "pack_dry_weight": "packDryWeight",
67
- "calculated_weight": "calculatedWeight",
68
- "units_per_pack": "unitsPerPack",
69
- "volume_of_packsize": "volumeOfPacksize",
70
- "vertical_rotation": "verticalRotation",
71
- "shipper_width": "shipperWidth",
72
- "shipper_height": "shipperHeight",
73
- "shipper_length": "shipperLength",
74
- "shipper_dry_weight": "shipperDryWeight",
75
- "units_per_shipper": "unitsPerShipper",
76
- });
77
- });
78
-
79
- /** @internal */
80
- export type ProductPackaging$Outbound = {
81
- pack_width?: number | undefined;
82
- pack_height?: number | undefined;
83
- pack_length?: number | undefined;
84
- pack_dry_weight?: number | undefined;
85
- calculated_weight?: number | undefined;
86
- units_per_pack?: number | undefined;
87
- volume_of_packsize?: number | undefined;
88
- vertical_rotation?: boolean | undefined;
89
- shipper_width?: number | undefined;
90
- shipper_height?: number | undefined;
91
- shipper_length?: number | undefined;
92
- shipper_dry_weight?: number | undefined;
93
- units_per_shipper?: number | undefined;
94
- };
95
-
96
- /** @internal */
97
- export const ProductPackaging$outboundSchema: z.ZodType<
98
- ProductPackaging$Outbound,
99
- z.ZodTypeDef,
100
- ProductPackaging
101
- > = z.object({
102
- packWidth: z.number().optional(),
103
- packHeight: z.number().optional(),
104
- packLength: z.number().optional(),
105
- packDryWeight: z.number().optional(),
106
- calculatedWeight: z.number().optional(),
107
- unitsPerPack: z.number().int().optional(),
108
- volumeOfPacksize: z.number().optional(),
109
- verticalRotation: z.boolean().optional(),
110
- shipperWidth: z.number().optional(),
111
- shipperHeight: z.number().optional(),
112
- shipperLength: z.number().optional(),
113
- shipperDryWeight: z.number().optional(),
114
- unitsPerShipper: z.number().int().optional(),
115
- }).transform((v) => {
116
- return remap$(v, {
117
- packWidth: "pack_width",
118
- packHeight: "pack_height",
119
- packLength: "pack_length",
120
- packDryWeight: "pack_dry_weight",
121
- calculatedWeight: "calculated_weight",
122
- unitsPerPack: "units_per_pack",
123
- volumeOfPacksize: "volume_of_packsize",
124
- verticalRotation: "vertical_rotation",
125
- shipperWidth: "shipper_width",
126
- shipperHeight: "shipper_height",
127
- shipperLength: "shipper_length",
128
- shipperDryWeight: "shipper_dry_weight",
129
- unitsPerShipper: "units_per_shipper",
130
- });
131
- });
132
-
133
- /**
134
- * @internal
135
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
136
- */
137
- export namespace ProductPackaging$ {
138
- /** @deprecated use `ProductPackaging$inboundSchema` instead. */
139
- export const inboundSchema = ProductPackaging$inboundSchema;
140
- /** @deprecated use `ProductPackaging$outboundSchema` instead. */
141
- export const outboundSchema = ProductPackaging$outboundSchema;
142
- /** @deprecated use `ProductPackaging$Outbound` instead. */
143
- export type Outbound = ProductPackaging$Outbound;
144
- }
145
-
146
- export function productPackagingToJSON(
147
- productPackaging: ProductPackaging,
148
- ): string {
149
- return JSON.stringify(
150
- ProductPackaging$outboundSchema.parse(productPackaging),
151
- );
152
- }
153
-
154
- export function productPackagingFromJSON(
155
- jsonString: string,
156
- ): SafeParseResult<ProductPackaging, SDKValidationError> {
157
- return safeParse(
158
- jsonString,
159
- (x) => ProductPackaging$inboundSchema.parse(JSON.parse(x)),
160
- `Failed to parse 'ProductPackaging' from JSON`,
161
- );
162
- }