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
|
@@ -0,0 +1,501 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
AssociatedOption,
|
|
13
|
+
AssociatedOption$inboundSchema,
|
|
14
|
+
AssociatedOption$Outbound,
|
|
15
|
+
AssociatedOption$outboundSchema,
|
|
16
|
+
} from "./associatedoption.js";
|
|
17
|
+
import {
|
|
18
|
+
ProductAttribute,
|
|
19
|
+
ProductAttribute$inboundSchema,
|
|
20
|
+
ProductAttribute$Outbound,
|
|
21
|
+
ProductAttribute$outboundSchema,
|
|
22
|
+
} from "./productattribute.js";
|
|
23
|
+
import {
|
|
24
|
+
ProductImage,
|
|
25
|
+
ProductImage$inboundSchema,
|
|
26
|
+
ProductImage$Outbound,
|
|
27
|
+
ProductImage$outboundSchema,
|
|
28
|
+
} from "./productimage.js";
|
|
29
|
+
import {
|
|
30
|
+
ProductPricing,
|
|
31
|
+
ProductPricing$inboundSchema,
|
|
32
|
+
ProductPricing$Outbound,
|
|
33
|
+
ProductPricing$outboundSchema,
|
|
34
|
+
} from "./productpricing.js";
|
|
35
|
+
import {
|
|
36
|
+
ProductPromotion,
|
|
37
|
+
ProductPromotion$inboundSchema,
|
|
38
|
+
ProductPromotion$Outbound,
|
|
39
|
+
ProductPromotion$outboundSchema,
|
|
40
|
+
} from "./productpromotion.js";
|
|
41
|
+
import {
|
|
42
|
+
ProductSubscription,
|
|
43
|
+
ProductSubscription$inboundSchema,
|
|
44
|
+
ProductSubscription$Outbound,
|
|
45
|
+
ProductSubscription$outboundSchema,
|
|
46
|
+
} from "./productsubscription.js";
|
|
47
|
+
import {
|
|
48
|
+
VariantOption,
|
|
49
|
+
VariantOption$inboundSchema,
|
|
50
|
+
VariantOption$Outbound,
|
|
51
|
+
VariantOption$outboundSchema,
|
|
52
|
+
} from "./variantoption.js";
|
|
53
|
+
|
|
54
|
+
export const BundleProductProductType = {
|
|
55
|
+
Physical: "physical",
|
|
56
|
+
Digital: "digital",
|
|
57
|
+
Bundle: "bundle",
|
|
58
|
+
} as const;
|
|
59
|
+
export type BundleProductProductType = ClosedEnum<
|
|
60
|
+
typeof BundleProductProductType
|
|
61
|
+
>;
|
|
62
|
+
|
|
63
|
+
export const BundleProductBundleItemsProductType = {
|
|
64
|
+
Physical: "physical",
|
|
65
|
+
Digital: "digital",
|
|
66
|
+
Bundle: "bundle",
|
|
67
|
+
} as const;
|
|
68
|
+
export type BundleProductBundleItemsProductType = ClosedEnum<
|
|
69
|
+
typeof BundleProductBundleItemsProductType
|
|
70
|
+
>;
|
|
71
|
+
|
|
72
|
+
export type BundleProductSKU = {
|
|
73
|
+
quantity: number;
|
|
74
|
+
productId: string;
|
|
75
|
+
variantId?: string | null | undefined;
|
|
76
|
+
sku: string;
|
|
77
|
+
slug?: string | undefined;
|
|
78
|
+
productName: string;
|
|
79
|
+
variantName?: string | null | undefined;
|
|
80
|
+
productType: BundleProductBundleItemsProductType;
|
|
81
|
+
shortDescription?: string | undefined;
|
|
82
|
+
active?: boolean | undefined;
|
|
83
|
+
stockAvailable?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
86
|
+
*/
|
|
87
|
+
onOffer?: boolean | undefined;
|
|
88
|
+
onSubscription?: boolean | undefined;
|
|
89
|
+
onPromotion?: boolean | undefined;
|
|
90
|
+
categoryIds?: Array<string> | undefined;
|
|
91
|
+
tags?: Array<string> | undefined;
|
|
92
|
+
reviewsCount?: number | undefined;
|
|
93
|
+
reviewsRatingSum?: number | undefined;
|
|
94
|
+
attributes?: Array<ProductAttribute> | undefined;
|
|
95
|
+
images?: Array<ProductImage> | undefined;
|
|
96
|
+
pricing?: ProductPricing | undefined;
|
|
97
|
+
promotion?: ProductPromotion | null | undefined;
|
|
98
|
+
subscription?: Array<ProductSubscription> | undefined;
|
|
99
|
+
associatedOptions?: { [k: string]: AssociatedOption } | null | undefined;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export type BundleProduct = {
|
|
103
|
+
/**
|
|
104
|
+
* The ULID of the product
|
|
105
|
+
*/
|
|
106
|
+
id: string;
|
|
107
|
+
sku?: string | undefined;
|
|
108
|
+
name: string;
|
|
109
|
+
slug: string;
|
|
110
|
+
shortDescription?: string | undefined;
|
|
111
|
+
productType: BundleProductProductType;
|
|
112
|
+
active?: boolean | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Indicates whether the product has stock available
|
|
115
|
+
*/
|
|
116
|
+
stockAvailable?: boolean | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Indicates whether this item is associated with any active (product-specific) coupons
|
|
119
|
+
*/
|
|
120
|
+
onOffer?: boolean | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Indicates whether the product has any subscription plans avaialble
|
|
123
|
+
*/
|
|
124
|
+
onSubscription?: boolean | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Indicates whether the product is currently on promotion. When true, the `ProductPromotion` object will contain details of the promotion
|
|
127
|
+
*/
|
|
128
|
+
onPromotion?: boolean | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Indicates whether the product has variants
|
|
131
|
+
*/
|
|
132
|
+
hasVariant?: boolean | undefined;
|
|
133
|
+
tags?: Array<string> | null | undefined;
|
|
134
|
+
categoryIds?: Array<string> | undefined;
|
|
135
|
+
reviewsRatingSum?: number | undefined;
|
|
136
|
+
reviewsCount?: number | undefined;
|
|
137
|
+
attributes?: Array<ProductAttribute> | undefined;
|
|
138
|
+
pricing?: ProductPricing | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* this will be used if has_variant is true, to auto set default values.
|
|
141
|
+
*/
|
|
142
|
+
variantOptions?: Array<VariantOption> | null | undefined;
|
|
143
|
+
promotion?: ProductPromotion | null | undefined;
|
|
144
|
+
images?: Array<ProductImage> | undefined;
|
|
145
|
+
subscription?: Array<ProductSubscription> | undefined;
|
|
146
|
+
bundleItems?: Array<BundleProductSKU> | undefined;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/** @internal */
|
|
150
|
+
export const BundleProductProductType$inboundSchema: z.ZodNativeEnum<
|
|
151
|
+
typeof BundleProductProductType
|
|
152
|
+
> = z.nativeEnum(BundleProductProductType);
|
|
153
|
+
|
|
154
|
+
/** @internal */
|
|
155
|
+
export const BundleProductProductType$outboundSchema: z.ZodNativeEnum<
|
|
156
|
+
typeof BundleProductProductType
|
|
157
|
+
> = BundleProductProductType$inboundSchema;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @internal
|
|
161
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
162
|
+
*/
|
|
163
|
+
export namespace BundleProductProductType$ {
|
|
164
|
+
/** @deprecated use `BundleProductProductType$inboundSchema` instead. */
|
|
165
|
+
export const inboundSchema = BundleProductProductType$inboundSchema;
|
|
166
|
+
/** @deprecated use `BundleProductProductType$outboundSchema` instead. */
|
|
167
|
+
export const outboundSchema = BundleProductProductType$outboundSchema;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/** @internal */
|
|
171
|
+
export const BundleProductBundleItemsProductType$inboundSchema: z.ZodNativeEnum<
|
|
172
|
+
typeof BundleProductBundleItemsProductType
|
|
173
|
+
> = z.nativeEnum(BundleProductBundleItemsProductType);
|
|
174
|
+
|
|
175
|
+
/** @internal */
|
|
176
|
+
export const BundleProductBundleItemsProductType$outboundSchema:
|
|
177
|
+
z.ZodNativeEnum<typeof BundleProductBundleItemsProductType> =
|
|
178
|
+
BundleProductBundleItemsProductType$inboundSchema;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @internal
|
|
182
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
183
|
+
*/
|
|
184
|
+
export namespace BundleProductBundleItemsProductType$ {
|
|
185
|
+
/** @deprecated use `BundleProductBundleItemsProductType$inboundSchema` instead. */
|
|
186
|
+
export const inboundSchema =
|
|
187
|
+
BundleProductBundleItemsProductType$inboundSchema;
|
|
188
|
+
/** @deprecated use `BundleProductBundleItemsProductType$outboundSchema` instead. */
|
|
189
|
+
export const outboundSchema =
|
|
190
|
+
BundleProductBundleItemsProductType$outboundSchema;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** @internal */
|
|
194
|
+
export const BundleProductSKU$inboundSchema: z.ZodType<
|
|
195
|
+
BundleProductSKU,
|
|
196
|
+
z.ZodTypeDef,
|
|
197
|
+
unknown
|
|
198
|
+
> = z.object({
|
|
199
|
+
quantity: z.number().int(),
|
|
200
|
+
product_id: z.string(),
|
|
201
|
+
variant_id: z.nullable(z.string()).optional(),
|
|
202
|
+
sku: z.string(),
|
|
203
|
+
slug: z.string().optional(),
|
|
204
|
+
product_name: z.string(),
|
|
205
|
+
variant_name: z.nullable(z.string()).optional(),
|
|
206
|
+
product_type: BundleProductBundleItemsProductType$inboundSchema,
|
|
207
|
+
short_description: z.string().optional(),
|
|
208
|
+
active: z.boolean().default(true),
|
|
209
|
+
stock_available: z.boolean().default(true),
|
|
210
|
+
on_offer: z.boolean().default(false),
|
|
211
|
+
on_subscription: z.boolean().default(false),
|
|
212
|
+
on_promotion: z.boolean().default(false),
|
|
213
|
+
category_ids: z.array(z.string()).optional(),
|
|
214
|
+
tags: z.array(z.string()).optional(),
|
|
215
|
+
reviews_count: z.number().int().optional(),
|
|
216
|
+
reviews_rating_sum: z.number().optional(),
|
|
217
|
+
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
218
|
+
images: z.array(ProductImage$inboundSchema).optional(),
|
|
219
|
+
pricing: ProductPricing$inboundSchema.optional(),
|
|
220
|
+
promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
|
|
221
|
+
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
222
|
+
associated_options: z.nullable(z.record(AssociatedOption$inboundSchema))
|
|
223
|
+
.optional(),
|
|
224
|
+
}).transform((v) => {
|
|
225
|
+
return remap$(v, {
|
|
226
|
+
"product_id": "productId",
|
|
227
|
+
"variant_id": "variantId",
|
|
228
|
+
"product_name": "productName",
|
|
229
|
+
"variant_name": "variantName",
|
|
230
|
+
"product_type": "productType",
|
|
231
|
+
"short_description": "shortDescription",
|
|
232
|
+
"stock_available": "stockAvailable",
|
|
233
|
+
"on_offer": "onOffer",
|
|
234
|
+
"on_subscription": "onSubscription",
|
|
235
|
+
"on_promotion": "onPromotion",
|
|
236
|
+
"category_ids": "categoryIds",
|
|
237
|
+
"reviews_count": "reviewsCount",
|
|
238
|
+
"reviews_rating_sum": "reviewsRatingSum",
|
|
239
|
+
"associated_options": "associatedOptions",
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
/** @internal */
|
|
244
|
+
export type BundleProductSKU$Outbound = {
|
|
245
|
+
quantity: number;
|
|
246
|
+
product_id: string;
|
|
247
|
+
variant_id?: string | null | undefined;
|
|
248
|
+
sku: string;
|
|
249
|
+
slug?: string | undefined;
|
|
250
|
+
product_name: string;
|
|
251
|
+
variant_name?: string | null | undefined;
|
|
252
|
+
product_type: string;
|
|
253
|
+
short_description?: string | undefined;
|
|
254
|
+
active: boolean;
|
|
255
|
+
stock_available: boolean;
|
|
256
|
+
on_offer: boolean;
|
|
257
|
+
on_subscription: boolean;
|
|
258
|
+
on_promotion: boolean;
|
|
259
|
+
category_ids?: Array<string> | undefined;
|
|
260
|
+
tags?: Array<string> | undefined;
|
|
261
|
+
reviews_count?: number | undefined;
|
|
262
|
+
reviews_rating_sum?: number | undefined;
|
|
263
|
+
attributes?: Array<ProductAttribute$Outbound> | undefined;
|
|
264
|
+
images?: Array<ProductImage$Outbound> | undefined;
|
|
265
|
+
pricing?: ProductPricing$Outbound | undefined;
|
|
266
|
+
promotion?: ProductPromotion$Outbound | null | undefined;
|
|
267
|
+
subscription?: Array<ProductSubscription$Outbound> | undefined;
|
|
268
|
+
associated_options?:
|
|
269
|
+
| { [k: string]: AssociatedOption$Outbound }
|
|
270
|
+
| null
|
|
271
|
+
| undefined;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
/** @internal */
|
|
275
|
+
export const BundleProductSKU$outboundSchema: z.ZodType<
|
|
276
|
+
BundleProductSKU$Outbound,
|
|
277
|
+
z.ZodTypeDef,
|
|
278
|
+
BundleProductSKU
|
|
279
|
+
> = z.object({
|
|
280
|
+
quantity: z.number().int(),
|
|
281
|
+
productId: z.string(),
|
|
282
|
+
variantId: z.nullable(z.string()).optional(),
|
|
283
|
+
sku: z.string(),
|
|
284
|
+
slug: z.string().optional(),
|
|
285
|
+
productName: z.string(),
|
|
286
|
+
variantName: z.nullable(z.string()).optional(),
|
|
287
|
+
productType: BundleProductBundleItemsProductType$outboundSchema,
|
|
288
|
+
shortDescription: z.string().optional(),
|
|
289
|
+
active: z.boolean().default(true),
|
|
290
|
+
stockAvailable: z.boolean().default(true),
|
|
291
|
+
onOffer: z.boolean().default(false),
|
|
292
|
+
onSubscription: z.boolean().default(false),
|
|
293
|
+
onPromotion: z.boolean().default(false),
|
|
294
|
+
categoryIds: z.array(z.string()).optional(),
|
|
295
|
+
tags: z.array(z.string()).optional(),
|
|
296
|
+
reviewsCount: z.number().int().optional(),
|
|
297
|
+
reviewsRatingSum: z.number().optional(),
|
|
298
|
+
attributes: z.array(ProductAttribute$outboundSchema).optional(),
|
|
299
|
+
images: z.array(ProductImage$outboundSchema).optional(),
|
|
300
|
+
pricing: ProductPricing$outboundSchema.optional(),
|
|
301
|
+
promotion: z.nullable(ProductPromotion$outboundSchema).optional(),
|
|
302
|
+
subscription: z.array(ProductSubscription$outboundSchema).optional(),
|
|
303
|
+
associatedOptions: z.nullable(z.record(AssociatedOption$outboundSchema))
|
|
304
|
+
.optional(),
|
|
305
|
+
}).transform((v) => {
|
|
306
|
+
return remap$(v, {
|
|
307
|
+
productId: "product_id",
|
|
308
|
+
variantId: "variant_id",
|
|
309
|
+
productName: "product_name",
|
|
310
|
+
variantName: "variant_name",
|
|
311
|
+
productType: "product_type",
|
|
312
|
+
shortDescription: "short_description",
|
|
313
|
+
stockAvailable: "stock_available",
|
|
314
|
+
onOffer: "on_offer",
|
|
315
|
+
onSubscription: "on_subscription",
|
|
316
|
+
onPromotion: "on_promotion",
|
|
317
|
+
categoryIds: "category_ids",
|
|
318
|
+
reviewsCount: "reviews_count",
|
|
319
|
+
reviewsRatingSum: "reviews_rating_sum",
|
|
320
|
+
associatedOptions: "associated_options",
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* @internal
|
|
326
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
327
|
+
*/
|
|
328
|
+
export namespace BundleProductSKU$ {
|
|
329
|
+
/** @deprecated use `BundleProductSKU$inboundSchema` instead. */
|
|
330
|
+
export const inboundSchema = BundleProductSKU$inboundSchema;
|
|
331
|
+
/** @deprecated use `BundleProductSKU$outboundSchema` instead. */
|
|
332
|
+
export const outboundSchema = BundleProductSKU$outboundSchema;
|
|
333
|
+
/** @deprecated use `BundleProductSKU$Outbound` instead. */
|
|
334
|
+
export type Outbound = BundleProductSKU$Outbound;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
export function bundleProductSKUToJSON(
|
|
338
|
+
bundleProductSKU: BundleProductSKU,
|
|
339
|
+
): string {
|
|
340
|
+
return JSON.stringify(
|
|
341
|
+
BundleProductSKU$outboundSchema.parse(bundleProductSKU),
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
export function bundleProductSKUFromJSON(
|
|
346
|
+
jsonString: string,
|
|
347
|
+
): SafeParseResult<BundleProductSKU, SDKValidationError> {
|
|
348
|
+
return safeParse(
|
|
349
|
+
jsonString,
|
|
350
|
+
(x) => BundleProductSKU$inboundSchema.parse(JSON.parse(x)),
|
|
351
|
+
`Failed to parse 'BundleProductSKU' from JSON`,
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/** @internal */
|
|
356
|
+
export const BundleProduct$inboundSchema: z.ZodType<
|
|
357
|
+
BundleProduct,
|
|
358
|
+
z.ZodTypeDef,
|
|
359
|
+
unknown
|
|
360
|
+
> = z.object({
|
|
361
|
+
id: z.string(),
|
|
362
|
+
sku: z.string().optional(),
|
|
363
|
+
name: z.string(),
|
|
364
|
+
slug: z.string(),
|
|
365
|
+
short_description: z.string().optional(),
|
|
366
|
+
product_type: BundleProductProductType$inboundSchema,
|
|
367
|
+
active: z.boolean().default(true),
|
|
368
|
+
stock_available: z.boolean().default(true),
|
|
369
|
+
on_offer: z.boolean().default(false),
|
|
370
|
+
on_subscription: z.boolean().default(false),
|
|
371
|
+
on_promotion: z.boolean().default(false),
|
|
372
|
+
has_variant: z.boolean().default(false),
|
|
373
|
+
tags: z.nullable(z.array(z.string())).optional(),
|
|
374
|
+
category_ids: z.array(z.string()).optional(),
|
|
375
|
+
reviews_rating_sum: z.number().optional(),
|
|
376
|
+
reviews_count: z.number().int().optional(),
|
|
377
|
+
attributes: z.array(ProductAttribute$inboundSchema).optional(),
|
|
378
|
+
pricing: ProductPricing$inboundSchema.optional(),
|
|
379
|
+
variant_options: z.nullable(z.array(VariantOption$inboundSchema)).optional(),
|
|
380
|
+
promotion: z.nullable(ProductPromotion$inboundSchema).optional(),
|
|
381
|
+
images: z.array(ProductImage$inboundSchema).optional(),
|
|
382
|
+
subscription: z.array(ProductSubscription$inboundSchema).optional(),
|
|
383
|
+
bundle_items: z.array(z.lazy(() => BundleProductSKU$inboundSchema))
|
|
384
|
+
.optional(),
|
|
385
|
+
}).transform((v) => {
|
|
386
|
+
return remap$(v, {
|
|
387
|
+
"short_description": "shortDescription",
|
|
388
|
+
"product_type": "productType",
|
|
389
|
+
"stock_available": "stockAvailable",
|
|
390
|
+
"on_offer": "onOffer",
|
|
391
|
+
"on_subscription": "onSubscription",
|
|
392
|
+
"on_promotion": "onPromotion",
|
|
393
|
+
"has_variant": "hasVariant",
|
|
394
|
+
"category_ids": "categoryIds",
|
|
395
|
+
"reviews_rating_sum": "reviewsRatingSum",
|
|
396
|
+
"reviews_count": "reviewsCount",
|
|
397
|
+
"variant_options": "variantOptions",
|
|
398
|
+
"bundle_items": "bundleItems",
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
/** @internal */
|
|
403
|
+
export type BundleProduct$Outbound = {
|
|
404
|
+
id: string;
|
|
405
|
+
sku?: string | undefined;
|
|
406
|
+
name: string;
|
|
407
|
+
slug: string;
|
|
408
|
+
short_description?: string | undefined;
|
|
409
|
+
product_type: string;
|
|
410
|
+
active: boolean;
|
|
411
|
+
stock_available: boolean;
|
|
412
|
+
on_offer: boolean;
|
|
413
|
+
on_subscription: boolean;
|
|
414
|
+
on_promotion: boolean;
|
|
415
|
+
has_variant: boolean;
|
|
416
|
+
tags?: Array<string> | null | undefined;
|
|
417
|
+
category_ids?: Array<string> | undefined;
|
|
418
|
+
reviews_rating_sum?: number | undefined;
|
|
419
|
+
reviews_count?: number | undefined;
|
|
420
|
+
attributes?: Array<ProductAttribute$Outbound> | undefined;
|
|
421
|
+
pricing?: ProductPricing$Outbound | undefined;
|
|
422
|
+
variant_options?: Array<VariantOption$Outbound> | null | undefined;
|
|
423
|
+
promotion?: ProductPromotion$Outbound | null | undefined;
|
|
424
|
+
images?: Array<ProductImage$Outbound> | undefined;
|
|
425
|
+
subscription?: Array<ProductSubscription$Outbound> | undefined;
|
|
426
|
+
bundle_items?: Array<BundleProductSKU$Outbound> | undefined;
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
/** @internal */
|
|
430
|
+
export const BundleProduct$outboundSchema: z.ZodType<
|
|
431
|
+
BundleProduct$Outbound,
|
|
432
|
+
z.ZodTypeDef,
|
|
433
|
+
BundleProduct
|
|
434
|
+
> = z.object({
|
|
435
|
+
id: z.string(),
|
|
436
|
+
sku: z.string().optional(),
|
|
437
|
+
name: z.string(),
|
|
438
|
+
slug: z.string(),
|
|
439
|
+
shortDescription: z.string().optional(),
|
|
440
|
+
productType: BundleProductProductType$outboundSchema,
|
|
441
|
+
active: z.boolean().default(true),
|
|
442
|
+
stockAvailable: z.boolean().default(true),
|
|
443
|
+
onOffer: z.boolean().default(false),
|
|
444
|
+
onSubscription: z.boolean().default(false),
|
|
445
|
+
onPromotion: z.boolean().default(false),
|
|
446
|
+
hasVariant: z.boolean().default(false),
|
|
447
|
+
tags: z.nullable(z.array(z.string())).optional(),
|
|
448
|
+
categoryIds: z.array(z.string()).optional(),
|
|
449
|
+
reviewsRatingSum: z.number().optional(),
|
|
450
|
+
reviewsCount: z.number().int().optional(),
|
|
451
|
+
attributes: z.array(ProductAttribute$outboundSchema).optional(),
|
|
452
|
+
pricing: ProductPricing$outboundSchema.optional(),
|
|
453
|
+
variantOptions: z.nullable(z.array(VariantOption$outboundSchema)).optional(),
|
|
454
|
+
promotion: z.nullable(ProductPromotion$outboundSchema).optional(),
|
|
455
|
+
images: z.array(ProductImage$outboundSchema).optional(),
|
|
456
|
+
subscription: z.array(ProductSubscription$outboundSchema).optional(),
|
|
457
|
+
bundleItems: z.array(z.lazy(() => BundleProductSKU$outboundSchema))
|
|
458
|
+
.optional(),
|
|
459
|
+
}).transform((v) => {
|
|
460
|
+
return remap$(v, {
|
|
461
|
+
shortDescription: "short_description",
|
|
462
|
+
productType: "product_type",
|
|
463
|
+
stockAvailable: "stock_available",
|
|
464
|
+
onOffer: "on_offer",
|
|
465
|
+
onSubscription: "on_subscription",
|
|
466
|
+
onPromotion: "on_promotion",
|
|
467
|
+
hasVariant: "has_variant",
|
|
468
|
+
categoryIds: "category_ids",
|
|
469
|
+
reviewsRatingSum: "reviews_rating_sum",
|
|
470
|
+
reviewsCount: "reviews_count",
|
|
471
|
+
variantOptions: "variant_options",
|
|
472
|
+
bundleItems: "bundle_items",
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* @internal
|
|
478
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
479
|
+
*/
|
|
480
|
+
export namespace BundleProduct$ {
|
|
481
|
+
/** @deprecated use `BundleProduct$inboundSchema` instead. */
|
|
482
|
+
export const inboundSchema = BundleProduct$inboundSchema;
|
|
483
|
+
/** @deprecated use `BundleProduct$outboundSchema` instead. */
|
|
484
|
+
export const outboundSchema = BundleProduct$outboundSchema;
|
|
485
|
+
/** @deprecated use `BundleProduct$Outbound` instead. */
|
|
486
|
+
export type Outbound = BundleProduct$Outbound;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export function bundleProductToJSON(bundleProduct: BundleProduct): string {
|
|
490
|
+
return JSON.stringify(BundleProduct$outboundSchema.parse(bundleProduct));
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export function bundleProductFromJSON(
|
|
494
|
+
jsonString: string,
|
|
495
|
+
): SafeParseResult<BundleProduct, SDKValidationError> {
|
|
496
|
+
return safeParse(
|
|
497
|
+
jsonString,
|
|
498
|
+
(x) => BundleProduct$inboundSchema.parse(JSON.parse(x)),
|
|
499
|
+
`Failed to parse 'BundleProduct' from JSON`,
|
|
500
|
+
);
|
|
501
|
+
}
|