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
@@ -1,122 +0,0 @@
1
- import * as z from "zod";
2
- import { Result as SafeParseResult } from "../../types/fp.js";
3
- import * as components from "../components/index.js";
4
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
5
- export type UpdateShippingMethodRequestBody = {
6
- shippingProviderId: string;
7
- courierCompanyId: string | null;
8
- };
9
- export type UpdateShippingMethodRequest = {
10
- /**
11
- * Cart ID
12
- */
13
- id: string;
14
- requestBody: UpdateShippingMethodRequestBody;
15
- };
16
- export type UpdateShippingMethodContent = {
17
- /**
18
- * This cart model is structured to capture a wide range of details, facilitating accurate representation and management of user shopping carts in an e-commerce platform.
19
- */
20
- cart: components.Cart;
21
- };
22
- /**
23
- * OK
24
- */
25
- export type UpdateShippingMethodResponseBody = {
26
- message: string;
27
- success: boolean;
28
- content: UpdateShippingMethodContent;
29
- };
30
- /** @internal */
31
- export declare const UpdateShippingMethodRequestBody$inboundSchema: z.ZodType<UpdateShippingMethodRequestBody, z.ZodTypeDef, unknown>;
32
- /** @internal */
33
- export type UpdateShippingMethodRequestBody$Outbound = {
34
- shipping_provider_id: string;
35
- courier_company_id: string | null;
36
- };
37
- /** @internal */
38
- export declare const UpdateShippingMethodRequestBody$outboundSchema: z.ZodType<UpdateShippingMethodRequestBody$Outbound, z.ZodTypeDef, UpdateShippingMethodRequestBody>;
39
- /**
40
- * @internal
41
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
42
- */
43
- export declare namespace UpdateShippingMethodRequestBody$ {
44
- /** @deprecated use `UpdateShippingMethodRequestBody$inboundSchema` instead. */
45
- const inboundSchema: z.ZodType<UpdateShippingMethodRequestBody, z.ZodTypeDef, unknown>;
46
- /** @deprecated use `UpdateShippingMethodRequestBody$outboundSchema` instead. */
47
- const outboundSchema: z.ZodType<UpdateShippingMethodRequestBody$Outbound, z.ZodTypeDef, UpdateShippingMethodRequestBody>;
48
- /** @deprecated use `UpdateShippingMethodRequestBody$Outbound` instead. */
49
- type Outbound = UpdateShippingMethodRequestBody$Outbound;
50
- }
51
- export declare function updateShippingMethodRequestBodyToJSON(updateShippingMethodRequestBody: UpdateShippingMethodRequestBody): string;
52
- export declare function updateShippingMethodRequestBodyFromJSON(jsonString: string): SafeParseResult<UpdateShippingMethodRequestBody, SDKValidationError>;
53
- /** @internal */
54
- export declare const UpdateShippingMethodRequest$inboundSchema: z.ZodType<UpdateShippingMethodRequest, z.ZodTypeDef, unknown>;
55
- /** @internal */
56
- export type UpdateShippingMethodRequest$Outbound = {
57
- id: string;
58
- RequestBody: UpdateShippingMethodRequestBody$Outbound;
59
- };
60
- /** @internal */
61
- export declare const UpdateShippingMethodRequest$outboundSchema: z.ZodType<UpdateShippingMethodRequest$Outbound, z.ZodTypeDef, UpdateShippingMethodRequest>;
62
- /**
63
- * @internal
64
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
65
- */
66
- export declare namespace UpdateShippingMethodRequest$ {
67
- /** @deprecated use `UpdateShippingMethodRequest$inboundSchema` instead. */
68
- const inboundSchema: z.ZodType<UpdateShippingMethodRequest, z.ZodTypeDef, unknown>;
69
- /** @deprecated use `UpdateShippingMethodRequest$outboundSchema` instead. */
70
- const outboundSchema: z.ZodType<UpdateShippingMethodRequest$Outbound, z.ZodTypeDef, UpdateShippingMethodRequest>;
71
- /** @deprecated use `UpdateShippingMethodRequest$Outbound` instead. */
72
- type Outbound = UpdateShippingMethodRequest$Outbound;
73
- }
74
- export declare function updateShippingMethodRequestToJSON(updateShippingMethodRequest: UpdateShippingMethodRequest): string;
75
- export declare function updateShippingMethodRequestFromJSON(jsonString: string): SafeParseResult<UpdateShippingMethodRequest, SDKValidationError>;
76
- /** @internal */
77
- export declare const UpdateShippingMethodContent$inboundSchema: z.ZodType<UpdateShippingMethodContent, z.ZodTypeDef, unknown>;
78
- /** @internal */
79
- export type UpdateShippingMethodContent$Outbound = {
80
- cart: components.Cart$Outbound;
81
- };
82
- /** @internal */
83
- export declare const UpdateShippingMethodContent$outboundSchema: z.ZodType<UpdateShippingMethodContent$Outbound, z.ZodTypeDef, UpdateShippingMethodContent>;
84
- /**
85
- * @internal
86
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
87
- */
88
- export declare namespace UpdateShippingMethodContent$ {
89
- /** @deprecated use `UpdateShippingMethodContent$inboundSchema` instead. */
90
- const inboundSchema: z.ZodType<UpdateShippingMethodContent, z.ZodTypeDef, unknown>;
91
- /** @deprecated use `UpdateShippingMethodContent$outboundSchema` instead. */
92
- const outboundSchema: z.ZodType<UpdateShippingMethodContent$Outbound, z.ZodTypeDef, UpdateShippingMethodContent>;
93
- /** @deprecated use `UpdateShippingMethodContent$Outbound` instead. */
94
- type Outbound = UpdateShippingMethodContent$Outbound;
95
- }
96
- export declare function updateShippingMethodContentToJSON(updateShippingMethodContent: UpdateShippingMethodContent): string;
97
- export declare function updateShippingMethodContentFromJSON(jsonString: string): SafeParseResult<UpdateShippingMethodContent, SDKValidationError>;
98
- /** @internal */
99
- export declare const UpdateShippingMethodResponseBody$inboundSchema: z.ZodType<UpdateShippingMethodResponseBody, z.ZodTypeDef, unknown>;
100
- /** @internal */
101
- export type UpdateShippingMethodResponseBody$Outbound = {
102
- message: string;
103
- success: boolean;
104
- content: UpdateShippingMethodContent$Outbound;
105
- };
106
- /** @internal */
107
- export declare const UpdateShippingMethodResponseBody$outboundSchema: z.ZodType<UpdateShippingMethodResponseBody$Outbound, z.ZodTypeDef, UpdateShippingMethodResponseBody>;
108
- /**
109
- * @internal
110
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
111
- */
112
- export declare namespace UpdateShippingMethodResponseBody$ {
113
- /** @deprecated use `UpdateShippingMethodResponseBody$inboundSchema` instead. */
114
- const inboundSchema: z.ZodType<UpdateShippingMethodResponseBody, z.ZodTypeDef, unknown>;
115
- /** @deprecated use `UpdateShippingMethodResponseBody$outboundSchema` instead. */
116
- const outboundSchema: z.ZodType<UpdateShippingMethodResponseBody$Outbound, z.ZodTypeDef, UpdateShippingMethodResponseBody>;
117
- /** @deprecated use `UpdateShippingMethodResponseBody$Outbound` instead. */
118
- type Outbound = UpdateShippingMethodResponseBody$Outbound;
119
- }
120
- export declare function updateShippingMethodResponseBodyToJSON(updateShippingMethodResponseBody: UpdateShippingMethodResponseBody): string;
121
- export declare function updateShippingMethodResponseBodyFromJSON(jsonString: string): SafeParseResult<UpdateShippingMethodResponseBody, SDKValidationError>;
122
- //# sourceMappingURL=updateshippingmethod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateshippingmethod.d.ts","sourceRoot":"","sources":["../../../src/models/operations/updateshippingmethod.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,+BAA+B,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,2BAA2B,CAAC;CACtC,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,6CAA6C,EAAE,CAAC,CAAC,OAAO,CACnE,+BAA+B,EAC/B,CAAC,CAAC,UAAU,EACZ,OAAO,CASP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,wCAAwC,GAAG;IACrD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF,gBAAgB;AAChB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E,iFAAiF;IAC1E,MAAM,cAAc,sGAAkD,CAAC;IAC9E,2EAA2E;IAC3E,KAAY,QAAQ,GAAG,yCAAyC,CAAC;CAClE;AAED,wBAAgB,sCAAsC,CACpD,gCAAgC,EAAE,gCAAgC,GACjE,MAAM,CAMR;AAED,wBAAgB,wCAAwC,CACtD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,gCAAgC,EAAE,kBAAkB,CAAC,CAMvE"}
@@ -1,134 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import * as z from "zod";
5
- import { remap as remap$ } from "../../lib/primitives.js";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import * as components from "../components/index.js";
8
- /** @internal */
9
- export const UpdateShippingMethodRequestBody$inboundSchema = z.object({
10
- shipping_provider_id: z.string(),
11
- courier_company_id: z.nullable(z.string()),
12
- }).transform((v) => {
13
- return remap$(v, {
14
- "shipping_provider_id": "shippingProviderId",
15
- "courier_company_id": "courierCompanyId",
16
- });
17
- });
18
- /** @internal */
19
- export const UpdateShippingMethodRequestBody$outboundSchema = z.object({
20
- shippingProviderId: z.string(),
21
- courierCompanyId: z.nullable(z.string()),
22
- }).transform((v) => {
23
- return remap$(v, {
24
- shippingProviderId: "shipping_provider_id",
25
- courierCompanyId: "courier_company_id",
26
- });
27
- });
28
- /**
29
- * @internal
30
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
31
- */
32
- export var UpdateShippingMethodRequestBody$;
33
- (function (UpdateShippingMethodRequestBody$) {
34
- /** @deprecated use `UpdateShippingMethodRequestBody$inboundSchema` instead. */
35
- UpdateShippingMethodRequestBody$.inboundSchema = UpdateShippingMethodRequestBody$inboundSchema;
36
- /** @deprecated use `UpdateShippingMethodRequestBody$outboundSchema` instead. */
37
- UpdateShippingMethodRequestBody$.outboundSchema = UpdateShippingMethodRequestBody$outboundSchema;
38
- })(UpdateShippingMethodRequestBody$ || (UpdateShippingMethodRequestBody$ = {}));
39
- export function updateShippingMethodRequestBodyToJSON(updateShippingMethodRequestBody) {
40
- return JSON.stringify(UpdateShippingMethodRequestBody$outboundSchema.parse(updateShippingMethodRequestBody));
41
- }
42
- export function updateShippingMethodRequestBodyFromJSON(jsonString) {
43
- return safeParse(jsonString, (x) => UpdateShippingMethodRequestBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateShippingMethodRequestBody' from JSON`);
44
- }
45
- /** @internal */
46
- export const UpdateShippingMethodRequest$inboundSchema = z.object({
47
- id: z.string(),
48
- RequestBody: z.lazy(() => UpdateShippingMethodRequestBody$inboundSchema),
49
- }).transform((v) => {
50
- return remap$(v, {
51
- "RequestBody": "requestBody",
52
- });
53
- });
54
- /** @internal */
55
- export const UpdateShippingMethodRequest$outboundSchema = z.object({
56
- id: z.string(),
57
- requestBody: z.lazy(() => UpdateShippingMethodRequestBody$outboundSchema),
58
- }).transform((v) => {
59
- return remap$(v, {
60
- requestBody: "RequestBody",
61
- });
62
- });
63
- /**
64
- * @internal
65
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
66
- */
67
- export var UpdateShippingMethodRequest$;
68
- (function (UpdateShippingMethodRequest$) {
69
- /** @deprecated use `UpdateShippingMethodRequest$inboundSchema` instead. */
70
- UpdateShippingMethodRequest$.inboundSchema = UpdateShippingMethodRequest$inboundSchema;
71
- /** @deprecated use `UpdateShippingMethodRequest$outboundSchema` instead. */
72
- UpdateShippingMethodRequest$.outboundSchema = UpdateShippingMethodRequest$outboundSchema;
73
- })(UpdateShippingMethodRequest$ || (UpdateShippingMethodRequest$ = {}));
74
- export function updateShippingMethodRequestToJSON(updateShippingMethodRequest) {
75
- return JSON.stringify(UpdateShippingMethodRequest$outboundSchema.parse(updateShippingMethodRequest));
76
- }
77
- export function updateShippingMethodRequestFromJSON(jsonString) {
78
- return safeParse(jsonString, (x) => UpdateShippingMethodRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateShippingMethodRequest' from JSON`);
79
- }
80
- /** @internal */
81
- export const UpdateShippingMethodContent$inboundSchema = z.object({
82
- cart: components.Cart$inboundSchema,
83
- });
84
- /** @internal */
85
- export const UpdateShippingMethodContent$outboundSchema = z.object({
86
- cart: components.Cart$outboundSchema,
87
- });
88
- /**
89
- * @internal
90
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
91
- */
92
- export var UpdateShippingMethodContent$;
93
- (function (UpdateShippingMethodContent$) {
94
- /** @deprecated use `UpdateShippingMethodContent$inboundSchema` instead. */
95
- UpdateShippingMethodContent$.inboundSchema = UpdateShippingMethodContent$inboundSchema;
96
- /** @deprecated use `UpdateShippingMethodContent$outboundSchema` instead. */
97
- UpdateShippingMethodContent$.outboundSchema = UpdateShippingMethodContent$outboundSchema;
98
- })(UpdateShippingMethodContent$ || (UpdateShippingMethodContent$ = {}));
99
- export function updateShippingMethodContentToJSON(updateShippingMethodContent) {
100
- return JSON.stringify(UpdateShippingMethodContent$outboundSchema.parse(updateShippingMethodContent));
101
- }
102
- export function updateShippingMethodContentFromJSON(jsonString) {
103
- return safeParse(jsonString, (x) => UpdateShippingMethodContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateShippingMethodContent' from JSON`);
104
- }
105
- /** @internal */
106
- export const UpdateShippingMethodResponseBody$inboundSchema = z.object({
107
- message: z.string(),
108
- success: z.boolean(),
109
- content: z.lazy(() => UpdateShippingMethodContent$inboundSchema),
110
- });
111
- /** @internal */
112
- export const UpdateShippingMethodResponseBody$outboundSchema = z.object({
113
- message: z.string(),
114
- success: z.boolean(),
115
- content: z.lazy(() => UpdateShippingMethodContent$outboundSchema),
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 var UpdateShippingMethodResponseBody$;
122
- (function (UpdateShippingMethodResponseBody$) {
123
- /** @deprecated use `UpdateShippingMethodResponseBody$inboundSchema` instead. */
124
- UpdateShippingMethodResponseBody$.inboundSchema = UpdateShippingMethodResponseBody$inboundSchema;
125
- /** @deprecated use `UpdateShippingMethodResponseBody$outboundSchema` instead. */
126
- UpdateShippingMethodResponseBody$.outboundSchema = UpdateShippingMethodResponseBody$outboundSchema;
127
- })(UpdateShippingMethodResponseBody$ || (UpdateShippingMethodResponseBody$ = {}));
128
- export function updateShippingMethodResponseBodyToJSON(updateShippingMethodResponseBody) {
129
- return JSON.stringify(UpdateShippingMethodResponseBody$outboundSchema.parse(updateShippingMethodResponseBody));
130
- }
131
- export function updateShippingMethodResponseBodyFromJSON(jsonString) {
132
- return safeParse(jsonString, (x) => UpdateShippingMethodResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateShippingMethodResponseBody' from JSON`);
133
- }
134
- //# sourceMappingURL=updateshippingmethod.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateshippingmethod.js","sourceRoot":"","sources":["../../../src/models/operations/updateshippingmethod.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAgCrD,gBAAgB;AAChB,MAAM,CAAC,MAAM,6CAA6C,GAItD,CAAC,CAAC,MAAM,CAAC;IACX,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE;IAChC,kBAAkB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC3C,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,MAAM,CAAC,CAAC,EAAE;QACf,sBAAsB,EAAE,oBAAoB;QAC5C,oBAAoB,EAAE,kBAAkB;KACzC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAQH,gBAAgB;AAChB,MA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G,+CAA+C,CAAC;AAGhF,CAAC,EAPgB,iCAAiC,KAAjC,iCAAiC,QAOjD;AAED,MAAM,UAAU,sCAAsC,CACpD,gCAAkE;IAElE,OAAO,IAAI,CAAC,SAAS,CACnB,+CAA+C,CAAC,KAAK,CACnD,gCAAgC,CACjC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wCAAwC,CACtD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,8CAA8C,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC1E,8DAA8D,CAC/D,CAAC;AACJ,CAAC"}
@@ -1,187 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { CeStorefrontCore } from "../core.js";
6
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
- import { pathToFunc } from "../lib/url.js";
13
- import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
14
- import {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/httpclienterrors.js";
21
- import * as errors from "../models/errors/index.js";
22
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
23
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
- import * as operations from "../models/operations/index.js";
25
- import { APICall, APIPromise } from "../types/async.js";
26
- import { Result } from "../types/fp.js";
27
-
28
- /**
29
- * Update shipping method
30
- *
31
- * @remarks
32
- * Update preferred shipping method and courier.
33
- *
34
- * @see {@link https://llm-docs.commercengine.io/storefront/operations/update-shipping-method} - API reference for the update-shipping-method operation
35
- */
36
- export function cartsAddShippingMethod(
37
- client: CeStorefrontCore,
38
- request: operations.UpdateShippingMethodRequest,
39
- options?: RequestOptions,
40
- ): APIPromise<
41
- Result<
42
- operations.UpdateShippingMethodResponseBody,
43
- | errors.BadRequest
44
- | errors.Unauthorized
45
- | errors.NotFound
46
- | CeStorefrontError
47
- | ResponseValidationError
48
- | ConnectionError
49
- | RequestAbortedError
50
- | RequestTimeoutError
51
- | InvalidRequestError
52
- | UnexpectedClientError
53
- | SDKValidationError
54
- >
55
- > {
56
- return new APIPromise($do(
57
- client,
58
- request,
59
- options,
60
- ));
61
- }
62
-
63
- async function $do(
64
- client: CeStorefrontCore,
65
- request: operations.UpdateShippingMethodRequest,
66
- options?: RequestOptions,
67
- ): Promise<
68
- [
69
- Result<
70
- operations.UpdateShippingMethodResponseBody,
71
- | errors.BadRequest
72
- | errors.Unauthorized
73
- | errors.NotFound
74
- | CeStorefrontError
75
- | ResponseValidationError
76
- | ConnectionError
77
- | RequestAbortedError
78
- | RequestTimeoutError
79
- | InvalidRequestError
80
- | UnexpectedClientError
81
- | SDKValidationError
82
- >,
83
- APICall,
84
- ]
85
- > {
86
- const parsed = safeParse(
87
- request,
88
- (value) =>
89
- operations.UpdateShippingMethodRequest$outboundSchema.parse(value),
90
- "Input validation failed",
91
- );
92
- if (!parsed.ok) {
93
- return [parsed, { status: "invalid" }];
94
- }
95
- const payload = parsed.value;
96
- const body = encodeJSON("body", payload.RequestBody, { explode: true });
97
-
98
- const pathParams = {
99
- id: encodeSimple("id", payload.id, {
100
- explode: false,
101
- charEncoding: "percent",
102
- }),
103
- };
104
-
105
- const path = pathToFunc("/carts/{id}/shipping-method")(pathParams);
106
-
107
- const headers = new Headers(compactMap({
108
- "Content-Type": "application/json",
109
- Accept: "application/json",
110
- }));
111
-
112
- const secConfig = await extractSecurity(client._options.authorization);
113
- const securityInput = secConfig == null ? {} : { authorization: secConfig };
114
- const requestSecurity = resolveGlobalSecurity(securityInput);
115
-
116
- const context = {
117
- options: client._options,
118
- baseURL: options?.serverURL ?? client._baseURL ?? "",
119
- operationID: "update-shipping-method",
120
- oAuth2Scopes: null,
121
-
122
- resolvedSecurity: requestSecurity,
123
-
124
- securitySource: client._options.authorization,
125
- retryConfig: options?.retries
126
- || client._options.retryConfig
127
- || { strategy: "none" },
128
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
129
- };
130
-
131
- const requestRes = client._createRequest(context, {
132
- security: requestSecurity,
133
- method: "POST",
134
- baseURL: options?.serverURL,
135
- path: path,
136
- headers: headers,
137
- body: body,
138
- userAgent: client._options.userAgent,
139
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
140
- }, options);
141
- if (!requestRes.ok) {
142
- return [requestRes, { status: "invalid" }];
143
- }
144
- const req = requestRes.value;
145
-
146
- const doResult = await client._do(req, {
147
- context,
148
- errorCodes: ["400", "401", "404", "4XX", "5XX"],
149
- retryConfig: context.retryConfig,
150
- retryCodes: context.retryCodes,
151
- });
152
- if (!doResult.ok) {
153
- return [doResult, { status: "request-error", request: req }];
154
- }
155
- const response = doResult.value;
156
-
157
- const responseFields = {
158
- HttpMeta: { Response: response, Request: req },
159
- };
160
-
161
- const [result] = await M.match<
162
- operations.UpdateShippingMethodResponseBody,
163
- | errors.BadRequest
164
- | errors.Unauthorized
165
- | errors.NotFound
166
- | CeStorefrontError
167
- | ResponseValidationError
168
- | ConnectionError
169
- | RequestAbortedError
170
- | RequestTimeoutError
171
- | InvalidRequestError
172
- | UnexpectedClientError
173
- | SDKValidationError
174
- >(
175
- M.json(200, operations.UpdateShippingMethodResponseBody$inboundSchema),
176
- M.jsonErr(400, errors.BadRequest$inboundSchema),
177
- M.jsonErr(401, errors.Unauthorized$inboundSchema),
178
- M.jsonErr(404, errors.NotFound$inboundSchema),
179
- M.fail("4XX"),
180
- M.fail("5XX"),
181
- )(response, req, { extraFields: responseFields });
182
- if (!result.ok) {
183
- return [result, { status: "complete", request: req, response }];
184
- }
185
-
186
- return [result, { status: "complete", request: req, response }];
187
- }