@vedhae/cms-schema 4.2.13 → 4.2.15

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.
@@ -1,19 +1,13 @@
1
1
  import { z } from "zod";
2
2
  export declare const AnnouncementSchema: z.ZodObject<{
3
- page: z.ZodLiteral<"global">;
4
- section: z.ZodLiteral<"announcement">;
5
3
  active: z.ZodBoolean;
6
4
  text: z.ZodString;
7
5
  speed: z.ZodDefault<z.ZodNumber>;
8
6
  }, "strip", z.ZodTypeAny, {
9
- page: "global";
10
- section: "announcement";
11
7
  active: boolean;
12
8
  text: string;
13
9
  speed: number;
14
10
  }, {
15
- page: "global";
16
- section: "announcement";
17
11
  active: boolean;
18
12
  text: string;
19
13
  speed?: number | undefined;
@@ -1,8 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export const AnnouncementSchema = z.object({
3
- page: z.literal("global"),
4
- section: z.literal("announcement"),
5
3
  active: z.boolean(),
6
4
  text: z.string().min(1),
7
- speed: z.number().default(30), // seconds
5
+ speed: z.number().min(5).max(120).default(30),
8
6
  });
@@ -89,10 +89,10 @@ export declare const CardSectionSchema: z.ZodObject<{
89
89
  }>, "many">;
90
90
  }, "strip", z.ZodTypeAny, {
91
91
  title: string;
92
- page: "home";
93
- section: "one" | "two";
94
92
  active: boolean;
95
93
  order: number;
94
+ page: "home";
95
+ section: "one" | "two";
96
96
  items: {
97
97
  name: string;
98
98
  link: string;
@@ -106,10 +106,10 @@ export declare const CardSectionSchema: z.ZodObject<{
106
106
  }[];
107
107
  }, {
108
108
  title: string;
109
- page: "home";
110
- section: "one" | "two";
111
109
  active: boolean;
112
110
  order: number;
111
+ page: "home";
112
+ section: "one" | "two";
113
113
  items: {
114
114
  name: string;
115
115
  link: string;
@@ -26,9 +26,9 @@ export declare const HeroSectionSchema: z.ZodObject<{
26
26
  }>, "many">>;
27
27
  }, "strip", z.ZodTypeAny, {
28
28
  title: string;
29
+ active: boolean;
29
30
  page: "home";
30
31
  section: "hero";
31
- active: boolean;
32
32
  tagline: string;
33
33
  ctaText: string;
34
34
  ctaLink: string;
@@ -41,9 +41,9 @@ export declare const HeroSectionSchema: z.ZodObject<{
41
41
  description?: string | undefined;
42
42
  }, {
43
43
  title: string;
44
+ active: boolean;
44
45
  page: "home";
45
46
  section: "hero";
46
- active: boolean;
47
47
  tagline: string;
48
48
  ctaText: string;
49
49
  ctaLink: string;
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { CardSectionSchema } from "./cardSection.schema.js";
4
4
  export { HomeDividerSchema } from "./homeDivider.schema.js";
5
5
  export { FooterSchema } from "./footer.schema.js";
6
6
  export { AnnouncementSchema } from "./announcement.schema.js";
7
- export { ProductSchema } from "./product.schema.js";
7
+ export { ProductSchema, CustomerReviewSchema } from "./product.schema.js";
8
8
  export { ProductHeroSchema } from "./productHero.schema.js";
9
9
  export { AboutHeroSchema, AboutContentSchema, AboutImagesSchema, } from "./about.schema.js";
10
10
  export type { ImageAsset } from "./image.schema.js";
@@ -13,6 +13,6 @@ export type { CardSection } from "./cardSection.schema.js";
13
13
  export type { HomeDivider } from "./homeDivider.schema.js";
14
14
  export type { FooterSection } from "./footer.schema.js";
15
15
  export type { Announcement } from "./announcement.schema.js";
16
- export type { Product } from "./product.schema.js";
16
+ export type { Product, CustomerReview } from "./product.schema.js";
17
17
  export type { ProductHero } from "./productHero.schema.js";
18
18
  export type { AboutHero, AboutContent, AboutImages, } from "./about.schema.js";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ export { HomeDividerSchema } from "./homeDivider.schema.js";
9
9
  export { FooterSchema } from "./footer.schema.js";
10
10
  export { AnnouncementSchema } from "./announcement.schema.js";
11
11
  // Products
12
- export { ProductSchema } from "./product.schema.js";
12
+ export { ProductSchema, CustomerReviewSchema } from "./product.schema.js";
13
13
  export { ProductHeroSchema } from "./productHero.schema.js";
14
14
  // About
15
15
  export { AboutHeroSchema, AboutContentSchema, AboutImagesSchema, } from "./about.schema.js";
@@ -1,4 +1,21 @@
1
1
  import { z } from "zod";
2
+ export declare const CustomerReviewSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ date: z.ZodString;
5
+ stars: z.ZodNumber;
6
+ review: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ date: string;
9
+ name: string;
10
+ stars: number;
11
+ review: string;
12
+ }, {
13
+ date: string;
14
+ name: string;
15
+ stars: number;
16
+ review: string;
17
+ }>;
18
+ export type CustomerReview = z.infer<typeof CustomerReviewSchema>;
2
19
  /**
3
20
  * Product schema
4
21
  */
@@ -38,6 +55,22 @@ export declare const ProductSchema: z.ZodEffects<z.ZodObject<{
38
55
  howToUseDescription: z.ZodString;
39
56
  ingredientsTitle: z.ZodString;
40
57
  ingredients: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
58
+ reviews: z.ZodOptional<z.ZodArray<z.ZodObject<{
59
+ name: z.ZodString;
60
+ date: z.ZodString;
61
+ stars: z.ZodNumber;
62
+ review: z.ZodString;
63
+ }, "strip", z.ZodTypeAny, {
64
+ date: string;
65
+ name: string;
66
+ stars: number;
67
+ review: string;
68
+ }, {
69
+ date: string;
70
+ name: string;
71
+ stars: number;
72
+ review: string;
73
+ }>, "many">>;
41
74
  active: z.ZodBoolean;
42
75
  order: z.ZodNumber;
43
76
  createdAt: z.ZodNumber;
@@ -72,6 +105,12 @@ export declare const ProductSchema: z.ZodEffects<z.ZodObject<{
72
105
  externalLink?: string | undefined;
73
106
  discountPercent?: number | undefined;
74
107
  priceSubText?: string | undefined;
108
+ reviews?: {
109
+ date: string;
110
+ name: string;
111
+ stars: number;
112
+ review: string;
113
+ }[] | undefined;
75
114
  }, {
76
115
  title: string;
77
116
  active: boolean;
@@ -102,6 +141,12 @@ export declare const ProductSchema: z.ZodEffects<z.ZodObject<{
102
141
  externalLink?: string | undefined;
103
142
  discountPercent?: number | undefined;
104
143
  priceSubText?: string | undefined;
144
+ reviews?: {
145
+ date: string;
146
+ name: string;
147
+ stars: number;
148
+ review: string;
149
+ }[] | undefined;
105
150
  }>, {
106
151
  title: string;
107
152
  active: boolean;
@@ -132,6 +177,12 @@ export declare const ProductSchema: z.ZodEffects<z.ZodObject<{
132
177
  externalLink?: string | undefined;
133
178
  discountPercent?: number | undefined;
134
179
  priceSubText?: string | undefined;
180
+ reviews?: {
181
+ date: string;
182
+ name: string;
183
+ stars: number;
184
+ review: string;
185
+ }[] | undefined;
135
186
  }, {
136
187
  title: string;
137
188
  active: boolean;
@@ -162,5 +213,11 @@ export declare const ProductSchema: z.ZodEffects<z.ZodObject<{
162
213
  externalLink?: string | undefined;
163
214
  discountPercent?: number | undefined;
164
215
  priceSubText?: string | undefined;
216
+ reviews?: {
217
+ date: string;
218
+ name: string;
219
+ stars: number;
220
+ review: string;
221
+ }[] | undefined;
165
222
  }>;
166
223
  export type Product = z.infer<typeof ProductSchema>;
@@ -1,5 +1,11 @@
1
1
  import { z } from "zod";
2
2
  import { ImageAssetSchema } from "./image.schema.js";
3
+ export const CustomerReviewSchema = z.object({
4
+ name: z.string().min(1),
5
+ date: z.string().min(1),
6
+ stars: z.number().min(0).max(5),
7
+ review: z.string().min(1),
8
+ });
3
9
  /**
4
10
  * Product schema
5
11
  */
@@ -50,6 +56,10 @@ export const ProductSchema = z
50
56
  howToUseDescription: z.string().min(1),
51
57
  ingredientsTitle: z.string().min(1),
52
58
  ingredients: z.array(z.tuple([z.string(), z.string()])).min(1),
59
+ /* =========================
60
+ Reviews
61
+ ========================= */
62
+ reviews: z.array(CustomerReviewSchema).optional(),
53
63
  /* =========================
54
64
  System
55
65
  ========================= */
@@ -29,8 +29,8 @@ export declare const ProductHeroSchema: z.ZodObject<{
29
29
  desc?: string | undefined;
30
30
  }>, "many">>;
31
31
  }, "strip", z.ZodTypeAny, {
32
- page: "products";
33
32
  active: boolean;
33
+ page: "products";
34
34
  imageLinks: {
35
35
  url: string;
36
36
  path: string;
@@ -42,8 +42,8 @@ export declare const ProductHeroSchema: z.ZodObject<{
42
42
  subtitle?: string | undefined;
43
43
  };
44
44
  }, {
45
- page: "products";
46
45
  active: boolean;
46
+ page: "products";
47
47
  content: {
48
48
  title?: string | undefined;
49
49
  subtitle?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vedhae/cms-schema",
3
- "version": "4.2.13",
3
+ "version": "4.2.15",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",