@zyacreatives/shared 2.1.85 → 2.1.86

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.
Files changed (54) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/constants.ts +483 -483
  4. package/src/index.ts +4 -4
  5. package/src/schemas/activity.ts +14 -14
  6. package/src/schemas/auth.ts +43 -43
  7. package/src/schemas/bookmark.ts +38 -38
  8. package/src/schemas/brand.ts +146 -146
  9. package/src/schemas/chat.ts +31 -31
  10. package/src/schemas/comment.ts +60 -60
  11. package/src/schemas/common.ts +22 -22
  12. package/src/schemas/creative.ts +222 -222
  13. package/src/schemas/discipline.ts +88 -88
  14. package/src/schemas/entity-stats.ts +43 -43
  15. package/src/schemas/feed.ts +11 -11
  16. package/src/schemas/file.ts +61 -61
  17. package/src/schemas/index.ts +21 -21
  18. package/src/schemas/investor.ts +211 -211
  19. package/src/schemas/job-application.ts +257 -257
  20. package/src/schemas/job.ts +364 -364
  21. package/src/schemas/like.ts +38 -38
  22. package/src/schemas/message.ts +112 -112
  23. package/src/schemas/notification.ts +71 -71
  24. package/src/schemas/post.ts +279 -279
  25. package/src/schemas/project.ts +298 -298
  26. package/src/schemas/user-strike.ts +21 -21
  27. package/src/schemas/user.ts +283 -283
  28. package/src/schemas/username.ts +11 -11
  29. package/src/schemas/view.ts +50 -50
  30. package/src/types/auth.ts +5 -5
  31. package/src/types/bookmark.ts +4 -4
  32. package/src/types/brand.ts +37 -37
  33. package/src/types/chat.ts +21 -21
  34. package/src/types/comment.ts +12 -12
  35. package/src/types/common.ts +9 -9
  36. package/src/types/creative.ts +33 -33
  37. package/src/types/discipline.ts +32 -32
  38. package/src/types/entity-stats.ts +4 -4
  39. package/src/types/feed.ts +5 -5
  40. package/src/types/file.ts +39 -39
  41. package/src/types/index.ts +22 -22
  42. package/src/types/investor.ts +34 -34
  43. package/src/types/job-application.ts +41 -41
  44. package/src/types/job.ts +71 -71
  45. package/src/types/like.ts +3 -3
  46. package/src/types/message.ts +23 -23
  47. package/src/types/notification.ts +34 -34
  48. package/src/types/post.ts +63 -63
  49. package/src/types/project.ts +65 -65
  50. package/src/types/user-strike.ts +10 -10
  51. package/src/types/user.ts +96 -96
  52. package/src/types/username.ts +4 -4
  53. package/src/utils/slugify.ts +10 -10
  54. package/tsconfig.json +13 -13
@@ -1,38 +1,38 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { ACTIVITY_PARENT_TYPES } from "../constants";
3
-
4
- export const LikeEntitySchema = z
5
- .object({
6
- id: z.cuid2().openapi({
7
- description: "The unique CUID2 identifier for the comment.",
8
- example: "tr4q2k7k0000c7625z2k8ggy",
9
- }),
10
- createdAt: z.coerce.date().optional().openapi({
11
- description: "Timestamp when the like was created.",
12
- title: "Created At",
13
- }),
14
- userId: z.cuid2().openapi({
15
- description: "Identifier of the user who performed the like.",
16
- title: "User ID",
17
- }),
18
- parentId: z.cuid2().openapi({
19
- description: "Identifier of the parent entity that was liked.",
20
- title: "Parent ID",
21
- }),
22
- parentType: z.enum(ACTIVITY_PARENT_TYPES).openapi({
23
- description: "Type of the parent entity this statistic belongs to.",
24
- title: "Parent Type",
25
- }),
26
- })
27
- .openapi({
28
- description: "Represents a single like event on a parent entity.",
29
- title: "Like",
30
- });
31
-
32
- export const LikeInputSchema = z.object({
33
- parentId: z.string(),
34
- parentType: z.enum(ACTIVITY_PARENT_TYPES),
35
- userId: z.string(),
36
- });
37
-
38
- export const LikeOutputSchema = LikeEntitySchema;
1
+ import { z } from "@hono/zod-openapi";
2
+ import { ACTIVITY_PARENT_TYPES } from "../constants";
3
+
4
+ export const LikeEntitySchema = z
5
+ .object({
6
+ id: z.cuid2().openapi({
7
+ description: "The unique CUID2 identifier for the comment.",
8
+ example: "tr4q2k7k0000c7625z2k8ggy",
9
+ }),
10
+ createdAt: z.coerce.date().optional().openapi({
11
+ description: "Timestamp when the like was created.",
12
+ title: "Created At",
13
+ }),
14
+ userId: z.cuid2().openapi({
15
+ description: "Identifier of the user who performed the like.",
16
+ title: "User ID",
17
+ }),
18
+ parentId: z.cuid2().openapi({
19
+ description: "Identifier of the parent entity that was liked.",
20
+ title: "Parent ID",
21
+ }),
22
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).openapi({
23
+ description: "Type of the parent entity this statistic belongs to.",
24
+ title: "Parent Type",
25
+ }),
26
+ })
27
+ .openapi({
28
+ description: "Represents a single like event on a parent entity.",
29
+ title: "Like",
30
+ });
31
+
32
+ export const LikeInputSchema = z.object({
33
+ parentId: z.string(),
34
+ parentType: z.enum(ACTIVITY_PARENT_TYPES),
35
+ userId: z.string(),
36
+ });
37
+
38
+ export const LikeOutputSchema = LikeEntitySchema;
@@ -1,112 +1,112 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { ACTIVITY_PARENT_TYPES, MESSAGE_TYPES } from "../constants";
3
- import { CreateFileInputSchema } from "./file";
4
-
5
- export const MessageEntitySchema = z.object({
6
- id: z.cuid2(),
7
- parentId: z.cuid2().optional(),
8
- parentType: z.enum(ACTIVITY_PARENT_TYPES).optional(),
9
- replyToMessageId: z.cuid2().optional(),
10
- chatId: z.cuid2(),
11
- senderId: z.cuid2(),
12
- linkMeta: z
13
- .object({
14
- url: z.url(),
15
- title: z.string().optional(),
16
- description: z.string().optional(),
17
- image: z.url().optional(),
18
- })
19
- .optional()
20
- .openapi({
21
- description: "Optional metadata for a single link in the message",
22
- example: {
23
- url: "https://example.com",
24
- title: "Example Website",
25
- description: "This is an example link",
26
- image: "https://example.com/preview.jpg",
27
- },
28
- }),
29
- content: z.string().optional(),
30
- messageType: z.enum(MESSAGE_TYPES).default(MESSAGE_TYPES.DEFAULT_MESSAGE),
31
- createdAt: z.coerce.date().optional(),
32
- updatedAt: z.coerce.date().optional(),
33
- deletedAt: z.coerce.date().optional(),
34
- });
35
-
36
- export const MessageFileEntitySchema = z
37
- .object({
38
- id: z
39
- .string()
40
- .openapi({ description: "CUID2 of the project file record." }),
41
- messageId: z.string().openapi({
42
- description: "CUID2 of the message this file belongs to.",
43
- }),
44
- fileId: z.string().openapi({ description: "CUID2 of the linked file." }),
45
- order: z.number().int().openapi({
46
- description: "Order index of the file in the project.",
47
- example: 1,
48
- }),
49
- })
50
- .openapi({
51
- title: "Message File Entity",
52
- description: "Schema representing a file associated with a project.",
53
- });
54
-
55
- export const MessageWithFilesEntitySchema = MessageEntitySchema.extend({
56
- messageFiles: z
57
- .array(
58
- MessageFileEntitySchema.extend({
59
- url: z.url(),
60
- })
61
- )
62
- .optional()
63
- .openapi({ description: "Files associated with the project." }),
64
- });
65
-
66
- export const CreateMessageInputSchema = z.object({
67
- parentId: z
68
- .cuid2()
69
- .optional()
70
- .openapi({ description: "Parent id", example: "ckl1a2b3c0000abc" }),
71
- content: z
72
- .string()
73
- .openapi({
74
- description: "Message content",
75
- example: "New project announcement",
76
- })
77
- .optional(),
78
- messageType: z
79
- .enum(MESSAGE_TYPES)
80
- .default("DEFAULT_MESSAGE")
81
- .openapi({ description: "Message type", example: "PROJECT" }),
82
- files: z
83
- .array(
84
- CreateFileInputSchema.extend({
85
- order: z.int().default(1),
86
- })
87
- )
88
- .optional(),
89
- chatId: z.string(),
90
- senderId: z.string(),
91
- linkMeta: z
92
- .object({
93
- url: z.url(),
94
- title: z.string().optional(),
95
- description: z.string().optional(),
96
- image: z.url().optional(),
97
- })
98
- .optional()
99
- .openapi({
100
- description: "Optional metadata for a single link in the message",
101
- example: {
102
- url: "https://example.com",
103
- title: "Example Website",
104
- description: "This is an example link",
105
- image: "https://example.com/preview.jpg",
106
- },
107
- }),
108
- });
109
-
110
- export const CreateMessageOutputSchema = MessageEntitySchema;
111
-
112
- export const GetMessagesOutputSchema = z.array(MessageFileEntitySchema);
1
+ import { z } from "@hono/zod-openapi";
2
+ import { ACTIVITY_PARENT_TYPES, MESSAGE_TYPES } from "../constants";
3
+ import { CreateFileInputSchema } from "./file";
4
+
5
+ export const MessageEntitySchema = z.object({
6
+ id: z.cuid2(),
7
+ parentId: z.cuid2().optional(),
8
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).optional(),
9
+ replyToMessageId: z.cuid2().optional(),
10
+ chatId: z.cuid2(),
11
+ senderId: z.cuid2(),
12
+ linkMeta: z
13
+ .object({
14
+ url: z.url(),
15
+ title: z.string().optional(),
16
+ description: z.string().optional(),
17
+ image: z.url().optional(),
18
+ })
19
+ .optional()
20
+ .openapi({
21
+ description: "Optional metadata for a single link in the message",
22
+ example: {
23
+ url: "https://example.com",
24
+ title: "Example Website",
25
+ description: "This is an example link",
26
+ image: "https://example.com/preview.jpg",
27
+ },
28
+ }),
29
+ content: z.string().optional(),
30
+ messageType: z.enum(MESSAGE_TYPES).default(MESSAGE_TYPES.DEFAULT_MESSAGE),
31
+ createdAt: z.coerce.date().optional(),
32
+ updatedAt: z.coerce.date().optional(),
33
+ deletedAt: z.coerce.date().optional(),
34
+ });
35
+
36
+ export const MessageFileEntitySchema = z
37
+ .object({
38
+ id: z
39
+ .string()
40
+ .openapi({ description: "CUID2 of the project file record." }),
41
+ messageId: z.string().openapi({
42
+ description: "CUID2 of the message this file belongs to.",
43
+ }),
44
+ fileId: z.string().openapi({ description: "CUID2 of the linked file." }),
45
+ order: z.number().int().openapi({
46
+ description: "Order index of the file in the project.",
47
+ example: 1,
48
+ }),
49
+ })
50
+ .openapi({
51
+ title: "Message File Entity",
52
+ description: "Schema representing a file associated with a project.",
53
+ });
54
+
55
+ export const MessageWithFilesEntitySchema = MessageEntitySchema.extend({
56
+ messageFiles: z
57
+ .array(
58
+ MessageFileEntitySchema.extend({
59
+ url: z.url(),
60
+ })
61
+ )
62
+ .optional()
63
+ .openapi({ description: "Files associated with the project." }),
64
+ });
65
+
66
+ export const CreateMessageInputSchema = z.object({
67
+ parentId: z
68
+ .cuid2()
69
+ .optional()
70
+ .openapi({ description: "Parent id", example: "ckl1a2b3c0000abc" }),
71
+ content: z
72
+ .string()
73
+ .openapi({
74
+ description: "Message content",
75
+ example: "New project announcement",
76
+ })
77
+ .optional(),
78
+ messageType: z
79
+ .enum(MESSAGE_TYPES)
80
+ .default("DEFAULT_MESSAGE")
81
+ .openapi({ description: "Message type", example: "PROJECT" }),
82
+ files: z
83
+ .array(
84
+ CreateFileInputSchema.extend({
85
+ order: z.int().default(1),
86
+ })
87
+ )
88
+ .optional(),
89
+ chatId: z.string(),
90
+ senderId: z.string(),
91
+ linkMeta: z
92
+ .object({
93
+ url: z.url(),
94
+ title: z.string().optional(),
95
+ description: z.string().optional(),
96
+ image: z.url().optional(),
97
+ })
98
+ .optional()
99
+ .openapi({
100
+ description: "Optional metadata for a single link in the message",
101
+ example: {
102
+ url: "https://example.com",
103
+ title: "Example Website",
104
+ description: "This is an example link",
105
+ image: "https://example.com/preview.jpg",
106
+ },
107
+ }),
108
+ });
109
+
110
+ export const CreateMessageOutputSchema = MessageEntitySchema;
111
+
112
+ export const GetMessagesOutputSchema = z.array(MessageFileEntitySchema);
@@ -1,71 +1,71 @@
1
- import { z } from "@hono/zod-openapi";
2
- import { ACTIVITY_PARENT_TYPES, NOTIFICATION_TYPES } from "../constants";
3
- import { MinimalUserSchema } from "./user";
4
-
5
- export const NotificationEntitySchema = z
6
- .object({
7
- id: z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
8
- recipientId: z.cuid2().openapi({ example: "user_recipient_123" }),
9
- actorId: z.cuid2().openapi({ example: "user_actor_456" }),
10
- type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
11
- entityId: z.cuid2().optional().openapi({ example: "entity_789" }),
12
-
13
- parentId: z
14
- .cuid2()
15
- .optional()
16
- .nullable()
17
- .openapi({ example: "parent_456" }),
18
- parentType: z.enum(ACTIVITY_PARENT_TYPES).optional().nullable(),
19
- rootId: z.cuid2().openapi({ example: "root_123" }),
20
- rootType: z.enum(ACTIVITY_PARENT_TYPES),
21
-
22
- isRead: z.boolean().default(false).openapi({ example: false }),
23
- createdAt: z.coerce
24
- .date()
25
- .openapi({ example: "2026-01-05T09:00:00.000Z" }),
26
- deletedAt: z.coerce.date().optional().nullable(),
27
- })
28
- .openapi("NotificationEntity");
29
-
30
- export const MinimalNotificationEntitySchema = z.object({
31
- id: z.cuid2(),
32
- recipientId: z.cuid2(),
33
- actorId: z.cuid2(),
34
- });
35
-
36
- export const NotificationDetailsEntitySchema = NotificationEntitySchema.extend({
37
- actor: MinimalUserSchema,
38
- recipient: MinimalUserSchema,
39
- itemTitle: z.string().optional(),
40
- itemContent: z.string().optional(),
41
- itemImgUrl: z.string().optional(),
42
- itemStatus: z.string().optional(),
43
- });
44
-
45
- export const ListNotificationsInputSchema = z
46
- .object({
47
- type: z
48
- .enum(NOTIFICATION_TYPES)
49
- .openapi({ example: "LIKE" })
50
- .optional(),
51
- cursor: z.string().optional(),
52
- unreadOnly: z
53
- .preprocess((val) => val === "true" || val === true, z.boolean())
54
- .optional()
55
- .default(false),
56
- })
57
- .openapi("ListNotificationsInput");
58
-
59
- export const ListNotificationsOutputSchema = z.object({
60
- notifications: z.array(NotificationDetailsEntitySchema),
61
- nextCursor: z.string().optional().nullable(),
62
- unreadCount: z.number().int().openapi({ example: 5 }),
63
- });
64
-
65
- export const MarkReadInputSchema = z.object({
66
- notificationIds: z.array(z.cuid2()).min(1),
67
- });
68
-
69
- export const NotificationCountOutputSchema = z.object({
70
- unreadCount: z.number().int().openapi({ example: 12 }),
71
- });
1
+ import { z } from "@hono/zod-openapi";
2
+ import { ACTIVITY_PARENT_TYPES, NOTIFICATION_TYPES } from "../constants";
3
+ import { MinimalUserSchema } from "./user";
4
+
5
+ export const NotificationEntitySchema = z
6
+ .object({
7
+ id: z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
8
+ recipientId: z.cuid2().openapi({ example: "user_recipient_123" }),
9
+ actorId: z.cuid2().openapi({ example: "user_actor_456" }),
10
+ type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
11
+ entityId: z.cuid2().optional().openapi({ example: "entity_789" }),
12
+
13
+ parentId: z
14
+ .cuid2()
15
+ .optional()
16
+ .nullable()
17
+ .openapi({ example: "parent_456" }),
18
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).optional().nullable(),
19
+ rootId: z.cuid2().openapi({ example: "root_123" }),
20
+ rootType: z.enum(ACTIVITY_PARENT_TYPES),
21
+
22
+ isRead: z.boolean().default(false).openapi({ example: false }),
23
+ createdAt: z.coerce
24
+ .date()
25
+ .openapi({ example: "2026-01-05T09:00:00.000Z" }),
26
+ deletedAt: z.coerce.date().optional().nullable(),
27
+ })
28
+ .openapi("NotificationEntity");
29
+
30
+ export const MinimalNotificationEntitySchema = z.object({
31
+ id: z.cuid2(),
32
+ recipientId: z.cuid2(),
33
+ actorId: z.cuid2(),
34
+ });
35
+
36
+ export const NotificationDetailsEntitySchema = NotificationEntitySchema.extend({
37
+ actor: MinimalUserSchema,
38
+ recipient: MinimalUserSchema,
39
+ itemTitle: z.string().optional(),
40
+ itemContent: z.string().optional(),
41
+ itemImgUrl: z.string().optional(),
42
+ itemStatus: z.string().optional(),
43
+ });
44
+
45
+ export const ListNotificationsInputSchema = z
46
+ .object({
47
+ type: z
48
+ .enum(NOTIFICATION_TYPES)
49
+ .openapi({ example: "LIKE" })
50
+ .optional(),
51
+ cursor: z.string().optional(),
52
+ unreadOnly: z
53
+ .preprocess((val) => val === "true" || val === true, z.boolean())
54
+ .optional()
55
+ .default(false),
56
+ })
57
+ .openapi("ListNotificationsInput");
58
+
59
+ export const ListNotificationsOutputSchema = z.object({
60
+ notifications: z.array(NotificationDetailsEntitySchema),
61
+ nextCursor: z.string().optional().nullable(),
62
+ unreadCount: z.number().int().openapi({ example: 5 }),
63
+ });
64
+
65
+ export const MarkReadInputSchema = z.object({
66
+ notificationIds: z.array(z.cuid2()).min(1),
67
+ });
68
+
69
+ export const NotificationCountOutputSchema = z.object({
70
+ unreadCount: z.number().int().openapi({ example: 12 }),
71
+ });