ce-storefront 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/sdks/auth/README.md +85 -36
- package/esm/funcs/authGenerateOtp.d.ts +1 -1
- package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
- package/esm/funcs/authGenerateOtp.js +27 -6
- package/esm/funcs/authGenerateOtp.js.map +1 -1
- package/esm/funcs/authLoginWithEmail.d.ts +1 -1
- package/esm/funcs/authLoginWithEmail.d.ts.map +1 -1
- package/esm/funcs/authLoginWithEmail.js +27 -6
- package/esm/funcs/authLoginWithEmail.js.map +1 -1
- package/esm/funcs/authLoginWithPhone.d.ts +1 -1
- package/esm/funcs/authLoginWithPhone.d.ts.map +1 -1
- package/esm/funcs/authLoginWithPhone.js +27 -6
- package/esm/funcs/authLoginWithPhone.js.map +1 -1
- package/esm/funcs/authLoginWithWhatsapp.d.ts +1 -1
- package/esm/funcs/authLoginWithWhatsapp.d.ts.map +1 -1
- package/esm/funcs/authLoginWithWhatsapp.js +27 -6
- package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
- package/esm/funcs/authVerifyOtp.d.ts +1 -1
- package/esm/funcs/authVerifyOtp.d.ts.map +1 -1
- package/esm/funcs/authVerifyOtp.js +27 -6
- package/esm/funcs/authVerifyOtp.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/notificationchannelpreferences.d.ts +3 -3
- package/esm/models/components/notificationchannelpreferences.d.ts.map +1 -1
- package/esm/models/components/notificationchannelpreferences.js +6 -6
- package/esm/models/components/notificationchannelpreferences.js.map +1 -1
- package/esm/models/operations/deleteaddress.d.ts +1 -1
- package/esm/models/operations/deleteaddress.d.ts.map +1 -1
- package/esm/models/operations/deleteaddress.js +2 -2
- package/esm/models/operations/deleteaddress.js.map +1 -1
- package/esm/models/operations/deletecart.d.ts +1 -1
- package/esm/models/operations/deletecart.d.ts.map +1 -1
- package/esm/models/operations/deletecart.js +2 -2
- package/esm/models/operations/deletecart.js.map +1 -1
- package/esm/models/operations/deleteusercart.d.ts +1 -1
- package/esm/models/operations/deleteusercart.d.ts.map +1 -1
- package/esm/models/operations/deleteusercart.js +2 -2
- package/esm/models/operations/deleteusercart.js.map +1 -1
- package/esm/models/operations/generateotp.d.ts +106 -0
- package/esm/models/operations/generateotp.d.ts.map +1 -1
- package/esm/models/operations/generateotp.js +144 -0
- package/esm/models/operations/generateotp.js.map +1 -1
- package/esm/models/operations/getcart.d.ts +1 -1
- package/esm/models/operations/getcart.d.ts.map +1 -1
- package/esm/models/operations/getcart.js +2 -2
- package/esm/models/operations/getcart.js.map +1 -1
- package/esm/models/operations/getproductdetail.d.ts +1 -1
- package/esm/models/operations/getproductdetail.d.ts.map +1 -1
- package/esm/models/operations/getproductdetail.js +2 -2
- package/esm/models/operations/getproductdetail.js.map +1 -1
- package/esm/models/operations/getusercart.d.ts +1 -1
- package/esm/models/operations/getusercart.d.ts.map +1 -1
- package/esm/models/operations/getusercart.js +2 -2
- package/esm/models/operations/getusercart.js.map +1 -1
- package/esm/models/operations/getvariantdetail.d.ts +1 -1
- package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
- package/esm/models/operations/getvariantdetail.js +2 -2
- package/esm/models/operations/getvariantdetail.js.map +1 -1
- package/esm/models/operations/listcategories.d.ts +1 -1
- package/esm/models/operations/listcategories.d.ts.map +1 -1
- package/esm/models/operations/listcategories.js +2 -2
- package/esm/models/operations/listcategories.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts +1 -1
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +2 -2
- package/esm/models/operations/listproducts.js.map +1 -1
- package/esm/models/operations/listproductvariants.d.ts +1 -1
- package/esm/models/operations/listproductvariants.d.ts.map +1 -1
- package/esm/models/operations/listproductvariants.js +2 -2
- package/esm/models/operations/listproductvariants.js.map +1 -1
- package/esm/models/operations/listskus.d.ts +1 -1
- package/esm/models/operations/listskus.d.ts.map +1 -1
- package/esm/models/operations/listskus.js +2 -2
- package/esm/models/operations/listskus.js.map +1 -1
- package/esm/models/operations/loginwithemail.d.ts +106 -0
- package/esm/models/operations/loginwithemail.d.ts.map +1 -1
- package/esm/models/operations/loginwithemail.js +147 -0
- package/esm/models/operations/loginwithemail.js.map +1 -1
- package/esm/models/operations/loginwithphone.d.ts +106 -0
- package/esm/models/operations/loginwithphone.d.ts.map +1 -1
- package/esm/models/operations/loginwithphone.js +147 -0
- package/esm/models/operations/loginwithphone.js.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.d.ts +106 -0
- package/esm/models/operations/loginwithwhatsapp.d.ts.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.js +150 -0
- package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
- package/esm/models/operations/updatecart.d.ts +2 -2
- package/esm/models/operations/updatecart.d.ts.map +1 -1
- package/esm/models/operations/updatecart.js +2 -2
- package/esm/models/operations/updatecart.js.map +1 -1
- package/esm/models/operations/verifyotp.d.ts +106 -0
- package/esm/models/operations/verifyotp.d.ts.map +1 -1
- package/esm/models/operations/verifyotp.js +144 -0
- package/esm/models/operations/verifyotp.js.map +1 -1
- package/esm/sdk/auth.d.ts +5 -5
- package/esm/sdk/auth.d.ts.map +1 -1
- package/esm/sdk/auth.js +10 -10
- package/esm/sdk/auth.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/authGenerateOtp.ts +31 -5
- package/src/funcs/authLoginWithEmail.ts +31 -5
- package/src/funcs/authLoginWithPhone.ts +31 -5
- package/src/funcs/authLoginWithWhatsapp.ts +31 -5
- package/src/funcs/authVerifyOtp.ts +31 -5
- package/src/lib/config.ts +3 -3
- package/src/models/components/notificationchannelpreferences.ts +9 -9
- package/src/models/operations/deleteaddress.ts +3 -3
- package/src/models/operations/deletecart.ts +3 -3
- package/src/models/operations/deleteusercart.ts +3 -3
- package/src/models/operations/generateotp.ts +282 -0
- package/src/models/operations/getcart.ts +3 -3
- package/src/models/operations/getproductdetail.ts +3 -3
- package/src/models/operations/getusercart.ts +3 -3
- package/src/models/operations/getvariantdetail.ts +3 -3
- package/src/models/operations/listcategories.ts +3 -3
- package/src/models/operations/listproducts.ts +3 -3
- package/src/models/operations/listproductvariants.ts +3 -3
- package/src/models/operations/listskus.ts +3 -3
- package/src/models/operations/loginwithemail.ts +291 -0
- package/src/models/operations/loginwithphone.ts +291 -0
- package/src/models/operations/loginwithwhatsapp.ts +294 -0
- package/src/models/operations/updatecart.ts +4 -4
- package/src/models/operations/verifyotp.ts +282 -0
- package/src/sdk/auth.ts +10 -0
|
@@ -19,6 +19,25 @@ export const LoginWithPhoneServerList = [
|
|
|
19
19
|
"https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
20
20
|
] as const;
|
|
21
21
|
|
|
22
|
+
export type LoginWithPhoneSecurityOption1 = {
|
|
23
|
+
xApiKey: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type LoginWithPhoneSecurityOption2 = {
|
|
27
|
+
authorization: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type LoginWithPhoneSecurityOption3 = {
|
|
31
|
+
xApiKey: string;
|
|
32
|
+
authorization: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type LoginWithPhoneSecurity = {
|
|
36
|
+
option1?: LoginWithPhoneSecurityOption1 | undefined;
|
|
37
|
+
option2?: LoginWithPhoneSecurityOption2 | undefined;
|
|
38
|
+
option3?: LoginWithPhoneSecurityOption3 | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
22
41
|
export type LoginWithPhoneRequestBody = {
|
|
23
42
|
/**
|
|
24
43
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
@@ -70,6 +89,278 @@ export type LoginWithPhoneResponseBody = {
|
|
|
70
89
|
content?: LoginWithPhoneContent | undefined;
|
|
71
90
|
};
|
|
72
91
|
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const LoginWithPhoneSecurityOption1$inboundSchema: z.ZodType<
|
|
94
|
+
LoginWithPhoneSecurityOption1,
|
|
95
|
+
z.ZodTypeDef,
|
|
96
|
+
unknown
|
|
97
|
+
> = z.object({
|
|
98
|
+
"X-Api-Key": z.string(),
|
|
99
|
+
}).transform((v) => {
|
|
100
|
+
return remap$(v, {
|
|
101
|
+
"X-Api-Key": "xApiKey",
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export type LoginWithPhoneSecurityOption1$Outbound = {
|
|
107
|
+
"X-Api-Key": string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export const LoginWithPhoneSecurityOption1$outboundSchema: z.ZodType<
|
|
112
|
+
LoginWithPhoneSecurityOption1$Outbound,
|
|
113
|
+
z.ZodTypeDef,
|
|
114
|
+
LoginWithPhoneSecurityOption1
|
|
115
|
+
> = z.object({
|
|
116
|
+
xApiKey: z.string(),
|
|
117
|
+
}).transform((v) => {
|
|
118
|
+
return remap$(v, {
|
|
119
|
+
xApiKey: "X-Api-Key",
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @internal
|
|
125
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
126
|
+
*/
|
|
127
|
+
export namespace LoginWithPhoneSecurityOption1$ {
|
|
128
|
+
/** @deprecated use `LoginWithPhoneSecurityOption1$inboundSchema` instead. */
|
|
129
|
+
export const inboundSchema = LoginWithPhoneSecurityOption1$inboundSchema;
|
|
130
|
+
/** @deprecated use `LoginWithPhoneSecurityOption1$outboundSchema` instead. */
|
|
131
|
+
export const outboundSchema = LoginWithPhoneSecurityOption1$outboundSchema;
|
|
132
|
+
/** @deprecated use `LoginWithPhoneSecurityOption1$Outbound` instead. */
|
|
133
|
+
export type Outbound = LoginWithPhoneSecurityOption1$Outbound;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function loginWithPhoneSecurityOption1ToJSON(
|
|
137
|
+
loginWithPhoneSecurityOption1: LoginWithPhoneSecurityOption1,
|
|
138
|
+
): string {
|
|
139
|
+
return JSON.stringify(
|
|
140
|
+
LoginWithPhoneSecurityOption1$outboundSchema.parse(
|
|
141
|
+
loginWithPhoneSecurityOption1,
|
|
142
|
+
),
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function loginWithPhoneSecurityOption1FromJSON(
|
|
147
|
+
jsonString: string,
|
|
148
|
+
): SafeParseResult<LoginWithPhoneSecurityOption1, SDKValidationError> {
|
|
149
|
+
return safeParse(
|
|
150
|
+
jsonString,
|
|
151
|
+
(x) => LoginWithPhoneSecurityOption1$inboundSchema.parse(JSON.parse(x)),
|
|
152
|
+
`Failed to parse 'LoginWithPhoneSecurityOption1' from JSON`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export const LoginWithPhoneSecurityOption2$inboundSchema: z.ZodType<
|
|
158
|
+
LoginWithPhoneSecurityOption2,
|
|
159
|
+
z.ZodTypeDef,
|
|
160
|
+
unknown
|
|
161
|
+
> = z.object({
|
|
162
|
+
Authorization: z.string(),
|
|
163
|
+
}).transform((v) => {
|
|
164
|
+
return remap$(v, {
|
|
165
|
+
"Authorization": "authorization",
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
/** @internal */
|
|
170
|
+
export type LoginWithPhoneSecurityOption2$Outbound = {
|
|
171
|
+
Authorization: string;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/** @internal */
|
|
175
|
+
export const LoginWithPhoneSecurityOption2$outboundSchema: z.ZodType<
|
|
176
|
+
LoginWithPhoneSecurityOption2$Outbound,
|
|
177
|
+
z.ZodTypeDef,
|
|
178
|
+
LoginWithPhoneSecurityOption2
|
|
179
|
+
> = z.object({
|
|
180
|
+
authorization: z.string(),
|
|
181
|
+
}).transform((v) => {
|
|
182
|
+
return remap$(v, {
|
|
183
|
+
authorization: "Authorization",
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
190
|
+
*/
|
|
191
|
+
export namespace LoginWithPhoneSecurityOption2$ {
|
|
192
|
+
/** @deprecated use `LoginWithPhoneSecurityOption2$inboundSchema` instead. */
|
|
193
|
+
export const inboundSchema = LoginWithPhoneSecurityOption2$inboundSchema;
|
|
194
|
+
/** @deprecated use `LoginWithPhoneSecurityOption2$outboundSchema` instead. */
|
|
195
|
+
export const outboundSchema = LoginWithPhoneSecurityOption2$outboundSchema;
|
|
196
|
+
/** @deprecated use `LoginWithPhoneSecurityOption2$Outbound` instead. */
|
|
197
|
+
export type Outbound = LoginWithPhoneSecurityOption2$Outbound;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function loginWithPhoneSecurityOption2ToJSON(
|
|
201
|
+
loginWithPhoneSecurityOption2: LoginWithPhoneSecurityOption2,
|
|
202
|
+
): string {
|
|
203
|
+
return JSON.stringify(
|
|
204
|
+
LoginWithPhoneSecurityOption2$outboundSchema.parse(
|
|
205
|
+
loginWithPhoneSecurityOption2,
|
|
206
|
+
),
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function loginWithPhoneSecurityOption2FromJSON(
|
|
211
|
+
jsonString: string,
|
|
212
|
+
): SafeParseResult<LoginWithPhoneSecurityOption2, SDKValidationError> {
|
|
213
|
+
return safeParse(
|
|
214
|
+
jsonString,
|
|
215
|
+
(x) => LoginWithPhoneSecurityOption2$inboundSchema.parse(JSON.parse(x)),
|
|
216
|
+
`Failed to parse 'LoginWithPhoneSecurityOption2' from JSON`,
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** @internal */
|
|
221
|
+
export const LoginWithPhoneSecurityOption3$inboundSchema: z.ZodType<
|
|
222
|
+
LoginWithPhoneSecurityOption3,
|
|
223
|
+
z.ZodTypeDef,
|
|
224
|
+
unknown
|
|
225
|
+
> = z.object({
|
|
226
|
+
"X-Api-Key": z.string(),
|
|
227
|
+
Authorization: z.string(),
|
|
228
|
+
}).transform((v) => {
|
|
229
|
+
return remap$(v, {
|
|
230
|
+
"X-Api-Key": "xApiKey",
|
|
231
|
+
"Authorization": "authorization",
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
/** @internal */
|
|
236
|
+
export type LoginWithPhoneSecurityOption3$Outbound = {
|
|
237
|
+
"X-Api-Key": string;
|
|
238
|
+
Authorization: string;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/** @internal */
|
|
242
|
+
export const LoginWithPhoneSecurityOption3$outboundSchema: z.ZodType<
|
|
243
|
+
LoginWithPhoneSecurityOption3$Outbound,
|
|
244
|
+
z.ZodTypeDef,
|
|
245
|
+
LoginWithPhoneSecurityOption3
|
|
246
|
+
> = z.object({
|
|
247
|
+
xApiKey: z.string(),
|
|
248
|
+
authorization: z.string(),
|
|
249
|
+
}).transform((v) => {
|
|
250
|
+
return remap$(v, {
|
|
251
|
+
xApiKey: "X-Api-Key",
|
|
252
|
+
authorization: "Authorization",
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @internal
|
|
258
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
259
|
+
*/
|
|
260
|
+
export namespace LoginWithPhoneSecurityOption3$ {
|
|
261
|
+
/** @deprecated use `LoginWithPhoneSecurityOption3$inboundSchema` instead. */
|
|
262
|
+
export const inboundSchema = LoginWithPhoneSecurityOption3$inboundSchema;
|
|
263
|
+
/** @deprecated use `LoginWithPhoneSecurityOption3$outboundSchema` instead. */
|
|
264
|
+
export const outboundSchema = LoginWithPhoneSecurityOption3$outboundSchema;
|
|
265
|
+
/** @deprecated use `LoginWithPhoneSecurityOption3$Outbound` instead. */
|
|
266
|
+
export type Outbound = LoginWithPhoneSecurityOption3$Outbound;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export function loginWithPhoneSecurityOption3ToJSON(
|
|
270
|
+
loginWithPhoneSecurityOption3: LoginWithPhoneSecurityOption3,
|
|
271
|
+
): string {
|
|
272
|
+
return JSON.stringify(
|
|
273
|
+
LoginWithPhoneSecurityOption3$outboundSchema.parse(
|
|
274
|
+
loginWithPhoneSecurityOption3,
|
|
275
|
+
),
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export function loginWithPhoneSecurityOption3FromJSON(
|
|
280
|
+
jsonString: string,
|
|
281
|
+
): SafeParseResult<LoginWithPhoneSecurityOption3, SDKValidationError> {
|
|
282
|
+
return safeParse(
|
|
283
|
+
jsonString,
|
|
284
|
+
(x) => LoginWithPhoneSecurityOption3$inboundSchema.parse(JSON.parse(x)),
|
|
285
|
+
`Failed to parse 'LoginWithPhoneSecurityOption3' from JSON`,
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** @internal */
|
|
290
|
+
export const LoginWithPhoneSecurity$inboundSchema: z.ZodType<
|
|
291
|
+
LoginWithPhoneSecurity,
|
|
292
|
+
z.ZodTypeDef,
|
|
293
|
+
unknown
|
|
294
|
+
> = z.object({
|
|
295
|
+
Option1: z.lazy(() => LoginWithPhoneSecurityOption1$inboundSchema).optional(),
|
|
296
|
+
Option2: z.lazy(() => LoginWithPhoneSecurityOption2$inboundSchema).optional(),
|
|
297
|
+
Option3: z.lazy(() => LoginWithPhoneSecurityOption3$inboundSchema).optional(),
|
|
298
|
+
}).transform((v) => {
|
|
299
|
+
return remap$(v, {
|
|
300
|
+
"Option1": "option1",
|
|
301
|
+
"Option2": "option2",
|
|
302
|
+
"Option3": "option3",
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
/** @internal */
|
|
307
|
+
export type LoginWithPhoneSecurity$Outbound = {
|
|
308
|
+
Option1?: LoginWithPhoneSecurityOption1$Outbound | undefined;
|
|
309
|
+
Option2?: LoginWithPhoneSecurityOption2$Outbound | undefined;
|
|
310
|
+
Option3?: LoginWithPhoneSecurityOption3$Outbound | undefined;
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
/** @internal */
|
|
314
|
+
export const LoginWithPhoneSecurity$outboundSchema: z.ZodType<
|
|
315
|
+
LoginWithPhoneSecurity$Outbound,
|
|
316
|
+
z.ZodTypeDef,
|
|
317
|
+
LoginWithPhoneSecurity
|
|
318
|
+
> = z.object({
|
|
319
|
+
option1: z.lazy(() => LoginWithPhoneSecurityOption1$outboundSchema)
|
|
320
|
+
.optional(),
|
|
321
|
+
option2: z.lazy(() => LoginWithPhoneSecurityOption2$outboundSchema)
|
|
322
|
+
.optional(),
|
|
323
|
+
option3: z.lazy(() => LoginWithPhoneSecurityOption3$outboundSchema)
|
|
324
|
+
.optional(),
|
|
325
|
+
}).transform((v) => {
|
|
326
|
+
return remap$(v, {
|
|
327
|
+
option1: "Option1",
|
|
328
|
+
option2: "Option2",
|
|
329
|
+
option3: "Option3",
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* @internal
|
|
335
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
336
|
+
*/
|
|
337
|
+
export namespace LoginWithPhoneSecurity$ {
|
|
338
|
+
/** @deprecated use `LoginWithPhoneSecurity$inboundSchema` instead. */
|
|
339
|
+
export const inboundSchema = LoginWithPhoneSecurity$inboundSchema;
|
|
340
|
+
/** @deprecated use `LoginWithPhoneSecurity$outboundSchema` instead. */
|
|
341
|
+
export const outboundSchema = LoginWithPhoneSecurity$outboundSchema;
|
|
342
|
+
/** @deprecated use `LoginWithPhoneSecurity$Outbound` instead. */
|
|
343
|
+
export type Outbound = LoginWithPhoneSecurity$Outbound;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function loginWithPhoneSecurityToJSON(
|
|
347
|
+
loginWithPhoneSecurity: LoginWithPhoneSecurity,
|
|
348
|
+
): string {
|
|
349
|
+
return JSON.stringify(
|
|
350
|
+
LoginWithPhoneSecurity$outboundSchema.parse(loginWithPhoneSecurity),
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export function loginWithPhoneSecurityFromJSON(
|
|
355
|
+
jsonString: string,
|
|
356
|
+
): SafeParseResult<LoginWithPhoneSecurity, SDKValidationError> {
|
|
357
|
+
return safeParse(
|
|
358
|
+
jsonString,
|
|
359
|
+
(x) => LoginWithPhoneSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
360
|
+
`Failed to parse 'LoginWithPhoneSecurity' from JSON`,
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
73
364
|
/** @internal */
|
|
74
365
|
export const LoginWithPhoneRequestBody$inboundSchema: z.ZodType<
|
|
75
366
|
LoginWithPhoneRequestBody,
|
|
@@ -19,6 +19,25 @@ export const LoginWithWhatsappServerList = [
|
|
|
19
19
|
"https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
|
|
20
20
|
] as const;
|
|
21
21
|
|
|
22
|
+
export type LoginWithWhatsappSecurityOption1 = {
|
|
23
|
+
xApiKey: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type LoginWithWhatsappSecurityOption2 = {
|
|
27
|
+
authorization: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type LoginWithWhatsappSecurityOption3 = {
|
|
31
|
+
xApiKey: string;
|
|
32
|
+
authorization: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type LoginWithWhatsappSecurity = {
|
|
36
|
+
option1?: LoginWithWhatsappSecurityOption1 | undefined;
|
|
37
|
+
option2?: LoginWithWhatsappSecurityOption2 | undefined;
|
|
38
|
+
option3?: LoginWithWhatsappSecurityOption3 | undefined;
|
|
39
|
+
};
|
|
40
|
+
|
|
22
41
|
export type LoginWithWhatsappRequestBody = {
|
|
23
42
|
/**
|
|
24
43
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
@@ -70,6 +89,281 @@ export type LoginWithWhatsappResponseBody = {
|
|
|
70
89
|
content?: LoginWithWhatsappContent | undefined;
|
|
71
90
|
};
|
|
72
91
|
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const LoginWithWhatsappSecurityOption1$inboundSchema: z.ZodType<
|
|
94
|
+
LoginWithWhatsappSecurityOption1,
|
|
95
|
+
z.ZodTypeDef,
|
|
96
|
+
unknown
|
|
97
|
+
> = z.object({
|
|
98
|
+
"X-Api-Key": z.string(),
|
|
99
|
+
}).transform((v) => {
|
|
100
|
+
return remap$(v, {
|
|
101
|
+
"X-Api-Key": "xApiKey",
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
/** @internal */
|
|
106
|
+
export type LoginWithWhatsappSecurityOption1$Outbound = {
|
|
107
|
+
"X-Api-Key": string;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/** @internal */
|
|
111
|
+
export const LoginWithWhatsappSecurityOption1$outboundSchema: z.ZodType<
|
|
112
|
+
LoginWithWhatsappSecurityOption1$Outbound,
|
|
113
|
+
z.ZodTypeDef,
|
|
114
|
+
LoginWithWhatsappSecurityOption1
|
|
115
|
+
> = z.object({
|
|
116
|
+
xApiKey: z.string(),
|
|
117
|
+
}).transform((v) => {
|
|
118
|
+
return remap$(v, {
|
|
119
|
+
xApiKey: "X-Api-Key",
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @internal
|
|
125
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
126
|
+
*/
|
|
127
|
+
export namespace LoginWithWhatsappSecurityOption1$ {
|
|
128
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption1$inboundSchema` instead. */
|
|
129
|
+
export const inboundSchema = LoginWithWhatsappSecurityOption1$inboundSchema;
|
|
130
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption1$outboundSchema` instead. */
|
|
131
|
+
export const outboundSchema = LoginWithWhatsappSecurityOption1$outboundSchema;
|
|
132
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption1$Outbound` instead. */
|
|
133
|
+
export type Outbound = LoginWithWhatsappSecurityOption1$Outbound;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function loginWithWhatsappSecurityOption1ToJSON(
|
|
137
|
+
loginWithWhatsappSecurityOption1: LoginWithWhatsappSecurityOption1,
|
|
138
|
+
): string {
|
|
139
|
+
return JSON.stringify(
|
|
140
|
+
LoginWithWhatsappSecurityOption1$outboundSchema.parse(
|
|
141
|
+
loginWithWhatsappSecurityOption1,
|
|
142
|
+
),
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function loginWithWhatsappSecurityOption1FromJSON(
|
|
147
|
+
jsonString: string,
|
|
148
|
+
): SafeParseResult<LoginWithWhatsappSecurityOption1, SDKValidationError> {
|
|
149
|
+
return safeParse(
|
|
150
|
+
jsonString,
|
|
151
|
+
(x) => LoginWithWhatsappSecurityOption1$inboundSchema.parse(JSON.parse(x)),
|
|
152
|
+
`Failed to parse 'LoginWithWhatsappSecurityOption1' from JSON`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export const LoginWithWhatsappSecurityOption2$inboundSchema: z.ZodType<
|
|
158
|
+
LoginWithWhatsappSecurityOption2,
|
|
159
|
+
z.ZodTypeDef,
|
|
160
|
+
unknown
|
|
161
|
+
> = z.object({
|
|
162
|
+
Authorization: z.string(),
|
|
163
|
+
}).transform((v) => {
|
|
164
|
+
return remap$(v, {
|
|
165
|
+
"Authorization": "authorization",
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
/** @internal */
|
|
170
|
+
export type LoginWithWhatsappSecurityOption2$Outbound = {
|
|
171
|
+
Authorization: string;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/** @internal */
|
|
175
|
+
export const LoginWithWhatsappSecurityOption2$outboundSchema: z.ZodType<
|
|
176
|
+
LoginWithWhatsappSecurityOption2$Outbound,
|
|
177
|
+
z.ZodTypeDef,
|
|
178
|
+
LoginWithWhatsappSecurityOption2
|
|
179
|
+
> = z.object({
|
|
180
|
+
authorization: z.string(),
|
|
181
|
+
}).transform((v) => {
|
|
182
|
+
return remap$(v, {
|
|
183
|
+
authorization: "Authorization",
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
190
|
+
*/
|
|
191
|
+
export namespace LoginWithWhatsappSecurityOption2$ {
|
|
192
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption2$inboundSchema` instead. */
|
|
193
|
+
export const inboundSchema = LoginWithWhatsappSecurityOption2$inboundSchema;
|
|
194
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption2$outboundSchema` instead. */
|
|
195
|
+
export const outboundSchema = LoginWithWhatsappSecurityOption2$outboundSchema;
|
|
196
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption2$Outbound` instead. */
|
|
197
|
+
export type Outbound = LoginWithWhatsappSecurityOption2$Outbound;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function loginWithWhatsappSecurityOption2ToJSON(
|
|
201
|
+
loginWithWhatsappSecurityOption2: LoginWithWhatsappSecurityOption2,
|
|
202
|
+
): string {
|
|
203
|
+
return JSON.stringify(
|
|
204
|
+
LoginWithWhatsappSecurityOption2$outboundSchema.parse(
|
|
205
|
+
loginWithWhatsappSecurityOption2,
|
|
206
|
+
),
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export function loginWithWhatsappSecurityOption2FromJSON(
|
|
211
|
+
jsonString: string,
|
|
212
|
+
): SafeParseResult<LoginWithWhatsappSecurityOption2, SDKValidationError> {
|
|
213
|
+
return safeParse(
|
|
214
|
+
jsonString,
|
|
215
|
+
(x) => LoginWithWhatsappSecurityOption2$inboundSchema.parse(JSON.parse(x)),
|
|
216
|
+
`Failed to parse 'LoginWithWhatsappSecurityOption2' from JSON`,
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** @internal */
|
|
221
|
+
export const LoginWithWhatsappSecurityOption3$inboundSchema: z.ZodType<
|
|
222
|
+
LoginWithWhatsappSecurityOption3,
|
|
223
|
+
z.ZodTypeDef,
|
|
224
|
+
unknown
|
|
225
|
+
> = z.object({
|
|
226
|
+
"X-Api-Key": z.string(),
|
|
227
|
+
Authorization: z.string(),
|
|
228
|
+
}).transform((v) => {
|
|
229
|
+
return remap$(v, {
|
|
230
|
+
"X-Api-Key": "xApiKey",
|
|
231
|
+
"Authorization": "authorization",
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
/** @internal */
|
|
236
|
+
export type LoginWithWhatsappSecurityOption3$Outbound = {
|
|
237
|
+
"X-Api-Key": string;
|
|
238
|
+
Authorization: string;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/** @internal */
|
|
242
|
+
export const LoginWithWhatsappSecurityOption3$outboundSchema: z.ZodType<
|
|
243
|
+
LoginWithWhatsappSecurityOption3$Outbound,
|
|
244
|
+
z.ZodTypeDef,
|
|
245
|
+
LoginWithWhatsappSecurityOption3
|
|
246
|
+
> = z.object({
|
|
247
|
+
xApiKey: z.string(),
|
|
248
|
+
authorization: z.string(),
|
|
249
|
+
}).transform((v) => {
|
|
250
|
+
return remap$(v, {
|
|
251
|
+
xApiKey: "X-Api-Key",
|
|
252
|
+
authorization: "Authorization",
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @internal
|
|
258
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
259
|
+
*/
|
|
260
|
+
export namespace LoginWithWhatsappSecurityOption3$ {
|
|
261
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption3$inboundSchema` instead. */
|
|
262
|
+
export const inboundSchema = LoginWithWhatsappSecurityOption3$inboundSchema;
|
|
263
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption3$outboundSchema` instead. */
|
|
264
|
+
export const outboundSchema = LoginWithWhatsappSecurityOption3$outboundSchema;
|
|
265
|
+
/** @deprecated use `LoginWithWhatsappSecurityOption3$Outbound` instead. */
|
|
266
|
+
export type Outbound = LoginWithWhatsappSecurityOption3$Outbound;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export function loginWithWhatsappSecurityOption3ToJSON(
|
|
270
|
+
loginWithWhatsappSecurityOption3: LoginWithWhatsappSecurityOption3,
|
|
271
|
+
): string {
|
|
272
|
+
return JSON.stringify(
|
|
273
|
+
LoginWithWhatsappSecurityOption3$outboundSchema.parse(
|
|
274
|
+
loginWithWhatsappSecurityOption3,
|
|
275
|
+
),
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export function loginWithWhatsappSecurityOption3FromJSON(
|
|
280
|
+
jsonString: string,
|
|
281
|
+
): SafeParseResult<LoginWithWhatsappSecurityOption3, SDKValidationError> {
|
|
282
|
+
return safeParse(
|
|
283
|
+
jsonString,
|
|
284
|
+
(x) => LoginWithWhatsappSecurityOption3$inboundSchema.parse(JSON.parse(x)),
|
|
285
|
+
`Failed to parse 'LoginWithWhatsappSecurityOption3' from JSON`,
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** @internal */
|
|
290
|
+
export const LoginWithWhatsappSecurity$inboundSchema: z.ZodType<
|
|
291
|
+
LoginWithWhatsappSecurity,
|
|
292
|
+
z.ZodTypeDef,
|
|
293
|
+
unknown
|
|
294
|
+
> = z.object({
|
|
295
|
+
Option1: z.lazy(() => LoginWithWhatsappSecurityOption1$inboundSchema)
|
|
296
|
+
.optional(),
|
|
297
|
+
Option2: z.lazy(() => LoginWithWhatsappSecurityOption2$inboundSchema)
|
|
298
|
+
.optional(),
|
|
299
|
+
Option3: z.lazy(() => LoginWithWhatsappSecurityOption3$inboundSchema)
|
|
300
|
+
.optional(),
|
|
301
|
+
}).transform((v) => {
|
|
302
|
+
return remap$(v, {
|
|
303
|
+
"Option1": "option1",
|
|
304
|
+
"Option2": "option2",
|
|
305
|
+
"Option3": "option3",
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
/** @internal */
|
|
310
|
+
export type LoginWithWhatsappSecurity$Outbound = {
|
|
311
|
+
Option1?: LoginWithWhatsappSecurityOption1$Outbound | undefined;
|
|
312
|
+
Option2?: LoginWithWhatsappSecurityOption2$Outbound | undefined;
|
|
313
|
+
Option3?: LoginWithWhatsappSecurityOption3$Outbound | undefined;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/** @internal */
|
|
317
|
+
export const LoginWithWhatsappSecurity$outboundSchema: z.ZodType<
|
|
318
|
+
LoginWithWhatsappSecurity$Outbound,
|
|
319
|
+
z.ZodTypeDef,
|
|
320
|
+
LoginWithWhatsappSecurity
|
|
321
|
+
> = z.object({
|
|
322
|
+
option1: z.lazy(() => LoginWithWhatsappSecurityOption1$outboundSchema)
|
|
323
|
+
.optional(),
|
|
324
|
+
option2: z.lazy(() => LoginWithWhatsappSecurityOption2$outboundSchema)
|
|
325
|
+
.optional(),
|
|
326
|
+
option3: z.lazy(() => LoginWithWhatsappSecurityOption3$outboundSchema)
|
|
327
|
+
.optional(),
|
|
328
|
+
}).transform((v) => {
|
|
329
|
+
return remap$(v, {
|
|
330
|
+
option1: "Option1",
|
|
331
|
+
option2: "Option2",
|
|
332
|
+
option3: "Option3",
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* @internal
|
|
338
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
339
|
+
*/
|
|
340
|
+
export namespace LoginWithWhatsappSecurity$ {
|
|
341
|
+
/** @deprecated use `LoginWithWhatsappSecurity$inboundSchema` instead. */
|
|
342
|
+
export const inboundSchema = LoginWithWhatsappSecurity$inboundSchema;
|
|
343
|
+
/** @deprecated use `LoginWithWhatsappSecurity$outboundSchema` instead. */
|
|
344
|
+
export const outboundSchema = LoginWithWhatsappSecurity$outboundSchema;
|
|
345
|
+
/** @deprecated use `LoginWithWhatsappSecurity$Outbound` instead. */
|
|
346
|
+
export type Outbound = LoginWithWhatsappSecurity$Outbound;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export function loginWithWhatsappSecurityToJSON(
|
|
350
|
+
loginWithWhatsappSecurity: LoginWithWhatsappSecurity,
|
|
351
|
+
): string {
|
|
352
|
+
return JSON.stringify(
|
|
353
|
+
LoginWithWhatsappSecurity$outboundSchema.parse(loginWithWhatsappSecurity),
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function loginWithWhatsappSecurityFromJSON(
|
|
358
|
+
jsonString: string,
|
|
359
|
+
): SafeParseResult<LoginWithWhatsappSecurity, SDKValidationError> {
|
|
360
|
+
return safeParse(
|
|
361
|
+
jsonString,
|
|
362
|
+
(x) => LoginWithWhatsappSecurity$inboundSchema.parse(JSON.parse(x)),
|
|
363
|
+
`Failed to parse 'LoginWithWhatsappSecurity' from JSON`,
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
73
367
|
/** @internal */
|
|
74
368
|
export const LoginWithWhatsappRequestBody$inboundSchema: z.ZodType<
|
|
75
369
|
LoginWithWhatsappRequestBody,
|
|
@@ -40,7 +40,7 @@ export type UpdateCartContent = {
|
|
|
40
40
|
*/
|
|
41
41
|
export type UpdateCartResponseBody = {
|
|
42
42
|
message: string;
|
|
43
|
-
success:
|
|
43
|
+
success: boolean;
|
|
44
44
|
content: UpdateCartContent;
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -170,14 +170,14 @@ export const UpdateCartResponseBody$inboundSchema: z.ZodType<
|
|
|
170
170
|
unknown
|
|
171
171
|
> = z.object({
|
|
172
172
|
message: z.string(),
|
|
173
|
-
success: z.
|
|
173
|
+
success: z.boolean(),
|
|
174
174
|
content: z.lazy(() => UpdateCartContent$inboundSchema),
|
|
175
175
|
});
|
|
176
176
|
|
|
177
177
|
/** @internal */
|
|
178
178
|
export type UpdateCartResponseBody$Outbound = {
|
|
179
179
|
message: string;
|
|
180
|
-
success:
|
|
180
|
+
success: boolean;
|
|
181
181
|
content: UpdateCartContent$Outbound;
|
|
182
182
|
};
|
|
183
183
|
|
|
@@ -188,7 +188,7 @@ export const UpdateCartResponseBody$outboundSchema: z.ZodType<
|
|
|
188
188
|
UpdateCartResponseBody
|
|
189
189
|
> = z.object({
|
|
190
190
|
message: z.string(),
|
|
191
|
-
success: z.
|
|
191
|
+
success: z.boolean(),
|
|
192
192
|
content: z.lazy(() => UpdateCartContent$outboundSchema),
|
|
193
193
|
});
|
|
194
194
|
|