ce-storefront 0.3.9 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/sdks/auth/README.md +2 -0
- package/docs/sdks/carts/README.md +22 -12
- package/docs/sdks/cestorefrontuser/README.md +30 -2
- package/docs/sdks/checkout/README.md +4 -0
- package/esm/funcs/cartsAddItem.js +1 -1
- package/esm/funcs/cartsAddItem.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/config.js.map +1 -1
- package/esm/models/components/anonymoususer.d.ts +14 -14
- package/esm/models/components/anonymoususer.d.ts.map +1 -1
- package/esm/models/components/anonymoususer.js +14 -14
- package/esm/models/components/anonymoususer.js.map +1 -1
- package/esm/models/components/associatedoption.d.ts +4 -102
- package/esm/models/components/associatedoption.d.ts.map +1 -1
- package/esm/models/components/associatedoption.js +4 -82
- package/esm/models/components/associatedoption.js.map +1 -1
- package/esm/models/components/bundleproduct.d.ts +48 -48
- package/esm/models/components/bundleproduct.d.ts.map +1 -1
- package/esm/models/components/bundleproduct.js +46 -50
- package/esm/models/components/bundleproduct.js.map +1 -1
- package/esm/models/components/bundleproductdetail.d.ts +66 -66
- package/esm/models/components/bundleproductdetail.d.ts.map +1 -1
- package/esm/models/components/bundleproductdetail.js +62 -66
- package/esm/models/components/bundleproductdetail.js.map +1 -1
- package/esm/models/components/coloroption.d.ts +72 -0
- package/esm/models/components/coloroption.d.ts.map +1 -0
- package/esm/models/components/coloroption.js +62 -0
- package/esm/models/components/coloroption.js.map +1 -0
- package/esm/models/components/currency.d.ts +6 -6
- package/esm/models/components/currency.d.ts.map +1 -1
- package/esm/models/components/currency.js +6 -6
- package/esm/models/components/currency.js.map +1 -1
- package/esm/models/components/index.d.ts +3 -1
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +3 -1
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/notificationpreferences.d.ts +6 -6
- package/esm/models/components/notificationpreferences.d.ts.map +1 -1
- package/esm/models/components/notificationpreferences.js +6 -6
- package/esm/models/components/notificationpreferences.js.map +1 -1
- package/esm/models/components/pagination.d.ts +8 -8
- package/esm/models/components/pagination.d.ts.map +1 -1
- package/esm/models/components/pagination.js +8 -8
- package/esm/models/components/pagination.js.map +1 -1
- package/esm/models/components/productattribute.d.ts +2 -2
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +2 -2
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/productcategory.d.ts +20 -20
- package/esm/models/components/productcategory.d.ts.map +1 -1
- package/esm/models/components/productcategory.js +20 -20
- package/esm/models/components/productcategory.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +2 -14
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +4 -18
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productimage.d.ts +14 -14
- package/esm/models/components/productimage.d.ts.map +1 -1
- package/esm/models/components/productimage.js +14 -14
- package/esm/models/components/productimage.js.map +1 -1
- package/esm/models/components/productpricing.d.ts +4 -4
- package/esm/models/components/productpricing.d.ts.map +1 -1
- package/esm/models/components/productpricing.js +4 -4
- package/esm/models/components/productpricing.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +12 -12
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +12 -12
- package/esm/models/components/productshipping.js.map +1 -1
- package/esm/models/components/productvideo.d.ts +16 -16
- package/esm/models/components/productvideo.d.ts.map +1 -1
- package/esm/models/components/productvideo.js +16 -16
- package/esm/models/components/productvideo.js.map +1 -1
- package/esm/models/components/seo.d.ts +8 -8
- package/esm/models/components/seo.d.ts.map +1 -1
- package/esm/models/components/seo.js +8 -8
- package/esm/models/components/seo.js.map +1 -1
- package/esm/models/components/singleproduct.d.ts +18 -18
- package/esm/models/components/singleproduct.d.ts.map +1 -1
- package/esm/models/components/singleproduct.js +18 -18
- package/esm/models/components/singleproduct.js.map +1 -1
- package/esm/models/components/singleproductdetail.d.ts +36 -36
- package/esm/models/components/singleproductdetail.d.ts.map +1 -1
- package/esm/models/components/singleproductdetail.js +34 -34
- package/esm/models/components/singleproductdetail.js.map +1 -1
- package/esm/models/components/singleselectoption.d.ts +42 -0
- package/esm/models/components/singleselectoption.d.ts.map +1 -0
- package/esm/models/components/singleselectoption.js +35 -0
- package/esm/models/components/singleselectoption.js.map +1 -0
- package/esm/models/components/sku.d.ts +30 -30
- package/esm/models/components/sku.d.ts.map +1 -1
- package/esm/models/components/sku.js +28 -30
- package/esm/models/components/sku.js.map +1 -1
- package/esm/models/components/updatecartitem.d.ts +45 -0
- package/esm/models/components/updatecartitem.d.ts.map +1 -0
- package/esm/models/components/updatecartitem.js +46 -0
- package/esm/models/components/updatecartitem.js.map +1 -0
- package/esm/models/components/user.d.ts +116 -26
- package/esm/models/components/user.d.ts.map +1 -1
- package/esm/models/components/user.js +104 -30
- package/esm/models/components/user.js.map +1 -1
- package/esm/models/components/variant.d.ts +15 -12
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +12 -12
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +41 -38
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +36 -36
- package/esm/models/components/variantdetail.js.map +1 -1
- package/esm/models/components/variantoption.d.ts +34 -26
- package/esm/models/components/variantoption.d.ts.map +1 -1
- package/esm/models/components/variantoption.js +32 -45
- package/esm/models/components/variantoption.js.map +1 -1
- package/esm/models/operations/getcrosssell.d.ts +6 -6
- package/esm/models/operations/getcrosssell.d.ts.map +1 -1
- package/esm/models/operations/getcrosssell.js +6 -6
- package/esm/models/operations/getcrosssell.js.map +1 -1
- package/esm/models/operations/getproductscategories.d.ts +4 -4
- package/esm/models/operations/getproductscategories.d.ts.map +1 -1
- package/esm/models/operations/getproductscategories.js +4 -4
- package/esm/models/operations/getproductscategories.js.map +1 -1
- package/esm/models/operations/getproductsidreviews.d.ts +4 -4
- package/esm/models/operations/getproductsidreviews.d.ts.map +1 -1
- package/esm/models/operations/getproductsidreviews.js +4 -4
- package/esm/models/operations/getproductsidreviews.js.map +1 -1
- package/esm/models/operations/getsimilar.d.ts +6 -6
- package/esm/models/operations/getsimilar.d.ts.map +1 -1
- package/esm/models/operations/getsimilar.js +6 -6
- package/esm/models/operations/getsimilar.js.map +1 -1
- package/esm/models/operations/getskus.d.ts +4 -4
- package/esm/models/operations/getskus.d.ts.map +1 -1
- package/esm/models/operations/getskus.js +4 -4
- package/esm/models/operations/getskus.js.map +1 -1
- package/esm/models/operations/getupsell.d.ts +6 -6
- package/esm/models/operations/getupsell.d.ts.map +1 -1
- package/esm/models/operations/getupsell.js +6 -6
- package/esm/models/operations/getupsell.js.map +1 -1
- package/esm/models/operations/postauthanonymous.d.ts +12 -12
- package/esm/models/operations/postauthanonymous.d.ts.map +1 -1
- package/esm/models/operations/postauthanonymous.js +12 -12
- package/esm/models/operations/postauthanonymous.js.map +1 -1
- package/esm/models/operations/postauthgenerateotp.d.ts +2 -2
- package/esm/models/operations/postauthgenerateotp.d.ts.map +1 -1
- package/esm/models/operations/postauthgenerateotp.js +2 -2
- package/esm/models/operations/postauthgenerateotp.js.map +1 -1
- package/esm/models/operations/postcartaddress.d.ts +8 -8
- package/esm/models/operations/postcartaddress.d.ts.map +1 -1
- package/esm/models/operations/postcartaddress.js +8 -12
- package/esm/models/operations/postcartaddress.js.map +1 -1
- package/esm/models/operations/postcartitemid.d.ts +2 -35
- package/esm/models/operations/postcartitemid.d.ts.map +1 -1
- package/esm/models/operations/postcartitemid.js +4 -49
- package/esm/models/operations/postcartitemid.js.map +1 -1
- package/esm/models/operations/postcartsid.d.ts +5 -31
- package/esm/models/operations/postcartsid.d.ts.map +1 -1
- package/esm/models/operations/postcartsid.js +2 -41
- package/esm/models/operations/postcartsid.js.map +1 -1
- package/esm/models/operations/postproductsidreviews.d.ts +4 -4
- package/esm/models/operations/postproductsidreviews.d.ts.map +1 -1
- package/esm/models/operations/postproductsidreviews.js +4 -4
- package/esm/models/operations/postproductsidreviews.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/cartsAddItem.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/anonymoususer.ts +28 -28
- package/src/models/components/associatedoption.ts +19 -164
- package/src/models/components/bundleproduct.ts +92 -99
- package/src/models/components/bundleproductdetail.ts +124 -131
- package/src/models/components/coloroption.ts +144 -0
- package/src/models/components/currency.ts +12 -12
- package/src/models/components/index.ts +3 -1
- package/src/models/components/notificationpreferences.ts +12 -12
- package/src/models/components/pagination.ts +16 -16
- package/src/models/components/productattribute.ts +4 -4
- package/src/models/components/productcategory.ts +40 -40
- package/src/models/components/productdetail.ts +7 -37
- package/src/models/components/productimage.ts +28 -28
- package/src/models/components/productpricing.ts +8 -8
- package/src/models/components/productshipping.ts +24 -24
- package/src/models/components/productvideo.ts +32 -32
- package/src/models/components/seo.ts +16 -16
- package/src/models/components/singleproduct.ts +36 -36
- package/src/models/components/singleproductdetail.ts +68 -68
- package/src/models/components/singleselectoption.ts +83 -0
- package/src/models/components/sku.ts +56 -61
- package/src/models/components/updatecartitem.ts +93 -0
- package/src/models/components/user.ts +199 -56
- package/src/models/components/variant.ts +27 -24
- package/src/models/components/variantdetail.ts +75 -72
- package/src/models/components/variantoption.ts +54 -61
- package/src/models/operations/getcrosssell.ts +12 -12
- package/src/models/operations/getproductscategories.ts +8 -8
- package/src/models/operations/getproductsidreviews.ts +8 -8
- package/src/models/operations/getsimilar.ts +12 -12
- package/src/models/operations/getskus.ts +8 -8
- package/src/models/operations/getupsell.ts +12 -12
- package/src/models/operations/postauthanonymous.ts +24 -24
- package/src/models/operations/postauthgenerateotp.ts +4 -4
- package/src/models/operations/postcartaddress.ts +16 -23
- package/src/models/operations/postcartitemid.ts +6 -94
- package/src/models/operations/postcartsid.ts +7 -72
- package/src/models/operations/postproductsidreviews.ts +8 -8
- package/esm/models/components/userinput.d.ts +0 -63
- package/esm/models/components/userinput.d.ts.map +0 -1
- package/esm/models/components/userinput.js +0 -61
- package/esm/models/components/userinput.js.map +0 -1
- package/src/models/components/userinput.ts +0 -130
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Schema for updating a cart item, including adding, removing, or adjusting the quantity of a product or variant.
|
|
13
|
+
*/
|
|
14
|
+
export type UpdateCartItem = {
|
|
15
|
+
/**
|
|
16
|
+
* The ID of the product to update in the cart.
|
|
17
|
+
*/
|
|
18
|
+
productId: string;
|
|
19
|
+
/**
|
|
20
|
+
* The ID of the product variant, or null if the product has no variants.
|
|
21
|
+
*/
|
|
22
|
+
variantId: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* The quantity of the product to add to or update in the cart. Use `0` to remove the item from the cart.
|
|
25
|
+
*/
|
|
26
|
+
quantity: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const UpdateCartItem$inboundSchema: z.ZodType<
|
|
31
|
+
UpdateCartItem,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
unknown
|
|
34
|
+
> = z.object({
|
|
35
|
+
product_id: z.string(),
|
|
36
|
+
variant_id: z.nullable(z.string()),
|
|
37
|
+
quantity: z.number().int(),
|
|
38
|
+
}).transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
"product_id": "productId",
|
|
41
|
+
"variant_id": "variantId",
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export type UpdateCartItem$Outbound = {
|
|
47
|
+
product_id: string;
|
|
48
|
+
variant_id: string | null;
|
|
49
|
+
quantity: number;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const UpdateCartItem$outboundSchema: z.ZodType<
|
|
54
|
+
UpdateCartItem$Outbound,
|
|
55
|
+
z.ZodTypeDef,
|
|
56
|
+
UpdateCartItem
|
|
57
|
+
> = z.object({
|
|
58
|
+
productId: z.string(),
|
|
59
|
+
variantId: z.nullable(z.string()),
|
|
60
|
+
quantity: z.number().int(),
|
|
61
|
+
}).transform((v) => {
|
|
62
|
+
return remap$(v, {
|
|
63
|
+
productId: "product_id",
|
|
64
|
+
variantId: "variant_id",
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
71
|
+
*/
|
|
72
|
+
export namespace UpdateCartItem$ {
|
|
73
|
+
/** @deprecated use `UpdateCartItem$inboundSchema` instead. */
|
|
74
|
+
export const inboundSchema = UpdateCartItem$inboundSchema;
|
|
75
|
+
/** @deprecated use `UpdateCartItem$outboundSchema` instead. */
|
|
76
|
+
export const outboundSchema = UpdateCartItem$outboundSchema;
|
|
77
|
+
/** @deprecated use `UpdateCartItem$Outbound` instead. */
|
|
78
|
+
export type Outbound = UpdateCartItem$Outbound;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function updateCartItemToJSON(updateCartItem: UpdateCartItem): string {
|
|
82
|
+
return JSON.stringify(UpdateCartItem$outboundSchema.parse(updateCartItem));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function updateCartItemFromJSON(
|
|
86
|
+
jsonString: string,
|
|
87
|
+
): SafeParseResult<UpdateCartItem, SDKValidationError> {
|
|
88
|
+
return safeParse(
|
|
89
|
+
jsonString,
|
|
90
|
+
(x) => UpdateCartItem$inboundSchema.parse(JSON.parse(x)),
|
|
91
|
+
`Failed to parse 'UpdateCartItem' from JSON`,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
11
|
import {
|
|
@@ -14,6 +15,14 @@ import {
|
|
|
14
15
|
NotificationPreferences$outboundSchema,
|
|
15
16
|
} from "./notificationpreferences.js";
|
|
16
17
|
|
|
18
|
+
export const LoginMethods = {
|
|
19
|
+
Email: "email",
|
|
20
|
+
Phone: "phone",
|
|
21
|
+
Whatsapp: "whatsapp",
|
|
22
|
+
Password: "password",
|
|
23
|
+
} as const;
|
|
24
|
+
export type LoginMethods = ClosedEnum<typeof LoginMethods>;
|
|
25
|
+
|
|
17
26
|
export type User = {
|
|
18
27
|
/**
|
|
19
28
|
* The unique identifier (ULID) of the user.
|
|
@@ -22,42 +31,51 @@ export type User = {
|
|
|
22
31
|
/**
|
|
23
32
|
* User’s first name.
|
|
24
33
|
*/
|
|
25
|
-
firstName
|
|
34
|
+
firstName: string;
|
|
26
35
|
/**
|
|
27
36
|
* User’s last name.
|
|
28
37
|
*/
|
|
29
|
-
lastName
|
|
38
|
+
lastName: string;
|
|
30
39
|
/**
|
|
31
40
|
* User’s email I’d.
|
|
32
41
|
*/
|
|
33
|
-
email
|
|
42
|
+
email: string;
|
|
34
43
|
/**
|
|
35
44
|
* Boolean indicating whether the email is verified.
|
|
36
45
|
*/
|
|
37
|
-
isEmailVerified
|
|
46
|
+
isEmailVerified: boolean;
|
|
38
47
|
/**
|
|
39
48
|
* 10 digit phone number without country code.
|
|
40
49
|
*/
|
|
41
|
-
phone
|
|
50
|
+
phone: string;
|
|
42
51
|
/**
|
|
43
52
|
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
44
53
|
*
|
|
45
54
|
* @remarks
|
|
46
55
|
* Use this key along with phone. Not necessary for email.
|
|
47
56
|
*/
|
|
48
|
-
countryCode
|
|
57
|
+
countryCode: string;
|
|
49
58
|
/**
|
|
50
59
|
* Boolean indicating whether the phone is verified.
|
|
51
60
|
*/
|
|
52
|
-
isPhoneVerified
|
|
61
|
+
isPhoneVerified: boolean;
|
|
53
62
|
/**
|
|
54
63
|
* URL to the user's profile image.
|
|
55
64
|
*/
|
|
56
|
-
profileImageUrl
|
|
65
|
+
profileImageUrl: string;
|
|
66
|
+
/**
|
|
67
|
+
* Indicates whether the user is anonymous.
|
|
68
|
+
*/
|
|
69
|
+
isAnonymous: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates whether the user is currently logged in.
|
|
72
|
+
*/
|
|
73
|
+
isLoggedIn: boolean;
|
|
74
|
+
loginMethods: Array<LoginMethods>;
|
|
57
75
|
/**
|
|
58
76
|
* Set channel preferences for each type of
|
|
59
77
|
*/
|
|
60
|
-
notificationPreferences
|
|
78
|
+
notificationPreferences: NotificationPreferences;
|
|
61
79
|
/**
|
|
62
80
|
* Timestamps indicate when the user's account was created.
|
|
63
81
|
*/
|
|
@@ -66,35 +84,76 @@ export type User = {
|
|
|
66
84
|
* Timestamps indicating when the user account was last modified.
|
|
67
85
|
*/
|
|
68
86
|
modifiedAt?: string | undefined;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type UserInput = {
|
|
69
90
|
/**
|
|
70
|
-
*
|
|
91
|
+
* User’s first name.
|
|
71
92
|
*/
|
|
72
|
-
|
|
93
|
+
firstName: string;
|
|
73
94
|
/**
|
|
74
|
-
*
|
|
95
|
+
* User’s last name.
|
|
96
|
+
*/
|
|
97
|
+
lastName: string;
|
|
98
|
+
/**
|
|
99
|
+
* User’s email I’d.
|
|
100
|
+
*/
|
|
101
|
+
email: string;
|
|
102
|
+
/**
|
|
103
|
+
* 10 digit phone number without country code.
|
|
75
104
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
105
|
+
phone: string;
|
|
106
|
+
/**
|
|
107
|
+
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
108
|
+
*
|
|
109
|
+
* @remarks
|
|
110
|
+
* Use this key along with phone. Not necessary for email.
|
|
111
|
+
*/
|
|
112
|
+
countryCode: string;
|
|
113
|
+
loginMethods: Array<LoginMethods>;
|
|
114
|
+
/**
|
|
115
|
+
* Set channel preferences for each type of
|
|
116
|
+
*/
|
|
117
|
+
notificationPreferences: NotificationPreferences;
|
|
78
118
|
};
|
|
79
119
|
|
|
120
|
+
/** @internal */
|
|
121
|
+
export const LoginMethods$inboundSchema: z.ZodNativeEnum<typeof LoginMethods> =
|
|
122
|
+
z.nativeEnum(LoginMethods);
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const LoginMethods$outboundSchema: z.ZodNativeEnum<typeof LoginMethods> =
|
|
126
|
+
LoginMethods$inboundSchema;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
131
|
+
*/
|
|
132
|
+
export namespace LoginMethods$ {
|
|
133
|
+
/** @deprecated use `LoginMethods$inboundSchema` instead. */
|
|
134
|
+
export const inboundSchema = LoginMethods$inboundSchema;
|
|
135
|
+
/** @deprecated use `LoginMethods$outboundSchema` instead. */
|
|
136
|
+
export const outboundSchema = LoginMethods$outboundSchema;
|
|
137
|
+
}
|
|
138
|
+
|
|
80
139
|
/** @internal */
|
|
81
140
|
export const User$inboundSchema: z.ZodType<User, z.ZodTypeDef, unknown> = z
|
|
82
141
|
.object({
|
|
83
142
|
id: z.string(),
|
|
84
|
-
first_name: z.string()
|
|
85
|
-
last_name: z.string()
|
|
86
|
-
email: z.string()
|
|
87
|
-
is_email_verified: z.boolean()
|
|
88
|
-
phone: z.string()
|
|
89
|
-
country_code: z.string()
|
|
90
|
-
is_phone_verified: z.boolean()
|
|
91
|
-
profile_image_url: z.string()
|
|
92
|
-
|
|
143
|
+
first_name: z.string(),
|
|
144
|
+
last_name: z.string(),
|
|
145
|
+
email: z.string(),
|
|
146
|
+
is_email_verified: z.boolean(),
|
|
147
|
+
phone: z.string(),
|
|
148
|
+
country_code: z.string(),
|
|
149
|
+
is_phone_verified: z.boolean(),
|
|
150
|
+
profile_image_url: z.string(),
|
|
151
|
+
is_anonymous: z.boolean(),
|
|
152
|
+
is_logged_in: z.boolean(),
|
|
153
|
+
login_methods: z.array(LoginMethods$inboundSchema),
|
|
154
|
+
notification_preferences: NotificationPreferences$inboundSchema,
|
|
93
155
|
created_at: z.string().optional(),
|
|
94
156
|
modified_at: z.string().optional(),
|
|
95
|
-
is_anonymous: z.boolean().optional(),
|
|
96
|
-
is_logged_in: z.boolean().optional(),
|
|
97
|
-
login_methods: z.array(z.string()).optional(),
|
|
98
157
|
}).transform((v) => {
|
|
99
158
|
return remap$(v, {
|
|
100
159
|
"first_name": "firstName",
|
|
@@ -103,52 +162,52 @@ export const User$inboundSchema: z.ZodType<User, z.ZodTypeDef, unknown> = z
|
|
|
103
162
|
"country_code": "countryCode",
|
|
104
163
|
"is_phone_verified": "isPhoneVerified",
|
|
105
164
|
"profile_image_url": "profileImageUrl",
|
|
106
|
-
"notification_preferences": "notificationPreferences",
|
|
107
|
-
"created_at": "createdAt",
|
|
108
|
-
"modified_at": "modifiedAt",
|
|
109
165
|
"is_anonymous": "isAnonymous",
|
|
110
166
|
"is_logged_in": "isLoggedIn",
|
|
111
167
|
"login_methods": "loginMethods",
|
|
168
|
+
"notification_preferences": "notificationPreferences",
|
|
169
|
+
"created_at": "createdAt",
|
|
170
|
+
"modified_at": "modifiedAt",
|
|
112
171
|
});
|
|
113
172
|
});
|
|
114
173
|
|
|
115
174
|
/** @internal */
|
|
116
175
|
export type User$Outbound = {
|
|
117
176
|
id: string;
|
|
118
|
-
first_name
|
|
119
|
-
last_name
|
|
120
|
-
email
|
|
121
|
-
is_email_verified
|
|
122
|
-
phone
|
|
123
|
-
country_code
|
|
124
|
-
is_phone_verified
|
|
125
|
-
profile_image_url
|
|
126
|
-
|
|
177
|
+
first_name: string;
|
|
178
|
+
last_name: string;
|
|
179
|
+
email: string;
|
|
180
|
+
is_email_verified: boolean;
|
|
181
|
+
phone: string;
|
|
182
|
+
country_code: string;
|
|
183
|
+
is_phone_verified: boolean;
|
|
184
|
+
profile_image_url: string;
|
|
185
|
+
is_anonymous: boolean;
|
|
186
|
+
is_logged_in: boolean;
|
|
187
|
+
login_methods: Array<string>;
|
|
188
|
+
notification_preferences: NotificationPreferences$Outbound;
|
|
127
189
|
created_at?: string | undefined;
|
|
128
190
|
modified_at?: string | undefined;
|
|
129
|
-
is_anonymous?: boolean | undefined;
|
|
130
|
-
is_logged_in?: boolean | undefined;
|
|
131
|
-
login_methods?: Array<string> | undefined;
|
|
132
191
|
};
|
|
133
192
|
|
|
134
193
|
/** @internal */
|
|
135
194
|
export const User$outboundSchema: z.ZodType<User$Outbound, z.ZodTypeDef, User> =
|
|
136
195
|
z.object({
|
|
137
196
|
id: z.string(),
|
|
138
|
-
firstName: z.string()
|
|
139
|
-
lastName: z.string()
|
|
140
|
-
email: z.string()
|
|
141
|
-
isEmailVerified: z.boolean()
|
|
142
|
-
phone: z.string()
|
|
143
|
-
countryCode: z.string()
|
|
144
|
-
isPhoneVerified: z.boolean()
|
|
145
|
-
profileImageUrl: z.string()
|
|
146
|
-
|
|
197
|
+
firstName: z.string(),
|
|
198
|
+
lastName: z.string(),
|
|
199
|
+
email: z.string(),
|
|
200
|
+
isEmailVerified: z.boolean(),
|
|
201
|
+
phone: z.string(),
|
|
202
|
+
countryCode: z.string(),
|
|
203
|
+
isPhoneVerified: z.boolean(),
|
|
204
|
+
profileImageUrl: z.string(),
|
|
205
|
+
isAnonymous: z.boolean(),
|
|
206
|
+
isLoggedIn: z.boolean(),
|
|
207
|
+
loginMethods: z.array(LoginMethods$outboundSchema),
|
|
208
|
+
notificationPreferences: NotificationPreferences$outboundSchema,
|
|
147
209
|
createdAt: z.string().optional(),
|
|
148
210
|
modifiedAt: z.string().optional(),
|
|
149
|
-
isAnonymous: z.boolean().optional(),
|
|
150
|
-
isLoggedIn: z.boolean().optional(),
|
|
151
|
-
loginMethods: z.array(z.string()).optional(),
|
|
152
211
|
}).transform((v) => {
|
|
153
212
|
return remap$(v, {
|
|
154
213
|
firstName: "first_name",
|
|
@@ -157,12 +216,12 @@ export const User$outboundSchema: z.ZodType<User$Outbound, z.ZodTypeDef, User> =
|
|
|
157
216
|
countryCode: "country_code",
|
|
158
217
|
isPhoneVerified: "is_phone_verified",
|
|
159
218
|
profileImageUrl: "profile_image_url",
|
|
160
|
-
notificationPreferences: "notification_preferences",
|
|
161
|
-
createdAt: "created_at",
|
|
162
|
-
modifiedAt: "modified_at",
|
|
163
219
|
isAnonymous: "is_anonymous",
|
|
164
220
|
isLoggedIn: "is_logged_in",
|
|
165
221
|
loginMethods: "login_methods",
|
|
222
|
+
notificationPreferences: "notification_preferences",
|
|
223
|
+
createdAt: "created_at",
|
|
224
|
+
modifiedAt: "modified_at",
|
|
166
225
|
});
|
|
167
226
|
});
|
|
168
227
|
|
|
@@ -192,3 +251,87 @@ export function userFromJSON(
|
|
|
192
251
|
`Failed to parse 'User' from JSON`,
|
|
193
252
|
);
|
|
194
253
|
}
|
|
254
|
+
|
|
255
|
+
/** @internal */
|
|
256
|
+
export const UserInput$inboundSchema: z.ZodType<
|
|
257
|
+
UserInput,
|
|
258
|
+
z.ZodTypeDef,
|
|
259
|
+
unknown
|
|
260
|
+
> = z.object({
|
|
261
|
+
first_name: z.string(),
|
|
262
|
+
last_name: z.string(),
|
|
263
|
+
email: z.string(),
|
|
264
|
+
phone: z.string(),
|
|
265
|
+
country_code: z.string(),
|
|
266
|
+
login_methods: z.array(LoginMethods$inboundSchema),
|
|
267
|
+
notification_preferences: NotificationPreferences$inboundSchema,
|
|
268
|
+
}).transform((v) => {
|
|
269
|
+
return remap$(v, {
|
|
270
|
+
"first_name": "firstName",
|
|
271
|
+
"last_name": "lastName",
|
|
272
|
+
"country_code": "countryCode",
|
|
273
|
+
"login_methods": "loginMethods",
|
|
274
|
+
"notification_preferences": "notificationPreferences",
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
/** @internal */
|
|
279
|
+
export type UserInput$Outbound = {
|
|
280
|
+
first_name: string;
|
|
281
|
+
last_name: string;
|
|
282
|
+
email: string;
|
|
283
|
+
phone: string;
|
|
284
|
+
country_code: string;
|
|
285
|
+
login_methods: Array<string>;
|
|
286
|
+
notification_preferences: NotificationPreferences$Outbound;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
/** @internal */
|
|
290
|
+
export const UserInput$outboundSchema: z.ZodType<
|
|
291
|
+
UserInput$Outbound,
|
|
292
|
+
z.ZodTypeDef,
|
|
293
|
+
UserInput
|
|
294
|
+
> = z.object({
|
|
295
|
+
firstName: z.string(),
|
|
296
|
+
lastName: z.string(),
|
|
297
|
+
email: z.string(),
|
|
298
|
+
phone: z.string(),
|
|
299
|
+
countryCode: z.string(),
|
|
300
|
+
loginMethods: z.array(LoginMethods$outboundSchema),
|
|
301
|
+
notificationPreferences: NotificationPreferences$outboundSchema,
|
|
302
|
+
}).transform((v) => {
|
|
303
|
+
return remap$(v, {
|
|
304
|
+
firstName: "first_name",
|
|
305
|
+
lastName: "last_name",
|
|
306
|
+
countryCode: "country_code",
|
|
307
|
+
loginMethods: "login_methods",
|
|
308
|
+
notificationPreferences: "notification_preferences",
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* @internal
|
|
314
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
315
|
+
*/
|
|
316
|
+
export namespace UserInput$ {
|
|
317
|
+
/** @deprecated use `UserInput$inboundSchema` instead. */
|
|
318
|
+
export const inboundSchema = UserInput$inboundSchema;
|
|
319
|
+
/** @deprecated use `UserInput$outboundSchema` instead. */
|
|
320
|
+
export const outboundSchema = UserInput$outboundSchema;
|
|
321
|
+
/** @deprecated use `UserInput$Outbound` instead. */
|
|
322
|
+
export type Outbound = UserInput$Outbound;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export function userInputToJSON(userInput: UserInput): string {
|
|
326
|
+
return JSON.stringify(UserInput$outboundSchema.parse(userInput));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export function userInputFromJSON(
|
|
330
|
+
jsonString: string,
|
|
331
|
+
): SafeParseResult<UserInput, SDKValidationError> {
|
|
332
|
+
return safeParse(
|
|
333
|
+
jsonString,
|
|
334
|
+
(x) => UserInput$inboundSchema.parse(JSON.parse(x)),
|
|
335
|
+
`Failed to parse 'UserInput' from JSON`,
|
|
336
|
+
);
|
|
337
|
+
}
|
|
@@ -50,8 +50,8 @@ export type Variant = {
|
|
|
50
50
|
/**
|
|
51
51
|
* variant sku
|
|
52
52
|
*/
|
|
53
|
-
sku
|
|
54
|
-
slug
|
|
53
|
+
sku: string | null;
|
|
54
|
+
slug: string | null;
|
|
55
55
|
/**
|
|
56
56
|
* variant name
|
|
57
57
|
*/
|
|
@@ -60,7 +60,7 @@ export type Variant = {
|
|
|
60
60
|
* variant name
|
|
61
61
|
*/
|
|
62
62
|
productName: string;
|
|
63
|
-
shortDescription: string;
|
|
63
|
+
shortDescription: string | null;
|
|
64
64
|
active: boolean;
|
|
65
65
|
stockAvailable: boolean;
|
|
66
66
|
/**
|
|
@@ -73,11 +73,14 @@ export type Variant = {
|
|
|
73
73
|
* Indicates whether a variant is marked as the default variant for a product
|
|
74
74
|
*/
|
|
75
75
|
isDefault: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* An object where each key is an option name, and the value describes the option details.
|
|
78
|
+
*/
|
|
76
79
|
associatedOptions: { [k: string]: AssociatedOption };
|
|
77
|
-
images
|
|
80
|
+
images: Array<ProductImage>;
|
|
78
81
|
pricing: ProductPricing;
|
|
79
|
-
subscription
|
|
80
|
-
promotion
|
|
82
|
+
subscription: Array<ProductSubscription>;
|
|
83
|
+
promotion: Array<ProductPromotion>;
|
|
81
84
|
};
|
|
82
85
|
|
|
83
86
|
/** @internal */
|
|
@@ -85,11 +88,11 @@ export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
|
|
|
85
88
|
z.object({
|
|
86
89
|
id: z.string(),
|
|
87
90
|
product_id: z.string(),
|
|
88
|
-
sku: z.
|
|
89
|
-
slug: z.
|
|
91
|
+
sku: z.nullable(z.string()),
|
|
92
|
+
slug: z.nullable(z.string()),
|
|
90
93
|
name: z.string(),
|
|
91
94
|
product_name: z.string(),
|
|
92
|
-
short_description: z.string(),
|
|
95
|
+
short_description: z.nullable(z.string()),
|
|
93
96
|
active: z.boolean(),
|
|
94
97
|
stock_available: z.boolean(),
|
|
95
98
|
on_offer: z.boolean().default(false),
|
|
@@ -97,10 +100,10 @@ export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
|
|
|
97
100
|
on_subscription: z.boolean().default(false),
|
|
98
101
|
is_default: z.boolean(),
|
|
99
102
|
associated_options: z.record(AssociatedOption$inboundSchema),
|
|
100
|
-
images: z.array(ProductImage$inboundSchema)
|
|
103
|
+
images: z.array(ProductImage$inboundSchema),
|
|
101
104
|
pricing: ProductPricing$inboundSchema,
|
|
102
|
-
subscription: z.array(ProductSubscription$inboundSchema)
|
|
103
|
-
promotion: z.array(ProductPromotion$inboundSchema)
|
|
105
|
+
subscription: z.array(ProductSubscription$inboundSchema),
|
|
106
|
+
promotion: z.array(ProductPromotion$inboundSchema),
|
|
104
107
|
}).transform((v) => {
|
|
105
108
|
return remap$(v, {
|
|
106
109
|
"product_id": "productId",
|
|
@@ -119,11 +122,11 @@ export const Variant$inboundSchema: z.ZodType<Variant, z.ZodTypeDef, unknown> =
|
|
|
119
122
|
export type Variant$Outbound = {
|
|
120
123
|
id: string;
|
|
121
124
|
product_id: string;
|
|
122
|
-
sku
|
|
123
|
-
slug
|
|
125
|
+
sku: string | null;
|
|
126
|
+
slug: string | null;
|
|
124
127
|
name: string;
|
|
125
128
|
product_name: string;
|
|
126
|
-
short_description: string;
|
|
129
|
+
short_description: string | null;
|
|
127
130
|
active: boolean;
|
|
128
131
|
stock_available: boolean;
|
|
129
132
|
on_offer: boolean;
|
|
@@ -131,10 +134,10 @@ export type Variant$Outbound = {
|
|
|
131
134
|
on_subscription: boolean;
|
|
132
135
|
is_default: boolean;
|
|
133
136
|
associated_options: { [k: string]: AssociatedOption$Outbound };
|
|
134
|
-
images
|
|
137
|
+
images: Array<ProductImage$Outbound>;
|
|
135
138
|
pricing: ProductPricing$Outbound;
|
|
136
|
-
subscription
|
|
137
|
-
promotion
|
|
139
|
+
subscription: Array<ProductSubscription$Outbound>;
|
|
140
|
+
promotion: Array<ProductPromotion$Outbound>;
|
|
138
141
|
};
|
|
139
142
|
|
|
140
143
|
/** @internal */
|
|
@@ -145,11 +148,11 @@ export const Variant$outboundSchema: z.ZodType<
|
|
|
145
148
|
> = z.object({
|
|
146
149
|
id: z.string(),
|
|
147
150
|
productId: z.string(),
|
|
148
|
-
sku: z.
|
|
149
|
-
slug: z.
|
|
151
|
+
sku: z.nullable(z.string()),
|
|
152
|
+
slug: z.nullable(z.string()),
|
|
150
153
|
name: z.string(),
|
|
151
154
|
productName: z.string(),
|
|
152
|
-
shortDescription: z.string(),
|
|
155
|
+
shortDescription: z.nullable(z.string()),
|
|
153
156
|
active: z.boolean(),
|
|
154
157
|
stockAvailable: z.boolean(),
|
|
155
158
|
onOffer: z.boolean().default(false),
|
|
@@ -157,10 +160,10 @@ export const Variant$outboundSchema: z.ZodType<
|
|
|
157
160
|
onSubscription: z.boolean().default(false),
|
|
158
161
|
isDefault: z.boolean(),
|
|
159
162
|
associatedOptions: z.record(AssociatedOption$outboundSchema),
|
|
160
|
-
images: z.array(ProductImage$outboundSchema)
|
|
163
|
+
images: z.array(ProductImage$outboundSchema),
|
|
161
164
|
pricing: ProductPricing$outboundSchema,
|
|
162
|
-
subscription: z.array(ProductSubscription$outboundSchema)
|
|
163
|
-
promotion: z.array(ProductPromotion$outboundSchema)
|
|
165
|
+
subscription: z.array(ProductSubscription$outboundSchema),
|
|
166
|
+
promotion: z.array(ProductPromotion$outboundSchema),
|
|
164
167
|
}).transform((v) => {
|
|
165
168
|
return remap$(v, {
|
|
166
169
|
productId: "product_id",
|