ce-storefront 0.13.0 → 0.13.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 (67) hide show
  1. package/esm/lib/config.d.ts +2 -2
  2. package/esm/lib/config.js +2 -2
  3. package/esm/models/components/appliedpromotion.d.ts +8 -8
  4. package/esm/models/components/appliedpromotion.d.ts.map +1 -1
  5. package/esm/models/components/appliedpromotion.js +12 -12
  6. package/esm/models/components/appliedpromotion.js.map +1 -1
  7. package/esm/models/components/discountbasedpromotion.d.ts +31 -0
  8. package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
  9. package/esm/models/components/discountbasedpromotion.js +21 -0
  10. package/esm/models/components/discountbasedpromotion.js.map +1 -1
  11. package/esm/models/components/fixedpricepromotion.d.ts +34 -2
  12. package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
  13. package/esm/models/components/fixedpricepromotion.js +23 -2
  14. package/esm/models/components/fixedpricepromotion.js.map +1 -1
  15. package/esm/models/components/freegoodspromotion.d.ts +32 -0
  16. package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
  17. package/esm/models/components/freegoodspromotion.js +21 -0
  18. package/esm/models/components/freegoodspromotion.js.map +1 -1
  19. package/esm/models/components/item.d.ts +8 -0
  20. package/esm/models/components/item.d.ts.map +1 -1
  21. package/esm/models/components/item.js +5 -0
  22. package/esm/models/components/item.js.map +1 -1
  23. package/esm/models/components/product.d.ts +5 -0
  24. package/esm/models/components/product.d.ts.map +1 -1
  25. package/esm/models/components/product.js +2 -0
  26. package/esm/models/components/product.js.map +1 -1
  27. package/esm/models/components/productbundleitem.d.ts +8 -0
  28. package/esm/models/components/productbundleitem.d.ts.map +1 -1
  29. package/esm/models/components/productbundleitem.js +5 -0
  30. package/esm/models/components/productbundleitem.js.map +1 -1
  31. package/esm/models/components/productdetail.d.ts +5 -0
  32. package/esm/models/components/productdetail.d.ts.map +1 -1
  33. package/esm/models/components/productdetail.js +2 -0
  34. package/esm/models/components/productdetail.js.map +1 -1
  35. package/esm/models/components/productpromotion.d.ts +2 -14
  36. package/esm/models/components/productpromotion.d.ts.map +1 -1
  37. package/esm/models/components/productshipping.d.ts +8 -16
  38. package/esm/models/components/productshipping.d.ts.map +1 -1
  39. package/esm/models/components/productshipping.js +12 -28
  40. package/esm/models/components/productshipping.js.map +1 -1
  41. package/esm/models/components/variant.d.ts +5 -0
  42. package/esm/models/components/variant.d.ts.map +1 -1
  43. package/esm/models/components/variant.js +2 -0
  44. package/esm/models/components/variant.js.map +1 -1
  45. package/esm/models/components/variantdetail.d.ts +5 -0
  46. package/esm/models/components/variantdetail.d.ts.map +1 -1
  47. package/esm/models/components/variantdetail.js +2 -0
  48. package/esm/models/components/variantdetail.js.map +1 -1
  49. package/esm/models/components/volumebasedpromotion.d.ts +34 -2
  50. package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
  51. package/esm/models/components/volumebasedpromotion.js +23 -2
  52. package/esm/models/components/volumebasedpromotion.js.map +1 -1
  53. package/jsr.json +1 -1
  54. package/package.json +1 -1
  55. package/src/lib/config.ts +2 -2
  56. package/src/models/components/appliedpromotion.ts +18 -16
  57. package/src/models/components/discountbasedpromotion.ts +30 -1
  58. package/src/models/components/fixedpricepromotion.ts +36 -4
  59. package/src/models/components/freegoodspromotion.ts +33 -1
  60. package/src/models/components/item.ts +17 -0
  61. package/src/models/components/product.ts +7 -0
  62. package/src/models/components/productbundleitem.ts +17 -0
  63. package/src/models/components/productdetail.ts +7 -0
  64. package/src/models/components/productshipping.ts +20 -44
  65. package/src/models/components/variant.ts +7 -0
  66. package/src/models/components/variantdetail.ts +7 -0
  67. package/src/models/components/volumebasedpromotion.ts +37 -4
@@ -9,14 +9,10 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
 
11
11
  export type ProductShipping = {
12
- additionalCost: number | null;
13
- shippingPriceIncludingTax: boolean;
14
- availabilityDescription: string | null;
15
- shipsInternationally?: boolean | undefined;
16
- midCode: string | null;
17
- countryOfOrigin?: string | null | undefined;
18
- taxType: string | null;
19
- taxRate: number | null;
12
+ handlingChargesIncludingTax: number;
13
+ handlingChargesExcludingTax: number;
14
+ taxType: string;
15
+ taxRate: number;
20
16
  };
21
17
 
22
18
  /** @internal */
@@ -25,22 +21,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
25
21
  z.ZodTypeDef,
26
22
  unknown
27
23
  > = z.object({
28
- additional_cost: z.nullable(z.number()),
29
- shipping_price_including_tax: z.boolean(),
30
- availability_description: z.nullable(z.string()),
31
- ships_internationally: z.boolean().default(false),
32
- mid_code: z.nullable(z.string()),
33
- country_of_origin: z.nullable(z.string().default("India")),
34
- tax_type: z.nullable(z.string()),
35
- tax_rate: z.nullable(z.number()),
24
+ handling_charges_including_tax: z.number(),
25
+ handling_charges_excluding_tax: z.number(),
26
+ tax_type: z.string(),
27
+ tax_rate: z.number(),
36
28
  }).transform((v) => {
37
29
  return remap$(v, {
38
- "additional_cost": "additionalCost",
39
- "shipping_price_including_tax": "shippingPriceIncludingTax",
40
- "availability_description": "availabilityDescription",
41
- "ships_internationally": "shipsInternationally",
42
- "mid_code": "midCode",
43
- "country_of_origin": "countryOfOrigin",
30
+ "handling_charges_including_tax": "handlingChargesIncludingTax",
31
+ "handling_charges_excluding_tax": "handlingChargesExcludingTax",
44
32
  "tax_type": "taxType",
45
33
  "tax_rate": "taxRate",
46
34
  });
@@ -48,14 +36,10 @@ export const ProductShipping$inboundSchema: z.ZodType<
48
36
 
49
37
  /** @internal */
50
38
  export type ProductShipping$Outbound = {
51
- additional_cost: number | null;
52
- shipping_price_including_tax: boolean;
53
- availability_description: string | null;
54
- ships_internationally: boolean;
55
- mid_code: string | null;
56
- country_of_origin: string | null;
57
- tax_type: string | null;
58
- tax_rate: number | null;
39
+ handling_charges_including_tax: number;
40
+ handling_charges_excluding_tax: number;
41
+ tax_type: string;
42
+ tax_rate: number;
59
43
  };
60
44
 
61
45
  /** @internal */
@@ -64,22 +48,14 @@ export const ProductShipping$outboundSchema: z.ZodType<
64
48
  z.ZodTypeDef,
65
49
  ProductShipping
66
50
  > = z.object({
67
- additionalCost: z.nullable(z.number()),
68
- shippingPriceIncludingTax: z.boolean(),
69
- availabilityDescription: z.nullable(z.string()),
70
- shipsInternationally: z.boolean().default(false),
71
- midCode: z.nullable(z.string()),
72
- countryOfOrigin: z.nullable(z.string().default("India")),
73
- taxType: z.nullable(z.string()),
74
- taxRate: z.nullable(z.number()),
51
+ handlingChargesIncludingTax: z.number(),
52
+ handlingChargesExcludingTax: z.number(),
53
+ taxType: z.string(),
54
+ taxRate: z.number(),
75
55
  }).transform((v) => {
76
56
  return remap$(v, {
77
- additionalCost: "additional_cost",
78
- shippingPriceIncludingTax: "shipping_price_including_tax",
79
- availabilityDescription: "availability_description",
80
- shipsInternationally: "ships_internationally",
81
- midCode: "mid_code",
82
- countryOfOrigin: "country_of_origin",
57
+ handlingChargesIncludingTax: "handling_charges_including_tax",
58
+ handlingChargesExcludingTax: "handling_charges_excluding_tax",
83
59
  taxType: "tax_type",
84
60
  taxRate: "tax_rate",
85
61
  });
@@ -63,6 +63,10 @@ export type Variant = {
63
63
  shortDescription: string | null;
64
64
  active: boolean;
65
65
  stockAvailable: boolean;
66
+ /**
67
+ * Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
68
+ */
69
+ backorder?: boolean | undefined;
66
70
  /**
67
71
  * Indicates whether this item is associated with any active (product-specific) coupons
68
72
  */
@@ -95,6 +99,7 @@ export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
95
99
  short_description: z.nullable(z.string()),
96
100
  active: z.boolean(),
97
101
  stock_available: z.boolean(),
102
+ backorder: z.boolean().optional(),
98
103
  on_offer: z.boolean(),
99
104
  on_promotion: z.boolean(),
100
105
  on_subscription: z.boolean(),
@@ -129,6 +134,7 @@ export type Variant$Outbound = {
129
134
  short_description: string | null;
130
135
  active: boolean;
131
136
  stock_available: boolean;
137
+ backorder?: boolean | undefined;
132
138
  on_offer: boolean;
133
139
  on_promotion: boolean;
134
140
  on_subscription: boolean;
@@ -155,6 +161,7 @@ export const Variant$outboundSchema: z.ZodType<
155
161
  shortDescription: z.nullable(z.string()),
156
162
  active: z.boolean(),
157
163
  stockAvailable: z.boolean(),
164
+ backorder: z.boolean().optional(),
158
165
  onOffer: z.boolean(),
159
166
  onPromotion: z.boolean(),
160
167
  onSubscription: z.boolean(),
@@ -103,6 +103,10 @@ export type VariantDetail = {
103
103
  shortDescription: string | null;
104
104
  active: boolean;
105
105
  stockAvailable: boolean;
106
+ /**
107
+ * Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
108
+ */
109
+ backorder?: boolean | undefined;
106
110
  /**
107
111
  * Indicates whether this item is associated with any active (product-specific) coupons
108
112
  */
@@ -173,6 +177,7 @@ export const VariantDetail$inboundSchema: z.ZodType<
173
177
  short_description: z.nullable(z.string()),
174
178
  active: z.boolean(),
175
179
  stock_available: z.boolean(),
180
+ backorder: z.boolean().optional(),
176
181
  on_offer: z.boolean(),
177
182
  on_promotion: z.boolean(),
178
183
  on_subscription: z.boolean(),
@@ -229,6 +234,7 @@ export type VariantDetail$Outbound = {
229
234
  short_description: string | null;
230
235
  active: boolean;
231
236
  stock_available: boolean;
237
+ backorder?: boolean | undefined;
232
238
  on_offer: boolean;
233
239
  on_promotion: boolean;
234
240
  on_subscription: boolean;
@@ -269,6 +275,7 @@ export const VariantDetail$outboundSchema: z.ZodType<
269
275
  shortDescription: z.nullable(z.string()),
270
276
  active: z.boolean(),
271
277
  stockAvailable: z.boolean(),
278
+ backorder: z.boolean().optional(),
272
279
  onOffer: z.boolean(),
273
280
  onPromotion: z.boolean(),
274
281
  onSubscription: z.boolean(),
@@ -5,9 +5,20 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
8
9
  import { Result as SafeParseResult } from "../../types/fp.js";
9
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
11
 
12
+ export const VolumeBasedPromotionPromotionType = {
13
+ Discount: "discount",
14
+ VolumeBased: "volume-based",
15
+ FixedPrice: "fixed-price",
16
+ FreeGoods: "free-goods",
17
+ } as const;
18
+ export type VolumeBasedPromotionPromotionType = ClosedEnum<
19
+ typeof VolumeBasedPromotionPromotionType
20
+ >;
21
+
11
22
  export type Slabs = {
12
23
  /**
13
24
  * The minimum quantity required to qualify for the discount.
@@ -20,10 +31,32 @@ export type Slabs = {
20
31
  };
21
32
 
22
33
  export type VolumeBasedPromotion = {
23
- promotionType?: "discount" | undefined;
34
+ promotionType?: "volume-based" | undefined;
24
35
  slabs: Array<Slabs>;
25
36
  };
26
37
 
38
+ /** @internal */
39
+ export const VolumeBasedPromotionPromotionType$inboundSchema: z.ZodNativeEnum<
40
+ typeof VolumeBasedPromotionPromotionType
41
+ > = z.nativeEnum(VolumeBasedPromotionPromotionType);
42
+
43
+ /** @internal */
44
+ export const VolumeBasedPromotionPromotionType$outboundSchema: z.ZodNativeEnum<
45
+ typeof VolumeBasedPromotionPromotionType
46
+ > = VolumeBasedPromotionPromotionType$inboundSchema;
47
+
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export namespace VolumeBasedPromotionPromotionType$ {
53
+ /** @deprecated use `VolumeBasedPromotionPromotionType$inboundSchema` instead. */
54
+ export const inboundSchema = VolumeBasedPromotionPromotionType$inboundSchema;
55
+ /** @deprecated use `VolumeBasedPromotionPromotionType$outboundSchema` instead. */
56
+ export const outboundSchema =
57
+ VolumeBasedPromotionPromotionType$outboundSchema;
58
+ }
59
+
27
60
  /** @internal */
28
61
  export const Slabs$inboundSchema: z.ZodType<Slabs, z.ZodTypeDef, unknown> = z
29
62
  .object({
@@ -90,7 +123,7 @@ export const VolumeBasedPromotion$inboundSchema: z.ZodType<
90
123
  z.ZodTypeDef,
91
124
  unknown
92
125
  > = z.object({
93
- promotion_type: z.literal("discount").optional(),
126
+ promotion_type: z.literal("volume-based").optional(),
94
127
  slabs: z.array(z.lazy(() => Slabs$inboundSchema)),
95
128
  }).transform((v) => {
96
129
  return remap$(v, {
@@ -100,7 +133,7 @@ export const VolumeBasedPromotion$inboundSchema: z.ZodType<
100
133
 
101
134
  /** @internal */
102
135
  export type VolumeBasedPromotion$Outbound = {
103
- promotion_type: "discount";
136
+ promotion_type: "volume-based";
104
137
  slabs: Array<Slabs$Outbound>;
105
138
  };
106
139
 
@@ -110,7 +143,7 @@ export const VolumeBasedPromotion$outboundSchema: z.ZodType<
110
143
  z.ZodTypeDef,
111
144
  VolumeBasedPromotion
112
145
  > = z.object({
113
- promotionType: z.literal("discount").default("discount" as const),
146
+ promotionType: z.literal("volume-based").default("volume-based"),
114
147
  slabs: z.array(z.lazy(() => Slabs$outboundSchema)),
115
148
  }).transform((v) => {
116
149
  return remap$(v, {