ce-storefront 0.16.2 → 0.16.4

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 (63) hide show
  1. package/README.md +2 -4
  2. package/docs/sdks/carts/README.md +0 -88
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/models/components/collectinstorefulfillment.d.ts +28 -0
  6. package/esm/models/components/collectinstorefulfillment.d.ts.map +1 -1
  7. package/esm/models/components/collectinstorefulfillment.js +23 -0
  8. package/esm/models/components/collectinstorefulfillment.js.map +1 -1
  9. package/esm/models/components/collectinstorefulfillmentinput.d.ts +34 -0
  10. package/esm/models/components/collectinstorefulfillmentinput.d.ts.map +1 -0
  11. package/esm/models/components/collectinstorefulfillmentinput.js +45 -0
  12. package/esm/models/components/collectinstorefulfillmentinput.js.map +1 -0
  13. package/esm/models/components/deliveryfulfillment.d.ts +28 -0
  14. package/esm/models/components/deliveryfulfillment.d.ts.map +1 -1
  15. package/esm/models/components/deliveryfulfillment.js +23 -0
  16. package/esm/models/components/deliveryfulfillment.js.map +1 -1
  17. package/esm/models/components/fulfillmentpreferenceinput.d.ts +3 -3
  18. package/esm/models/components/fulfillmentpreferenceinput.d.ts.map +1 -1
  19. package/esm/models/components/fulfillmentpreferenceinput.js +3 -3
  20. package/esm/models/components/fulfillmentpreferenceinput.js.map +1 -1
  21. package/esm/models/components/index.d.ts +1 -0
  22. package/esm/models/components/index.d.ts.map +1 -1
  23. package/esm/models/components/index.js +1 -0
  24. package/esm/models/components/index.js.map +1 -1
  25. package/esm/models/components/partialcollectanddelivery.d.ts +34 -6
  26. package/esm/models/components/partialcollectanddelivery.d.ts.map +1 -1
  27. package/esm/models/components/partialcollectanddelivery.js +32 -6
  28. package/esm/models/components/partialcollectanddelivery.js.map +1 -1
  29. package/esm/models/components/partialcollectanddeliveryinput.d.ts +6 -6
  30. package/esm/models/components/partialcollectanddeliveryinput.d.ts.map +1 -1
  31. package/esm/models/components/partialcollectanddeliveryinput.js +6 -6
  32. package/esm/models/components/partialcollectanddeliveryinput.js.map +1 -1
  33. package/esm/models/operations/index.d.ts +0 -1
  34. package/esm/models/operations/index.d.ts.map +1 -1
  35. package/esm/models/operations/index.js +0 -1
  36. package/esm/models/operations/index.js.map +1 -1
  37. package/esm/sdk/carts.d.ts +0 -9
  38. package/esm/sdk/carts.d.ts.map +1 -1
  39. package/esm/sdk/carts.js +0 -12
  40. package/esm/sdk/carts.js.map +1 -1
  41. package/examples/package-lock.json +1 -1
  42. package/jsr.json +1 -1
  43. package/package.json +1 -1
  44. package/src/lib/config.ts +2 -2
  45. package/src/models/components/collectinstorefulfillment.ts +34 -0
  46. package/src/models/components/collectinstorefulfillmentinput.ts +89 -0
  47. package/src/models/components/deliveryfulfillment.ts +37 -0
  48. package/src/models/components/fulfillmentpreferenceinput.ts +9 -9
  49. package/src/models/components/index.ts +1 -0
  50. package/src/models/components/partialcollectanddelivery.ts +52 -12
  51. package/src/models/components/partialcollectanddeliveryinput.ts +12 -12
  52. package/src/models/operations/index.ts +0 -1
  53. package/src/sdk/carts.ts +0 -20
  54. package/esm/funcs/cartsAddShippingMethod.d.ts +0 -20
  55. package/esm/funcs/cartsAddShippingMethod.d.ts.map +0 -1
  56. package/esm/funcs/cartsAddShippingMethod.js +0 -90
  57. package/esm/funcs/cartsAddShippingMethod.js.map +0 -1
  58. package/esm/models/operations/updateshippingmethod.d.ts +0 -122
  59. package/esm/models/operations/updateshippingmethod.d.ts.map +0 -1
  60. package/esm/models/operations/updateshippingmethod.js +0 -134
  61. package/esm/models/operations/updateshippingmethod.js.map +0 -1
  62. package/src/funcs/cartsAddShippingMethod.ts +0 -187
  63. package/src/models/operations/updateshippingmethod.ts +0 -293
@@ -0,0 +1,89 @@
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
+ /**
12
+ * @see {@link https://llm-docs.commercengine.io/storefront/schemas/CollectInStoreFulfillment} - API reference for the CollectInStoreFulfillment schema
13
+ */
14
+ export type CollectInStoreFulfillmentInput = {
15
+ fulfillmentType?: "collect-in-store" | undefined;
16
+ pickupLocationId: string;
17
+ };
18
+
19
+ /** @internal */
20
+ export const CollectInStoreFulfillmentInput$inboundSchema: z.ZodType<
21
+ CollectInStoreFulfillmentInput,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ fulfillment_type: z.literal("collect-in-store").default("collect-in-store")
26
+ .optional(),
27
+ pickup_location_id: z.string(),
28
+ }).transform((v) => {
29
+ return remap$(v, {
30
+ "fulfillment_type": "fulfillmentType",
31
+ "pickup_location_id": "pickupLocationId",
32
+ });
33
+ });
34
+
35
+ /** @internal */
36
+ export type CollectInStoreFulfillmentInput$Outbound = {
37
+ fulfillment_type: "collect-in-store";
38
+ pickup_location_id: string;
39
+ };
40
+
41
+ /** @internal */
42
+ export const CollectInStoreFulfillmentInput$outboundSchema: z.ZodType<
43
+ CollectInStoreFulfillmentInput$Outbound,
44
+ z.ZodTypeDef,
45
+ CollectInStoreFulfillmentInput
46
+ > = z.object({
47
+ fulfillmentType: z.literal("collect-in-store").default(
48
+ "collect-in-store" as const,
49
+ ),
50
+ pickupLocationId: z.string(),
51
+ }).transform((v) => {
52
+ return remap$(v, {
53
+ fulfillmentType: "fulfillment_type",
54
+ pickupLocationId: "pickup_location_id",
55
+ });
56
+ });
57
+
58
+ /**
59
+ * @internal
60
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
61
+ */
62
+ export namespace CollectInStoreFulfillmentInput$ {
63
+ /** @deprecated use `CollectInStoreFulfillmentInput$inboundSchema` instead. */
64
+ export const inboundSchema = CollectInStoreFulfillmentInput$inboundSchema;
65
+ /** @deprecated use `CollectInStoreFulfillmentInput$outboundSchema` instead. */
66
+ export const outboundSchema = CollectInStoreFulfillmentInput$outboundSchema;
67
+ /** @deprecated use `CollectInStoreFulfillmentInput$Outbound` instead. */
68
+ export type Outbound = CollectInStoreFulfillmentInput$Outbound;
69
+ }
70
+
71
+ export function collectInStoreFulfillmentInputToJSON(
72
+ collectInStoreFulfillmentInput: CollectInStoreFulfillmentInput,
73
+ ): string {
74
+ return JSON.stringify(
75
+ CollectInStoreFulfillmentInput$outboundSchema.parse(
76
+ collectInStoreFulfillmentInput,
77
+ ),
78
+ );
79
+ }
80
+
81
+ export function collectInStoreFulfillmentInputFromJSON(
82
+ jsonString: string,
83
+ ): SafeParseResult<CollectInStoreFulfillmentInput, SDKValidationError> {
84
+ return safeParse(
85
+ jsonString,
86
+ (x) => CollectInStoreFulfillmentInput$inboundSchema.parse(JSON.parse(x)),
87
+ `Failed to parse 'CollectInStoreFulfillmentInput' from JSON`,
88
+ );
89
+ }
@@ -5,20 +5,52 @@
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 DeliveryFulfillmentPreferenceType = {
13
+ User: "user",
14
+ Auto: "auto",
15
+ } as const;
16
+ export type DeliveryFulfillmentPreferenceType = ClosedEnum<
17
+ typeof DeliveryFulfillmentPreferenceType
18
+ >;
19
+
11
20
  /**
12
21
  * @see {@link https://llm-docs.commercengine.io/storefront/schemas/DeliveryFulfillment} - API reference for the DeliveryFulfillment schema
13
22
  */
14
23
  export type DeliveryFulfillment = {
15
24
  fulfillmentType?: "delivery" | undefined;
25
+ preferenceType?: DeliveryFulfillmentPreferenceType | undefined;
16
26
  shippingProviderId: string | null;
17
27
  shippingProviderName?: string | null | undefined;
18
28
  courierCompanyId?: string | null | undefined;
19
29
  courierCompanyName?: string | null | undefined;
20
30
  };
21
31
 
32
+ /** @internal */
33
+ export const DeliveryFulfillmentPreferenceType$inboundSchema: z.ZodNativeEnum<
34
+ typeof DeliveryFulfillmentPreferenceType
35
+ > = z.nativeEnum(DeliveryFulfillmentPreferenceType);
36
+
37
+ /** @internal */
38
+ export const DeliveryFulfillmentPreferenceType$outboundSchema: z.ZodNativeEnum<
39
+ typeof DeliveryFulfillmentPreferenceType
40
+ > = DeliveryFulfillmentPreferenceType$inboundSchema;
41
+
42
+ /**
43
+ * @internal
44
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
45
+ */
46
+ export namespace DeliveryFulfillmentPreferenceType$ {
47
+ /** @deprecated use `DeliveryFulfillmentPreferenceType$inboundSchema` instead. */
48
+ export const inboundSchema = DeliveryFulfillmentPreferenceType$inboundSchema;
49
+ /** @deprecated use `DeliveryFulfillmentPreferenceType$outboundSchema` instead. */
50
+ export const outboundSchema =
51
+ DeliveryFulfillmentPreferenceType$outboundSchema;
52
+ }
53
+
22
54
  /** @internal */
23
55
  export const DeliveryFulfillment$inboundSchema: z.ZodType<
24
56
  DeliveryFulfillment,
@@ -26,6 +58,7 @@ export const DeliveryFulfillment$inboundSchema: z.ZodType<
26
58
  unknown
27
59
  > = z.object({
28
60
  fulfillment_type: z.literal("delivery").default("delivery").optional(),
61
+ preference_type: DeliveryFulfillmentPreferenceType$inboundSchema.optional(),
29
62
  shipping_provider_id: z.nullable(z.string()),
30
63
  shipping_provider_name: z.nullable(z.string()).optional(),
31
64
  courier_company_id: z.nullable(z.string()).optional(),
@@ -33,6 +66,7 @@ export const DeliveryFulfillment$inboundSchema: z.ZodType<
33
66
  }).transform((v) => {
34
67
  return remap$(v, {
35
68
  "fulfillment_type": "fulfillmentType",
69
+ "preference_type": "preferenceType",
36
70
  "shipping_provider_id": "shippingProviderId",
37
71
  "shipping_provider_name": "shippingProviderName",
38
72
  "courier_company_id": "courierCompanyId",
@@ -43,6 +77,7 @@ export const DeliveryFulfillment$inboundSchema: z.ZodType<
43
77
  /** @internal */
44
78
  export type DeliveryFulfillment$Outbound = {
45
79
  fulfillment_type: "delivery";
80
+ preference_type?: string | undefined;
46
81
  shipping_provider_id: string | null;
47
82
  shipping_provider_name?: string | null | undefined;
48
83
  courier_company_id?: string | null | undefined;
@@ -56,6 +91,7 @@ export const DeliveryFulfillment$outboundSchema: z.ZodType<
56
91
  DeliveryFulfillment
57
92
  > = z.object({
58
93
  fulfillmentType: z.literal("delivery").default("delivery" as const),
94
+ preferenceType: DeliveryFulfillmentPreferenceType$outboundSchema.optional(),
59
95
  shippingProviderId: z.nullable(z.string()),
60
96
  shippingProviderName: z.nullable(z.string()).optional(),
61
97
  courierCompanyId: z.nullable(z.string()).optional(),
@@ -63,6 +99,7 @@ export const DeliveryFulfillment$outboundSchema: z.ZodType<
63
99
  }).transform((v) => {
64
100
  return remap$(v, {
65
101
  fulfillmentType: "fulfillment_type",
102
+ preferenceType: "preference_type",
66
103
  shippingProviderId: "shipping_provider_id",
67
104
  shippingProviderName: "shipping_provider_name",
68
105
  courierCompanyId: "courier_company_id",
@@ -7,11 +7,11 @@ import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
  import {
10
- CollectInStoreFulfillment,
11
- CollectInStoreFulfillment$inboundSchema,
12
- CollectInStoreFulfillment$Outbound,
13
- CollectInStoreFulfillment$outboundSchema,
14
- } from "./collectinstorefulfillment.js";
10
+ CollectInStoreFulfillmentInput,
11
+ CollectInStoreFulfillmentInput$inboundSchema,
12
+ CollectInStoreFulfillmentInput$Outbound,
13
+ CollectInStoreFulfillmentInput$outboundSchema,
14
+ } from "./collectinstorefulfillmentinput.js";
15
15
  import {
16
16
  DeliveryFulfillmentInput,
17
17
  DeliveryFulfillmentInput$inboundSchema,
@@ -32,7 +32,7 @@ export type FulfillmentPreferenceInput =
32
32
  | (PartialCollectAndDeliveryInput & {
33
33
  fulfillmentType: "partial-collect-and-delivery";
34
34
  })
35
- | (CollectInStoreFulfillment & { fulfillmentType: "collect-in-store" })
35
+ | (CollectInStoreFulfillmentInput & { fulfillmentType: "collect-in-store" })
36
36
  | (DeliveryFulfillmentInput & { fulfillmentType: "delivery" });
37
37
 
38
38
  /** @internal */
@@ -45,7 +45,7 @@ export const FulfillmentPreferenceInput$inboundSchema: z.ZodType<
45
45
  z.object({ fulfillment_type: z.literal("partial-collect-and-delivery") })
46
46
  .transform((v) => ({ fulfillmentType: v.fulfillment_type })),
47
47
  ),
48
- CollectInStoreFulfillment$inboundSchema.and(
48
+ CollectInStoreFulfillmentInput$inboundSchema.and(
49
49
  z.object({ fulfillment_type: z.literal("collect-in-store") }).transform((
50
50
  v,
51
51
  ) => ({ fulfillmentType: v.fulfillment_type })),
@@ -62,7 +62,7 @@ export type FulfillmentPreferenceInput$Outbound =
62
62
  | (PartialCollectAndDeliveryInput$Outbound & {
63
63
  fulfillment_type: "partial-collect-and-delivery";
64
64
  })
65
- | (CollectInStoreFulfillment$Outbound & {
65
+ | (CollectInStoreFulfillmentInput$Outbound & {
66
66
  fulfillment_type: "collect-in-store";
67
67
  })
68
68
  | (DeliveryFulfillmentInput$Outbound & { fulfillment_type: "delivery" });
@@ -77,7 +77,7 @@ export const FulfillmentPreferenceInput$outboundSchema: z.ZodType<
77
77
  z.object({ fulfillmentType: z.literal("partial-collect-and-delivery") })
78
78
  .transform((v) => ({ fulfillment_type: v.fulfillmentType })),
79
79
  ),
80
- CollectInStoreFulfillment$outboundSchema.and(
80
+ CollectInStoreFulfillmentInput$outboundSchema.and(
81
81
  z.object({ fulfillmentType: z.literal("collect-in-store") }).transform((
82
82
  v,
83
83
  ) => ({ fulfillment_type: v.fulfillmentType })),
@@ -15,6 +15,7 @@ export * from "./cartitem.js";
15
15
  export * from "./category.js";
16
16
  export * from "./collectinstore.js";
17
17
  export * from "./collectinstorefulfillment.js";
18
+ export * from "./collectinstorefulfillmentinput.js";
18
19
  export * from "./colorattribute.js";
19
20
  export * from "./coloroption.js";
20
21
  export * from "./currency.js";
@@ -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,21 @@ 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
+ items: Array<FulfillmentItem>;
20
29
  };
21
30
 
22
31
  export type Delivery = {
23
- shippingProviderId: string | null;
32
+ shippingProviderId: string;
24
33
  shippingProviderName?: string | null | undefined;
25
34
  courierCompanyId?: string | null | undefined;
26
35
  courierCompanyName?: string | null | undefined;
@@ -32,18 +41,42 @@ export type Delivery = {
32
41
  */
33
42
  export type PartialCollectAndDelivery = {
34
43
  fulfillmentType?: "partial-collect-and-delivery" | undefined;
44
+ preferenceType?: PartialCollectAndDeliveryPreferenceType | undefined;
35
45
  collectInStore: PartialCollectAndDeliveryCollectInStore;
36
46
  delivery: Delivery;
37
47
  };
38
48
 
49
+ /** @internal */
50
+ export const PartialCollectAndDeliveryPreferenceType$inboundSchema:
51
+ z.ZodNativeEnum<typeof PartialCollectAndDeliveryPreferenceType> = z
52
+ .nativeEnum(PartialCollectAndDeliveryPreferenceType);
53
+
54
+ /** @internal */
55
+ export const PartialCollectAndDeliveryPreferenceType$outboundSchema:
56
+ z.ZodNativeEnum<typeof PartialCollectAndDeliveryPreferenceType> =
57
+ PartialCollectAndDeliveryPreferenceType$inboundSchema;
58
+
59
+ /**
60
+ * @internal
61
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
62
+ */
63
+ export namespace PartialCollectAndDeliveryPreferenceType$ {
64
+ /** @deprecated use `PartialCollectAndDeliveryPreferenceType$inboundSchema` instead. */
65
+ export const inboundSchema =
66
+ PartialCollectAndDeliveryPreferenceType$inboundSchema;
67
+ /** @deprecated use `PartialCollectAndDeliveryPreferenceType$outboundSchema` instead. */
68
+ export const outboundSchema =
69
+ PartialCollectAndDeliveryPreferenceType$outboundSchema;
70
+ }
71
+
39
72
  /** @internal */
40
73
  export const PartialCollectAndDeliveryCollectInStore$inboundSchema: z.ZodType<
41
74
  PartialCollectAndDeliveryCollectInStore,
42
75
  z.ZodTypeDef,
43
76
  unknown
44
77
  > = z.object({
45
- pickup_location_id: z.string().optional(),
46
- items: z.array(FulfillmentItem$inboundSchema).optional(),
78
+ pickup_location_id: z.string(),
79
+ items: z.array(FulfillmentItem$inboundSchema),
47
80
  }).transform((v) => {
48
81
  return remap$(v, {
49
82
  "pickup_location_id": "pickupLocationId",
@@ -52,8 +85,8 @@ export const PartialCollectAndDeliveryCollectInStore$inboundSchema: z.ZodType<
52
85
 
53
86
  /** @internal */
54
87
  export type PartialCollectAndDeliveryCollectInStore$Outbound = {
55
- pickup_location_id?: string | undefined;
56
- items?: Array<FulfillmentItem$Outbound> | undefined;
88
+ pickup_location_id: string;
89
+ items: Array<FulfillmentItem$Outbound>;
57
90
  };
58
91
 
59
92
  /** @internal */
@@ -62,8 +95,8 @@ export const PartialCollectAndDeliveryCollectInStore$outboundSchema: z.ZodType<
62
95
  z.ZodTypeDef,
63
96
  PartialCollectAndDeliveryCollectInStore
64
97
  > = z.object({
65
- pickupLocationId: z.string().optional(),
66
- items: z.array(FulfillmentItem$outboundSchema).optional(),
98
+ pickupLocationId: z.string(),
99
+ items: z.array(FulfillmentItem$outboundSchema),
67
100
  }).transform((v) => {
68
101
  return remap$(v, {
69
102
  pickupLocationId: "pickup_location_id",
@@ -118,7 +151,7 @@ export const Delivery$inboundSchema: z.ZodType<
118
151
  z.ZodTypeDef,
119
152
  unknown
120
153
  > = z.object({
121
- shipping_provider_id: z.nullable(z.string()),
154
+ shipping_provider_id: z.string(),
122
155
  shipping_provider_name: z.nullable(z.string()).optional(),
123
156
  courier_company_id: z.nullable(z.string()).optional(),
124
157
  courier_company_name: z.nullable(z.string()).optional(),
@@ -134,7 +167,7 @@ export const Delivery$inboundSchema: z.ZodType<
134
167
 
135
168
  /** @internal */
136
169
  export type Delivery$Outbound = {
137
- shipping_provider_id: string | null;
170
+ shipping_provider_id: string;
138
171
  shipping_provider_name?: string | null | undefined;
139
172
  courier_company_id?: string | null | undefined;
140
173
  courier_company_name?: string | null | undefined;
@@ -147,7 +180,7 @@ export const Delivery$outboundSchema: z.ZodType<
147
180
  z.ZodTypeDef,
148
181
  Delivery
149
182
  > = z.object({
150
- shippingProviderId: z.nullable(z.string()),
183
+ shippingProviderId: z.string(),
151
184
  shippingProviderName: z.nullable(z.string()).optional(),
152
185
  courierCompanyId: z.nullable(z.string()).optional(),
153
186
  courierCompanyName: z.nullable(z.string()).optional(),
@@ -197,6 +230,8 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
197
230
  fulfillment_type: z.literal("partial-collect-and-delivery").default(
198
231
  "partial-collect-and-delivery",
199
232
  ).optional(),
233
+ preference_type: PartialCollectAndDeliveryPreferenceType$inboundSchema
234
+ .optional(),
200
235
  "collect-in-store": z.lazy(() =>
201
236
  PartialCollectAndDeliveryCollectInStore$inboundSchema
202
237
  ),
@@ -204,6 +239,7 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
204
239
  }).transform((v) => {
205
240
  return remap$(v, {
206
241
  "fulfillment_type": "fulfillmentType",
242
+ "preference_type": "preferenceType",
207
243
  "collect-in-store": "collectInStore",
208
244
  });
209
245
  });
@@ -211,6 +247,7 @@ export const PartialCollectAndDelivery$inboundSchema: z.ZodType<
211
247
  /** @internal */
212
248
  export type PartialCollectAndDelivery$Outbound = {
213
249
  fulfillment_type: "partial-collect-and-delivery";
250
+ preference_type?: string | undefined;
214
251
  "collect-in-store": PartialCollectAndDeliveryCollectInStore$Outbound;
215
252
  delivery: Delivery$Outbound;
216
253
  };
@@ -224,6 +261,8 @@ export const PartialCollectAndDelivery$outboundSchema: z.ZodType<
224
261
  fulfillmentType: z.literal("partial-collect-and-delivery").default(
225
262
  "partial-collect-and-delivery" as const,
226
263
  ),
264
+ preferenceType: PartialCollectAndDeliveryPreferenceType$outboundSchema
265
+ .optional(),
227
266
  collectInStore: z.lazy(() =>
228
267
  PartialCollectAndDeliveryCollectInStore$outboundSchema
229
268
  ),
@@ -231,6 +270,7 @@ export const PartialCollectAndDelivery$outboundSchema: z.ZodType<
231
270
  }).transform((v) => {
232
271
  return remap$(v, {
233
272
  fulfillmentType: "fulfillment_type",
273
+ preferenceType: "preference_type",
234
274
  collectInStore: "collect-in-store",
235
275
  });
236
276
  });
@@ -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) => {
@@ -51,6 +51,5 @@ export * from "./searchproducts.js";
51
51
  export * from "./updateaddressdetail.js";
52
52
  export * from "./updatecart.js";
53
53
  export * from "./updatefulfillmentpreference.js";
54
- export * from "./updateshippingmethod.js";
55
54
  export * from "./updateuser.js";
56
55
  export * from "./verifyotp.js";
package/src/sdk/carts.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { cartsAddShippingMethod } from "../funcs/cartsAddShippingMethod.js";
6
5
  import { cartsApplyCoupon } from "../funcs/cartsApplyCoupon.js";
7
6
  import { cartsCreateCart } from "../funcs/cartsCreateCart.js";
8
7
  import { cartsCreateCartAddress } from "../funcs/cartsCreateCartAddress.js";
@@ -247,23 +246,4 @@ export class Carts extends ClientSDK {
247
246
  options,
248
247
  ));
249
248
  }
250
-
251
- /**
252
- * Update shipping method
253
- *
254
- * @remarks
255
- * Update preferred shipping method and courier.
256
- *
257
- * @see {@link https://llm-docs.commercengine.io/storefront/operations/update-shipping-method} - API reference for the update-shipping-method operation
258
- */
259
- async addShippingMethod(
260
- request: operations.UpdateShippingMethodRequest,
261
- options?: RequestOptions,
262
- ): Promise<operations.UpdateShippingMethodResponseBody> {
263
- return unwrapAsync(cartsAddShippingMethod(
264
- this,
265
- request,
266
- options,
267
- ));
268
- }
269
249
  }
@@ -1,20 +0,0 @@
1
- import { CeStorefrontCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
4
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
- import * as errors from "../models/errors/index.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as operations from "../models/operations/index.js";
9
- import { APIPromise } from "../types/async.js";
10
- import { Result } from "../types/fp.js";
11
- /**
12
- * Update shipping method
13
- *
14
- * @remarks
15
- * Update preferred shipping method and courier.
16
- *
17
- * @see {@link https://llm-docs.commercengine.io/storefront/operations/update-shipping-method} - API reference for the update-shipping-method operation
18
- */
19
- export declare function cartsAddShippingMethod(client: CeStorefrontCore, request: operations.UpdateShippingMethodRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateShippingMethodResponseBody, errors.BadRequest | errors.Unauthorized | errors.NotFound | CeStorefrontError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
20
- //# sourceMappingURL=cartsAddShippingMethod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cartsAddShippingMethod.d.ts","sourceRoot":"","sources":["../../src/funcs/cartsAddShippingMethod.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,gCAAgC,EACzC,MAAM,CAAC,UAAU,GACjB,MAAM,CAAC,YAAY,GACnB,MAAM,CAAC,QAAQ,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
@@ -1,90 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
5
- import * as M from "../lib/matchers.js";
6
- import { compactMap } from "../lib/primitives.js";
7
- import { safeParse } from "../lib/schemas.js";
8
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
9
- import { pathToFunc } from "../lib/url.js";
10
- import * as errors from "../models/errors/index.js";
11
- import * as operations from "../models/operations/index.js";
12
- import { APIPromise } from "../types/async.js";
13
- /**
14
- * Update shipping method
15
- *
16
- * @remarks
17
- * Update preferred shipping method and courier.
18
- *
19
- * @see {@link https://llm-docs.commercengine.io/storefront/operations/update-shipping-method} - API reference for the update-shipping-method operation
20
- */
21
- export function cartsAddShippingMethod(client, request, options) {
22
- return new APIPromise($do(client, request, options));
23
- }
24
- async function $do(client, request, options) {
25
- const parsed = safeParse(request, (value) => operations.UpdateShippingMethodRequest$outboundSchema.parse(value), "Input validation failed");
26
- if (!parsed.ok) {
27
- return [parsed, { status: "invalid" }];
28
- }
29
- const payload = parsed.value;
30
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
31
- const pathParams = {
32
- id: encodeSimple("id", payload.id, {
33
- explode: false,
34
- charEncoding: "percent",
35
- }),
36
- };
37
- const path = pathToFunc("/carts/{id}/shipping-method")(pathParams);
38
- const headers = new Headers(compactMap({
39
- "Content-Type": "application/json",
40
- Accept: "application/json",
41
- }));
42
- const secConfig = await extractSecurity(client._options.authorization);
43
- const securityInput = secConfig == null ? {} : { authorization: secConfig };
44
- const requestSecurity = resolveGlobalSecurity(securityInput);
45
- const context = {
46
- options: client._options,
47
- baseURL: options?.serverURL ?? client._baseURL ?? "",
48
- operationID: "update-shipping-method",
49
- oAuth2Scopes: null,
50
- resolvedSecurity: requestSecurity,
51
- securitySource: client._options.authorization,
52
- retryConfig: options?.retries
53
- || client._options.retryConfig
54
- || { strategy: "none" },
55
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
56
- };
57
- const requestRes = client._createRequest(context, {
58
- security: requestSecurity,
59
- method: "POST",
60
- baseURL: options?.serverURL,
61
- path: path,
62
- headers: headers,
63
- body: body,
64
- userAgent: client._options.userAgent,
65
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
66
- }, options);
67
- if (!requestRes.ok) {
68
- return [requestRes, { status: "invalid" }];
69
- }
70
- const req = requestRes.value;
71
- const doResult = await client._do(req, {
72
- context,
73
- errorCodes: ["400", "401", "404", "4XX", "5XX"],
74
- retryConfig: context.retryConfig,
75
- retryCodes: context.retryCodes,
76
- });
77
- if (!doResult.ok) {
78
- return [doResult, { status: "request-error", request: req }];
79
- }
80
- const response = doResult.value;
81
- const responseFields = {
82
- HttpMeta: { Response: response, Request: req },
83
- };
84
- const [result] = await M.match(M.json(200, operations.UpdateShippingMethodResponseBody$inboundSchema), M.jsonErr(400, errors.BadRequest$inboundSchema), M.jsonErr(401, errors.Unauthorized$inboundSchema), M.jsonErr(404, errors.NotFound$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
85
- if (!result.ok) {
86
- return [result, { status: "complete", request: req, response }];
87
- }
88
- return [result, { status: "complete", request: req, response }];
89
- }
90
- //# sourceMappingURL=cartsAddShippingMethod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cartsAddShippingMethod.js","sourceRoot":"","sources":["../../src/funcs/cartsAddShippingMethod.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAGpD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGxD;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAwB,EACxB,OAA+C,EAC/C,OAAwB;IAiBxB,OAAO,IAAI,UAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAwB,EACxB,OAA+C,EAC/C,OAAwB;IAoBxB,MAAM,MAAM,GAAG,SAAS,CACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CACR,UAAU,CAAC,0CAA0C,CAAC,KAAK,CAAC,KAAK,CAAC,EACpE,yBAAyB,CAC1B,CAAC;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAC7B,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,E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