@zyacreatives/shared 2.4.8 → 2.4.9
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/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/schemas/product.ts +11 -10
|
@@ -34,7 +34,7 @@ export declare const ProductLinkSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
export type ProductLink = z.infer<typeof ProductLinkSchema>;
|
|
36
36
|
export declare const BaseProductSchema: z.ZodObject<{
|
|
37
|
-
id: z.
|
|
37
|
+
id: z.ZodCUID2;
|
|
38
38
|
createdAt: z.ZodDate;
|
|
39
39
|
updatedAt: z.ZodDate;
|
|
40
40
|
deletedAt: z.ZodNullable<z.ZodDate>;
|
|
@@ -45,7 +45,7 @@ export declare const BaseProductSchema: z.ZodObject<{
|
|
|
45
45
|
readonly ARCHIVED: "ARCHIVED";
|
|
46
46
|
readonly DELETED: "DELETED";
|
|
47
47
|
}>>;
|
|
48
|
-
sellerId: z.
|
|
48
|
+
sellerId: z.ZodCUID2;
|
|
49
49
|
title: z.ZodString;
|
|
50
50
|
description: z.ZodString;
|
|
51
51
|
keyFeatures: z.ZodString;
|
|
@@ -88,7 +88,7 @@ export declare const BaseProductSchema: z.ZodObject<{
|
|
|
88
88
|
supportPhone: z.ZodNullable<z.ZodString>;
|
|
89
89
|
}, z.core.$strip>;
|
|
90
90
|
export declare const CreateProductInputSchema: z.ZodObject<{
|
|
91
|
-
id: z.
|
|
91
|
+
id: z.ZodCUID2;
|
|
92
92
|
title: z.ZodString;
|
|
93
93
|
description: z.ZodString;
|
|
94
94
|
keyFeatures: z.ZodString;
|
|
@@ -147,7 +147,7 @@ export declare const CreateProductInputSchema: z.ZodObject<{
|
|
|
147
147
|
}, z.core.$strip>>>;
|
|
148
148
|
}, z.core.$strip>;
|
|
149
149
|
export declare const ProductServiceAndComplianceInputSchema: z.ZodObject<{
|
|
150
|
-
id: z.
|
|
150
|
+
id: z.ZodCUID2;
|
|
151
151
|
supportEmail: z.ZodEmail;
|
|
152
152
|
supportPhone: z.ZodOptional<z.ZodString>;
|
|
153
153
|
ownsRights: z.ZodLiteral<true>;
|
|
@@ -218,11 +218,11 @@ export declare const UpdateProductInputSchema: z.ZodObject<{
|
|
|
218
218
|
noHarmfulContent: z.ZodOptional<z.ZodLiteral<true>>;
|
|
219
219
|
providesSupport: z.ZodOptional<z.ZodBoolean>;
|
|
220
220
|
agreesToTerms: z.ZodOptional<z.ZodLiteral<true>>;
|
|
221
|
-
id: z.
|
|
221
|
+
id: z.ZodCUID2;
|
|
222
222
|
}, z.core.$strip>;
|
|
223
223
|
export declare const ProductEntitySchema: z.ZodObject<{
|
|
224
|
-
id: z.
|
|
225
|
-
sellerId: z.
|
|
224
|
+
id: z.ZodCUID2;
|
|
225
|
+
sellerId: z.ZodCUID2;
|
|
226
226
|
sellerUsername: z.ZodString;
|
|
227
227
|
sellerName: z.ZodString;
|
|
228
228
|
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
@@ -286,11 +286,18 @@ export declare const ProductEntitySchema: z.ZodObject<{
|
|
|
286
286
|
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
287
287
|
}, z.core.$strip>;
|
|
288
288
|
export declare const ProductSearchDocumentSchema: z.ZodObject<{
|
|
289
|
-
id: z.
|
|
290
|
-
sellerId: z.
|
|
289
|
+
id: z.ZodCUID2;
|
|
290
|
+
sellerId: z.ZodCUID2;
|
|
291
291
|
sellerUsername: z.ZodString;
|
|
292
292
|
sellerName: z.ZodString;
|
|
293
|
-
|
|
293
|
+
status: z.ZodEnum<{
|
|
294
|
+
readonly ACTIVE: "ACTIVE";
|
|
295
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
296
|
+
readonly DRAFT: "DRAFT";
|
|
297
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
298
|
+
readonly DELETED: "DELETED";
|
|
299
|
+
}>;
|
|
300
|
+
sellerImageUrl: z.ZodNullable<z.ZodURL>;
|
|
294
301
|
title: z.ZodString;
|
|
295
302
|
category: z.ZodString;
|
|
296
303
|
subcategory: z.ZodNullable<z.ZodString>;
|
|
@@ -324,11 +331,18 @@ export declare const SearchProductInputSchema: z.ZodObject<{
|
|
|
324
331
|
}, z.core.$strip>;
|
|
325
332
|
export declare const SearchProductOutputSchema: z.ZodObject<{
|
|
326
333
|
products: z.ZodArray<z.ZodObject<{
|
|
327
|
-
id: z.
|
|
328
|
-
sellerId: z.
|
|
334
|
+
id: z.ZodCUID2;
|
|
335
|
+
sellerId: z.ZodCUID2;
|
|
329
336
|
sellerUsername: z.ZodString;
|
|
330
337
|
sellerName: z.ZodString;
|
|
331
|
-
|
|
338
|
+
status: z.ZodEnum<{
|
|
339
|
+
readonly ACTIVE: "ACTIVE";
|
|
340
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
341
|
+
readonly DRAFT: "DRAFT";
|
|
342
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
343
|
+
readonly DELETED: "DELETED";
|
|
344
|
+
}>;
|
|
345
|
+
sellerImageUrl: z.ZodNullable<z.ZodURL>;
|
|
332
346
|
title: z.ZodString;
|
|
333
347
|
category: z.ZodString;
|
|
334
348
|
subcategory: z.ZodNullable<z.ZodString>;
|
|
@@ -366,11 +380,18 @@ export declare const GetMarketplaceInfoOutputSchema: z.ZodObject<{
|
|
|
366
380
|
subcategories: z.ZodArray<z.ZodString>;
|
|
367
381
|
}, z.core.$strip>>;
|
|
368
382
|
whatsHot: z.ZodArray<z.ZodObject<{
|
|
369
|
-
id: z.
|
|
370
|
-
sellerId: z.
|
|
383
|
+
id: z.ZodCUID2;
|
|
384
|
+
sellerId: z.ZodCUID2;
|
|
371
385
|
sellerUsername: z.ZodString;
|
|
372
386
|
sellerName: z.ZodString;
|
|
373
|
-
|
|
387
|
+
status: z.ZodEnum<{
|
|
388
|
+
readonly ACTIVE: "ACTIVE";
|
|
389
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
390
|
+
readonly DRAFT: "DRAFT";
|
|
391
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
392
|
+
readonly DELETED: "DELETED";
|
|
393
|
+
}>;
|
|
394
|
+
sellerImageUrl: z.ZodNullable<z.ZodURL>;
|
|
374
395
|
title: z.ZodString;
|
|
375
396
|
category: z.ZodString;
|
|
376
397
|
subcategory: z.ZodNullable<z.ZodString>;
|
|
@@ -395,11 +416,18 @@ export declare const GetMarketplaceInfoOutputSchema: z.ZodObject<{
|
|
|
395
416
|
deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
396
417
|
}, z.core.$strip>>;
|
|
397
418
|
communityFavourites: z.ZodArray<z.ZodObject<{
|
|
398
|
-
id: z.
|
|
399
|
-
sellerId: z.
|
|
419
|
+
id: z.ZodCUID2;
|
|
420
|
+
sellerId: z.ZodCUID2;
|
|
400
421
|
sellerUsername: z.ZodString;
|
|
401
422
|
sellerName: z.ZodString;
|
|
402
|
-
|
|
423
|
+
status: z.ZodEnum<{
|
|
424
|
+
readonly ACTIVE: "ACTIVE";
|
|
425
|
+
readonly UNDER_REVIEW: "UNDER_REVIEW";
|
|
426
|
+
readonly DRAFT: "DRAFT";
|
|
427
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
428
|
+
readonly DELETED: "DELETED";
|
|
429
|
+
}>;
|
|
430
|
+
sellerImageUrl: z.ZodNullable<z.ZodURL>;
|
|
403
431
|
title: z.ZodString;
|
|
404
432
|
category: z.ZodString;
|
|
405
433
|
subcategory: z.ZodNullable<z.ZodString>;
|
package/dist/schemas/product.js
CHANGED
|
@@ -41,12 +41,12 @@ exports.ProductLinkSchema = zod_openapi_1.z.object({
|
|
|
41
41
|
url: zod_openapi_1.z.string(),
|
|
42
42
|
});
|
|
43
43
|
exports.BaseProductSchema = zod_openapi_1.z.object({
|
|
44
|
-
id: zod_openapi_1.z.
|
|
44
|
+
id: zod_openapi_1.z.cuid2(),
|
|
45
45
|
createdAt: zod_openapi_1.z.date(),
|
|
46
46
|
updatedAt: zod_openapi_1.z.date(),
|
|
47
47
|
deletedAt: zod_openapi_1.z.date().nullable(),
|
|
48
48
|
status: zod_openapi_1.z.enum(constants_1.PRODUCT_STATUS).default("DRAFT"),
|
|
49
|
-
sellerId: zod_openapi_1.z.
|
|
49
|
+
sellerId: zod_openapi_1.z.cuid2(),
|
|
50
50
|
title: zod_openapi_1.z.string(),
|
|
51
51
|
description: zod_openapi_1.z.string(),
|
|
52
52
|
keyFeatures: zod_openapi_1.z.string(),
|
|
@@ -70,7 +70,7 @@ exports.BaseProductSchema = zod_openapi_1.z.object({
|
|
|
70
70
|
supportPhone: zod_openapi_1.z.string().nullable(),
|
|
71
71
|
});
|
|
72
72
|
const ProductCoreInputSchema = zod_openapi_1.z.object({
|
|
73
|
-
id: zod_openapi_1.z.
|
|
73
|
+
id: zod_openapi_1.z.cuid2().openapi({ description: "Client-generated ID for the product" }),
|
|
74
74
|
title: zod_openapi_1.z.string().min(1, "Title is required").max(255),
|
|
75
75
|
description: zod_openapi_1.z.string().min(1, "Description is required"),
|
|
76
76
|
keyFeatures: zod_openapi_1.z.string(),
|
|
@@ -156,7 +156,7 @@ exports.CreateProductInputSchema = ProductCoreInputSchema.superRefine((data, ctx
|
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
158
|
exports.ProductServiceAndComplianceInputSchema = zod_openapi_1.z.object({
|
|
159
|
-
id: zod_openapi_1.z.
|
|
159
|
+
id: zod_openapi_1.z.cuid2().openapi({ description: "ID of the product" }),
|
|
160
160
|
supportEmail: zod_openapi_1.z.email("A valid support email is required"),
|
|
161
161
|
supportPhone: zod_openapi_1.z.string().optional(),
|
|
162
162
|
ownsRights: zod_openapi_1.z.literal(true, "You must confirm you own the rights to this product."),
|
|
@@ -168,12 +168,12 @@ exports.ProductServiceAndComplianceInputSchema = zod_openapi_1.z.object({
|
|
|
168
168
|
exports.UpdateProductInputSchema = ProductCoreInputSchema.extend(exports.ProductServiceAndComplianceInputSchema.omit({ id: true }).shape)
|
|
169
169
|
.partial()
|
|
170
170
|
.extend({
|
|
171
|
-
id: zod_openapi_1.z.
|
|
171
|
+
id: zod_openapi_1.z.cuid2().openapi({ description: "ID of the product being updated" }),
|
|
172
172
|
});
|
|
173
173
|
exports.ProductEntitySchema = zod_openapi_1.z
|
|
174
174
|
.object({
|
|
175
|
-
id: zod_openapi_1.z.
|
|
176
|
-
sellerId: zod_openapi_1.z.
|
|
175
|
+
id: zod_openapi_1.z.cuid2(),
|
|
176
|
+
sellerId: zod_openapi_1.z.cuid2().openapi({ description: "ID of the creator/seller" }),
|
|
177
177
|
sellerUsername: zod_openapi_1.z.string(),
|
|
178
178
|
sellerName: zod_openapi_1.z.string(),
|
|
179
179
|
sellerImageUrl: zod_openapi_1.z.url().optional().nullable(),
|
|
@@ -204,11 +204,12 @@ exports.ProductEntitySchema = zod_openapi_1.z
|
|
|
204
204
|
})
|
|
205
205
|
.openapi({ title: "ProductEntity" });
|
|
206
206
|
exports.ProductSearchDocumentSchema = zod_openapi_1.z.object({
|
|
207
|
-
id: zod_openapi_1.z.
|
|
208
|
-
sellerId: zod_openapi_1.z.
|
|
207
|
+
id: zod_openapi_1.z.cuid2(),
|
|
208
|
+
sellerId: zod_openapi_1.z.cuid2(),
|
|
209
209
|
sellerUsername: zod_openapi_1.z.string(),
|
|
210
210
|
sellerName: zod_openapi_1.z.string(),
|
|
211
|
-
|
|
211
|
+
status: zod_openapi_1.z.enum(constants_1.PRODUCT_STATUS),
|
|
212
|
+
sellerImageUrl: zod_openapi_1.z.url().nullable(),
|
|
212
213
|
title: zod_openapi_1.z.string(),
|
|
213
214
|
category: zod_openapi_1.z.string(),
|
|
214
215
|
subcategory: zod_openapi_1.z.string().nullable(),
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -670,8 +670,8 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
670
670
|
export declare const UserWithProductsEntitySchema: z.ZodObject<{
|
|
671
671
|
userId: z.ZodCUID2;
|
|
672
672
|
products: z.ZodArray<z.ZodObject<{
|
|
673
|
-
id: z.
|
|
674
|
-
sellerId: z.
|
|
673
|
+
id: z.ZodCUID2;
|
|
674
|
+
sellerId: z.ZodCUID2;
|
|
675
675
|
sellerUsername: z.ZodString;
|
|
676
676
|
sellerName: z.ZodString;
|
|
677
677
|
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
|
@@ -822,8 +822,8 @@ export declare const GetUserWithProductsOutputSchema: z.ZodObject<{
|
|
|
822
822
|
products: z.ZodObject<{
|
|
823
823
|
userId: z.ZodCUID2;
|
|
824
824
|
products: z.ZodArray<z.ZodObject<{
|
|
825
|
-
id: z.
|
|
826
|
-
sellerId: z.
|
|
825
|
+
id: z.ZodCUID2;
|
|
826
|
+
sellerId: z.ZodCUID2;
|
|
827
827
|
sellerUsername: z.ZodString;
|
|
828
828
|
sellerName: z.ZodString;
|
|
829
829
|
sellerImageUrl: z.ZodNullable<z.ZodOptional<z.ZodURL>>;
|
package/package.json
CHANGED
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(),
|