@zyacreatives/shared 2.0.75 → 2.0.77

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.
@@ -185,14 +185,14 @@ export declare const BrandWithUserEntitySchema: z.ZodObject<{
185
185
  id: z.ZodCUID2;
186
186
  username: z.ZodOptional<z.ZodString>;
187
187
  email: z.ZodString;
188
+ name: z.ZodOptional<z.ZodString>;
189
+ image: z.ZodOptional<z.ZodString>;
188
190
  role: z.ZodEnum<{
189
191
  CREATIVE: "CREATIVE";
190
192
  BRAND: "BRAND";
191
193
  INVESTOR: "INVESTOR";
192
194
  ADMIN: "ADMIN";
193
195
  }>;
194
- name: z.ZodOptional<z.ZodString>;
195
- image: z.ZodOptional<z.ZodString>;
196
196
  }, z.core.$strip>;
197
197
  }, z.core.$strip>;
198
198
  export declare const SearchBrandInputSchema: z.ZodObject<{
@@ -214,14 +214,14 @@ export declare const SearchBrandOutputSchema: z.ZodObject<{
214
214
  id: z.ZodCUID2;
215
215
  username: z.ZodOptional<z.ZodString>;
216
216
  email: z.ZodString;
217
+ name: z.ZodOptional<z.ZodString>;
218
+ image: z.ZodOptional<z.ZodString>;
217
219
  role: z.ZodEnum<{
218
220
  CREATIVE: "CREATIVE";
219
221
  BRAND: "BRAND";
220
222
  INVESTOR: "INVESTOR";
221
223
  ADMIN: "ADMIN";
222
224
  }>;
223
- name: z.ZodOptional<z.ZodString>;
224
- image: z.ZodOptional<z.ZodString>;
225
225
  }, z.core.$strip>;
226
226
  }, z.core.$strip>>;
227
227
  nextCursor: z.ZodOptional<z.ZodString>;
@@ -275,14 +275,14 @@ export declare const CreativeWithUserEntitySchema: z.ZodObject<{
275
275
  id: z.ZodCUID2;
276
276
  username: z.ZodOptional<z.ZodString>;
277
277
  email: z.ZodString;
278
+ name: z.ZodOptional<z.ZodString>;
279
+ image: z.ZodOptional<z.ZodString>;
278
280
  role: z.ZodEnum<{
279
281
  CREATIVE: "CREATIVE";
280
282
  BRAND: "BRAND";
281
283
  INVESTOR: "INVESTOR";
282
284
  ADMIN: "ADMIN";
283
285
  }>;
284
- name: z.ZodOptional<z.ZodString>;
285
- image: z.ZodOptional<z.ZodString>;
286
286
  }, z.core.$strip>;
287
287
  }, z.core.$strip>;
288
288
  export declare const SearchCreativeInputSchema: z.ZodObject<{
@@ -311,14 +311,14 @@ export declare const SearchCreativeOutputSchema: z.ZodObject<{
311
311
  id: z.ZodCUID2;
312
312
  username: z.ZodOptional<z.ZodString>;
313
313
  email: z.ZodString;
314
+ name: z.ZodOptional<z.ZodString>;
315
+ image: z.ZodOptional<z.ZodString>;
314
316
  role: z.ZodEnum<{
315
317
  CREATIVE: "CREATIVE";
316
318
  BRAND: "BRAND";
317
319
  INVESTOR: "INVESTOR";
318
320
  ADMIN: "ADMIN";
319
321
  }>;
320
- name: z.ZodOptional<z.ZodString>;
321
- image: z.ZodOptional<z.ZodString>;
322
322
  }, z.core.$strip>;
323
323
  }, z.core.$strip>>;
324
324
  nextCursor: z.ZodOptional<z.ZodString>;
@@ -59,7 +59,7 @@ exports.MessageWithFilesEntitySchema = exports.MessageEntitySchema.extend({
59
59
  }))
60
60
  .optional()
61
61
  .openapi({ description: "Files associated with the project." }),
62
- }).openapi({ title: "ProjectWithFilesEntity" });
62
+ });
63
63
  exports.CreateMessageInputSchema = zod_openapi_1.z.object({
64
64
  parentId: zod_openapi_1.z
65
65
  .cuid2()
@@ -131,7 +131,7 @@ export declare const CreatePostInputSchema: z.ZodObject<{
131
131
  readonly MENTORSHIP: "Mentorship";
132
132
  }>>;
133
133
  linkMeta: z.ZodOptional<z.ZodObject<{
134
- url: z.ZodString;
134
+ url: z.ZodOptional<z.ZodURL>;
135
135
  title: z.ZodOptional<z.ZodString>;
136
136
  description: z.ZodOptional<z.ZodString>;
137
137
  image: z.ZodOptional<z.ZodString>;
@@ -82,7 +82,7 @@ exports.PostWithFilesEntitySchema = exports.PostEntitySchema.extend({
82
82
  }))
83
83
  .optional()
84
84
  .openapi({ description: "Files associated with the project." }),
85
- }).openapi({ title: "ProjectWithFilesEntity" });
85
+ });
86
86
  exports.CreatePostInputSchema = zod_openapi_1.z.object({
87
87
  parentId: zod_openapi_1.z
88
88
  .cuid2({ message: "Invalid parentId" })
@@ -91,8 +91,7 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
91
91
  parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).default(constants_1.ACTIVITY_PARENT_TYPES.POST),
92
92
  content: zod_openapi_1.z
93
93
  .string()
94
- .min(1, { message: "Post content cannot be empty" })
95
- .max(1000, { message: "Post content cannot exceed 1000 characters" })
94
+ .max(500, { message: "Post content cannot exceed 500 characters" })
96
95
  .optional()
97
96
  .openapi({
98
97
  description: "Post content",
@@ -107,19 +106,19 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
107
106
  order: zod_openapi_1.z
108
107
  .number()
109
108
  .int({ message: "File order must be an integer" })
110
- .max(10, { message: "File order cannot exceed 10" })
109
+ .max(5, { message: "File order cannot exceed 5" })
111
110
  .default(1),
112
111
  }))
113
- .max(10, { message: "Cannot attach more than 10 files" })
112
+ .max(5, { message: "Cannot attach more than 5 files" })
114
113
  .optional(),
115
114
  tags: zod_openapi_1.z
116
115
  .array(zod_openapi_1.z.string().min(1, { message: "Tag cannot be empty" }))
117
- .max(10, { message: "Cannot add more than 10 tags" })
116
+ .max(3, { message: "Cannot add more than 3 tags" })
118
117
  .optional(),
119
118
  badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional(),
120
119
  linkMeta: zod_openapi_1.z
121
120
  .object({
122
- url: zod_openapi_1.z.string().url({ message: "Invalid URL format" }),
121
+ url: zod_openapi_1.z.url({ message: "Invalid URL format" }).optional(),
123
122
  title: zod_openapi_1.z
124
123
  .string()
125
124
  .max(200, { message: "Title cannot exceed 200 characters" })
@@ -40,7 +40,7 @@ export declare const ProjectSocialGraphEntitySchema: z.ZodObject<{
40
40
  noOfBookmarks: z.ZodOptional<z.ZodNumber>;
41
41
  noOfViews: z.ZodOptional<z.ZodNumber>;
42
42
  }, z.core.$strip>;
43
- export declare const ProjectWithFilesEntitySchema: z.ZodObject<{
43
+ export declare const ProjectDetailsEntitySchema: z.ZodObject<{
44
44
  id: z.ZodString;
45
45
  userId: z.ZodString;
46
46
  title: z.ZodString;
@@ -67,6 +67,19 @@ export declare const ProjectWithFilesEntitySchema: z.ZodObject<{
67
67
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
68
68
  createdAt: z.ZodCoercedDate<unknown>;
69
69
  updatedAt: z.ZodCoercedDate<unknown>;
70
+ user: z.ZodObject<{
71
+ id: z.ZodCUID2;
72
+ username: z.ZodOptional<z.ZodString>;
73
+ email: z.ZodString;
74
+ name: z.ZodOptional<z.ZodString>;
75
+ image: z.ZodOptional<z.ZodString>;
76
+ role: z.ZodEnum<{
77
+ CREATIVE: "CREATIVE";
78
+ BRAND: "BRAND";
79
+ INVESTOR: "INVESTOR";
80
+ ADMIN: "ADMIN";
81
+ }>;
82
+ }, z.core.$strip>;
70
83
  projectFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
84
  id: z.ZodString;
72
85
  projectId: z.ZodString;
@@ -264,6 +277,19 @@ export declare const GetProjectOutputSchema: z.ZodObject<{
264
277
  endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
265
278
  createdAt: z.ZodCoercedDate<unknown>;
266
279
  updatedAt: z.ZodCoercedDate<unknown>;
280
+ user: z.ZodObject<{
281
+ id: z.ZodCUID2;
282
+ username: z.ZodOptional<z.ZodString>;
283
+ email: z.ZodString;
284
+ name: z.ZodOptional<z.ZodString>;
285
+ image: z.ZodOptional<z.ZodString>;
286
+ role: z.ZodEnum<{
287
+ CREATIVE: "CREATIVE";
288
+ BRAND: "BRAND";
289
+ INVESTOR: "INVESTOR";
290
+ ADMIN: "ADMIN";
291
+ }>;
292
+ }, z.core.$strip>;
267
293
  projectFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
268
294
  id: z.ZodString;
269
295
  projectId: z.ZodString;
@@ -1,6 +1,6 @@
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.ProjectIdSchema = exports.GetProjectOutputSchema = exports.DeleteProjectOutputSchema = exports.UpdateProjectOutputSchema = exports.CreateProjectOutputSchema = exports.ViewProjectInputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectInputSchema = exports.ProjectUpdateOutputEntitySchema = exports.ProjectWithFilesEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.ProjectFileEntitySchema = exports.ProjectEntitySchema = void 0;
3
+ exports.ProjectWithProjectBookmarksEntitySchema = exports.ProjectWithProjectLikesEntitySchema = exports.ProjectWithProjectCommentsEntitySchema = exports.ProjectWithProjectViewsEntitySchema = exports.ListProjectsInputSchema = exports.MinimalProjectSchema = exports.ProjectIdSchema = exports.GetProjectOutputSchema = exports.DeleteProjectOutputSchema = exports.UpdateProjectOutputSchema = exports.CreateProjectOutputSchema = exports.ViewProjectInputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectInputSchema = exports.ProjectUpdateOutputEntitySchema = exports.ProjectDetailsEntitySchema = 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");
@@ -8,6 +8,7 @@ const comment_1 = require("./comment");
8
8
  const bookmark_1 = require("./bookmark");
9
9
  const view_1 = require("./view");
10
10
  const like_1 = require("./like");
11
+ const user_1 = require("./user");
11
12
  /* ------------------------------ Core Entities ------------------------------ */
12
13
  exports.ProjectEntitySchema = zod_openapi_1.z
13
14
  .object({
@@ -124,14 +125,15 @@ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
124
125
  })
125
126
  .openapi("ProjectSocialGraphEntity");
126
127
  /* ------------------------------ Derived Entities ------------------------------ */
127
- exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend({
128
+ exports.ProjectDetailsEntitySchema = exports.ProjectEntitySchema.extend({
129
+ user: user_1.MinimalUserSchema,
128
130
  projectFiles: zod_openapi_1.z
129
131
  .array(exports.ProjectFileEntitySchema.extend({
130
132
  file: file_1.FileEntitySchema,
131
133
  }))
132
134
  .optional()
133
135
  .openapi({ description: "Files associated with the project." }),
134
- }).openapi({ title: "ProjectWithFilesEntity" });
136
+ }).openapi({ title: "ProjectDetailsEntity" });
135
137
  exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z
136
138
  .object({ id: zod_openapi_1.z.cuid2() })
137
139
  .openapi("ProjectUpdateOutputEntity");
@@ -210,7 +212,7 @@ exports.ViewProjectInputSchema = zod_openapi_1.z
210
212
  exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
211
213
  exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
212
214
  exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
213
- exports.GetProjectOutputSchema = exports.ProjectWithFilesEntitySchema.extend({
215
+ exports.GetProjectOutputSchema = exports.ProjectDetailsEntitySchema.extend({
214
216
  isLiked: zod_openapi_1.z.boolean().optional(),
215
217
  isBookmarked: zod_openapi_1.z.boolean().optional(),
216
218
  });
@@ -40,14 +40,14 @@ export declare const MinimalUserSchema: z.ZodObject<{
40
40
  id: z.ZodCUID2;
41
41
  username: z.ZodOptional<z.ZodString>;
42
42
  email: z.ZodString;
43
+ name: z.ZodOptional<z.ZodString>;
44
+ image: z.ZodOptional<z.ZodString>;
43
45
  role: z.ZodEnum<{
44
46
  CREATIVE: "CREATIVE";
45
47
  BRAND: "BRAND";
46
48
  INVESTOR: "INVESTOR";
47
49
  ADMIN: "ADMIN";
48
50
  }>;
49
- name: z.ZodOptional<z.ZodString>;
50
- image: z.ZodOptional<z.ZodString>;
51
51
  }, z.core.$strip>;
52
52
  export declare const UserStatsEntitySchema: z.ZodObject<{
53
53
  followerCount: z.ZodInt;
@@ -299,52 +299,52 @@ export declare const UserWithFollowingEntitySchema: z.ZodObject<{
299
299
  id: z.ZodCUID2;
300
300
  username: z.ZodOptional<z.ZodString>;
301
301
  email: z.ZodString;
302
+ name: z.ZodOptional<z.ZodString>;
303
+ image: z.ZodOptional<z.ZodString>;
302
304
  role: z.ZodEnum<{
303
305
  CREATIVE: "CREATIVE";
304
306
  BRAND: "BRAND";
305
307
  INVESTOR: "INVESTOR";
306
308
  ADMIN: "ADMIN";
307
309
  }>;
308
- name: z.ZodOptional<z.ZodString>;
309
- image: z.ZodOptional<z.ZodString>;
310
310
  following: z.ZodArray<z.ZodObject<{
311
311
  id: z.ZodCUID2;
312
312
  username: z.ZodOptional<z.ZodString>;
313
313
  email: z.ZodString;
314
+ name: z.ZodOptional<z.ZodString>;
315
+ image: z.ZodOptional<z.ZodString>;
314
316
  role: z.ZodEnum<{
315
317
  CREATIVE: "CREATIVE";
316
318
  BRAND: "BRAND";
317
319
  INVESTOR: "INVESTOR";
318
320
  ADMIN: "ADMIN";
319
321
  }>;
320
- name: z.ZodOptional<z.ZodString>;
321
- image: z.ZodOptional<z.ZodString>;
322
322
  }, z.core.$strip>>;
323
323
  }, z.core.$strip>;
324
324
  export declare const UserWithFollowersEntitySchema: z.ZodObject<{
325
325
  id: z.ZodCUID2;
326
326
  username: z.ZodOptional<z.ZodString>;
327
327
  email: z.ZodString;
328
+ name: z.ZodOptional<z.ZodString>;
329
+ image: z.ZodOptional<z.ZodString>;
328
330
  role: z.ZodEnum<{
329
331
  CREATIVE: "CREATIVE";
330
332
  BRAND: "BRAND";
331
333
  INVESTOR: "INVESTOR";
332
334
  ADMIN: "ADMIN";
333
335
  }>;
334
- name: z.ZodOptional<z.ZodString>;
335
- image: z.ZodOptional<z.ZodString>;
336
336
  followers: z.ZodArray<z.ZodObject<{
337
337
  id: z.ZodCUID2;
338
338
  username: z.ZodOptional<z.ZodString>;
339
339
  email: z.ZodString;
340
+ name: z.ZodOptional<z.ZodString>;
341
+ image: z.ZodOptional<z.ZodString>;
340
342
  role: z.ZodEnum<{
341
343
  CREATIVE: "CREATIVE";
342
344
  BRAND: "BRAND";
343
345
  INVESTOR: "INVESTOR";
344
346
  ADMIN: "ADMIN";
345
347
  }>;
346
- name: z.ZodOptional<z.ZodString>;
347
- image: z.ZodOptional<z.ZodString>;
348
348
  }, z.core.$strip>>;
349
349
  }, z.core.$strip>;
350
350
  export declare const GetUserFollowingOutputSchema: z.ZodObject<{
@@ -352,26 +352,26 @@ export declare const GetUserFollowingOutputSchema: z.ZodObject<{
352
352
  id: z.ZodCUID2;
353
353
  username: z.ZodOptional<z.ZodString>;
354
354
  email: z.ZodString;
355
+ name: z.ZodOptional<z.ZodString>;
356
+ image: z.ZodOptional<z.ZodString>;
355
357
  role: z.ZodEnum<{
356
358
  CREATIVE: "CREATIVE";
357
359
  BRAND: "BRAND";
358
360
  INVESTOR: "INVESTOR";
359
361
  ADMIN: "ADMIN";
360
362
  }>;
361
- name: z.ZodOptional<z.ZodString>;
362
- image: z.ZodOptional<z.ZodString>;
363
363
  following: z.ZodArray<z.ZodObject<{
364
364
  id: z.ZodCUID2;
365
365
  username: z.ZodOptional<z.ZodString>;
366
366
  email: z.ZodString;
367
+ name: z.ZodOptional<z.ZodString>;
368
+ image: z.ZodOptional<z.ZodString>;
367
369
  role: z.ZodEnum<{
368
370
  CREATIVE: "CREATIVE";
369
371
  BRAND: "BRAND";
370
372
  INVESTOR: "INVESTOR";
371
373
  ADMIN: "ADMIN";
372
374
  }>;
373
- name: z.ZodOptional<z.ZodString>;
374
- image: z.ZodOptional<z.ZodString>;
375
375
  }, z.core.$strip>>;
376
376
  }, z.core.$strip>;
377
377
  }, z.core.$strip>;
@@ -380,26 +380,26 @@ export declare const GetUserFollowersOutputSchema: z.ZodObject<{
380
380
  id: z.ZodCUID2;
381
381
  username: z.ZodOptional<z.ZodString>;
382
382
  email: z.ZodString;
383
+ name: z.ZodOptional<z.ZodString>;
384
+ image: z.ZodOptional<z.ZodString>;
383
385
  role: z.ZodEnum<{
384
386
  CREATIVE: "CREATIVE";
385
387
  BRAND: "BRAND";
386
388
  INVESTOR: "INVESTOR";
387
389
  ADMIN: "ADMIN";
388
390
  }>;
389
- name: z.ZodOptional<z.ZodString>;
390
- image: z.ZodOptional<z.ZodString>;
391
391
  followers: z.ZodArray<z.ZodObject<{
392
392
  id: z.ZodCUID2;
393
393
  username: z.ZodOptional<z.ZodString>;
394
394
  email: z.ZodString;
395
+ name: z.ZodOptional<z.ZodString>;
396
+ image: z.ZodOptional<z.ZodString>;
395
397
  role: z.ZodEnum<{
396
398
  CREATIVE: "CREATIVE";
397
399
  BRAND: "BRAND";
398
400
  INVESTOR: "INVESTOR";
399
401
  ADMIN: "ADMIN";
400
402
  }>;
401
- name: z.ZodOptional<z.ZodString>;
402
- image: z.ZodOptional<z.ZodString>;
403
403
  }, z.core.$strip>>;
404
404
  }, z.core.$strip>;
405
405
  }, z.core.$strip>;
@@ -655,52 +655,52 @@ export declare const GetAuthenticatedUserWithUserFollowingOutputSchema: z.ZodObj
655
655
  id: z.ZodCUID2;
656
656
  username: z.ZodOptional<z.ZodString>;
657
657
  email: z.ZodString;
658
+ name: z.ZodOptional<z.ZodString>;
659
+ image: z.ZodOptional<z.ZodString>;
658
660
  role: z.ZodEnum<{
659
661
  CREATIVE: "CREATIVE";
660
662
  BRAND: "BRAND";
661
663
  INVESTOR: "INVESTOR";
662
664
  ADMIN: "ADMIN";
663
665
  }>;
664
- name: z.ZodOptional<z.ZodString>;
665
- image: z.ZodOptional<z.ZodString>;
666
666
  following: z.ZodArray<z.ZodObject<{
667
667
  id: z.ZodCUID2;
668
668
  username: z.ZodOptional<z.ZodString>;
669
669
  email: z.ZodString;
670
+ name: z.ZodOptional<z.ZodString>;
671
+ image: z.ZodOptional<z.ZodString>;
670
672
  role: z.ZodEnum<{
671
673
  CREATIVE: "CREATIVE";
672
674
  BRAND: "BRAND";
673
675
  INVESTOR: "INVESTOR";
674
676
  ADMIN: "ADMIN";
675
677
  }>;
676
- name: z.ZodOptional<z.ZodString>;
677
- image: z.ZodOptional<z.ZodString>;
678
678
  }, z.core.$strip>>;
679
679
  }, z.core.$strip>;
680
680
  export declare const GetAuthenticatedUserWithUserFollowersOutputSchema: z.ZodObject<{
681
681
  id: z.ZodCUID2;
682
682
  username: z.ZodOptional<z.ZodString>;
683
683
  email: z.ZodString;
684
+ name: z.ZodOptional<z.ZodString>;
685
+ image: z.ZodOptional<z.ZodString>;
684
686
  role: z.ZodEnum<{
685
687
  CREATIVE: "CREATIVE";
686
688
  BRAND: "BRAND";
687
689
  INVESTOR: "INVESTOR";
688
690
  ADMIN: "ADMIN";
689
691
  }>;
690
- name: z.ZodOptional<z.ZodString>;
691
- image: z.ZodOptional<z.ZodString>;
692
692
  followers: z.ZodArray<z.ZodObject<{
693
693
  id: z.ZodCUID2;
694
694
  username: z.ZodOptional<z.ZodString>;
695
695
  email: z.ZodString;
696
+ name: z.ZodOptional<z.ZodString>;
697
+ image: z.ZodOptional<z.ZodString>;
696
698
  role: z.ZodEnum<{
697
699
  CREATIVE: "CREATIVE";
698
700
  BRAND: "BRAND";
699
701
  INVESTOR: "INVESTOR";
700
702
  ADMIN: "ADMIN";
701
703
  }>;
702
- name: z.ZodOptional<z.ZodString>;
703
- image: z.ZodOptional<z.ZodString>;
704
704
  }, z.core.$strip>>;
705
705
  }, z.core.$strip>;
706
706
  export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import type { z } from "@hono/zod-openapi";
2
- import type { ProjectEntitySchema, ProjectIdSchema, MinimalProjectSchema, ProjectFileEntitySchema, ProjectWithFilesEntitySchema, ProjectWithProjectViewsEntitySchema, ProjectWithProjectCommentsEntitySchema, ProjectWithProjectLikesEntitySchema, ProjectWithProjectBookmarksEntitySchema, CreateProjectInputSchema, CreateProjectOutputSchema, UpdateProjectInputSchema, UpdateProjectOutputSchema, DeleteProjectOutputSchema, GetProjectOutputSchema, ListProjectsInputSchema, ViewProjectInputSchema } from "../schemas/project";
2
+ import type { ProjectEntitySchema, ProjectIdSchema, MinimalProjectSchema, ProjectFileEntitySchema, ProjectDetailsEntitySchema, ProjectWithProjectViewsEntitySchema, ProjectWithProjectCommentsEntitySchema, ProjectWithProjectLikesEntitySchema, ProjectWithProjectBookmarksEntitySchema, CreateProjectInputSchema, CreateProjectOutputSchema, UpdateProjectInputSchema, UpdateProjectOutputSchema, DeleteProjectOutputSchema, GetProjectOutputSchema, ListProjectsInputSchema, ViewProjectInputSchema } from "../schemas/project";
3
3
  import { ViewEntitySchema } from "../schemas/view";
4
4
  import { LikeEntitySchema } from "../schemas/like";
5
5
  import { CommentEntitySchema } from "../schemas/comment";
@@ -10,7 +10,7 @@ export type ProjectFileEntity = z.infer<typeof ProjectFileEntitySchema>;
10
10
  export type ProjectViewEntity = z.infer<typeof ViewEntitySchema>;
11
11
  export type ProjectLikeEntity = z.infer<typeof LikeEntitySchema>;
12
12
  export type ProjectCommentEntity = z.infer<typeof CommentEntitySchema>;
13
- export type ProjectWithFilesEntity = z.infer<typeof ProjectWithFilesEntitySchema>;
13
+ export type ProjectDetailsEntity = z.infer<typeof ProjectDetailsEntitySchema>;
14
14
  export type ProjectWithProjectViewsEntity = z.infer<typeof ProjectWithProjectViewsEntitySchema>;
15
15
  export type ProjectWithProjectCommentsEntity = z.infer<typeof ProjectWithProjectCommentsEntitySchema>;
16
16
  export type ProjectWithProjectLikesEntity = z.infer<typeof ProjectWithProjectLikesEntitySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.75",
3
+ "version": "2.0.77",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -61,7 +61,7 @@ export const MessageWithFilesEntitySchema = MessageEntitySchema.extend({
61
61
  )
62
62
  .optional()
63
63
  .openapi({ description: "Files associated with the project." }),
64
- }).openapi({ title: "ProjectWithFilesEntity" });
64
+ });
65
65
 
66
66
  export const CreateMessageInputSchema = z.object({
67
67
  parentId: z
@@ -92,7 +92,7 @@ export const PostWithFilesEntitySchema = PostEntitySchema.extend({
92
92
  )
93
93
  .optional()
94
94
  .openapi({ description: "Files associated with the project." }),
95
- }).openapi({ title: "ProjectWithFilesEntity" });
95
+ });
96
96
 
97
97
  export const CreatePostInputSchema = z.object({
98
98
  parentId: z
@@ -102,8 +102,7 @@ export const CreatePostInputSchema = z.object({
102
102
  parentType: z.enum(ACTIVITY_PARENT_TYPES).default(ACTIVITY_PARENT_TYPES.POST),
103
103
  content: z
104
104
  .string()
105
- .min(1, { message: "Post content cannot be empty" })
106
- .max(1000, { message: "Post content cannot exceed 1000 characters" })
105
+ .max(500, { message: "Post content cannot exceed 500 characters" })
107
106
  .optional()
108
107
  .openapi({
109
108
  description: "Post content",
@@ -122,23 +121,21 @@ export const CreatePostInputSchema = z.object({
122
121
  .number()
123
122
  .int({ message: "File order must be an integer" })
124
123
 
125
- .max(10, { message: "File order cannot exceed 10" })
124
+ .max(5, { message: "File order cannot exceed 5" })
126
125
  .default(1),
127
126
  })
128
127
  )
129
- .max(10, { message: "Cannot attach more than 10 files" })
128
+ .max(5, { message: "Cannot attach more than 5 files" })
130
129
  .optional(),
131
130
 
132
131
  tags: z
133
132
  .array(z.string().min(1, { message: "Tag cannot be empty" }))
134
- .max(10, { message: "Cannot add more than 10 tags" })
133
+ .max(3, { message: "Cannot add more than 3 tags" })
135
134
  .optional(),
136
-
137
135
  badge: z.enum(POST_BADGE_TYPES).optional(),
138
-
139
136
  linkMeta: z
140
137
  .object({
141
- url: z.string().url({ message: "Invalid URL format" }),
138
+ url: z.url({ message: "Invalid URL format" }).optional(),
142
139
  title: z
143
140
  .string()
144
141
  .max(200, { message: "Title cannot exceed 200 characters" })
@@ -218,7 +215,6 @@ export const GetFeedOutputSchema = z.object({
218
215
  nextCursor: z.string().optional(),
219
216
  });
220
217
 
221
-
222
218
  export const SearchPostInputSchema = z.object({
223
219
  string: z
224
220
  .string()
@@ -5,6 +5,7 @@ import { CommentEntitySchema } from "./comment";
5
5
  import { BookmarkEntitySchema } from "./bookmark";
6
6
  import { ViewEntitySchema } from "./view";
7
7
  import { LikeEntitySchema } from "./like";
8
+ import { MinimalUserSchema } from "./user";
8
9
 
9
10
  /* ------------------------------ Core Entities ------------------------------ */
10
11
  export const ProjectEntitySchema = z
@@ -126,7 +127,8 @@ export const ProjectSocialGraphEntitySchema = z
126
127
  .openapi("ProjectSocialGraphEntity");
127
128
 
128
129
  /* ------------------------------ Derived Entities ------------------------------ */
129
- export const ProjectWithFilesEntitySchema = ProjectEntitySchema.extend({
130
+ export const ProjectDetailsEntitySchema = ProjectEntitySchema.extend({
131
+ user: MinimalUserSchema,
130
132
  projectFiles: z
131
133
  .array(
132
134
  ProjectFileEntitySchema.extend({
@@ -135,7 +137,7 @@ export const ProjectWithFilesEntitySchema = ProjectEntitySchema.extend({
135
137
  )
136
138
  .optional()
137
139
  .openapi({ description: "Files associated with the project." }),
138
- }).openapi({ title: "ProjectWithFilesEntity" });
140
+ }).openapi({ title: "ProjectDetailsEntity" });
139
141
 
140
142
  export const ProjectUpdateOutputEntitySchema = z
141
143
  .object({ id: z.cuid2() })
@@ -221,7 +223,7 @@ export const CreateProjectOutputSchema = ProjectEntitySchema;
221
223
  export const UpdateProjectOutputSchema = ProjectEntitySchema;
222
224
  export const DeleteProjectOutputSchema = ProjectEntitySchema;
223
225
 
224
- export const GetProjectOutputSchema = ProjectWithFilesEntitySchema.extend({
226
+ export const GetProjectOutputSchema = ProjectDetailsEntitySchema.extend({
225
227
  isLiked: z.boolean().optional(),
226
228
  isBookmarked: z.boolean().optional(),
227
229
  });
@@ -4,7 +4,7 @@ import type {
4
4
  ProjectIdSchema,
5
5
  MinimalProjectSchema,
6
6
  ProjectFileEntitySchema,
7
- ProjectWithFilesEntitySchema,
7
+ ProjectDetailsEntitySchema,
8
8
  ProjectWithProjectViewsEntitySchema,
9
9
  ProjectWithProjectCommentsEntitySchema,
10
10
  ProjectWithProjectLikesEntitySchema,
@@ -31,9 +31,7 @@ export type ProjectViewEntity = z.infer<typeof ViewEntitySchema>;
31
31
  export type ProjectLikeEntity = z.infer<typeof LikeEntitySchema>;
32
32
  export type ProjectCommentEntity = z.infer<typeof CommentEntitySchema>;
33
33
 
34
- export type ProjectWithFilesEntity = z.infer<
35
- typeof ProjectWithFilesEntitySchema
36
- >;
34
+ export type ProjectDetailsEntity = z.infer<typeof ProjectDetailsEntitySchema>;
37
35
  export type ProjectWithProjectViewsEntity = z.infer<
38
36
  typeof ProjectWithProjectViewsEntitySchema
39
37
  >;