@zyacreatives/shared 2.5.4 → 2.5.6
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 +2 -0
- package/dist/constants.js +2 -0
- package/dist/schemas/bookmark.d.ts +6 -0
- package/dist/schemas/comment.d.ts +4 -0
- package/dist/schemas/common.d.ts +2 -0
- package/dist/schemas/entity-stats.d.ts +2 -0
- package/dist/schemas/file.d.ts +8 -0
- package/dist/schemas/file.js +1 -4
- package/dist/schemas/like.d.ts +6 -0
- package/dist/schemas/message.d.ts +8 -0
- package/dist/schemas/notification.d.ts +12 -0
- package/dist/schemas/post.d.ts +38 -0
- package/dist/schemas/product.d.ts +66 -115
- package/dist/schemas/product.js +47 -89
- package/dist/schemas/project.d.ts +12 -0
- package/dist/schemas/transaction.d.ts +1 -1
- package/dist/schemas/user-strike.d.ts +6 -0
- package/dist/schemas/user.d.ts +86 -18
- package/dist/schemas/view.d.ts +2 -0
- package/package.json +1 -1
- package/src/constants.ts +2 -0
- package/src/schemas/file.ts +1 -4
- package/src/schemas/product.ts +58 -121
package/dist/schemas/product.js
CHANGED
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetMarketplaceInfoOutputSchema = exports.MarketplaceCategorySchema = exports.SearchProductOutputSchema = exports.SearchProductInputSchema = exports.ProductSearchDocumentSchema = exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.
|
|
3
|
+
exports.GetMarketplaceInfoOutputSchema = exports.MarketplaceCategorySchema = exports.SearchProductOutputSchema = exports.SearchProductInputSchema = exports.ProductSearchDocumentSchema = exports.ProductEntitySchema = exports.UpdateProductInputSchema = exports.ProductServiceAndComplianceInputSchema = exports.CreateProductInputSchema = exports.ProductLinkSchema = exports.ProductDiscountEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
|
|
7
|
-
key: zod_openapi_1.z.string().openapi({ description: "Storage key of the uploaded file" }),
|
|
8
|
-
mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
|
|
9
|
-
isThumbnail: zod_openapi_1.z.boolean().default(false),
|
|
10
|
-
order: zod_openapi_1.z.number().int().default(0),
|
|
11
|
-
});
|
|
12
|
-
exports.DeliveryFileInputSchema = zod_openapi_1.z.object({
|
|
13
|
-
key: zod_openapi_1.z.string().openapi({ description: "Storage key of the uploaded file" }),
|
|
14
|
-
mimeType: zod_openapi_1.z.string().openapi({ example: "application/zip" }),
|
|
15
|
-
order: zod_openapi_1.z.number().int().default(0),
|
|
16
|
-
});
|
|
17
|
-
exports.ProductCoverImageEntitySchema = zod_openapi_1.z.object({
|
|
18
|
-
fileId: zod_openapi_1.z
|
|
19
|
-
.cuid2()
|
|
20
|
-
.openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
|
|
21
|
-
isThumbnail: zod_openapi_1.z.boolean().default(false),
|
|
22
|
-
order: zod_openapi_1.z.number().int().default(0),
|
|
23
|
-
});
|
|
24
|
-
exports.ProductDeliveryFileEntitySchema = zod_openapi_1.z.object({
|
|
25
|
-
fileId: zod_openapi_1.z
|
|
26
|
-
.cuid2()
|
|
27
|
-
.openapi({ example: "f987e6543-e89b-12d3-a456-426614174000" }),
|
|
28
|
-
order: zod_openapi_1.z.number().int().default(0),
|
|
29
|
-
});
|
|
6
|
+
const file_1 = require("./file");
|
|
30
7
|
exports.ProductDiscountEntitySchema = zod_openapi_1.z.object({
|
|
31
8
|
discountType: zod_openapi_1.z.enum(constants_1.DISCOUNT_TYPES),
|
|
32
9
|
amount: zod_openapi_1.z
|
|
@@ -40,35 +17,7 @@ exports.ProductLinkSchema = zod_openapi_1.z.object({
|
|
|
40
17
|
title: zod_openapi_1.z.string().nullable(),
|
|
41
18
|
url: zod_openapi_1.z.string(),
|
|
42
19
|
});
|
|
43
|
-
|
|
44
|
-
id: zod_openapi_1.z.cuid2(),
|
|
45
|
-
createdAt: zod_openapi_1.z.date(),
|
|
46
|
-
updatedAt: zod_openapi_1.z.date(),
|
|
47
|
-
deletedAt: zod_openapi_1.z.date().nullable(),
|
|
48
|
-
status: zod_openapi_1.z.enum(constants_1.PRODUCT_STATUS).default("DRAFT"),
|
|
49
|
-
sellerId: zod_openapi_1.z.cuid2(),
|
|
50
|
-
title: zod_openapi_1.z.string(),
|
|
51
|
-
description: zod_openapi_1.z.string(),
|
|
52
|
-
keyFeatures: zod_openapi_1.z.string(),
|
|
53
|
-
category: zod_openapi_1.z.string(),
|
|
54
|
-
subcategory: zod_openapi_1.z.string().nullable(),
|
|
55
|
-
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).nullable(),
|
|
56
|
-
productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).nullable(),
|
|
57
|
-
pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS),
|
|
58
|
-
currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
|
|
59
|
-
price: zod_openapi_1.z.number().nullable(),
|
|
60
|
-
suggestedPrice: zod_openapi_1.z.number().nullable(),
|
|
61
|
-
discounts: zod_openapi_1.z
|
|
62
|
-
.array(zod_openapi_1.z.object({
|
|
63
|
-
discountType: zod_openapi_1.z.enum(constants_1.DISCOUNT_TYPES),
|
|
64
|
-
amount: zod_openapi_1.z.number(),
|
|
65
|
-
discountCode: zod_openapi_1.z.string().optional().nullable(),
|
|
66
|
-
expiry: zod_openapi_1.z.coerce.date().optional().nullable(),
|
|
67
|
-
}))
|
|
68
|
-
.nullable(),
|
|
69
|
-
supportEmail: zod_openapi_1.z.string().nullable(),
|
|
70
|
-
supportPhone: zod_openapi_1.z.string().nullable(),
|
|
71
|
-
});
|
|
20
|
+
// --- 3. Input Validation Schemas ---
|
|
72
21
|
const ProductCoreInputSchema = zod_openapi_1.z.object({
|
|
73
22
|
id: zod_openapi_1.z.cuid2().openapi({ description: "Client-generated ID for the product" }),
|
|
74
23
|
title: zod_openapi_1.z.string().min(1, "Title is required").max(255),
|
|
@@ -78,19 +27,16 @@ const ProductCoreInputSchema = zod_openapi_1.z.object({
|
|
|
78
27
|
category: zod_openapi_1.z.string().min(1, "Category is required"),
|
|
79
28
|
subcategory: zod_openapi_1.z.string().optional(),
|
|
80
29
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).max(10, "Keep tags to a maximum of 10").default([]),
|
|
81
|
-
|
|
82
|
-
.array(exports.CoverImageInputSchema)
|
|
83
|
-
.min(1, "At least one cover image is required")
|
|
84
|
-
.max(5, "Maximum of 5 cover images allowed"),
|
|
85
|
-
currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
|
|
86
|
-
productFiles: zod_openapi_1.z.array(exports.DeliveryFileInputSchema).default([]),
|
|
30
|
+
files: zod_openapi_1.z.array(file_1.CreateFileInputSchema).default([]),
|
|
87
31
|
productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).default([]),
|
|
32
|
+
currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
|
|
88
33
|
pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS).default(constants_1.PRICING_MODELS.FIXED),
|
|
89
34
|
price: zod_openapi_1.z.number().int("Must be a whole number").min(0).optional(),
|
|
90
35
|
suggestedPrice: zod_openapi_1.z.number().int("Must be in cents").min(0).optional(),
|
|
91
36
|
discounts: zod_openapi_1.z.array(exports.ProductDiscountEntitySchema).max(3).default([]),
|
|
92
37
|
});
|
|
93
38
|
exports.CreateProductInputSchema = ProductCoreInputSchema.superRefine((data, ctx) => {
|
|
39
|
+
// Pricing Validation
|
|
94
40
|
if (data.pricingModel === constants_1.PRICING_MODELS.FIXED &&
|
|
95
41
|
(!data.price || data.price <= 0)) {
|
|
96
42
|
ctx.addIssue({
|
|
@@ -101,14 +47,13 @@ exports.CreateProductInputSchema = ProductCoreInputSchema.superRefine((data, ctx
|
|
|
101
47
|
}
|
|
102
48
|
if (data.pricingModel === constants_1.PRICING_MODELS.PWYW &&
|
|
103
49
|
data.suggestedPrice !== undefined &&
|
|
104
|
-
data.price !== undefined
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
50
|
+
data.price !== undefined &&
|
|
51
|
+
data.suggestedPrice < data.price) {
|
|
52
|
+
ctx.addIssue({
|
|
53
|
+
code: "custom",
|
|
54
|
+
message: "Suggested price cannot be lower than the minimum price.",
|
|
55
|
+
path: ["suggestedPrice"],
|
|
56
|
+
});
|
|
112
57
|
}
|
|
113
58
|
if (data.pricingModel === constants_1.PRICING_MODELS.FREE &&
|
|
114
59
|
data.price &&
|
|
@@ -119,21 +64,33 @@ exports.CreateProductInputSchema = ProductCoreInputSchema.superRefine((data, ctx
|
|
|
119
64
|
path: ["price"],
|
|
120
65
|
});
|
|
121
66
|
}
|
|
122
|
-
|
|
67
|
+
// File Validation based on parentType
|
|
68
|
+
const deliveryFiles = data.files.filter((f) => f.parentType === "PRODUCT_DELIVERY");
|
|
69
|
+
const coverImages = data.files.filter((f) => f.parentType === "PRODUCT_COVER");
|
|
70
|
+
if (deliveryFiles.length === 0 && data.productLinks.length === 0) {
|
|
123
71
|
ctx.addIssue({
|
|
124
72
|
code: "custom",
|
|
125
73
|
message: "You must provide at least one product file or a link for the buyer to receive.",
|
|
126
|
-
path: ["
|
|
74
|
+
path: ["files"],
|
|
127
75
|
});
|
|
128
76
|
}
|
|
129
|
-
|
|
130
|
-
if (thumbnails.length !== 1) {
|
|
77
|
+
if (coverImages.length < 1 || coverImages.length > 5) {
|
|
131
78
|
ctx.addIssue({
|
|
132
79
|
code: "custom",
|
|
133
|
-
message: "
|
|
134
|
-
path: ["
|
|
80
|
+
message: "Between 1 and 5 cover images are required.",
|
|
81
|
+
path: ["files"],
|
|
135
82
|
});
|
|
136
83
|
}
|
|
84
|
+
else {
|
|
85
|
+
const thumbnails = coverImages.filter((img) => img.isThumbnail);
|
|
86
|
+
if (thumbnails.length !== 1) {
|
|
87
|
+
ctx.addIssue({
|
|
88
|
+
code: "custom",
|
|
89
|
+
message: "Exactly one cover image must be set as the thumbnail.",
|
|
90
|
+
path: ["files"],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
137
94
|
data.discounts.forEach((discount, index) => {
|
|
138
95
|
const isPercentage = String(discount.discountType).toUpperCase() === "PERCENTAGE";
|
|
139
96
|
const isFixed = String(discount.discountType).toUpperCase() === "FIXED";
|
|
@@ -144,14 +101,14 @@ exports.CreateProductInputSchema = ProductCoreInputSchema.superRefine((data, ctx
|
|
|
144
101
|
path: ["discounts", index, "amount"],
|
|
145
102
|
});
|
|
146
103
|
}
|
|
147
|
-
if (isFixed &&
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
104
|
+
if (isFixed &&
|
|
105
|
+
data.price !== undefined &&
|
|
106
|
+
discount.amount >= data.price) {
|
|
107
|
+
ctx.addIssue({
|
|
108
|
+
code: "custom",
|
|
109
|
+
message: "Fixed discount amounts must be less than the product price.",
|
|
110
|
+
path: ["discounts", index, "amount"],
|
|
111
|
+
});
|
|
155
112
|
}
|
|
156
113
|
});
|
|
157
114
|
});
|
|
@@ -159,7 +116,7 @@ exports.ProductServiceAndComplianceInputSchema = zod_openapi_1.z.object({
|
|
|
159
116
|
id: zod_openapi_1.z.cuid2().openapi({ description: "ID of the product" }),
|
|
160
117
|
supportEmail: zod_openapi_1.z.email("A valid support email is required"),
|
|
161
118
|
supportPhone: zod_openapi_1.z.string().optional(),
|
|
162
|
-
ownsRights: zod_openapi_1.z.literal(true, "You must confirm you own the rights to this product."),
|
|
119
|
+
ownsRights: zod_openapi_1.z.literal(true, '"You must confirm you own the rights to this product."'),
|
|
163
120
|
noHarmfulContent: zod_openapi_1.z.literal(true, "You must confirm no harmful content."),
|
|
164
121
|
providesSupport: zod_openapi_1.z.boolean(),
|
|
165
122
|
agreesToTerms: zod_openapi_1.z.literal(true, "You must agree to the Terms."),
|
|
@@ -169,6 +126,7 @@ exports.UpdateProductInputSchema = ProductCoreInputSchema.extend(exports.Product
|
|
|
169
126
|
.extend({
|
|
170
127
|
id: zod_openapi_1.z.cuid2().openapi({ description: "ID of the product being updated" }),
|
|
171
128
|
});
|
|
129
|
+
// --- 4. Entity & Output Schemas ---
|
|
172
130
|
exports.ProductEntitySchema = zod_openapi_1.z
|
|
173
131
|
.object({
|
|
174
132
|
id: zod_openapi_1.z.cuid2(),
|
|
@@ -183,18 +141,18 @@ exports.ProductEntitySchema = zod_openapi_1.z
|
|
|
183
141
|
category: zod_openapi_1.z.string(),
|
|
184
142
|
subcategory: zod_openapi_1.z.string().optional().nullable(),
|
|
185
143
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
.default([]),
|
|
189
|
-
productFiles: zod_openapi_1.z
|
|
190
|
-
.array(exports.ProductDeliveryFileEntitySchema.extend({ url: zod_openapi_1.z.url() }))
|
|
191
|
-
.default([]),
|
|
144
|
+
// Unified files array for output
|
|
145
|
+
files: zod_openapi_1.z.array(file_1.FileEntitySchema).default([]),
|
|
192
146
|
productLinks: zod_openapi_1.z.array(exports.ProductLinkSchema).default([]),
|
|
193
147
|
pricingModel: zod_openapi_1.z.enum(constants_1.PRICING_MODELS),
|
|
194
148
|
currency: zod_openapi_1.z.enum(constants_1.WAGES_CURRENCY),
|
|
195
149
|
price: zod_openapi_1.z.number().int().optional().nullable(),
|
|
196
150
|
suggestedPrice: zod_openapi_1.z.number().int().optional().nullable(),
|
|
197
151
|
discounts: zod_openapi_1.z.array(exports.ProductDiscountEntitySchema).default([]),
|
|
152
|
+
ownsRights: zod_openapi_1.z.boolean(),
|
|
153
|
+
noHarmfulContent: zod_openapi_1.z.boolean(),
|
|
154
|
+
providesSupport: zod_openapi_1.z.boolean(),
|
|
155
|
+
agreesToTerms: zod_openapi_1.z.boolean(),
|
|
198
156
|
supportEmail: zod_openapi_1.z.email().optional().nullable(),
|
|
199
157
|
supportPhone: zod_openapi_1.z.string().optional().nullable(),
|
|
200
158
|
createdAt: zod_openapi_1.z.coerce.date(),
|
|
@@ -169,6 +169,8 @@ export declare const CommentOnProjectInputSchema: z.ZodObject<{
|
|
|
169
169
|
readonly JOB: "JOB";
|
|
170
170
|
readonly POST: "POST";
|
|
171
171
|
readonly PRODUCT: "PRODUCT";
|
|
172
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
173
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
172
174
|
readonly COMMENT: "COMMENT";
|
|
173
175
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
174
176
|
}>;
|
|
@@ -466,6 +468,8 @@ export declare const ProjectWithProjectCommentsEntitySchema: z.ZodObject<{
|
|
|
466
468
|
readonly JOB: "JOB";
|
|
467
469
|
readonly POST: "POST";
|
|
468
470
|
readonly PRODUCT: "PRODUCT";
|
|
471
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
472
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
469
473
|
readonly COMMENT: "COMMENT";
|
|
470
474
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
471
475
|
}>;
|
|
@@ -500,6 +504,8 @@ export declare const GetProjectWithCommentsOutputSchema: z.ZodObject<{
|
|
|
500
504
|
readonly JOB: "JOB";
|
|
501
505
|
readonly POST: "POST";
|
|
502
506
|
readonly PRODUCT: "PRODUCT";
|
|
507
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
508
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
503
509
|
readonly COMMENT: "COMMENT";
|
|
504
510
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
505
511
|
}>;
|
|
@@ -587,6 +593,8 @@ export declare const ProjectWithProjectViewsEntitySchema: z.ZodObject<{
|
|
|
587
593
|
readonly JOB: "JOB";
|
|
588
594
|
readonly POST: "POST";
|
|
589
595
|
readonly PRODUCT: "PRODUCT";
|
|
596
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
597
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
590
598
|
readonly COMMENT: "COMMENT";
|
|
591
599
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
592
600
|
}>;
|
|
@@ -614,6 +622,8 @@ export declare const ProjectWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
614
622
|
readonly JOB: "JOB";
|
|
615
623
|
readonly POST: "POST";
|
|
616
624
|
readonly PRODUCT: "PRODUCT";
|
|
625
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
626
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
617
627
|
readonly COMMENT: "COMMENT";
|
|
618
628
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
619
629
|
}>;
|
|
@@ -819,6 +829,8 @@ export declare const CommentOnProjectOutputSchema: z.ZodObject<{
|
|
|
819
829
|
readonly JOB: "JOB";
|
|
820
830
|
readonly POST: "POST";
|
|
821
831
|
readonly PRODUCT: "PRODUCT";
|
|
832
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
833
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
822
834
|
readonly COMMENT: "COMMENT";
|
|
823
835
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
824
836
|
}>;
|
|
@@ -65,7 +65,6 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
65
65
|
readonly REFUNDED: "REFUNDED";
|
|
66
66
|
}>>;
|
|
67
67
|
amount: z.ZodNumber;
|
|
68
|
-
sellerId: z.ZodCUID2;
|
|
69
68
|
currency: z.ZodEnum<{
|
|
70
69
|
readonly USD: "USD (United States Dollar)";
|
|
71
70
|
readonly EUR: "EUR (Euro)";
|
|
@@ -78,6 +77,7 @@ export declare const CreateTransactionInputSchema: z.ZodObject<{
|
|
|
78
77
|
readonly INR: "INR (Indian Rupee)";
|
|
79
78
|
readonly ZAR: "ZAR (South African Rand)";
|
|
80
79
|
}>;
|
|
80
|
+
sellerId: z.ZodCUID2;
|
|
81
81
|
productId: z.ZodCUID2;
|
|
82
82
|
buyerId: z.ZodCUID2;
|
|
83
83
|
platformFee: z.ZodNumber;
|
|
@@ -11,6 +11,8 @@ export declare const UserStrikeEntitySchema: z.ZodObject<{
|
|
|
11
11
|
readonly JOB: "JOB";
|
|
12
12
|
readonly POST: "POST";
|
|
13
13
|
readonly PRODUCT: "PRODUCT";
|
|
14
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
15
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
14
16
|
readonly COMMENT: "COMMENT";
|
|
15
17
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
16
18
|
}>>;
|
|
@@ -27,6 +29,8 @@ export declare const UpsertUserStrikeInputSchema: z.ZodObject<{
|
|
|
27
29
|
readonly JOB: "JOB";
|
|
28
30
|
readonly POST: "POST";
|
|
29
31
|
readonly PRODUCT: "PRODUCT";
|
|
32
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
33
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
30
34
|
readonly COMMENT: "COMMENT";
|
|
31
35
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
32
36
|
}>>;
|
|
@@ -43,6 +47,8 @@ export declare const UpsertUserStrikeOutputSchema: z.ZodObject<{
|
|
|
43
47
|
readonly JOB: "JOB";
|
|
44
48
|
readonly POST: "POST";
|
|
45
49
|
readonly PRODUCT: "PRODUCT";
|
|
50
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
51
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
46
52
|
readonly COMMENT: "COMMENT";
|
|
47
53
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
48
54
|
}>>;
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -298,6 +298,8 @@ export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
|
298
298
|
readonly JOB: "JOB";
|
|
299
299
|
readonly POST: "POST";
|
|
300
300
|
readonly PRODUCT: "PRODUCT";
|
|
301
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
302
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
301
303
|
readonly COMMENT: "COMMENT";
|
|
302
304
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
303
305
|
}>>;
|
|
@@ -349,6 +351,8 @@ export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
|
349
351
|
readonly JOB: "JOB";
|
|
350
352
|
readonly POST: "POST";
|
|
351
353
|
readonly PRODUCT: "PRODUCT";
|
|
354
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
355
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
352
356
|
readonly COMMENT: "COMMENT";
|
|
353
357
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
354
358
|
}>>;
|
|
@@ -373,6 +377,8 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
373
377
|
readonly JOB: "JOB";
|
|
374
378
|
readonly POST: "POST";
|
|
375
379
|
readonly PRODUCT: "PRODUCT";
|
|
380
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
381
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
376
382
|
readonly COMMENT: "COMMENT";
|
|
377
383
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
378
384
|
}>;
|
|
@@ -400,6 +406,8 @@ export declare const UserWithPostLikesEntitySchema: z.ZodObject<{
|
|
|
400
406
|
readonly JOB: "JOB";
|
|
401
407
|
readonly POST: "POST";
|
|
402
408
|
readonly PRODUCT: "PRODUCT";
|
|
409
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
410
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
403
411
|
readonly COMMENT: "COMMENT";
|
|
404
412
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
405
413
|
}>;
|
|
@@ -428,6 +436,8 @@ export declare const UserWithJobBookmarksEntitySchema: z.ZodObject<{
|
|
|
428
436
|
readonly JOB: "JOB";
|
|
429
437
|
readonly POST: "POST";
|
|
430
438
|
readonly PRODUCT: "PRODUCT";
|
|
439
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
440
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
431
441
|
readonly COMMENT: "COMMENT";
|
|
432
442
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
433
443
|
}>;
|
|
@@ -476,6 +486,8 @@ export declare const UserWithJobBookmarksOutputSchema: z.ZodObject<{
|
|
|
476
486
|
readonly JOB: "JOB";
|
|
477
487
|
readonly POST: "POST";
|
|
478
488
|
readonly PRODUCT: "PRODUCT";
|
|
489
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
490
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
479
491
|
readonly COMMENT: "COMMENT";
|
|
480
492
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
481
493
|
}>;
|
|
@@ -521,6 +533,8 @@ export declare const UserWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
|
521
533
|
readonly JOB: "JOB";
|
|
522
534
|
readonly POST: "POST";
|
|
523
535
|
readonly PRODUCT: "PRODUCT";
|
|
536
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
537
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
524
538
|
readonly COMMENT: "COMMENT";
|
|
525
539
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
526
540
|
}>;
|
|
@@ -592,6 +606,8 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
592
606
|
readonly JOB: "JOB";
|
|
593
607
|
readonly POST: "POST";
|
|
594
608
|
readonly PRODUCT: "PRODUCT";
|
|
609
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
610
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
595
611
|
readonly COMMENT: "COMMENT";
|
|
596
612
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
597
613
|
}>;
|
|
@@ -604,6 +620,8 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
604
620
|
readonly JOB: "JOB";
|
|
605
621
|
readonly POST: "POST";
|
|
606
622
|
readonly PRODUCT: "PRODUCT";
|
|
623
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
624
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
607
625
|
readonly COMMENT: "COMMENT";
|
|
608
626
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
609
627
|
}>>;
|
|
@@ -655,6 +673,8 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
655
673
|
readonly JOB: "JOB";
|
|
656
674
|
readonly POST: "POST";
|
|
657
675
|
readonly PRODUCT: "PRODUCT";
|
|
676
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
677
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
658
678
|
readonly COMMENT: "COMMENT";
|
|
659
679
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
660
680
|
}>>;
|
|
@@ -688,16 +708,28 @@ export declare const UserWithProductsEntitySchema: z.ZodObject<{
|
|
|
688
708
|
category: z.ZodString;
|
|
689
709
|
subcategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
690
710
|
tags: z.ZodArray<z.ZodString>;
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
url: z.ZodURL;
|
|
696
|
-
}, z.core.$strip>>>;
|
|
697
|
-
productFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
698
|
-
fileId: z.ZodCUID2;
|
|
699
|
-
order: z.ZodDefault<z.ZodNumber>;
|
|
711
|
+
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
712
|
+
id: z.ZodCUID2;
|
|
713
|
+
key: z.ZodString;
|
|
714
|
+
mimeType: z.ZodString;
|
|
700
715
|
url: z.ZodURL;
|
|
716
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
717
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
718
|
+
readonly PROJECT: "PROJECT";
|
|
719
|
+
readonly USER: "USER";
|
|
720
|
+
readonly JOB: "JOB";
|
|
721
|
+
readonly POST: "POST";
|
|
722
|
+
readonly PRODUCT: "PRODUCT";
|
|
723
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
724
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
725
|
+
readonly COMMENT: "COMMENT";
|
|
726
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
727
|
+
}>>;
|
|
728
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
729
|
+
order: z.ZodNumber;
|
|
730
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
731
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
732
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
701
733
|
}, z.core.$strip>>>;
|
|
702
734
|
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
703
735
|
title: z.ZodNullable<z.ZodString>;
|
|
@@ -731,6 +763,10 @@ export declare const UserWithProductsEntitySchema: z.ZodObject<{
|
|
|
731
763
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
732
764
|
expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
733
765
|
}, z.core.$strip>>>;
|
|
766
|
+
ownsRights: z.ZodBoolean;
|
|
767
|
+
noHarmfulContent: z.ZodBoolean;
|
|
768
|
+
providesSupport: z.ZodBoolean;
|
|
769
|
+
agreesToTerms: z.ZodBoolean;
|
|
734
770
|
supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
|
|
735
771
|
supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
736
772
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -761,6 +797,8 @@ export declare const GetUserWithProjectBookmarksOutputSchema: z.ZodObject<{
|
|
|
761
797
|
readonly JOB: "JOB";
|
|
762
798
|
readonly POST: "POST";
|
|
763
799
|
readonly PRODUCT: "PRODUCT";
|
|
800
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
801
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
764
802
|
readonly COMMENT: "COMMENT";
|
|
765
803
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
766
804
|
}>;
|
|
@@ -843,16 +881,28 @@ export declare const GetUserWithProductsOutputSchema: z.ZodObject<{
|
|
|
843
881
|
category: z.ZodString;
|
|
844
882
|
subcategory: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
845
883
|
tags: z.ZodArray<z.ZodString>;
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
url: z.ZodURL;
|
|
851
|
-
}, z.core.$strip>>>;
|
|
852
|
-
productFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
853
|
-
fileId: z.ZodCUID2;
|
|
854
|
-
order: z.ZodDefault<z.ZodNumber>;
|
|
884
|
+
files: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
885
|
+
id: z.ZodCUID2;
|
|
886
|
+
key: z.ZodString;
|
|
887
|
+
mimeType: z.ZodString;
|
|
855
888
|
url: z.ZodURL;
|
|
889
|
+
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
890
|
+
parentType: z.ZodNullable<z.ZodEnum<{
|
|
891
|
+
readonly PROJECT: "PROJECT";
|
|
892
|
+
readonly USER: "USER";
|
|
893
|
+
readonly JOB: "JOB";
|
|
894
|
+
readonly POST: "POST";
|
|
895
|
+
readonly PRODUCT: "PRODUCT";
|
|
896
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
897
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
898
|
+
readonly COMMENT: "COMMENT";
|
|
899
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
900
|
+
}>>;
|
|
901
|
+
isThumbnail: z.ZodNullable<z.ZodBoolean>;
|
|
902
|
+
order: z.ZodNumber;
|
|
903
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
904
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
905
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
856
906
|
}, z.core.$strip>>>;
|
|
857
907
|
productLinks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
858
908
|
title: z.ZodNullable<z.ZodString>;
|
|
@@ -886,6 +936,10 @@ export declare const GetUserWithProductsOutputSchema: z.ZodObject<{
|
|
|
886
936
|
discountCode: z.ZodOptional<z.ZodString>;
|
|
887
937
|
expiry: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
|
|
888
938
|
}, z.core.$strip>>>;
|
|
939
|
+
ownsRights: z.ZodBoolean;
|
|
940
|
+
noHarmfulContent: z.ZodBoolean;
|
|
941
|
+
providesSupport: z.ZodBoolean;
|
|
942
|
+
agreesToTerms: z.ZodBoolean;
|
|
889
943
|
supportEmail: z.ZodNullable<z.ZodOptional<z.ZodEmail>>;
|
|
890
944
|
supportPhone: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
891
945
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -909,6 +963,8 @@ export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
|
909
963
|
readonly JOB: "JOB";
|
|
910
964
|
readonly POST: "POST";
|
|
911
965
|
readonly PRODUCT: "PRODUCT";
|
|
966
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
967
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
912
968
|
readonly COMMENT: "COMMENT";
|
|
913
969
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
914
970
|
}>;
|
|
@@ -921,6 +977,8 @@ export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
|
921
977
|
readonly JOB: "JOB";
|
|
922
978
|
readonly POST: "POST";
|
|
923
979
|
readonly PRODUCT: "PRODUCT";
|
|
980
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
981
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
924
982
|
readonly COMMENT: "COMMENT";
|
|
925
983
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
926
984
|
}>>;
|
|
@@ -972,6 +1030,8 @@ export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
|
972
1030
|
readonly JOB: "JOB";
|
|
973
1031
|
readonly POST: "POST";
|
|
974
1032
|
readonly PRODUCT: "PRODUCT";
|
|
1033
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
1034
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
975
1035
|
readonly COMMENT: "COMMENT";
|
|
976
1036
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
977
1037
|
}>>;
|
|
@@ -991,6 +1051,8 @@ export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
|
991
1051
|
readonly JOB: "JOB";
|
|
992
1052
|
readonly POST: "POST";
|
|
993
1053
|
readonly PRODUCT: "PRODUCT";
|
|
1054
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
1055
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
994
1056
|
readonly COMMENT: "COMMENT";
|
|
995
1057
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
996
1058
|
}>;
|
|
@@ -1390,6 +1452,8 @@ export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.Zod
|
|
|
1390
1452
|
readonly JOB: "JOB";
|
|
1391
1453
|
readonly POST: "POST";
|
|
1392
1454
|
readonly PRODUCT: "PRODUCT";
|
|
1455
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
1456
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
1393
1457
|
readonly COMMENT: "COMMENT";
|
|
1394
1458
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
1395
1459
|
}>;
|
|
@@ -1461,6 +1525,8 @@ export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObje
|
|
|
1461
1525
|
readonly JOB: "JOB";
|
|
1462
1526
|
readonly POST: "POST";
|
|
1463
1527
|
readonly PRODUCT: "PRODUCT";
|
|
1528
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
1529
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
1464
1530
|
readonly COMMENT: "COMMENT";
|
|
1465
1531
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
1466
1532
|
}>;
|
|
@@ -1548,6 +1614,8 @@ export declare const GetUserActivityOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
1548
1614
|
JOB: "JOB";
|
|
1549
1615
|
POST: "POST";
|
|
1550
1616
|
PRODUCT: "PRODUCT";
|
|
1617
|
+
PRODUCT_COVER: "PRODUCT_COVER";
|
|
1618
|
+
PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
1551
1619
|
COMMENT: "COMMENT";
|
|
1552
1620
|
JOB_APPLICATION: "JOB_APPLICATION";
|
|
1553
1621
|
}>;
|
package/dist/schemas/view.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare const ViewEntitySchema: z.ZodObject<{
|
|
|
11
11
|
readonly JOB: "JOB";
|
|
12
12
|
readonly POST: "POST";
|
|
13
13
|
readonly PRODUCT: "PRODUCT";
|
|
14
|
+
readonly PRODUCT_COVER: "PRODUCT_COVER";
|
|
15
|
+
readonly PRODUCT_DELIVERY: "PRODUCT_DELIVERY";
|
|
14
16
|
readonly COMMENT: "COMMENT";
|
|
15
17
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
16
18
|
}>;
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -109,6 +109,8 @@ export const ACTIVITY_PARENT_TYPES = {
|
|
|
109
109
|
JOB: "JOB",
|
|
110
110
|
POST: "POST",
|
|
111
111
|
PRODUCT: "PRODUCT",
|
|
112
|
+
PRODUCT_COVER: "PRODUCT_COVER",
|
|
113
|
+
PRODUCT_DELIVERY: "PRODUCT_DELIVERY",
|
|
112
114
|
COMMENT: "COMMENT",
|
|
113
115
|
JOB_APPLICATION: "JOB_APPLICATION",
|
|
114
116
|
} as const;
|
package/src/schemas/file.ts
CHANGED
|
@@ -8,10 +8,7 @@ export const FileEntitySchema = z
|
|
|
8
8
|
mimeType: z.string().openapi({ example: "image/jpeg" }),
|
|
9
9
|
url: z.url().openapi({ example: "https://example.com/file.jpg" }),
|
|
10
10
|
parentId: z.cuid2().nullable().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
11
|
-
parentType: z
|
|
12
|
-
.enum(ACTIVITY_PARENT_TYPES)
|
|
13
|
-
.nullable()
|
|
14
|
-
.openapi({ example: "POST" }),
|
|
11
|
+
parentType: z.enum(ACTIVITY_PARENT_TYPES).nullable(),
|
|
15
12
|
isThumbnail: z.boolean().nullable().openapi({ example: false }),
|
|
16
13
|
order: z.number().int().openapi({ example: 0 }),
|
|
17
14
|
createdAt: z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
|