ce-storefront 0.3.8 → 0.3.10
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/docs/sdks/auth/README.md +2 -0
- package/docs/sdks/carts/README.md +22 -12
- package/docs/sdks/cestorefrontuser/README.md +22 -2
- package/docs/sdks/checkout/README.md +4 -0
- package/esm/funcs/cartsAddItem.js +1 -1
- package/esm/funcs/cartsAddItem.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/models/components/anonymoususer.d.ts +14 -14
- package/esm/models/components/anonymoususer.d.ts.map +1 -1
- package/esm/models/components/anonymoususer.js +14 -14
- package/esm/models/components/anonymoususer.js.map +1 -1
- package/esm/models/components/index.d.ts +1 -1
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +1 -1
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +4 -4
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +4 -4
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/updatecartitem.d.ts +45 -0
- package/esm/models/components/updatecartitem.d.ts.map +1 -0
- package/esm/models/components/updatecartitem.js +46 -0
- package/esm/models/components/updatecartitem.js.map +1 -0
- package/esm/models/components/user.d.ts +116 -26
- package/esm/models/components/user.d.ts.map +1 -1
- package/esm/models/components/user.js +104 -30
- package/esm/models/components/user.js.map +1 -1
- package/esm/models/operations/getcrosssell.d.ts +6 -6
- package/esm/models/operations/getcrosssell.d.ts.map +1 -1
- package/esm/models/operations/getcrosssell.js +6 -6
- package/esm/models/operations/getcrosssell.js.map +1 -1
- package/esm/models/operations/getproductdetails.d.ts +2 -2
- package/esm/models/operations/getproductdetails.d.ts.map +1 -1
- package/esm/models/operations/getproductdetails.js +2 -2
- package/esm/models/operations/getproductdetails.js.map +1 -1
- package/esm/models/operations/getproductscategories.d.ts +4 -4
- package/esm/models/operations/getproductscategories.d.ts.map +1 -1
- package/esm/models/operations/getproductscategories.js +4 -4
- package/esm/models/operations/getproductscategories.js.map +1 -1
- package/esm/models/operations/getproductsidreviews.d.ts +4 -4
- package/esm/models/operations/getproductsidreviews.d.ts.map +1 -1
- package/esm/models/operations/getproductsidreviews.js +4 -4
- package/esm/models/operations/getproductsidreviews.js.map +1 -1
- package/esm/models/operations/getproductvariantdetail.d.ts +2 -2
- package/esm/models/operations/getproductvariantdetail.d.ts.map +1 -1
- package/esm/models/operations/getproductvariantdetail.js +2 -2
- package/esm/models/operations/getproductvariantdetail.js.map +1 -1
- package/esm/models/operations/getproductvariants.d.ts +2 -2
- package/esm/models/operations/getproductvariants.d.ts.map +1 -1
- package/esm/models/operations/getproductvariants.js +2 -2
- package/esm/models/operations/getproductvariants.js.map +1 -1
- package/esm/models/operations/getsimilar.d.ts +6 -6
- package/esm/models/operations/getsimilar.d.ts.map +1 -1
- package/esm/models/operations/getsimilar.js +6 -6
- package/esm/models/operations/getsimilar.js.map +1 -1
- package/esm/models/operations/getskus.d.ts +4 -4
- package/esm/models/operations/getskus.d.ts.map +1 -1
- package/esm/models/operations/getskus.js +4 -4
- package/esm/models/operations/getskus.js.map +1 -1
- package/esm/models/operations/getupsell.d.ts +6 -6
- package/esm/models/operations/getupsell.d.ts.map +1 -1
- package/esm/models/operations/getupsell.js +6 -6
- package/esm/models/operations/getupsell.js.map +1 -1
- package/esm/models/operations/postauthanonymous.d.ts +12 -12
- package/esm/models/operations/postauthanonymous.d.ts.map +1 -1
- package/esm/models/operations/postauthanonymous.js +12 -12
- package/esm/models/operations/postauthanonymous.js.map +1 -1
- package/esm/models/operations/postauthgenerateotp.d.ts +2 -2
- package/esm/models/operations/postauthgenerateotp.d.ts.map +1 -1
- package/esm/models/operations/postauthgenerateotp.js +2 -2
- package/esm/models/operations/postauthgenerateotp.js.map +1 -1
- package/esm/models/operations/postcartaddress.d.ts +8 -8
- package/esm/models/operations/postcartaddress.d.ts.map +1 -1
- package/esm/models/operations/postcartaddress.js +8 -12
- package/esm/models/operations/postcartaddress.js.map +1 -1
- package/esm/models/operations/postcartitemid.d.ts +2 -35
- package/esm/models/operations/postcartitemid.d.ts.map +1 -1
- package/esm/models/operations/postcartitemid.js +4 -49
- package/esm/models/operations/postcartitemid.js.map +1 -1
- package/esm/models/operations/postcartsid.d.ts +5 -31
- package/esm/models/operations/postcartsid.d.ts.map +1 -1
- package/esm/models/operations/postcartsid.js +2 -41
- package/esm/models/operations/postcartsid.js.map +1 -1
- package/esm/models/operations/postproductsidreviews.d.ts +4 -4
- package/esm/models/operations/postproductsidreviews.d.ts.map +1 -1
- package/esm/models/operations/postproductsidreviews.js +4 -4
- package/esm/models/operations/postproductsidreviews.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/cartsAddItem.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/anonymoususer.ts +28 -28
- package/src/models/components/index.ts +1 -1
- package/src/models/components/productlistresponse.ts +8 -8
- package/src/models/components/updatecartitem.ts +93 -0
- package/src/models/components/user.ts +199 -56
- package/src/models/operations/getcrosssell.ts +12 -12
- package/src/models/operations/getproductdetails.ts +4 -4
- package/src/models/operations/getproductscategories.ts +8 -8
- package/src/models/operations/getproductsidreviews.ts +8 -8
- package/src/models/operations/getproductvariantdetail.ts +4 -4
- package/src/models/operations/getproductvariants.ts +4 -4
- package/src/models/operations/getsimilar.ts +12 -12
- package/src/models/operations/getskus.ts +8 -8
- package/src/models/operations/getupsell.ts +12 -12
- package/src/models/operations/postauthanonymous.ts +24 -24
- package/src/models/operations/postauthgenerateotp.ts +4 -4
- package/src/models/operations/postcartaddress.ts +16 -23
- package/src/models/operations/postcartitemid.ts +6 -94
- package/src/models/operations/postcartsid.ts +7 -72
- package/src/models/operations/postproductsidreviews.ts +8 -8
- package/esm/models/components/userinput.d.ts +0 -63
- package/esm/models/components/userinput.d.ts.map +0 -1
- package/esm/models/components/userinput.js +0 -61
- package/esm/models/components/userinput.js.map +0 -1
- package/src/models/components/userinput.ts +0 -130
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
import {
|
|
@@ -14,6 +15,14 @@ import {
|
|
|
14
15
|
NotificationPreferences$outboundSchema,
|
|
15
16
|
} from "./notificationpreferences.js";
|
|
16
17
|
|
|
18
|
+
export const LoginMethods = {
|
|
19
|
+
Email: "email",
|
|
20
|
+
Phone: "phone",
|
|
21
|
+
Whatsapp: "whatsapp",
|
|
22
|
+
Password: "password",
|
|
23
|
+
} as const;
|
|
24
|
+
export type LoginMethods = ClosedEnum<typeof LoginMethods>;
|
|
25
|
+
|
|
17
26
|
export type User = {
|
|
18
27
|
/**
|
|
19
28
|
* The unique identifier (ULID) of the user.
|
|
@@ -22,42 +31,51 @@ export type User = {
|
|
|
22
31
|
/**
|
|
23
32
|
* User’s first name.
|
|
24
33
|
*/
|
|
25
|
-
firstName
|
|
34
|
+
firstName: string;
|
|
26
35
|
/**
|
|
27
36
|
* User’s last name.
|
|
28
37
|
*/
|
|
29
|
-
lastName
|
|
38
|
+
lastName: string;
|
|
30
39
|
/**
|
|
31
40
|
* User’s email I’d.
|
|
32
41
|
*/
|
|
33
|
-
email
|
|
42
|
+
email: string;
|
|
34
43
|
/**
|
|
35
44
|
* Boolean indicating whether the email is verified.
|
|
36
45
|
*/
|
|
37
|
-
isEmailVerified
|
|
46
|
+
isEmailVerified: boolean;
|
|
38
47
|
/**
|
|
39
48
|
* 10 digit phone number without country code.
|
|
40
49
|
*/
|
|
41
|
-
phone
|
|
50
|
+
phone: string;
|
|
42
51
|
/**
|
|
43
52
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
44
53
|
*
|
|
45
54
|
* @remarks
|
|
46
55
|
* Use this key along with phone. Not necessary for email.
|
|
47
56
|
*/
|
|
48
|
-
countryCode
|
|
57
|
+
countryCode: string;
|
|
49
58
|
/**
|
|
50
59
|
* Boolean indicating whether the phone is verified.
|
|
51
60
|
*/
|
|
52
|
-
isPhoneVerified
|
|
61
|
+
isPhoneVerified: boolean;
|
|
53
62
|
/**
|
|
54
63
|
* URL to the user's profile image.
|
|
55
64
|
*/
|
|
56
|
-
profileImageUrl
|
|
65
|
+
profileImageUrl: string;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates whether the user is anonymous.
|
|
68
|
+
*/
|
|
69
|
+
isAnonymous: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates whether the user is currently logged in.
|
|
72
|
+
*/
|
|
73
|
+
isLoggedIn: boolean;
|
|
74
|
+
loginMethods: Array<LoginMethods>;
|
|
57
75
|
/**
|
|
58
76
|
* Set channel preferences for each type of
|
|
59
77
|
*/
|
|
60
|
-
notificationPreferences
|
|
78
|
+
notificationPreferences: NotificationPreferences;
|
|
61
79
|
/**
|
|
62
80
|
* Timestamps indicate when the user's account was created.
|
|
63
81
|
*/
|
|
@@ -66,35 +84,76 @@ export type User = {
|
|
|
66
84
|
* Timestamps indicating when the user account was last modified.
|
|
67
85
|
*/
|
|
68
86
|
modifiedAt?: string | undefined;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type UserInput = {
|
|
69
90
|
/**
|
|
70
|
-
*
|
|
91
|
+
* User’s first name.
|
|
71
92
|
*/
|
|
72
|
-
|
|
93
|
+
firstName: string;
|
|
73
94
|
/**
|
|
74
|
-
*
|
|
95
|
+
* User’s last name.
|
|
96
|
+
*/
|
|
97
|
+
lastName: string;
|
|
98
|
+
/**
|
|
99
|
+
* User’s email I’d.
|
|
100
|
+
*/
|
|
101
|
+
email: string;
|
|
102
|
+
/**
|
|
103
|
+
* 10 digit phone number without country code.
|
|
75
104
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
105
|
+
phone: string;
|
|
106
|
+
/**
|
|
107
|
+
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
108
|
+
*
|
|
109
|
+
* @remarks
|
|
110
|
+
* Use this key along with phone. Not necessary for email.
|
|
111
|
+
*/
|
|
112
|
+
countryCode: string;
|
|
113
|
+
loginMethods: Array<LoginMethods>;
|
|
114
|
+
/**
|
|
115
|
+
* Set channel preferences for each type of
|
|
116
|
+
*/
|
|
117
|
+
notificationPreferences: NotificationPreferences;
|
|
78
118
|
};
|
|
79
119
|
|
|
120
|
+
/** @internal */
|
|
121
|
+
export const LoginMethods$inboundSchema: z.ZodNativeEnum<typeof LoginMethods> =
|
|
122
|
+
z.nativeEnum(LoginMethods);
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const LoginMethods$outboundSchema: z.ZodNativeEnum<typeof LoginMethods> =
|
|
126
|
+
LoginMethods$inboundSchema;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
131
|
+
*/
|
|
132
|
+
export namespace LoginMethods$ {
|
|
133
|
+
/** @deprecated use `LoginMethods$inboundSchema` instead. */
|
|
134
|
+
export const inboundSchema = LoginMethods$inboundSchema;
|
|
135
|
+
/** @deprecated use `LoginMethods$outboundSchema` instead. */
|
|
136
|
+
export const outboundSchema = LoginMethods$outboundSchema;
|
|
137
|
+
}
|
|
138
|
+
|
|
80
139
|
/** @internal */
|
|
81
140
|
export const User$inboundSchema: z.ZodType<User, z.ZodTypeDef, unknown> = z
|
|
82
141
|
.object({
|
|
83
142
|
id: z.string(),
|
|
84
|
-
first_name: z.string()
|
|
85
|
-
last_name: z.string()
|
|
86
|
-
email: z.string()
|
|
87
|
-
is_email_verified: z.boolean()
|
|
88
|
-
phone: z.string()
|
|
89
|
-
country_code: z.string()
|
|
90
|
-
is_phone_verified: z.boolean()
|
|
91
|
-
profile_image_url: z.string()
|
|
92
|
-
|
|
143
|
+
first_name: z.string(),
|
|
144
|
+
last_name: z.string(),
|
|
145
|
+
email: z.string(),
|
|
146
|
+
is_email_verified: z.boolean(),
|
|
147
|
+
phone: z.string(),
|
|
148
|
+
country_code: z.string(),
|
|
149
|
+
is_phone_verified: z.boolean(),
|
|
150
|
+
profile_image_url: z.string(),
|
|
151
|
+
is_anonymous: z.boolean(),
|
|
152
|
+
is_logged_in: z.boolean(),
|
|
153
|
+
login_methods: z.array(LoginMethods$inboundSchema),
|
|
154
|
+
notification_preferences: NotificationPreferences$inboundSchema,
|
|
93
155
|
created_at: z.string().optional(),
|
|
94
156
|
modified_at: z.string().optional(),
|
|
95
|
-
is_anonymous: z.boolean().optional(),
|
|
96
|
-
is_logged_in: z.boolean().optional(),
|
|
97
|
-
login_methods: z.array(z.string()).optional(),
|
|
98
157
|
}).transform((v) => {
|
|
99
158
|
return remap$(v, {
|
|
100
159
|
"first_name": "firstName",
|
|
@@ -103,52 +162,52 @@ export const User$inboundSchema: z.ZodType<User, z.ZodTypeDef, unknown> = z
|
|
|
103
162
|
"country_code": "countryCode",
|
|
104
163
|
"is_phone_verified": "isPhoneVerified",
|
|
105
164
|
"profile_image_url": "profileImageUrl",
|
|
106
|
-
"notification_preferences": "notificationPreferences",
|
|
107
|
-
"created_at": "createdAt",
|
|
108
|
-
"modified_at": "modifiedAt",
|
|
109
165
|
"is_anonymous": "isAnonymous",
|
|
110
166
|
"is_logged_in": "isLoggedIn",
|
|
111
167
|
"login_methods": "loginMethods",
|
|
168
|
+
"notification_preferences": "notificationPreferences",
|
|
169
|
+
"created_at": "createdAt",
|
|
170
|
+
"modified_at": "modifiedAt",
|
|
112
171
|
});
|
|
113
172
|
});
|
|
114
173
|
|
|
115
174
|
/** @internal */
|
|
116
175
|
export type User$Outbound = {
|
|
117
176
|
id: string;
|
|
118
|
-
first_name
|
|
119
|
-
last_name
|
|
120
|
-
email
|
|
121
|
-
is_email_verified
|
|
122
|
-
phone
|
|
123
|
-
country_code
|
|
124
|
-
is_phone_verified
|
|
125
|
-
profile_image_url
|
|
126
|
-
|
|
177
|
+
first_name: string;
|
|
178
|
+
last_name: string;
|
|
179
|
+
email: string;
|
|
180
|
+
is_email_verified: boolean;
|
|
181
|
+
phone: string;
|
|
182
|
+
country_code: string;
|
|
183
|
+
is_phone_verified: boolean;
|
|
184
|
+
profile_image_url: string;
|
|
185
|
+
is_anonymous: boolean;
|
|
186
|
+
is_logged_in: boolean;
|
|
187
|
+
login_methods: Array<string>;
|
|
188
|
+
notification_preferences: NotificationPreferences$Outbound;
|
|
127
189
|
created_at?: string | undefined;
|
|
128
190
|
modified_at?: string | undefined;
|
|
129
|
-
is_anonymous?: boolean | undefined;
|
|
130
|
-
is_logged_in?: boolean | undefined;
|
|
131
|
-
login_methods?: Array<string> | undefined;
|
|
132
191
|
};
|
|
133
192
|
|
|
134
193
|
/** @internal */
|
|
135
194
|
export const User$outboundSchema: z.ZodType<User$Outbound, z.ZodTypeDef, User> =
|
|
136
195
|
z.object({
|
|
137
196
|
id: z.string(),
|
|
138
|
-
firstName: z.string()
|
|
139
|
-
lastName: z.string()
|
|
140
|
-
email: z.string()
|
|
141
|
-
isEmailVerified: z.boolean()
|
|
142
|
-
phone: z.string()
|
|
143
|
-
countryCode: z.string()
|
|
144
|
-
isPhoneVerified: z.boolean()
|
|
145
|
-
profileImageUrl: z.string()
|
|
146
|
-
|
|
197
|
+
firstName: z.string(),
|
|
198
|
+
lastName: z.string(),
|
|
199
|
+
email: z.string(),
|
|
200
|
+
isEmailVerified: z.boolean(),
|
|
201
|
+
phone: z.string(),
|
|
202
|
+
countryCode: z.string(),
|
|
203
|
+
isPhoneVerified: z.boolean(),
|
|
204
|
+
profileImageUrl: z.string(),
|
|
205
|
+
isAnonymous: z.boolean(),
|
|
206
|
+
isLoggedIn: z.boolean(),
|
|
207
|
+
loginMethods: z.array(LoginMethods$outboundSchema),
|
|
208
|
+
notificationPreferences: NotificationPreferences$outboundSchema,
|
|
147
209
|
createdAt: z.string().optional(),
|
|
148
210
|
modifiedAt: z.string().optional(),
|
|
149
|
-
isAnonymous: z.boolean().optional(),
|
|
150
|
-
isLoggedIn: z.boolean().optional(),
|
|
151
|
-
loginMethods: z.array(z.string()).optional(),
|
|
152
211
|
}).transform((v) => {
|
|
153
212
|
return remap$(v, {
|
|
154
213
|
firstName: "first_name",
|
|
@@ -157,12 +216,12 @@ export const User$outboundSchema: z.ZodType<User$Outbound, z.ZodTypeDef, User> =
|
|
|
157
216
|
countryCode: "country_code",
|
|
158
217
|
isPhoneVerified: "is_phone_verified",
|
|
159
218
|
profileImageUrl: "profile_image_url",
|
|
160
|
-
notificationPreferences: "notification_preferences",
|
|
161
|
-
createdAt: "created_at",
|
|
162
|
-
modifiedAt: "modified_at",
|
|
163
219
|
isAnonymous: "is_anonymous",
|
|
164
220
|
isLoggedIn: "is_logged_in",
|
|
165
221
|
loginMethods: "login_methods",
|
|
222
|
+
notificationPreferences: "notification_preferences",
|
|
223
|
+
createdAt: "created_at",
|
|
224
|
+
modifiedAt: "modified_at",
|
|
166
225
|
});
|
|
167
226
|
});
|
|
168
227
|
|
|
@@ -192,3 +251,87 @@ export function userFromJSON(
|
|
|
192
251
|
`Failed to parse 'User' from JSON`,
|
|
193
252
|
);
|
|
194
253
|
}
|
|
254
|
+
|
|
255
|
+
/** @internal */
|
|
256
|
+
export const UserInput$inboundSchema: z.ZodType<
|
|
257
|
+
UserInput,
|
|
258
|
+
z.ZodTypeDef,
|
|
259
|
+
unknown
|
|
260
|
+
> = z.object({
|
|
261
|
+
first_name: z.string(),
|
|
262
|
+
last_name: z.string(),
|
|
263
|
+
email: z.string(),
|
|
264
|
+
phone: z.string(),
|
|
265
|
+
country_code: z.string(),
|
|
266
|
+
login_methods: z.array(LoginMethods$inboundSchema),
|
|
267
|
+
notification_preferences: NotificationPreferences$inboundSchema,
|
|
268
|
+
}).transform((v) => {
|
|
269
|
+
return remap$(v, {
|
|
270
|
+
"first_name": "firstName",
|
|
271
|
+
"last_name": "lastName",
|
|
272
|
+
"country_code": "countryCode",
|
|
273
|
+
"login_methods": "loginMethods",
|
|
274
|
+
"notification_preferences": "notificationPreferences",
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
/** @internal */
|
|
279
|
+
export type UserInput$Outbound = {
|
|
280
|
+
first_name: string;
|
|
281
|
+
last_name: string;
|
|
282
|
+
email: string;
|
|
283
|
+
phone: string;
|
|
284
|
+
country_code: string;
|
|
285
|
+
login_methods: Array<string>;
|
|
286
|
+
notification_preferences: NotificationPreferences$Outbound;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/** @internal */
|
|
290
|
+
export const UserInput$outboundSchema: z.ZodType<
|
|
291
|
+
UserInput$Outbound,
|
|
292
|
+
z.ZodTypeDef,
|
|
293
|
+
UserInput
|
|
294
|
+
> = z.object({
|
|
295
|
+
firstName: z.string(),
|
|
296
|
+
lastName: z.string(),
|
|
297
|
+
email: z.string(),
|
|
298
|
+
phone: z.string(),
|
|
299
|
+
countryCode: z.string(),
|
|
300
|
+
loginMethods: z.array(LoginMethods$outboundSchema),
|
|
301
|
+
notificationPreferences: NotificationPreferences$outboundSchema,
|
|
302
|
+
}).transform((v) => {
|
|
303
|
+
return remap$(v, {
|
|
304
|
+
firstName: "first_name",
|
|
305
|
+
lastName: "last_name",
|
|
306
|
+
countryCode: "country_code",
|
|
307
|
+
loginMethods: "login_methods",
|
|
308
|
+
notificationPreferences: "notification_preferences",
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @internal
|
|
314
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
315
|
+
*/
|
|
316
|
+
export namespace UserInput$ {
|
|
317
|
+
/** @deprecated use `UserInput$inboundSchema` instead. */
|
|
318
|
+
export const inboundSchema = UserInput$inboundSchema;
|
|
319
|
+
/** @deprecated use `UserInput$outboundSchema` instead. */
|
|
320
|
+
export const outboundSchema = UserInput$outboundSchema;
|
|
321
|
+
/** @deprecated use `UserInput$Outbound` instead. */
|
|
322
|
+
export type Outbound = UserInput$Outbound;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export function userInputToJSON(userInput: UserInput): string {
|
|
326
|
+
return JSON.stringify(UserInput$outboundSchema.parse(userInput));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function userInputFromJSON(
|
|
330
|
+
jsonString: string,
|
|
331
|
+
): SafeParseResult<UserInput, SDKValidationError> {
|
|
332
|
+
return safeParse(
|
|
333
|
+
jsonString,
|
|
334
|
+
(x) => UserInput$inboundSchema.parse(JSON.parse(x)),
|
|
335
|
+
`Failed to parse 'UserInput' from JSON`,
|
|
336
|
+
);
|
|
337
|
+
}
|
|
@@ -32,9 +32,9 @@ export type GetCrossSellRequest = {
|
|
|
32
32
|
* Success response
|
|
33
33
|
*/
|
|
34
34
|
export type GetCrossSellResponseBody = {
|
|
35
|
-
message
|
|
36
|
-
success
|
|
37
|
-
content
|
|
35
|
+
message: string;
|
|
36
|
+
success: boolean;
|
|
37
|
+
content: components.ProductListResponse;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
@@ -116,16 +116,16 @@ export const GetCrossSellResponseBody$inboundSchema: z.ZodType<
|
|
|
116
116
|
z.ZodTypeDef,
|
|
117
117
|
unknown
|
|
118
118
|
> = z.object({
|
|
119
|
-
message: z.string()
|
|
120
|
-
success: z.boolean()
|
|
121
|
-
content: components.ProductListResponse$inboundSchema
|
|
119
|
+
message: z.string(),
|
|
120
|
+
success: z.boolean(),
|
|
121
|
+
content: components.ProductListResponse$inboundSchema,
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
/** @internal */
|
|
125
125
|
export type GetCrossSellResponseBody$Outbound = {
|
|
126
|
-
message
|
|
127
|
-
success
|
|
128
|
-
content
|
|
126
|
+
message: string;
|
|
127
|
+
success: boolean;
|
|
128
|
+
content: components.ProductListResponse$Outbound;
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
/** @internal */
|
|
@@ -134,9 +134,9 @@ export const GetCrossSellResponseBody$outboundSchema: z.ZodType<
|
|
|
134
134
|
z.ZodTypeDef,
|
|
135
135
|
GetCrossSellResponseBody
|
|
136
136
|
> = z.object({
|
|
137
|
-
message: z.string()
|
|
138
|
-
success: z.boolean()
|
|
139
|
-
content: components.ProductListResponse$outboundSchema
|
|
137
|
+
message: z.string(),
|
|
138
|
+
success: z.boolean(),
|
|
139
|
+
content: components.ProductListResponse$outboundSchema,
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -21,7 +21,7 @@ export type GetProductDetailsRequest = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export type GetProductDetailsContent = {
|
|
24
|
-
product
|
|
24
|
+
product: components.ProductDetail;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -106,12 +106,12 @@ export const GetProductDetailsContent$inboundSchema: z.ZodType<
|
|
|
106
106
|
z.ZodTypeDef,
|
|
107
107
|
unknown
|
|
108
108
|
> = z.object({
|
|
109
|
-
product: components.ProductDetail$inboundSchema
|
|
109
|
+
product: components.ProductDetail$inboundSchema,
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
/** @internal */
|
|
113
113
|
export type GetProductDetailsContent$Outbound = {
|
|
114
|
-
product
|
|
114
|
+
product: components.ProductDetail$Outbound;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/** @internal */
|
|
@@ -120,7 +120,7 @@ export const GetProductDetailsContent$outboundSchema: z.ZodType<
|
|
|
120
120
|
z.ZodTypeDef,
|
|
121
121
|
GetProductDetailsContent
|
|
122
122
|
> = z.object({
|
|
123
|
-
product: components.ProductDetail$outboundSchema
|
|
123
|
+
product: components.ProductDetail$outboundSchema,
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -36,9 +36,9 @@ export type GetProductsCategoriesContent = {
|
|
|
36
36
|
* OK
|
|
37
37
|
*/
|
|
38
38
|
export type GetProductsCategoriesResponseBody = {
|
|
39
|
-
message
|
|
39
|
+
message: string;
|
|
40
40
|
success?: boolean | undefined;
|
|
41
|
-
content
|
|
41
|
+
content: GetProductsCategoriesContent;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
/** @internal */
|
|
@@ -180,16 +180,16 @@ export const GetProductsCategoriesResponseBody$inboundSchema: z.ZodType<
|
|
|
180
180
|
z.ZodTypeDef,
|
|
181
181
|
unknown
|
|
182
182
|
> = z.object({
|
|
183
|
-
message: z.string()
|
|
183
|
+
message: z.string(),
|
|
184
184
|
success: z.boolean().default(true),
|
|
185
|
-
content: z.lazy(() => GetProductsCategoriesContent$inboundSchema)
|
|
185
|
+
content: z.lazy(() => GetProductsCategoriesContent$inboundSchema),
|
|
186
186
|
});
|
|
187
187
|
|
|
188
188
|
/** @internal */
|
|
189
189
|
export type GetProductsCategoriesResponseBody$Outbound = {
|
|
190
|
-
message
|
|
190
|
+
message: string;
|
|
191
191
|
success: boolean;
|
|
192
|
-
content
|
|
192
|
+
content: GetProductsCategoriesContent$Outbound;
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
/** @internal */
|
|
@@ -198,9 +198,9 @@ export const GetProductsCategoriesResponseBody$outboundSchema: z.ZodType<
|
|
|
198
198
|
z.ZodTypeDef,
|
|
199
199
|
GetProductsCategoriesResponseBody
|
|
200
200
|
> = z.object({
|
|
201
|
-
message: z.string()
|
|
201
|
+
message: z.string(),
|
|
202
202
|
success: z.boolean().default(true),
|
|
203
|
-
content: z.lazy(() => GetProductsCategoriesContent$outboundSchema)
|
|
203
|
+
content: z.lazy(() => GetProductsCategoriesContent$outboundSchema),
|
|
204
204
|
});
|
|
205
205
|
|
|
206
206
|
/**
|
|
@@ -37,8 +37,8 @@ export type GetProductsIdReviewsRequest = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export type GetProductsIdReviewsContent = {
|
|
40
|
-
reviews
|
|
41
|
-
reviewTags?: Array<string> | undefined;
|
|
40
|
+
reviews: Array<components.ProductReview>;
|
|
41
|
+
reviewTags?: Array<string> | null | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* pagination metadata structure
|
|
44
44
|
*/
|
|
@@ -143,8 +143,8 @@ export const GetProductsIdReviewsContent$inboundSchema: z.ZodType<
|
|
|
143
143
|
z.ZodTypeDef,
|
|
144
144
|
unknown
|
|
145
145
|
> = z.object({
|
|
146
|
-
reviews: z.array(components.ProductReview$inboundSchema)
|
|
147
|
-
review_tags: z.array(z.string()).optional(),
|
|
146
|
+
reviews: z.array(components.ProductReview$inboundSchema),
|
|
147
|
+
review_tags: z.nullable(z.array(z.string())).optional(),
|
|
148
148
|
pagination: components.Pagination$inboundSchema.optional(),
|
|
149
149
|
}).transform((v) => {
|
|
150
150
|
return remap$(v, {
|
|
@@ -154,8 +154,8 @@ export const GetProductsIdReviewsContent$inboundSchema: z.ZodType<
|
|
|
154
154
|
|
|
155
155
|
/** @internal */
|
|
156
156
|
export type GetProductsIdReviewsContent$Outbound = {
|
|
157
|
-
reviews
|
|
158
|
-
review_tags?: Array<string> | undefined;
|
|
157
|
+
reviews: Array<components.ProductReview$Outbound>;
|
|
158
|
+
review_tags?: Array<string> | null | undefined;
|
|
159
159
|
pagination?: components.Pagination$Outbound | undefined;
|
|
160
160
|
};
|
|
161
161
|
|
|
@@ -165,8 +165,8 @@ export const GetProductsIdReviewsContent$outboundSchema: z.ZodType<
|
|
|
165
165
|
z.ZodTypeDef,
|
|
166
166
|
GetProductsIdReviewsContent
|
|
167
167
|
> = z.object({
|
|
168
|
-
reviews: z.array(components.ProductReview$outboundSchema)
|
|
169
|
-
reviewTags: z.array(z.string()).optional(),
|
|
168
|
+
reviews: z.array(components.ProductReview$outboundSchema),
|
|
169
|
+
reviewTags: z.nullable(z.array(z.string())).optional(),
|
|
170
170
|
pagination: components.Pagination$outboundSchema.optional(),
|
|
171
171
|
}).transform((v) => {
|
|
172
172
|
return remap$(v, {
|
|
@@ -25,7 +25,7 @@ export type GetProductVariantDetailRequest = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export type GetProductVariantDetailContent = {
|
|
28
|
-
variant
|
|
28
|
+
variant: components.VariantDetail;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -117,12 +117,12 @@ export const GetProductVariantDetailContent$inboundSchema: z.ZodType<
|
|
|
117
117
|
z.ZodTypeDef,
|
|
118
118
|
unknown
|
|
119
119
|
> = z.object({
|
|
120
|
-
variant: components.VariantDetail$inboundSchema
|
|
120
|
+
variant: components.VariantDetail$inboundSchema,
|
|
121
121
|
});
|
|
122
122
|
|
|
123
123
|
/** @internal */
|
|
124
124
|
export type GetProductVariantDetailContent$Outbound = {
|
|
125
|
-
variant
|
|
125
|
+
variant: components.VariantDetail$Outbound;
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
/** @internal */
|
|
@@ -131,7 +131,7 @@ export const GetProductVariantDetailContent$outboundSchema: z.ZodType<
|
|
|
131
131
|
z.ZodTypeDef,
|
|
132
132
|
GetProductVariantDetailContent
|
|
133
133
|
> = z.object({
|
|
134
|
-
variant: components.VariantDetail$outboundSchema
|
|
134
|
+
variant: components.VariantDetail$outboundSchema,
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
/**
|
|
@@ -21,7 +21,7 @@ export type GetProductVariantsRequest = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export type GetProductVariantsContent = {
|
|
24
|
-
variants
|
|
24
|
+
variants: Array<components.Variant>;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -106,12 +106,12 @@ export const GetProductVariantsContent$inboundSchema: z.ZodType<
|
|
|
106
106
|
z.ZodTypeDef,
|
|
107
107
|
unknown
|
|
108
108
|
> = z.object({
|
|
109
|
-
variants: z.array(components.Variant$inboundSchema)
|
|
109
|
+
variants: z.array(components.Variant$inboundSchema),
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
/** @internal */
|
|
113
113
|
export type GetProductVariantsContent$Outbound = {
|
|
114
|
-
variants
|
|
114
|
+
variants: Array<components.Variant$Outbound>;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
/** @internal */
|
|
@@ -120,7 +120,7 @@ export const GetProductVariantsContent$outboundSchema: z.ZodType<
|
|
|
120
120
|
z.ZodTypeDef,
|
|
121
121
|
GetProductVariantsContent
|
|
122
122
|
> = z.object({
|
|
123
|
-
variants: z.array(components.Variant$outboundSchema)
|
|
123
|
+
variants: z.array(components.Variant$outboundSchema),
|
|
124
124
|
});
|
|
125
125
|
|
|
126
126
|
/**
|
|
@@ -32,9 +32,9 @@ export type GetSimilarRequest = {
|
|
|
32
32
|
* Success response
|
|
33
33
|
*/
|
|
34
34
|
export type GetSimilarResponseBody = {
|
|
35
|
-
message
|
|
36
|
-
success
|
|
37
|
-
content
|
|
35
|
+
message: string;
|
|
36
|
+
success: boolean;
|
|
37
|
+
content: components.ProductListResponse;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
@@ -116,16 +116,16 @@ export const GetSimilarResponseBody$inboundSchema: z.ZodType<
|
|
|
116
116
|
z.ZodTypeDef,
|
|
117
117
|
unknown
|
|
118
118
|
> = z.object({
|
|
119
|
-
message: z.string()
|
|
120
|
-
success: z.boolean()
|
|
121
|
-
content: components.ProductListResponse$inboundSchema
|
|
119
|
+
message: z.string(),
|
|
120
|
+
success: z.boolean(),
|
|
121
|
+
content: components.ProductListResponse$inboundSchema,
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
/** @internal */
|
|
125
125
|
export type GetSimilarResponseBody$Outbound = {
|
|
126
|
-
message
|
|
127
|
-
success
|
|
128
|
-
content
|
|
126
|
+
message: string;
|
|
127
|
+
success: boolean;
|
|
128
|
+
content: components.ProductListResponse$Outbound;
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
/** @internal */
|
|
@@ -134,9 +134,9 @@ export const GetSimilarResponseBody$outboundSchema: z.ZodType<
|
|
|
134
134
|
z.ZodTypeDef,
|
|
135
135
|
GetSimilarResponseBody
|
|
136
136
|
> = z.object({
|
|
137
|
-
message: z.string()
|
|
138
|
-
success: z.boolean()
|
|
139
|
-
content: components.ProductListResponse$outboundSchema
|
|
137
|
+
message: z.string(),
|
|
138
|
+
success: z.boolean(),
|
|
139
|
+
content: components.ProductListResponse$outboundSchema,
|
|
140
140
|
});
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -37,11 +37,11 @@ export type GetSkusRequest = {
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export type Content = {
|
|
40
|
-
skus
|
|
40
|
+
skus: Array<components.Sku>;
|
|
41
41
|
/**
|
|
42
42
|
* pagination metadata structure
|
|
43
43
|
*/
|
|
44
|
-
pagination
|
|
44
|
+
pagination: components.Pagination;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -133,14 +133,14 @@ export function getSkusRequestFromJSON(
|
|
|
133
133
|
/** @internal */
|
|
134
134
|
export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
|
|
135
135
|
z.object({
|
|
136
|
-
skus: z.array(components.Sku$inboundSchema)
|
|
137
|
-
pagination: components.Pagination$inboundSchema
|
|
136
|
+
skus: z.array(components.Sku$inboundSchema),
|
|
137
|
+
pagination: components.Pagination$inboundSchema,
|
|
138
138
|
});
|
|
139
139
|
|
|
140
140
|
/** @internal */
|
|
141
141
|
export type Content$Outbound = {
|
|
142
|
-
skus
|
|
143
|
-
pagination
|
|
142
|
+
skus: Array<components.Sku$Outbound>;
|
|
143
|
+
pagination: components.Pagination$Outbound;
|
|
144
144
|
};
|
|
145
145
|
|
|
146
146
|
/** @internal */
|
|
@@ -149,8 +149,8 @@ export const Content$outboundSchema: z.ZodType<
|
|
|
149
149
|
z.ZodTypeDef,
|
|
150
150
|
Content
|
|
151
151
|
> = z.object({
|
|
152
|
-
skus: z.array(components.Sku$outboundSchema)
|
|
153
|
-
pagination: components.Pagination$outboundSchema
|
|
152
|
+
skus: z.array(components.Sku$outboundSchema),
|
|
153
|
+
pagination: components.Pagination$outboundSchema,
|
|
154
154
|
});
|
|
155
155
|
|
|
156
156
|
/**
|