ce-storefront 0.16.3 → 0.17.0

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 (42) hide show
  1. package/esm/lib/config.d.ts +3 -3
  2. package/esm/lib/config.js +3 -3
  3. package/esm/lib/config.js.map +1 -1
  4. package/esm/models/components/collectinstorefulfillment.d.ts +30 -0
  5. package/esm/models/components/collectinstorefulfillment.d.ts.map +1 -1
  6. package/esm/models/components/collectinstorefulfillment.js +27 -0
  7. package/esm/models/components/collectinstorefulfillment.js.map +1 -1
  8. package/esm/models/components/collectinstorefulfillmentinput.d.ts +34 -0
  9. package/esm/models/components/collectinstorefulfillmentinput.d.ts.map +1 -0
  10. package/esm/models/components/collectinstorefulfillmentinput.js +45 -0
  11. package/esm/models/components/collectinstorefulfillmentinput.js.map +1 -0
  12. package/esm/models/components/deliveryfulfillment.d.ts +28 -0
  13. package/esm/models/components/deliveryfulfillment.d.ts.map +1 -1
  14. package/esm/models/components/deliveryfulfillment.js +23 -0
  15. package/esm/models/components/deliveryfulfillment.js.map +1 -1
  16. package/esm/models/components/fulfillmentpreferenceinput.d.ts +3 -3
  17. package/esm/models/components/fulfillmentpreferenceinput.d.ts.map +1 -1
  18. package/esm/models/components/fulfillmentpreferenceinput.js +3 -3
  19. package/esm/models/components/fulfillmentpreferenceinput.js.map +1 -1
  20. package/esm/models/components/index.d.ts +1 -0
  21. package/esm/models/components/index.d.ts.map +1 -1
  22. package/esm/models/components/index.js +1 -0
  23. package/esm/models/components/index.js.map +1 -1
  24. package/esm/models/components/partialcollectanddelivery.d.ts +36 -6
  25. package/esm/models/components/partialcollectanddelivery.d.ts.map +1 -1
  26. package/esm/models/components/partialcollectanddelivery.js +36 -6
  27. package/esm/models/components/partialcollectanddelivery.js.map +1 -1
  28. package/esm/models/components/partialcollectanddeliveryinput.d.ts +6 -6
  29. package/esm/models/components/partialcollectanddeliveryinput.d.ts.map +1 -1
  30. package/esm/models/components/partialcollectanddeliveryinput.js +6 -6
  31. package/esm/models/components/partialcollectanddeliveryinput.js.map +1 -1
  32. package/examples/package-lock.json +1 -1
  33. package/jsr.json +1 -1
  34. package/package.json +1 -1
  35. package/src/lib/config.ts +3 -3
  36. package/src/models/components/collectinstorefulfillment.ts +40 -0
  37. package/src/models/components/collectinstorefulfillmentinput.ts +89 -0
  38. package/src/models/components/deliveryfulfillment.ts +37 -0
  39. package/src/models/components/fulfillmentpreferenceinput.ts +9 -9
  40. package/src/models/components/index.ts +1 -0
  41. package/src/models/components/partialcollectanddelivery.ts +58 -12
  42. package/src/models/components/partialcollectanddeliveryinput.ts +12 -12
@@ -5,6 +5,7 @@
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
  import {
@@ -14,13 +15,22 @@ import {
14
15
  FulfillmentItem$outboundSchema,
15
16
  } from "./fulfillmentitem.js";
16
17
 
18
+ export const PartialCollectAndDeliveryPreferenceType = {
19
+ User: "user",
20
+ Auto: "auto",
21
+ } as const;
22
+ export type PartialCollectAndDeliveryPreferenceType = ClosedEnum<
23
+ typeof PartialCollectAndDeliveryPreferenceType
24
+ >;
25
+
17
26
  export type PartialCollectAndDeliveryCollectInStore = {
18
- pickupLocationId?: string | undefined;
19
- items?: Array<FulfillmentItem> | undefined;
27
+ pickupLocationId: string;
28
+ pickupLocationName?: string | undefined;
29
+ items: Array<FulfillmentItem>;
20
30
  };
21
31
 
22
32
  export type Delivery = {
23
- shippingProviderId: string | null;
33
+ shippingProviderId: string;
24
34
  shippingProviderName?: string | null | undefined;
25
35
  courierCompanyId?: string | null | undefined;
26
36
  courierCompanyName?: string | null | undefined;
@@ -32,28 +42,55 @@ export type Delivery = {
32
42
  */
33
43
  export type PartialCollectAndDelivery = {
34
44
  fulfillmentType?: "partial-collect-and-delivery" | undefined;
45
+ preferenceType?: PartialCollectAndDeliveryPreferenceType | undefined;
35
46
  collectInStore: PartialCollectAndDeliveryCollectInStore;
36
47
  delivery: Delivery;
37
48
  };
38
49
 
50
+ /** @internal */
51
+ export const PartialCollectAndDeliveryPreferenceType$inboundSchema:
52
+ z.ZodNativeEnum<typeof PartialCollectAndDeliveryPreferenceType> = z
53
+ .nativeEnum(PartialCollectAndDeliveryPreferenceType);
54
+
55
+ /** @internal */
56
+ export const PartialCollectAndDeliveryPreferenceType$outboundSchema:
57
+ z.ZodNativeEnum<typeof PartialCollectAndDeliveryPreferenceType> =
58
+ PartialCollectAndDeliveryPreferenceType$inboundSchema;
59
+
60
+ /**
61
+ * @internal
62
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
63
+ */
64
+ export namespace PartialCollectAndDeliveryPreferenceType$ {
65
+ /** @deprecated use `PartialCollectAndDeliveryPreferenceType$inboundSchema` instead. */
66
+ export const inboundSchema =
67
+ PartialCollectAndDeliveryPreferenceType$inboundSchema;
68
+ /** @deprecated use `PartialCollectAndDeliveryPreferenceType$outboundSchema` instead. */
69
+ export const outboundSchema =
70
+ PartialCollectAndDeliveryPreferenceType$outboundSchema;
71
+ }
72
+
39
73
  /** @internal */
40
74
  export const PartialCollectAndDeliveryCollectInStore$inboundSchema: z.ZodType<
41
75
  PartialCollectAndDeliveryCollectInStore,
42
76
  z.ZodTypeDef,
43
77
  unknown
44
78
  > = z.object({
45
- pickup_location_id: z.string().optional(),
46
- items: z.array(FulfillmentItem$inboundSchema).optional(),
79
+ pickup_location_id: z.string(),
80
+ pickup_location_name: z.string().optional(),
81
+ items: z.array(FulfillmentItem$inboundSchema),
47
82
  }).transform((v) => {
48
83
  return remap$(v, {
49
84
  "pickup_location_id": "pickupLocationId",
85
+ "pickup_location_name": "pickupLocationName",
50
86
  });
51
87
  });
52
88
 
53
89
  /** @internal */
54
90
  export type PartialCollectAndDeliveryCollectInStore$Outbound = {
55
- pickup_location_id?: string | undefined;
56
- items?: Array<FulfillmentItem$Outbound> | undefined;
91
+ pickup_location_id: string;
92
+ pickup_location_name?: string | undefined;
93
+ items: Array<FulfillmentItem$Outbound>;
57
94
  };
58
95
 
59
96
  /** @internal */
@@ -62,11 +99,13 @@ export const PartialCollectAndDeliveryCollectInStore$outboundSchema: z.ZodType<
62
99
  z.ZodTypeDef,
63
100
  PartialCollectAndDeliveryCollectInStore
64
101
  > = z.object({
65
- pickupLocationId: z.string().optional(),
66
- items: z.array(FulfillmentItem$outboundSchema).optional(),
102
+ pickupLocationId: z.string(),
103
+ pickupLocationName: z.string().optional(),
104
+ items: z.array(FulfillmentItem$outboundSchema),
67
105
  }).transform((v) => {
68
106
  return remap$(v, {
69
107
  pickupLocationId: "pickup_location_id",
108
+ pickupLocationName: "pickup_location_name",
70
109
  });
71
110
  });
72
111
 
@@ -118,7 +157,7 @@ export const Delivery$inboundSchema: z.ZodType<
118
157
  z.ZodTypeDef,
119
158
  unknown
120
159
  > = z.object({
121
- shipping_provider_id: z.nullable(z.string()),
160
+ shipping_provider_id: z.string(),
122
161
  shipping_provider_name: z.nullable(z.string()).optional(),
123
162
  courier_company_id: z.nullable(z.string()).optional(),
124
163
  courier_company_name: z.nullable(z.string()).optional(),
@@ -134,7 +173,7 @@ export const Delivery$inboundSchema: z.ZodType<
134
173
 
135
174
  /** @internal */
136
175
  export type Delivery$Outbound = {
137
- shipping_provider_id: string | null;
176
+ shipping_provider_id: string;
138
177
  shipping_provider_name?: string | null | undefined;
139
178
  courier_company_id?: string | null | undefined;
140
179
  courier_company_name?: string | null | undefined;
@@ -147,7 +186,7 @@ export const Delivery$outboundSchema: z.ZodType<
147
186
  z.ZodTypeDef,
148
187
  Delivery
149
188
  > = z.object({
150
- shippingProviderId: z.nullable(z.string()),
189
+ shippingProviderId: z.string(),
151
190
  shippingProviderName: z.nullable(z.string()).optional(),
152
191
  courierCompanyId: z.nullable(z.string()).optional(),
153
192
  courierCompanyName: z.nullable(z.string()).optional(),
@@ -197,6 +236,8 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
197
236
  fulfillment_type: z.literal("partial-collect-and-delivery").default(
198
237
  "partial-collect-and-delivery",
199
238
  ).optional(),
239
+ preference_type: PartialCollectAndDeliveryPreferenceType$inboundSchema
240
+ .optional(),
200
241
  "collect-in-store": z.lazy(() =>
201
242
  PartialCollectAndDeliveryCollectInStore$inboundSchema
202
243
  ),
@@ -204,6 +245,7 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
204
245
  }).transform((v) => {
205
246
  return remap$(v, {
206
247
  "fulfillment_type": "fulfillmentType",
248
+ "preference_type": "preferenceType",
207
249
  "collect-in-store": "collectInStore",
208
250
  });
209
251
  });
@@ -211,6 +253,7 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
211
253
  /** @internal */
212
254
  export type PartialCollectAndDelivery$Outbound = {
213
255
  fulfillment_type: "partial-collect-and-delivery";
256
+ preference_type?: string | undefined;
214
257
  "collect-in-store": PartialCollectAndDeliveryCollectInStore$Outbound;
215
258
  delivery: Delivery$Outbound;
216
259
  };
@@ -224,6 +267,8 @@ export const PartialCollectAndDelivery$outboundSchema: z.ZodType<
224
267
  fulfillmentType: z.literal("partial-collect-and-delivery").default(
225
268
  "partial-collect-and-delivery" as const,
226
269
  ),
270
+ preferenceType: PartialCollectAndDeliveryPreferenceType$outboundSchema
271
+ .optional(),
227
272
  collectInStore: z.lazy(() =>
228
273
  PartialCollectAndDeliveryCollectInStore$outboundSchema
229
274
  ),
@@ -231,6 +276,7 @@ export const PartialCollectAndDelivery$outboundSchema: z.ZodType<
231
276
  }).transform((v) => {
232
277
  return remap$(v, {
233
278
  fulfillmentType: "fulfillment_type",
279
+ preferenceType: "preference_type",
234
280
  collectInStore: "collect-in-store",
235
281
  });
236
282
  });
@@ -15,12 +15,12 @@ import {
15
15
  } from "./fulfillmentiteminput.js";
16
16
 
17
17
  export type PartialCollectAndDeliveryCollectInStoreInput = {
18
- pickupLocationId?: string | undefined;
19
- items?: Array<FulfillmentItemInput> | undefined;
18
+ pickupLocationId: string;
19
+ items: Array<FulfillmentItemInput>;
20
20
  };
21
21
 
22
22
  export type PartialCollectAndDeliveryDelivery = {
23
- shippingProviderId: string | null;
23
+ shippingProviderId: string;
24
24
  courierCompanyId?: string | null | undefined;
25
25
  items: Array<FulfillmentItemInput>;
26
26
  };
@@ -41,8 +41,8 @@ export const PartialCollectAndDeliveryCollectInStoreInput$inboundSchema:
41
41
  z.ZodTypeDef,
42
42
  unknown
43
43
  > = z.object({
44
- pickup_location_id: z.string().optional(),
45
- items: z.array(FulfillmentItemInput$inboundSchema).optional(),
44
+ pickup_location_id: z.string(),
45
+ items: z.array(FulfillmentItemInput$inboundSchema),
46
46
  }).transform((v) => {
47
47
  return remap$(v, {
48
48
  "pickup_location_id": "pickupLocationId",
@@ -51,8 +51,8 @@ export const PartialCollectAndDeliveryCollectInStoreInput$inboundSchema:
51
51
 
52
52
  /** @internal */
53
53
  export type PartialCollectAndDeliveryCollectInStoreInput$Outbound = {
54
- pickup_location_id?: string | undefined;
55
- items?: Array<FulfillmentItemInput$Outbound> | undefined;
54
+ pickup_location_id: string;
55
+ items: Array<FulfillmentItemInput$Outbound>;
56
56
  };
57
57
 
58
58
  /** @internal */
@@ -62,8 +62,8 @@ export const PartialCollectAndDeliveryCollectInStoreInput$outboundSchema:
62
62
  z.ZodTypeDef,
63
63
  PartialCollectAndDeliveryCollectInStoreInput
64
64
  > = z.object({
65
- pickupLocationId: z.string().optional(),
66
- items: z.array(FulfillmentItemInput$outboundSchema).optional(),
65
+ pickupLocationId: z.string(),
66
+ items: z.array(FulfillmentItemInput$outboundSchema),
67
67
  }).transform((v) => {
68
68
  return remap$(v, {
69
69
  pickupLocationId: "pickup_location_id",
@@ -118,7 +118,7 @@ export const PartialCollectAndDeliveryDelivery$inboundSchema: z.ZodType<
118
118
  z.ZodTypeDef,
119
119
  unknown
120
120
  > = z.object({
121
- shipping_provider_id: z.nullable(z.string()),
121
+ shipping_provider_id: z.string(),
122
122
  courier_company_id: z.nullable(z.string()).optional(),
123
123
  items: z.array(FulfillmentItemInput$inboundSchema),
124
124
  }).transform((v) => {
@@ -130,7 +130,7 @@ export const PartialCollectAndDeliveryDelivery$inboundSchema: z.ZodType<
130
130
 
131
131
  /** @internal */
132
132
  export type PartialCollectAndDeliveryDelivery$Outbound = {
133
- shipping_provider_id: string | null;
133
+ shipping_provider_id: string;
134
134
  courier_company_id?: string | null | undefined;
135
135
  items: Array<FulfillmentItemInput$Outbound>;
136
136
  };
@@ -141,7 +141,7 @@ export const PartialCollectAndDeliveryDelivery$outboundSchema: z.ZodType<
141
141
  z.ZodTypeDef,
142
142
  PartialCollectAndDeliveryDelivery
143
143
  > = z.object({
144
- shippingProviderId: z.nullable(z.string()),
144
+ shippingProviderId: z.string(),
145
145
  courierCompanyId: z.nullable(z.string()).optional(),
146
146
  items: z.array(FulfillmentItemInput$outboundSchema),
147
147
  }).transform((v) => {