@zyacreatives/shared 2.5.52 → 2.5.55

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 (114) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/schemas/activity.d.ts +1 -0
  4. package/dist/schemas/auth.d.ts +2 -0
  5. package/dist/schemas/bookmark.d.ts +62 -7
  6. package/dist/schemas/bookmark.js +32 -30
  7. package/dist/schemas/brand.d.ts +3 -3
  8. package/dist/schemas/chat.d.ts +96 -52
  9. package/dist/schemas/chat.js +44 -18
  10. package/dist/schemas/comment.d.ts +65 -21
  11. package/dist/schemas/comment.js +48 -54
  12. package/dist/schemas/common.d.ts +15 -11
  13. package/dist/schemas/creative.d.ts +21 -21
  14. package/dist/schemas/creative.js +3 -3
  15. package/dist/schemas/discipline.d.ts +63 -12
  16. package/dist/schemas/discipline.js +62 -65
  17. package/dist/schemas/entity-stats.d.ts +35 -3
  18. package/dist/schemas/entity-stats.js +24 -38
  19. package/dist/schemas/feed.d.ts +50 -3
  20. package/dist/schemas/feed.js +43 -13
  21. package/dist/schemas/file.d.ts +65 -24
  22. package/dist/schemas/file.js +60 -49
  23. package/dist/schemas/index.d.ts +1 -0
  24. package/dist/schemas/index.js +1 -0
  25. package/dist/schemas/investor-shortlist.d.ts +68 -11
  26. package/dist/schemas/investor-shortlist.js +46 -24
  27. package/dist/schemas/investor-signal.d.ts +52 -12
  28. package/dist/schemas/investor-signal.js +59 -39
  29. package/dist/schemas/investor.d.ts +3 -3
  30. package/dist/schemas/job-application.d.ts +291 -279
  31. package/dist/schemas/job-application.js +59 -95
  32. package/dist/schemas/job.d.ts +200 -659
  33. package/dist/schemas/job.js +98 -231
  34. package/dist/schemas/like.d.ts +3 -0
  35. package/dist/schemas/message.d.ts +125 -94
  36. package/dist/schemas/message.js +54 -55
  37. package/dist/schemas/notification.d.ts +99 -32
  38. package/dist/schemas/notification.js +46 -42
  39. package/dist/schemas/payout-method.d.ts +51 -31
  40. package/dist/schemas/payout-method.js +48 -58
  41. package/dist/schemas/post.d.ts +295 -204
  42. package/dist/schemas/post.js +148 -272
  43. package/dist/schemas/product.d.ts +308 -229
  44. package/dist/schemas/product.js +111 -94
  45. package/dist/schemas/project.d.ts +75 -107
  46. package/dist/schemas/project.js +1 -5
  47. package/dist/schemas/seller.d.ts +10 -10
  48. package/dist/schemas/user-strike.d.ts +3 -0
  49. package/dist/schemas/user.d.ts +128 -126
  50. package/dist/schemas/user.js +10 -1
  51. package/dist/schemas/username.d.ts +1 -0
  52. package/dist/schemas/view.d.ts +1 -0
  53. package/dist/types/activity.d.ts +1 -3
  54. package/dist/types/auth.d.ts +1 -4
  55. package/dist/types/bookmark.d.ts +1 -3
  56. package/dist/types/chat.d.ts +1 -11
  57. package/dist/types/comment.d.ts +1 -5
  58. package/dist/types/common.d.ts +2 -8
  59. package/dist/types/discipline.d.ts +1 -11
  60. package/dist/types/entity-stats.d.ts +1 -3
  61. package/dist/types/feed.d.ts +1 -5
  62. package/dist/types/investor-shortlist.d.ts +1 -6
  63. package/dist/types/investor-signal.d.ts +1 -7
  64. package/dist/types/like.d.ts +1 -3
  65. package/dist/types/message.d.ts +1 -9
  66. package/dist/types/notification.d.ts +1 -9
  67. package/dist/types/user-strike.d.ts +1 -5
  68. package/dist/types/username.d.ts +1 -3
  69. package/package.json +1 -1
  70. package/src/index.ts +4 -5
  71. package/src/schemas/activity.ts +5 -4
  72. package/src/schemas/auth.ts +14 -10
  73. package/src/schemas/bookmark.ts +48 -29
  74. package/src/schemas/chat.ts +79 -18
  75. package/src/schemas/comment.ts +63 -49
  76. package/src/schemas/common.ts +8 -3
  77. package/src/schemas/creative.ts +3 -3
  78. package/src/schemas/discipline.ts +103 -71
  79. package/src/schemas/entity-stats.ts +32 -38
  80. package/src/schemas/feed.ts +62 -15
  81. package/src/schemas/file.ts +85 -58
  82. package/src/schemas/index.ts +1 -0
  83. package/src/schemas/investor-shortlist.ts +57 -8
  84. package/src/schemas/investor-signal.ts +79 -27
  85. package/src/schemas/job-application.ts +81 -115
  86. package/src/schemas/job.ts +160 -301
  87. package/src/schemas/like.ts +5 -1
  88. package/src/schemas/message.ts +71 -64
  89. package/src/schemas/notification.ts +63 -51
  90. package/src/schemas/payout-method.ts +47 -63
  91. package/src/schemas/post.ts +211 -272
  92. package/src/schemas/product.ts +202 -139
  93. package/src/schemas/project.ts +7 -10
  94. package/src/schemas/user-strike.ts +7 -1
  95. package/src/schemas/user.ts +17 -5
  96. package/src/schemas/username.ts +5 -3
  97. package/src/schemas/view.ts +0 -50
  98. package/src/types/activity.ts +0 -4
  99. package/src/types/auth.ts +0 -5
  100. package/src/types/bookmark.ts +0 -4
  101. package/src/types/chat.ts +0 -31
  102. package/src/types/comment.ts +0 -12
  103. package/src/types/common.ts +0 -14
  104. package/src/types/discipline.ts +0 -32
  105. package/src/types/entity-stats.ts +0 -4
  106. package/src/types/feed.ts +0 -10
  107. package/src/types/index.ts +0 -16
  108. package/src/types/investor-shortlist.ts +0 -18
  109. package/src/types/investor-signal.ts +0 -26
  110. package/src/types/like.ts +0 -4
  111. package/src/types/message.ts +0 -26
  112. package/src/types/notification.ts +0 -34
  113. package/src/types/user-strike.ts +0 -10
  114. package/src/types/username.ts +0 -4
@@ -1,322 +1,198 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostSearchDocumentSchema = exports.PostAnalyticsOutputSchema = exports.SearchPostOutputSchema = exports.GetFeedOutputSchema = exports.LinkPreviewOutputSchema = exports.GetPostOutputSchema = exports.CreatePostOutputSchema = exports.SearchPostInputSchema = exports.GetFeedInputSchema = exports.ReportPostInputSchema = exports.LinkPreviewInputSchema = exports.PostIdSchema = exports.CreatePostInputSchema = exports.FeedPostEntitySchema = exports.MinimalPostSchema = exports.PostWithFilesEntitySchema = exports.PostEntitySchema = void 0;
3
+ exports.PostSearchDocumentSchema = exports.PostAnalyticsOutputSchema = exports.SearchPostOutputSchema = exports.GetFeedOutputSchema = exports.LinkPreviewOutputSchema = exports.GetPostOutputSchema = exports.CreatePostOutputSchema = exports.SearchPostInputSchema = exports.GetFeedInputSchema = exports.ReportPostInputSchema = exports.LinkPreviewInputSchema = exports.PostIdInputSchema = exports.CreatePostInputSchema = exports.FeedPostEntitySchema = exports.MinimalPostSchema = exports.PostWithFilesEntitySchema = exports.PostEntitySchema = exports.LinkMetaSchema = 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
7
  const entity_stats_1 = require("./entity-stats");
8
8
  const clean_html_1 = require("../utils/clean-html");
9
- exports.PostEntitySchema = zod_openapi_1.z.object({
10
- id: zod_openapi_1.z
11
- .cuid2()
12
- .openapi({ description: "Post id", example: "ckj1a2b3c0000xyz" }),
13
- parentId: zod_openapi_1.z
14
- .cuid2()
15
- .optional()
16
- .openapi({ description: "Parent id", example: "ckj1a2b3c0000abc" }),
17
- parentType: zod_openapi_1.z
18
- .enum(constants_1.ACTIVITY_PARENT_TYPES)
19
- .default(constants_1.ACTIVITY_PARENT_TYPES.POST)
20
- .openapi({ example: "POST" }),
21
- tags: zod_openapi_1.z
22
- .array(zod_openapi_1.z.object({
23
- name: zod_openapi_1.z.string().openapi({ example: "javascript" }),
24
- id: zod_openapi_1.z.int().openapi({ example: 101 }),
25
- }))
26
- .optional()
27
- .openapi({ example: [{ name: "javascript", id: 101 }] }),
28
- mentions: zod_openapi_1.z
29
- .array(zod_openapi_1.z.string())
30
- .optional()
31
- .openapi({ example: ["cuid123", "cuid456"] }),
32
- badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional().openapi({ example: "FEATURED" }),
33
- userId: zod_openapi_1.z
34
- .cuid2()
35
- .openapi({ description: "User id", example: "ckj1a2b3c0000def" }),
36
- creatorUsername: zod_openapi_1.z
37
- .string()
38
- .optional()
39
- .openapi({ description: "Username", example: "dev_guru" }),
40
- creatorFullName: zod_openapi_1.z.string().optional().openapi({ example: "Jane Doe" }),
41
- creatorImageUrl: zod_openapi_1.z
42
- .cuid2()
43
- .optional()
44
- .openapi({ description: "Creator Image ID", example: "clm1a2b3c0000pic" }),
9
+ /**
10
+ * --------------------------------
11
+ * SHARED
12
+ * --------------------------------
13
+ */
14
+ exports.LinkMetaSchema = zod_openapi_1.z.object({
15
+ url: zod_openapi_1.z.url(),
16
+ title: zod_openapi_1.z.string().optional(),
17
+ description: zod_openapi_1.z.string().optional(),
18
+ image: zod_openapi_1.z.url().optional(),
19
+ });
20
+ const PostTagSchema = zod_openapi_1.z.object({
21
+ id: zod_openapi_1.z.int(),
22
+ name: zod_openapi_1.z.string(),
23
+ });
24
+ /**
25
+ * --------------------------------
26
+ * SHAPE
27
+ * --------------------------------
28
+ */
29
+ const PostShape = zod_openapi_1.z.object({
30
+ parentId: zod_openapi_1.z.cuid2().optional(),
31
+ parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).default(constants_1.ACTIVITY_PARENT_TYPES.POST),
45
32
  content: zod_openapi_1.z
46
33
  .string()
47
34
  .optional()
48
- .refine((val) => {
49
- if (!val)
35
+ .refine((value) => {
36
+ if (!value)
50
37
  return true;
51
- const plainText = (0, clean_html_1.cleanHtml)(val, Number.MAX_SAFE_INTEGER);
38
+ const plainText = (0, clean_html_1.cleanHtml)(value, Number.MAX_SAFE_INTEGER);
52
39
  return plainText.length <= 300;
53
- }, { message: "Post content cannot exceed 300 characters" })
54
- .openapi({ example: "Check out my new portfolio update!" }),
55
- postType: zod_openapi_1.z.enum(constants_1.POST_TYPES).openapi({
56
- description: "Type of the post entity",
57
- title: "Post Type",
58
- example: "PROJECT",
59
- }),
60
- createdAt: zod_openapi_1.z.coerce
61
- .date()
62
- .optional()
63
- .openapi({ example: "2026-03-11T14:43:09Z" }),
64
- linkMeta: zod_openapi_1.z
65
- .object({
66
- url: zod_openapi_1.z.url().openapi({ example: "https://example.com" }),
67
- title: zod_openapi_1.z.string().optional().openapi({ example: "Example Website" }),
68
- description: zod_openapi_1.z
69
- .string()
70
- .optional()
71
- .openapi({ example: "This is an example link" }),
72
- image: zod_openapi_1.z
73
- .url()
74
- .optional()
75
- .openapi({ example: "https://example.com/preview.jpg" }),
76
- })
77
- .optional()
78
- .openapi({
79
- description: "Optional metadata for a single link in the post",
80
- }),
81
- });
40
+ }, { message: "Post content cannot exceed 300 characters" }),
41
+ postType: zod_openapi_1.z.enum(constants_1.POST_TYPES).default("DEFAULT_POST"),
42
+ badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional(),
43
+ mentions: zod_openapi_1.z.array(zod_openapi_1.z.cuid2()).max(15).optional(),
44
+ linkMeta: exports.LinkMetaSchema.optional(),
45
+ });
46
+ /**
47
+ * --------------------------------
48
+ * BASE ENTITY
49
+ * --------------------------------
50
+ */
51
+ exports.PostEntitySchema = zod_openapi_1.z
52
+ .object({
53
+ id: zod_openapi_1.z.cuid2(),
54
+ userId: zod_openapi_1.z.cuid2(),
55
+ ...PostShape.shape,
56
+ tags: zod_openapi_1.z.array(PostTagSchema).optional(),
57
+ creatorUsername: zod_openapi_1.z.string().optional(),
58
+ creatorFullName: zod_openapi_1.z.string().optional(),
59
+ creatorImageUrl: zod_openapi_1.z.string().optional(),
60
+ createdAt: zod_openapi_1.z.iso.datetime(),
61
+ })
62
+ .openapi("Post");
63
+ /**
64
+ * --------------------------------
65
+ * DERIVED ENTITIES
66
+ * --------------------------------
67
+ */
82
68
  exports.PostWithFilesEntitySchema = exports.PostEntitySchema.extend({
83
- files: zod_openapi_1.z
84
- .array(file_1.FileEntitySchema)
85
- .optional()
86
- .openapi({ description: "Files attached to the post", example: [] }),
87
- });
69
+ files: zod_openapi_1.z.array(file_1.FileEntitySchema).optional(),
70
+ }).openapi("PostWithFiles");
88
71
  exports.MinimalPostSchema = exports.PostEntitySchema.pick({
89
72
  id: true,
90
73
  parentId: true,
91
74
  content: true,
92
- });
75
+ }).openapi("MinimalPost");
93
76
  exports.FeedPostEntitySchema = exports.PostWithFilesEntitySchema.extend({
94
- stats: entity_stats_1.EntityStatsSchema,
95
- score: zod_openapi_1.z.number().openapi({ example: 98.5 }),
96
- isLiked: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
97
- isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
98
- isBookmarked: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
99
- });
100
- exports.CreatePostInputSchema = zod_openapi_1.z.object({
101
- id: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
102
- parentId: zod_openapi_1.z
103
- .cuid2({ message: "Invalid parentId" })
104
- .optional()
105
- .openapi({ description: "Parent id", example: "ckl1a2b3c0000abc" }),
106
- parentType: zod_openapi_1.z
107
- .enum(constants_1.ACTIVITY_PARENT_TYPES)
108
- .default(constants_1.ACTIVITY_PARENT_TYPES.POST)
109
- .openapi({ example: "POST" }),
110
- content: zod_openapi_1.z
111
- .string()
112
- .max(2000, { message: "Post content cannot exceed 2000 characters" })
113
- .optional()
114
- .openapi({
115
- description: "Post content",
116
- example: "New project announcement",
117
- }),
118
- postType: zod_openapi_1.z
119
- .enum(constants_1.POST_TYPES)
120
- .default("DEFAULT_POST")
121
- .openapi({ description: "Post type", example: "PROJECT" }),
77
+ stats: entity_stats_1.EntityStatsEntitySchema,
78
+ score: zod_openapi_1.z.number(),
79
+ isLiked: zod_openapi_1.z.boolean().optional(),
80
+ isFollowing: zod_openapi_1.z.boolean().optional(),
81
+ isBookmarked: zod_openapi_1.z.boolean().optional(),
82
+ }).openapi("FeedPost");
83
+ /**
84
+ * --------------------------------
85
+ * INPUTS
86
+ * --------------------------------
87
+ */
88
+ exports.CreatePostInputSchema = PostShape.extend({
89
+ content: zod_openapi_1.z.string().max(2000).optional(),
122
90
  files: zod_openapi_1.z
123
91
  .array(file_1.CreateFileInputSchema.extend({
124
- order: zod_openapi_1.z
125
- .number()
126
- .int({ message: "File order must be an integer" })
127
- .max(5, { message: "File order cannot exceed 5" })
128
- .default(1)
129
- .openapi({ example: 1 }),
130
- isThumbnail: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
92
+ order: zod_openapi_1.z.number().int().max(5).default(1),
93
+ isThumbnail: zod_openapi_1.z.boolean().optional(),
131
94
  }))
132
- .max(5, { message: "Cannot attach more than 5 files" })
133
- .optional()
134
- .openapi({
135
- example: [
136
- {
137
- key: "uploads/img.png",
138
- mimeType: "image/png",
139
- order: 1,
140
- isThumbnail: false,
141
- },
142
- ],
143
- }),
144
- tags: zod_openapi_1.z
145
- .array(zod_openapi_1.z.string().min(1, { message: "Tag cannot be empty" }))
146
- .max(3, { message: "Cannot add more than 3 tags" })
147
- .optional()
148
- .openapi({ example: ["react", "frontend"] }),
149
- mentions: zod_openapi_1.z
150
- .array(zod_openapi_1.z.cuid2())
151
- .max(15, { message: "Cannot mention more than 15 users" })
152
- .optional()
153
- .openapi({ example: ["cuid123"] }),
154
- badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional().openapi({ example: "TRENDING" }),
155
- linkMeta: zod_openapi_1.z
156
- .object({
157
- url: zod_openapi_1.z
158
- .url({ message: "Invalid URL format" })
159
- .openapi({ example: "https://example.com" }),
160
- title: zod_openapi_1.z
161
- .string()
162
- .max(200, { message: "Title cannot exceed 200 characters" })
163
- .optional()
164
- .openapi({ example: "Example Website" }),
165
- description: zod_openapi_1.z
166
- .string()
167
- .max(500, { message: "Description cannot exceed 500 characters" })
168
- .optional()
169
- .openapi({ example: "This is an example link" }),
170
- image: zod_openapi_1.z
171
- .string({ message: "" })
172
- .optional()
173
- .openapi({ example: "https://example.com/preview.jpg" }),
174
- })
175
- .optional()
176
- .openapi({
177
- description: "Optional metadata for a single link in the post",
178
- }),
95
+ .max(5)
96
+ .optional(),
97
+ tags: zod_openapi_1.z.array(zod_openapi_1.z.string().min(1)).max(3).optional(),
179
98
  });
180
- exports.PostIdSchema = zod_openapi_1.z.object({
181
- postId: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
99
+ exports.PostIdInputSchema = zod_openapi_1.z.object({
100
+ postId: zod_openapi_1.z.cuid2(),
182
101
  });
183
102
  exports.LinkPreviewInputSchema = zod_openapi_1.z.object({
184
- url: zod_openapi_1.z.url().openapi({ example: "https://example.com/article" }),
103
+ url: zod_openapi_1.z.url(),
185
104
  });
186
105
  exports.ReportPostInputSchema = zod_openapi_1.z.object({
187
- complaint: zod_openapi_1.z
188
- .string()
189
- .max(200, { error: "Complaint cannot be longer than 200 characters" })
190
- .openapi({ example: "This post contains spam." }),
106
+ complaint: zod_openapi_1.z.string().max(200),
191
107
  });
192
108
  exports.GetFeedInputSchema = zod_openapi_1.z.object({
193
- limit: zod_openapi_1.z.number().int().optional().openapi({ example: 20 }),
194
- cursor: zod_openapi_1.z.string().optional().openapi({ example: "ckj1a2b3c0000cur" }),
109
+ limit: zod_openapi_1.z.coerce.number().int().min(1).max(100).default(20),
110
+ cursor: zod_openapi_1.z.string().optional(),
195
111
  });
196
112
  exports.SearchPostInputSchema = zod_openapi_1.z.object({
197
- queryString: zod_openapi_1.z
198
- .string()
199
- .min(1, { message: "Search string cannot be empty" })
200
- .max(200, { message: "Search string cannot exceed 200 characters" })
201
- .openapi({ example: "typescript utility types" }),
202
- cursor: zod_openapi_1.z.string().optional().openapi({ example: "ckj1a2b3c0000cur" }),
203
- });
113
+ queryString: zod_openapi_1.z.string().min(1).max(200),
114
+ cursor: zod_openapi_1.z.string().optional(),
115
+ });
116
+ /**
117
+ * --------------------------------
118
+ * OUTPUTS
119
+ * --------------------------------
120
+ */
204
121
  exports.CreatePostOutputSchema = exports.PostEntitySchema;
205
122
  exports.GetPostOutputSchema = exports.PostWithFilesEntitySchema;
206
- exports.LinkPreviewOutputSchema = zod_openapi_1.z.object({
207
- title: zod_openapi_1.z.string().openapi({ example: "Great Article" }),
208
- description: zod_openapi_1.z
209
- .string()
210
- .optional()
211
- .openapi({ example: "A detailed breakdown of the topic." }),
212
- image: zod_openapi_1.z
213
- .string()
214
- .optional()
215
- .openapi({ example: "https://example.com/hero.jpg" }),
216
- url: zod_openapi_1.z
217
- .string()
218
- .optional()
219
- .openapi({ example: "https://example.com/article" }),
220
- });
123
+ exports.LinkPreviewOutputSchema = exports.LinkMetaSchema;
221
124
  exports.GetFeedOutputSchema = zod_openapi_1.z.object({
222
- feed: zod_openapi_1.z.array(exports.FeedPostEntitySchema).openapi({ example: [] }),
223
- nextCursor: zod_openapi_1.z
224
- .string()
225
- .optional()
226
- .nullable()
227
- .openapi({ example: "ckj1a2b3c0000nxt" }),
125
+ feed: zod_openapi_1.z.array(exports.FeedPostEntitySchema),
126
+ nextCursor: zod_openapi_1.z.string().optional(),
228
127
  });
229
128
  exports.SearchPostOutputSchema = zod_openapi_1.z.object({
230
- posts: zod_openapi_1.z.array(exports.FeedPostEntitySchema).openapi({ example: [] }),
231
- nextCursor: zod_openapi_1.z
232
- .string()
233
- .optional()
234
- .nullable()
235
- .openapi({ example: "ckj1a2b3c0000nxt" }),
236
- });
129
+ posts: zod_openapi_1.z.array(exports.FeedPostEntitySchema),
130
+ nextCursor: zod_openapi_1.z.string().optional(),
131
+ });
132
+ /**
133
+ * --------------------------------
134
+ * ANALYTICS
135
+ * --------------------------------
136
+ */
237
137
  const AnalyticsChartItemSchema = zod_openapi_1.z.object({
238
- x: zod_openapi_1.z.string().openapi({ example: "2026-03-11" }),
239
- y: zod_openapi_1.z.number().openapi({ example: 150 }),
138
+ x: zod_openapi_1.z.string(),
139
+ y: zod_openapi_1.z.number(),
240
140
  });
241
141
  exports.PostAnalyticsOutputSchema = zod_openapi_1.z.object({
242
142
  awareness: zod_openapi_1.z.object({
243
- reach: zod_openapi_1.z.number().openapi({ example: 5000 }),
244
- impressions: zod_openapi_1.z.number().openapi({ example: 6500 }),
245
- visitors: zod_openapi_1.z.number().openapi({ example: 1200 }),
246
- newFollowers: zod_openapi_1.z.number().openapi({ example: 45 }),
143
+ reach: zod_openapi_1.z.number(),
144
+ impressions: zod_openapi_1.z.number(),
145
+ visitors: zod_openapi_1.z.number(),
146
+ newFollowers: zod_openapi_1.z.number(),
247
147
  }),
248
148
  engagement: zod_openapi_1.z.object({
249
- rate: zod_openapi_1.z.number().openapi({ example: 4.2 }),
250
- likes: zod_openapi_1.z.number().openapi({ example: 210 }),
251
- comments: zod_openapi_1.z.number().openapi({ example: 34 }),
252
- linkCopied: zod_openapi_1.z.number().openapi({ example: 12 }),
253
- bookmarks: zod_openapi_1.z.number().openapi({ example: 56 }),
254
- tagsClicked: zod_openapi_1.z
255
- .array(AnalyticsChartItemSchema)
256
- .openapi({ example: [{ x: "javascript", y: 25 }] }),
257
- platformShares: zod_openapi_1.z
258
- .array(AnalyticsChartItemSchema)
259
- .openapi({ example: [{ x: "Twitter", y: 10 }] }),
149
+ rate: zod_openapi_1.z.number(),
150
+ likes: zod_openapi_1.z.number(),
151
+ comments: zod_openapi_1.z.number(),
152
+ linkCopied: zod_openapi_1.z.number(),
153
+ bookmarks: zod_openapi_1.z.number(),
154
+ tagsClicked: zod_openapi_1.z.array(AnalyticsChartItemSchema),
155
+ platformShares: zod_openapi_1.z.array(AnalyticsChartItemSchema),
260
156
  }),
261
157
  behavior: zod_openapi_1.z.object({
262
- viralityScore: zod_openapi_1.z.number().openapi({ example: 8.5 }),
263
- frictionRatio: zod_openapi_1.z.number().openapi({ example: 1.2 }),
264
- consumptionDepth: zod_openapi_1.z.number().openapi({ example: 65.4 }),
158
+ viralityScore: zod_openapi_1.z.number(),
159
+ frictionRatio: zod_openapi_1.z.number(),
160
+ consumptionDepth: zod_openapi_1.z.number(),
265
161
  sentiment: zod_openapi_1.z.object({
266
- positive: zod_openapi_1.z.number().openapi({ example: 85 }),
267
- negative: zod_openapi_1.z.number().openapi({ example: 5 }),
268
- score: zod_openapi_1.z.number().openapi({ example: 9.1 }),
269
- reports: zod_openapi_1.z.number().openapi({ example: 0 }),
270
- notInterested: zod_openapi_1.z.number().openapi({ example: 2 }),
271
- status: zod_openapi_1.z.enum(["Healthy", "Polarizing"]).openapi({ example: "Healthy" }),
162
+ positive: zod_openapi_1.z.number(),
163
+ negative: zod_openapi_1.z.number(),
164
+ score: zod_openapi_1.z.number(),
165
+ reports: zod_openapi_1.z.number(),
166
+ notInterested: zod_openapi_1.z.number(),
167
+ status: zod_openapi_1.z.enum(["Healthy", "Polarizing"]),
272
168
  }),
273
169
  }),
274
170
  });
171
+ /**
172
+ * --------------------------------
173
+ * SEARCH DOCUMENT
174
+ * --------------------------------
175
+ */
275
176
  exports.PostSearchDocumentSchema = zod_openapi_1.z
276
177
  .object({
277
- id: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000doc" }),
278
- userId: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000usr" }),
279
- parentId: zod_openapi_1.z.cuid2().nullable().openapi({ example: "ckj1a2b3c0000prt" }),
280
- parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).openapi({ example: "POST" }),
281
- creatorUsername: zod_openapi_1.z.string().nullable().openapi({ example: "tech_lead" }),
282
- creatorFullName: zod_openapi_1.z.string().nullable().openapi({ example: "Alex Smith" }),
283
- creatorImageUrl: zod_openapi_1.z
284
- .cuid2()
285
- .nullable()
286
- .openapi({ example: "clm1a2b3c0000pic" }),
287
- tagIds: zod_openapi_1.z.array(zod_openapi_1.z.number()).openapi({ example: [101, 102] }),
288
- tagNames: zod_openapi_1.z.array(zod_openapi_1.z.string()).openapi({ example: ["react", "typescript"] }),
289
- badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).nullable().openapi({ example: "TRENDING" }),
290
- postType: zod_openapi_1.z.enum(constants_1.POST_TYPES).openapi({ example: "PROJECT" }),
291
- content: zod_openapi_1.z
292
- .string()
293
- .nullable()
294
- .openapi({ example: "Here is my latest open source tool." }),
295
- linkTitle: zod_openapi_1.z.string().nullable().openapi({ example: "GitHub Repo" }),
296
- linkDescription: zod_openapi_1.z
297
- .string()
298
- .nullable()
299
- .openapi({ example: "A fast, modern build system." }),
300
- linkUrl: zod_openapi_1.z
301
- .url()
302
- .nullable()
303
- .openapi({ example: "https://github.com/project" }),
304
- linkImage: zod_openapi_1.z
305
- .url()
306
- .nullable()
307
- .openapi({ example: "https://github.com/image.png" }),
308
- files: zod_openapi_1.z.array(file_1.FileEntitySchema).nullable().openapi({ example: [] }),
309
- mentions: zod_openapi_1.z
310
- .array(zod_openapi_1.z.cuid2())
311
- .max(15, { message: "Cannot mention more than 15 users" })
312
- .optional()
313
- .openapi({ example: ["cuid123"] }),
314
- createdAt: zod_openapi_1.z
315
- .string()
316
- .nullable()
317
- .openapi({ example: "2026-03-11T14:43:09.000Z" }),
178
+ id: zod_openapi_1.z.cuid2(),
179
+ userId: zod_openapi_1.z.cuid2(),
180
+ parentId: zod_openapi_1.z.cuid2().nullable(),
181
+ parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
182
+ creatorUsername: zod_openapi_1.z.string().nullable(),
183
+ creatorFullName: zod_openapi_1.z.string().nullable(),
184
+ creatorImageUrl: zod_openapi_1.z.string().nullable(),
185
+ tagIds: zod_openapi_1.z.array(zod_openapi_1.z.number()),
186
+ tagNames: zod_openapi_1.z.array(zod_openapi_1.z.string()),
187
+ badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).nullable(),
188
+ postType: zod_openapi_1.z.enum(constants_1.POST_TYPES),
189
+ content: zod_openapi_1.z.string().nullable(),
190
+ linkTitle: zod_openapi_1.z.string().nullable(),
191
+ linkDescription: zod_openapi_1.z.string().nullable(),
192
+ linkUrl: zod_openapi_1.z.url().nullable(),
193
+ linkImage: zod_openapi_1.z.url().nullable(),
194
+ files: zod_openapi_1.z.array(file_1.FileEntitySchema).nullable(),
195
+ mentions: zod_openapi_1.z.array(zod_openapi_1.z.cuid2()).max(15).optional(),
196
+ createdAt: zod_openapi_1.z.iso.datetime().nullable(),
318
197
  })
319
- .openapi({
320
- title: "Post Search Document",
321
- description: "Flattened schema used for indexing posts in search engines.",
322
- });
198
+ .openapi("PostSearchDocument");