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
|
@@ -21,10 +21,17 @@ export const ApplyCouponServerList = [
|
|
|
21
21
|
] as const;
|
|
22
22
|
|
|
23
23
|
export type ApplyCouponRequestBody = {
|
|
24
|
-
cartId: string;
|
|
25
24
|
couponCode: string;
|
|
26
25
|
};
|
|
27
26
|
|
|
27
|
+
export type ApplyCouponRequest = {
|
|
28
|
+
/**
|
|
29
|
+
* Cart ID
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
requestBody: ApplyCouponRequestBody;
|
|
33
|
+
};
|
|
34
|
+
|
|
28
35
|
export type ApplyCouponContent = {
|
|
29
36
|
/**
|
|
30
37
|
* 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.
|
|
@@ -47,18 +54,15 @@ export const ApplyCouponRequestBody$inboundSchema: z.ZodType<
|
|
|
47
54
|
z.ZodTypeDef,
|
|
48
55
|
unknown
|
|
49
56
|
> = z.object({
|
|
50
|
-
cart_id: z.string(),
|
|
51
57
|
coupon_code: z.string(),
|
|
52
58
|
}).transform((v) => {
|
|
53
59
|
return remap$(v, {
|
|
54
|
-
"cart_id": "cartId",
|
|
55
60
|
"coupon_code": "couponCode",
|
|
56
61
|
});
|
|
57
62
|
});
|
|
58
63
|
|
|
59
64
|
/** @internal */
|
|
60
65
|
export type ApplyCouponRequestBody$Outbound = {
|
|
61
|
-
cart_id: string;
|
|
62
66
|
coupon_code: string;
|
|
63
67
|
};
|
|
64
68
|
|
|
@@ -68,11 +72,9 @@ export const ApplyCouponRequestBody$outboundSchema: z.ZodType<
|
|
|
68
72
|
z.ZodTypeDef,
|
|
69
73
|
ApplyCouponRequestBody
|
|
70
74
|
> = z.object({
|
|
71
|
-
cartId: z.string(),
|
|
72
75
|
couponCode: z.string(),
|
|
73
76
|
}).transform((v) => {
|
|
74
77
|
return remap$(v, {
|
|
75
|
-
cartId: "cart_id",
|
|
76
78
|
couponCode: "coupon_code",
|
|
77
79
|
});
|
|
78
80
|
});
|
|
@@ -108,6 +110,71 @@ export function applyCouponRequestBodyFromJSON(
|
|
|
108
110
|
);
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
/** @internal */
|
|
114
|
+
export const ApplyCouponRequest$inboundSchema: z.ZodType<
|
|
115
|
+
ApplyCouponRequest,
|
|
116
|
+
z.ZodTypeDef,
|
|
117
|
+
unknown
|
|
118
|
+
> = z.object({
|
|
119
|
+
id: z.string(),
|
|
120
|
+
RequestBody: z.lazy(() => ApplyCouponRequestBody$inboundSchema),
|
|
121
|
+
}).transform((v) => {
|
|
122
|
+
return remap$(v, {
|
|
123
|
+
"RequestBody": "requestBody",
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export type ApplyCouponRequest$Outbound = {
|
|
129
|
+
id: string;
|
|
130
|
+
RequestBody: ApplyCouponRequestBody$Outbound;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export const ApplyCouponRequest$outboundSchema: z.ZodType<
|
|
135
|
+
ApplyCouponRequest$Outbound,
|
|
136
|
+
z.ZodTypeDef,
|
|
137
|
+
ApplyCouponRequest
|
|
138
|
+
> = z.object({
|
|
139
|
+
id: z.string(),
|
|
140
|
+
requestBody: z.lazy(() => ApplyCouponRequestBody$outboundSchema),
|
|
141
|
+
}).transform((v) => {
|
|
142
|
+
return remap$(v, {
|
|
143
|
+
requestBody: "RequestBody",
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* @internal
|
|
149
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
150
|
+
*/
|
|
151
|
+
export namespace ApplyCouponRequest$ {
|
|
152
|
+
/** @deprecated use `ApplyCouponRequest$inboundSchema` instead. */
|
|
153
|
+
export const inboundSchema = ApplyCouponRequest$inboundSchema;
|
|
154
|
+
/** @deprecated use `ApplyCouponRequest$outboundSchema` instead. */
|
|
155
|
+
export const outboundSchema = ApplyCouponRequest$outboundSchema;
|
|
156
|
+
/** @deprecated use `ApplyCouponRequest$Outbound` instead. */
|
|
157
|
+
export type Outbound = ApplyCouponRequest$Outbound;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function applyCouponRequestToJSON(
|
|
161
|
+
applyCouponRequest: ApplyCouponRequest,
|
|
162
|
+
): string {
|
|
163
|
+
return JSON.stringify(
|
|
164
|
+
ApplyCouponRequest$outboundSchema.parse(applyCouponRequest),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function applyCouponRequestFromJSON(
|
|
169
|
+
jsonString: string,
|
|
170
|
+
): SafeParseResult<ApplyCouponRequest, SDKValidationError> {
|
|
171
|
+
return safeParse(
|
|
172
|
+
jsonString,
|
|
173
|
+
(x) => ApplyCouponRequest$inboundSchema.parse(JSON.parse(x)),
|
|
174
|
+
`Failed to parse 'ApplyCouponRequest' from JSON`,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
111
178
|
/** @internal */
|
|
112
179
|
export const ApplyCouponContent$inboundSchema: z.ZodType<
|
|
113
180
|
ApplyCouponContent,
|
|
@@ -24,8 +24,12 @@ export const CreateAddressServerList = [
|
|
|
24
24
|
* payload for new address
|
|
25
25
|
*/
|
|
26
26
|
export type CreateAddressRequestBody = {
|
|
27
|
+
/**
|
|
28
|
+
* null value for guest checkout.
|
|
29
|
+
*/
|
|
30
|
+
id: string | null;
|
|
27
31
|
firstName: string;
|
|
28
|
-
lastName: string;
|
|
32
|
+
lastName: string | null;
|
|
29
33
|
/**
|
|
30
34
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
31
35
|
*
|
|
@@ -86,8 +90,9 @@ export const CreateAddressRequestBody$inboundSchema: z.ZodType<
|
|
|
86
90
|
z.ZodTypeDef,
|
|
87
91
|
unknown
|
|
88
92
|
> = z.object({
|
|
93
|
+
id: z.nullable(z.string()),
|
|
89
94
|
first_name: z.string(),
|
|
90
|
-
last_name: z.string(),
|
|
95
|
+
last_name: z.nullable(z.string()),
|
|
91
96
|
country_code: z.string(),
|
|
92
97
|
phone: z.string(),
|
|
93
98
|
email: z.string(),
|
|
@@ -118,8 +123,9 @@ export const CreateAddressRequestBody$inboundSchema: z.ZodType<
|
|
|
118
123
|
|
|
119
124
|
/** @internal */
|
|
120
125
|
export type CreateAddressRequestBody$Outbound = {
|
|
126
|
+
id: string | null;
|
|
121
127
|
first_name: string;
|
|
122
|
-
last_name: string;
|
|
128
|
+
last_name: string | null;
|
|
123
129
|
country_code: string;
|
|
124
130
|
phone: string;
|
|
125
131
|
email: string;
|
|
@@ -142,8 +148,9 @@ export const CreateAddressRequestBody$outboundSchema: z.ZodType<
|
|
|
142
148
|
z.ZodTypeDef,
|
|
143
149
|
CreateAddressRequestBody
|
|
144
150
|
> = z.object({
|
|
151
|
+
id: z.nullable(z.string()),
|
|
145
152
|
firstName: z.string(),
|
|
146
|
-
lastName: z.string(),
|
|
153
|
+
lastName: z.nullable(z.string()),
|
|
147
154
|
countryCode: z.string(),
|
|
148
155
|
phone: z.string(),
|
|
149
156
|
email: z.string(),
|
|
@@ -9,7 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import * as components from "../components/index.js";
|
|
10
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
11
|
|
|
12
|
-
export const
|
|
12
|
+
export const CreateCartAddressServerList = [
|
|
13
13
|
/**
|
|
14
14
|
* Staging Server
|
|
15
15
|
*/
|
|
@@ -24,7 +24,6 @@ export const CreateCheckoutAddressServerList = [
|
|
|
24
24
|
* For guest checkout where address is not saved
|
|
25
25
|
*/
|
|
26
26
|
export type GuestUser = {
|
|
27
|
-
cartId: string;
|
|
28
27
|
billingAddress: components.CustomerAddressInput | null;
|
|
29
28
|
shippingAddress: components.CustomerAddressInput | null;
|
|
30
29
|
};
|
|
@@ -33,7 +32,6 @@ export type GuestUser = {
|
|
|
33
32
|
* For registered users where address is previously added
|
|
34
33
|
*/
|
|
35
34
|
export type RegisteredUser = {
|
|
36
|
-
cartId: string;
|
|
37
35
|
billingAddressId: string;
|
|
38
36
|
shippingAddressId: string;
|
|
39
37
|
};
|
|
@@ -41,9 +39,20 @@ export type RegisteredUser = {
|
|
|
41
39
|
/**
|
|
42
40
|
* Update billing and shipping address during checkout
|
|
43
41
|
*/
|
|
44
|
-
export type
|
|
42
|
+
export type CreateCartAddressRequestBody = RegisteredUser | GuestUser;
|
|
45
43
|
|
|
46
|
-
export type
|
|
44
|
+
export type CreateCartAddressRequest = {
|
|
45
|
+
/**
|
|
46
|
+
* Cart ID
|
|
47
|
+
*/
|
|
48
|
+
id: string;
|
|
49
|
+
/**
|
|
50
|
+
* Update billing and shipping address during checkout
|
|
51
|
+
*/
|
|
52
|
+
requestBody: RegisteredUser | GuestUser;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type CreateCartAddressContent = {
|
|
47
56
|
/**
|
|
48
57
|
* 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.
|
|
49
58
|
*/
|
|
@@ -53,10 +62,10 @@ export type CreateCheckoutAddressContent = {
|
|
|
53
62
|
/**
|
|
54
63
|
* OK
|
|
55
64
|
*/
|
|
56
|
-
export type
|
|
65
|
+
export type CreateCartAddressResponseBody = {
|
|
57
66
|
message: string;
|
|
58
67
|
success: boolean;
|
|
59
|
-
content:
|
|
68
|
+
content: CreateCartAddressContent;
|
|
60
69
|
};
|
|
61
70
|
|
|
62
71
|
/** @internal */
|
|
@@ -65,12 +74,10 @@ export const GuestUser$inboundSchema: z.ZodType<
|
|
|
65
74
|
z.ZodTypeDef,
|
|
66
75
|
unknown
|
|
67
76
|
> = z.object({
|
|
68
|
-
cart_id: z.string(),
|
|
69
77
|
billing_address: z.nullable(components.CustomerAddressInput$inboundSchema),
|
|
70
78
|
shipping_address: z.nullable(components.CustomerAddressInput$inboundSchema),
|
|
71
79
|
}).transform((v) => {
|
|
72
80
|
return remap$(v, {
|
|
73
|
-
"cart_id": "cartId",
|
|
74
81
|
"billing_address": "billingAddress",
|
|
75
82
|
"shipping_address": "shippingAddress",
|
|
76
83
|
});
|
|
@@ -78,7 +85,6 @@ export const GuestUser$inboundSchema: z.ZodType<
|
|
|
78
85
|
|
|
79
86
|
/** @internal */
|
|
80
87
|
export type GuestUser$Outbound = {
|
|
81
|
-
cart_id: string;
|
|
82
88
|
billing_address: components.CustomerAddressInput$Outbound | null;
|
|
83
89
|
shipping_address: components.CustomerAddressInput$Outbound | null;
|
|
84
90
|
};
|
|
@@ -89,12 +95,10 @@ export const GuestUser$outboundSchema: z.ZodType<
|
|
|
89
95
|
z.ZodTypeDef,
|
|
90
96
|
GuestUser
|
|
91
97
|
> = z.object({
|
|
92
|
-
cartId: z.string(),
|
|
93
98
|
billingAddress: z.nullable(components.CustomerAddressInput$outboundSchema),
|
|
94
99
|
shippingAddress: z.nullable(components.CustomerAddressInput$outboundSchema),
|
|
95
100
|
}).transform((v) => {
|
|
96
101
|
return remap$(v, {
|
|
97
|
-
cartId: "cart_id",
|
|
98
102
|
billingAddress: "billing_address",
|
|
99
103
|
shippingAddress: "shipping_address",
|
|
100
104
|
});
|
|
@@ -133,12 +137,10 @@ export const RegisteredUser$inboundSchema: z.ZodType<
|
|
|
133
137
|
z.ZodTypeDef,
|
|
134
138
|
unknown
|
|
135
139
|
> = z.object({
|
|
136
|
-
cart_id: z.string(),
|
|
137
140
|
billing_address_id: z.string(),
|
|
138
141
|
shipping_address_id: z.string(),
|
|
139
142
|
}).transform((v) => {
|
|
140
143
|
return remap$(v, {
|
|
141
|
-
"cart_id": "cartId",
|
|
142
144
|
"billing_address_id": "billingAddressId",
|
|
143
145
|
"shipping_address_id": "shippingAddressId",
|
|
144
146
|
});
|
|
@@ -146,7 +148,6 @@ export const RegisteredUser$inboundSchema: z.ZodType<
|
|
|
146
148
|
|
|
147
149
|
/** @internal */
|
|
148
150
|
export type RegisteredUser$Outbound = {
|
|
149
|
-
cart_id: string;
|
|
150
151
|
billing_address_id: string;
|
|
151
152
|
shipping_address_id: string;
|
|
152
153
|
};
|
|
@@ -157,12 +158,10 @@ export const RegisteredUser$outboundSchema: z.ZodType<
|
|
|
157
158
|
z.ZodTypeDef,
|
|
158
159
|
RegisteredUser
|
|
159
160
|
> = z.object({
|
|
160
|
-
cartId: z.string(),
|
|
161
161
|
billingAddressId: z.string(),
|
|
162
162
|
shippingAddressId: z.string(),
|
|
163
163
|
}).transform((v) => {
|
|
164
164
|
return remap$(v, {
|
|
165
|
-
cartId: "cart_id",
|
|
166
165
|
billingAddressId: "billing_address_id",
|
|
167
166
|
shippingAddressId: "shipping_address_id",
|
|
168
167
|
});
|
|
@@ -196,8 +195,8 @@ export function registeredUserFromJSON(
|
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
/** @internal */
|
|
199
|
-
export const
|
|
200
|
-
|
|
198
|
+
export const CreateCartAddressRequestBody$inboundSchema: z.ZodType<
|
|
199
|
+
CreateCartAddressRequestBody,
|
|
201
200
|
z.ZodTypeDef,
|
|
202
201
|
unknown
|
|
203
202
|
> = z.union([
|
|
@@ -206,15 +205,15 @@ export const CreateCheckoutAddressRequestBody$inboundSchema: z.ZodType<
|
|
|
206
205
|
]);
|
|
207
206
|
|
|
208
207
|
/** @internal */
|
|
209
|
-
export type
|
|
208
|
+
export type CreateCartAddressRequestBody$Outbound =
|
|
210
209
|
| RegisteredUser$Outbound
|
|
211
210
|
| GuestUser$Outbound;
|
|
212
211
|
|
|
213
212
|
/** @internal */
|
|
214
|
-
export const
|
|
215
|
-
|
|
213
|
+
export const CreateCartAddressRequestBody$outboundSchema: z.ZodType<
|
|
214
|
+
CreateCartAddressRequestBody$Outbound,
|
|
216
215
|
z.ZodTypeDef,
|
|
217
|
-
|
|
216
|
+
CreateCartAddressRequestBody
|
|
218
217
|
> = z.union([
|
|
219
218
|
z.lazy(() => RegisteredUser$outboundSchema),
|
|
220
219
|
z.lazy(() => GuestUser$outboundSchema),
|
|
@@ -224,38 +223,109 @@ export const CreateCheckoutAddressRequestBody$outboundSchema: z.ZodType<
|
|
|
224
223
|
* @internal
|
|
225
224
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
226
225
|
*/
|
|
227
|
-
export namespace
|
|
228
|
-
/** @deprecated use `
|
|
229
|
-
export const inboundSchema =
|
|
230
|
-
/** @deprecated use `
|
|
231
|
-
export const outboundSchema =
|
|
232
|
-
/** @deprecated use `
|
|
233
|
-
export type Outbound =
|
|
226
|
+
export namespace CreateCartAddressRequestBody$ {
|
|
227
|
+
/** @deprecated use `CreateCartAddressRequestBody$inboundSchema` instead. */
|
|
228
|
+
export const inboundSchema = CreateCartAddressRequestBody$inboundSchema;
|
|
229
|
+
/** @deprecated use `CreateCartAddressRequestBody$outboundSchema` instead. */
|
|
230
|
+
export const outboundSchema = CreateCartAddressRequestBody$outboundSchema;
|
|
231
|
+
/** @deprecated use `CreateCartAddressRequestBody$Outbound` instead. */
|
|
232
|
+
export type Outbound = CreateCartAddressRequestBody$Outbound;
|
|
234
233
|
}
|
|
235
234
|
|
|
236
|
-
export function
|
|
237
|
-
|
|
235
|
+
export function createCartAddressRequestBodyToJSON(
|
|
236
|
+
createCartAddressRequestBody: CreateCartAddressRequestBody,
|
|
238
237
|
): string {
|
|
239
238
|
return JSON.stringify(
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
CreateCartAddressRequestBody$outboundSchema.parse(
|
|
240
|
+
createCartAddressRequestBody,
|
|
242
241
|
),
|
|
243
242
|
);
|
|
244
243
|
}
|
|
245
244
|
|
|
246
|
-
export function
|
|
245
|
+
export function createCartAddressRequestBodyFromJSON(
|
|
246
|
+
jsonString: string,
|
|
247
|
+
): SafeParseResult<CreateCartAddressRequestBody, SDKValidationError> {
|
|
248
|
+
return safeParse(
|
|
249
|
+
jsonString,
|
|
250
|
+
(x) => CreateCartAddressRequestBody$inboundSchema.parse(JSON.parse(x)),
|
|
251
|
+
`Failed to parse 'CreateCartAddressRequestBody' from JSON`,
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** @internal */
|
|
256
|
+
export const CreateCartAddressRequest$inboundSchema: z.ZodType<
|
|
257
|
+
CreateCartAddressRequest,
|
|
258
|
+
z.ZodTypeDef,
|
|
259
|
+
unknown
|
|
260
|
+
> = z.object({
|
|
261
|
+
id: z.string(),
|
|
262
|
+
RequestBody: z.union([
|
|
263
|
+
z.lazy(() => RegisteredUser$inboundSchema),
|
|
264
|
+
z.lazy(() => GuestUser$inboundSchema),
|
|
265
|
+
]),
|
|
266
|
+
}).transform((v) => {
|
|
267
|
+
return remap$(v, {
|
|
268
|
+
"RequestBody": "requestBody",
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
/** @internal */
|
|
273
|
+
export type CreateCartAddressRequest$Outbound = {
|
|
274
|
+
id: string;
|
|
275
|
+
RequestBody: RegisteredUser$Outbound | GuestUser$Outbound;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/** @internal */
|
|
279
|
+
export const CreateCartAddressRequest$outboundSchema: z.ZodType<
|
|
280
|
+
CreateCartAddressRequest$Outbound,
|
|
281
|
+
z.ZodTypeDef,
|
|
282
|
+
CreateCartAddressRequest
|
|
283
|
+
> = z.object({
|
|
284
|
+
id: z.string(),
|
|
285
|
+
requestBody: z.union([
|
|
286
|
+
z.lazy(() => RegisteredUser$outboundSchema),
|
|
287
|
+
z.lazy(() => GuestUser$outboundSchema),
|
|
288
|
+
]),
|
|
289
|
+
}).transform((v) => {
|
|
290
|
+
return remap$(v, {
|
|
291
|
+
requestBody: "RequestBody",
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @internal
|
|
297
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
298
|
+
*/
|
|
299
|
+
export namespace CreateCartAddressRequest$ {
|
|
300
|
+
/** @deprecated use `CreateCartAddressRequest$inboundSchema` instead. */
|
|
301
|
+
export const inboundSchema = CreateCartAddressRequest$inboundSchema;
|
|
302
|
+
/** @deprecated use `CreateCartAddressRequest$outboundSchema` instead. */
|
|
303
|
+
export const outboundSchema = CreateCartAddressRequest$outboundSchema;
|
|
304
|
+
/** @deprecated use `CreateCartAddressRequest$Outbound` instead. */
|
|
305
|
+
export type Outbound = CreateCartAddressRequest$Outbound;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export function createCartAddressRequestToJSON(
|
|
309
|
+
createCartAddressRequest: CreateCartAddressRequest,
|
|
310
|
+
): string {
|
|
311
|
+
return JSON.stringify(
|
|
312
|
+
CreateCartAddressRequest$outboundSchema.parse(createCartAddressRequest),
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export function createCartAddressRequestFromJSON(
|
|
247
317
|
jsonString: string,
|
|
248
|
-
): SafeParseResult<
|
|
318
|
+
): SafeParseResult<CreateCartAddressRequest, SDKValidationError> {
|
|
249
319
|
return safeParse(
|
|
250
320
|
jsonString,
|
|
251
|
-
(x) =>
|
|
252
|
-
`Failed to parse '
|
|
321
|
+
(x) => CreateCartAddressRequest$inboundSchema.parse(JSON.parse(x)),
|
|
322
|
+
`Failed to parse 'CreateCartAddressRequest' from JSON`,
|
|
253
323
|
);
|
|
254
324
|
}
|
|
255
325
|
|
|
256
326
|
/** @internal */
|
|
257
|
-
export const
|
|
258
|
-
|
|
327
|
+
export const CreateCartAddressContent$inboundSchema: z.ZodType<
|
|
328
|
+
CreateCartAddressContent,
|
|
259
329
|
z.ZodTypeDef,
|
|
260
330
|
unknown
|
|
261
331
|
> = z.object({
|
|
@@ -263,15 +333,15 @@ export const CreateCheckoutAddressContent$inboundSchema: z.ZodType<
|
|
|
263
333
|
});
|
|
264
334
|
|
|
265
335
|
/** @internal */
|
|
266
|
-
export type
|
|
336
|
+
export type CreateCartAddressContent$Outbound = {
|
|
267
337
|
cart: components.Cart$Outbound;
|
|
268
338
|
};
|
|
269
339
|
|
|
270
340
|
/** @internal */
|
|
271
|
-
export const
|
|
272
|
-
|
|
341
|
+
export const CreateCartAddressContent$outboundSchema: z.ZodType<
|
|
342
|
+
CreateCartAddressContent$Outbound,
|
|
273
343
|
z.ZodTypeDef,
|
|
274
|
-
|
|
344
|
+
CreateCartAddressContent
|
|
275
345
|
> = z.object({
|
|
276
346
|
cart: components.Cart$outboundSchema,
|
|
277
347
|
});
|
|
@@ -280,94 +350,91 @@ export const CreateCheckoutAddressContent$outboundSchema: z.ZodType<
|
|
|
280
350
|
* @internal
|
|
281
351
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
282
352
|
*/
|
|
283
|
-
export namespace
|
|
284
|
-
/** @deprecated use `
|
|
285
|
-
export const inboundSchema =
|
|
286
|
-
/** @deprecated use `
|
|
287
|
-
export const outboundSchema =
|
|
288
|
-
/** @deprecated use `
|
|
289
|
-
export type Outbound =
|
|
353
|
+
export namespace CreateCartAddressContent$ {
|
|
354
|
+
/** @deprecated use `CreateCartAddressContent$inboundSchema` instead. */
|
|
355
|
+
export const inboundSchema = CreateCartAddressContent$inboundSchema;
|
|
356
|
+
/** @deprecated use `CreateCartAddressContent$outboundSchema` instead. */
|
|
357
|
+
export const outboundSchema = CreateCartAddressContent$outboundSchema;
|
|
358
|
+
/** @deprecated use `CreateCartAddressContent$Outbound` instead. */
|
|
359
|
+
export type Outbound = CreateCartAddressContent$Outbound;
|
|
290
360
|
}
|
|
291
361
|
|
|
292
|
-
export function
|
|
293
|
-
|
|
362
|
+
export function createCartAddressContentToJSON(
|
|
363
|
+
createCartAddressContent: CreateCartAddressContent,
|
|
294
364
|
): string {
|
|
295
365
|
return JSON.stringify(
|
|
296
|
-
|
|
297
|
-
createCheckoutAddressContent,
|
|
298
|
-
),
|
|
366
|
+
CreateCartAddressContent$outboundSchema.parse(createCartAddressContent),
|
|
299
367
|
);
|
|
300
368
|
}
|
|
301
369
|
|
|
302
|
-
export function
|
|
370
|
+
export function createCartAddressContentFromJSON(
|
|
303
371
|
jsonString: string,
|
|
304
|
-
): SafeParseResult<
|
|
372
|
+
): SafeParseResult<CreateCartAddressContent, SDKValidationError> {
|
|
305
373
|
return safeParse(
|
|
306
374
|
jsonString,
|
|
307
|
-
(x) =>
|
|
308
|
-
`Failed to parse '
|
|
375
|
+
(x) => CreateCartAddressContent$inboundSchema.parse(JSON.parse(x)),
|
|
376
|
+
`Failed to parse 'CreateCartAddressContent' from JSON`,
|
|
309
377
|
);
|
|
310
378
|
}
|
|
311
379
|
|
|
312
380
|
/** @internal */
|
|
313
|
-
export const
|
|
314
|
-
|
|
381
|
+
export const CreateCartAddressResponseBody$inboundSchema: z.ZodType<
|
|
382
|
+
CreateCartAddressResponseBody,
|
|
315
383
|
z.ZodTypeDef,
|
|
316
384
|
unknown
|
|
317
385
|
> = z.object({
|
|
318
386
|
message: z.string(),
|
|
319
387
|
success: z.boolean(),
|
|
320
|
-
content: z.lazy(() =>
|
|
388
|
+
content: z.lazy(() => CreateCartAddressContent$inboundSchema),
|
|
321
389
|
});
|
|
322
390
|
|
|
323
391
|
/** @internal */
|
|
324
|
-
export type
|
|
392
|
+
export type CreateCartAddressResponseBody$Outbound = {
|
|
325
393
|
message: string;
|
|
326
394
|
success: boolean;
|
|
327
|
-
content:
|
|
395
|
+
content: CreateCartAddressContent$Outbound;
|
|
328
396
|
};
|
|
329
397
|
|
|
330
398
|
/** @internal */
|
|
331
|
-
export const
|
|
332
|
-
|
|
399
|
+
export const CreateCartAddressResponseBody$outboundSchema: z.ZodType<
|
|
400
|
+
CreateCartAddressResponseBody$Outbound,
|
|
333
401
|
z.ZodTypeDef,
|
|
334
|
-
|
|
402
|
+
CreateCartAddressResponseBody
|
|
335
403
|
> = z.object({
|
|
336
404
|
message: z.string(),
|
|
337
405
|
success: z.boolean(),
|
|
338
|
-
content: z.lazy(() =>
|
|
406
|
+
content: z.lazy(() => CreateCartAddressContent$outboundSchema),
|
|
339
407
|
});
|
|
340
408
|
|
|
341
409
|
/**
|
|
342
410
|
* @internal
|
|
343
411
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
344
412
|
*/
|
|
345
|
-
export namespace
|
|
346
|
-
/** @deprecated use `
|
|
347
|
-
export const inboundSchema =
|
|
348
|
-
/** @deprecated use `
|
|
349
|
-
export const outboundSchema =
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
export type Outbound = CreateCheckoutAddressResponseBody$Outbound;
|
|
413
|
+
export namespace CreateCartAddressResponseBody$ {
|
|
414
|
+
/** @deprecated use `CreateCartAddressResponseBody$inboundSchema` instead. */
|
|
415
|
+
export const inboundSchema = CreateCartAddressResponseBody$inboundSchema;
|
|
416
|
+
/** @deprecated use `CreateCartAddressResponseBody$outboundSchema` instead. */
|
|
417
|
+
export const outboundSchema = CreateCartAddressResponseBody$outboundSchema;
|
|
418
|
+
/** @deprecated use `CreateCartAddressResponseBody$Outbound` instead. */
|
|
419
|
+
export type Outbound = CreateCartAddressResponseBody$Outbound;
|
|
353
420
|
}
|
|
354
421
|
|
|
355
|
-
export function
|
|
356
|
-
|
|
422
|
+
export function createCartAddressResponseBodyToJSON(
|
|
423
|
+
createCartAddressResponseBody: CreateCartAddressResponseBody,
|
|
357
424
|
): string {
|
|
358
425
|
return JSON.stringify(
|
|
359
|
-
|
|
360
|
-
|
|
426
|
+
CreateCartAddressResponseBody$outboundSchema.parse(
|
|
427
|
+
createCartAddressResponseBody,
|
|
361
428
|
),
|
|
362
429
|
);
|
|
363
430
|
}
|
|
364
431
|
|
|
365
|
-
export function
|
|
432
|
+
export function createCartAddressResponseBodyFromJSON(
|
|
366
433
|
jsonString: string,
|
|
367
|
-
): SafeParseResult<
|
|
434
|
+
): SafeParseResult<CreateCartAddressResponseBody, SDKValidationError> {
|
|
368
435
|
return safeParse(
|
|
369
436
|
jsonString,
|
|
370
|
-
(x) =>
|
|
371
|
-
`Failed to parse '
|
|
437
|
+
(x) => CreateCartAddressResponseBody$inboundSchema.parse(JSON.parse(x)),
|
|
438
|
+
`Failed to parse 'CreateCartAddressResponseBody' from JSON`,
|
|
372
439
|
);
|
|
373
440
|
}
|
|
@@ -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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -21,9 +20,9 @@ export const DeleteCartServerList = [
|
|
|
21
20
|
|
|
22
21
|
export type DeleteCartRequest = {
|
|
23
22
|
/**
|
|
24
|
-
*
|
|
23
|
+
* Cart ID
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
id: string;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
/**
|
|
@@ -40,16 +39,12 @@ export const DeleteCartRequest$inboundSchema: z.ZodType<
|
|
|
40
39
|
z.ZodTypeDef,
|
|
41
40
|
unknown
|
|
42
41
|
> = z.object({
|
|
43
|
-
|
|
44
|
-
}).transform((v) => {
|
|
45
|
-
return remap$(v, {
|
|
46
|
-
"user_id": "userId",
|
|
47
|
-
});
|
|
42
|
+
id: z.string(),
|
|
48
43
|
});
|
|
49
44
|
|
|
50
45
|
/** @internal */
|
|
51
46
|
export type DeleteCartRequest$Outbound = {
|
|
52
|
-
|
|
47
|
+
id: string;
|
|
53
48
|
};
|
|
54
49
|
|
|
55
50
|
/** @internal */
|
|
@@ -58,11 +53,7 @@ export const DeleteCartRequest$outboundSchema: z.ZodType<
|
|
|
58
53
|
z.ZodTypeDef,
|
|
59
54
|
DeleteCartRequest
|
|
60
55
|
> = z.object({
|
|
61
|
-
|
|
62
|
-
}).transform((v) => {
|
|
63
|
-
return remap$(v, {
|
|
64
|
-
userId: "user_id",
|
|
65
|
-
});
|
|
56
|
+
id: z.string(),
|
|
66
57
|
});
|
|
67
58
|
|
|
68
59
|
/**
|