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.
Files changed (126) hide show
  1. package/docs/sdks/auth/README.md +85 -36
  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/components/notificationchannelpreferences.d.ts +3 -3
  25. package/esm/models/components/notificationchannelpreferences.d.ts.map +1 -1
  26. package/esm/models/components/notificationchannelpreferences.js +6 -6
  27. package/esm/models/components/notificationchannelpreferences.js.map +1 -1
  28. package/esm/models/operations/deleteaddress.d.ts +1 -1
  29. package/esm/models/operations/deleteaddress.d.ts.map +1 -1
  30. package/esm/models/operations/deleteaddress.js +2 -2
  31. package/esm/models/operations/deleteaddress.js.map +1 -1
  32. package/esm/models/operations/deletecart.d.ts +1 -1
  33. package/esm/models/operations/deletecart.d.ts.map +1 -1
  34. package/esm/models/operations/deletecart.js +2 -2
  35. package/esm/models/operations/deletecart.js.map +1 -1
  36. package/esm/models/operations/deleteusercart.d.ts +1 -1
  37. package/esm/models/operations/deleteusercart.d.ts.map +1 -1
  38. package/esm/models/operations/deleteusercart.js +2 -2
  39. package/esm/models/operations/deleteusercart.js.map +1 -1
  40. package/esm/models/operations/generateotp.d.ts +106 -0
  41. package/esm/models/operations/generateotp.d.ts.map +1 -1
  42. package/esm/models/operations/generateotp.js +144 -0
  43. package/esm/models/operations/generateotp.js.map +1 -1
  44. package/esm/models/operations/getcart.d.ts +1 -1
  45. package/esm/models/operations/getcart.d.ts.map +1 -1
  46. package/esm/models/operations/getcart.js +2 -2
  47. package/esm/models/operations/getcart.js.map +1 -1
  48. package/esm/models/operations/getproductdetail.d.ts +1 -1
  49. package/esm/models/operations/getproductdetail.d.ts.map +1 -1
  50. package/esm/models/operations/getproductdetail.js +2 -2
  51. package/esm/models/operations/getproductdetail.js.map +1 -1
  52. package/esm/models/operations/getusercart.d.ts +1 -1
  53. package/esm/models/operations/getusercart.d.ts.map +1 -1
  54. package/esm/models/operations/getusercart.js +2 -2
  55. package/esm/models/operations/getusercart.js.map +1 -1
  56. package/esm/models/operations/getvariantdetail.d.ts +1 -1
  57. package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
  58. package/esm/models/operations/getvariantdetail.js +2 -2
  59. package/esm/models/operations/getvariantdetail.js.map +1 -1
  60. package/esm/models/operations/listcategories.d.ts +1 -1
  61. package/esm/models/operations/listcategories.d.ts.map +1 -1
  62. package/esm/models/operations/listcategories.js +2 -2
  63. package/esm/models/operations/listcategories.js.map +1 -1
  64. package/esm/models/operations/listproducts.d.ts +1 -1
  65. package/esm/models/operations/listproducts.d.ts.map +1 -1
  66. package/esm/models/operations/listproducts.js +2 -2
  67. package/esm/models/operations/listproducts.js.map +1 -1
  68. package/esm/models/operations/listproductvariants.d.ts +1 -1
  69. package/esm/models/operations/listproductvariants.d.ts.map +1 -1
  70. package/esm/models/operations/listproductvariants.js +2 -2
  71. package/esm/models/operations/listproductvariants.js.map +1 -1
  72. package/esm/models/operations/listskus.d.ts +1 -1
  73. package/esm/models/operations/listskus.d.ts.map +1 -1
  74. package/esm/models/operations/listskus.js +2 -2
  75. package/esm/models/operations/listskus.js.map +1 -1
  76. package/esm/models/operations/loginwithemail.d.ts +106 -0
  77. package/esm/models/operations/loginwithemail.d.ts.map +1 -1
  78. package/esm/models/operations/loginwithemail.js +147 -0
  79. package/esm/models/operations/loginwithemail.js.map +1 -1
  80. package/esm/models/operations/loginwithphone.d.ts +106 -0
  81. package/esm/models/operations/loginwithphone.d.ts.map +1 -1
  82. package/esm/models/operations/loginwithphone.js +147 -0
  83. package/esm/models/operations/loginwithphone.js.map +1 -1
  84. package/esm/models/operations/loginwithwhatsapp.d.ts +106 -0
  85. package/esm/models/operations/loginwithwhatsapp.d.ts.map +1 -1
  86. package/esm/models/operations/loginwithwhatsapp.js +150 -0
  87. package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
  88. package/esm/models/operations/updatecart.d.ts +2 -2
  89. package/esm/models/operations/updatecart.d.ts.map +1 -1
  90. package/esm/models/operations/updatecart.js +2 -2
  91. package/esm/models/operations/updatecart.js.map +1 -1
  92. package/esm/models/operations/verifyotp.d.ts +106 -0
  93. package/esm/models/operations/verifyotp.d.ts.map +1 -1
  94. package/esm/models/operations/verifyotp.js +144 -0
  95. package/esm/models/operations/verifyotp.js.map +1 -1
  96. package/esm/sdk/auth.d.ts +5 -5
  97. package/esm/sdk/auth.d.ts.map +1 -1
  98. package/esm/sdk/auth.js +10 -10
  99. package/esm/sdk/auth.js.map +1 -1
  100. package/jsr.json +1 -1
  101. package/package.json +1 -1
  102. package/src/funcs/authGenerateOtp.ts +31 -5
  103. package/src/funcs/authLoginWithEmail.ts +31 -5
  104. package/src/funcs/authLoginWithPhone.ts +31 -5
  105. package/src/funcs/authLoginWithWhatsapp.ts +31 -5
  106. package/src/funcs/authVerifyOtp.ts +31 -5
  107. package/src/lib/config.ts +3 -3
  108. package/src/models/components/notificationchannelpreferences.ts +9 -9
  109. package/src/models/operations/deleteaddress.ts +3 -3
  110. package/src/models/operations/deletecart.ts +3 -3
  111. package/src/models/operations/deleteusercart.ts +3 -3
  112. package/src/models/operations/generateotp.ts +282 -0
  113. package/src/models/operations/getcart.ts +3 -3
  114. package/src/models/operations/getproductdetail.ts +3 -3
  115. package/src/models/operations/getusercart.ts +3 -3
  116. package/src/models/operations/getvariantdetail.ts +3 -3
  117. package/src/models/operations/listcategories.ts +3 -3
  118. package/src/models/operations/listproducts.ts +3 -3
  119. package/src/models/operations/listproductvariants.ts +3 -3
  120. package/src/models/operations/listskus.ts +3 -3
  121. package/src/models/operations/loginwithemail.ts +291 -0
  122. package/src/models/operations/loginwithphone.ts +291 -0
  123. package/src/models/operations/loginwithwhatsapp.ts +294 -0
  124. package/src/models/operations/updatecart.ts +4 -4
  125. package/src/models/operations/verifyotp.ts +282 -0
  126. package/src/sdk/auth.ts +10 -0
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
10
10
  import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { resolveSecurity } from "../lib/security.js";
12
12
  import { pathToFunc } from "../lib/url.js";
13
13
  import { CeError } from "../models/errors/ceerror.js";
14
14
  import {
@@ -31,6 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  */
32
32
  export async function authLoginWithPhone(
33
33
  client: CeStorefrontCore,
34
+ security: operations.LoginWithPhoneSecurity,
34
35
  request: operations.LoginWithPhoneRequestBody,
35
36
  options?: RequestOptions,
36
37
  ): Promise<
@@ -68,9 +69,34 @@ export async function authLoginWithPhone(
68
69
  Accept: "application/json",
69
70
  }));
70
71
 
71
- const secConfig = await extractSecurity(client._options.authorization);
72
- const securityInput = secConfig == null ? {} : { authorization: secConfig };
73
- const requestSecurity = resolveGlobalSecurity(securityInput);
72
+ const requestSecurity = resolveSecurity(
73
+ [
74
+ {
75
+ fieldName: "X-Api-Key",
76
+ type: "apiKey:header",
77
+ value: security?.option1?.xApiKey,
78
+ },
79
+ ],
80
+ [
81
+ {
82
+ fieldName: "Authorization",
83
+ type: "http:bearer",
84
+ value: security?.option2?.authorization,
85
+ },
86
+ ],
87
+ [
88
+ {
89
+ fieldName: "X-Api-Key",
90
+ type: "apiKey:header",
91
+ value: security?.option3?.xApiKey,
92
+ },
93
+ {
94
+ fieldName: "Authorization",
95
+ type: "http:bearer",
96
+ value: security?.option3?.authorization,
97
+ },
98
+ ],
99
+ );
74
100
 
75
101
  const context = {
76
102
  operationID: "login-with-phone",
@@ -78,7 +104,7 @@ export async function authLoginWithPhone(
78
104
 
79
105
  resolvedSecurity: requestSecurity,
80
106
 
81
- securitySource: client._options.authorization,
107
+ securitySource: security,
82
108
  retryConfig: options?.retries
83
109
  || client._options.retryConfig
84
110
  || { strategy: "none" },
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
10
10
  import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { resolveSecurity } from "../lib/security.js";
12
12
  import { pathToFunc } from "../lib/url.js";
13
13
  import { CeError } from "../models/errors/ceerror.js";
14
14
  import {
@@ -31,6 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  */
32
32
  export async function authLoginWithWhatsapp(
33
33
  client: CeStorefrontCore,
34
+ security: operations.LoginWithWhatsappSecurity,
34
35
  request: operations.LoginWithWhatsappRequestBody,
35
36
  options?: RequestOptions,
36
37
  ): Promise<
@@ -69,9 +70,34 @@ export async function authLoginWithWhatsapp(
69
70
  Accept: "application/json",
70
71
  }));
71
72
 
72
- const secConfig = await extractSecurity(client._options.authorization);
73
- const securityInput = secConfig == null ? {} : { authorization: secConfig };
74
- const requestSecurity = resolveGlobalSecurity(securityInput);
73
+ const requestSecurity = resolveSecurity(
74
+ [
75
+ {
76
+ fieldName: "X-Api-Key",
77
+ type: "apiKey:header",
78
+ value: security?.option1?.xApiKey,
79
+ },
80
+ ],
81
+ [
82
+ {
83
+ fieldName: "Authorization",
84
+ type: "http:bearer",
85
+ value: security?.option2?.authorization,
86
+ },
87
+ ],
88
+ [
89
+ {
90
+ fieldName: "X-Api-Key",
91
+ type: "apiKey:header",
92
+ value: security?.option3?.xApiKey,
93
+ },
94
+ {
95
+ fieldName: "Authorization",
96
+ type: "http:bearer",
97
+ value: security?.option3?.authorization,
98
+ },
99
+ ],
100
+ );
75
101
 
76
102
  const context = {
77
103
  operationID: "login-with-whatsapp",
@@ -79,7 +105,7 @@ export async function authLoginWithWhatsapp(
79
105
 
80
106
  resolvedSecurity: requestSecurity,
81
107
 
82
- securitySource: client._options.authorization,
108
+ securitySource: security,
83
109
  retryConfig: options?.retries
84
110
  || client._options.retryConfig
85
111
  || { strategy: "none" },
@@ -8,7 +8,7 @@ import * as M from "../lib/matchers.js";
8
8
  import { compactMap } from "../lib/primitives.js";
9
9
  import { safeParse } from "../lib/schemas.js";
10
10
  import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { resolveSecurity } from "../lib/security.js";
12
12
  import { pathToFunc } from "../lib/url.js";
13
13
  import { CeError } from "../models/errors/ceerror.js";
14
14
  import {
@@ -31,6 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  */
32
32
  export async function authVerifyOtp(
33
33
  client: CeStorefrontCore,
34
+ security: operations.VerifyOtpSecurity,
34
35
  request: operations.VerifyOtpRequestBody,
35
36
  options?: RequestOptions,
36
37
  ): Promise<
@@ -68,9 +69,34 @@ export async function authVerifyOtp(
68
69
  Accept: "application/json",
69
70
  }));
70
71
 
71
- const secConfig = await extractSecurity(client._options.authorization);
72
- const securityInput = secConfig == null ? {} : { authorization: secConfig };
73
- const requestSecurity = resolveGlobalSecurity(securityInput);
72
+ const requestSecurity = resolveSecurity(
73
+ [
74
+ {
75
+ fieldName: "X-Api-Key",
76
+ type: "apiKey:header",
77
+ value: security?.option1?.xApiKey,
78
+ },
79
+ ],
80
+ [
81
+ {
82
+ fieldName: "Authorization",
83
+ type: "http:bearer",
84
+ value: security?.option2?.authorization,
85
+ },
86
+ ],
87
+ [
88
+ {
89
+ fieldName: "X-Api-Key",
90
+ type: "apiKey:header",
91
+ value: security?.option3?.xApiKey,
92
+ },
93
+ {
94
+ fieldName: "Authorization",
95
+ type: "http:bearer",
96
+ value: security?.option3?.authorization,
97
+ },
98
+ ],
99
+ );
74
100
 
75
101
  const context = {
76
102
  operationID: "verify-otp",
@@ -78,7 +104,7 @@ export async function authVerifyOtp(
78
104
 
79
105
  resolvedSecurity: requestSecurity,
80
106
 
81
- securitySource: client._options.authorization,
107
+ securitySource: security,
82
108
  retryConfig: options?.retries
83
109
  || client._options.retryConfig
84
110
  || { strategy: "none" },
package/src/lib/config.ts CHANGED
@@ -74,7 +74,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
74
74
  export const SDK_METADATA = {
75
75
  language: "typescript",
76
76
  openapiDocVersion: "1.0",
77
- sdkVersion: "0.5.2",
78
- genVersion: "2.500.5",
79
- userAgent: "speakeasy-sdk/typescript 0.5.2 2.500.5 1.0 ce-storefront",
77
+ sdkVersion: "0.5.4",
78
+ genVersion: "2.502.0",
79
+ userAgent: "speakeasy-sdk/typescript 0.5.4 2.502.0 1.0 ce-storefront",
80
80
  } as const;
@@ -14,15 +14,15 @@ export type NotificationChannelPreferences = {
14
14
  /**
15
15
  * Indicates whether the user has opted to receive notifications via email.
16
16
  */
17
- email?: boolean | undefined;
17
+ email: boolean;
18
18
  /**
19
19
  * Indicates whether the user has opted to receive notifications via SMS.
20
20
  */
21
- sms?: boolean | undefined;
21
+ sms: boolean;
22
22
  /**
23
23
  * Indicates whether the user has opted to receive notifications via WhatsApp.
24
24
  */
25
- whatsapp?: boolean | undefined;
25
+ whatsapp: boolean;
26
26
  };
27
27
 
28
28
  /** @internal */
@@ -31,9 +31,9 @@ export const NotificationChannelPreferences$inboundSchema: z.ZodType<
31
31
  z.ZodTypeDef,
32
32
  unknown
33
33
  > = z.object({
34
- email: z.boolean().default(true),
35
- sms: z.boolean().default(true),
36
- whatsapp: z.boolean().default(true),
34
+ email: z.boolean(),
35
+ sms: z.boolean(),
36
+ whatsapp: z.boolean(),
37
37
  });
38
38
 
39
39
  /** @internal */
@@ -49,9 +49,9 @@ export const NotificationChannelPreferences$outboundSchema: z.ZodType<
49
49
  z.ZodTypeDef,
50
50
  NotificationChannelPreferences
51
51
  > = z.object({
52
- email: z.boolean().default(true),
53
- sms: z.boolean().default(true),
54
- whatsapp: z.boolean().default(true),
52
+ email: z.boolean(),
53
+ sms: z.boolean(),
54
+ whatsapp: z.boolean(),
55
55
  });
56
56
 
57
57
  /**
@@ -112,13 +112,13 @@ export const DeleteAddressResponseBody$inboundSchema: z.ZodType<
112
112
  unknown
113
113
  > = z.object({
114
114
  message: z.string().optional(),
115
- success: z.boolean().default(true),
115
+ success: z.boolean().optional(),
116
116
  });
117
117
 
118
118
  /** @internal */
119
119
  export type DeleteAddressResponseBody$Outbound = {
120
120
  message?: string | undefined;
121
- success: boolean;
121
+ success?: boolean | undefined;
122
122
  };
123
123
 
124
124
  /** @internal */
@@ -128,7 +128,7 @@ export const DeleteAddressResponseBody$outboundSchema: z.ZodType<
128
128
  DeleteAddressResponseBody
129
129
  > = z.object({
130
130
  message: z.string().optional(),
131
- success: z.boolean().default(true),
131
+ success: z.boolean().optional(),
132
132
  });
133
133
 
134
134
  /**
@@ -30,7 +30,7 @@ export type DeleteCartRequest = {
30
30
  */
31
31
  export type DeleteCartResponseBody = {
32
32
  message: string;
33
- success?: boolean | undefined;
33
+ success: boolean;
34
34
  };
35
35
 
36
36
  /** @internal */
@@ -94,7 +94,7 @@ export const DeleteCartResponseBody$inboundSchema: z.ZodType<
94
94
  unknown
95
95
  > = z.object({
96
96
  message: z.string(),
97
- success: z.boolean().default(true),
97
+ success: z.boolean(),
98
98
  });
99
99
 
100
100
  /** @internal */
@@ -110,7 +110,7 @@ export const DeleteCartResponseBody$outboundSchema: z.ZodType<
110
110
  DeleteCartResponseBody
111
111
  > = z.object({
112
112
  message: z.string(),
113
- success: z.boolean().default(true),
113
+ success: z.boolean(),
114
114
  });
115
115
 
116
116
  /**
@@ -31,7 +31,7 @@ export type DeleteUserCartRequest = {
31
31
  */
32
32
  export type DeleteUserCartResponseBody = {
33
33
  message: string;
34
- success?: boolean | undefined;
34
+ success: boolean;
35
35
  };
36
36
 
37
37
  /** @internal */
@@ -103,7 +103,7 @@ export const DeleteUserCartResponseBody$inboundSchema: z.ZodType<
103
103
  unknown
104
104
  > = z.object({
105
105
  message: z.string(),
106
- success: z.boolean().default(true),
106
+ success: z.boolean(),
107
107
  });
108
108
 
109
109
  /** @internal */
@@ -119,7 +119,7 @@ export const DeleteUserCartResponseBody$outboundSchema: z.ZodType<
119
119
  DeleteUserCartResponseBody
120
120
  > = z.object({
121
121
  message: z.string(),
122
- success: z.boolean().default(true),
122
+ success: z.boolean(),
123
123
  });
124
124
 
125
125
  /**
@@ -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);
@@ -38,7 +38,7 @@ export type GetCartContent = {
38
38
  */
39
39
  export type GetCartResponseBody = {
40
40
  message: string;
41
- success?: boolean | undefined;
41
+ success: boolean;
42
42
  content: GetCartContent;
43
43
  };
44
44
 
@@ -149,7 +149,7 @@ export const GetCartResponseBody$inboundSchema: z.ZodType<
149
149
  unknown
150
150
  > = z.object({
151
151
  message: z.string(),
152
- success: z.boolean().default(true),
152
+ success: z.boolean(),
153
153
  content: z.lazy(() => GetCartContent$inboundSchema),
154
154
  });
155
155
 
@@ -167,7 +167,7 @@ export const GetCartResponseBody$outboundSchema: z.ZodType<
167
167
  GetCartResponseBody
168
168
  > = z.object({
169
169
  message: z.string(),
170
- success: z.boolean().default(true),
170
+ success: z.boolean(),
171
171
  content: z.lazy(() => GetCartContent$outboundSchema),
172
172
  });
173
173
 
@@ -40,7 +40,7 @@ export type GetProductDetailContent = {
40
40
  */
41
41
  export type GetProductDetailResponseBody = {
42
42
  message: string;
43
- success?: boolean | undefined;
43
+ success: boolean;
44
44
  content: GetProductDetailContent;
45
45
  };
46
46
 
@@ -172,7 +172,7 @@ export const GetProductDetailResponseBody$inboundSchema: z.ZodType<
172
172
  unknown
173
173
  > = z.object({
174
174
  message: z.string(),
175
- success: z.boolean().default(true),
175
+ success: z.boolean(),
176
176
  content: z.lazy(() => GetProductDetailContent$inboundSchema),
177
177
  });
178
178
 
@@ -190,7 +190,7 @@ export const GetProductDetailResponseBody$outboundSchema: z.ZodType<
190
190
  GetProductDetailResponseBody
191
191
  > = z.object({
192
192
  message: z.string(),
193
- success: z.boolean().default(true),
193
+ success: z.boolean(),
194
194
  content: z.lazy(() => GetProductDetailContent$outboundSchema),
195
195
  });
196
196