@vedhae/cms-schema 4.2.14 → 4.2.16
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/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/product.schema.d.ts +57 -0
- package/dist/product.schema.js +10 -0
- package/package.json +1 -1
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";
|
package/dist/product.schema.d.ts
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const CustomerReviewSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
date: z.ZodOptional<z.ZodString>;
|
|
5
|
+
stars: z.ZodNumber;
|
|
6
|
+
review: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
name: string;
|
|
9
|
+
stars: number;
|
|
10
|
+
review: string;
|
|
11
|
+
date?: string | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
name: string;
|
|
14
|
+
stars: number;
|
|
15
|
+
review: string;
|
|
16
|
+
date?: string | undefined;
|
|
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.ZodOptional<z.ZodString>;
|
|
61
|
+
stars: z.ZodNumber;
|
|
62
|
+
review: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
name: string;
|
|
65
|
+
stars: number;
|
|
66
|
+
review: string;
|
|
67
|
+
date?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
name: string;
|
|
70
|
+
stars: number;
|
|
71
|
+
review: string;
|
|
72
|
+
date?: string | undefined;
|
|
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
|
+
name: string;
|
|
110
|
+
stars: number;
|
|
111
|
+
review: string;
|
|
112
|
+
date?: string | undefined;
|
|
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
|
+
name: string;
|
|
146
|
+
stars: number;
|
|
147
|
+
review: string;
|
|
148
|
+
date?: string | undefined;
|
|
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
|
+
name: string;
|
|
182
|
+
stars: number;
|
|
183
|
+
review: string;
|
|
184
|
+
date?: string | undefined;
|
|
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
|
+
name: string;
|
|
218
|
+
stars: number;
|
|
219
|
+
review: string;
|
|
220
|
+
date?: string | undefined;
|
|
221
|
+
}[] | undefined;
|
|
165
222
|
}>;
|
|
166
223
|
export type Product = z.infer<typeof ProductSchema>;
|
package/dist/product.schema.js
CHANGED
|
@@ -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().optional(),
|
|
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
|
========================= */
|