@zyacreatives/shared 2.5.50 → 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.
- package/dist/schemas/brand.d.ts +134 -109
- package/dist/schemas/brand.js +49 -112
- package/dist/schemas/common.d.ts +25 -0
- package/dist/schemas/common.js +30 -1
- package/dist/schemas/creative.d.ts +224 -150
- package/dist/schemas/creative.js +91 -170
- package/dist/schemas/investor.d.ts +362 -261
- package/dist/schemas/investor.js +111 -211
- package/dist/schemas/job-application.d.ts +6 -6
- package/dist/schemas/notification.d.ts +12 -12
- package/dist/schemas/project.d.ts +20 -20
- package/dist/schemas/user.d.ts +265 -1161
- package/dist/schemas/user.js +141 -252
- package/package.json +1 -1
- package/src/schemas/brand.ts +73 -129
- package/src/schemas/common.ts +32 -0
- package/src/schemas/creative.ts +118 -187
- package/src/schemas/investor.ts +154 -278
- package/src/schemas/user.ts +186 -438
package/dist/schemas/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserSearchDocumentSchema = exports.
|
|
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()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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("
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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()
|
|
64
|
-
followingCount: zod_openapi_1.z.int()
|
|
65
|
-
followingIds: zod_openapi_1.z
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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 =
|
|
89
|
-
|
|
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 =
|
|
105
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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 =
|
|
139
|
-
.
|
|
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
|
-
|
|
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
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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("")
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
.
|
|
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
|
});
|