ce-storefront 0.3.5 → 0.3.7
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/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/analyticsevent.d.ts +8 -8
- package/esm/models/components/analyticsevent.d.ts.map +1 -1
- package/esm/models/components/analyticsevent.js +12 -12
- package/esm/models/components/analyticsevent.js.map +1 -1
- package/esm/models/components/associatedoption.d.ts +125 -0
- package/esm/models/components/associatedoption.d.ts.map +1 -0
- package/esm/models/components/associatedoption.js +107 -0
- package/esm/models/components/associatedoption.js.map +1 -0
- package/esm/models/components/bundleproduct.d.ts +236 -0
- package/esm/models/components/bundleproduct.d.ts.map +1 -0
- package/esm/models/components/bundleproduct.js +262 -0
- package/esm/models/components/bundleproduct.js.map +1 -0
- package/esm/models/components/bundleproductdetail.d.ts +265 -0
- package/esm/models/components/bundleproductdetail.d.ts.map +1 -0
- package/esm/models/components/bundleproductdetail.js +288 -0
- package/esm/models/components/bundleproductdetail.js.map +1 -0
- package/esm/models/components/cart.d.ts +15 -15
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +15 -15
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/discountbasedpromotion.d.ts +0 -2
- package/esm/models/components/discountbasedpromotion.d.ts.map +1 -1
- package/esm/models/components/discountbasedpromotion.js +0 -4
- package/esm/models/components/discountbasedpromotion.js.map +1 -1
- package/esm/models/components/fixedpricepromotion.d.ts +0 -2
- package/esm/models/components/fixedpricepromotion.d.ts.map +1 -1
- package/esm/models/components/fixedpricepromotion.js +0 -4
- package/esm/models/components/fixedpricepromotion.js.map +1 -1
- package/esm/models/components/freegoodspromotion.d.ts +0 -5
- package/esm/models/components/freegoodspromotion.d.ts.map +1 -1
- package/esm/models/components/freegoodspromotion.js +0 -4
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/index.d.ts +8 -6
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +8 -6
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/productattribute.d.ts +97 -64
- package/esm/models/components/productattribute.d.ts.map +1 -1
- package/esm/models/components/productattribute.js +67 -128
- package/esm/models/components/productattribute.js.map +1 -1
- package/esm/models/components/productcategory.d.ts +2 -2
- package/esm/models/components/productcategory.d.ts.map +1 -1
- package/esm/models/components/productcategory.js +2 -2
- package/esm/models/components/productcategory.js.map +1 -1
- package/esm/models/components/productdetail.d.ts +16 -188
- package/esm/models/components/productdetail.d.ts.map +1 -1
- package/esm/models/components/productdetail.js +26 -228
- package/esm/models/components/productdetail.js.map +1 -1
- package/esm/models/components/productlistresponse.d.ts +49 -3
- package/esm/models/components/productlistresponse.d.ts.map +1 -1
- package/esm/models/components/productlistresponse.js +65 -3
- package/esm/models/components/productlistresponse.js.map +1 -1
- package/esm/models/components/productshipping.d.ts +13 -15
- package/esm/models/components/productshipping.d.ts.map +1 -1
- package/esm/models/components/productshipping.js +14 -18
- package/esm/models/components/productshipping.js.map +1 -1
- package/esm/models/components/{promotion.d.ts → promotiondetail.d.ts} +29 -29
- package/esm/models/components/promotiondetail.d.ts.map +1 -0
- package/esm/models/components/{promotion.js → promotiondetail.js} +29 -29
- package/esm/models/components/promotiondetail.js.map +1 -0
- package/esm/models/components/seo.d.ts +6 -6
- package/esm/models/components/seo.d.ts.map +1 -1
- package/esm/models/components/seo.js +6 -19
- package/esm/models/components/seo.js.map +1 -1
- package/esm/models/components/{product.d.ts → singleproduct.d.ts} +52 -75
- package/esm/models/components/singleproduct.d.ts.map +1 -0
- package/esm/models/components/{product.js → singleproduct.js} +37 -95
- package/esm/models/components/singleproduct.js.map +1 -0
- package/esm/models/components/singleproductdetail.d.ts +159 -0
- package/esm/models/components/singleproductdetail.d.ts.map +1 -0
- package/esm/models/components/singleproductdetail.js +156 -0
- package/esm/models/components/singleproductdetail.js.map +1 -0
- package/esm/models/components/{skuinfo.d.ts → sku.d.ts} +59 -48
- package/esm/models/components/sku.d.ts.map +1 -0
- package/esm/models/components/{skuinfo.js → sku.js} +67 -57
- package/esm/models/components/sku.js.map +1 -0
- package/esm/models/components/variant.d.ts +42 -72
- package/esm/models/components/variant.d.ts.map +1 -1
- package/esm/models/components/variant.js +39 -82
- package/esm/models/components/variant.js.map +1 -1
- package/esm/models/components/variantdetail.d.ts +101 -68
- package/esm/models/components/variantdetail.d.ts.map +1 -1
- package/esm/models/components/variantdetail.js +99 -71
- package/esm/models/components/variantdetail.js.map +1 -1
- package/esm/models/components/variantoption.d.ts +118 -0
- package/esm/models/components/variantoption.d.ts.map +1 -0
- package/esm/models/components/variantoption.js +114 -0
- package/esm/models/components/variantoption.js.map +1 -0
- package/esm/models/components/volumebasedpromotion.d.ts +0 -5
- package/esm/models/components/volumebasedpromotion.d.ts.map +1 -1
- package/esm/models/components/volumebasedpromotion.js +0 -4
- package/esm/models/components/volumebasedpromotion.js.map +1 -1
- package/esm/models/operations/getpromotions.d.ts +2 -2
- package/esm/models/operations/getpromotions.d.ts.map +1 -1
- package/esm/models/operations/getpromotions.js +2 -2
- package/esm/models/operations/getpromotions.js.map +1 -1
- package/esm/models/operations/getskus.d.ts +2 -2
- package/esm/models/operations/getskus.d.ts.map +1 -1
- package/esm/models/operations/getskus.js +2 -2
- package/esm/models/operations/getskus.js.map +1 -1
- package/esm/models/operations/getwishtlist.d.ts +2 -2
- package/esm/models/operations/getwishtlist.d.ts.map +1 -1
- package/esm/models/operations/getwishtlist.js +2 -2
- package/esm/models/operations/getwishtlist.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/analyticsevent.ts +16 -15
- package/src/models/components/associatedoption.ts +217 -0
- package/src/models/components/bundleproduct.ts +501 -0
- package/src/models/components/bundleproductdetail.ts +567 -0
- package/src/models/components/cart.ts +24 -24
- package/src/models/components/discountbasedpromotion.ts +0 -6
- package/src/models/components/fixedpricepromotion.ts +0 -6
- package/src/models/components/freegoodspromotion.ts +0 -9
- package/src/models/components/index.ts +8 -6
- package/src/models/components/productattribute.ts +162 -188
- package/src/models/components/productcategory.ts +4 -4
- package/src/models/components/productdetail.ts +52 -475
- package/src/models/components/productlistresponse.ts +147 -9
- package/src/models/components/productshipping.ts +27 -33
- package/src/models/components/{promotion.ts → promotiondetail.ts} +47 -45
- package/src/models/components/seo.ts +12 -25
- package/src/models/components/singleproduct.ts +269 -0
- package/src/models/components/singleproductdetail.ts +339 -0
- package/src/models/components/sku.ts +252 -0
- package/src/models/components/variant.ts +81 -170
- package/src/models/components/variantdetail.ts +189 -168
- package/src/models/components/variantoption.ts +214 -0
- package/src/models/components/volumebasedpromotion.ts +0 -9
- package/src/models/operations/getpromotions.ts +4 -4
- package/src/models/operations/getskus.ts +4 -4
- package/src/models/operations/getwishtlist.ts +4 -4
- package/esm/models/components/product.d.ts.map +0 -1
- package/esm/models/components/product.js.map +0 -1
- package/esm/models/components/productbundleitem.d.ts +0 -47
- package/esm/models/components/productbundleitem.d.ts.map +0 -1
- package/esm/models/components/productbundleitem.js +0 -66
- package/esm/models/components/productbundleitem.js.map +0 -1
- package/esm/models/components/productpackaging.d.ts +0 -68
- package/esm/models/components/productpackaging.d.ts.map +0 -1
- package/esm/models/components/productpackaging.js +0 -88
- package/esm/models/components/productpackaging.js.map +0 -1
- package/esm/models/components/promotion.d.ts.map +0 -1
- package/esm/models/components/promotion.js.map +0 -1
- package/esm/models/components/saleschannel.d.ts +0 -39
- package/esm/models/components/saleschannel.d.ts.map +0 -1
- package/esm/models/components/saleschannel.js +0 -53
- package/esm/models/components/saleschannel.js.map +0 -1
- package/esm/models/components/skuinfo.d.ts.map +0 -1
- package/esm/models/components/skuinfo.js.map +0 -1
- package/src/models/components/product.ts +0 -363
- package/src/models/components/productbundleitem.ts +0 -127
- package/src/models/components/productpackaging.ts +0 -162
- package/src/models/components/saleschannel.ts +0 -96
- package/src/models/components/skuinfo.ts +0 -237
|
@@ -6,6 +6,12 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
BundleProduct,
|
|
11
|
+
BundleProduct$inboundSchema,
|
|
12
|
+
BundleProduct$Outbound,
|
|
13
|
+
BundleProduct$outboundSchema,
|
|
14
|
+
} from "./bundleproduct.js";
|
|
9
15
|
import {
|
|
10
16
|
Pagination,
|
|
11
17
|
Pagination$inboundSchema,
|
|
@@ -13,33 +19,147 @@ import {
|
|
|
13
19
|
Pagination$outboundSchema,
|
|
14
20
|
} from "./pagination.js";
|
|
15
21
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from "./
|
|
22
|
+
SingleProduct,
|
|
23
|
+
SingleProduct$inboundSchema,
|
|
24
|
+
SingleProduct$Outbound,
|
|
25
|
+
SingleProduct$outboundSchema,
|
|
26
|
+
} from "./singleproduct.js";
|
|
27
|
+
|
|
28
|
+
export type Products =
|
|
29
|
+
| (SingleProduct & { productType: "physical" })
|
|
30
|
+
| (SingleProduct & { productType: "digital" })
|
|
31
|
+
| (BundleProduct & { productType: "bundle" });
|
|
21
32
|
|
|
22
33
|
export type ProductListResponse = {
|
|
23
|
-
products?:
|
|
34
|
+
products?:
|
|
35
|
+
| Array<
|
|
36
|
+
| (SingleProduct & { productType: "physical" })
|
|
37
|
+
| (SingleProduct & { productType: "digital" })
|
|
38
|
+
| (BundleProduct & { productType: "bundle" })
|
|
39
|
+
>
|
|
40
|
+
| undefined;
|
|
24
41
|
/**
|
|
25
42
|
* pagination metadata structure
|
|
26
43
|
*/
|
|
27
44
|
pagination?: Pagination | undefined;
|
|
28
45
|
};
|
|
29
46
|
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const Products$inboundSchema: z.ZodType<
|
|
49
|
+
Products,
|
|
50
|
+
z.ZodTypeDef,
|
|
51
|
+
unknown
|
|
52
|
+
> = z.union([
|
|
53
|
+
SingleProduct$inboundSchema.and(
|
|
54
|
+
z.object({ product_type: z.literal("physical") }).transform((v) => ({
|
|
55
|
+
productType: v.product_type,
|
|
56
|
+
})),
|
|
57
|
+
),
|
|
58
|
+
SingleProduct$inboundSchema.and(
|
|
59
|
+
z.object({ product_type: z.literal("digital") }).transform((v) => ({
|
|
60
|
+
productType: v.product_type,
|
|
61
|
+
})),
|
|
62
|
+
),
|
|
63
|
+
BundleProduct$inboundSchema.and(
|
|
64
|
+
z.object({ product_type: z.literal("bundle") }).transform((v) => ({
|
|
65
|
+
productType: v.product_type,
|
|
66
|
+
})),
|
|
67
|
+
),
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export type Products$Outbound =
|
|
72
|
+
| (SingleProduct$Outbound & { product_type: "physical" })
|
|
73
|
+
| (SingleProduct$Outbound & { product_type: "digital" })
|
|
74
|
+
| (BundleProduct$Outbound & { product_type: "bundle" });
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const Products$outboundSchema: z.ZodType<
|
|
78
|
+
Products$Outbound,
|
|
79
|
+
z.ZodTypeDef,
|
|
80
|
+
Products
|
|
81
|
+
> = z.union([
|
|
82
|
+
SingleProduct$outboundSchema.and(
|
|
83
|
+
z.object({ productType: z.literal("physical") }).transform((v) => ({
|
|
84
|
+
product_type: v.productType,
|
|
85
|
+
})),
|
|
86
|
+
),
|
|
87
|
+
SingleProduct$outboundSchema.and(
|
|
88
|
+
z.object({ productType: z.literal("digital") }).transform((v) => ({
|
|
89
|
+
product_type: v.productType,
|
|
90
|
+
})),
|
|
91
|
+
),
|
|
92
|
+
BundleProduct$outboundSchema.and(
|
|
93
|
+
z.object({ productType: z.literal("bundle") }).transform((v) => ({
|
|
94
|
+
product_type: v.productType,
|
|
95
|
+
})),
|
|
96
|
+
),
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
102
|
+
*/
|
|
103
|
+
export namespace Products$ {
|
|
104
|
+
/** @deprecated use `Products$inboundSchema` instead. */
|
|
105
|
+
export const inboundSchema = Products$inboundSchema;
|
|
106
|
+
/** @deprecated use `Products$outboundSchema` instead. */
|
|
107
|
+
export const outboundSchema = Products$outboundSchema;
|
|
108
|
+
/** @deprecated use `Products$Outbound` instead. */
|
|
109
|
+
export type Outbound = Products$Outbound;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function productsToJSON(products: Products): string {
|
|
113
|
+
return JSON.stringify(Products$outboundSchema.parse(products));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function productsFromJSON(
|
|
117
|
+
jsonString: string,
|
|
118
|
+
): SafeParseResult<Products, SDKValidationError> {
|
|
119
|
+
return safeParse(
|
|
120
|
+
jsonString,
|
|
121
|
+
(x) => Products$inboundSchema.parse(JSON.parse(x)),
|
|
122
|
+
`Failed to parse 'Products' from JSON`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
30
126
|
/** @internal */
|
|
31
127
|
export const ProductListResponse$inboundSchema: z.ZodType<
|
|
32
128
|
ProductListResponse,
|
|
33
129
|
z.ZodTypeDef,
|
|
34
130
|
unknown
|
|
35
131
|
> = z.object({
|
|
36
|
-
products: z.array(
|
|
132
|
+
products: z.array(
|
|
133
|
+
z.union([
|
|
134
|
+
SingleProduct$inboundSchema.and(
|
|
135
|
+
z.object({ product_type: z.literal("physical") }).transform((v) => ({
|
|
136
|
+
productType: v.product_type,
|
|
137
|
+
})),
|
|
138
|
+
),
|
|
139
|
+
SingleProduct$inboundSchema.and(
|
|
140
|
+
z.object({ product_type: z.literal("digital") }).transform((v) => ({
|
|
141
|
+
productType: v.product_type,
|
|
142
|
+
})),
|
|
143
|
+
),
|
|
144
|
+
BundleProduct$inboundSchema.and(
|
|
145
|
+
z.object({ product_type: z.literal("bundle") }).transform((v) => ({
|
|
146
|
+
productType: v.product_type,
|
|
147
|
+
})),
|
|
148
|
+
),
|
|
149
|
+
]),
|
|
150
|
+
).optional(),
|
|
37
151
|
pagination: Pagination$inboundSchema.optional(),
|
|
38
152
|
});
|
|
39
153
|
|
|
40
154
|
/** @internal */
|
|
41
155
|
export type ProductListResponse$Outbound = {
|
|
42
|
-
products?:
|
|
156
|
+
products?:
|
|
157
|
+
| Array<
|
|
158
|
+
| (SingleProduct$Outbound & { product_type: "physical" })
|
|
159
|
+
| (SingleProduct$Outbound & { product_type: "digital" })
|
|
160
|
+
| (BundleProduct$Outbound & { product_type: "bundle" })
|
|
161
|
+
>
|
|
162
|
+
| undefined;
|
|
43
163
|
pagination?: Pagination$Outbound | undefined;
|
|
44
164
|
};
|
|
45
165
|
|
|
@@ -49,7 +169,25 @@ export const ProductListResponse$outboundSchema: z.ZodType<
|
|
|
49
169
|
z.ZodTypeDef,
|
|
50
170
|
ProductListResponse
|
|
51
171
|
> = z.object({
|
|
52
|
-
products: z.array(
|
|
172
|
+
products: z.array(
|
|
173
|
+
z.union([
|
|
174
|
+
SingleProduct$outboundSchema.and(
|
|
175
|
+
z.object({ productType: z.literal("physical") }).transform((v) => ({
|
|
176
|
+
product_type: v.productType,
|
|
177
|
+
})),
|
|
178
|
+
),
|
|
179
|
+
SingleProduct$outboundSchema.and(
|
|
180
|
+
z.object({ productType: z.literal("digital") }).transform((v) => ({
|
|
181
|
+
product_type: v.productType,
|
|
182
|
+
})),
|
|
183
|
+
),
|
|
184
|
+
BundleProduct$outboundSchema.and(
|
|
185
|
+
z.object({ productType: z.literal("bundle") }).transform((v) => ({
|
|
186
|
+
product_type: v.productType,
|
|
187
|
+
})),
|
|
188
|
+
),
|
|
189
|
+
]),
|
|
190
|
+
).optional(),
|
|
53
191
|
pagination: Pagination$outboundSchema.optional(),
|
|
54
192
|
});
|
|
55
193
|
|
|
@@ -9,15 +9,14 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
10
|
|
|
11
11
|
export type ProductShipping = {
|
|
12
|
-
additionalCost?: number | undefined;
|
|
12
|
+
additionalCost?: number | null | undefined;
|
|
13
13
|
shippingPriceIncludingTax?: boolean | undefined;
|
|
14
|
-
availabilityDescription?: string | undefined;
|
|
14
|
+
availabilityDescription?: string | null | undefined;
|
|
15
15
|
shipsInternationally?: boolean | undefined;
|
|
16
|
-
midCode?: string | undefined;
|
|
17
|
-
countryOfOrigin?: string | undefined;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
taxRate?: number | undefined;
|
|
16
|
+
midCode?: string | null | undefined;
|
|
17
|
+
countryOfOrigin?: string | null | undefined;
|
|
18
|
+
taxType?: string | null | undefined;
|
|
19
|
+
taxRate?: number | null | undefined;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
/** @internal */
|
|
@@ -26,15 +25,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
|
|
|
26
25
|
z.ZodTypeDef,
|
|
27
26
|
unknown
|
|
28
27
|
> = z.object({
|
|
29
|
-
additional_cost: z.number().optional(),
|
|
28
|
+
additional_cost: z.nullable(z.number()).optional(),
|
|
30
29
|
shipping_price_including_tax: z.boolean().optional(),
|
|
31
|
-
availability_description: z.string().optional(),
|
|
32
|
-
ships_internationally: z.boolean().
|
|
33
|
-
mid_code: z.string().optional(),
|
|
34
|
-
country_of_origin: z.string().default("India"),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
tax_rate: z.number().optional(),
|
|
30
|
+
availability_description: z.nullable(z.string()).optional(),
|
|
31
|
+
ships_internationally: z.boolean().default(false),
|
|
32
|
+
mid_code: z.nullable(z.string()).optional(),
|
|
33
|
+
country_of_origin: z.nullable(z.string().default("India")),
|
|
34
|
+
tax_type: z.nullable(z.string()).optional(),
|
|
35
|
+
tax_rate: z.nullable(z.number()).optional(),
|
|
38
36
|
}).transform((v) => {
|
|
39
37
|
return remap$(v, {
|
|
40
38
|
"additional_cost": "additionalCost",
|
|
@@ -43,7 +41,6 @@ export const ProductShipping$inboundSchema: z.ZodType<
|
|
|
43
41
|
"ships_internationally": "shipsInternationally",
|
|
44
42
|
"mid_code": "midCode",
|
|
45
43
|
"country_of_origin": "countryOfOrigin",
|
|
46
|
-
"tax_region": "taxRegion",
|
|
47
44
|
"tax_type": "taxType",
|
|
48
45
|
"tax_rate": "taxRate",
|
|
49
46
|
});
|
|
@@ -51,15 +48,14 @@ export const ProductShipping$inboundSchema: z.ZodType<
|
|
|
51
48
|
|
|
52
49
|
/** @internal */
|
|
53
50
|
export type ProductShipping$Outbound = {
|
|
54
|
-
additional_cost?: number | undefined;
|
|
51
|
+
additional_cost?: number | null | undefined;
|
|
55
52
|
shipping_price_including_tax?: boolean | undefined;
|
|
56
|
-
availability_description?: string | undefined;
|
|
57
|
-
ships_internationally
|
|
58
|
-
mid_code?: string | undefined;
|
|
59
|
-
country_of_origin: string;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tax_rate?: number | undefined;
|
|
53
|
+
availability_description?: string | null | undefined;
|
|
54
|
+
ships_internationally: boolean;
|
|
55
|
+
mid_code?: string | null | undefined;
|
|
56
|
+
country_of_origin: string | null;
|
|
57
|
+
tax_type?: string | null | undefined;
|
|
58
|
+
tax_rate?: number | null | undefined;
|
|
63
59
|
};
|
|
64
60
|
|
|
65
61
|
/** @internal */
|
|
@@ -68,15 +64,14 @@ export const ProductShipping$outboundSchema: z.ZodType<
|
|
|
68
64
|
z.ZodTypeDef,
|
|
69
65
|
ProductShipping
|
|
70
66
|
> = z.object({
|
|
71
|
-
additionalCost: z.number().optional(),
|
|
67
|
+
additionalCost: z.nullable(z.number()).optional(),
|
|
72
68
|
shippingPriceIncludingTax: z.boolean().optional(),
|
|
73
|
-
availabilityDescription: z.string().optional(),
|
|
74
|
-
shipsInternationally: z.boolean().
|
|
75
|
-
midCode: z.string().optional(),
|
|
76
|
-
countryOfOrigin: z.string().default("India"),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
taxRate: z.number().optional(),
|
|
69
|
+
availabilityDescription: z.nullable(z.string()).optional(),
|
|
70
|
+
shipsInternationally: z.boolean().default(false),
|
|
71
|
+
midCode: z.nullable(z.string()).optional(),
|
|
72
|
+
countryOfOrigin: z.nullable(z.string().default("India")),
|
|
73
|
+
taxType: z.nullable(z.string()).optional(),
|
|
74
|
+
taxRate: z.nullable(z.number()).optional(),
|
|
80
75
|
}).transform((v) => {
|
|
81
76
|
return remap$(v, {
|
|
82
77
|
additionalCost: "additional_cost",
|
|
@@ -85,7 +80,6 @@ export const ProductShipping$outboundSchema: z.ZodType<
|
|
|
85
80
|
shipsInternationally: "ships_internationally",
|
|
86
81
|
midCode: "mid_code",
|
|
87
82
|
countryOfOrigin: "country_of_origin",
|
|
88
|
-
taxRegion: "tax_region",
|
|
89
83
|
taxType: "tax_type",
|
|
90
84
|
taxRate: "tax_rate",
|
|
91
85
|
});
|
|
@@ -17,18 +17,18 @@ export const PromotionType = {
|
|
|
17
17
|
} as const;
|
|
18
18
|
export type PromotionType = ClosedEnum<typeof PromotionType>;
|
|
19
19
|
|
|
20
|
-
export type
|
|
20
|
+
export type PromotionDetailDetails = {};
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* promotion model
|
|
24
24
|
*/
|
|
25
|
-
export type
|
|
25
|
+
export type PromotionDetail = {
|
|
26
26
|
id?: string | undefined;
|
|
27
27
|
name?: string | undefined;
|
|
28
28
|
description?: string | undefined;
|
|
29
29
|
promotionType?: PromotionType | undefined;
|
|
30
30
|
tags?: Array<string> | undefined;
|
|
31
|
-
details?:
|
|
31
|
+
details?: PromotionDetailDetails | undefined;
|
|
32
32
|
hasRedemptionLimit?: boolean | undefined;
|
|
33
33
|
redemptionLimit?: number | undefined;
|
|
34
34
|
redemptionCount?: number | undefined;
|
|
@@ -64,56 +64,56 @@ export namespace PromotionType$ {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** @internal */
|
|
67
|
-
export const
|
|
68
|
-
|
|
67
|
+
export const PromotionDetailDetails$inboundSchema: z.ZodType<
|
|
68
|
+
PromotionDetailDetails,
|
|
69
69
|
z.ZodTypeDef,
|
|
70
70
|
unknown
|
|
71
71
|
> = z.object({});
|
|
72
72
|
|
|
73
73
|
/** @internal */
|
|
74
|
-
export type
|
|
74
|
+
export type PromotionDetailDetails$Outbound = {};
|
|
75
75
|
|
|
76
76
|
/** @internal */
|
|
77
|
-
export const
|
|
78
|
-
|
|
77
|
+
export const PromotionDetailDetails$outboundSchema: z.ZodType<
|
|
78
|
+
PromotionDetailDetails$Outbound,
|
|
79
79
|
z.ZodTypeDef,
|
|
80
|
-
|
|
80
|
+
PromotionDetailDetails
|
|
81
81
|
> = z.object({});
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
84
|
* @internal
|
|
85
85
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
86
86
|
*/
|
|
87
|
-
export namespace
|
|
88
|
-
/** @deprecated use `
|
|
89
|
-
export const inboundSchema =
|
|
90
|
-
/** @deprecated use `
|
|
91
|
-
export const outboundSchema =
|
|
92
|
-
/** @deprecated use `
|
|
93
|
-
export type Outbound =
|
|
87
|
+
export namespace PromotionDetailDetails$ {
|
|
88
|
+
/** @deprecated use `PromotionDetailDetails$inboundSchema` instead. */
|
|
89
|
+
export const inboundSchema = PromotionDetailDetails$inboundSchema;
|
|
90
|
+
/** @deprecated use `PromotionDetailDetails$outboundSchema` instead. */
|
|
91
|
+
export const outboundSchema = PromotionDetailDetails$outboundSchema;
|
|
92
|
+
/** @deprecated use `PromotionDetailDetails$Outbound` instead. */
|
|
93
|
+
export type Outbound = PromotionDetailDetails$Outbound;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
export function
|
|
97
|
-
|
|
96
|
+
export function promotionDetailDetailsToJSON(
|
|
97
|
+
promotionDetailDetails: PromotionDetailDetails,
|
|
98
98
|
): string {
|
|
99
99
|
return JSON.stringify(
|
|
100
|
-
|
|
100
|
+
PromotionDetailDetails$outboundSchema.parse(promotionDetailDetails),
|
|
101
101
|
);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export function
|
|
104
|
+
export function promotionDetailDetailsFromJSON(
|
|
105
105
|
jsonString: string,
|
|
106
|
-
): SafeParseResult<
|
|
106
|
+
): SafeParseResult<PromotionDetailDetails, SDKValidationError> {
|
|
107
107
|
return safeParse(
|
|
108
108
|
jsonString,
|
|
109
|
-
(x) =>
|
|
110
|
-
`Failed to parse '
|
|
109
|
+
(x) => PromotionDetailDetails$inboundSchema.parse(JSON.parse(x)),
|
|
110
|
+
`Failed to parse 'PromotionDetailDetails' from JSON`,
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
/** @internal */
|
|
115
|
-
export const
|
|
116
|
-
|
|
115
|
+
export const PromotionDetail$inboundSchema: z.ZodType<
|
|
116
|
+
PromotionDetail,
|
|
117
117
|
z.ZodTypeDef,
|
|
118
118
|
unknown
|
|
119
119
|
> = z.object({
|
|
@@ -122,7 +122,7 @@ export const Promotion$inboundSchema: z.ZodType<
|
|
|
122
122
|
description: z.string().optional(),
|
|
123
123
|
promotion_type: PromotionType$inboundSchema.optional(),
|
|
124
124
|
tags: z.array(z.string()).optional(),
|
|
125
|
-
details: z.lazy(() =>
|
|
125
|
+
details: z.lazy(() => PromotionDetailDetails$inboundSchema).optional(),
|
|
126
126
|
has_redemption_limit: z.boolean().optional(),
|
|
127
127
|
redemption_limit: z.number().int().optional(),
|
|
128
128
|
redemption_count: z.number().int().optional(),
|
|
@@ -157,13 +157,13 @@ export const Promotion$inboundSchema: z.ZodType<
|
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
/** @internal */
|
|
160
|
-
export type
|
|
160
|
+
export type PromotionDetail$Outbound = {
|
|
161
161
|
id?: string | undefined;
|
|
162
162
|
name?: string | undefined;
|
|
163
163
|
description?: string | undefined;
|
|
164
164
|
promotion_type?: string | undefined;
|
|
165
165
|
tags?: Array<string> | undefined;
|
|
166
|
-
details?:
|
|
166
|
+
details?: PromotionDetailDetails$Outbound | undefined;
|
|
167
167
|
has_redemption_limit?: boolean | undefined;
|
|
168
168
|
redemption_limit?: number | undefined;
|
|
169
169
|
redemption_count?: number | undefined;
|
|
@@ -178,17 +178,17 @@ export type Promotion$Outbound = {
|
|
|
178
178
|
};
|
|
179
179
|
|
|
180
180
|
/** @internal */
|
|
181
|
-
export const
|
|
182
|
-
|
|
181
|
+
export const PromotionDetail$outboundSchema: z.ZodType<
|
|
182
|
+
PromotionDetail$Outbound,
|
|
183
183
|
z.ZodTypeDef,
|
|
184
|
-
|
|
184
|
+
PromotionDetail
|
|
185
185
|
> = z.object({
|
|
186
186
|
id: z.string().optional(),
|
|
187
187
|
name: z.string().optional(),
|
|
188
188
|
description: z.string().optional(),
|
|
189
189
|
promotionType: PromotionType$outboundSchema.optional(),
|
|
190
190
|
tags: z.array(z.string()).optional(),
|
|
191
|
-
details: z.lazy(() =>
|
|
191
|
+
details: z.lazy(() => PromotionDetailDetails$outboundSchema).optional(),
|
|
192
192
|
hasRedemptionLimit: z.boolean().optional(),
|
|
193
193
|
redemptionLimit: z.number().int().optional(),
|
|
194
194
|
redemptionCount: z.number().int().optional(),
|
|
@@ -221,25 +221,27 @@ export const Promotion$outboundSchema: z.ZodType<
|
|
|
221
221
|
* @internal
|
|
222
222
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
223
223
|
*/
|
|
224
|
-
export namespace
|
|
225
|
-
/** @deprecated use `
|
|
226
|
-
export const inboundSchema =
|
|
227
|
-
/** @deprecated use `
|
|
228
|
-
export const outboundSchema =
|
|
229
|
-
/** @deprecated use `
|
|
230
|
-
export type Outbound =
|
|
224
|
+
export namespace PromotionDetail$ {
|
|
225
|
+
/** @deprecated use `PromotionDetail$inboundSchema` instead. */
|
|
226
|
+
export const inboundSchema = PromotionDetail$inboundSchema;
|
|
227
|
+
/** @deprecated use `PromotionDetail$outboundSchema` instead. */
|
|
228
|
+
export const outboundSchema = PromotionDetail$outboundSchema;
|
|
229
|
+
/** @deprecated use `PromotionDetail$Outbound` instead. */
|
|
230
|
+
export type Outbound = PromotionDetail$Outbound;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export function
|
|
234
|
-
|
|
233
|
+
export function promotionDetailToJSON(
|
|
234
|
+
promotionDetail: PromotionDetail,
|
|
235
|
+
): string {
|
|
236
|
+
return JSON.stringify(PromotionDetail$outboundSchema.parse(promotionDetail));
|
|
235
237
|
}
|
|
236
238
|
|
|
237
|
-
export function
|
|
239
|
+
export function promotionDetailFromJSON(
|
|
238
240
|
jsonString: string,
|
|
239
|
-
): SafeParseResult<
|
|
241
|
+
): SafeParseResult<PromotionDetail, SDKValidationError> {
|
|
240
242
|
return safeParse(
|
|
241
243
|
jsonString,
|
|
242
|
-
(x) =>
|
|
243
|
-
`Failed to parse '
|
|
244
|
+
(x) => PromotionDetail$inboundSchema.parse(JSON.parse(x)),
|
|
245
|
+
`Failed to parse 'PromotionDetail' from JSON`,
|
|
244
246
|
);
|
|
245
247
|
}
|
|
@@ -3,54 +3,41 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
9
|
|
|
11
10
|
export type Seo = {
|
|
12
|
-
metaTitle?: string | undefined;
|
|
13
|
-
metaDescription?: string | undefined;
|
|
14
|
-
metaKeywords?: Array<string> | undefined;
|
|
15
11
|
slug?: string | undefined;
|
|
12
|
+
title?: string | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
keywords?: Array<string> | undefined;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
/** @internal */
|
|
19
18
|
export const Seo$inboundSchema: z.ZodType<Seo, z.ZodTypeDef, unknown> = z
|
|
20
19
|
.object({
|
|
21
|
-
meta_title: z.string().optional(),
|
|
22
|
-
meta_description: z.string().optional(),
|
|
23
|
-
meta_keywords: z.array(z.string()).optional(),
|
|
24
20
|
slug: z.string().optional(),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"meta_description": "metaDescription",
|
|
29
|
-
"meta_keywords": "metaKeywords",
|
|
30
|
-
});
|
|
21
|
+
title: z.string().optional(),
|
|
22
|
+
description: z.string().optional(),
|
|
23
|
+
keywords: z.array(z.string()).optional(),
|
|
31
24
|
});
|
|
32
25
|
|
|
33
26
|
/** @internal */
|
|
34
27
|
export type Seo$Outbound = {
|
|
35
|
-
meta_title?: string | undefined;
|
|
36
|
-
meta_description?: string | undefined;
|
|
37
|
-
meta_keywords?: Array<string> | undefined;
|
|
38
28
|
slug?: string | undefined;
|
|
29
|
+
title?: string | undefined;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
keywords?: Array<string> | undefined;
|
|
39
32
|
};
|
|
40
33
|
|
|
41
34
|
/** @internal */
|
|
42
35
|
export const Seo$outboundSchema: z.ZodType<Seo$Outbound, z.ZodTypeDef, Seo> = z
|
|
43
36
|
.object({
|
|
44
|
-
metaTitle: z.string().optional(),
|
|
45
|
-
metaDescription: z.string().optional(),
|
|
46
|
-
metaKeywords: z.array(z.string()).optional(),
|
|
47
37
|
slug: z.string().optional(),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
metaDescription: "meta_description",
|
|
52
|
-
metaKeywords: "meta_keywords",
|
|
53
|
-
});
|
|
38
|
+
title: z.string().optional(),
|
|
39
|
+
description: z.string().optional(),
|
|
40
|
+
keywords: z.array(z.string()).optional(),
|
|
54
41
|
});
|
|
55
42
|
|
|
56
43
|
/**
|