@zyacreatives/shared 1.5.6 → 1.5.8

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.
@@ -1,19 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProjectWithProjectBookmarksEntitySchema = exports.ProjectWithProjectLikesEntitySchema = exports.ProjectWithProjectCommentsEntitySchema = exports.ProjectWithProjectViewsEntitySchema = exports.ListProjectsInputSchema = exports.MinimalProjectSchema = exports.ViewProjectInputSchema = exports.UnlikeProjectParamsSchema = exports.LikeProjectParamsSchema = exports.BookmarkProjectOutputSchema = exports.BookmarkProjectParamsSchema = exports.GetProjectOutputSchema = exports.GetProjectParamsSchema = exports.DeleteProjectOutputSchema = exports.DeleteProjectCommentOutputSchema = exports.DeleteProjectCommentParamsSchema = exports.DeleteProjectInputSchema = exports.CommentOnProjectOutputSchema = exports.CommentOnProjectInputSchema = exports.CommentOnProjectParamsSchema = exports.ProjectIdSchema = exports.UpdateProjectOutputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectOutputSchema = exports.CreateProjectInputSchema = exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.ProjectFileEntitySchema = exports.ProjectEntitySchema = void 0;
3
+ exports.ProjectWithProjectBookmarksEntitySchema = exports.ProjectWithProjectLikesEntitySchema = exports.ProjectWithProjectCommentsEntitySchema = exports.ProjectWithProjectViewsEntitySchema = exports.ListProjectsInputSchema = exports.MinimalProjectSchema = exports.CommentOnProjectParamsSchema = exports.ProjectIdSchema = exports.BookmarkProjectOutputSchema = exports.GetProjectOutputSchema = exports.DeleteProjectOutputSchema = exports.DeleteProjectCommentOutputSchema = exports.CommentOnProjectOutputSchema = exports.UpdateProjectOutputSchema = exports.CreateProjectOutputSchema = exports.DeleteProjectCommentInputSchema = exports.CommentOnProjectInputSchema = exports.ViewProjectInputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectInputSchema = exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.ProjectFileEntitySchema = exports.ProjectEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const file_1 = require("./file");
7
+ /* ------------------------------ Core Entities ------------------------------ */
7
8
  exports.ProjectEntitySchema = zod_openapi_1.z
8
9
  .object({
9
- description: zod_openapi_1.z.string().optional().openapi({
10
- description: "Detailed description of the project, max 1000 characters.",
11
- example: "A modern e-commerce mobile application built with React Native.",
10
+ id: zod_openapi_1.z.string().openapi({
11
+ description: "CUID2 of the project.",
12
+ example: "ckl1y9xyz0000qv7a0h1efgh4",
13
+ }),
14
+ userId: zod_openapi_1.z.string().openapi({
15
+ description: "CUID2 of the user who created the project.",
16
+ example: "ckl1y9xyz0000qv7a0h1efgh4",
12
17
  }),
13
18
  title: zod_openapi_1.z.string().openapi({
14
19
  description: "Title of the project.",
15
20
  example: "E-commerce Mobile App",
16
21
  }),
22
+ description: zod_openapi_1.z.string().optional().openapi({
23
+ description: "Detailed description of the project, max 1000 characters.",
24
+ example: "A modern e-commerce mobile application built with React Native.",
25
+ }),
26
+ overview: zod_openapi_1.z.string().optional().openapi({
27
+ description: "Brief overview of the project.",
28
+ example: "A comprehensive e-commerce solution for mobile devices.",
29
+ }),
17
30
  url: zod_openapi_1.z.string().optional().openapi({
18
31
  description: "URL to the project or live demo.",
19
32
  example: "https://example.com/project",
@@ -29,24 +42,6 @@ exports.ProjectEntitySchema = zod_openapi_1.z
29
42
  description: "Array of tags associated with the project.",
30
43
  example: ["react-native", "e-commerce", "mobile"],
31
44
  }),
32
- startDate: zod_openapi_1.z.coerce
33
- .date()
34
- .optional()
35
- .openapi({
36
- description: "Start date of the project.",
37
- example: new Date("2024-01-01"),
38
- }),
39
- endDate: zod_openapi_1.z.coerce
40
- .date()
41
- .optional()
42
- .openapi({
43
- description: "End date of the project.",
44
- example: new Date("2024-06-30"),
45
- }),
46
- overview: zod_openapi_1.z.string().optional().openapi({
47
- description: "Brief overview of the project.",
48
- example: "A comprehensive e-commerce solution for mobile devices.",
49
- }),
50
45
  projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).openapi({
51
46
  description: "Type of creator who made this project.",
52
47
  example: "CREATIVE",
@@ -63,14 +58,28 @@ exports.ProjectEntitySchema = zod_openapi_1.z
63
58
  description: "Name of the client.",
64
59
  example: "Acme Corp",
65
60
  }),
66
- id: zod_openapi_1.z.string().openapi({
67
- description: "CUID2 of the project.",
68
- example: "ckl1y9xyz0000qv7a0h1efgh4",
69
- }),
70
61
  isFeatured: zod_openapi_1.z.boolean().optional().openapi({
71
62
  description: "Whether the project is featured.",
72
63
  example: true,
73
64
  }),
65
+ startDate: zod_openapi_1.z.coerce
66
+ .date()
67
+ .optional()
68
+ .openapi({
69
+ description: "Start date of the project.",
70
+ example: new Date("2024-01-01"),
71
+ }),
72
+ endDate: zod_openapi_1.z.coerce
73
+ .date()
74
+ .optional()
75
+ .openapi({
76
+ description: "End date of the project.",
77
+ example: new Date("2024-06-30"),
78
+ }),
79
+ searchVector: zod_openapi_1.z.string().openapi({
80
+ description: "Search vector for full-text search indexing.",
81
+ example: "ecommerce mobile app react native",
82
+ }),
74
83
  createdAt: zod_openapi_1.z.coerce.date().openapi({
75
84
  description: "Timestamp when the project was created.",
76
85
  example: new Date("2024-01-01T00:00:00.000Z"),
@@ -79,14 +88,6 @@ exports.ProjectEntitySchema = zod_openapi_1.z
79
88
  description: "Timestamp when the project was last updated.",
80
89
  example: new Date("2024-06-30T00:00:00.000Z"),
81
90
  }),
82
- userId: zod_openapi_1.z.string().openapi({
83
- description: "CUID2 of the user who created the project.",
84
- example: "ckl1y9xyz0000qv7a0h1efgh4",
85
- }),
86
- searchVector: zod_openapi_1.z.string().openapi({
87
- description: "Search vector for full-text search indexing.",
88
- example: "ecommerce mobile app react native",
89
- }),
90
91
  })
91
92
  .openapi({
92
93
  title: "Project DB Entity",
@@ -94,6 +95,13 @@ exports.ProjectEntitySchema = zod_openapi_1.z
94
95
  });
95
96
  exports.ProjectFileEntitySchema = zod_openapi_1.z
96
97
  .object({
98
+ id: zod_openapi_1.z
99
+ .string()
100
+ .openapi({ description: "CUID2 of the project file record." }),
101
+ projectId: zod_openapi_1.z.string().openapi({
102
+ description: "CUID2 of the project this file belongs to.",
103
+ }),
104
+ fileId: zod_openapi_1.z.string().openapi({ description: "CUID2 of the linked file." }),
97
105
  isPlaceholder: zod_openapi_1.z.boolean().openapi({
98
106
  description: "Indicates whether the file is a placeholder.",
99
107
  example: false,
@@ -102,18 +110,6 @@ exports.ProjectFileEntitySchema = zod_openapi_1.z
102
110
  description: "Order index of the file in the project.",
103
111
  example: 1,
104
112
  }),
105
- projectId: zod_openapi_1.z.string().openapi({
106
- description: "CUID2 of the project this file belongs to.",
107
- example: "ckl1y9xyz0000qv7a0h1efgh4",
108
- }),
109
- id: zod_openapi_1.z.string().openapi({
110
- description: "CUID2 of the project file record.",
111
- example: "ckl1y9xyz0000qv7a0h1efgh4",
112
- }),
113
- fileId: zod_openapi_1.z.string().openapi({
114
- description: "CUID2 of the linked file.",
115
- example: "ckl1y9xyz0000qv7a0h1efgh4",
116
- }),
117
113
  })
118
114
  .openapi({
119
115
  title: "Project File Entity",
@@ -127,6 +123,7 @@ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
127
123
  noOfViews: zod_openapi_1.z.number().int().optional().openapi({ example: 1200 }),
128
124
  })
129
125
  .openapi("ProjectSocialGraphEntity");
126
+ /* ------------------------------ Derived Entities ------------------------------ */
130
127
  exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend({
131
128
  projectFiles: zod_openapi_1.z
132
129
  .array(exports.ProjectFileEntitySchema.extend({
@@ -134,329 +131,143 @@ exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend({
134
131
  }))
135
132
  .optional()
136
133
  .openapi({ description: "Files associated with the project." }),
137
- }).openapi({
138
- title: "ProjectWithFilesEntity",
139
- });
134
+ }).openapi({ title: "ProjectWithFilesEntity" });
140
135
  exports.ProjectViewEntitySchema = zod_openapi_1.z
141
136
  .object({
142
- id: zod_openapi_1.z.cuid2().openapi({ example: "view_cksd0v6q0000s9a5y8z7p3x9" }),
143
- userId: zod_openapi_1.z.cuid2().optional().openapi({ example: "user_view_xyz" }),
144
- ipAddress: zod_openapi_1.z.ipv4().optional().openapi({ example: "192.168.1.1" }),
145
- userAgent: zod_openapi_1.z
146
- .string()
147
- .optional()
148
- .openapi({ example: "Mozilla/5.0 (Windows NT 10.0; Win64)" }),
149
- projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
150
- sessionId: zod_openapi_1.z.string().optional().openapi({ example: "sess_xyz789" }),
151
- viewedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T10:30:00.000Z" }),
152
- viewDate: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-14T00:00:00.000Z" }),
137
+ id: zod_openapi_1.z.cuid2(),
138
+ projectId: zod_openapi_1.z.cuid2(),
139
+ userId: zod_openapi_1.z.cuid2().optional(),
140
+ ipAddress: zod_openapi_1.z.ipv4().optional(),
141
+ userAgent: zod_openapi_1.z.string().optional(),
142
+ sessionId: zod_openapi_1.z.string().optional(),
143
+ viewedAt: zod_openapi_1.z.coerce.date(),
144
+ viewDate: zod_openapi_1.z.coerce.date(),
153
145
  })
154
146
  .openapi("ProjectViewEntity");
155
147
  exports.ProjectLikeEntitySchema = zod_openapi_1.z
156
148
  .object({
157
- createdAt: zod_openapi_1.z.coerce
158
- .date()
159
- .optional()
160
- .openapi({ example: "2025-10-13T11:00:00.000Z" }),
161
- userId: zod_openapi_1.z.cuid2().openapi({ example: "user_liker_123" }),
162
- projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
149
+ projectId: zod_openapi_1.z.cuid2(),
150
+ userId: zod_openapi_1.z.cuid2(),
151
+ createdAt: zod_openapi_1.z.coerce.date().optional(),
163
152
  })
164
153
  .openapi("ProjectLikeEntity");
165
154
  exports.ProjectCommentEntitySchema = zod_openapi_1.z
166
155
  .object({
167
- id: zod_openapi_1.z.cuid2().openapi({ example: "comment_id_1" }),
168
- createdAt: zod_openapi_1.z.coerce
169
- .date()
170
- .optional()
171
- .openapi({ example: "2025-10-13T12:00:00.000Z" }),
172
- userId: zod_openapi_1.z.cuid2().openapi({ example: "user_commenter_456" }),
173
- projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
174
- parentCommentId: zod_openapi_1.z
175
- .cuid2()
176
- .optional()
177
- .openapi({ example: "comment_id_parent_1" }),
178
- content: zod_openapi_1.z
179
- .string()
180
- .min(1)
181
- .openapi({ example: "Amazing work on the color palette!" }),
156
+ id: zod_openapi_1.z.cuid2(),
157
+ projectId: zod_openapi_1.z.cuid2(),
158
+ userId: zod_openapi_1.z.cuid2(),
159
+ commenterName: zod_openapi_1.z.string(),
160
+ commenterUsername: zod_openapi_1.z.string(),
161
+ commenterImageUrl: zod_openapi_1.z.string().optional(),
162
+ parentCommentId: zod_openapi_1.z.cuid2().optional(),
163
+ content: zod_openapi_1.z.string().min(1),
164
+ createdAt: zod_openapi_1.z.coerce.date().optional(),
182
165
  })
183
166
  .openapi("ProjectCommentEntity");
184
167
  exports.ProjectBookmarkEntitySchema = zod_openapi_1.z
185
168
  .object({
186
- createdAt: zod_openapi_1.z.coerce
187
- .date()
188
- .optional()
189
- .openapi({ example: "2025-10-13T13:00:00.000Z" }),
190
- userId: zod_openapi_1.z.cuid2().openapi({ example: "user_bookmark_789" }),
191
- projectId: zod_openapi_1.z.cuid2().openapi({ example: "proj_abc456" }),
169
+ projectId: zod_openapi_1.z.cuid2(),
170
+ userId: zod_openapi_1.z.cuid2(),
171
+ createdAt: zod_openapi_1.z.coerce.date().optional(),
192
172
  })
193
173
  .openapi("ProjectBookmarkEntity");
194
174
  exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z
195
- .object({
196
- id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
197
- })
175
+ .object({ id: zod_openapi_1.z.cuid2() })
198
176
  .openapi("ProjectUpdateOutputEntity");
199
177
  exports.CreateProjectInputSchema = zod_openapi_1.z
200
178
  .object({
201
- title: zod_openapi_1.z.string().min(1).max(100).openapi({
202
- description: "Title of the project, 1-100 characters.",
203
- example: "E-commerce Mobile App",
204
- }),
205
- description: zod_openapi_1.z.string().max(1000).optional().openapi({
206
- description: "Detailed description of the project, max 1000 characters.",
207
- example: "A modern e-commerce mobile application built with React Native.",
208
- }),
209
- url: zod_openapi_1.z.string().openapi({
210
- description: "URL to the project or live demo.",
211
- example: "https://example.com/project",
212
- }),
213
- imagePlaceholderUrl: zod_openapi_1.z.url().openapi({ example: "https://img.com" }),
214
- tags: zod_openapi_1.z
215
- .array(zod_openapi_1.z.string())
216
- .default([])
217
- .openapi({
218
- description: "Array of tags associated with the project.",
219
- example: ["react-native", "e-commerce", "mobile"],
220
- }),
221
- startDate: zod_openapi_1.z.coerce.date().openapi({
222
- description: "Start date of the project.",
223
- example: new Date("2024-01-01"),
224
- }),
225
- endDate: zod_openapi_1.z.coerce
226
- .date()
227
- .optional()
228
- .openapi({
229
- description: "End date of the project.",
230
- example: new Date("2024-06-30"),
231
- }),
232
- overview: zod_openapi_1.z.string().optional().openapi({
233
- description: "Brief overview of the project.",
234
- example: "A comprehensive e-commerce solution for mobile devices.",
235
- }),
236
- projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE).openapi({
237
- description: "Type of creator who made this project.",
238
- example: "CREATIVE",
239
- }),
240
- clientId: zod_openapi_1.z.string().optional().openapi({
241
- description: "CUID2 of the client if this is a client project.",
242
- example: "ckl1y9xyz0000qv7a0h1efgh4",
243
- }),
244
- clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).default(constants_1.CLIENT_TYPES.NONE).openapi({
245
- description: "Type of client for this project.",
246
- example: "BRAND",
247
- }),
248
- clientName: zod_openapi_1.z.string().optional().openapi({
249
- description: "Name of the client.",
250
- example: "Acme Corp",
251
- }),
252
- files: zod_openapi_1.z
253
- .array(file_1.CreateFileInputSchema.extend({
179
+ title: zod_openapi_1.z.string().min(1).max(100),
180
+ description: zod_openapi_1.z.string().max(1000).optional(),
181
+ overview: zod_openapi_1.z.string().optional(),
182
+ url: zod_openapi_1.z.string(),
183
+ imagePlaceholderUrl: zod_openapi_1.z.url(),
184
+ tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).default([]),
185
+ startDate: zod_openapi_1.z.coerce.date(),
186
+ endDate: zod_openapi_1.z.coerce.date().optional(),
187
+ projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE),
188
+ clientId: zod_openapi_1.z.string().optional(),
189
+ clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).default(constants_1.CLIENT_TYPES.NONE),
190
+ clientName: zod_openapi_1.z.string().optional(),
191
+ files: zod_openapi_1.z.array(file_1.CreateFileInputSchema.extend({
254
192
  isPlaceholder: zod_openapi_1.z.boolean().default(false),
255
193
  order: zod_openapi_1.z.int().default(1),
256
- }))
257
- .openapi({
258
- description: "Array of files/images for the project.",
259
- example: [],
260
- }),
194
+ })),
261
195
  })
262
196
  .superRefine(({ startDate, endDate }, ctx) => {
263
197
  const today = new Date();
264
198
  today.setHours(0, 0, 0, 0);
265
- if (startDate > today) {
199
+ if (startDate > today)
266
200
  ctx.addIssue({
267
201
  path: ["startDate"],
268
202
  code: "custom",
269
203
  message: "Start date cannot be in the future",
270
204
  });
271
- }
272
205
  if (endDate) {
273
- if (endDate > today) {
206
+ if (endDate > today)
274
207
  ctx.addIssue({
275
208
  path: ["endDate"],
276
209
  code: "custom",
277
210
  message: "End date cannot be in the future",
278
211
  });
279
- }
280
- if (startDate > endDate) {
212
+ if (startDate > endDate)
281
213
  ctx.addIssue({
282
214
  path: ["startDate"],
283
215
  code: "custom",
284
216
  message: "Start date cannot be after end date",
285
217
  });
286
- }
287
218
  }
288
219
  })
289
- .openapi({
290
- title: "Create Project",
291
- description: "Schema for creating a new project.",
292
- });
293
- exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
220
+ .openapi({ title: "Create Project" });
294
221
  exports.UpdateProjectInputSchema = zod_openapi_1.z
295
222
  .object({
296
- id: zod_openapi_1.z.cuid2().openapi({
297
- description: "CUID2 identifier of the project to update.",
298
- example: "ckl1z0abc0000qv7a0h1abcd2",
299
- }),
300
- title: zod_openapi_1.z.string().optional().openapi({
301
- description: "Updated title of the project.",
302
- example: "Updated E-commerce Mobile App",
303
- }),
304
- description: zod_openapi_1.z.string().optional().openapi({
305
- description: "Updated description of the project.",
306
- example: "An updated description of the project.",
307
- }),
308
- imagePlaceholderUrl: zod_openapi_1.z.url().optional().openapi({
309
- example: "https://img.com",
310
- }),
311
- overview: zod_openapi_1.z.string().optional().openapi({
312
- description: "Updated overview of the project.",
313
- example: "Updated project overview.",
314
- }),
315
- url: zod_openapi_1.z.url().optional().openapi({
316
- description: "Updated URL to the project or live demo.",
317
- example: "https://updated-example.com/project",
318
- }),
319
- clientId: zod_openapi_1.z.cuid2().optional().openapi({
320
- description: "Updated client ID.",
321
- example: "ckl1y9xyz0000qv7a0h1efgh5",
322
- }),
323
- clientType: zod_openapi_1.z.enum(["CREATIVE", "BRAND", "NONE"]).optional().openapi({
324
- description: "Updated client type.",
325
- example: "BRAND",
326
- }),
327
- clientName: zod_openapi_1.z.string().optional().openapi({
328
- description: "Updated client name.",
329
- example: "Updated Acme Corp",
330
- }),
331
- projectCreatorType: zod_openapi_1.z
332
- .enum(["CREATIVE", "BRAND", "INVESTOR", "ADMIN"])
333
- .optional()
334
- .openapi({
335
- description: "Updated project creator type.",
336
- example: "CREATIVE",
337
- }),
338
- tags: zod_openapi_1.z
339
- .array(zod_openapi_1.z.string())
340
- .optional()
341
- .openapi({
342
- description: "Updated array of tags.",
343
- example: ["react-native", "e-commerce", "mobile", "updated"],
344
- }),
345
- isFeatured: zod_openapi_1.z.boolean().optional().openapi({
346
- description: "Whether the project should be featured.",
347
- example: true,
348
- }),
349
- startDate: zod_openapi_1.z
350
- .date()
351
- .optional()
352
- .openapi({
353
- description: "Updated start date of the project.",
354
- example: new Date("2024-02-01"),
355
- }),
356
- endDate: zod_openapi_1.z
357
- .date()
358
- .optional()
359
- .openapi({
360
- description: "Updated end date of the project.",
361
- example: new Date("2024-07-30"),
362
- }),
363
- createdAt: zod_openapi_1.z
364
- .date()
365
- .optional()
366
- .openapi({
367
- description: "Creation date (read-only).",
368
- example: new Date("2024-01-01T12:00:00Z"),
369
- }),
370
- updatedAt: zod_openapi_1.z
371
- .date()
372
- .optional()
373
- .openapi({
374
- description: "Last update date (read-only).",
375
- example: new Date("2024-06-30T18:00:00Z"),
376
- }),
223
+ id: zod_openapi_1.z.cuid2(),
224
+ title: zod_openapi_1.z.string().optional(),
225
+ description: zod_openapi_1.z.string().optional(),
226
+ overview: zod_openapi_1.z.string().optional(),
227
+ url: zod_openapi_1.z.url().optional(),
228
+ imagePlaceholderUrl: zod_openapi_1.z.url().optional(),
229
+ tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
230
+ projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).optional(),
231
+ clientId: zod_openapi_1.z.cuid2().optional(),
232
+ clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).optional(),
233
+ clientName: zod_openapi_1.z.string().optional(),
234
+ isFeatured: zod_openapi_1.z.boolean().optional(),
235
+ startDate: zod_openapi_1.z.date().optional(),
236
+ endDate: zod_openapi_1.z.date().optional(),
237
+ createdAt: zod_openapi_1.z.date().optional(),
238
+ updatedAt: zod_openapi_1.z.date().optional(),
377
239
  })
378
- .openapi({
379
- title: "Update Project",
380
- description: "Schema for updating an existing project.",
381
- });
382
- exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
383
- exports.ProjectIdSchema = zod_openapi_1.z.object({
240
+ .openapi({ title: "Update Project" });
241
+ exports.ViewProjectInputSchema = zod_openapi_1.z
242
+ .object({
384
243
  projectId: zod_openapi_1.z.cuid2(),
385
- });
386
- exports.CommentOnProjectParamsSchema = exports.ProjectIdSchema;
244
+ id: zod_openapi_1.z.cuid2().optional(),
245
+ userId: zod_openapi_1.z.cuid2().optional(),
246
+ sessionId: zod_openapi_1.z.string().optional(),
247
+ ipAddress: zod_openapi_1.z.string().optional(),
248
+ userAgent: zod_openapi_1.z.string().optional(),
249
+ viewedAt: zod_openapi_1.z.date().optional(),
250
+ viewDate: zod_openapi_1.z.date().optional(),
251
+ })
252
+ .openapi({ title: "View Project" });
387
253
  exports.CommentOnProjectInputSchema = zod_openapi_1.z
388
254
  .object({
389
- content: zod_openapi_1.z.string().openapi({
390
- description: "Content of the comment.",
391
- example: "This is a great project!",
392
- }),
393
- parentCommentId: zod_openapi_1.z.cuid2().optional().openapi({
394
- description: "CUID2 of the parent comment if this is a reply.",
395
- example: "ckl1z0abc0000qv7a0h1abcd4",
396
- }),
255
+ content: zod_openapi_1.z.string(),
256
+ parentCommentId: zod_openapi_1.z.cuid2().optional(),
397
257
  })
398
- .openapi({
399
- title: "Comment on Project",
400
- description: "Schema for commenting on a project.",
401
- });
402
- exports.CommentOnProjectOutputSchema = exports.ProjectCommentEntitySchema;
403
- exports.DeleteProjectInputSchema = exports.ProjectIdSchema;
404
- exports.DeleteProjectCommentParamsSchema = zod_openapi_1.z.object({
258
+ .openapi({ title: "Comment on Project" });
259
+ exports.DeleteProjectCommentInputSchema = zod_openapi_1.z.object({
405
260
  commentId: zod_openapi_1.z.cuid2(),
406
261
  });
262
+ exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
263
+ exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
264
+ exports.CommentOnProjectOutputSchema = exports.ProjectCommentEntitySchema;
407
265
  exports.DeleteProjectCommentOutputSchema = exports.ProjectCommentEntitySchema;
408
266
  exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
409
- exports.GetProjectParamsSchema = exports.ProjectIdSchema;
410
267
  exports.GetProjectOutputSchema = exports.ProjectWithFilesEntitySchema;
411
- exports.BookmarkProjectParamsSchema = exports.ProjectIdSchema;
412
268
  exports.BookmarkProjectOutputSchema = exports.ProjectBookmarkEntitySchema;
413
- exports.LikeProjectParamsSchema = exports.ProjectIdSchema;
414
- exports.UnlikeProjectParamsSchema = exports.ProjectIdSchema;
415
- exports.ViewProjectInputSchema = zod_openapi_1.z
416
- .object({
417
- projectId: zod_openapi_1.z.cuid2().openapi({
418
- description: "CUID2 identifier of the project being viewed.",
419
- example: "ckl1z0abc0000qv7a0h1abcd2",
420
- }),
421
- id: zod_openapi_1.z.cuid2().optional().openapi({
422
- description: "CUID2 identifier of the view record (auto-generated).",
423
- example: "ckl1z0abc0000qv7a0h1abcd5",
424
- }),
425
- userId: zod_openapi_1.z.cuid2().optional().openapi({
426
- description: "CUID2 of the user who viewed the project.",
427
- example: "ckl1y9xyz0000qv7a0h1efgh3",
428
- }),
429
- sessionId: zod_openapi_1.z.string().optional().openapi({
430
- description: "Session ID for anonymous users.",
431
- example: "sess_123456789",
432
- }),
433
- ipAddress: zod_openapi_1.z.string().optional().openapi({
434
- description: "IP address of the viewer.",
435
- example: "192.168.1.1",
436
- }),
437
- userAgent: zod_openapi_1.z.string().optional().openapi({
438
- description: "User agent string of the viewer.",
439
- example: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
440
- }),
441
- viewedAt: zod_openapi_1.z
442
- .date()
443
- .optional()
444
- .openapi({
445
- description: "Date and time when the project was viewed.",
446
- example: new Date("2024-01-15T14:30:00Z"),
447
- }),
448
- viewDate: zod_openapi_1.z
449
- .date()
450
- .optional()
451
- .openapi({
452
- description: "Date when the project was viewed.",
453
- example: new Date("2024-01-15"),
454
- }),
455
- })
456
- .openapi({
457
- title: "View Project",
458
- description: "Schema for recording a project view.",
459
- });
269
+ exports.ProjectIdSchema = zod_openapi_1.z.object({ projectId: zod_openapi_1.z.cuid2() });
270
+ exports.CommentOnProjectParamsSchema = exports.ProjectIdSchema;
460
271
  exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
461
272
  id: true,
462
273
  title: true,
@@ -467,71 +278,36 @@ exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
467
278
  imagePlaceholderUrl: true,
468
279
  }).openapi({
469
280
  title: "MinimalProject",
470
- description: "Subset of project fields for lightweight listings.",
471
281
  });
472
282
  exports.ListProjectsInputSchema = zod_openapi_1.z
473
283
  .object({
474
- query: zod_openapi_1.z.string().optional().openapi({
475
- description: "Search query for projects.",
476
- example: "ecommerce app",
477
- }),
478
- tags: zod_openapi_1.z
479
- .array(zod_openapi_1.z.string())
480
- .optional()
481
- .openapi({
482
- description: "Tags to filter projects by.",
483
- example: ["react", "design"],
484
- }),
485
- clientName: zod_openapi_1.z.string().optional().openapi({
486
- description: "Client name to filter projects by.",
487
- example: "Acme Corp",
488
- }),
489
- userId: zod_openapi_1.z.string().optional().openapi({
490
- description: "Filter projects by user ID.",
491
- example: "ckl1y9xyz0000qv7a0h1efgh4",
492
- }),
493
- page: zod_openapi_1.z.number().int().optional().default(1).openapi({
494
- description: "Page number for pagination.",
495
- example: 1,
496
- }),
497
- perPage: zod_openapi_1.z.number().int().optional().default(10).openapi({
498
- description: "Number of items per page.",
499
- example: 10,
500
- }),
284
+ query: zod_openapi_1.z.string().optional(),
285
+ tags: zod_openapi_1.z.array(zod_openapi_1.z.string()).optional(),
286
+ clientName: zod_openapi_1.z.string().optional(),
287
+ userId: zod_openapi_1.z.string().optional(),
288
+ page: zod_openapi_1.z.number().int().optional().default(1),
289
+ perPage: zod_openapi_1.z.number().int().optional().default(10),
501
290
  })
502
291
  .openapi({
503
292
  title: "ListProjectsInput",
504
- description: "Parameters for listing or searching projects.",
505
293
  });
506
294
  exports.ProjectWithProjectViewsEntitySchema = exports.MinimalProjectSchema.extend({
507
- views: zod_openapi_1.z.array(exports.ProjectViewEntitySchema).openapi({
508
- description: "Array of project view records.",
509
- }),
295
+ views: zod_openapi_1.z.array(exports.ProjectViewEntitySchema),
510
296
  }).openapi({
511
297
  title: "ProjectWithProjectViewsEntity",
512
- description: "Project entity with associated views.",
513
298
  });
514
299
  exports.ProjectWithProjectCommentsEntitySchema = exports.MinimalProjectSchema.extend({
515
- comments: zod_openapi_1.z.array(exports.ProjectCommentEntitySchema).openapi({
516
- description: "Array of comments on the project.",
517
- }),
300
+ comments: zod_openapi_1.z.array(exports.ProjectCommentEntitySchema),
518
301
  }).openapi({
519
302
  title: "ProjectWithProjectCommentsEntity",
520
- description: "Project entity with associated comments.",
521
303
  });
522
304
  exports.ProjectWithProjectLikesEntitySchema = exports.MinimalProjectSchema.extend({
523
- likes: zod_openapi_1.z.array(exports.ProjectLikeEntitySchema).openapi({
524
- description: "Array of likes on the project.",
525
- }),
305
+ likes: zod_openapi_1.z.array(exports.ProjectLikeEntitySchema),
526
306
  }).openapi({
527
307
  title: "ProjectWithProjectLikesEntity",
528
- description: "Project entity with associated likes.",
529
308
  });
530
309
  exports.ProjectWithProjectBookmarksEntitySchema = exports.MinimalProjectSchema.extend({
531
- bookmarks: zod_openapi_1.z.array(exports.ProjectBookmarkEntitySchema).openapi({
532
- description: "Array of bookmarks for the project.",
533
- }),
310
+ bookmarks: zod_openapi_1.z.array(exports.ProjectBookmarkEntitySchema),
534
311
  }).openapi({
535
312
  title: "ProjectWithProjectBookmarksEntity",
536
- description: "Project entity with associated bookmarks.",
537
313
  });