@commercelayer/demo-store-types 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -21
- package/dist/config/facets.config.d.ts +8 -8
- package/dist/config/general.config.d.ts +1 -1
- package/dist/config/variants.config.d.ts +5 -5
- package/dist/json/catalogs.d.ts +34 -24
- package/dist/json/catalogs.js +2 -2
- package/dist/json/countries.d.ts +48 -39
- package/dist/json/countries.js +3 -3
- package/dist/json/languages.d.ts +23 -23
- package/dist/json/languages.js +2 -2
- package/dist/json/organization.d.ts +45 -33
- package/dist/json/organization.js +1 -2
- package/dist/json/page-components/carousel.d.ts +19 -0
- package/dist/json/page-components/carousel.js +10 -0
- package/dist/json/page-components/grid.d.ts +17 -0
- package/dist/json/page-components/grid.js +10 -0
- package/dist/json/page-components/hero.d.ts +33 -0
- package/dist/json/page-components/hero.js +13 -0
- package/dist/json/page-components/image.d.ts +12 -0
- package/dist/json/page-components/image.js +8 -0
- package/dist/json/page-components/item.d.ts +31 -0
- package/dist/json/page-components/item.js +12 -0
- package/dist/json/page-components/markdown.d.ts +18 -0
- package/dist/json/page-components/markdown.js +20 -0
- package/dist/json/page-components/product-grid.d.ts +20 -0
- package/dist/json/page-components/product-grid.js +10 -0
- package/dist/json/pages.d.ts +120 -1195
- package/dist/json/pages.js +17 -50
- package/dist/json/products.d.ts +194 -126
- package/dist/json/products.js +8 -2
- package/dist/json/taxonomies.d.ts +38 -29
- package/dist/json/taxonomies.js +2 -2
- package/dist/json/taxons.d.ts +65 -80
- package/dist/json/taxons.js +2 -2
- package/dist/utils/locale.d.ts +11 -5
- package/dist/utils/locale.js +6 -1
- package/dist/utils/sort.d.ts +2 -2
- package/package.json +6 -5
package/dist/json/pages.js
CHANGED
|
@@ -1,58 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rawDataPages_schema = void 0;
|
|
3
|
+
exports.rawDataPages_schema = exports.rawDataPage_schema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const locale_1 = require("../utils/locale");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
title: zod_1.z.string(),
|
|
13
|
-
description: zod_1.z.string(),
|
|
14
|
-
linkLabel: zod_1.z.string(),
|
|
15
|
-
linkHref: zod_1.z.string()
|
|
16
|
-
});
|
|
17
|
-
const carousel_schema = zod_1.z.object({
|
|
18
|
-
type: zod_1.z.literal('carousel'),
|
|
19
|
-
id: zod_1.z.string(),
|
|
20
|
-
slides: slide_schema.array()
|
|
21
|
-
});
|
|
22
|
-
const hero_schema = zod_1.z.object({
|
|
23
|
-
type: zod_1.z.literal('hero'),
|
|
24
|
-
id: zod_1.z.string(),
|
|
25
|
-
image: image_schema,
|
|
26
|
-
title: zod_1.z.string(),
|
|
27
|
-
description: zod_1.z.string().optional(),
|
|
28
|
-
href: zod_1.z.string()
|
|
29
|
-
});
|
|
30
|
-
const productGrid_schema = zod_1.z.object({
|
|
31
|
-
type: zod_1.z.literal('product-grid'),
|
|
32
|
-
id: zod_1.z.string(),
|
|
33
|
-
title: zod_1.z.string(),
|
|
34
|
-
skus: zod_1.z.string().array()
|
|
35
|
-
});
|
|
36
|
-
const grid_schema = zod_1.z.object({
|
|
37
|
-
type: zod_1.z.literal('grid'),
|
|
38
|
-
id: zod_1.z.string(),
|
|
39
|
-
items: slide_schema.array()
|
|
40
|
-
});
|
|
41
|
-
const markdown_schema = zod_1.z.object({
|
|
42
|
-
type: zod_1.z.literal('markdown'),
|
|
43
|
-
id: zod_1.z.string(),
|
|
44
|
-
content: zod_1.z.string()
|
|
45
|
-
});
|
|
46
|
-
const pages_schema = zod_1.z.object({})
|
|
47
|
-
.catchall((0, locale_1.localizedFieldSchema)(zod_1.z.object({
|
|
6
|
+
const carousel_1 = require("./page-components/carousel");
|
|
7
|
+
const grid_1 = require("./page-components/grid");
|
|
8
|
+
const hero_1 = require("./page-components/hero");
|
|
9
|
+
const markdown_1 = require("./page-components/markdown");
|
|
10
|
+
const product_grid_1 = require("./page-components/product-grid");
|
|
11
|
+
exports.rawDataPage_schema = zod_1.z.object({
|
|
48
12
|
title: zod_1.z.string().optional(),
|
|
49
13
|
description: zod_1.z.string().optional(),
|
|
50
14
|
components: zod_1.z.discriminatedUnion('type', [
|
|
51
|
-
carousel_schema,
|
|
52
|
-
grid_schema,
|
|
53
|
-
hero_schema,
|
|
54
|
-
productGrid_schema,
|
|
55
|
-
markdown_schema,
|
|
15
|
+
carousel_1.carousel_schema,
|
|
16
|
+
grid_1.grid_schema,
|
|
17
|
+
hero_1.hero_schema,
|
|
18
|
+
product_grid_1.productGrid_schema,
|
|
19
|
+
markdown_1.markdown_schema,
|
|
56
20
|
]).array()
|
|
57
|
-
})
|
|
58
|
-
|
|
21
|
+
});
|
|
22
|
+
const rawDataLocalizedPage_schema = (0, locale_1.localizedFieldSchema)(exports.rawDataPage_schema);
|
|
23
|
+
exports.rawDataPages_schema = zod_1.z
|
|
24
|
+
.object({})
|
|
25
|
+
.catchall(rawDataLocalizedPage_schema);
|
package/dist/json/products.d.ts
CHANGED
|
@@ -1,143 +1,204 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
import { LocalizedFieldSchema } from '../utils/locale';
|
|
3
|
+
type DetailSchema = z.ZodObject<{
|
|
4
|
+
/**
|
|
5
|
+
* Accordion title
|
|
6
|
+
*/
|
|
7
|
+
title: LocalizedFieldSchema<z.ZodString>;
|
|
8
|
+
/**
|
|
9
|
+
* Accordion content
|
|
10
|
+
*/
|
|
11
|
+
content: LocalizedFieldSchema<z.ZodString>;
|
|
12
|
+
}>;
|
|
13
|
+
type RawDataProductSchema = z.ZodObject<{
|
|
14
|
+
/**
|
|
15
|
+
* The **product code** identifies the base product
|
|
16
|
+
*
|
|
17
|
+
* A master product or base product is a non-sellable product that represents a group of similar or related products.
|
|
18
|
+
*
|
|
19
|
+
* For example, a clothing retailer may have a master product for each type of clothing item, such as "men's t-shirts" or "women's dresses".
|
|
20
|
+
* Each of these master products would contain multiple variations, such as different sizes, colors, and styles.
|
|
21
|
+
*/
|
|
3
22
|
productCode: z.ZodString;
|
|
23
|
+
/**
|
|
24
|
+
* The **variant code** identifies a variation product
|
|
25
|
+
*
|
|
26
|
+
* A variation product is a product that is part of a group of similar or related products,
|
|
27
|
+
* and it is identified by specific attributes or characteristics that distinguish it from the other products in the group (color, material, size, etc.).
|
|
28
|
+
*
|
|
29
|
+
* The `variantCode`, in Demo Store, is used for grouping similar products in the listing page.
|
|
30
|
+
* Usually a different `variantCode` corresponds to a different product image.
|
|
31
|
+
*/
|
|
4
32
|
variantCode: z.ZodString;
|
|
33
|
+
/**
|
|
34
|
+
* The **sku** is a **unique identifier**, meaning *Stock Keeping Unit*.
|
|
35
|
+
*
|
|
36
|
+
* This is the stock unit in a warehouse used to track availability and stock variations of an item to be sold.
|
|
37
|
+
* SKUs can be a variant of any item (e.g., Medium or Large size of a jogger pant).
|
|
38
|
+
*
|
|
39
|
+
* An SKU usually consists of letters and numbers (either EAN code, UPC, or any other code format) like "LSLEEVMM000000FFFFFFMXXX".
|
|
40
|
+
* SKU refers to an item's details, including variants data (e.g., a T-shirt, Red color, Nike brand, 0.5g, XL size).
|
|
41
|
+
* An SKU identifies each product item's characteristics such as manufacturer name, brand name, style, color, weight, and size.
|
|
42
|
+
*/
|
|
5
43
|
sku: z.ZodString;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
slug: string;
|
|
63
|
-
images: string[];
|
|
64
|
-
}, {
|
|
65
|
-
details?: {
|
|
66
|
-
title: {
|
|
67
|
-
[x: string]: string | undefined;
|
|
68
|
-
};
|
|
69
|
-
content: {
|
|
70
|
-
[x: string]: string | undefined;
|
|
71
|
-
};
|
|
72
|
-
}[] | undefined;
|
|
73
|
-
name: {
|
|
74
|
-
[x: string]: string | undefined;
|
|
75
|
-
};
|
|
76
|
-
description: {
|
|
77
|
-
[x: string]: string | undefined;
|
|
78
|
-
};
|
|
79
|
-
productCode: string;
|
|
80
|
-
variantCode: string;
|
|
81
|
-
sku: string;
|
|
82
|
-
slug: string;
|
|
83
|
-
images: string[];
|
|
44
|
+
/**
|
|
45
|
+
* The product URL slug
|
|
46
|
+
*
|
|
47
|
+
* The slug is the part of a URL that identifies a particular page on a website in an easy-to-read form.
|
|
48
|
+
*
|
|
49
|
+
* It should always start with a forward slash (`/`).
|
|
50
|
+
* @example "/white-apron-with-black-logo/APRONXXXFFFFFF000000XXXX"
|
|
51
|
+
*/
|
|
52
|
+
slug: z.ZodEffects<z.ZodString>;
|
|
53
|
+
/**
|
|
54
|
+
* The localized product name
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* {
|
|
58
|
+
* "it": "Maglietta Grigia",
|
|
59
|
+
* "en-US": "Gray T-Shirt"
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
name: LocalizedFieldSchema<z.ZodString>;
|
|
63
|
+
/**
|
|
64
|
+
* The localized product description
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* {
|
|
68
|
+
* "it": "Descrizione"
|
|
69
|
+
* "en-US": "Description",
|
|
70
|
+
* }
|
|
71
|
+
*/
|
|
72
|
+
description: LocalizedFieldSchema<z.ZodString>;
|
|
73
|
+
/**
|
|
74
|
+
* A carousel of image URLs that represent the product
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* [
|
|
78
|
+
* "https://res.cloudinary.com/commercelayer/image/upload/f_auto,b_white/demo-store/skus/TSHIRTMSB0B0B2000000LXXX_FLAT.png"
|
|
79
|
+
* ]
|
|
80
|
+
*/
|
|
81
|
+
images: z.ZodArray<z.ZodString>;
|
|
82
|
+
/**
|
|
83
|
+
* Additional product details
|
|
84
|
+
*
|
|
85
|
+
* This attribute is presented as accordion just below the "Add to cart" button.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* [
|
|
89
|
+
* {
|
|
90
|
+
* "title": {
|
|
91
|
+
* "en": "Details"
|
|
92
|
+
* },
|
|
93
|
+
* "content": {
|
|
94
|
+
* "en": "Content here."
|
|
95
|
+
* }
|
|
96
|
+
* }
|
|
97
|
+
* ]
|
|
98
|
+
*/
|
|
99
|
+
details: z.ZodOptional<z.ZodArray<DetailSchema>>;
|
|
84
100
|
}>;
|
|
85
101
|
export declare const rawDataProducts_schema: z.ZodArray<z.ZodObject<{
|
|
102
|
+
/**
|
|
103
|
+
* The **product code** identifies the base product
|
|
104
|
+
*
|
|
105
|
+
* A master product or base product is a non-sellable product that represents a group of similar or related products.
|
|
106
|
+
*
|
|
107
|
+
* For example, a clothing retailer may have a master product for each type of clothing item, such as "men's t-shirts" or "women's dresses".
|
|
108
|
+
* Each of these master products would contain multiple variations, such as different sizes, colors, and styles.
|
|
109
|
+
*/
|
|
86
110
|
productCode: z.ZodString;
|
|
111
|
+
/**
|
|
112
|
+
* The **variant code** identifies a variation product
|
|
113
|
+
*
|
|
114
|
+
* A variation product is a product that is part of a group of similar or related products,
|
|
115
|
+
* and it is identified by specific attributes or characteristics that distinguish it from the other products in the group (color, material, size, etc.).
|
|
116
|
+
*
|
|
117
|
+
* The `variantCode`, in Demo Store, is used for grouping similar products in the listing page.
|
|
118
|
+
* Usually a different `variantCode` corresponds to a different product image.
|
|
119
|
+
*/
|
|
87
120
|
variantCode: z.ZodString;
|
|
121
|
+
/**
|
|
122
|
+
* The **sku** is a **unique identifier**, meaning *Stock Keeping Unit*.
|
|
123
|
+
*
|
|
124
|
+
* This is the stock unit in a warehouse used to track availability and stock variations of an item to be sold.
|
|
125
|
+
* SKUs can be a variant of any item (e.g., Medium or Large size of a jogger pant).
|
|
126
|
+
*
|
|
127
|
+
* An SKU usually consists of letters and numbers (either EAN code, UPC, or any other code format) like "LSLEEVMM000000FFFFFFMXXX".
|
|
128
|
+
* SKU refers to an item's details, including variants data (e.g., a T-shirt, Red color, Nike brand, 0.5g, XL size).
|
|
129
|
+
* An SKU identifies each product item's characteristics such as manufacturer name, brand name, style, color, weight, and size.
|
|
130
|
+
*/
|
|
88
131
|
sku: z.ZodString;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
/**
|
|
133
|
+
* The product URL slug
|
|
134
|
+
*
|
|
135
|
+
* The slug is the part of a URL that identifies a particular page on a website in an easy-to-read form.
|
|
136
|
+
*
|
|
137
|
+
* It should always start with a forward slash (`/`).
|
|
138
|
+
* @example "/white-apron-with-black-logo/APRONXXXFFFFFF000000XXXX"
|
|
139
|
+
*/
|
|
140
|
+
slug: z.ZodEffects<z.ZodString>;
|
|
141
|
+
/**
|
|
142
|
+
* The localized product name
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* {
|
|
146
|
+
* "it": "Maglietta Grigia",
|
|
147
|
+
* "en-US": "Gray T-Shirt"
|
|
148
|
+
* }
|
|
149
|
+
*/
|
|
150
|
+
name: LocalizedFieldSchema<z.ZodString>;
|
|
151
|
+
/**
|
|
152
|
+
* The localized product description
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* {
|
|
156
|
+
* "it": "Descrizione"
|
|
157
|
+
* "en-US": "Description",
|
|
158
|
+
* }
|
|
159
|
+
*/
|
|
160
|
+
description: LocalizedFieldSchema<z.ZodString>;
|
|
161
|
+
/**
|
|
162
|
+
* A carousel of image URLs that represent the product
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* [
|
|
166
|
+
* "https://res.cloudinary.com/commercelayer/image/upload/f_auto,b_white/demo-store/skus/TSHIRTMSB0B0B2000000LXXX_FLAT.png"
|
|
167
|
+
* ]
|
|
168
|
+
*/
|
|
169
|
+
images: z.ZodArray<z.ZodString>;
|
|
170
|
+
/**
|
|
171
|
+
* Additional product details
|
|
172
|
+
*
|
|
173
|
+
* This attribute is presented as accordion just below the "Add to cart" button.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* [
|
|
177
|
+
* {
|
|
178
|
+
* "title": {
|
|
179
|
+
* "en": "Details"
|
|
180
|
+
* },
|
|
181
|
+
* "content": {
|
|
182
|
+
* "en": "Content here."
|
|
183
|
+
* }
|
|
184
|
+
* }
|
|
185
|
+
* ]
|
|
186
|
+
*/
|
|
187
|
+
details: z.ZodOptional<z.ZodArray<DetailSchema>>;
|
|
127
188
|
}, "passthrough", z.ZodTypeAny, {
|
|
128
189
|
details?: {
|
|
129
190
|
title: {
|
|
130
|
-
[
|
|
191
|
+
[localeCode: string]: string;
|
|
131
192
|
};
|
|
132
193
|
content: {
|
|
133
|
-
[
|
|
194
|
+
[localeCode: string]: string;
|
|
134
195
|
};
|
|
135
196
|
}[] | undefined;
|
|
136
197
|
name: {
|
|
137
|
-
[
|
|
198
|
+
[localeCode: string]: string;
|
|
138
199
|
};
|
|
139
200
|
description: {
|
|
140
|
-
[
|
|
201
|
+
[localeCode: string]: string;
|
|
141
202
|
};
|
|
142
203
|
productCode: string;
|
|
143
204
|
variantCode: string;
|
|
@@ -147,17 +208,17 @@ export declare const rawDataProducts_schema: z.ZodArray<z.ZodObject<{
|
|
|
147
208
|
}, {
|
|
148
209
|
details?: {
|
|
149
210
|
title: {
|
|
150
|
-
[
|
|
211
|
+
[localeCode: string]: string;
|
|
151
212
|
};
|
|
152
213
|
content: {
|
|
153
|
-
[
|
|
214
|
+
[localeCode: string]: string;
|
|
154
215
|
};
|
|
155
216
|
}[] | undefined;
|
|
156
217
|
name: {
|
|
157
|
-
[
|
|
218
|
+
[localeCode: string]: string;
|
|
158
219
|
};
|
|
159
220
|
description: {
|
|
160
|
-
[
|
|
221
|
+
[localeCode: string]: string;
|
|
161
222
|
};
|
|
162
223
|
productCode: string;
|
|
163
224
|
variantCode: string;
|
|
@@ -165,5 +226,12 @@ export declare const rawDataProducts_schema: z.ZodArray<z.ZodObject<{
|
|
|
165
226
|
slug: string;
|
|
166
227
|
images: string[];
|
|
167
228
|
}>, "many">;
|
|
168
|
-
|
|
229
|
+
/**
|
|
230
|
+
* Product
|
|
231
|
+
*
|
|
232
|
+
* A product that can be purchased since it has a `sku` property.
|
|
233
|
+
*
|
|
234
|
+
* Products need to be assigned to a `taxon` to be visible in the Demo Store.
|
|
235
|
+
*/
|
|
236
|
+
export type RawDataProduct = z.infer<RawDataProductSchema>;
|
|
169
237
|
export {};
|
package/dist/json/products.js
CHANGED
|
@@ -4,10 +4,16 @@ exports.rawDataProducts_schema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const locale_1 = require("../utils/locale");
|
|
6
6
|
const detail_schema = zod_1.z.object({
|
|
7
|
+
/**
|
|
8
|
+
* Accordion title
|
|
9
|
+
*/
|
|
7
10
|
title: (0, locale_1.localizedFieldSchema)(zod_1.z.string()),
|
|
11
|
+
/**
|
|
12
|
+
* Accordion content
|
|
13
|
+
*/
|
|
8
14
|
content: (0, locale_1.localizedFieldSchema)(zod_1.z.string())
|
|
9
15
|
});
|
|
10
|
-
const
|
|
16
|
+
const rawDataProduct_schema = zod_1.z.object({
|
|
11
17
|
productCode: zod_1.z.string(),
|
|
12
18
|
variantCode: zod_1.z.string(),
|
|
13
19
|
sku: zod_1.z.string(),
|
|
@@ -17,4 +23,4 @@ const product_schema = zod_1.z.object({
|
|
|
17
23
|
images: zod_1.z.string().array(),
|
|
18
24
|
details: detail_schema.array().optional()
|
|
19
25
|
});
|
|
20
|
-
exports.rawDataProducts_schema =
|
|
26
|
+
exports.rawDataProducts_schema = rawDataProduct_schema.passthrough().array();
|
|
@@ -1,35 +1,44 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
type RawDataTaxonomySchema = z.ZodObject<{
|
|
3
|
+
/**
|
|
4
|
+
* The taxonomy id
|
|
5
|
+
*
|
|
6
|
+
* This attribute is used to manage the relationship with `catalogs`.
|
|
7
|
+
*/
|
|
3
8
|
id: z.ZodString;
|
|
9
|
+
/**
|
|
10
|
+
* The taxonomy name
|
|
11
|
+
*
|
|
12
|
+
* This attribute is used to better identify the taxonomy. **Not used on the website**.
|
|
13
|
+
*/
|
|
4
14
|
name: z.ZodString;
|
|
15
|
+
/**
|
|
16
|
+
* The facet key is used inside the `facets.config.js` to define a facet.
|
|
17
|
+
*
|
|
18
|
+
* When you define a facet field in the `facets.config.js` that corresponds to a `facetKey`, the related taxonomy will be shown in the filter component.
|
|
19
|
+
*
|
|
20
|
+
* 
|
|
21
|
+
*/
|
|
5
22
|
facetKey: z.ZodString;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
name: string;
|
|
15
|
-
facetKey: string;
|
|
16
|
-
taxons: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Reference to the `taxons` id
|
|
25
|
+
*
|
|
26
|
+
* Any child branches of a `taxonomy` are called `taxons`. Taxons themselves can have their own branches.
|
|
27
|
+
*
|
|
28
|
+
* 
|
|
29
|
+
*/
|
|
30
|
+
taxons: z.ZodArray<z.ZodString>;
|
|
17
31
|
}>;
|
|
18
|
-
export declare const rawDataTaxonomies_schema: z.ZodArray<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
name: string;
|
|
31
|
-
facetKey: string;
|
|
32
|
-
taxons: string[];
|
|
33
|
-
}>, "many">;
|
|
34
|
-
export declare type RawDataTaxonomy = z.infer<typeof taxonomy_schema>;
|
|
32
|
+
export declare const rawDataTaxonomies_schema: z.ZodArray<RawDataTaxonomySchema, "many">;
|
|
33
|
+
/**
|
|
34
|
+
* Taxonomy
|
|
35
|
+
*
|
|
36
|
+
* Taxonomies are an approach to managing category trees.
|
|
37
|
+
* The heading of a tree is called `taxonomy`.
|
|
38
|
+
*
|
|
39
|
+
* For example, you can create a taxonomy for managing product categories, or for grouping products by their gender.
|
|
40
|
+
*
|
|
41
|
+
* 
|
|
42
|
+
*/
|
|
43
|
+
export type RawDataTaxonomy = z.infer<RawDataTaxonomySchema>;
|
|
35
44
|
export {};
|
package/dist/json/taxonomies.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rawDataTaxonomies_schema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const rawDataTaxonomy_schema = zod_1.z.object({
|
|
6
6
|
id: zod_1.z.string(),
|
|
7
7
|
name: zod_1.z.string(),
|
|
8
8
|
facetKey: zod_1.z.string(),
|
|
9
9
|
taxons: zod_1.z.string().array()
|
|
10
10
|
});
|
|
11
|
-
exports.rawDataTaxonomies_schema =
|
|
11
|
+
exports.rawDataTaxonomies_schema = rawDataTaxonomy_schema.array();
|