ce-storefront 0.15.30 → 0.15.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -7
- package/docs/sdks/auth/README.md +32 -16
- package/esm/funcs/authGenerateOtp.d.ts +1 -1
- package/esm/funcs/authGenerateOtp.d.ts.map +1 -1
- package/esm/funcs/authGenerateOtp.js +7 -3
- 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 +7 -3
- 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 +7 -3
- 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 +7 -3
- package/esm/funcs/authLoginWithWhatsapp.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/url.js +1 -1
- package/esm/lib/url.js.map +1 -1
- package/esm/models/components/cartitem.d.ts +0 -5
- package/esm/models/components/cartitem.d.ts.map +1 -1
- package/esm/models/components/cartitem.js +0 -4
- package/esm/models/components/cartitem.js.map +1 -1
- package/esm/models/components/item.d.ts +0 -5
- package/esm/models/components/item.d.ts.map +1 -1
- package/esm/models/components/item.js +0 -4
- package/esm/models/components/item.js.map +1 -1
- package/esm/models/components/orderitem.d.ts +0 -2
- package/esm/models/components/orderitem.d.ts.map +1 -1
- package/esm/models/components/orderitem.js +0 -4
- package/esm/models/components/orderitem.js.map +1 -1
- package/esm/models/components/product.d.ts +0 -5
- package/esm/models/components/product.d.ts.map +1 -1
- package/esm/models/components/product.js +0 -4
- package/esm/models/components/product.js.map +1 -1
- package/esm/models/components/productbundleitem.d.ts +0 -5
- package/esm/models/components/productbundleitem.d.ts.map +1 -1
- package/esm/models/components/productbundleitem.js +0 -4
- package/esm/models/components/productbundleitem.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +0 -5
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +0 -4
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/variant.d.ts +0 -5
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +0 -4
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +0 -5
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +0 -4
- package/esm/models/components/variantdetail.js.map +1 -1
- package/esm/models/operations/generateotp.d.ts +30 -0
- package/esm/models/operations/generateotp.d.ts.map +1 -1
- package/esm/models/operations/generateotp.js +43 -0
- package/esm/models/operations/generateotp.js.map +1 -1
- package/esm/models/operations/loginwithemail.d.ts +30 -0
- package/esm/models/operations/loginwithemail.d.ts.map +1 -1
- package/esm/models/operations/loginwithemail.js +37 -0
- package/esm/models/operations/loginwithemail.js.map +1 -1
- package/esm/models/operations/loginwithphone.d.ts +30 -0
- package/esm/models/operations/loginwithphone.d.ts.map +1 -1
- package/esm/models/operations/loginwithphone.js +37 -0
- package/esm/models/operations/loginwithphone.js.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.d.ts +30 -0
- package/esm/models/operations/loginwithwhatsapp.d.ts.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.js +37 -0
- package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
- package/esm/sdk/auth.d.ts +4 -4
- package/esm/sdk/auth.d.ts.map +1 -1
- package/esm/sdk/auth.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/authGenerateOtp.ts +9 -5
- package/src/funcs/authLoginWithEmail.ts +9 -5
- package/src/funcs/authLoginWithPhone.ts +9 -5
- package/src/funcs/authLoginWithWhatsapp.ts +9 -6
- package/src/lib/config.ts +3 -3
- package/src/lib/url.ts +1 -1
- package/src/models/components/cartitem.ts +0 -9
- package/src/models/components/item.ts +0 -9
- package/src/models/components/orderitem.ts +0 -6
- package/src/models/components/product.ts +0 -9
- package/src/models/components/productbundleitem.ts +0 -9
- package/src/models/components/productdetail.ts +0 -9
- package/src/models/components/variant.ts +0 -9
- package/src/models/components/variantdetail.ts +0 -9
- package/src/models/operations/generateotp.ts +85 -0
- package/src/models/operations/loginwithemail.ts +75 -0
- package/src/models/operations/loginwithphone.ts +75 -0
- package/src/models/operations/loginwithwhatsapp.ts +75 -0
- package/src/sdk/auth.ts +4 -4
|
@@ -76,10 +76,6 @@ export type Variant = {
|
|
|
76
76
|
* Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
|
|
77
77
|
*/
|
|
78
78
|
backorder?: boolean | undefined;
|
|
79
|
-
/**
|
|
80
|
-
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
81
|
-
*/
|
|
82
|
-
onOffer: boolean;
|
|
83
79
|
onPromotion: boolean;
|
|
84
80
|
onSubscription: boolean;
|
|
85
81
|
/**
|
|
@@ -110,7 +106,6 @@ export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
|
|
|
110
106
|
active: z.boolean(),
|
|
111
107
|
stock_available: z.boolean(),
|
|
112
108
|
backorder: z.boolean().optional(),
|
|
113
|
-
on_offer: z.boolean(),
|
|
114
109
|
on_promotion: z.boolean(),
|
|
115
110
|
on_subscription: z.boolean(),
|
|
116
111
|
is_default: z.boolean(),
|
|
@@ -126,7 +121,6 @@ export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
|
|
|
126
121
|
"product_name": "productName",
|
|
127
122
|
"short_description": "shortDescription",
|
|
128
123
|
"stock_available": "stockAvailable",
|
|
129
|
-
"on_offer": "onOffer",
|
|
130
124
|
"on_promotion": "onPromotion",
|
|
131
125
|
"on_subscription": "onSubscription",
|
|
132
126
|
"is_default": "isDefault",
|
|
@@ -146,7 +140,6 @@ export type Variant$Outbound = {
|
|
|
146
140
|
active: boolean;
|
|
147
141
|
stock_available: boolean;
|
|
148
142
|
backorder?: boolean | undefined;
|
|
149
|
-
on_offer: boolean;
|
|
150
143
|
on_promotion: boolean;
|
|
151
144
|
on_subscription: boolean;
|
|
152
145
|
is_default: boolean;
|
|
@@ -174,7 +167,6 @@ export const Variant$outboundSchema: z.ZodType<
|
|
|
174
167
|
active: z.boolean(),
|
|
175
168
|
stockAvailable: z.boolean(),
|
|
176
169
|
backorder: z.boolean().optional(),
|
|
177
|
-
onOffer: z.boolean(),
|
|
178
170
|
onPromotion: z.boolean(),
|
|
179
171
|
onSubscription: z.boolean(),
|
|
180
172
|
isDefault: z.boolean(),
|
|
@@ -190,7 +182,6 @@ export const Variant$outboundSchema: z.ZodType<
|
|
|
190
182
|
productName: "product_name",
|
|
191
183
|
shortDescription: "short_description",
|
|
192
184
|
stockAvailable: "stock_available",
|
|
193
|
-
onOffer: "on_offer",
|
|
194
185
|
onPromotion: "on_promotion",
|
|
195
186
|
onSubscription: "on_subscription",
|
|
196
187
|
isDefault: "is_default",
|
|
@@ -116,10 +116,6 @@ export type VariantDetail = {
|
|
|
116
116
|
* Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
|
|
117
117
|
*/
|
|
118
118
|
backorder?: boolean | undefined;
|
|
119
|
-
/**
|
|
120
|
-
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
121
|
-
*/
|
|
122
|
-
onOffer: boolean;
|
|
123
119
|
onPromotion: boolean;
|
|
124
120
|
onSubscription: boolean;
|
|
125
121
|
/**
|
|
@@ -188,7 +184,6 @@ export const VariantDetail$inboundSchema: z.ZodType<
|
|
|
188
184
|
active: z.boolean(),
|
|
189
185
|
stock_available: z.boolean(),
|
|
190
186
|
backorder: z.boolean().optional(),
|
|
191
|
-
on_offer: z.boolean(),
|
|
192
187
|
on_promotion: z.boolean(),
|
|
193
188
|
on_subscription: z.boolean(),
|
|
194
189
|
is_default: z.boolean(),
|
|
@@ -218,7 +213,6 @@ export const VariantDetail$inboundSchema: z.ZodType<
|
|
|
218
213
|
"product_name": "productName",
|
|
219
214
|
"short_description": "shortDescription",
|
|
220
215
|
"stock_available": "stockAvailable",
|
|
221
|
-
"on_offer": "onOffer",
|
|
222
216
|
"on_promotion": "onPromotion",
|
|
223
217
|
"on_subscription": "onSubscription",
|
|
224
218
|
"is_default": "isDefault",
|
|
@@ -246,7 +240,6 @@ export type VariantDetail$Outbound = {
|
|
|
246
240
|
active: boolean;
|
|
247
241
|
stock_available: boolean;
|
|
248
242
|
backorder?: boolean | undefined;
|
|
249
|
-
on_offer: boolean;
|
|
250
243
|
on_promotion: boolean;
|
|
251
244
|
on_subscription: boolean;
|
|
252
245
|
is_default: boolean;
|
|
@@ -288,7 +281,6 @@ export const VariantDetail$outboundSchema: z.ZodType<
|
|
|
288
281
|
active: z.boolean(),
|
|
289
282
|
stockAvailable: z.boolean(),
|
|
290
283
|
backorder: z.boolean().optional(),
|
|
291
|
-
onOffer: z.boolean(),
|
|
292
284
|
onPromotion: z.boolean(),
|
|
293
285
|
onSubscription: z.boolean(),
|
|
294
286
|
isDefault: z.boolean(),
|
|
@@ -318,7 +310,6 @@ export const VariantDetail$outboundSchema: z.ZodType<
|
|
|
318
310
|
productName: "product_name",
|
|
319
311
|
shortDescription: "short_description",
|
|
320
312
|
stockAvailable: "stock_available",
|
|
321
|
-
onOffer: "on_offer",
|
|
322
313
|
onPromotion: "on_promotion",
|
|
323
314
|
onSubscription: "on_subscription",
|
|
324
315
|
isDefault: "is_default",
|
|
@@ -13,6 +13,16 @@ export type GenerateOtpRequestBody =
|
|
|
13
13
|
| components.GenerateOtpWithPhone
|
|
14
14
|
| components.GenerateOtpWithEmail;
|
|
15
15
|
|
|
16
|
+
export type GenerateOtpRequest = {
|
|
17
|
+
/**
|
|
18
|
+
* This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes.
|
|
19
|
+
*/
|
|
20
|
+
xDebugMode?: boolean | undefined;
|
|
21
|
+
requestBody:
|
|
22
|
+
| components.GenerateOtpWithPhone
|
|
23
|
+
| components.GenerateOtpWithEmail;
|
|
24
|
+
};
|
|
25
|
+
|
|
16
26
|
/**
|
|
17
27
|
* An object containing the response content.
|
|
18
28
|
*/
|
|
@@ -101,6 +111,81 @@ export function generateOtpRequestBodyFromJSON(
|
|
|
101
111
|
);
|
|
102
112
|
}
|
|
103
113
|
|
|
114
|
+
/** @internal */
|
|
115
|
+
export const GenerateOtpRequest$inboundSchema: z.ZodType<
|
|
116
|
+
GenerateOtpRequest,
|
|
117
|
+
z.ZodTypeDef,
|
|
118
|
+
unknown
|
|
119
|
+
> = z.object({
|
|
120
|
+
"x-debug-mode": z.boolean().optional(),
|
|
121
|
+
RequestBody: z.union([
|
|
122
|
+
components.GenerateOtpWithPhone$inboundSchema,
|
|
123
|
+
components.GenerateOtpWithEmail$inboundSchema,
|
|
124
|
+
]),
|
|
125
|
+
}).transform((v) => {
|
|
126
|
+
return remap$(v, {
|
|
127
|
+
"x-debug-mode": "xDebugMode",
|
|
128
|
+
"RequestBody": "requestBody",
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
/** @internal */
|
|
133
|
+
export type GenerateOtpRequest$Outbound = {
|
|
134
|
+
"x-debug-mode"?: boolean | undefined;
|
|
135
|
+
RequestBody:
|
|
136
|
+
| components.GenerateOtpWithPhone$Outbound
|
|
137
|
+
| components.GenerateOtpWithEmail$Outbound;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const GenerateOtpRequest$outboundSchema: z.ZodType<
|
|
142
|
+
GenerateOtpRequest$Outbound,
|
|
143
|
+
z.ZodTypeDef,
|
|
144
|
+
GenerateOtpRequest
|
|
145
|
+
> = z.object({
|
|
146
|
+
xDebugMode: z.boolean().optional(),
|
|
147
|
+
requestBody: z.union([
|
|
148
|
+
components.GenerateOtpWithPhone$outboundSchema,
|
|
149
|
+
components.GenerateOtpWithEmail$outboundSchema,
|
|
150
|
+
]),
|
|
151
|
+
}).transform((v) => {
|
|
152
|
+
return remap$(v, {
|
|
153
|
+
xDebugMode: "x-debug-mode",
|
|
154
|
+
requestBody: "RequestBody",
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
161
|
+
*/
|
|
162
|
+
export namespace GenerateOtpRequest$ {
|
|
163
|
+
/** @deprecated use `GenerateOtpRequest$inboundSchema` instead. */
|
|
164
|
+
export const inboundSchema = GenerateOtpRequest$inboundSchema;
|
|
165
|
+
/** @deprecated use `GenerateOtpRequest$outboundSchema` instead. */
|
|
166
|
+
export const outboundSchema = GenerateOtpRequest$outboundSchema;
|
|
167
|
+
/** @deprecated use `GenerateOtpRequest$Outbound` instead. */
|
|
168
|
+
export type Outbound = GenerateOtpRequest$Outbound;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function generateOtpRequestToJSON(
|
|
172
|
+
generateOtpRequest: GenerateOtpRequest,
|
|
173
|
+
): string {
|
|
174
|
+
return JSON.stringify(
|
|
175
|
+
GenerateOtpRequest$outboundSchema.parse(generateOtpRequest),
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function generateOtpRequestFromJSON(
|
|
180
|
+
jsonString: string,
|
|
181
|
+
): SafeParseResult<GenerateOtpRequest, SDKValidationError> {
|
|
182
|
+
return safeParse(
|
|
183
|
+
jsonString,
|
|
184
|
+
(x) => GenerateOtpRequest$inboundSchema.parse(JSON.parse(x)),
|
|
185
|
+
`Failed to parse 'GenerateOtpRequest' from JSON`,
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
104
189
|
/** @internal */
|
|
105
190
|
export const GenerateOtpContent$inboundSchema: z.ZodType<
|
|
106
191
|
GenerateOtpContent,
|
|
@@ -23,6 +23,14 @@ export type LoginWithEmailRequestBody = {
|
|
|
23
23
|
registerIfNotExists?: boolean | undefined;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
export type LoginWithEmailRequest = {
|
|
27
|
+
/**
|
|
28
|
+
* This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes.
|
|
29
|
+
*/
|
|
30
|
+
xDebugMode?: boolean | undefined;
|
|
31
|
+
requestBody: LoginWithEmailRequestBody;
|
|
32
|
+
};
|
|
33
|
+
|
|
26
34
|
/**
|
|
27
35
|
* An object containing the response content.
|
|
28
36
|
*/
|
|
@@ -120,6 +128,73 @@ export function loginWithEmailRequestBodyFromJSON(
|
|
|
120
128
|
);
|
|
121
129
|
}
|
|
122
130
|
|
|
131
|
+
/** @internal */
|
|
132
|
+
export const LoginWithEmailRequest$inboundSchema: z.ZodType<
|
|
133
|
+
LoginWithEmailRequest,
|
|
134
|
+
z.ZodTypeDef,
|
|
135
|
+
unknown
|
|
136
|
+
> = z.object({
|
|
137
|
+
"x-debug-mode": z.boolean().optional(),
|
|
138
|
+
RequestBody: z.lazy(() => LoginWithEmailRequestBody$inboundSchema),
|
|
139
|
+
}).transform((v) => {
|
|
140
|
+
return remap$(v, {
|
|
141
|
+
"x-debug-mode": "xDebugMode",
|
|
142
|
+
"RequestBody": "requestBody",
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
/** @internal */
|
|
147
|
+
export type LoginWithEmailRequest$Outbound = {
|
|
148
|
+
"x-debug-mode"?: boolean | undefined;
|
|
149
|
+
RequestBody: LoginWithEmailRequestBody$Outbound;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/** @internal */
|
|
153
|
+
export const LoginWithEmailRequest$outboundSchema: z.ZodType<
|
|
154
|
+
LoginWithEmailRequest$Outbound,
|
|
155
|
+
z.ZodTypeDef,
|
|
156
|
+
LoginWithEmailRequest
|
|
157
|
+
> = z.object({
|
|
158
|
+
xDebugMode: z.boolean().optional(),
|
|
159
|
+
requestBody: z.lazy(() => LoginWithEmailRequestBody$outboundSchema),
|
|
160
|
+
}).transform((v) => {
|
|
161
|
+
return remap$(v, {
|
|
162
|
+
xDebugMode: "x-debug-mode",
|
|
163
|
+
requestBody: "RequestBody",
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @internal
|
|
169
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
170
|
+
*/
|
|
171
|
+
export namespace LoginWithEmailRequest$ {
|
|
172
|
+
/** @deprecated use `LoginWithEmailRequest$inboundSchema` instead. */
|
|
173
|
+
export const inboundSchema = LoginWithEmailRequest$inboundSchema;
|
|
174
|
+
/** @deprecated use `LoginWithEmailRequest$outboundSchema` instead. */
|
|
175
|
+
export const outboundSchema = LoginWithEmailRequest$outboundSchema;
|
|
176
|
+
/** @deprecated use `LoginWithEmailRequest$Outbound` instead. */
|
|
177
|
+
export type Outbound = LoginWithEmailRequest$Outbound;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function loginWithEmailRequestToJSON(
|
|
181
|
+
loginWithEmailRequest: LoginWithEmailRequest,
|
|
182
|
+
): string {
|
|
183
|
+
return JSON.stringify(
|
|
184
|
+
LoginWithEmailRequest$outboundSchema.parse(loginWithEmailRequest),
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function loginWithEmailRequestFromJSON(
|
|
189
|
+
jsonString: string,
|
|
190
|
+
): SafeParseResult<LoginWithEmailRequest, SDKValidationError> {
|
|
191
|
+
return safeParse(
|
|
192
|
+
jsonString,
|
|
193
|
+
(x) => LoginWithEmailRequest$inboundSchema.parse(JSON.parse(x)),
|
|
194
|
+
`Failed to parse 'LoginWithEmailRequest' from JSON`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
123
198
|
/** @internal */
|
|
124
199
|
export const LoginWithEmailContent$inboundSchema: z.ZodType<
|
|
125
200
|
LoginWithEmailContent,
|
|
@@ -27,6 +27,14 @@ export type LoginWithPhoneRequestBody = {
|
|
|
27
27
|
registerIfNotExists?: boolean | undefined;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
export type LoginWithPhoneRequest = {
|
|
31
|
+
/**
|
|
32
|
+
* This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes.
|
|
33
|
+
*/
|
|
34
|
+
xDebugMode?: boolean | undefined;
|
|
35
|
+
requestBody: LoginWithPhoneRequestBody;
|
|
36
|
+
};
|
|
37
|
+
|
|
30
38
|
/**
|
|
31
39
|
* An object containing the response content.
|
|
32
40
|
*/
|
|
@@ -129,6 +137,73 @@ export function loginWithPhoneRequestBodyFromJSON(
|
|
|
129
137
|
);
|
|
130
138
|
}
|
|
131
139
|
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const LoginWithPhoneRequest$inboundSchema: z.ZodType<
|
|
142
|
+
LoginWithPhoneRequest,
|
|
143
|
+
z.ZodTypeDef,
|
|
144
|
+
unknown
|
|
145
|
+
> = z.object({
|
|
146
|
+
"x-debug-mode": z.boolean().optional(),
|
|
147
|
+
RequestBody: z.lazy(() => LoginWithPhoneRequestBody$inboundSchema),
|
|
148
|
+
}).transform((v) => {
|
|
149
|
+
return remap$(v, {
|
|
150
|
+
"x-debug-mode": "xDebugMode",
|
|
151
|
+
"RequestBody": "requestBody",
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
/** @internal */
|
|
156
|
+
export type LoginWithPhoneRequest$Outbound = {
|
|
157
|
+
"x-debug-mode"?: boolean | undefined;
|
|
158
|
+
RequestBody: LoginWithPhoneRequestBody$Outbound;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/** @internal */
|
|
162
|
+
export const LoginWithPhoneRequest$outboundSchema: z.ZodType<
|
|
163
|
+
LoginWithPhoneRequest$Outbound,
|
|
164
|
+
z.ZodTypeDef,
|
|
165
|
+
LoginWithPhoneRequest
|
|
166
|
+
> = z.object({
|
|
167
|
+
xDebugMode: z.boolean().optional(),
|
|
168
|
+
requestBody: z.lazy(() => LoginWithPhoneRequestBody$outboundSchema),
|
|
169
|
+
}).transform((v) => {
|
|
170
|
+
return remap$(v, {
|
|
171
|
+
xDebugMode: "x-debug-mode",
|
|
172
|
+
requestBody: "RequestBody",
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @internal
|
|
178
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
179
|
+
*/
|
|
180
|
+
export namespace LoginWithPhoneRequest$ {
|
|
181
|
+
/** @deprecated use `LoginWithPhoneRequest$inboundSchema` instead. */
|
|
182
|
+
export const inboundSchema = LoginWithPhoneRequest$inboundSchema;
|
|
183
|
+
/** @deprecated use `LoginWithPhoneRequest$outboundSchema` instead. */
|
|
184
|
+
export const outboundSchema = LoginWithPhoneRequest$outboundSchema;
|
|
185
|
+
/** @deprecated use `LoginWithPhoneRequest$Outbound` instead. */
|
|
186
|
+
export type Outbound = LoginWithPhoneRequest$Outbound;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function loginWithPhoneRequestToJSON(
|
|
190
|
+
loginWithPhoneRequest: LoginWithPhoneRequest,
|
|
191
|
+
): string {
|
|
192
|
+
return JSON.stringify(
|
|
193
|
+
LoginWithPhoneRequest$outboundSchema.parse(loginWithPhoneRequest),
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function loginWithPhoneRequestFromJSON(
|
|
198
|
+
jsonString: string,
|
|
199
|
+
): SafeParseResult<LoginWithPhoneRequest, SDKValidationError> {
|
|
200
|
+
return safeParse(
|
|
201
|
+
jsonString,
|
|
202
|
+
(x) => LoginWithPhoneRequest$inboundSchema.parse(JSON.parse(x)),
|
|
203
|
+
`Failed to parse 'LoginWithPhoneRequest' from JSON`,
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
132
207
|
/** @internal */
|
|
133
208
|
export const LoginWithPhoneContent$inboundSchema: z.ZodType<
|
|
134
209
|
LoginWithPhoneContent,
|
|
@@ -27,6 +27,14 @@ export type LoginWithWhatsappRequestBody = {
|
|
|
27
27
|
registerIfNotExists?: boolean | undefined;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
export type LoginWithWhatsappRequest = {
|
|
31
|
+
/**
|
|
32
|
+
* This param is used to enable debug mode. If debug mode is enabled, the API will return OTP as well. This is only for development and testing purposes.
|
|
33
|
+
*/
|
|
34
|
+
xDebugMode?: boolean | undefined;
|
|
35
|
+
requestBody: LoginWithWhatsappRequestBody;
|
|
36
|
+
};
|
|
37
|
+
|
|
30
38
|
/**
|
|
31
39
|
* An object containing the response content.
|
|
32
40
|
*/
|
|
@@ -131,6 +139,73 @@ export function loginWithWhatsappRequestBodyFromJSON(
|
|
|
131
139
|
);
|
|
132
140
|
}
|
|
133
141
|
|
|
142
|
+
/** @internal */
|
|
143
|
+
export const LoginWithWhatsappRequest$inboundSchema: z.ZodType<
|
|
144
|
+
LoginWithWhatsappRequest,
|
|
145
|
+
z.ZodTypeDef,
|
|
146
|
+
unknown
|
|
147
|
+
> = z.object({
|
|
148
|
+
"x-debug-mode": z.boolean().optional(),
|
|
149
|
+
RequestBody: z.lazy(() => LoginWithWhatsappRequestBody$inboundSchema),
|
|
150
|
+
}).transform((v) => {
|
|
151
|
+
return remap$(v, {
|
|
152
|
+
"x-debug-mode": "xDebugMode",
|
|
153
|
+
"RequestBody": "requestBody",
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
/** @internal */
|
|
158
|
+
export type LoginWithWhatsappRequest$Outbound = {
|
|
159
|
+
"x-debug-mode"?: boolean | undefined;
|
|
160
|
+
RequestBody: LoginWithWhatsappRequestBody$Outbound;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/** @internal */
|
|
164
|
+
export const LoginWithWhatsappRequest$outboundSchema: z.ZodType<
|
|
165
|
+
LoginWithWhatsappRequest$Outbound,
|
|
166
|
+
z.ZodTypeDef,
|
|
167
|
+
LoginWithWhatsappRequest
|
|
168
|
+
> = z.object({
|
|
169
|
+
xDebugMode: z.boolean().optional(),
|
|
170
|
+
requestBody: z.lazy(() => LoginWithWhatsappRequestBody$outboundSchema),
|
|
171
|
+
}).transform((v) => {
|
|
172
|
+
return remap$(v, {
|
|
173
|
+
xDebugMode: "x-debug-mode",
|
|
174
|
+
requestBody: "RequestBody",
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @internal
|
|
180
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
181
|
+
*/
|
|
182
|
+
export namespace LoginWithWhatsappRequest$ {
|
|
183
|
+
/** @deprecated use `LoginWithWhatsappRequest$inboundSchema` instead. */
|
|
184
|
+
export const inboundSchema = LoginWithWhatsappRequest$inboundSchema;
|
|
185
|
+
/** @deprecated use `LoginWithWhatsappRequest$outboundSchema` instead. */
|
|
186
|
+
export const outboundSchema = LoginWithWhatsappRequest$outboundSchema;
|
|
187
|
+
/** @deprecated use `LoginWithWhatsappRequest$Outbound` instead. */
|
|
188
|
+
export type Outbound = LoginWithWhatsappRequest$Outbound;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function loginWithWhatsappRequestToJSON(
|
|
192
|
+
loginWithWhatsappRequest: LoginWithWhatsappRequest,
|
|
193
|
+
): string {
|
|
194
|
+
return JSON.stringify(
|
|
195
|
+
LoginWithWhatsappRequest$outboundSchema.parse(loginWithWhatsappRequest),
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function loginWithWhatsappRequestFromJSON(
|
|
200
|
+
jsonString: string,
|
|
201
|
+
): SafeParseResult<LoginWithWhatsappRequest, SDKValidationError> {
|
|
202
|
+
return safeParse(
|
|
203
|
+
jsonString,
|
|
204
|
+
(x) => LoginWithWhatsappRequest$inboundSchema.parse(JSON.parse(x)),
|
|
205
|
+
`Failed to parse 'LoginWithWhatsappRequest' from JSON`,
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
134
209
|
/** @internal */
|
|
135
210
|
export const LoginWithWhatsappContent$inboundSchema: z.ZodType<
|
|
136
211
|
LoginWithWhatsappContent,
|
package/src/sdk/auth.ts
CHANGED
|
@@ -46,7 +46,7 @@ export class Auth extends ClientSDK {
|
|
|
46
46
|
* @see {@link https://llm-docs.commercengine.io/operations/generate-otp} - API reference for the generate-otp operation
|
|
47
47
|
*/
|
|
48
48
|
async generateOtp(
|
|
49
|
-
request: operations.
|
|
49
|
+
request: operations.GenerateOtpRequest,
|
|
50
50
|
options?: RequestOptions,
|
|
51
51
|
): Promise<operations.GenerateOtpResponseBody> {
|
|
52
52
|
return unwrapAsync(authGenerateOtp(
|
|
@@ -65,7 +65,7 @@ export class Auth extends ClientSDK {
|
|
|
65
65
|
* @see {@link https://llm-docs.commercengine.io/operations/login-with-email} - API reference for the login-with-email operation
|
|
66
66
|
*/
|
|
67
67
|
async loginWithEmail(
|
|
68
|
-
request: operations.
|
|
68
|
+
request: operations.LoginWithEmailRequest,
|
|
69
69
|
options?: RequestOptions,
|
|
70
70
|
): Promise<operations.LoginWithEmailResponseBody> {
|
|
71
71
|
return unwrapAsync(authLoginWithEmail(
|
|
@@ -84,7 +84,7 @@ export class Auth extends ClientSDK {
|
|
|
84
84
|
* @see {@link https://llm-docs.commercengine.io/operations/login-with-phone} - API reference for the login-with-phone operation
|
|
85
85
|
*/
|
|
86
86
|
async loginWithPhone(
|
|
87
|
-
request: operations.
|
|
87
|
+
request: operations.LoginWithPhoneRequest,
|
|
88
88
|
options?: RequestOptions,
|
|
89
89
|
): Promise<operations.LoginWithPhoneResponseBody> {
|
|
90
90
|
return unwrapAsync(authLoginWithPhone(
|
|
@@ -103,7 +103,7 @@ export class Auth extends ClientSDK {
|
|
|
103
103
|
* @see {@link https://llm-docs.commercengine.io/operations/login-with-whatsapp} - API reference for the login-with-whatsapp operation
|
|
104
104
|
*/
|
|
105
105
|
async loginWithWhatsapp(
|
|
106
|
-
request: operations.
|
|
106
|
+
request: operations.LoginWithWhatsappRequest,
|
|
107
107
|
options?: RequestOptions,
|
|
108
108
|
): Promise<operations.LoginWithWhatsappResponseBody> {
|
|
109
109
|
return unwrapAsync(authLoginWithWhatsapp(
|