@commercelayer/demo-store-types 1.0.0 → 1.1.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.
Files changed (38) hide show
  1. package/README.md +105 -21
  2. package/dist/config/facets.config.d.ts +8 -8
  3. package/dist/config/general.config.d.ts +1 -1
  4. package/dist/config/variants.config.d.ts +5 -5
  5. package/dist/json/catalogs.d.ts +34 -24
  6. package/dist/json/catalogs.js +2 -2
  7. package/dist/json/countries.d.ts +44 -38
  8. package/dist/json/countries.js +2 -2
  9. package/dist/json/languages.d.ts +23 -23
  10. package/dist/json/languages.js +2 -2
  11. package/dist/json/organization.d.ts +45 -33
  12. package/dist/json/organization.js +1 -2
  13. package/dist/json/page-components/carousel.d.ts +19 -0
  14. package/dist/json/page-components/carousel.js +10 -0
  15. package/dist/json/page-components/grid.d.ts +17 -0
  16. package/dist/json/page-components/grid.js +10 -0
  17. package/dist/json/page-components/hero.d.ts +33 -0
  18. package/dist/json/page-components/hero.js +13 -0
  19. package/dist/json/page-components/image.d.ts +12 -0
  20. package/dist/json/page-components/image.js +8 -0
  21. package/dist/json/page-components/item.d.ts +31 -0
  22. package/dist/json/page-components/item.js +12 -0
  23. package/dist/json/page-components/markdown.d.ts +18 -0
  24. package/dist/json/page-components/markdown.js +20 -0
  25. package/dist/json/page-components/product-grid.d.ts +20 -0
  26. package/dist/json/page-components/product-grid.js +10 -0
  27. package/dist/json/pages.d.ts +120 -1195
  28. package/dist/json/pages.js +17 -50
  29. package/dist/json/products.d.ts +194 -126
  30. package/dist/json/products.js +8 -2
  31. package/dist/json/taxonomies.d.ts +38 -29
  32. package/dist/json/taxonomies.js +2 -2
  33. package/dist/json/taxons.d.ts +65 -80
  34. package/dist/json/taxons.js +2 -2
  35. package/dist/utils/locale.d.ts +11 -5
  36. package/dist/utils/locale.js +6 -1
  37. package/dist/utils/sort.d.ts +2 -2
  38. package/package.json +4 -4
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { ImageSchema } from './image';
3
+ export type HeroSchema = z.ZodObject<{
4
+ /**
5
+ * Identifies the component type
6
+ */
7
+ type: z.ZodLiteral<'hero'>;
8
+ /**
9
+ * Unique ID
10
+ */
11
+ id: z.ZodString;
12
+ /**
13
+ * The hero image
14
+ */
15
+ image: ImageSchema;
16
+ /**
17
+ * The hero title
18
+ */
19
+ title: z.ZodString;
20
+ /**
21
+ * The hero description
22
+ */
23
+ description: z.ZodOptional<z.ZodString>;
24
+ /**
25
+ * The hero link URL
26
+ *
27
+ * URL can be an internal one starting with `/` or an external one starting with `https://`.
28
+ *
29
+ * @example "/search/bags"
30
+ */
31
+ href: z.ZodString;
32
+ }>;
33
+ export declare const hero_schema: HeroSchema;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hero_schema = void 0;
4
+ const zod_1 = require("zod");
5
+ const image_1 = require("./image");
6
+ exports.hero_schema = zod_1.z.object({
7
+ type: zod_1.z.literal('hero'),
8
+ id: zod_1.z.string(),
9
+ image: image_1.image_schema,
10
+ title: zod_1.z.string(),
11
+ description: zod_1.z.string().optional(),
12
+ href: zod_1.z.string()
13
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export type ImageSchema = z.ZodObject<{
3
+ /**
4
+ * Image source
5
+ */
6
+ src: z.ZodString;
7
+ /**
8
+ * Alternative text
9
+ */
10
+ alt: z.ZodString;
11
+ }>;
12
+ export declare const image_schema: ImageSchema;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.image_schema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.image_schema = zod_1.z.object({
6
+ src: zod_1.z.string(),
7
+ alt: zod_1.z.string()
8
+ });
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { ImageSchema } from './image';
3
+ export type ItemSchema = z.ZodObject<{
4
+ /**
5
+ * The title
6
+ */
7
+ title: z.ZodString;
8
+ /**
9
+ * The description
10
+ */
11
+ description: z.ZodString;
12
+ /**
13
+ * The image
14
+ */
15
+ image: ImageSchema;
16
+ /**
17
+ * The button link label
18
+ *
19
+ * @example "Shop here"
20
+ */
21
+ linkLabel: z.ZodString;
22
+ /**
23
+ * The button link URL
24
+ *
25
+ * URL can be an internal one starting with `/` or an external one starting with `https://`.
26
+ *
27
+ * @example "/search/bags"
28
+ */
29
+ linkHref: z.ZodString;
30
+ }>;
31
+ export declare const item_schema: ItemSchema;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.item_schema = void 0;
4
+ const zod_1 = require("zod");
5
+ const image_1 = require("./image");
6
+ exports.item_schema = zod_1.z.object({
7
+ title: zod_1.z.string(),
8
+ description: zod_1.z.string(),
9
+ image: image_1.image_schema,
10
+ linkLabel: zod_1.z.string(),
11
+ linkHref: zod_1.z.string()
12
+ });
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export type MarkdownSchema = z.ZodObject<{
3
+ /**
4
+ * Identifies the component type
5
+ */
6
+ type: z.ZodLiteral<'markdown'>;
7
+ /**
8
+ * Unique ID
9
+ */
10
+ id: z.ZodString;
11
+ /**
12
+ * The markdown content
13
+ *
14
+ * When the page already has a `title` attribute, the markdown content should not start with a `#` (markdown title) to avoid a second `<h1>` title on the page.
15
+ */
16
+ content: z.ZodString;
17
+ }>;
18
+ export declare const markdown_schema: MarkdownSchema;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.markdown_schema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.markdown_schema = zod_1.z.object({
6
+ /**
7
+ * Identifies the component type
8
+ */
9
+ type: zod_1.z.literal('markdown'),
10
+ /**
11
+ * Unique ID
12
+ */
13
+ id: zod_1.z.string(),
14
+ /**
15
+ * The markdown content
16
+ *
17
+ * When the page already has a `title` attribute, the markdown content should not start with a `#` (markdown title) to avoid a second `<h1>` title on the page.
18
+ */
19
+ content: zod_1.z.string()
20
+ });
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export type ProductGridSchema = z.ZodObject<{
3
+ /**
4
+ * Identifies the component type
5
+ */
6
+ type: z.ZodLiteral<'product-grid'>;
7
+ /**
8
+ * Unique ID
9
+ */
10
+ id: z.ZodString;
11
+ /**
12
+ * The product grid title
13
+ */
14
+ title: z.ZodString;
15
+ /**
16
+ * List of SKUs from `products.json` file
17
+ */
18
+ skus: z.ZodArray<z.ZodString>;
19
+ }>;
20
+ export declare const productGrid_schema: ProductGridSchema;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.productGrid_schema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.productGrid_schema = zod_1.z.object({
6
+ type: zod_1.z.literal('product-grid'),
7
+ id: zod_1.z.string(),
8
+ title: zod_1.z.string(),
9
+ skus: zod_1.z.string().array()
10
+ });