ce-storefront 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/components/index.d.ts +3 -5
  4. package/esm/models/components/index.d.ts.map +1 -1
  5. package/esm/models/components/index.js +3 -5
  6. package/esm/models/components/index.js.map +1 -1
  7. package/esm/models/components/{singleproduct.d.ts → product.d.ts} +17 -14
  8. package/esm/models/components/product.d.ts.map +1 -0
  9. package/esm/models/components/{singleproduct.js → product.js} +19 -14
  10. package/esm/models/components/product.js.map +1 -0
  11. package/esm/models/components/productbundleitem.d.ts +142 -0
  12. package/esm/models/components/productbundleitem.d.ts.map +1 -0
  13. package/esm/models/components/productbundleitem.js +171 -0
  14. package/esm/models/components/productbundleitem.js.map +1 -0
  15. package/esm/models/components/productdetail.d.ts +139 -4
  16. package/esm/models/components/productdetail.d.ts.map +1 -1
  17. package/esm/models/components/productdetail.js +136 -10
  18. package/esm/models/components/productdetail.js.map +1 -1
  19. package/esm/models/components/productlist.d.ts +36 -0
  20. package/esm/models/components/productlist.d.ts.map +1 -0
  21. package/esm/models/components/productlist.js +35 -0
  22. package/esm/models/components/productlist.js.map +1 -0
  23. package/esm/models/operations/getcrosssell.d.ts +2 -2
  24. package/esm/models/operations/getcrosssell.d.ts.map +1 -1
  25. package/esm/models/operations/getcrosssell.js +2 -2
  26. package/esm/models/operations/getcrosssell.js.map +1 -1
  27. package/esm/models/operations/getproducts.d.ts +32 -2
  28. package/esm/models/operations/getproducts.d.ts.map +1 -1
  29. package/esm/models/operations/getproducts.js +29 -2
  30. package/esm/models/operations/getproducts.js.map +1 -1
  31. package/esm/models/operations/getsimilar.d.ts +2 -2
  32. package/esm/models/operations/getsimilar.d.ts.map +1 -1
  33. package/esm/models/operations/getsimilar.js +2 -2
  34. package/esm/models/operations/getsimilar.js.map +1 -1
  35. package/esm/models/operations/getskus.d.ts +15 -15
  36. package/esm/models/operations/getskus.d.ts.map +1 -1
  37. package/esm/models/operations/getskus.js +15 -15
  38. package/esm/models/operations/getskus.js.map +1 -1
  39. package/esm/models/operations/getupsell.d.ts +2 -2
  40. package/esm/models/operations/getupsell.d.ts.map +1 -1
  41. package/esm/models/operations/getupsell.js +2 -2
  42. package/esm/models/operations/getupsell.js.map +1 -1
  43. package/jsr.json +1 -1
  44. package/package.json +1 -1
  45. package/src/lib/config.ts +2 -2
  46. package/src/models/components/index.ts +3 -5
  47. package/src/models/components/{singleproduct.ts → product.ts} +69 -60
  48. package/src/models/components/productbundleitem.ts +329 -0
  49. package/src/models/components/productdetail.ts +295 -22
  50. package/src/models/components/productlist.ts +81 -0
  51. package/src/models/operations/getcrosssell.ts +4 -4
  52. package/src/models/operations/getproducts.ts +62 -4
  53. package/src/models/operations/getsimilar.ts +4 -4
  54. package/src/models/operations/getskus.ts +30 -27
  55. package/src/models/operations/getupsell.ts +4 -4
  56. package/esm/models/components/bundleproduct.d.ts +0 -236
  57. package/esm/models/components/bundleproduct.d.ts.map +0 -1
  58. package/esm/models/components/bundleproduct.js +0 -258
  59. package/esm/models/components/bundleproduct.js.map +0 -1
  60. package/esm/models/components/bundleproductdetail.d.ts +0 -265
  61. package/esm/models/components/bundleproductdetail.d.ts.map +0 -1
  62. package/esm/models/components/bundleproductdetail.js +0 -284
  63. package/esm/models/components/bundleproductdetail.js.map +0 -1
  64. package/esm/models/components/productlistresponse.d.ts +0 -58
  65. package/esm/models/components/productlistresponse.d.ts.map +0 -1
  66. package/esm/models/components/productlistresponse.js +0 -57
  67. package/esm/models/components/productlistresponse.js.map +0 -1
  68. package/esm/models/components/singleproduct.d.ts.map +0 -1
  69. package/esm/models/components/singleproduct.js.map +0 -1
  70. package/esm/models/components/singleproductdetail.d.ts +0 -159
  71. package/esm/models/components/singleproductdetail.d.ts.map +0 -1
  72. package/esm/models/components/singleproductdetail.js +0 -156
  73. package/esm/models/components/singleproductdetail.js.map +0 -1
  74. package/src/models/components/bundleproduct.ts +0 -494
  75. package/src/models/components/bundleproductdetail.ts +0 -560
  76. package/src/models/components/productlistresponse.ts +0 -141
  77. package/src/models/components/singleproductdetail.ts +0 -339
@@ -1,339 +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
- ProductImage,
19
- ProductImage$inboundSchema,
20
- ProductImage$Outbound,
21
- ProductImage$outboundSchema,
22
- } from "./productimage.js";
23
- import {
24
- ProductPricing,
25
- ProductPricing$inboundSchema,
26
- ProductPricing$Outbound,
27
- ProductPricing$outboundSchema,
28
- } from "./productpricing.js";
29
- import {
30
- ProductPromotion,
31
- ProductPromotion$inboundSchema,
32
- ProductPromotion$Outbound,
33
- ProductPromotion$outboundSchema,
34
- } from "./productpromotion.js";
35
- import {
36
- ProductShipping,
37
- ProductShipping$inboundSchema,
38
- ProductShipping$Outbound,
39
- ProductShipping$outboundSchema,
40
- } from "./productshipping.js";
41
- import {
42
- ProductSubscription,
43
- ProductSubscription$inboundSchema,
44
- ProductSubscription$Outbound,
45
- ProductSubscription$outboundSchema,
46
- } from "./productsubscription.js";
47
- import {
48
- ProductVideo,
49
- ProductVideo$inboundSchema,
50
- ProductVideo$Outbound,
51
- ProductVideo$outboundSchema,
52
- } from "./productvideo.js";
53
- import {
54
- Seo,
55
- Seo$inboundSchema,
56
- Seo$Outbound,
57
- Seo$outboundSchema,
58
- } from "./seo.js";
59
- import {
60
- Variant,
61
- Variant$inboundSchema,
62
- Variant$Outbound,
63
- Variant$outboundSchema,
64
- } from "./variant.js";
65
- import {
66
- VariantOption,
67
- VariantOption$inboundSchema,
68
- VariantOption$Outbound,
69
- VariantOption$outboundSchema,
70
- } from "./variantoption.js";
71
-
72
- export const SingleProductDetailProductType = {
73
- Physical: "physical",
74
- Digital: "digital",
75
- Bundle: "bundle",
76
- } as const;
77
- export type SingleProductDetailProductType = ClosedEnum<
78
- typeof SingleProductDetailProductType
79
- >;
80
-
81
- export type SingleProductDetail = {
82
- /**
83
- * The ULID of the product
84
- */
85
- id: string;
86
- sku: string | null;
87
- name: string;
88
- slug: string | null;
89
- shortDescription: string | null;
90
- productType: SingleProductDetailProductType;
91
- active: boolean;
92
- /**
93
- * Indicates whether the product has stock available
94
- */
95
- stockAvailable: boolean;
96
- /**
97
- * Indicates whether this item is associated with any active (product-specific) coupons
98
- */
99
- onOffer: boolean;
100
- /**
101
- * Indicates whether the product has any subscription plans avaialble
102
- */
103
- onSubscription: boolean;
104
- /**
105
- * Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion
106
- */
107
- onPromotion: boolean;
108
- /**
109
- * Indicates whether the product has variants
110
- */
111
- hasVariant: boolean;
112
- tags: Array<string> | null;
113
- categoryIds: Array<string>;
114
- reviewsRatingSum: number;
115
- reviewsCount: number;
116
- attributes: Array<ProductAttribute>;
117
- pricing: ProductPricing;
118
- /**
119
- * this will be used if has_variant is true, to auto set default values.
120
- */
121
- variantOptions: Array<VariantOption> | null;
122
- promotion: ProductPromotion | null;
123
- images: Array<ProductImage>;
124
- subscription: Array<ProductSubscription>;
125
- variants: Array<Variant>;
126
- description: string | null;
127
- hsnCode: string | null;
128
- videos: Array<ProductVideo>;
129
- shipping: ProductShipping | null;
130
- /**
131
- * An array of product ULIDs
132
- */
133
- upsellingProductIds: Array<string>;
134
- /**
135
- * An array of product ULIDs
136
- */
137
- crosssellingProductIds: Array<string>;
138
- seo: Seo;
139
- metadata: { [k: string]: string };
140
- };
141
-
142
- /** @internal */
143
- export const SingleProductDetailProductType$inboundSchema: z.ZodNativeEnum<
144
- typeof SingleProductDetailProductType
145
- > = z.nativeEnum(SingleProductDetailProductType);
146
-
147
- /** @internal */
148
- export const SingleProductDetailProductType$outboundSchema: z.ZodNativeEnum<
149
- typeof SingleProductDetailProductType
150
- > = SingleProductDetailProductType$inboundSchema;
151
-
152
- /**
153
- * @internal
154
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
155
- */
156
- export namespace SingleProductDetailProductType$ {
157
- /** @deprecated use `SingleProductDetailProductType$inboundSchema` instead. */
158
- export const inboundSchema = SingleProductDetailProductType$inboundSchema;
159
- /** @deprecated use `SingleProductDetailProductType$outboundSchema` instead. */
160
- export const outboundSchema = SingleProductDetailProductType$outboundSchema;
161
- }
162
-
163
- /** @internal */
164
- export const SingleProductDetail$inboundSchema: z.ZodType<
165
- SingleProductDetail,
166
- z.ZodTypeDef,
167
- unknown
168
- > = z.object({
169
- id: z.string(),
170
- sku: z.nullable(z.string()),
171
- name: z.string(),
172
- slug: z.nullable(z.string()),
173
- short_description: z.nullable(z.string()),
174
- product_type: SingleProductDetailProductType$inboundSchema,
175
- active: z.boolean(),
176
- stock_available: z.boolean(),
177
- on_offer: z.boolean(),
178
- on_subscription: z.boolean(),
179
- on_promotion: z.boolean(),
180
- has_variant: z.boolean(),
181
- tags: z.nullable(z.array(z.string())),
182
- category_ids: z.array(z.string()),
183
- reviews_rating_sum: z.number(),
184
- reviews_count: z.number().int(),
185
- attributes: z.array(ProductAttribute$inboundSchema),
186
- pricing: ProductPricing$inboundSchema,
187
- variant_options: z.nullable(z.array(VariantOption$inboundSchema)),
188
- promotion: z.nullable(ProductPromotion$inboundSchema),
189
- images: z.array(ProductImage$inboundSchema),
190
- subscription: z.array(ProductSubscription$inboundSchema),
191
- variants: z.array(Variant$inboundSchema),
192
- description: z.nullable(z.string()),
193
- hsn_code: z.nullable(z.string()),
194
- videos: z.array(ProductVideo$inboundSchema),
195
- shipping: z.nullable(ProductShipping$inboundSchema),
196
- upselling_product_ids: z.array(z.string()),
197
- crossselling_product_ids: z.array(z.string()),
198
- seo: Seo$inboundSchema,
199
- metadata: z.record(z.string()),
200
- }).transform((v) => {
201
- return remap$(v, {
202
- "short_description": "shortDescription",
203
- "product_type": "productType",
204
- "stock_available": "stockAvailable",
205
- "on_offer": "onOffer",
206
- "on_subscription": "onSubscription",
207
- "on_promotion": "onPromotion",
208
- "has_variant": "hasVariant",
209
- "category_ids": "categoryIds",
210
- "reviews_rating_sum": "reviewsRatingSum",
211
- "reviews_count": "reviewsCount",
212
- "variant_options": "variantOptions",
213
- "hsn_code": "hsnCode",
214
- "upselling_product_ids": "upsellingProductIds",
215
- "crossselling_product_ids": "crosssellingProductIds",
216
- });
217
- });
218
-
219
- /** @internal */
220
- export type SingleProductDetail$Outbound = {
221
- id: string;
222
- sku: string | null;
223
- name: string;
224
- slug: string | null;
225
- short_description: string | null;
226
- product_type: string;
227
- active: boolean;
228
- stock_available: boolean;
229
- on_offer: boolean;
230
- on_subscription: boolean;
231
- on_promotion: boolean;
232
- has_variant: boolean;
233
- tags: Array<string> | null;
234
- category_ids: Array<string>;
235
- reviews_rating_sum: number;
236
- reviews_count: number;
237
- attributes: Array<ProductAttribute$Outbound>;
238
- pricing: ProductPricing$Outbound;
239
- variant_options: Array<VariantOption$Outbound> | null;
240
- promotion: ProductPromotion$Outbound | null;
241
- images: Array<ProductImage$Outbound>;
242
- subscription: Array<ProductSubscription$Outbound>;
243
- variants: Array<Variant$Outbound>;
244
- description: string | null;
245
- hsn_code: string | null;
246
- videos: Array<ProductVideo$Outbound>;
247
- shipping: ProductShipping$Outbound | null;
248
- upselling_product_ids: Array<string>;
249
- crossselling_product_ids: Array<string>;
250
- seo: Seo$Outbound;
251
- metadata: { [k: string]: string };
252
- };
253
-
254
- /** @internal */
255
- export const SingleProductDetail$outboundSchema: z.ZodType<
256
- SingleProductDetail$Outbound,
257
- z.ZodTypeDef,
258
- SingleProductDetail
259
- > = z.object({
260
- id: z.string(),
261
- sku: z.nullable(z.string()),
262
- name: z.string(),
263
- slug: z.nullable(z.string()),
264
- shortDescription: z.nullable(z.string()),
265
- productType: SingleProductDetailProductType$outboundSchema,
266
- active: z.boolean(),
267
- stockAvailable: z.boolean(),
268
- onOffer: z.boolean(),
269
- onSubscription: z.boolean(),
270
- onPromotion: z.boolean(),
271
- hasVariant: z.boolean(),
272
- tags: z.nullable(z.array(z.string())),
273
- categoryIds: z.array(z.string()),
274
- reviewsRatingSum: z.number(),
275
- reviewsCount: z.number().int(),
276
- attributes: z.array(ProductAttribute$outboundSchema),
277
- pricing: ProductPricing$outboundSchema,
278
- variantOptions: z.nullable(z.array(VariantOption$outboundSchema)),
279
- promotion: z.nullable(ProductPromotion$outboundSchema),
280
- images: z.array(ProductImage$outboundSchema),
281
- subscription: z.array(ProductSubscription$outboundSchema),
282
- variants: z.array(Variant$outboundSchema),
283
- description: z.nullable(z.string()),
284
- hsnCode: z.nullable(z.string()),
285
- videos: z.array(ProductVideo$outboundSchema),
286
- shipping: z.nullable(ProductShipping$outboundSchema),
287
- upsellingProductIds: z.array(z.string()),
288
- crosssellingProductIds: z.array(z.string()),
289
- seo: Seo$outboundSchema,
290
- metadata: z.record(z.string()),
291
- }).transform((v) => {
292
- return remap$(v, {
293
- shortDescription: "short_description",
294
- productType: "product_type",
295
- stockAvailable: "stock_available",
296
- onOffer: "on_offer",
297
- onSubscription: "on_subscription",
298
- onPromotion: "on_promotion",
299
- hasVariant: "has_variant",
300
- categoryIds: "category_ids",
301
- reviewsRatingSum: "reviews_rating_sum",
302
- reviewsCount: "reviews_count",
303
- variantOptions: "variant_options",
304
- hsnCode: "hsn_code",
305
- upsellingProductIds: "upselling_product_ids",
306
- crosssellingProductIds: "crossselling_product_ids",
307
- });
308
- });
309
-
310
- /**
311
- * @internal
312
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
313
- */
314
- export namespace SingleProductDetail$ {
315
- /** @deprecated use `SingleProductDetail$inboundSchema` instead. */
316
- export const inboundSchema = SingleProductDetail$inboundSchema;
317
- /** @deprecated use `SingleProductDetail$outboundSchema` instead. */
318
- export const outboundSchema = SingleProductDetail$outboundSchema;
319
- /** @deprecated use `SingleProductDetail$Outbound` instead. */
320
- export type Outbound = SingleProductDetail$Outbound;
321
- }
322
-
323
- export function singleProductDetailToJSON(
324
- singleProductDetail: SingleProductDetail,
325
- ): string {
326
- return JSON.stringify(
327
- SingleProductDetail$outboundSchema.parse(singleProductDetail),
328
- );
329
- }
330
-
331
- export function singleProductDetailFromJSON(
332
- jsonString: string,
333
- ): SafeParseResult<SingleProductDetail, SDKValidationError> {
334
- return safeParse(
335
- jsonString,
336
- (x) => SingleProductDetail$inboundSchema.parse(JSON.parse(x)),
337
- `Failed to parse 'SingleProductDetail' from JSON`,
338
- );
339
- }