ce-storefront 0.5.0 → 0.5.2
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.
- package/README.md +12 -11
- package/docs/sdks/carts/README.md +480 -5
- package/docs/sdks/customers/README.md +4 -0
- package/esm/funcs/cartsApplyCoupon.d.ts +16 -0
- package/esm/funcs/cartsApplyCoupon.d.ts.map +1 -0
- package/esm/funcs/{checkoutApplyCoupon.js → cartsApplyCoupon.js} +12 -6
- package/esm/funcs/cartsApplyCoupon.js.map +1 -0
- package/esm/funcs/{checkoutCreateCheckoutAddress.d.ts → cartsCreateCartAddress.d.ts} +2 -2
- package/esm/funcs/cartsCreateCartAddress.d.ts.map +1 -0
- package/esm/funcs/{checkoutCreateCheckoutAddress.js → cartsCreateCartAddress.js} +16 -12
- package/esm/funcs/cartsCreateCartAddress.js.map +1 -0
- package/esm/funcs/cartsDeleteCart.js +2 -2
- package/esm/funcs/cartsDeleteCart.js.map +1 -1
- package/esm/funcs/cartsGetCart.d.ts +1 -1
- package/esm/funcs/cartsGetCart.js +3 -3
- package/esm/funcs/cartsGetCart.js.map +1 -1
- package/esm/funcs/cartsGetUserCart.d.ts +16 -0
- package/esm/funcs/cartsGetUserCart.d.ts.map +1 -0
- package/esm/funcs/cartsGetUserCart.js +85 -0
- package/esm/funcs/cartsGetUserCart.js.map +1 -0
- package/esm/funcs/{checkoutRemoveCoupon.d.ts → cartsRemoveCoupon.d.ts} +2 -2
- package/esm/funcs/cartsRemoveCoupon.d.ts.map +1 -0
- package/esm/funcs/{checkoutRemoveCoupon.js → cartsRemoveCoupon.js} +12 -7
- package/esm/funcs/{checkoutRemoveCoupon.js.map → cartsRemoveCoupon.js.map} +1 -1
- package/esm/funcs/{checkoutApplyCoupon.d.ts → cartsRemoveUserCart.d.ts} +4 -4
- package/esm/funcs/{checkoutApplyCoupon.d.ts.map → cartsRemoveUserCart.d.ts.map} +1 -1
- package/esm/funcs/cartsRemoveUserCart.js +85 -0
- package/esm/funcs/cartsRemoveUserCart.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/cart.d.ts +4 -4
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +4 -4
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/cartitem.d.ts +0 -5
- package/esm/models/components/cartitem.d.ts.map +1 -1
- package/esm/models/components/cartitem.js +0 -2
- package/esm/models/components/cartitem.js.map +1 -1
- package/esm/models/components/customeraddress.d.ts +7 -4
- package/esm/models/components/customeraddress.d.ts.map +1 -1
- package/esm/models/components/customeraddress.js +4 -4
- package/esm/models/components/customeraddress.js.map +1 -1
- package/esm/models/components/customeraddressinput.d.ts +7 -2
- package/esm/models/components/customeraddressinput.d.ts.map +1 -1
- package/esm/models/components/customeraddressinput.js +4 -2
- package/esm/models/components/customeraddressinput.js.map +1 -1
- package/esm/models/operations/applycoupon.d.ts +30 -2
- package/esm/models/operations/applycoupon.d.ts.map +1 -1
- package/esm/models/operations/applycoupon.js +35 -4
- package/esm/models/operations/applycoupon.js.map +1 -1
- package/esm/models/operations/createaddress.d.ts +7 -2
- package/esm/models/operations/createaddress.d.ts.map +1 -1
- package/esm/models/operations/createaddress.js +4 -2
- package/esm/models/operations/createaddress.js.map +1 -1
- package/esm/models/operations/createcartaddress.d.ts +183 -0
- package/esm/models/operations/createcartaddress.d.ts.map +1 -0
- package/esm/models/operations/createcartaddress.js +214 -0
- package/esm/models/operations/createcartaddress.js.map +1 -0
- package/esm/models/operations/deletecart.d.ts +3 -3
- package/esm/models/operations/deletecart.d.ts.map +1 -1
- package/esm/models/operations/deletecart.js +2 -11
- package/esm/models/operations/deletecart.js.map +1 -1
- package/esm/models/operations/deleteusercart.d.ts +63 -0
- package/esm/models/operations/deleteusercart.d.ts.map +1 -0
- package/esm/models/operations/deleteusercart.js +77 -0
- package/esm/models/operations/deleteusercart.js.map +1 -0
- package/esm/models/operations/getaddressdetail.d.ts +7 -4
- package/esm/models/operations/getaddressdetail.d.ts.map +1 -1
- package/esm/models/operations/getaddressdetail.js +4 -4
- package/esm/models/operations/getaddressdetail.js.map +1 -1
- package/esm/models/operations/getcart.d.ts +3 -3
- package/esm/models/operations/getcart.d.ts.map +1 -1
- package/esm/models/operations/getcart.js +2 -11
- package/esm/models/operations/getcart.js.map +1 -1
- package/esm/models/operations/getusercart.d.ts +94 -0
- package/esm/models/operations/getusercart.d.ts.map +1 -0
- package/esm/models/operations/getusercart.js +105 -0
- package/esm/models/operations/getusercart.js.map +1 -0
- package/esm/models/operations/index.d.ts +3 -1
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +3 -1
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/listaddresses.d.ts +7 -4
- package/esm/models/operations/listaddresses.d.ts.map +1 -1
- package/esm/models/operations/listaddresses.js +4 -4
- package/esm/models/operations/listaddresses.js.map +1 -1
- package/esm/models/operations/removecoupon.d.ts +18 -17
- package/esm/models/operations/removecoupon.d.ts.map +1 -1
- package/esm/models/operations/removecoupon.js +15 -28
- package/esm/models/operations/removecoupon.js.map +1 -1
- package/esm/models/operations/updateaddressdetail.d.ts +7 -2
- package/esm/models/operations/updateaddressdetail.d.ts.map +1 -1
- package/esm/models/operations/updateaddressdetail.js +4 -2
- package/esm/models/operations/updateaddressdetail.js.map +1 -1
- package/esm/sdk/carts.d.ts +36 -1
- package/esm/sdk/carts.d.ts.map +1 -1
- package/esm/sdk/carts.js +51 -1
- package/esm/sdk/carts.js.map +1 -1
- package/esm/sdk/sdk.d.ts +0 -3
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +0 -4
- package/esm/sdk/sdk.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{checkoutApplyCoupon.ts → cartsApplyCoupon.ts} +13 -6
- package/src/funcs/{checkoutCreateCheckoutAddress.ts → cartsCreateCartAddress.ts} +19 -15
- package/src/funcs/cartsDeleteCart.ts +2 -2
- package/src/funcs/cartsGetCart.ts +3 -3
- package/src/funcs/cartsGetUserCart.ts +149 -0
- package/src/funcs/{checkoutRemoveCoupon.ts → cartsRemoveCoupon.ts} +13 -7
- package/src/funcs/cartsRemoveUserCart.ts +149 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/cart.ts +9 -9
- package/src/models/components/cartitem.ts +0 -7
- package/src/models/components/customeraddress.ts +11 -8
- package/src/models/components/customeraddressinput.ts +11 -4
- package/src/models/operations/applycoupon.ts +73 -6
- package/src/models/operations/createaddress.ts +11 -4
- package/src/models/operations/{createcheckoutaddress.ts → createcartaddress.ts} +152 -85
- package/src/models/operations/deletecart.ts +5 -14
- package/src/models/operations/deleteusercart.ts +154 -0
- package/src/models/operations/getaddressdetail.ts +11 -8
- package/src/models/operations/getcart.ts +5 -14
- package/src/models/operations/getusercart.ts +220 -0
- package/src/models/operations/index.ts +3 -1
- package/src/models/operations/listaddresses.ts +11 -8
- package/src/models/operations/removecoupon.ts +28 -40
- package/src/models/operations/updateaddressdetail.ts +11 -4
- package/src/sdk/carts.ts +91 -1
- package/src/sdk/sdk.ts +0 -6
- package/docs/sdks/checkout/README.md +0 -310
- package/esm/funcs/checkoutApplyCoupon.js.map +0 -1
- package/esm/funcs/checkoutCreateCheckoutAddress.d.ts.map +0 -1
- package/esm/funcs/checkoutCreateCheckoutAddress.js.map +0 -1
- package/esm/funcs/checkoutRemoveCoupon.d.ts.map +0 -1
- package/esm/models/operations/createcheckoutaddress.d.ts +0 -154
- package/esm/models/operations/createcheckoutaddress.d.ts.map +0 -1
- package/esm/models/operations/createcheckoutaddress.js +0 -181
- package/esm/models/operations/createcheckoutaddress.js.map +0 -1
- package/esm/sdk/checkout.d.ts +0 -26
- package/esm/sdk/checkout.d.ts.map +0 -1
- package/esm/sdk/checkout.js +0 -38
- package/esm/sdk/checkout.js.map +0 -1
- package/src/sdk/checkout.ts +0 -63
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
export const DeleteUserCartServerList = [
|
|
12
|
+
/**
|
|
13
|
+
* Staging Server
|
|
14
|
+
*/
|
|
15
|
+
"https://staging.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
16
|
+
/**
|
|
17
|
+
* Prod Server
|
|
18
|
+
*/
|
|
19
|
+
"https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
export type DeleteUserCartRequest = {
|
|
23
|
+
/**
|
|
24
|
+
* User ID
|
|
25
|
+
*/
|
|
26
|
+
userId: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* OK
|
|
31
|
+
*/
|
|
32
|
+
export type DeleteUserCartResponseBody = {
|
|
33
|
+
message: string;
|
|
34
|
+
success?: boolean | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const DeleteUserCartRequest$inboundSchema: z.ZodType<
|
|
39
|
+
DeleteUserCartRequest,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
unknown
|
|
42
|
+
> = z.object({
|
|
43
|
+
user_id: z.string(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
"user_id": "userId",
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type DeleteUserCartRequest$Outbound = {
|
|
52
|
+
user_id: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export const DeleteUserCartRequest$outboundSchema: z.ZodType<
|
|
57
|
+
DeleteUserCartRequest$Outbound,
|
|
58
|
+
z.ZodTypeDef,
|
|
59
|
+
DeleteUserCartRequest
|
|
60
|
+
> = z.object({
|
|
61
|
+
userId: z.string(),
|
|
62
|
+
}).transform((v) => {
|
|
63
|
+
return remap$(v, {
|
|
64
|
+
userId: "user_id",
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
71
|
+
*/
|
|
72
|
+
export namespace DeleteUserCartRequest$ {
|
|
73
|
+
/** @deprecated use `DeleteUserCartRequest$inboundSchema` instead. */
|
|
74
|
+
export const inboundSchema = DeleteUserCartRequest$inboundSchema;
|
|
75
|
+
/** @deprecated use `DeleteUserCartRequest$outboundSchema` instead. */
|
|
76
|
+
export const outboundSchema = DeleteUserCartRequest$outboundSchema;
|
|
77
|
+
/** @deprecated use `DeleteUserCartRequest$Outbound` instead. */
|
|
78
|
+
export type Outbound = DeleteUserCartRequest$Outbound;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function deleteUserCartRequestToJSON(
|
|
82
|
+
deleteUserCartRequest: DeleteUserCartRequest,
|
|
83
|
+
): string {
|
|
84
|
+
return JSON.stringify(
|
|
85
|
+
DeleteUserCartRequest$outboundSchema.parse(deleteUserCartRequest),
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function deleteUserCartRequestFromJSON(
|
|
90
|
+
jsonString: string,
|
|
91
|
+
): SafeParseResult<DeleteUserCartRequest, SDKValidationError> {
|
|
92
|
+
return safeParse(
|
|
93
|
+
jsonString,
|
|
94
|
+
(x) => DeleteUserCartRequest$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'DeleteUserCartRequest' from JSON`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const DeleteUserCartResponseBody$inboundSchema: z.ZodType<
|
|
101
|
+
DeleteUserCartResponseBody,
|
|
102
|
+
z.ZodTypeDef,
|
|
103
|
+
unknown
|
|
104
|
+
> = z.object({
|
|
105
|
+
message: z.string(),
|
|
106
|
+
success: z.boolean().default(true),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export type DeleteUserCartResponseBody$Outbound = {
|
|
111
|
+
message: string;
|
|
112
|
+
success: boolean;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/** @internal */
|
|
116
|
+
export const DeleteUserCartResponseBody$outboundSchema: z.ZodType<
|
|
117
|
+
DeleteUserCartResponseBody$Outbound,
|
|
118
|
+
z.ZodTypeDef,
|
|
119
|
+
DeleteUserCartResponseBody
|
|
120
|
+
> = z.object({
|
|
121
|
+
message: z.string(),
|
|
122
|
+
success: z.boolean().default(true),
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
128
|
+
*/
|
|
129
|
+
export namespace DeleteUserCartResponseBody$ {
|
|
130
|
+
/** @deprecated use `DeleteUserCartResponseBody$inboundSchema` instead. */
|
|
131
|
+
export const inboundSchema = DeleteUserCartResponseBody$inboundSchema;
|
|
132
|
+
/** @deprecated use `DeleteUserCartResponseBody$outboundSchema` instead. */
|
|
133
|
+
export const outboundSchema = DeleteUserCartResponseBody$outboundSchema;
|
|
134
|
+
/** @deprecated use `DeleteUserCartResponseBody$Outbound` instead. */
|
|
135
|
+
export type Outbound = DeleteUserCartResponseBody$Outbound;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function deleteUserCartResponseBodyToJSON(
|
|
139
|
+
deleteUserCartResponseBody: DeleteUserCartResponseBody,
|
|
140
|
+
): string {
|
|
141
|
+
return JSON.stringify(
|
|
142
|
+
DeleteUserCartResponseBody$outboundSchema.parse(deleteUserCartResponseBody),
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function deleteUserCartResponseBodyFromJSON(
|
|
147
|
+
jsonString: string,
|
|
148
|
+
): SafeParseResult<DeleteUserCartResponseBody, SDKValidationError> {
|
|
149
|
+
return safeParse(
|
|
150
|
+
jsonString,
|
|
151
|
+
(x) => DeleteUserCartResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
152
|
+
`Failed to parse 'DeleteUserCartResponseBody' from JSON`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
@@ -31,9 +31,12 @@ export type GetAddressDetailRequest = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export type GetAddressDetailAddress = {
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* null value for guest checkout.
|
|
36
|
+
*/
|
|
37
|
+
id: string | null;
|
|
35
38
|
firstName: string;
|
|
36
|
-
lastName: string;
|
|
39
|
+
lastName: string | null;
|
|
37
40
|
/**
|
|
38
41
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
39
42
|
*
|
|
@@ -152,9 +155,9 @@ export const GetAddressDetailAddress$inboundSchema: z.ZodType<
|
|
|
152
155
|
z.ZodTypeDef,
|
|
153
156
|
unknown
|
|
154
157
|
> = z.object({
|
|
155
|
-
id: z.string(),
|
|
158
|
+
id: z.nullable(z.string()),
|
|
156
159
|
first_name: z.string(),
|
|
157
|
-
last_name: z.string(),
|
|
160
|
+
last_name: z.nullable(z.string()),
|
|
158
161
|
country_code: z.string(),
|
|
159
162
|
phone: z.string(),
|
|
160
163
|
email: z.string(),
|
|
@@ -189,9 +192,9 @@ export const GetAddressDetailAddress$inboundSchema: z.ZodType<
|
|
|
189
192
|
|
|
190
193
|
/** @internal */
|
|
191
194
|
export type GetAddressDetailAddress$Outbound = {
|
|
192
|
-
id: string;
|
|
195
|
+
id: string | null;
|
|
193
196
|
first_name: string;
|
|
194
|
-
last_name: string;
|
|
197
|
+
last_name: string | null;
|
|
195
198
|
country_code: string;
|
|
196
199
|
phone: string;
|
|
197
200
|
email: string;
|
|
@@ -216,9 +219,9 @@ export const GetAddressDetailAddress$outboundSchema: z.ZodType<
|
|
|
216
219
|
z.ZodTypeDef,
|
|
217
220
|
GetAddressDetailAddress
|
|
218
221
|
> = z.object({
|
|
219
|
-
id: z.string(),
|
|
222
|
+
id: z.nullable(z.string()),
|
|
220
223
|
firstName: z.string(),
|
|
221
|
-
lastName: z.string(),
|
|
224
|
+
lastName: z.nullable(z.string()),
|
|
222
225
|
countryCode: z.string(),
|
|
223
226
|
phone: z.string(),
|
|
224
227
|
email: z.string(),
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import * as components from "../components/index.js";
|
|
@@ -22,9 +21,9 @@ export const GetCartServerList = [
|
|
|
22
21
|
|
|
23
22
|
export type GetCartRequest = {
|
|
24
23
|
/**
|
|
25
|
-
*
|
|
24
|
+
* Cart ID
|
|
26
25
|
*/
|
|
27
|
-
|
|
26
|
+
id: string;
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
export type GetCartContent = {
|
|
@@ -49,16 +48,12 @@ export const GetCartRequest$inboundSchema: z.ZodType<
|
|
|
49
48
|
z.ZodTypeDef,
|
|
50
49
|
unknown
|
|
51
50
|
> = z.object({
|
|
52
|
-
|
|
53
|
-
}).transform((v) => {
|
|
54
|
-
return remap$(v, {
|
|
55
|
-
"user_id": "userId",
|
|
56
|
-
});
|
|
51
|
+
id: z.string(),
|
|
57
52
|
});
|
|
58
53
|
|
|
59
54
|
/** @internal */
|
|
60
55
|
export type GetCartRequest$Outbound = {
|
|
61
|
-
|
|
56
|
+
id: string;
|
|
62
57
|
};
|
|
63
58
|
|
|
64
59
|
/** @internal */
|
|
@@ -67,11 +62,7 @@ export const GetCartRequest$outboundSchema: z.ZodType<
|
|
|
67
62
|
z.ZodTypeDef,
|
|
68
63
|
GetCartRequest
|
|
69
64
|
> = z.object({
|
|
70
|
-
|
|
71
|
-
}).transform((v) => {
|
|
72
|
-
return remap$(v, {
|
|
73
|
-
userId: "user_id",
|
|
74
|
-
});
|
|
65
|
+
id: z.string(),
|
|
75
66
|
});
|
|
76
67
|
|
|
77
68
|
/**
|
|
@@ -0,0 +1,220 @@
|
|
|
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 * as components from "../components/index.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const GetUserCartServerList = [
|
|
13
|
+
/**
|
|
14
|
+
* Staging Server
|
|
15
|
+
*/
|
|
16
|
+
"https://staging.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
17
|
+
/**
|
|
18
|
+
* Prod Server
|
|
19
|
+
*/
|
|
20
|
+
"https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
21
|
+
] as const;
|
|
22
|
+
|
|
23
|
+
export type GetUserCartRequest = {
|
|
24
|
+
/**
|
|
25
|
+
* User ID
|
|
26
|
+
*/
|
|
27
|
+
userId: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type GetUserCartContent = {
|
|
31
|
+
/**
|
|
32
|
+
* 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.
|
|
33
|
+
*/
|
|
34
|
+
cart: components.Cart;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* OK
|
|
39
|
+
*/
|
|
40
|
+
export type GetUserCartResponseBody = {
|
|
41
|
+
message: string;
|
|
42
|
+
success?: boolean | undefined;
|
|
43
|
+
content: GetUserCartContent;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const GetUserCartRequest$inboundSchema: z.ZodType<
|
|
48
|
+
GetUserCartRequest,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
unknown
|
|
51
|
+
> = z.object({
|
|
52
|
+
user_id: z.string(),
|
|
53
|
+
}).transform((v) => {
|
|
54
|
+
return remap$(v, {
|
|
55
|
+
"user_id": "userId",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/** @internal */
|
|
60
|
+
export type GetUserCartRequest$Outbound = {
|
|
61
|
+
user_id: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const GetUserCartRequest$outboundSchema: z.ZodType<
|
|
66
|
+
GetUserCartRequest$Outbound,
|
|
67
|
+
z.ZodTypeDef,
|
|
68
|
+
GetUserCartRequest
|
|
69
|
+
> = z.object({
|
|
70
|
+
userId: z.string(),
|
|
71
|
+
}).transform((v) => {
|
|
72
|
+
return remap$(v, {
|
|
73
|
+
userId: "user_id",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @internal
|
|
79
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
80
|
+
*/
|
|
81
|
+
export namespace GetUserCartRequest$ {
|
|
82
|
+
/** @deprecated use `GetUserCartRequest$inboundSchema` instead. */
|
|
83
|
+
export const inboundSchema = GetUserCartRequest$inboundSchema;
|
|
84
|
+
/** @deprecated use `GetUserCartRequest$outboundSchema` instead. */
|
|
85
|
+
export const outboundSchema = GetUserCartRequest$outboundSchema;
|
|
86
|
+
/** @deprecated use `GetUserCartRequest$Outbound` instead. */
|
|
87
|
+
export type Outbound = GetUserCartRequest$Outbound;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function getUserCartRequestToJSON(
|
|
91
|
+
getUserCartRequest: GetUserCartRequest,
|
|
92
|
+
): string {
|
|
93
|
+
return JSON.stringify(
|
|
94
|
+
GetUserCartRequest$outboundSchema.parse(getUserCartRequest),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function getUserCartRequestFromJSON(
|
|
99
|
+
jsonString: string,
|
|
100
|
+
): SafeParseResult<GetUserCartRequest, SDKValidationError> {
|
|
101
|
+
return safeParse(
|
|
102
|
+
jsonString,
|
|
103
|
+
(x) => GetUserCartRequest$inboundSchema.parse(JSON.parse(x)),
|
|
104
|
+
`Failed to parse 'GetUserCartRequest' from JSON`,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** @internal */
|
|
109
|
+
export const GetUserCartContent$inboundSchema: z.ZodType<
|
|
110
|
+
GetUserCartContent,
|
|
111
|
+
z.ZodTypeDef,
|
|
112
|
+
unknown
|
|
113
|
+
> = z.object({
|
|
114
|
+
cart: components.Cart$inboundSchema,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/** @internal */
|
|
118
|
+
export type GetUserCartContent$Outbound = {
|
|
119
|
+
cart: components.Cart$Outbound;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** @internal */
|
|
123
|
+
export const GetUserCartContent$outboundSchema: z.ZodType<
|
|
124
|
+
GetUserCartContent$Outbound,
|
|
125
|
+
z.ZodTypeDef,
|
|
126
|
+
GetUserCartContent
|
|
127
|
+
> = z.object({
|
|
128
|
+
cart: components.Cart$outboundSchema,
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* @internal
|
|
133
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
134
|
+
*/
|
|
135
|
+
export namespace GetUserCartContent$ {
|
|
136
|
+
/** @deprecated use `GetUserCartContent$inboundSchema` instead. */
|
|
137
|
+
export const inboundSchema = GetUserCartContent$inboundSchema;
|
|
138
|
+
/** @deprecated use `GetUserCartContent$outboundSchema` instead. */
|
|
139
|
+
export const outboundSchema = GetUserCartContent$outboundSchema;
|
|
140
|
+
/** @deprecated use `GetUserCartContent$Outbound` instead. */
|
|
141
|
+
export type Outbound = GetUserCartContent$Outbound;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function getUserCartContentToJSON(
|
|
145
|
+
getUserCartContent: GetUserCartContent,
|
|
146
|
+
): string {
|
|
147
|
+
return JSON.stringify(
|
|
148
|
+
GetUserCartContent$outboundSchema.parse(getUserCartContent),
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function getUserCartContentFromJSON(
|
|
153
|
+
jsonString: string,
|
|
154
|
+
): SafeParseResult<GetUserCartContent, SDKValidationError> {
|
|
155
|
+
return safeParse(
|
|
156
|
+
jsonString,
|
|
157
|
+
(x) => GetUserCartContent$inboundSchema.parse(JSON.parse(x)),
|
|
158
|
+
`Failed to parse 'GetUserCartContent' from JSON`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** @internal */
|
|
163
|
+
export const GetUserCartResponseBody$inboundSchema: z.ZodType<
|
|
164
|
+
GetUserCartResponseBody,
|
|
165
|
+
z.ZodTypeDef,
|
|
166
|
+
unknown
|
|
167
|
+
> = z.object({
|
|
168
|
+
message: z.string(),
|
|
169
|
+
success: z.boolean().default(true),
|
|
170
|
+
content: z.lazy(() => GetUserCartContent$inboundSchema),
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
/** @internal */
|
|
174
|
+
export type GetUserCartResponseBody$Outbound = {
|
|
175
|
+
message: string;
|
|
176
|
+
success: boolean;
|
|
177
|
+
content: GetUserCartContent$Outbound;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** @internal */
|
|
181
|
+
export const GetUserCartResponseBody$outboundSchema: z.ZodType<
|
|
182
|
+
GetUserCartResponseBody$Outbound,
|
|
183
|
+
z.ZodTypeDef,
|
|
184
|
+
GetUserCartResponseBody
|
|
185
|
+
> = z.object({
|
|
186
|
+
message: z.string(),
|
|
187
|
+
success: z.boolean().default(true),
|
|
188
|
+
content: z.lazy(() => GetUserCartContent$outboundSchema),
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
194
|
+
*/
|
|
195
|
+
export namespace GetUserCartResponseBody$ {
|
|
196
|
+
/** @deprecated use `GetUserCartResponseBody$inboundSchema` instead. */
|
|
197
|
+
export const inboundSchema = GetUserCartResponseBody$inboundSchema;
|
|
198
|
+
/** @deprecated use `GetUserCartResponseBody$outboundSchema` instead. */
|
|
199
|
+
export const outboundSchema = GetUserCartResponseBody$outboundSchema;
|
|
200
|
+
/** @deprecated use `GetUserCartResponseBody$Outbound` instead. */
|
|
201
|
+
export type Outbound = GetUserCartResponseBody$Outbound;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export function getUserCartResponseBodyToJSON(
|
|
205
|
+
getUserCartResponseBody: GetUserCartResponseBody,
|
|
206
|
+
): string {
|
|
207
|
+
return JSON.stringify(
|
|
208
|
+
GetUserCartResponseBody$outboundSchema.parse(getUserCartResponseBody),
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function getUserCartResponseBodyFromJSON(
|
|
213
|
+
jsonString: string,
|
|
214
|
+
): SafeParseResult<GetUserCartResponseBody, SDKValidationError> {
|
|
215
|
+
return safeParse(
|
|
216
|
+
jsonString,
|
|
217
|
+
(x) => GetUserCartResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
218
|
+
`Failed to parse 'GetUserCartResponseBody' from JSON`,
|
|
219
|
+
);
|
|
220
|
+
}
|
|
@@ -8,12 +8,13 @@ export * from "./checkdeliveryavailability.js";
|
|
|
8
8
|
export * from "./checkverificationstatus.js";
|
|
9
9
|
export * from "./createaddress.js";
|
|
10
10
|
export * from "./createcart.js";
|
|
11
|
-
export * from "./
|
|
11
|
+
export * from "./createcartaddress.js";
|
|
12
12
|
export * from "./createnotificationpreferences.js";
|
|
13
13
|
export * from "./createorder.js";
|
|
14
14
|
export * from "./createproductreview.js";
|
|
15
15
|
export * from "./deleteaddress.js";
|
|
16
16
|
export * from "./deletecart.js";
|
|
17
|
+
export * from "./deleteusercart.js";
|
|
17
18
|
export * from "./generateotp.js";
|
|
18
19
|
export * from "./getaddressdetail.js";
|
|
19
20
|
export * from "./getanonymoustoken.js";
|
|
@@ -22,6 +23,7 @@ export * from "./getnotificationpreferences.js";
|
|
|
22
23
|
export * from "./getorderdetail.js";
|
|
23
24
|
export * from "./getpaymentstatus.js";
|
|
24
25
|
export * from "./getproductdetail.js";
|
|
26
|
+
export * from "./getusercart.js";
|
|
25
27
|
export * from "./getuserdetail.js";
|
|
26
28
|
export * from "./getvariantdetail.js";
|
|
27
29
|
export * from "./listaddresses.js";
|
|
@@ -36,9 +36,12 @@ export type ListAddressesRequest = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export type Address = {
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* null value for guest checkout.
|
|
41
|
+
*/
|
|
42
|
+
id: string | null;
|
|
40
43
|
firstName: string;
|
|
41
|
-
lastName: string;
|
|
44
|
+
lastName: string | null;
|
|
42
45
|
/**
|
|
43
46
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
44
47
|
*
|
|
@@ -159,9 +162,9 @@ export function listAddressesRequestFromJSON(
|
|
|
159
162
|
/** @internal */
|
|
160
163
|
export const Address$inboundSchema: z.ZodType<Address, z.ZodTypeDef, unknown> =
|
|
161
164
|
z.object({
|
|
162
|
-
id: z.string(),
|
|
165
|
+
id: z.nullable(z.string()),
|
|
163
166
|
first_name: z.string(),
|
|
164
|
-
last_name: z.string(),
|
|
167
|
+
last_name: z.nullable(z.string()),
|
|
165
168
|
country_code: z.string(),
|
|
166
169
|
phone: z.string(),
|
|
167
170
|
email: z.string(),
|
|
@@ -196,9 +199,9 @@ export const Address$inboundSchema: z.ZodType<Address, z.ZodTypeDef, unknown> =
|
|
|
196
199
|
|
|
197
200
|
/** @internal */
|
|
198
201
|
export type Address$Outbound = {
|
|
199
|
-
id: string;
|
|
202
|
+
id: string | null;
|
|
200
203
|
first_name: string;
|
|
201
|
-
last_name: string;
|
|
204
|
+
last_name: string | null;
|
|
202
205
|
country_code: string;
|
|
203
206
|
phone: string;
|
|
204
207
|
email: string;
|
|
@@ -223,9 +226,9 @@ export const Address$outboundSchema: z.ZodType<
|
|
|
223
226
|
z.ZodTypeDef,
|
|
224
227
|
Address
|
|
225
228
|
> = z.object({
|
|
226
|
-
id: z.string(),
|
|
229
|
+
id: z.nullable(z.string()),
|
|
227
230
|
firstName: z.string(),
|
|
228
|
-
lastName: z.string(),
|
|
231
|
+
lastName: z.nullable(z.string()),
|
|
229
232
|
countryCode: z.string(),
|
|
230
233
|
phone: z.string(),
|
|
231
234
|
email: z.string(),
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import * as components from "../components/index.js";
|
|
@@ -20,9 +19,11 @@ export const RemoveCouponServerList = [
|
|
|
20
19
|
"https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
21
20
|
] as const;
|
|
22
21
|
|
|
23
|
-
export type
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
export type RemoveCouponRequest = {
|
|
23
|
+
/**
|
|
24
|
+
* Cart ID
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
export type RemoveCouponContent = {
|
|
@@ -42,69 +43,56 @@ export type RemoveCouponResponseBody = {
|
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
/** @internal */
|
|
45
|
-
export const
|
|
46
|
-
|
|
46
|
+
export const RemoveCouponRequest$inboundSchema: z.ZodType<
|
|
47
|
+
RemoveCouponRequest,
|
|
47
48
|
z.ZodTypeDef,
|
|
48
49
|
unknown
|
|
49
50
|
> = z.object({
|
|
50
|
-
|
|
51
|
-
coupon_code: z.string().optional(),
|
|
52
|
-
}).transform((v) => {
|
|
53
|
-
return remap$(v, {
|
|
54
|
-
"cart_id": "cartId",
|
|
55
|
-
"coupon_code": "couponCode",
|
|
56
|
-
});
|
|
51
|
+
id: z.string(),
|
|
57
52
|
});
|
|
58
53
|
|
|
59
54
|
/** @internal */
|
|
60
|
-
export type
|
|
61
|
-
|
|
62
|
-
coupon_code?: string | undefined;
|
|
55
|
+
export type RemoveCouponRequest$Outbound = {
|
|
56
|
+
id: string;
|
|
63
57
|
};
|
|
64
58
|
|
|
65
59
|
/** @internal */
|
|
66
|
-
export const
|
|
67
|
-
|
|
60
|
+
export const RemoveCouponRequest$outboundSchema: z.ZodType<
|
|
61
|
+
RemoveCouponRequest$Outbound,
|
|
68
62
|
z.ZodTypeDef,
|
|
69
|
-
|
|
63
|
+
RemoveCouponRequest
|
|
70
64
|
> = z.object({
|
|
71
|
-
|
|
72
|
-
couponCode: z.string().optional(),
|
|
73
|
-
}).transform((v) => {
|
|
74
|
-
return remap$(v, {
|
|
75
|
-
cartId: "cart_id",
|
|
76
|
-
couponCode: "coupon_code",
|
|
77
|
-
});
|
|
65
|
+
id: z.string(),
|
|
78
66
|
});
|
|
79
67
|
|
|
80
68
|
/**
|
|
81
69
|
* @internal
|
|
82
70
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
83
71
|
*/
|
|
84
|
-
export namespace
|
|
85
|
-
/** @deprecated use `
|
|
86
|
-
export const inboundSchema =
|
|
87
|
-
/** @deprecated use `
|
|
88
|
-
export const outboundSchema =
|
|
89
|
-
/** @deprecated use `
|
|
90
|
-
export type Outbound =
|
|
72
|
+
export namespace RemoveCouponRequest$ {
|
|
73
|
+
/** @deprecated use `RemoveCouponRequest$inboundSchema` instead. */
|
|
74
|
+
export const inboundSchema = RemoveCouponRequest$inboundSchema;
|
|
75
|
+
/** @deprecated use `RemoveCouponRequest$outboundSchema` instead. */
|
|
76
|
+
export const outboundSchema = RemoveCouponRequest$outboundSchema;
|
|
77
|
+
/** @deprecated use `RemoveCouponRequest$Outbound` instead. */
|
|
78
|
+
export type Outbound = RemoveCouponRequest$Outbound;
|
|
91
79
|
}
|
|
92
80
|
|
|
93
|
-
export function
|
|
94
|
-
|
|
81
|
+
export function removeCouponRequestToJSON(
|
|
82
|
+
removeCouponRequest: RemoveCouponRequest,
|
|
95
83
|
): string {
|
|
96
84
|
return JSON.stringify(
|
|
97
|
-
|
|
85
|
+
RemoveCouponRequest$outboundSchema.parse(removeCouponRequest),
|
|
98
86
|
);
|
|
99
87
|
}
|
|
100
88
|
|
|
101
|
-
export function
|
|
89
|
+
export function removeCouponRequestFromJSON(
|
|
102
90
|
jsonString: string,
|
|
103
|
-
): SafeParseResult<
|
|
91
|
+
): SafeParseResult<RemoveCouponRequest, SDKValidationError> {
|
|
104
92
|
return safeParse(
|
|
105
93
|
jsonString,
|
|
106
|
-
(x) =>
|
|
107
|
-
`Failed to parse '
|
|
94
|
+
(x) => RemoveCouponRequest$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'RemoveCouponRequest' from JSON`,
|
|
108
96
|
);
|
|
109
97
|
}
|
|
110
98
|
|