@zyacreatives/shared 2.0.72 → 2.0.74
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.
|
@@ -91,10 +91,10 @@ export declare const CreateProjectInputSchema: z.ZodObject<{
|
|
|
91
91
|
title: z.ZodString;
|
|
92
92
|
description: z.ZodOptional<z.ZodString>;
|
|
93
93
|
overview: z.ZodOptional<z.ZodString>;
|
|
94
|
-
url: z.ZodString
|
|
94
|
+
url: z.ZodOptional<z.ZodString>;
|
|
95
95
|
imagePlaceholderUrl: z.ZodURL;
|
|
96
96
|
tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
97
|
-
startDate: z.ZodCoercedDate<unknown
|
|
97
|
+
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
98
98
|
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
99
99
|
projectCreatorType: z.ZodDefault<z.ZodEnum<{
|
|
100
100
|
readonly CREATIVE: "CREATIVE";
|
|
@@ -280,6 +280,8 @@ export declare const GetProjectOutputSchema: z.ZodObject<{
|
|
|
280
280
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
281
281
|
}, z.core.$strip>;
|
|
282
282
|
}, z.core.$strip>>>;
|
|
283
|
+
isLiked: z.ZodOptional<z.ZodBoolean>;
|
|
284
|
+
isBookmarked: z.ZodOptional<z.ZodBoolean>;
|
|
283
285
|
}, z.core.$strip>;
|
|
284
286
|
export declare const ProjectIdSchema: z.ZodObject<{
|
|
285
287
|
projectId: z.ZodCUID2;
|
package/dist/schemas/project.js
CHANGED
|
@@ -140,10 +140,10 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
|
140
140
|
title: zod_openapi_1.z.string().min(1).max(100),
|
|
141
141
|
description: zod_openapi_1.z.string().max(1000).optional(),
|
|
142
142
|
overview: zod_openapi_1.z.string().optional(),
|
|
143
|
-
url: zod_openapi_1.z.string(),
|
|
143
|
+
url: zod_openapi_1.z.string().optional(),
|
|
144
144
|
imagePlaceholderUrl: zod_openapi_1.z.url(),
|
|
145
145
|
tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
|
|
146
|
-
startDate: zod_openapi_1.z.coerce.date(),
|
|
146
|
+
startDate: zod_openapi_1.z.coerce.date().optional(),
|
|
147
147
|
endDate: zod_openapi_1.z.coerce.date().optional(),
|
|
148
148
|
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE),
|
|
149
149
|
clientId: zod_openapi_1.z.string().optional(),
|
|
@@ -157,6 +157,8 @@ exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
|
157
157
|
.superRefine(({ startDate, endDate }, ctx) => {
|
|
158
158
|
const today = new Date();
|
|
159
159
|
today.setHours(0, 0, 0, 0);
|
|
160
|
+
if (!startDate)
|
|
161
|
+
return;
|
|
160
162
|
if (startDate > today)
|
|
161
163
|
ctx.addIssue({
|
|
162
164
|
path: ["startDate"],
|
|
@@ -208,7 +210,10 @@ exports.ViewProjectInputSchema = zod_openapi_1.z
|
|
|
208
210
|
exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
|
|
209
211
|
exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
|
|
210
212
|
exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
|
|
211
|
-
exports.GetProjectOutputSchema = exports.ProjectWithFilesEntitySchema
|
|
213
|
+
exports.GetProjectOutputSchema = exports.ProjectWithFilesEntitySchema.extend({
|
|
214
|
+
isLiked: zod_openapi_1.z.boolean().optional(),
|
|
215
|
+
isBookmarked: zod_openapi_1.z.boolean().optional(),
|
|
216
|
+
});
|
|
212
217
|
exports.ProjectIdSchema = zod_openapi_1.z.object({ projectId: zod_openapi_1.z.cuid2() });
|
|
213
218
|
exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
|
|
214
219
|
id: true,
|
package/package.json
CHANGED
package/src/schemas/project.ts
CHANGED
|
@@ -146,10 +146,10 @@ export const CreateProjectInputSchema = z
|
|
|
146
146
|
title: z.string().min(1).max(100),
|
|
147
147
|
description: z.string().max(1000).optional(),
|
|
148
148
|
overview: z.string().optional(),
|
|
149
|
-
url: z.string(),
|
|
149
|
+
url: z.string().optional(),
|
|
150
150
|
imagePlaceholderUrl: z.url(),
|
|
151
151
|
tags: z.array(z.string()).default([]),
|
|
152
|
-
startDate: z.coerce.date(),
|
|
152
|
+
startDate: z.coerce.date().optional(),
|
|
153
153
|
endDate: z.coerce.date().optional(),
|
|
154
154
|
projectCreatorType: z.enum(ROLES).default(ROLES.CREATIVE),
|
|
155
155
|
clientId: z.string().optional(),
|
|
@@ -165,6 +165,7 @@ export const CreateProjectInputSchema = z
|
|
|
165
165
|
.superRefine(({ startDate, endDate }, ctx) => {
|
|
166
166
|
const today = new Date();
|
|
167
167
|
today.setHours(0, 0, 0, 0);
|
|
168
|
+
if (!startDate) return;
|
|
168
169
|
if (startDate > today)
|
|
169
170
|
ctx.addIssue({
|
|
170
171
|
path: ["startDate"],
|
|
@@ -219,7 +220,11 @@ export const ViewProjectInputSchema = z
|
|
|
219
220
|
export const CreateProjectOutputSchema = ProjectEntitySchema;
|
|
220
221
|
export const UpdateProjectOutputSchema = ProjectEntitySchema;
|
|
221
222
|
export const DeleteProjectOutputSchema = ProjectEntitySchema;
|
|
222
|
-
|
|
223
|
+
|
|
224
|
+
export const GetProjectOutputSchema = ProjectWithFilesEntitySchema.extend({
|
|
225
|
+
isLiked: z.boolean().optional(),
|
|
226
|
+
isBookmarked: z.boolean().optional(),
|
|
227
|
+
});
|
|
223
228
|
|
|
224
229
|
export const ProjectIdSchema = z.object({ projectId: z.cuid2() });
|
|
225
230
|
export const MinimalProjectSchema = ProjectEntitySchema.pick({
|