@zyacreatives/shared 1.3.8 → 1.4.0
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/project.d.ts +337 -39
- package/dist/schemas/project.js +321 -115
- package/dist/schemas/user.d.ts +193 -0
- package/dist/schemas/user.js +7 -1
- package/dist/types/project.d.ts +35 -91
- package/package.json +1 -1
- package/src/schemas/project.ts +351 -123
- package/src/schemas/user.ts +16 -0
- package/src/types/project.ts +88 -106
package/dist/schemas/project.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = exports.ProjectSocialGraphEntitySchema = exports.ProjectFileEntitySchema = exports.
|
|
3
|
+
exports.ProjectWithProjectBookmarksEntitySchema = exports.ProjectWithProjectLikesEntitySchema = exports.ProjectWithProjectCommentsEntitySchema = exports.ProjectWithProjectViewsEntitySchema = exports.ListProjectsInputSchema = exports.MinimalProjectSchema = exports.ViewProjectInputSchema = exports.UnlikeProjectParamsSchema = exports.LikeProjectParamsSchema = exports.BookmarkProjectOutputSchema = exports.BookmarkProjectParamsSchema = exports.GetProjectOutputSchema = exports.GetProjectParamsSchema = exports.DeleteProjectOutputSchema = exports.DeleteProjectCommentOutputSchema = exports.DeleteProjectCommentParamsSchema = exports.DeleteProjectInputSchema = exports.CommentOnProjectOutputSchema = exports.CommentOnProjectInputSchema = exports.CommentOnProjectParamsSchema = exports.ProjectIdSchema = exports.UpdateProjectOutputSchema = exports.UpdateProjectInputSchema = exports.CreateProjectOutputSchema = exports.CreateProjectInputSchema = exports.ProjectUpdateOutputEntitySchema = exports.ProjectBookmarkEntitySchema = exports.ProjectCommentEntitySchema = exports.ProjectLikeEntitySchema = exports.ProjectViewEntitySchema = exports.ProjectWithFilesEntitySchema = 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");
|
|
@@ -92,114 +92,6 @@ exports.ProjectEntitySchema = zod_openapi_1.z
|
|
|
92
92
|
title: "Project DB Entity",
|
|
93
93
|
description: "Schema representing a project stored in the database.",
|
|
94
94
|
});
|
|
95
|
-
exports.CreateProjectSchema = zod_openapi_1.z
|
|
96
|
-
.object({
|
|
97
|
-
userId: zod_openapi_1.z.string().openapi({
|
|
98
|
-
description: "CUID2 of the user creating the project.",
|
|
99
|
-
example: "ckl1y9xyz0000qv7a0h1efgh4",
|
|
100
|
-
}),
|
|
101
|
-
title: zod_openapi_1.z.string().min(1).max(100).openapi({
|
|
102
|
-
description: "Title of the project, 1–100 characters.",
|
|
103
|
-
example: "E-commerce Mobile App",
|
|
104
|
-
}),
|
|
105
|
-
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE).openapi({
|
|
106
|
-
description: "Type of creator who made this project.",
|
|
107
|
-
example: "CREATIVE",
|
|
108
|
-
}),
|
|
109
|
-
imagePlaceholderUrl: zod_openapi_1.z.url().openapi({
|
|
110
|
-
description: "URL for the placeholder image of the project.",
|
|
111
|
-
example: "https://img.com",
|
|
112
|
-
}),
|
|
113
|
-
id: zod_openapi_1.z.string().optional().openapi({
|
|
114
|
-
description: "CUID2 of the project.",
|
|
115
|
-
example: "ckl1y9xyz0000qv7a0h1efgh4",
|
|
116
|
-
}),
|
|
117
|
-
description: zod_openapi_1.z.string().optional().openapi({
|
|
118
|
-
description: "Detailed description of the project, max 1000 characters.",
|
|
119
|
-
example: "A modern e-commerce mobile application built with React Native.",
|
|
120
|
-
}),
|
|
121
|
-
overview: zod_openapi_1.z.string().optional().openapi({
|
|
122
|
-
description: "Brief overview of the project.",
|
|
123
|
-
example: "A comprehensive e-commerce solution for mobile devices.",
|
|
124
|
-
}),
|
|
125
|
-
url: zod_openapi_1.z.string().optional().openapi({
|
|
126
|
-
description: "URL to the project or live demo.",
|
|
127
|
-
example: "https://example.com/project",
|
|
128
|
-
}),
|
|
129
|
-
clientId: zod_openapi_1.z.string().optional().openapi({
|
|
130
|
-
description: "CUID2 of the client if this is a client project.",
|
|
131
|
-
example: "ckl1y9xyz0000qv7a0h1efgh4",
|
|
132
|
-
}),
|
|
133
|
-
clientType: zod_openapi_1.z
|
|
134
|
-
.enum(constants_1.CLIENT_TYPES)
|
|
135
|
-
.optional()
|
|
136
|
-
.default(constants_1.CLIENT_TYPES.NONE)
|
|
137
|
-
.openapi({
|
|
138
|
-
description: "Type of client for this project.",
|
|
139
|
-
example: "BRAND",
|
|
140
|
-
}),
|
|
141
|
-
clientName: zod_openapi_1.z.string().optional().openapi({
|
|
142
|
-
description: "Name of the client.",
|
|
143
|
-
example: "Acme Corp",
|
|
144
|
-
}),
|
|
145
|
-
tags: zod_openapi_1.z
|
|
146
|
-
.array(zod_openapi_1.z.string())
|
|
147
|
-
.optional()
|
|
148
|
-
.openapi({
|
|
149
|
-
description: "Array of tags associated with the project.",
|
|
150
|
-
example: ["react-native", "e-commerce", "mobile"],
|
|
151
|
-
}),
|
|
152
|
-
searchVector: zod_openapi_1.z.string().optional().openapi({
|
|
153
|
-
description: "Search vector for full-text search indexing.",
|
|
154
|
-
example: "ecommerce mobile app react native",
|
|
155
|
-
}),
|
|
156
|
-
isFeatured: zod_openapi_1.z.boolean().optional().openapi({
|
|
157
|
-
description: "Whether the project is featured.",
|
|
158
|
-
example: true,
|
|
159
|
-
}),
|
|
160
|
-
startDate: zod_openapi_1.z.coerce
|
|
161
|
-
.date()
|
|
162
|
-
.optional()
|
|
163
|
-
.openapi({
|
|
164
|
-
description: "Start date of the project.",
|
|
165
|
-
example: new Date("2024-01-01"),
|
|
166
|
-
}),
|
|
167
|
-
endDate: zod_openapi_1.z.coerce
|
|
168
|
-
.date()
|
|
169
|
-
.optional()
|
|
170
|
-
.openapi({
|
|
171
|
-
description: "End date of the project.",
|
|
172
|
-
example: new Date("2024-06-30"),
|
|
173
|
-
}),
|
|
174
|
-
createdAt: zod_openapi_1.z.coerce
|
|
175
|
-
.date()
|
|
176
|
-
.optional()
|
|
177
|
-
.openapi({
|
|
178
|
-
description: "Timestamp when the project was created.",
|
|
179
|
-
example: new Date("2024-01-01T00:00:00.000Z"),
|
|
180
|
-
}),
|
|
181
|
-
updatedAt: zod_openapi_1.z.coerce
|
|
182
|
-
.date()
|
|
183
|
-
.optional()
|
|
184
|
-
.openapi({
|
|
185
|
-
description: "Timestamp when the project was last updated.",
|
|
186
|
-
example: new Date("2024-06-30T00:00:00.000Z"),
|
|
187
|
-
}),
|
|
188
|
-
files: zod_openapi_1.z
|
|
189
|
-
.array(file_1.CreateFileInputSchema.extend({
|
|
190
|
-
isPlaceholder: zod_openapi_1.z.boolean().default(false),
|
|
191
|
-
order: zod_openapi_1.z.number().int().default(1),
|
|
192
|
-
}))
|
|
193
|
-
.optional()
|
|
194
|
-
.openapi({
|
|
195
|
-
description: "Array of files/images for the project.",
|
|
196
|
-
example: [],
|
|
197
|
-
}),
|
|
198
|
-
})
|
|
199
|
-
.openapi({
|
|
200
|
-
title: "Create Project",
|
|
201
|
-
description: "Schema for creating a new project.",
|
|
202
|
-
});
|
|
203
95
|
exports.ProjectFileEntitySchema = zod_openapi_1.z
|
|
204
96
|
.object({
|
|
205
97
|
isPlaceholder: zod_openapi_1.z.boolean().openapi({
|
|
@@ -235,14 +127,16 @@ exports.ProjectSocialGraphEntitySchema = zod_openapi_1.z
|
|
|
235
127
|
noOfViews: zod_openapi_1.z.number().int().optional().openapi({ example: 1200 }),
|
|
236
128
|
})
|
|
237
129
|
.openapi("ProjectSocialGraphEntity");
|
|
238
|
-
exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend(
|
|
239
|
-
.extend({
|
|
130
|
+
exports.ProjectWithFilesEntitySchema = exports.ProjectEntitySchema.extend({
|
|
240
131
|
projectFiles: zod_openapi_1.z
|
|
241
|
-
.array(exports.ProjectFileEntitySchema
|
|
132
|
+
.array(exports.ProjectFileEntitySchema.extend({
|
|
133
|
+
file: file_1.FileEntitySchema,
|
|
134
|
+
}))
|
|
242
135
|
.optional()
|
|
243
|
-
.openapi({ description: "Files associated with the project" }),
|
|
244
|
-
})
|
|
245
|
-
|
|
136
|
+
.openapi({ description: "Files associated with the project." }),
|
|
137
|
+
}).openapi({
|
|
138
|
+
title: "ProjectWithFilesEntity",
|
|
139
|
+
});
|
|
246
140
|
exports.ProjectViewEntitySchema = zod_openapi_1.z
|
|
247
141
|
.object({
|
|
248
142
|
id: zod_openapi_1.z.cuid2().openapi({ example: "view_cksd0v6q0000s9a5y8z7p3x9" }),
|
|
@@ -302,3 +196,315 @@ exports.ProjectUpdateOutputEntitySchema = zod_openapi_1.z
|
|
|
302
196
|
id: zod_openapi_1.z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
|
|
303
197
|
})
|
|
304
198
|
.openapi("ProjectUpdateOutputEntity");
|
|
199
|
+
exports.CreateProjectInputSchema = zod_openapi_1.z
|
|
200
|
+
.object({
|
|
201
|
+
title: zod_openapi_1.z.string().min(1).max(100).openapi({
|
|
202
|
+
description: "Title of the project, 1-100 characters.",
|
|
203
|
+
example: "E-commerce Mobile App",
|
|
204
|
+
}),
|
|
205
|
+
description: zod_openapi_1.z.string().max(1000).optional().default("").openapi({
|
|
206
|
+
description: "Detailed description of the project, max 1000 characters.",
|
|
207
|
+
example: "A modern e-commerce mobile application built with React Native.",
|
|
208
|
+
}),
|
|
209
|
+
url: zod_openapi_1.z.string().openapi({
|
|
210
|
+
description: "URL to the project or live demo.",
|
|
211
|
+
example: "https://example.com/project",
|
|
212
|
+
}),
|
|
213
|
+
imagePlaceholderUrl: zod_openapi_1.z.url().openapi({ example: "https://img.com" }),
|
|
214
|
+
tags: zod_openapi_1.z
|
|
215
|
+
.array(zod_openapi_1.z.string())
|
|
216
|
+
.default([])
|
|
217
|
+
.openapi({
|
|
218
|
+
description: "Array of tags associated with the project.",
|
|
219
|
+
example: ["react-native", "e-commerce", "mobile"],
|
|
220
|
+
}),
|
|
221
|
+
startDate: zod_openapi_1.z.coerce.date().openapi({
|
|
222
|
+
description: "Start date of the project.",
|
|
223
|
+
example: new Date("2024-01-01"),
|
|
224
|
+
}),
|
|
225
|
+
endDate: zod_openapi_1.z.coerce
|
|
226
|
+
.date()
|
|
227
|
+
.optional()
|
|
228
|
+
.openapi({
|
|
229
|
+
description: "End date of the project.",
|
|
230
|
+
example: new Date("2024-06-30"),
|
|
231
|
+
}),
|
|
232
|
+
overview: zod_openapi_1.z.string().optional().openapi({
|
|
233
|
+
description: "Brief overview of the project.",
|
|
234
|
+
example: "A comprehensive e-commerce solution for mobile devices.",
|
|
235
|
+
}),
|
|
236
|
+
projectCreatorType: zod_openapi_1.z.enum(constants_1.ROLES).default(constants_1.ROLES.CREATIVE).openapi({
|
|
237
|
+
description: "Type of creator who made this project.",
|
|
238
|
+
example: "CREATIVE",
|
|
239
|
+
}),
|
|
240
|
+
clientId: zod_openapi_1.z.string().optional().openapi({
|
|
241
|
+
description: "CUID2 of the client if this is a client project.",
|
|
242
|
+
example: "ckl1y9xyz0000qv7a0h1efgh4",
|
|
243
|
+
}),
|
|
244
|
+
clientType: zod_openapi_1.z.enum(constants_1.CLIENT_TYPES).default(constants_1.CLIENT_TYPES.NONE).openapi({
|
|
245
|
+
description: "Type of client for this project.",
|
|
246
|
+
example: "BRAND",
|
|
247
|
+
}),
|
|
248
|
+
clientName: zod_openapi_1.z.string().optional().default("").openapi({
|
|
249
|
+
description: "Name of the client.",
|
|
250
|
+
example: "Acme Corp",
|
|
251
|
+
}),
|
|
252
|
+
files: zod_openapi_1.z
|
|
253
|
+
.array(file_1.CreateFileInputSchema.extend({
|
|
254
|
+
isPlaceholder: zod_openapi_1.z.boolean().default(false),
|
|
255
|
+
order: zod_openapi_1.z.int().default(1),
|
|
256
|
+
}))
|
|
257
|
+
.openapi({
|
|
258
|
+
description: "Array of files/images for the project.",
|
|
259
|
+
example: [],
|
|
260
|
+
}),
|
|
261
|
+
})
|
|
262
|
+
.openapi({
|
|
263
|
+
title: "Create Project",
|
|
264
|
+
description: "Schema for creating a new project.",
|
|
265
|
+
});
|
|
266
|
+
exports.CreateProjectOutputSchema = exports.ProjectEntitySchema;
|
|
267
|
+
exports.UpdateProjectInputSchema = zod_openapi_1.z
|
|
268
|
+
.object({
|
|
269
|
+
id: zod_openapi_1.z.cuid2().openapi({
|
|
270
|
+
description: "CUID2 identifier of the project to update.",
|
|
271
|
+
example: "ckl1z0abc0000qv7a0h1abcd2",
|
|
272
|
+
}),
|
|
273
|
+
title: zod_openapi_1.z.string().optional().openapi({
|
|
274
|
+
description: "Updated title of the project.",
|
|
275
|
+
example: "Updated E-commerce Mobile App",
|
|
276
|
+
}),
|
|
277
|
+
description: zod_openapi_1.z.string().optional().openapi({
|
|
278
|
+
description: "Updated description of the project.",
|
|
279
|
+
example: "An updated description of the project.",
|
|
280
|
+
}),
|
|
281
|
+
imagePlaceholderUrl: zod_openapi_1.z.url().optional().openapi({
|
|
282
|
+
example: "https://img.com",
|
|
283
|
+
}),
|
|
284
|
+
overview: zod_openapi_1.z.string().optional().openapi({
|
|
285
|
+
description: "Updated overview of the project.",
|
|
286
|
+
example: "Updated project overview.",
|
|
287
|
+
}),
|
|
288
|
+
url: zod_openapi_1.z.url().optional().openapi({
|
|
289
|
+
description: "Updated URL to the project or live demo.",
|
|
290
|
+
example: "https://updated-example.com/project",
|
|
291
|
+
}),
|
|
292
|
+
clientId: zod_openapi_1.z.cuid2().optional().openapi({
|
|
293
|
+
description: "Updated client ID.",
|
|
294
|
+
example: "ckl1y9xyz0000qv7a0h1efgh5",
|
|
295
|
+
}),
|
|
296
|
+
clientType: zod_openapi_1.z.enum(["CREATIVE", "BRAND", "NONE"]).optional().openapi({
|
|
297
|
+
description: "Updated client type.",
|
|
298
|
+
example: "BRAND",
|
|
299
|
+
}),
|
|
300
|
+
clientName: zod_openapi_1.z.string().optional().openapi({
|
|
301
|
+
description: "Updated client name.",
|
|
302
|
+
example: "Updated Acme Corp",
|
|
303
|
+
}),
|
|
304
|
+
projectCreatorType: zod_openapi_1.z
|
|
305
|
+
.enum(["CREATIVE", "BRAND", "INVESTOR", "ADMIN"])
|
|
306
|
+
.optional()
|
|
307
|
+
.openapi({
|
|
308
|
+
description: "Updated project creator type.",
|
|
309
|
+
example: "CREATIVE",
|
|
310
|
+
}),
|
|
311
|
+
tags: zod_openapi_1.z
|
|
312
|
+
.array(zod_openapi_1.z.string())
|
|
313
|
+
.optional()
|
|
314
|
+
.openapi({
|
|
315
|
+
description: "Updated array of tags.",
|
|
316
|
+
example: ["react-native", "e-commerce", "mobile", "updated"],
|
|
317
|
+
}),
|
|
318
|
+
isFeatured: zod_openapi_1.z.boolean().optional().openapi({
|
|
319
|
+
description: "Whether the project should be featured.",
|
|
320
|
+
example: true,
|
|
321
|
+
}),
|
|
322
|
+
startDate: zod_openapi_1.z
|
|
323
|
+
.date()
|
|
324
|
+
.optional()
|
|
325
|
+
.openapi({
|
|
326
|
+
description: "Updated start date of the project.",
|
|
327
|
+
example: new Date("2024-02-01"),
|
|
328
|
+
}),
|
|
329
|
+
endDate: zod_openapi_1.z
|
|
330
|
+
.date()
|
|
331
|
+
.optional()
|
|
332
|
+
.openapi({
|
|
333
|
+
description: "Updated end date of the project.",
|
|
334
|
+
example: new Date("2024-07-30"),
|
|
335
|
+
}),
|
|
336
|
+
createdAt: zod_openapi_1.z
|
|
337
|
+
.date()
|
|
338
|
+
.optional()
|
|
339
|
+
.openapi({
|
|
340
|
+
description: "Creation date (read-only).",
|
|
341
|
+
example: new Date("2024-01-01T12:00:00Z"),
|
|
342
|
+
}),
|
|
343
|
+
updatedAt: zod_openapi_1.z
|
|
344
|
+
.date()
|
|
345
|
+
.optional()
|
|
346
|
+
.openapi({
|
|
347
|
+
description: "Last update date (read-only).",
|
|
348
|
+
example: new Date("2024-06-30T18:00:00Z"),
|
|
349
|
+
}),
|
|
350
|
+
})
|
|
351
|
+
.openapi({
|
|
352
|
+
title: "Update Project",
|
|
353
|
+
description: "Schema for updating an existing project.",
|
|
354
|
+
});
|
|
355
|
+
exports.UpdateProjectOutputSchema = exports.ProjectEntitySchema;
|
|
356
|
+
exports.ProjectIdSchema = zod_openapi_1.z.object({
|
|
357
|
+
projectId: zod_openapi_1.z.cuid2(),
|
|
358
|
+
});
|
|
359
|
+
exports.CommentOnProjectParamsSchema = exports.ProjectIdSchema;
|
|
360
|
+
exports.CommentOnProjectInputSchema = zod_openapi_1.z
|
|
361
|
+
.object({
|
|
362
|
+
content: zod_openapi_1.z.string().openapi({
|
|
363
|
+
description: "Content of the comment.",
|
|
364
|
+
example: "This is a great project!",
|
|
365
|
+
}),
|
|
366
|
+
parentCommentId: zod_openapi_1.z.cuid2().optional().openapi({
|
|
367
|
+
description: "CUID2 of the parent comment if this is a reply.",
|
|
368
|
+
example: "ckl1z0abc0000qv7a0h1abcd4",
|
|
369
|
+
}),
|
|
370
|
+
})
|
|
371
|
+
.openapi({
|
|
372
|
+
title: "Comment on Project",
|
|
373
|
+
description: "Schema for commenting on a project.",
|
|
374
|
+
});
|
|
375
|
+
exports.CommentOnProjectOutputSchema = exports.ProjectCommentEntitySchema;
|
|
376
|
+
exports.DeleteProjectInputSchema = exports.ProjectIdSchema;
|
|
377
|
+
exports.DeleteProjectCommentParamsSchema = zod_openapi_1.z.object({
|
|
378
|
+
commentId: zod_openapi_1.z.cuid2(),
|
|
379
|
+
});
|
|
380
|
+
exports.DeleteProjectCommentOutputSchema = exports.ProjectCommentEntitySchema;
|
|
381
|
+
exports.DeleteProjectOutputSchema = exports.ProjectEntitySchema;
|
|
382
|
+
exports.GetProjectParamsSchema = exports.ProjectIdSchema;
|
|
383
|
+
exports.GetProjectOutputSchema = exports.ProjectWithFilesEntitySchema;
|
|
384
|
+
exports.BookmarkProjectParamsSchema = exports.ProjectIdSchema;
|
|
385
|
+
exports.BookmarkProjectOutputSchema = exports.ProjectBookmarkEntitySchema;
|
|
386
|
+
exports.LikeProjectParamsSchema = exports.ProjectIdSchema;
|
|
387
|
+
exports.UnlikeProjectParamsSchema = exports.ProjectIdSchema;
|
|
388
|
+
exports.ViewProjectInputSchema = zod_openapi_1.z
|
|
389
|
+
.object({
|
|
390
|
+
projectId: zod_openapi_1.z.cuid2().openapi({
|
|
391
|
+
description: "CUID2 identifier of the project being viewed.",
|
|
392
|
+
example: "ckl1z0abc0000qv7a0h1abcd2",
|
|
393
|
+
}),
|
|
394
|
+
id: zod_openapi_1.z.cuid2().optional().openapi({
|
|
395
|
+
description: "CUID2 identifier of the view record (auto-generated).",
|
|
396
|
+
example: "ckl1z0abc0000qv7a0h1abcd5",
|
|
397
|
+
}),
|
|
398
|
+
userId: zod_openapi_1.z.cuid2().optional().openapi({
|
|
399
|
+
description: "CUID2 of the user who viewed the project.",
|
|
400
|
+
example: "ckl1y9xyz0000qv7a0h1efgh3",
|
|
401
|
+
}),
|
|
402
|
+
sessionId: zod_openapi_1.z.string().optional().openapi({
|
|
403
|
+
description: "Session ID for anonymous users.",
|
|
404
|
+
example: "sess_123456789",
|
|
405
|
+
}),
|
|
406
|
+
ipAddress: zod_openapi_1.z.string().optional().openapi({
|
|
407
|
+
description: "IP address of the viewer.",
|
|
408
|
+
example: "192.168.1.1",
|
|
409
|
+
}),
|
|
410
|
+
userAgent: zod_openapi_1.z.string().optional().openapi({
|
|
411
|
+
description: "User agent string of the viewer.",
|
|
412
|
+
example: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
|
|
413
|
+
}),
|
|
414
|
+
viewedAt: zod_openapi_1.z
|
|
415
|
+
.date()
|
|
416
|
+
.optional()
|
|
417
|
+
.openapi({
|
|
418
|
+
description: "Date and time when the project was viewed.",
|
|
419
|
+
example: new Date("2024-01-15T14:30:00Z"),
|
|
420
|
+
}),
|
|
421
|
+
viewDate: zod_openapi_1.z
|
|
422
|
+
.date()
|
|
423
|
+
.optional()
|
|
424
|
+
.openapi({
|
|
425
|
+
description: "Date when the project was viewed.",
|
|
426
|
+
example: new Date("2024-01-15"),
|
|
427
|
+
}),
|
|
428
|
+
})
|
|
429
|
+
.openapi({
|
|
430
|
+
title: "View Project",
|
|
431
|
+
description: "Schema for recording a project view.",
|
|
432
|
+
});
|
|
433
|
+
exports.MinimalProjectSchema = exports.ProjectEntitySchema.pick({
|
|
434
|
+
id: true,
|
|
435
|
+
title: true,
|
|
436
|
+
description: true,
|
|
437
|
+
tags: true,
|
|
438
|
+
startDate: true,
|
|
439
|
+
endDate: true,
|
|
440
|
+
imagePlaceholderUrl: true,
|
|
441
|
+
}).openapi({
|
|
442
|
+
title: "MinimalProject",
|
|
443
|
+
description: "Subset of project fields for lightweight listings.",
|
|
444
|
+
});
|
|
445
|
+
exports.ListProjectsInputSchema = zod_openapi_1.z
|
|
446
|
+
.object({
|
|
447
|
+
query: zod_openapi_1.z.string().optional().openapi({
|
|
448
|
+
description: "Search query for projects.",
|
|
449
|
+
example: "ecommerce app",
|
|
450
|
+
}),
|
|
451
|
+
tags: zod_openapi_1.z
|
|
452
|
+
.array(zod_openapi_1.z.string())
|
|
453
|
+
.optional()
|
|
454
|
+
.openapi({
|
|
455
|
+
description: "Tags to filter projects by.",
|
|
456
|
+
example: ["react", "design"],
|
|
457
|
+
}),
|
|
458
|
+
clientName: zod_openapi_1.z.string().optional().openapi({
|
|
459
|
+
description: "Client name to filter projects by.",
|
|
460
|
+
example: "Acme Corp",
|
|
461
|
+
}),
|
|
462
|
+
userId: zod_openapi_1.z.string().optional().openapi({
|
|
463
|
+
description: "Filter projects by user ID.",
|
|
464
|
+
example: "ckl1y9xyz0000qv7a0h1efgh4",
|
|
465
|
+
}),
|
|
466
|
+
page: zod_openapi_1.z.number().int().optional().default(1).openapi({
|
|
467
|
+
description: "Page number for pagination.",
|
|
468
|
+
example: 1,
|
|
469
|
+
}),
|
|
470
|
+
perPage: zod_openapi_1.z.number().int().optional().default(10).openapi({
|
|
471
|
+
description: "Number of items per page.",
|
|
472
|
+
example: 10,
|
|
473
|
+
}),
|
|
474
|
+
})
|
|
475
|
+
.openapi({
|
|
476
|
+
title: "ListProjectsInput",
|
|
477
|
+
description: "Parameters for listing or searching projects.",
|
|
478
|
+
});
|
|
479
|
+
exports.ProjectWithProjectViewsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
480
|
+
views: zod_openapi_1.z.array(exports.ProjectViewEntitySchema).openapi({
|
|
481
|
+
description: "Array of project view records.",
|
|
482
|
+
}),
|
|
483
|
+
}).openapi({
|
|
484
|
+
title: "ProjectWithProjectViewsEntity",
|
|
485
|
+
description: "Project entity with associated views.",
|
|
486
|
+
});
|
|
487
|
+
exports.ProjectWithProjectCommentsEntitySchema = exports.MinimalProjectSchema.extend({
|
|
488
|
+
comments: zod_openapi_1.z.array(exports.ProjectCommentEntitySchema).openapi({
|
|
489
|
+
description: "Array of comments on the project.",
|
|
490
|
+
}),
|
|
491
|
+
}).openapi({
|
|
492
|
+
title: "ProjectWithProjectCommentsEntity",
|
|
493
|
+
description: "Project entity with associated comments.",
|
|
494
|
+
});
|
|
495
|
+
exports.ProjectWithProjectLikesEntitySchema = exports.MinimalProjectSchema.extend({
|
|
496
|
+
likes: zod_openapi_1.z.array(exports.ProjectLikeEntitySchema).openapi({
|
|
497
|
+
description: "Array of likes on the project.",
|
|
498
|
+
}),
|
|
499
|
+
}).openapi({
|
|
500
|
+
title: "ProjectWithProjectLikesEntity",
|
|
501
|
+
description: "Project entity with associated likes.",
|
|
502
|
+
});
|
|
503
|
+
exports.ProjectWithProjectBookmarksEntitySchema = exports.MinimalProjectSchema.extend({
|
|
504
|
+
bookmarks: zod_openapi_1.z.array(exports.ProjectBookmarkEntitySchema).openapi({
|
|
505
|
+
description: "Array of bookmarks for the project.",
|
|
506
|
+
}),
|
|
507
|
+
}).openapi({
|
|
508
|
+
title: "ProjectWithProjectBookmarksEntity",
|
|
509
|
+
description: "Project entity with associated bookmarks.",
|
|
510
|
+
});
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -246,3 +246,196 @@ export declare const UserWithFollowersEntitySchema: z.ZodObject<{
|
|
|
246
246
|
}>;
|
|
247
247
|
}, z.core.$strip>>;
|
|
248
248
|
}, z.core.$strip>;
|
|
249
|
+
export declare const GetAuthenticatedUserOutputSchema: z.ZodObject<{
|
|
250
|
+
id: z.ZodCUID2;
|
|
251
|
+
email: z.ZodString;
|
|
252
|
+
emailVerified: z.ZodBoolean;
|
|
253
|
+
name: z.ZodOptional<z.ZodString>;
|
|
254
|
+
image: z.ZodOptional<z.ZodString>;
|
|
255
|
+
username: z.ZodOptional<z.ZodString>;
|
|
256
|
+
displayUsername: z.ZodOptional<z.ZodString>;
|
|
257
|
+
role: z.ZodEnum<{
|
|
258
|
+
CREATIVE: "CREATIVE";
|
|
259
|
+
BRAND: "BRAND";
|
|
260
|
+
INVESTOR: "INVESTOR";
|
|
261
|
+
ADMIN: "ADMIN";
|
|
262
|
+
}>;
|
|
263
|
+
status: z.ZodEnum<{
|
|
264
|
+
ACTIVE: "ACTIVE";
|
|
265
|
+
SUSPENDED: "SUSPENDED";
|
|
266
|
+
DELETED: "DELETED";
|
|
267
|
+
}>;
|
|
268
|
+
onboardingPage: z.ZodEnum<{
|
|
269
|
+
EMAIL_VERIFICATION: "EMAIL_VERIFICATION";
|
|
270
|
+
USERNAME_SELECTION: "USERNAME_SELECTION";
|
|
271
|
+
ACCOUNT_TYPE_SELECTION: "ACCOUNT_TYPE_SELECTION";
|
|
272
|
+
CREATIVE_PROFILE_DETAILS: "CREATIVE_PROFILE_DETAILS";
|
|
273
|
+
CREATIVE_PROFILE_CUSTOMIZE_FEED: "CREATIVE_PROFILE_CUSTOMIZE_FEED";
|
|
274
|
+
CREATIVE_PROFILE_PORTFOLIO: "CREATIVE_PROFILE_PORTFOLIO";
|
|
275
|
+
BRAND_PROFILE_DETAILS: "BRAND_PROFILE_DETAILS";
|
|
276
|
+
BRAND_PROFILE_CUSTOMIZE_FEED: "BRAND_PROFILE_CUSTOMIZE_FEED";
|
|
277
|
+
BRAND_PROFILE_PORTFOLIO: "BRAND_PROFILE_PORTFOLIO";
|
|
278
|
+
INVESTOR_PROFILE_DETAILS: "INVESTOR_PROFILE_DETAILS";
|
|
279
|
+
INVESTOR_INVESTMENT_FOCUS: "INVESTOR_INVESTMENT_FOCUS";
|
|
280
|
+
INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
|
|
281
|
+
DONE: "DONE";
|
|
282
|
+
}>;
|
|
283
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
284
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
285
|
+
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
}, z.core.$strip>;
|
|
288
|
+
export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
289
|
+
id: z.ZodCUID2;
|
|
290
|
+
email: z.ZodString;
|
|
291
|
+
emailVerified: z.ZodBoolean;
|
|
292
|
+
name: z.ZodOptional<z.ZodString>;
|
|
293
|
+
image: z.ZodOptional<z.ZodString>;
|
|
294
|
+
username: z.ZodOptional<z.ZodString>;
|
|
295
|
+
displayUsername: z.ZodOptional<z.ZodString>;
|
|
296
|
+
role: z.ZodEnum<{
|
|
297
|
+
CREATIVE: "CREATIVE";
|
|
298
|
+
BRAND: "BRAND";
|
|
299
|
+
INVESTOR: "INVESTOR";
|
|
300
|
+
ADMIN: "ADMIN";
|
|
301
|
+
}>;
|
|
302
|
+
status: z.ZodEnum<{
|
|
303
|
+
ACTIVE: "ACTIVE";
|
|
304
|
+
SUSPENDED: "SUSPENDED";
|
|
305
|
+
DELETED: "DELETED";
|
|
306
|
+
}>;
|
|
307
|
+
onboardingPage: z.ZodEnum<{
|
|
308
|
+
EMAIL_VERIFICATION: "EMAIL_VERIFICATION";
|
|
309
|
+
USERNAME_SELECTION: "USERNAME_SELECTION";
|
|
310
|
+
ACCOUNT_TYPE_SELECTION: "ACCOUNT_TYPE_SELECTION";
|
|
311
|
+
CREATIVE_PROFILE_DETAILS: "CREATIVE_PROFILE_DETAILS";
|
|
312
|
+
CREATIVE_PROFILE_CUSTOMIZE_FEED: "CREATIVE_PROFILE_CUSTOMIZE_FEED";
|
|
313
|
+
CREATIVE_PROFILE_PORTFOLIO: "CREATIVE_PROFILE_PORTFOLIO";
|
|
314
|
+
BRAND_PROFILE_DETAILS: "BRAND_PROFILE_DETAILS";
|
|
315
|
+
BRAND_PROFILE_CUSTOMIZE_FEED: "BRAND_PROFILE_CUSTOMIZE_FEED";
|
|
316
|
+
BRAND_PROFILE_PORTFOLIO: "BRAND_PROFILE_PORTFOLIO";
|
|
317
|
+
INVESTOR_PROFILE_DETAILS: "INVESTOR_PROFILE_DETAILS";
|
|
318
|
+
INVESTOR_INVESTMENT_FOCUS: "INVESTOR_INVESTMENT_FOCUS";
|
|
319
|
+
INVESTOR_VERIFICATION: "INVESTOR_VERIFICATION";
|
|
320
|
+
DONE: "DONE";
|
|
321
|
+
}>;
|
|
322
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
323
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
324
|
+
followerCount: z.ZodOptional<z.ZodNumber>;
|
|
325
|
+
followingCount: z.ZodOptional<z.ZodNumber>;
|
|
326
|
+
profileType: z.ZodOptional<z.ZodEnum<{
|
|
327
|
+
creative: "creative";
|
|
328
|
+
brand: "brand";
|
|
329
|
+
investor: "investor";
|
|
330
|
+
}>>;
|
|
331
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
332
|
+
location: z.ZodOptional<z.ZodString>;
|
|
333
|
+
experienceLevel: z.ZodOptional<z.ZodString>;
|
|
334
|
+
disciplines: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
335
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
336
|
+
brandName: z.ZodOptional<z.ZodString>;
|
|
337
|
+
websiteURL: z.ZodOptional<z.ZodString>;
|
|
338
|
+
investorType: z.ZodOptional<z.ZodString>;
|
|
339
|
+
investmentSize: z.ZodOptional<z.ZodString>;
|
|
340
|
+
geographicFocus: z.ZodOptional<z.ZodString>;
|
|
341
|
+
}, z.core.$strip>;
|
|
342
|
+
export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
|
|
343
|
+
userId: z.ZodCUID2;
|
|
344
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
345
|
+
id: z.ZodString;
|
|
346
|
+
userId: z.ZodString;
|
|
347
|
+
description: z.ZodOptional<z.ZodString>;
|
|
348
|
+
title: z.ZodString;
|
|
349
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
350
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
351
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
352
|
+
url: z.ZodOptional<z.ZodString>;
|
|
353
|
+
imagePlaceholderUrl: z.ZodString;
|
|
354
|
+
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
355
|
+
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
356
|
+
projectCreatorType: z.ZodEnum<{
|
|
357
|
+
readonly CREATIVE: "CREATIVE";
|
|
358
|
+
readonly BRAND: "BRAND";
|
|
359
|
+
readonly INVESTOR: "INVESTOR";
|
|
360
|
+
readonly ADMIN: "ADMIN";
|
|
361
|
+
}>;
|
|
362
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
363
|
+
clientType: z.ZodOptional<z.ZodEnum<{
|
|
364
|
+
readonly CREATIVE: "CREATIVE";
|
|
365
|
+
readonly BRAND: "BRAND";
|
|
366
|
+
readonly NONE: "NONE";
|
|
367
|
+
}>>;
|
|
368
|
+
clientName: z.ZodOptional<z.ZodString>;
|
|
369
|
+
isFeatured: z.ZodOptional<z.ZodBoolean>;
|
|
370
|
+
searchVector: z.ZodString;
|
|
371
|
+
}, z.core.$strip>>;
|
|
372
|
+
}, z.core.$strip>;
|
|
373
|
+
export declare const GetAuthenticatedUserWithProjectBookmarksOutputSchema: z.ZodObject<{
|
|
374
|
+
userId: z.ZodCUID2;
|
|
375
|
+
projectBookmarks: z.ZodArray<z.ZodObject<{
|
|
376
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
377
|
+
userId: z.ZodCUID2;
|
|
378
|
+
projectId: z.ZodCUID2;
|
|
379
|
+
project: z.ZodObject<{
|
|
380
|
+
id: z.ZodString;
|
|
381
|
+
description: z.ZodOptional<z.ZodString>;
|
|
382
|
+
title: z.ZodString;
|
|
383
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
384
|
+
imagePlaceholderUrl: z.ZodString;
|
|
385
|
+
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
386
|
+
endDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
387
|
+
}, z.core.$strip>;
|
|
388
|
+
}, z.core.$strip>>;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
export declare const GetAuthenticatedUserWithUserFollowingOutputSchema: z.ZodObject<{
|
|
391
|
+
id: z.ZodCUID2;
|
|
392
|
+
username: z.ZodOptional<z.ZodString>;
|
|
393
|
+
email: z.ZodString;
|
|
394
|
+
name: z.ZodOptional<z.ZodString>;
|
|
395
|
+
image: z.ZodOptional<z.ZodString>;
|
|
396
|
+
role: z.ZodEnum<{
|
|
397
|
+
CREATIVE: "CREATIVE";
|
|
398
|
+
BRAND: "BRAND";
|
|
399
|
+
INVESTOR: "INVESTOR";
|
|
400
|
+
ADMIN: "ADMIN";
|
|
401
|
+
}>;
|
|
402
|
+
following: z.ZodArray<z.ZodObject<{
|
|
403
|
+
id: z.ZodCUID2;
|
|
404
|
+
username: z.ZodOptional<z.ZodString>;
|
|
405
|
+
email: z.ZodString;
|
|
406
|
+
name: z.ZodOptional<z.ZodString>;
|
|
407
|
+
image: z.ZodOptional<z.ZodString>;
|
|
408
|
+
role: z.ZodEnum<{
|
|
409
|
+
CREATIVE: "CREATIVE";
|
|
410
|
+
BRAND: "BRAND";
|
|
411
|
+
INVESTOR: "INVESTOR";
|
|
412
|
+
ADMIN: "ADMIN";
|
|
413
|
+
}>;
|
|
414
|
+
}, z.core.$strip>>;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
export declare const GetAuthenticatedUserWithUserFollowersOutputSchema: z.ZodObject<{
|
|
417
|
+
id: z.ZodCUID2;
|
|
418
|
+
username: z.ZodOptional<z.ZodString>;
|
|
419
|
+
email: z.ZodString;
|
|
420
|
+
name: z.ZodOptional<z.ZodString>;
|
|
421
|
+
image: z.ZodOptional<z.ZodString>;
|
|
422
|
+
role: z.ZodEnum<{
|
|
423
|
+
CREATIVE: "CREATIVE";
|
|
424
|
+
BRAND: "BRAND";
|
|
425
|
+
INVESTOR: "INVESTOR";
|
|
426
|
+
ADMIN: "ADMIN";
|
|
427
|
+
}>;
|
|
428
|
+
followers: z.ZodArray<z.ZodObject<{
|
|
429
|
+
id: z.ZodCUID2;
|
|
430
|
+
username: z.ZodOptional<z.ZodString>;
|
|
431
|
+
email: z.ZodString;
|
|
432
|
+
name: z.ZodOptional<z.ZodString>;
|
|
433
|
+
image: z.ZodOptional<z.ZodString>;
|
|
434
|
+
role: z.ZodEnum<{
|
|
435
|
+
CREATIVE: "CREATIVE";
|
|
436
|
+
BRAND: "BRAND";
|
|
437
|
+
INVESTOR: "INVESTOR";
|
|
438
|
+
ADMIN: "ADMIN";
|
|
439
|
+
}>;
|
|
440
|
+
}, z.core.$strip>>;
|
|
441
|
+
}, z.core.$strip>;
|
package/dist/schemas/user.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = exports.UserSocialGraphEntitySchema = void 0;
|
|
3
|
+
exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.GetAuthenticatedUserProfileOutputSchema = exports.GetAuthenticatedUserOutputSchema = exports.UserWithFollowersEntitySchema = exports.UserWithFollowingEntitySchema = exports.UserWithProjectBookmarksEntitySchema = exports.UserWithProjectsEntitySchema = exports.UserProfileEntitySchema = exports.UserEntitySchema = exports.MinimalUserSchema = exports.BaseUserEntitySchema = exports.UserSocialGraphEntitySchema = 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");
|
|
@@ -103,3 +103,9 @@ exports.UserWithFollowersEntitySchema = exports.MinimalUserSchema.extend({
|
|
|
103
103
|
.array(exports.MinimalUserSchema)
|
|
104
104
|
.openapi({ description: "List of users who follow this user." }),
|
|
105
105
|
}).openapi("UserWithFollowersEntity");
|
|
106
|
+
exports.GetAuthenticatedUserOutputSchema = exports.UserEntitySchema;
|
|
107
|
+
exports.GetAuthenticatedUserProfileOutputSchema = exports.UserProfileEntitySchema;
|
|
108
|
+
exports.GetAuthenticatedUserWithProjectsOutputSchema = exports.UserWithProjectsEntitySchema;
|
|
109
|
+
exports.GetAuthenticatedUserWithProjectBookmarksOutputSchema = exports.UserWithProjectBookmarksEntitySchema;
|
|
110
|
+
exports.GetAuthenticatedUserWithUserFollowingOutputSchema = exports.UserWithFollowingEntitySchema;
|
|
111
|
+
exports.GetAuthenticatedUserWithUserFollowersOutputSchema = exports.UserWithFollowersEntitySchema;
|