@zyacreatives/shared 2.4.8 → 2.5.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/dist/constants.d.ts +1 -0
- package/dist/constants.js +746 -465
- package/dist/schemas/product.d.ts +47 -19
- package/dist/schemas/product.js +11 -10
- package/dist/schemas/user.d.ts +4 -4
- package/package.json +1 -1
- package/src/constants.ts +756 -468
- package/src/schemas/product.ts +11 -10
package/src/schemas/product.ts
CHANGED
|
@@ -51,12 +51,12 @@ export const ProductLinkSchema = z.object({
|
|
|
51
51
|
export type ProductLink = z.infer<typeof ProductLinkSchema>;
|
|
52
52
|
|
|
53
53
|
export const BaseProductSchema = z.object({
|
|
54
|
-
id: z.
|
|
54
|
+
id: z.cuid2(),
|
|
55
55
|
createdAt: z.date(),
|
|
56
56
|
updatedAt: z.date(),
|
|
57
57
|
deletedAt: z.date().nullable(),
|
|
58
58
|
status: z.enum(PRODUCT_STATUS).default("DRAFT"),
|
|
59
|
-
sellerId: z.
|
|
59
|
+
sellerId: z.cuid2(),
|
|
60
60
|
title: z.string(),
|
|
61
61
|
description: z.string(),
|
|
62
62
|
keyFeatures: z.string(),
|
|
@@ -85,7 +85,7 @@ export const BaseProductSchema = z.object({
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
const ProductCoreInputSchema = z.object({
|
|
88
|
-
id: z.
|
|
88
|
+
id: z.cuid2().openapi({ description: "Client-generated ID for the product" }),
|
|
89
89
|
|
|
90
90
|
title: z.string().min(1, "Title is required").max(255),
|
|
91
91
|
description: z.string().min(1, "Description is required"),
|
|
@@ -197,7 +197,7 @@ export const CreateProductInputSchema = ProductCoreInputSchema.superRefine(
|
|
|
197
197
|
);
|
|
198
198
|
|
|
199
199
|
export const ProductServiceAndComplianceInputSchema = z.object({
|
|
200
|
-
id: z.
|
|
200
|
+
id: z.cuid2().openapi({ description: "ID of the product" }),
|
|
201
201
|
|
|
202
202
|
supportEmail: z.email("A valid support email is required"),
|
|
203
203
|
supportPhone: z.string().optional(),
|
|
@@ -219,14 +219,14 @@ export const UpdateProductInputSchema = ProductCoreInputSchema.extend(
|
|
|
219
219
|
)
|
|
220
220
|
.partial()
|
|
221
221
|
.extend({
|
|
222
|
-
id: z.
|
|
222
|
+
id: z.cuid2().openapi({ description: "ID of the product being updated" }),
|
|
223
223
|
});
|
|
224
224
|
|
|
225
225
|
export const ProductEntitySchema = z
|
|
226
226
|
.object({
|
|
227
|
-
id: z.
|
|
227
|
+
id: z.cuid2(),
|
|
228
228
|
|
|
229
|
-
sellerId: z.
|
|
229
|
+
sellerId: z.cuid2().openapi({ description: "ID of the creator/seller" }),
|
|
230
230
|
sellerUsername: z.string(),
|
|
231
231
|
sellerName: z.string(),
|
|
232
232
|
sellerImageUrl: z.url().optional().nullable(),
|
|
@@ -263,11 +263,12 @@ export const ProductEntitySchema = z
|
|
|
263
263
|
.openapi({ title: "ProductEntity" });
|
|
264
264
|
|
|
265
265
|
export const ProductSearchDocumentSchema = z.object({
|
|
266
|
-
id: z.
|
|
267
|
-
sellerId: z.
|
|
266
|
+
id: z.cuid2(),
|
|
267
|
+
sellerId: z.cuid2(),
|
|
268
268
|
sellerUsername: z.string(),
|
|
269
269
|
sellerName: z.string(),
|
|
270
|
-
|
|
270
|
+
status: z.enum(PRODUCT_STATUS),
|
|
271
|
+
sellerImageUrl: z.url().nullable(),
|
|
271
272
|
title: z.string(),
|
|
272
273
|
category: z.string(),
|
|
273
274
|
subcategory: z.string().nullable(),
|