@zyacreatives/shared 2.5.49 → 2.5.51

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,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UserSearchDocumentSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.GetAuthenticatedUserProfileOutputSchema = exports.GetAuthenticatedUserOutputSchema = exports.GetUserFollowersOutputSchema = exports.GetUserFollowingOutputSchema = exports.GetUserFollowersInputSchema = exports.GetUserFollowingInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.GetUserWithPostBookmarksOutputSchema = exports.GetUserWithProductsOutputSchema = exports.GetUserWithProjectBookmarksOutputSchema = exports.GetUserWithPostBookmarksInputSchema = exports.GetUserWithProjectBookmarksInputSchema = exports.UserWithProductsEntitySchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithJobBookmarksOutputSchema = exports.UserWithJobBookmarksInputSchema = exports.UserWithJobBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserAuthStatusEntitySchema = exports.UserWithPostsEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserStatsEntitySchema = exports.UserProfileEntitySchema = exports.MinimalUserSchema = exports.UserEntitySchema = void 0;
3
+ exports.UserSearchDocumentSchema = exports.GetUserActivityOutputSchema = exports.GetUserActivityInputSchema = exports.SearchUsersOutputSchema = exports.SearchUsersInputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithPostBookmarksEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithJobBookmarksEntitySchema = exports.UserWithPostLikesEntitySchema = exports.UserWithProjectLikesEntitySchema = exports.UserWithProductsEntitySchema = exports.UserWithPostsEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserStatsEntitySchema = exports.UserProfileEntitySchema = exports.MinimalUserSchema = exports.UserEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const project_1 = require("./project");
@@ -12,36 +12,41 @@ const investor_1 = require("./investor");
12
12
  const post_1 = require("./post");
13
13
  const job_1 = require("./job");
14
14
  const product_1 = require("./product");
15
+ /**
16
+ * --------------------------------
17
+ * SHAPE
18
+ * --------------------------------
19
+ */
20
+ const UserShape = zod_openapi_1.z.object({
21
+ email: zod_openapi_1.z.email(),
22
+ emailVerified: zod_openapi_1.z.boolean(),
23
+ name: zod_openapi_1.z.string().default(""),
24
+ image: zod_openapi_1.z.string().default(""),
25
+ username: zod_openapi_1.z.string().default(""),
26
+ displayUsername: zod_openapi_1.z.string().default(""),
27
+ role: zod_openapi_1.z.enum(Object.values(constants_1.ROLES)),
28
+ status: zod_openapi_1.z.enum(Object.values(constants_1.USER_STATUSES)),
29
+ onboardingPage: zod_openapi_1.z.enum(Object.values(constants_1.ONBOARDING_PAGES)),
30
+ });
31
+ /**
32
+ * --------------------------------
33
+ * BASE ENTITY
34
+ * --------------------------------
35
+ */
15
36
  exports.UserEntitySchema = zod_openapi_1.z
16
37
  .object({
17
- id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
18
- email: zod_openapi_1.z.email().openapi({ example: "user@example.com" }),
19
- emailVerified: zod_openapi_1.z.boolean().openapi({ example: true }),
20
- name: zod_openapi_1.z.string().optional().openapi({ example: "John Doe" }),
21
- image: zod_openapi_1.z
22
- .string()
23
- .optional()
24
- .openapi({ example: "https://example.com/avatar.png" }),
25
- username: zod_openapi_1.z.string().optional().openapi({ example: "johndoe" }),
26
- displayUsername: zod_openapi_1.z.string().optional().openapi({ example: "@johndoe" }),
27
- role: zod_openapi_1.z.enum(Object.values(constants_1.ROLES)).openapi({
28
- example: "CREATIVE",
29
- }),
30
- status: zod_openapi_1.z
31
- .enum(Object.values(constants_1.USER_STATUSES))
32
- .openapi({
33
- example: "ACTIVE",
34
- }),
35
- onboardingPage: zod_openapi_1.z
36
- .enum(Object.values(constants_1.ONBOARDING_PAGES))
37
- .openapi({
38
- example: "DONE",
39
- }),
40
- createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2026-03-11T09:00:00.000Z" }),
41
- version: zod_openapi_1.z.int().openapi({ example: 1 }),
42
- updatedAt: zod_openapi_1.z.coerce.date().openapi({ example: "2026-03-11T09:00:00.000Z" }),
38
+ id: zod_openapi_1.z.cuid2(),
39
+ ...UserShape.shape,
40
+ createdAt: zod_openapi_1.z.iso.datetime(),
41
+ updatedAt: zod_openapi_1.z.iso.datetime(),
42
+ version: zod_openapi_1.z.int(),
43
43
  })
44
- .openapi("BaseUserEntity");
44
+ .openapi("User");
45
+ /**
46
+ * --------------------------------
47
+ * DERIVED ENTITIES
48
+ * --------------------------------
49
+ */
45
50
  exports.MinimalUserSchema = exports.UserEntitySchema.pick({
46
51
  id: true,
47
52
  name: true,
@@ -51,44 +56,33 @@ exports.MinimalUserSchema = exports.UserEntitySchema.pick({
51
56
  role: true,
52
57
  }).openapi("MinimalUser");
53
58
  exports.UserProfileEntitySchema = exports.UserEntitySchema.extend({
54
- profileType: zod_openapi_1.z
55
- .enum(["creative", "brand", "investor"])
56
- .optional()
57
- .openapi({ example: "creative" }),
58
- brand: brand_1.BrandEntitySchema,
59
- creative: creative_1.CreativeEntitySchema,
60
- investor: investor_1.InvestorEntitySchema,
61
- }).openapi("UserProfileEntity");
59
+ profileType: zod_openapi_1.z.enum(["creative", "brand", "investor"]).optional(),
60
+ brand: brand_1.BrandEntitySchema.optional(),
61
+ creative: creative_1.CreativeEntitySchema.optional(),
62
+ investor: investor_1.InvestorEntitySchema.optional(),
63
+ }).openapi("UserProfile");
62
64
  exports.UserStatsEntitySchema = zod_openapi_1.z.object({
63
- followerCount: zod_openapi_1.z.int().openapi({ example: 1540 }),
64
- followingCount: zod_openapi_1.z.int().openapi({ example: 234 }),
65
- followingIds: zod_openapi_1.z
66
- .array(zod_openapi_1.z.cuid2())
67
- .openapi({ example: ["cksd0v6q0000s9a5y8z7p3x9", "clm1a2b3c0000abc"] }),
68
- });
69
- exports.UserWithProjectsEntitySchema = zod_openapi_1.z
70
- .object({
71
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
72
- projects: zod_openapi_1.z
73
- .array(project_1.ProjectEntitySchema.omit({ overview: true }))
74
- .openapi({ example: [] }),
75
- })
76
- .openapi("UserWithProjectsEntity");
77
- exports.UserWithPostsEntitySchema = zod_openapi_1.z
78
- .object({
79
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
80
- posts: zod_openapi_1.z.array(post_1.PostWithFilesEntitySchema).openapi({ example: [] }),
81
- })
82
- .openapi("UserWithPostsEntity");
83
- exports.UserAuthStatusEntitySchema = zod_openapi_1.z.object({
84
- exists: zod_openapi_1.z.boolean(),
85
- isOAuthOnly: zod_openapi_1.z.boolean(),
86
- providers: zod_openapi_1.z.array(zod_openapi_1.z.string()),
65
+ followerCount: zod_openapi_1.z.int(),
66
+ followingCount: zod_openapi_1.z.int(),
67
+ followingIds: zod_openapi_1.z.array(zod_openapi_1.z.cuid2()),
68
+ });
69
+ /**
70
+ * --------------------------------
71
+ * COMPOSED ENTITIES
72
+ * --------------------------------
73
+ */
74
+ const UserWithId = zod_openapi_1.z.object({ userId: zod_openapi_1.z.cuid2() });
75
+ exports.UserWithProjectsEntitySchema = UserWithId.extend({
76
+ projects: zod_openapi_1.z.array(project_1.ProjectEntitySchema.omit({ overview: true })),
77
+ });
78
+ exports.UserWithPostsEntitySchema = UserWithId.extend({
79
+ posts: zod_openapi_1.z.array(post_1.PostWithFilesEntitySchema),
80
+ });
81
+ exports.UserWithProductsEntitySchema = UserWithId.extend({
82
+ products: zod_openapi_1.z.array(product_1.ProductEntitySchema),
87
83
  });
88
- exports.UserWithProjectLikesEntitySchema = zod_openapi_1.z.object({
89
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
90
- projectLikes: zod_openapi_1.z
91
- .array(like_1.LikeEntitySchema.extend({
84
+ exports.UserWithProjectLikesEntitySchema = UserWithId.extend({
85
+ projectLikes: zod_openapi_1.z.array(like_1.LikeEntitySchema.extend({
92
86
  project: project_1.ProjectEntitySchema.pick({
93
87
  id: true,
94
88
  title: true,
@@ -98,13 +92,10 @@ exports.UserWithProjectLikesEntitySchema = zod_openapi_1.z.object({
98
92
  endDate: true,
99
93
  imagePlaceholderUrl: true,
100
94
  }),
101
- }))
102
- .openapi({ example: [] }),
95
+ })),
103
96
  });
104
- exports.UserWithPostLikesEntitySchema = zod_openapi_1.z.object({
105
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
106
- postLikes: zod_openapi_1.z
107
- .array(like_1.LikeEntitySchema.extend({
97
+ exports.UserWithPostLikesEntitySchema = UserWithId.extend({
98
+ postLikes: zod_openapi_1.z.array(like_1.LikeEntitySchema.extend({
108
99
  post: post_1.PostEntitySchema.pick({
109
100
  id: true,
110
101
  parentId: true,
@@ -114,210 +105,108 @@ exports.UserWithPostLikesEntitySchema = zod_openapi_1.z.object({
114
105
  createdAt: true,
115
106
  updatedAt: true,
116
107
  }),
117
- }))
118
- .openapi({ example: [] }),
108
+ })),
119
109
  });
120
- exports.UserWithJobBookmarksEntitySchema = zod_openapi_1.z.object({
121
- userId: zod_openapi_1.z.cuid2().openapi({ example: "afoaifaofi" }),
122
- jobBookmarks: zod_openapi_1.z
123
- .array(bookmark_1.BookmarkEntitySchema.extend({
110
+ /**
111
+ * --------------------------------
112
+ * BOOKMARKS
113
+ * --------------------------------
114
+ */
115
+ exports.UserWithJobBookmarksEntitySchema = UserWithId.extend({
116
+ jobBookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
124
117
  job: job_1.JobSearchDocumentSchema.extend({
125
118
  isBookmarked: zod_openapi_1.z.boolean().default(true),
126
119
  }),
127
- }))
128
- .optional(),
129
- });
130
- exports.UserWithJobBookmarksInputSchema = zod_openapi_1.z.object({
131
- cursor: zod_openapi_1.z.string().optional().nullable(),
132
- limit: zod_openapi_1.z.int().positive().optional().nullable(),
133
- });
134
- exports.UserWithJobBookmarksOutputSchema = zod_openapi_1.z.object({
135
- bookmarks: exports.UserWithJobBookmarksEntitySchema,
136
- nextCursor: zod_openapi_1.z.string().nullable(),
120
+ })),
137
121
  });
138
- exports.UserWithProjectBookmarksEntitySchema = zod_openapi_1.z
139
- .object({
140
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
141
- projectBookmarks: zod_openapi_1.z
142
- .array(bookmark_1.BookmarkEntitySchema.extend({
122
+ exports.UserWithProjectBookmarksEntitySchema = UserWithId.extend({
123
+ projectBookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
143
124
  project: project_1.ProjectSearchDocumentSchema,
144
- }))
145
- .openapi({ example: [] }),
146
- })
147
- .openapi("UserWithProjectBookmarksEntity");
148
- exports.UserWithPostBookmarksEntitySchema = zod_openapi_1.z.object({
149
- userId: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
125
+ })),
126
+ });
127
+ exports.UserWithPostBookmarksEntitySchema = UserWithId.extend({
150
128
  postBookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
151
129
  post: post_1.PostWithFilesEntitySchema,
152
130
  })),
153
131
  });
154
- exports.UserWithProductsEntitySchema = zod_openapi_1.z.object({
155
- userId: zod_openapi_1.z.cuid2(),
156
- products: zod_openapi_1.z.array(product_1.ProductEntitySchema),
157
- });
158
- exports.GetUserWithProjectBookmarksInputSchema = exports.UserWithJobBookmarksInputSchema;
159
- exports.GetUserWithPostBookmarksInputSchema = exports.UserWithJobBookmarksInputSchema;
160
- exports.GetUserWithProjectBookmarksOutputSchema = zod_openapi_1.z.object({
161
- bookmarks: exports.UserWithProjectBookmarksEntitySchema,
162
- nextCursor: zod_openapi_1.z.string().nullable(),
163
- });
164
- exports.GetUserWithProductsOutputSchema = zod_openapi_1.z.object({
165
- products: exports.UserWithProductsEntitySchema,
166
- noOfProducts: zod_openapi_1.z.int().nullable(),
167
- nextCursor: zod_openapi_1.z.string().nullable(),
168
- });
169
- exports.GetUserWithPostBookmarksOutputSchema = zod_openapi_1.z.object({
170
- bookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema.extend({
171
- post: post_1.FeedPostEntitySchema,
172
- })),
173
- nextCursor: zod_openapi_1.z.string().nullable(),
132
+ /**
133
+ * --------------------------------
134
+ * FOLLOW SYSTEM
135
+ * --------------------------------
136
+ */
137
+ const FollowMeta = zod_openapi_1.z.object({
138
+ isFollowing: zod_openapi_1.z.boolean(),
139
+ followsYou: zod_openapi_1.z.boolean(),
174
140
  });
175
141
  exports.UserWithFollowingEntitySchema = exports.MinimalUserSchema.extend({
176
- following: zod_openapi_1.z
177
- .array(exports.MinimalUserSchema.extend({
178
- isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
179
- followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
180
- }))
181
- .openapi({
182
- description: "List of users this user is following.",
183
- example: [],
184
- }),
185
- }).openapi("UserWithFollowingEntity");
186
- exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
187
- followers: zod_openapi_1.z
188
- .array(exports.MinimalUserSchema.extend({
189
- isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
190
- followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
191
- }))
192
- .openapi({
193
- description: "List of users who follow this user.",
194
- example: [],
195
- }),
196
- }).openapi("UserWithFollowersEntity");
197
- exports.GetUserFollowingInputSchema = zod_openapi_1.z.object({
198
- searchQuery: zod_openapi_1.z.string().optional().openapi({ example: "design systems" }),
199
- offset: zod_openapi_1.z.number().int().nonnegative().optional().openapi({ example: 20 }),
200
- });
201
- exports.GetUserFollowersInputSchema = zod_openapi_1.z.object({
202
- searchQuery: zod_openapi_1.z.string().optional().openapi({ example: "design systems" }),
203
- offset: zod_openapi_1.z.number().int().nonnegative().optional().openapi({ example: 20 }),
204
- });
205
- exports.GetUserFollowingOutputSchema = zod_openapi_1.z.object({
206
- nextCursor: zod_openapi_1.z.string().openapi({ example: "cksd0v6q0000nxtcur" }),
207
- following: zod_openapi_1.z
208
- .array(exports.MinimalUserSchema.extend({
209
- isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
210
- followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
211
- }))
212
- .openapi({ example: [] }),
213
- });
214
- exports.GetUserFollowersOutputSchema = zod_openapi_1.z.object({
215
- nextCursor: zod_openapi_1.z.string().openapi({ example: "cksd0v6q0000nxtcur" }),
216
- followers: zod_openapi_1.z
217
- .array(exports.MinimalUserSchema.extend({
218
- isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
219
- followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
220
- }))
221
- .openapi({ example: [] }),
142
+ following: zod_openapi_1.z.array(exports.MinimalUserSchema.extend(FollowMeta.shape)),
222
143
  });
223
- exports.GetAuthenticatedUserOutputSchema = exports.UserEntitySchema;
224
- exports.GetAuthenticatedUserProfileOutputSchema = exports.UserProfileEntitySchema;
225
- exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.UserWithProjectsEntitySchema;
226
- exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.UserWithProjectBookmarksEntitySchema;
227
- exports.GetAuthenticatedUserWithProjectLikesOutputSchema = exports.UserWithProjectLikesEntitySchema;
228
- exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.UserWithFollowingEntitySchema;
229
- exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.UserWithFollowersEntitySchema;
230
- exports.GetUserActivityInputSchema = zod_openapi_1.z.object({
231
- activityType: zod_openapi_1.z
232
- .enum(Object.values(constants_1.ACTIVITY_TYPES))
233
- .openapi({ example: "LIKE" }),
234
- });
235
- exports.GetUserActivityOutputSchema = zod_openapi_1.z
236
- .array(zod_openapi_1.z.object({
237
- parentId: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000prt" }),
238
- parentType: zod_openapi_1.z
239
- .enum(Object.values(constants_1.ACTIVITY_PARENT_TYPES))
240
- .openapi({ example: "POST" }),
241
- }))
242
- .openapi({ example: [] });
144
+ exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
145
+ followers: zod_openapi_1.z.array(exports.MinimalUserSchema.extend(FollowMeta.shape)),
146
+ });
147
+ /**
148
+ * --------------------------------
149
+ * PAGINATION INPUT (REUSED)
150
+ * --------------------------------
151
+ */
152
+ const CursorPaginationInput = zod_openapi_1.z.object({
153
+ cursor: zod_openapi_1.z.string().optional(),
154
+ limit: zod_openapi_1.z.coerce.number().int().min(1).max(100).default(20),
155
+ });
156
+ /**
157
+ * --------------------------------
158
+ * SEARCH USERS
159
+ * --------------------------------
160
+ */
243
161
  const coerceArray = (val) => {
244
162
  if (typeof val === "string")
245
163
  return val === "" ? [] : val.split(",");
246
164
  return val;
247
165
  };
248
166
  exports.SearchUsersInputSchema = zod_openapi_1.z.object({
249
- query: zod_openapi_1.z.string().default("").openapi({
250
- example: "john",
251
- description: "Search by name, email, username, or discipline",
252
- }),
167
+ query: zod_openapi_1.z.string().default(""),
253
168
  roles: zod_openapi_1.z
254
169
  .preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.enum(Object.values(constants_1.ROLES))))
255
- .optional()
256
- .openapi({ example: ["CREATIVE", "BRAND"] }),
257
- disciplines: zod_openapi_1.z
258
- .preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.string()))
259
- .optional()
260
- .openapi({ example: ["Design Systems", "Web Development"] }),
261
- locations: zod_openapi_1.z
262
- .preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.string()))
263
- .optional()
264
- .openapi({ example: ["Lagos, Nigeria", "London, UK"] }),
265
- limit: zod_openapi_1.z.coerce.number().min(1).max(100).default(20).openapi({ example: 20 }),
266
- cursor: zod_openapi_1.z.string().nullable().optional().openapi({
267
- example: "cksd0v6q0000cursor",
268
- description: "The offset/cursor for pagination",
269
- }),
170
+ .optional(),
171
+ disciplines: zod_openapi_1.z.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.string())).optional(),
172
+ locations: zod_openapi_1.z.preprocess(coerceArray, zod_openapi_1.z.array(zod_openapi_1.z.string())).optional(),
173
+ ...CursorPaginationInput.shape,
270
174
  });
271
175
  exports.SearchUsersOutputSchema = zod_openapi_1.z.object({
272
- users: zod_openapi_1.z
273
- .array(exports.MinimalUserSchema.extend({
274
- isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
275
- followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
276
- noOfFollowers: zod_openapi_1.z
277
- .number()
278
- .int()
279
- .nonnegative()
280
- .optional()
281
- .openapi({ example: 1200 }),
282
- disciplines: zod_openapi_1.z
283
- .array(zod_openapi_1.z.string())
284
- .optional()
285
- .openapi({ example: ["UI/UX", "Frontend"] }),
286
- }))
287
- .openapi({ example: [] }),
288
- nextCursor: zod_openapi_1.z.string().optional().openapi({
289
- example: "abc123nxt",
290
- description: "The next cursor for pagination",
291
- }),
176
+ users: zod_openapi_1.z.array(exports.MinimalUserSchema.extend({
177
+ isFollowing: zod_openapi_1.z.boolean(),
178
+ followsYou: zod_openapi_1.z.boolean(),
179
+ noOfFollowers: zod_openapi_1.z.number().int(),
180
+ disciplines: zod_openapi_1.z.array(zod_openapi_1.z.string()),
181
+ })),
182
+ nextCursor: zod_openapi_1.z.string().optional(),
292
183
  });
293
- exports.UserSearchDocumentSchema = zod_openapi_1.z
294
- .object({
295
- id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
296
- email: zod_openapi_1.z.email().openapi({ example: "user@example.com" }),
297
- username: zod_openapi_1.z.string().nullable().openapi({ example: "johndoe" }),
298
- name: zod_openapi_1.z.string().nullable().openapi({ example: "John Doe" }),
299
- image: zod_openapi_1.z
300
- .string()
301
- .nullable()
302
- .openapi({ example: "https://example.com/avatar.png" }),
303
- role: zod_openapi_1.z
304
- .enum(Object.values(constants_1.ROLES))
305
- .openapi({ example: "CREATIVE" }),
306
- location: zod_openapi_1.z.string().nullable().openapi({ example: "Lagos, Nigeria" }),
307
- disciplines: zod_openapi_1.z
308
- .array(zod_openapi_1.z.string())
309
- .nullable()
310
- .openapi({ example: ["Design Systems", "Web Development"] }),
311
- updatedAt: zod_openapi_1.z
312
- .string()
313
- .nullable()
314
- .openapi({ example: "2026-03-11T09:00:00.000Z" }),
315
- createdAt: zod_openapi_1.z
316
- .string()
317
- .nullable()
318
- .openapi({ example: "2026-03-11T09:00:00.000Z" }),
319
- })
320
- .openapi({
321
- title: "User Search Document",
322
- description: "Flattened schema used for indexing users in search engines.",
184
+ /**
185
+ * --------------------------------
186
+ * ACTIVITY
187
+ * --------------------------------
188
+ */
189
+ exports.GetUserActivityInputSchema = zod_openapi_1.z.object({
190
+ activityType: zod_openapi_1.z.enum(Object.values(constants_1.ACTIVITY_TYPES)),
191
+ });
192
+ exports.GetUserActivityOutputSchema = zod_openapi_1.z.array(zod_openapi_1.z.object({
193
+ parentId: zod_openapi_1.z.cuid2(),
194
+ parentType: zod_openapi_1.z.enum(Object.values(constants_1.ACTIVITY_PARENT_TYPES)),
195
+ }));
196
+ /**
197
+ * --------------------------------
198
+ * SEARCH DOCUMENT (ALLOWED NULLS)
199
+ * --------------------------------
200
+ */
201
+ exports.UserSearchDocumentSchema = zod_openapi_1.z.object({
202
+ id: zod_openapi_1.z.cuid2(),
203
+ email: zod_openapi_1.z.email(),
204
+ username: zod_openapi_1.z.string().nullable(),
205
+ name: zod_openapi_1.z.string().nullable(),
206
+ image: zod_openapi_1.z.string().nullable(),
207
+ role: zod_openapi_1.z.enum(Object.values(constants_1.ROLES)),
208
+ location: zod_openapi_1.z.string().nullable(),
209
+ disciplines: zod_openapi_1.z.array(zod_openapi_1.z.string()).nullable(),
210
+ updatedAt: zod_openapi_1.z.iso.datetime().nullable(),
211
+ createdAt: zod_openapi_1.z.iso.datetime().nullable(),
323
212
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.5.49",
3
+ "version": "2.5.51",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",