ce-storefront 0.5.3 → 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.
Files changed (61) hide show
  1. package/docs/sdks/auth/README.md +55 -30
  2. package/esm/funcs/authGenerateOtp.d.ts +1 -1
  3. package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
  4. package/esm/funcs/authGenerateOtp.js +27 -6
  5. package/esm/funcs/authGenerateOtp.js.map +1 -1
  6. package/esm/funcs/authLoginWithEmail.d.ts +1 -1
  7. package/esm/funcs/authLoginWithEmail.d.ts.map +1 -1
  8. package/esm/funcs/authLoginWithEmail.js +27 -6
  9. package/esm/funcs/authLoginWithEmail.js.map +1 -1
  10. package/esm/funcs/authLoginWithPhone.d.ts +1 -1
  11. package/esm/funcs/authLoginWithPhone.d.ts.map +1 -1
  12. package/esm/funcs/authLoginWithPhone.js +27 -6
  13. package/esm/funcs/authLoginWithPhone.js.map +1 -1
  14. package/esm/funcs/authLoginWithWhatsapp.d.ts +1 -1
  15. package/esm/funcs/authLoginWithWhatsapp.d.ts.map +1 -1
  16. package/esm/funcs/authLoginWithWhatsapp.js +27 -6
  17. package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
  18. package/esm/funcs/authVerifyOtp.d.ts +1 -1
  19. package/esm/funcs/authVerifyOtp.d.ts.map +1 -1
  20. package/esm/funcs/authVerifyOtp.js +27 -6
  21. package/esm/funcs/authVerifyOtp.js.map +1 -1
  22. package/esm/lib/config.d.ts +3 -3
  23. package/esm/lib/config.js +3 -3
  24. package/esm/models/operations/generateotp.d.ts +106 -0
  25. package/esm/models/operations/generateotp.d.ts.map +1 -1
  26. package/esm/models/operations/generateotp.js +144 -0
  27. package/esm/models/operations/generateotp.js.map +1 -1
  28. package/esm/models/operations/loginwithemail.d.ts +106 -0
  29. package/esm/models/operations/loginwithemail.d.ts.map +1 -1
  30. package/esm/models/operations/loginwithemail.js +147 -0
  31. package/esm/models/operations/loginwithemail.js.map +1 -1
  32. package/esm/models/operations/loginwithphone.d.ts +106 -0
  33. package/esm/models/operations/loginwithphone.d.ts.map +1 -1
  34. package/esm/models/operations/loginwithphone.js +147 -0
  35. package/esm/models/operations/loginwithphone.js.map +1 -1
  36. package/esm/models/operations/loginwithwhatsapp.d.ts +106 -0
  37. package/esm/models/operations/loginwithwhatsapp.d.ts.map +1 -1
  38. package/esm/models/operations/loginwithwhatsapp.js +150 -0
  39. package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
  40. package/esm/models/operations/verifyotp.d.ts +106 -0
  41. package/esm/models/operations/verifyotp.d.ts.map +1 -1
  42. package/esm/models/operations/verifyotp.js +144 -0
  43. package/esm/models/operations/verifyotp.js.map +1 -1
  44. package/esm/sdk/auth.d.ts +5 -5
  45. package/esm/sdk/auth.d.ts.map +1 -1
  46. package/esm/sdk/auth.js +10 -10
  47. package/esm/sdk/auth.js.map +1 -1
  48. package/jsr.json +1 -1
  49. package/package.json +1 -1
  50. package/src/funcs/authGenerateOtp.ts +31 -5
  51. package/src/funcs/authLoginWithEmail.ts +31 -5
  52. package/src/funcs/authLoginWithPhone.ts +31 -5
  53. package/src/funcs/authLoginWithWhatsapp.ts +31 -5
  54. package/src/funcs/authVerifyOtp.ts +31 -5
  55. package/src/lib/config.ts +3 -3
  56. package/src/models/operations/generateotp.ts +282 -0
  57. package/src/models/operations/loginwithemail.ts +291 -0
  58. package/src/models/operations/loginwithphone.ts +291 -0
  59. package/src/models/operations/loginwithwhatsapp.ts +294 -0
  60. package/src/models/operations/verifyotp.ts +282 -0
  61. package/src/sdk/auth.ts +10 -0
@@ -20,6 +20,25 @@ export const GenerateOtpServerList = [
20
20
  "https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
21
21
  ] as const;
22
22
 
23
+ export type GenerateOtpSecurityOption1 = {
24
+ xApiKey: string;
25
+ };
26
+
27
+ export type GenerateOtpSecurityOption2 = {
28
+ authorization: string;
29
+ };
30
+
31
+ export type GenerateOtpSecurityOption3 = {
32
+ xApiKey: string;
33
+ authorization: string;
34
+ };
35
+
36
+ export type GenerateOtpSecurity = {
37
+ option1?: GenerateOtpSecurityOption1 | undefined;
38
+ option2?: GenerateOtpSecurityOption2 | undefined;
39
+ option3?: GenerateOtpSecurityOption3 | undefined;
40
+ };
41
+
23
42
  /**
24
43
  * The communication channel for sending the OTP.
25
44
  */
@@ -99,6 +118,269 @@ export type GenerateOtpResponseBody = {
99
118
  content?: GenerateOtpContent | undefined;
100
119
  };
101
120
 
121
+ /** @internal */
122
+ export const GenerateOtpSecurityOption1$inboundSchema: z.ZodType<
123
+ GenerateOtpSecurityOption1,
124
+ z.ZodTypeDef,
125
+ unknown
126
+ > = z.object({
127
+ "X-Api-Key": z.string(),
128
+ }).transform((v) => {
129
+ return remap$(v, {
130
+ "X-Api-Key": "xApiKey",
131
+ });
132
+ });
133
+
134
+ /** @internal */
135
+ export type GenerateOtpSecurityOption1$Outbound = {
136
+ "X-Api-Key": string;
137
+ };
138
+
139
+ /** @internal */
140
+ export const GenerateOtpSecurityOption1$outboundSchema: z.ZodType<
141
+ GenerateOtpSecurityOption1$Outbound,
142
+ z.ZodTypeDef,
143
+ GenerateOtpSecurityOption1
144
+ > = z.object({
145
+ xApiKey: z.string(),
146
+ }).transform((v) => {
147
+ return remap$(v, {
148
+ xApiKey: "X-Api-Key",
149
+ });
150
+ });
151
+
152
+ /**
153
+ * @internal
154
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
155
+ */
156
+ export namespace GenerateOtpSecurityOption1$ {
157
+ /** @deprecated use `GenerateOtpSecurityOption1$inboundSchema` instead. */
158
+ export const inboundSchema = GenerateOtpSecurityOption1$inboundSchema;
159
+ /** @deprecated use `GenerateOtpSecurityOption1$outboundSchema` instead. */
160
+ export const outboundSchema = GenerateOtpSecurityOption1$outboundSchema;
161
+ /** @deprecated use `GenerateOtpSecurityOption1$Outbound` instead. */
162
+ export type Outbound = GenerateOtpSecurityOption1$Outbound;
163
+ }
164
+
165
+ export function generateOtpSecurityOption1ToJSON(
166
+ generateOtpSecurityOption1: GenerateOtpSecurityOption1,
167
+ ): string {
168
+ return JSON.stringify(
169
+ GenerateOtpSecurityOption1$outboundSchema.parse(generateOtpSecurityOption1),
170
+ );
171
+ }
172
+
173
+ export function generateOtpSecurityOption1FromJSON(
174
+ jsonString: string,
175
+ ): SafeParseResult<GenerateOtpSecurityOption1, SDKValidationError> {
176
+ return safeParse(
177
+ jsonString,
178
+ (x) => GenerateOtpSecurityOption1$inboundSchema.parse(JSON.parse(x)),
179
+ `Failed to parse 'GenerateOtpSecurityOption1' from JSON`,
180
+ );
181
+ }
182
+
183
+ /** @internal */
184
+ export const GenerateOtpSecurityOption2$inboundSchema: z.ZodType<
185
+ GenerateOtpSecurityOption2,
186
+ z.ZodTypeDef,
187
+ unknown
188
+ > = z.object({
189
+ Authorization: z.string(),
190
+ }).transform((v) => {
191
+ return remap$(v, {
192
+ "Authorization": "authorization",
193
+ });
194
+ });
195
+
196
+ /** @internal */
197
+ export type GenerateOtpSecurityOption2$Outbound = {
198
+ Authorization: string;
199
+ };
200
+
201
+ /** @internal */
202
+ export const GenerateOtpSecurityOption2$outboundSchema: z.ZodType<
203
+ GenerateOtpSecurityOption2$Outbound,
204
+ z.ZodTypeDef,
205
+ GenerateOtpSecurityOption2
206
+ > = z.object({
207
+ authorization: z.string(),
208
+ }).transform((v) => {
209
+ return remap$(v, {
210
+ authorization: "Authorization",
211
+ });
212
+ });
213
+
214
+ /**
215
+ * @internal
216
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
217
+ */
218
+ export namespace GenerateOtpSecurityOption2$ {
219
+ /** @deprecated use `GenerateOtpSecurityOption2$inboundSchema` instead. */
220
+ export const inboundSchema = GenerateOtpSecurityOption2$inboundSchema;
221
+ /** @deprecated use `GenerateOtpSecurityOption2$outboundSchema` instead. */
222
+ export const outboundSchema = GenerateOtpSecurityOption2$outboundSchema;
223
+ /** @deprecated use `GenerateOtpSecurityOption2$Outbound` instead. */
224
+ export type Outbound = GenerateOtpSecurityOption2$Outbound;
225
+ }
226
+
227
+ export function generateOtpSecurityOption2ToJSON(
228
+ generateOtpSecurityOption2: GenerateOtpSecurityOption2,
229
+ ): string {
230
+ return JSON.stringify(
231
+ GenerateOtpSecurityOption2$outboundSchema.parse(generateOtpSecurityOption2),
232
+ );
233
+ }
234
+
235
+ export function generateOtpSecurityOption2FromJSON(
236
+ jsonString: string,
237
+ ): SafeParseResult<GenerateOtpSecurityOption2, SDKValidationError> {
238
+ return safeParse(
239
+ jsonString,
240
+ (x) => GenerateOtpSecurityOption2$inboundSchema.parse(JSON.parse(x)),
241
+ `Failed to parse 'GenerateOtpSecurityOption2' from JSON`,
242
+ );
243
+ }
244
+
245
+ /** @internal */
246
+ export const GenerateOtpSecurityOption3$inboundSchema: z.ZodType<
247
+ GenerateOtpSecurityOption3,
248
+ z.ZodTypeDef,
249
+ unknown
250
+ > = z.object({
251
+ "X-Api-Key": z.string(),
252
+ Authorization: z.string(),
253
+ }).transform((v) => {
254
+ return remap$(v, {
255
+ "X-Api-Key": "xApiKey",
256
+ "Authorization": "authorization",
257
+ });
258
+ });
259
+
260
+ /** @internal */
261
+ export type GenerateOtpSecurityOption3$Outbound = {
262
+ "X-Api-Key": string;
263
+ Authorization: string;
264
+ };
265
+
266
+ /** @internal */
267
+ export const GenerateOtpSecurityOption3$outboundSchema: z.ZodType<
268
+ GenerateOtpSecurityOption3$Outbound,
269
+ z.ZodTypeDef,
270
+ GenerateOtpSecurityOption3
271
+ > = z.object({
272
+ xApiKey: z.string(),
273
+ authorization: z.string(),
274
+ }).transform((v) => {
275
+ return remap$(v, {
276
+ xApiKey: "X-Api-Key",
277
+ authorization: "Authorization",
278
+ });
279
+ });
280
+
281
+ /**
282
+ * @internal
283
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
284
+ */
285
+ export namespace GenerateOtpSecurityOption3$ {
286
+ /** @deprecated use `GenerateOtpSecurityOption3$inboundSchema` instead. */
287
+ export const inboundSchema = GenerateOtpSecurityOption3$inboundSchema;
288
+ /** @deprecated use `GenerateOtpSecurityOption3$outboundSchema` instead. */
289
+ export const outboundSchema = GenerateOtpSecurityOption3$outboundSchema;
290
+ /** @deprecated use `GenerateOtpSecurityOption3$Outbound` instead. */
291
+ export type Outbound = GenerateOtpSecurityOption3$Outbound;
292
+ }
293
+
294
+ export function generateOtpSecurityOption3ToJSON(
295
+ generateOtpSecurityOption3: GenerateOtpSecurityOption3,
296
+ ): string {
297
+ return JSON.stringify(
298
+ GenerateOtpSecurityOption3$outboundSchema.parse(generateOtpSecurityOption3),
299
+ );
300
+ }
301
+
302
+ export function generateOtpSecurityOption3FromJSON(
303
+ jsonString: string,
304
+ ): SafeParseResult<GenerateOtpSecurityOption3, SDKValidationError> {
305
+ return safeParse(
306
+ jsonString,
307
+ (x) => GenerateOtpSecurityOption3$inboundSchema.parse(JSON.parse(x)),
308
+ `Failed to parse 'GenerateOtpSecurityOption3' from JSON`,
309
+ );
310
+ }
311
+
312
+ /** @internal */
313
+ export const GenerateOtpSecurity$inboundSchema: z.ZodType<
314
+ GenerateOtpSecurity,
315
+ z.ZodTypeDef,
316
+ unknown
317
+ > = z.object({
318
+ Option1: z.lazy(() => GenerateOtpSecurityOption1$inboundSchema).optional(),
319
+ Option2: z.lazy(() => GenerateOtpSecurityOption2$inboundSchema).optional(),
320
+ Option3: z.lazy(() => GenerateOtpSecurityOption3$inboundSchema).optional(),
321
+ }).transform((v) => {
322
+ return remap$(v, {
323
+ "Option1": "option1",
324
+ "Option2": "option2",
325
+ "Option3": "option3",
326
+ });
327
+ });
328
+
329
+ /** @internal */
330
+ export type GenerateOtpSecurity$Outbound = {
331
+ Option1?: GenerateOtpSecurityOption1$Outbound | undefined;
332
+ Option2?: GenerateOtpSecurityOption2$Outbound | undefined;
333
+ Option3?: GenerateOtpSecurityOption3$Outbound | undefined;
334
+ };
335
+
336
+ /** @internal */
337
+ export const GenerateOtpSecurity$outboundSchema: z.ZodType<
338
+ GenerateOtpSecurity$Outbound,
339
+ z.ZodTypeDef,
340
+ GenerateOtpSecurity
341
+ > = z.object({
342
+ option1: z.lazy(() => GenerateOtpSecurityOption1$outboundSchema).optional(),
343
+ option2: z.lazy(() => GenerateOtpSecurityOption2$outboundSchema).optional(),
344
+ option3: z.lazy(() => GenerateOtpSecurityOption3$outboundSchema).optional(),
345
+ }).transform((v) => {
346
+ return remap$(v, {
347
+ option1: "Option1",
348
+ option2: "Option2",
349
+ option3: "Option3",
350
+ });
351
+ });
352
+
353
+ /**
354
+ * @internal
355
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
356
+ */
357
+ export namespace GenerateOtpSecurity$ {
358
+ /** @deprecated use `GenerateOtpSecurity$inboundSchema` instead. */
359
+ export const inboundSchema = GenerateOtpSecurity$inboundSchema;
360
+ /** @deprecated use `GenerateOtpSecurity$outboundSchema` instead. */
361
+ export const outboundSchema = GenerateOtpSecurity$outboundSchema;
362
+ /** @deprecated use `GenerateOtpSecurity$Outbound` instead. */
363
+ export type Outbound = GenerateOtpSecurity$Outbound;
364
+ }
365
+
366
+ export function generateOtpSecurityToJSON(
367
+ generateOtpSecurity: GenerateOtpSecurity,
368
+ ): string {
369
+ return JSON.stringify(
370
+ GenerateOtpSecurity$outboundSchema.parse(generateOtpSecurity),
371
+ );
372
+ }
373
+
374
+ export function generateOtpSecurityFromJSON(
375
+ jsonString: string,
376
+ ): SafeParseResult<GenerateOtpSecurity, SDKValidationError> {
377
+ return safeParse(
378
+ jsonString,
379
+ (x) => GenerateOtpSecurity$inboundSchema.parse(JSON.parse(x)),
380
+ `Failed to parse 'GenerateOtpSecurity' from JSON`,
381
+ );
382
+ }
383
+
102
384
  /** @internal */
103
385
  export const Channel$inboundSchema: z.ZodNativeEnum<typeof Channel> = z
104
386
  .nativeEnum(Channel);
@@ -19,6 +19,25 @@ export const LoginWithEmailServerList = [
19
19
  "https://prod.api.commercengine.io/api/v1/{store_id}/storefront",
20
20
  ] as const;
21
21
 
22
+ export type LoginWithEmailSecurityOption1 = {
23
+ xApiKey: string;
24
+ };
25
+
26
+ export type LoginWithEmailSecurityOption2 = {
27
+ authorization: string;
28
+ };
29
+
30
+ export type LoginWithEmailSecurityOption3 = {
31
+ xApiKey: string;
32
+ authorization: string;
33
+ };
34
+
35
+ export type LoginWithEmailSecurity = {
36
+ option1?: LoginWithEmailSecurityOption1 | undefined;
37
+ option2?: LoginWithEmailSecurityOption2 | undefined;
38
+ option3?: LoginWithEmailSecurityOption3 | undefined;
39
+ };
40
+
22
41
  export type LoginWithEmailRequestBody = {
23
42
  /**
24
43
  * User's email address.
@@ -66,6 +85,278 @@ export type LoginWithEmailResponseBody = {
66
85
  content?: LoginWithEmailContent | undefined;
67
86
  };
68
87
 
88
+ /** @internal */
89
+ export const LoginWithEmailSecurityOption1$inboundSchema: z.ZodType<
90
+ LoginWithEmailSecurityOption1,
91
+ z.ZodTypeDef,
92
+ unknown
93
+ > = z.object({
94
+ "X-Api-Key": z.string(),
95
+ }).transform((v) => {
96
+ return remap$(v, {
97
+ "X-Api-Key": "xApiKey",
98
+ });
99
+ });
100
+
101
+ /** @internal */
102
+ export type LoginWithEmailSecurityOption1$Outbound = {
103
+ "X-Api-Key": string;
104
+ };
105
+
106
+ /** @internal */
107
+ export const LoginWithEmailSecurityOption1$outboundSchema: z.ZodType<
108
+ LoginWithEmailSecurityOption1$Outbound,
109
+ z.ZodTypeDef,
110
+ LoginWithEmailSecurityOption1
111
+ > = z.object({
112
+ xApiKey: z.string(),
113
+ }).transform((v) => {
114
+ return remap$(v, {
115
+ xApiKey: "X-Api-Key",
116
+ });
117
+ });
118
+
119
+ /**
120
+ * @internal
121
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
122
+ */
123
+ export namespace LoginWithEmailSecurityOption1$ {
124
+ /** @deprecated use `LoginWithEmailSecurityOption1$inboundSchema` instead. */
125
+ export const inboundSchema = LoginWithEmailSecurityOption1$inboundSchema;
126
+ /** @deprecated use `LoginWithEmailSecurityOption1$outboundSchema` instead. */
127
+ export const outboundSchema = LoginWithEmailSecurityOption1$outboundSchema;
128
+ /** @deprecated use `LoginWithEmailSecurityOption1$Outbound` instead. */
129
+ export type Outbound = LoginWithEmailSecurityOption1$Outbound;
130
+ }
131
+
132
+ export function loginWithEmailSecurityOption1ToJSON(
133
+ loginWithEmailSecurityOption1: LoginWithEmailSecurityOption1,
134
+ ): string {
135
+ return JSON.stringify(
136
+ LoginWithEmailSecurityOption1$outboundSchema.parse(
137
+ loginWithEmailSecurityOption1,
138
+ ),
139
+ );
140
+ }
141
+
142
+ export function loginWithEmailSecurityOption1FromJSON(
143
+ jsonString: string,
144
+ ): SafeParseResult<LoginWithEmailSecurityOption1, SDKValidationError> {
145
+ return safeParse(
146
+ jsonString,
147
+ (x) => LoginWithEmailSecurityOption1$inboundSchema.parse(JSON.parse(x)),
148
+ `Failed to parse 'LoginWithEmailSecurityOption1' from JSON`,
149
+ );
150
+ }
151
+
152
+ /** @internal */
153
+ export const LoginWithEmailSecurityOption2$inboundSchema: z.ZodType<
154
+ LoginWithEmailSecurityOption2,
155
+ z.ZodTypeDef,
156
+ unknown
157
+ > = z.object({
158
+ Authorization: z.string(),
159
+ }).transform((v) => {
160
+ return remap$(v, {
161
+ "Authorization": "authorization",
162
+ });
163
+ });
164
+
165
+ /** @internal */
166
+ export type LoginWithEmailSecurityOption2$Outbound = {
167
+ Authorization: string;
168
+ };
169
+
170
+ /** @internal */
171
+ export const LoginWithEmailSecurityOption2$outboundSchema: z.ZodType<
172
+ LoginWithEmailSecurityOption2$Outbound,
173
+ z.ZodTypeDef,
174
+ LoginWithEmailSecurityOption2
175
+ > = z.object({
176
+ authorization: z.string(),
177
+ }).transform((v) => {
178
+ return remap$(v, {
179
+ authorization: "Authorization",
180
+ });
181
+ });
182
+
183
+ /**
184
+ * @internal
185
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
186
+ */
187
+ export namespace LoginWithEmailSecurityOption2$ {
188
+ /** @deprecated use `LoginWithEmailSecurityOption2$inboundSchema` instead. */
189
+ export const inboundSchema = LoginWithEmailSecurityOption2$inboundSchema;
190
+ /** @deprecated use `LoginWithEmailSecurityOption2$outboundSchema` instead. */
191
+ export const outboundSchema = LoginWithEmailSecurityOption2$outboundSchema;
192
+ /** @deprecated use `LoginWithEmailSecurityOption2$Outbound` instead. */
193
+ export type Outbound = LoginWithEmailSecurityOption2$Outbound;
194
+ }
195
+
196
+ export function loginWithEmailSecurityOption2ToJSON(
197
+ loginWithEmailSecurityOption2: LoginWithEmailSecurityOption2,
198
+ ): string {
199
+ return JSON.stringify(
200
+ LoginWithEmailSecurityOption2$outboundSchema.parse(
201
+ loginWithEmailSecurityOption2,
202
+ ),
203
+ );
204
+ }
205
+
206
+ export function loginWithEmailSecurityOption2FromJSON(
207
+ jsonString: string,
208
+ ): SafeParseResult<LoginWithEmailSecurityOption2, SDKValidationError> {
209
+ return safeParse(
210
+ jsonString,
211
+ (x) => LoginWithEmailSecurityOption2$inboundSchema.parse(JSON.parse(x)),
212
+ `Failed to parse 'LoginWithEmailSecurityOption2' from JSON`,
213
+ );
214
+ }
215
+
216
+ /** @internal */
217
+ export const LoginWithEmailSecurityOption3$inboundSchema: z.ZodType<
218
+ LoginWithEmailSecurityOption3,
219
+ z.ZodTypeDef,
220
+ unknown
221
+ > = z.object({
222
+ "X-Api-Key": z.string(),
223
+ Authorization: z.string(),
224
+ }).transform((v) => {
225
+ return remap$(v, {
226
+ "X-Api-Key": "xApiKey",
227
+ "Authorization": "authorization",
228
+ });
229
+ });
230
+
231
+ /** @internal */
232
+ export type LoginWithEmailSecurityOption3$Outbound = {
233
+ "X-Api-Key": string;
234
+ Authorization: string;
235
+ };
236
+
237
+ /** @internal */
238
+ export const LoginWithEmailSecurityOption3$outboundSchema: z.ZodType<
239
+ LoginWithEmailSecurityOption3$Outbound,
240
+ z.ZodTypeDef,
241
+ LoginWithEmailSecurityOption3
242
+ > = z.object({
243
+ xApiKey: z.string(),
244
+ authorization: z.string(),
245
+ }).transform((v) => {
246
+ return remap$(v, {
247
+ xApiKey: "X-Api-Key",
248
+ authorization: "Authorization",
249
+ });
250
+ });
251
+
252
+ /**
253
+ * @internal
254
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
255
+ */
256
+ export namespace LoginWithEmailSecurityOption3$ {
257
+ /** @deprecated use `LoginWithEmailSecurityOption3$inboundSchema` instead. */
258
+ export const inboundSchema = LoginWithEmailSecurityOption3$inboundSchema;
259
+ /** @deprecated use `LoginWithEmailSecurityOption3$outboundSchema` instead. */
260
+ export const outboundSchema = LoginWithEmailSecurityOption3$outboundSchema;
261
+ /** @deprecated use `LoginWithEmailSecurityOption3$Outbound` instead. */
262
+ export type Outbound = LoginWithEmailSecurityOption3$Outbound;
263
+ }
264
+
265
+ export function loginWithEmailSecurityOption3ToJSON(
266
+ loginWithEmailSecurityOption3: LoginWithEmailSecurityOption3,
267
+ ): string {
268
+ return JSON.stringify(
269
+ LoginWithEmailSecurityOption3$outboundSchema.parse(
270
+ loginWithEmailSecurityOption3,
271
+ ),
272
+ );
273
+ }
274
+
275
+ export function loginWithEmailSecurityOption3FromJSON(
276
+ jsonString: string,
277
+ ): SafeParseResult<LoginWithEmailSecurityOption3, SDKValidationError> {
278
+ return safeParse(
279
+ jsonString,
280
+ (x) => LoginWithEmailSecurityOption3$inboundSchema.parse(JSON.parse(x)),
281
+ `Failed to parse 'LoginWithEmailSecurityOption3' from JSON`,
282
+ );
283
+ }
284
+
285
+ /** @internal */
286
+ export const LoginWithEmailSecurity$inboundSchema: z.ZodType<
287
+ LoginWithEmailSecurity,
288
+ z.ZodTypeDef,
289
+ unknown
290
+ > = z.object({
291
+ Option1: z.lazy(() => LoginWithEmailSecurityOption1$inboundSchema).optional(),
292
+ Option2: z.lazy(() => LoginWithEmailSecurityOption2$inboundSchema).optional(),
293
+ Option3: z.lazy(() => LoginWithEmailSecurityOption3$inboundSchema).optional(),
294
+ }).transform((v) => {
295
+ return remap$(v, {
296
+ "Option1": "option1",
297
+ "Option2": "option2",
298
+ "Option3": "option3",
299
+ });
300
+ });
301
+
302
+ /** @internal */
303
+ export type LoginWithEmailSecurity$Outbound = {
304
+ Option1?: LoginWithEmailSecurityOption1$Outbound | undefined;
305
+ Option2?: LoginWithEmailSecurityOption2$Outbound | undefined;
306
+ Option3?: LoginWithEmailSecurityOption3$Outbound | undefined;
307
+ };
308
+
309
+ /** @internal */
310
+ export const LoginWithEmailSecurity$outboundSchema: z.ZodType<
311
+ LoginWithEmailSecurity$Outbound,
312
+ z.ZodTypeDef,
313
+ LoginWithEmailSecurity
314
+ > = z.object({
315
+ option1: z.lazy(() => LoginWithEmailSecurityOption1$outboundSchema)
316
+ .optional(),
317
+ option2: z.lazy(() => LoginWithEmailSecurityOption2$outboundSchema)
318
+ .optional(),
319
+ option3: z.lazy(() => LoginWithEmailSecurityOption3$outboundSchema)
320
+ .optional(),
321
+ }).transform((v) => {
322
+ return remap$(v, {
323
+ option1: "Option1",
324
+ option2: "Option2",
325
+ option3: "Option3",
326
+ });
327
+ });
328
+
329
+ /**
330
+ * @internal
331
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
332
+ */
333
+ export namespace LoginWithEmailSecurity$ {
334
+ /** @deprecated use `LoginWithEmailSecurity$inboundSchema` instead. */
335
+ export const inboundSchema = LoginWithEmailSecurity$inboundSchema;
336
+ /** @deprecated use `LoginWithEmailSecurity$outboundSchema` instead. */
337
+ export const outboundSchema = LoginWithEmailSecurity$outboundSchema;
338
+ /** @deprecated use `LoginWithEmailSecurity$Outbound` instead. */
339
+ export type Outbound = LoginWithEmailSecurity$Outbound;
340
+ }
341
+
342
+ export function loginWithEmailSecurityToJSON(
343
+ loginWithEmailSecurity: LoginWithEmailSecurity,
344
+ ): string {
345
+ return JSON.stringify(
346
+ LoginWithEmailSecurity$outboundSchema.parse(loginWithEmailSecurity),
347
+ );
348
+ }
349
+
350
+ export function loginWithEmailSecurityFromJSON(
351
+ jsonString: string,
352
+ ): SafeParseResult<LoginWithEmailSecurity, SDKValidationError> {
353
+ return safeParse(
354
+ jsonString,
355
+ (x) => LoginWithEmailSecurity$inboundSchema.parse(JSON.parse(x)),
356
+ `Failed to parse 'LoginWithEmailSecurity' from JSON`,
357
+ );
358
+ }
359
+
69
360
  /** @internal */
70
361
  export const LoginWithEmailRequestBody$inboundSchema: z.ZodType<
71
362
  LoginWithEmailRequestBody,