@zyacreatives/shared 2.3.8 → 2.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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/schemas/common.d.ts +85 -0
- package/dist/schemas/common.js +19 -1
- package/dist/schemas/file.d.ts +0 -2
- package/dist/schemas/file.js +0 -3
- package/dist/schemas/post.d.ts +0 -159
- package/dist/schemas/post.js +1 -35
- package/dist/schemas/project.d.ts +7 -7
- package/dist/schemas/user.d.ts +12 -15
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/schemas/common.ts +22 -0
- package/src/schemas/file.ts +1 -3
- package/src/schemas/post.ts +0 -59
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/schemas/common.d.ts
CHANGED
|
@@ -25,3 +25,88 @@ export declare const DefaultApiSuccessOutputSchema: z.ZodObject<{
|
|
|
25
25
|
status: z.ZodLiteral<"success">;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
export type ApiSuccessOutput = z.infer<typeof DefaultApiSuccessOutputSchema>;
|
|
28
|
+
export declare const EntityCommentsOutputSchema: z.ZodObject<{
|
|
29
|
+
comments: z.ZodArray<z.ZodObject<{
|
|
30
|
+
id: z.ZodCUID2;
|
|
31
|
+
userId: z.ZodCUID2;
|
|
32
|
+
parentId: z.ZodCUID2;
|
|
33
|
+
parentCommentId: z.ZodOptional<z.ZodCUID2>;
|
|
34
|
+
parentType: z.ZodEnum<{
|
|
35
|
+
readonly PROJECT: "PROJECT";
|
|
36
|
+
readonly USER: "USER";
|
|
37
|
+
readonly JOB: "JOB";
|
|
38
|
+
readonly POST: "POST";
|
|
39
|
+
readonly PRODUCT: "PRODUCT";
|
|
40
|
+
readonly COMMENT: "COMMENT";
|
|
41
|
+
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
42
|
+
}>;
|
|
43
|
+
content: z.ZodString;
|
|
44
|
+
commenterUsername: z.ZodOptional<z.ZodString>;
|
|
45
|
+
commenterName: z.ZodOptional<z.ZodString>;
|
|
46
|
+
commenterImageUrl: z.ZodOptional<z.ZodString>;
|
|
47
|
+
replyToId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
|
|
48
|
+
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
49
|
+
isLiked: z.ZodDefault<z.ZodBoolean>;
|
|
50
|
+
likesCount: z.ZodDefault<z.ZodInt>;
|
|
51
|
+
hasReplies: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export declare const EntityLikesOutputSchema: z.ZodObject<{
|
|
57
|
+
likes: z.ZodArray<z.ZodObject<{
|
|
58
|
+
id: z.ZodCUID2;
|
|
59
|
+
type: z.ZodEnum<{
|
|
60
|
+
readonly LIKE: "LIKE";
|
|
61
|
+
readonly UNLIKE: "UNLIKE";
|
|
62
|
+
readonly BOOKMARK: "BOOKMARK";
|
|
63
|
+
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
64
|
+
readonly VIEW: "VIEW";
|
|
65
|
+
}>;
|
|
66
|
+
actorName: z.ZodString;
|
|
67
|
+
actorId: z.ZodString;
|
|
68
|
+
actorUsername: z.ZodString;
|
|
69
|
+
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
70
|
+
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export declare const EntityBookmarksOutputSchema: z.ZodObject<{
|
|
76
|
+
bookmarks: z.ZodArray<z.ZodObject<{
|
|
77
|
+
id: z.ZodCUID2;
|
|
78
|
+
type: z.ZodEnum<{
|
|
79
|
+
readonly LIKE: "LIKE";
|
|
80
|
+
readonly UNLIKE: "UNLIKE";
|
|
81
|
+
readonly BOOKMARK: "BOOKMARK";
|
|
82
|
+
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
83
|
+
readonly VIEW: "VIEW";
|
|
84
|
+
}>;
|
|
85
|
+
actorName: z.ZodString;
|
|
86
|
+
actorId: z.ZodString;
|
|
87
|
+
actorUsername: z.ZodString;
|
|
88
|
+
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
89
|
+
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export declare const EntityRepliesOutputSchema: z.ZodObject<{
|
|
95
|
+
replies: z.ZodArray<z.ZodObject<{
|
|
96
|
+
id: z.ZodCUID2;
|
|
97
|
+
type: z.ZodEnum<{
|
|
98
|
+
readonly LIKE: "LIKE";
|
|
99
|
+
readonly UNLIKE: "UNLIKE";
|
|
100
|
+
readonly BOOKMARK: "BOOKMARK";
|
|
101
|
+
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
102
|
+
readonly VIEW: "VIEW";
|
|
103
|
+
}>;
|
|
104
|
+
actorName: z.ZodString;
|
|
105
|
+
actorId: z.ZodString;
|
|
106
|
+
actorUsername: z.ZodString;
|
|
107
|
+
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
108
|
+
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>;
|
package/dist/schemas/common.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultApiSuccessOutputSchema = exports.ProjectIdentifierSchema = exports.ProfileIdentifierSchema = exports.UserIdentifierSchema = exports.CuidSchema = void 0;
|
|
3
|
+
exports.EntityRepliesOutputSchema = exports.EntityBookmarksOutputSchema = exports.EntityLikesOutputSchema = exports.EntityCommentsOutputSchema = exports.DefaultApiSuccessOutputSchema = exports.ProjectIdentifierSchema = exports.ProfileIdentifierSchema = exports.UserIdentifierSchema = exports.CuidSchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
|
+
const comment_1 = require("./comment");
|
|
6
|
+
const activity_1 = require("./activity");
|
|
5
7
|
exports.CuidSchema = zod_openapi_1.z.cuid2({ error: "Invalid CUID2 is written." });
|
|
6
8
|
exports.UserIdentifierSchema = zod_openapi_1.z.object({
|
|
7
9
|
by: zod_openapi_1.z.enum(["id", "username"]).optional().default("id"),
|
|
@@ -15,3 +17,19 @@ exports.ProjectIdentifierSchema = zod_openapi_1.z.object({
|
|
|
15
17
|
exports.DefaultApiSuccessOutputSchema = zod_openapi_1.z.object({
|
|
16
18
|
status: zod_openapi_1.z.literal("success"),
|
|
17
19
|
});
|
|
20
|
+
exports.EntityCommentsOutputSchema = zod_openapi_1.z.object({
|
|
21
|
+
comments: zod_openapi_1.z.array(comment_1.CommentEntitySchema),
|
|
22
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
23
|
+
});
|
|
24
|
+
exports.EntityLikesOutputSchema = zod_openapi_1.z.object({
|
|
25
|
+
likes: zod_openapi_1.z.array(activity_1.ActivitySchema),
|
|
26
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
27
|
+
});
|
|
28
|
+
exports.EntityBookmarksOutputSchema = zod_openapi_1.z.object({
|
|
29
|
+
bookmarks: zod_openapi_1.z.array(activity_1.ActivitySchema),
|
|
30
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
31
|
+
});
|
|
32
|
+
exports.EntityRepliesOutputSchema = zod_openapi_1.z.object({
|
|
33
|
+
replies: zod_openapi_1.z.array(activity_1.ActivitySchema),
|
|
34
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
35
|
+
});
|
package/dist/schemas/file.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export declare const FileEntitySchema: z.ZodObject<{
|
|
|
4
4
|
key: z.ZodString;
|
|
5
5
|
mimeType: z.ZodString;
|
|
6
6
|
url: z.ZodURL;
|
|
7
|
-
userId: z.ZodCUID2;
|
|
8
7
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
9
8
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
10
9
|
readonly PROJECT: "PROJECT";
|
|
@@ -69,7 +68,6 @@ export declare const CreateFileOutputSchema: z.ZodObject<{
|
|
|
69
68
|
key: z.ZodString;
|
|
70
69
|
mimeType: z.ZodString;
|
|
71
70
|
url: z.ZodURL;
|
|
72
|
-
userId: z.ZodCUID2;
|
|
73
71
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
74
72
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
75
73
|
readonly PROJECT: "PROJECT";
|
package/dist/schemas/file.js
CHANGED
|
@@ -9,9 +9,6 @@ exports.FileEntitySchema = zod_openapi_1.z
|
|
|
9
9
|
key: zod_openapi_1.z.string().openapi({ example: "profile-pic-12345" }),
|
|
10
10
|
mimeType: zod_openapi_1.z.string().openapi({ example: "image/jpeg" }),
|
|
11
11
|
url: zod_openapi_1.z.url().openapi({ example: "https://example.com/file.jpg" }),
|
|
12
|
-
userId: zod_openapi_1.z
|
|
13
|
-
.cuid2()
|
|
14
|
-
.openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
|
|
15
12
|
parentId: zod_openapi_1.z.cuid2().nullable().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
16
13
|
parentType: zod_openapi_1.z
|
|
17
14
|
.enum(constants_1.ACTIVITY_PARENT_TYPES)
|
package/dist/schemas/post.d.ts
CHANGED
|
@@ -100,7 +100,6 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
|
|
|
100
100
|
key: z.ZodString;
|
|
101
101
|
mimeType: z.ZodString;
|
|
102
102
|
url: z.ZodURL;
|
|
103
|
-
userId: z.ZodCUID2;
|
|
104
103
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
105
104
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
106
105
|
readonly PROJECT: "PROJECT";
|
|
@@ -176,7 +175,6 @@ export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
|
176
175
|
key: z.ZodString;
|
|
177
176
|
mimeType: z.ZodString;
|
|
178
177
|
url: z.ZodURL;
|
|
179
|
-
userId: z.ZodCUID2;
|
|
180
178
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
181
179
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
182
180
|
readonly PROJECT: "PROJECT";
|
|
@@ -217,81 +215,6 @@ export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
|
217
215
|
isBookmarked: z.ZodOptional<z.ZodBoolean>;
|
|
218
216
|
}, z.core.$strip>;
|
|
219
217
|
export type FeedPostEntity = z.infer<typeof FeedPostEntitySchema>;
|
|
220
|
-
export declare const PostWithLikesEntitySchema: z.ZodObject<{
|
|
221
|
-
id: z.ZodCUID2;
|
|
222
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
223
|
-
content: z.ZodOptional<z.ZodString>;
|
|
224
|
-
likes: z.ZodArray<z.ZodObject<{
|
|
225
|
-
id: z.ZodCUID2;
|
|
226
|
-
type: z.ZodEnum<{
|
|
227
|
-
readonly LIKE: "LIKE";
|
|
228
|
-
readonly UNLIKE: "UNLIKE";
|
|
229
|
-
readonly BOOKMARK: "BOOKMARK";
|
|
230
|
-
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
231
|
-
readonly VIEW: "VIEW";
|
|
232
|
-
}>;
|
|
233
|
-
actorName: z.ZodString;
|
|
234
|
-
actorId: z.ZodString;
|
|
235
|
-
actorUsername: z.ZodString;
|
|
236
|
-
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
237
|
-
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
238
|
-
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
-
}, z.core.$strip>>;
|
|
240
|
-
}, z.core.$strip>;
|
|
241
|
-
export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
|
|
242
|
-
export declare const PostWithCommentsEntitySchema: z.ZodObject<{
|
|
243
|
-
id: z.ZodCUID2;
|
|
244
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
245
|
-
content: z.ZodOptional<z.ZodString>;
|
|
246
|
-
comments: z.ZodArray<z.ZodObject<{
|
|
247
|
-
id: z.ZodCUID2;
|
|
248
|
-
userId: z.ZodCUID2;
|
|
249
|
-
parentId: z.ZodCUID2;
|
|
250
|
-
parentCommentId: z.ZodOptional<z.ZodCUID2>;
|
|
251
|
-
parentType: z.ZodEnum<{
|
|
252
|
-
readonly PROJECT: "PROJECT";
|
|
253
|
-
readonly USER: "USER";
|
|
254
|
-
readonly JOB: "JOB";
|
|
255
|
-
readonly POST: "POST";
|
|
256
|
-
readonly PRODUCT: "PRODUCT";
|
|
257
|
-
readonly COMMENT: "COMMENT";
|
|
258
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
259
|
-
}>;
|
|
260
|
-
content: z.ZodString;
|
|
261
|
-
commenterUsername: z.ZodOptional<z.ZodString>;
|
|
262
|
-
commenterName: z.ZodOptional<z.ZodString>;
|
|
263
|
-
commenterImageUrl: z.ZodOptional<z.ZodString>;
|
|
264
|
-
replyToId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
|
|
265
|
-
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
266
|
-
isLiked: z.ZodDefault<z.ZodBoolean>;
|
|
267
|
-
likesCount: z.ZodDefault<z.ZodInt>;
|
|
268
|
-
hasReplies: z.ZodOptional<z.ZodBoolean>;
|
|
269
|
-
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
270
|
-
}, z.core.$strip>>;
|
|
271
|
-
}, z.core.$strip>;
|
|
272
|
-
export type PostWithPostCommentsEntity = z.infer<typeof PostWithCommentsEntitySchema>;
|
|
273
|
-
export declare const PostWithBookmarksEntitySchema: z.ZodObject<{
|
|
274
|
-
id: z.ZodCUID2;
|
|
275
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
276
|
-
content: z.ZodOptional<z.ZodString>;
|
|
277
|
-
bookmarks: z.ZodArray<z.ZodObject<{
|
|
278
|
-
id: z.ZodCUID2;
|
|
279
|
-
type: z.ZodEnum<{
|
|
280
|
-
readonly LIKE: "LIKE";
|
|
281
|
-
readonly UNLIKE: "UNLIKE";
|
|
282
|
-
readonly BOOKMARK: "BOOKMARK";
|
|
283
|
-
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
284
|
-
readonly VIEW: "VIEW";
|
|
285
|
-
}>;
|
|
286
|
-
actorName: z.ZodString;
|
|
287
|
-
actorId: z.ZodString;
|
|
288
|
-
actorUsername: z.ZodString;
|
|
289
|
-
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
290
|
-
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
291
|
-
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
292
|
-
}, z.core.$strip>>;
|
|
293
|
-
}, z.core.$strip>;
|
|
294
|
-
export type PostWithPostBookmarksEntity = z.infer<typeof PostWithBookmarksEntitySchema>;
|
|
295
218
|
export declare const CreatePostInputSchema: z.ZodObject<{
|
|
296
219
|
id: z.ZodCUID2;
|
|
297
220
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
@@ -472,7 +395,6 @@ export declare const GetPostOutputSchema: z.ZodObject<{
|
|
|
472
395
|
key: z.ZodString;
|
|
473
396
|
mimeType: z.ZodString;
|
|
474
397
|
url: z.ZodURL;
|
|
475
|
-
userId: z.ZodCUID2;
|
|
476
398
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
477
399
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
478
400
|
readonly PROJECT: "PROJECT";
|
|
@@ -498,84 +420,6 @@ export declare const LinkPreviewOutputSchema: z.ZodObject<{
|
|
|
498
420
|
url: z.ZodOptional<z.ZodString>;
|
|
499
421
|
}, z.core.$strip>;
|
|
500
422
|
export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;
|
|
501
|
-
export declare const GetPostWithLikesOutputSchema: z.ZodObject<{
|
|
502
|
-
id: z.ZodCUID2;
|
|
503
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
504
|
-
content: z.ZodOptional<z.ZodString>;
|
|
505
|
-
likes: z.ZodArray<z.ZodObject<{
|
|
506
|
-
id: z.ZodCUID2;
|
|
507
|
-
type: z.ZodEnum<{
|
|
508
|
-
readonly LIKE: "LIKE";
|
|
509
|
-
readonly UNLIKE: "UNLIKE";
|
|
510
|
-
readonly BOOKMARK: "BOOKMARK";
|
|
511
|
-
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
512
|
-
readonly VIEW: "VIEW";
|
|
513
|
-
}>;
|
|
514
|
-
actorName: z.ZodString;
|
|
515
|
-
actorId: z.ZodString;
|
|
516
|
-
actorUsername: z.ZodString;
|
|
517
|
-
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
518
|
-
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
519
|
-
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
520
|
-
}, z.core.$strip>>;
|
|
521
|
-
nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
522
|
-
}, z.core.$strip>;
|
|
523
|
-
export type GetPostWithLikesOutput = z.infer<typeof GetPostWithLikesOutputSchema>;
|
|
524
|
-
export declare const GetPostWithCommentsOutputSchema: z.ZodObject<{
|
|
525
|
-
id: z.ZodCUID2;
|
|
526
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
527
|
-
content: z.ZodOptional<z.ZodString>;
|
|
528
|
-
comments: z.ZodArray<z.ZodObject<{
|
|
529
|
-
id: z.ZodCUID2;
|
|
530
|
-
userId: z.ZodCUID2;
|
|
531
|
-
parentId: z.ZodCUID2;
|
|
532
|
-
parentCommentId: z.ZodOptional<z.ZodCUID2>;
|
|
533
|
-
parentType: z.ZodEnum<{
|
|
534
|
-
readonly PROJECT: "PROJECT";
|
|
535
|
-
readonly USER: "USER";
|
|
536
|
-
readonly JOB: "JOB";
|
|
537
|
-
readonly POST: "POST";
|
|
538
|
-
readonly PRODUCT: "PRODUCT";
|
|
539
|
-
readonly COMMENT: "COMMENT";
|
|
540
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
541
|
-
}>;
|
|
542
|
-
content: z.ZodString;
|
|
543
|
-
commenterUsername: z.ZodOptional<z.ZodString>;
|
|
544
|
-
commenterName: z.ZodOptional<z.ZodString>;
|
|
545
|
-
commenterImageUrl: z.ZodOptional<z.ZodString>;
|
|
546
|
-
replyToId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
|
|
547
|
-
createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
548
|
-
isLiked: z.ZodDefault<z.ZodBoolean>;
|
|
549
|
-
likesCount: z.ZodDefault<z.ZodInt>;
|
|
550
|
-
hasReplies: z.ZodOptional<z.ZodBoolean>;
|
|
551
|
-
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
552
|
-
}, z.core.$strip>>;
|
|
553
|
-
nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
554
|
-
}, z.core.$strip>;
|
|
555
|
-
export type GetPostWithCommentsOutput = z.infer<typeof GetPostWithCommentsOutputSchema>;
|
|
556
|
-
export declare const GetPostWithBookmarksOutputSchema: z.ZodObject<{
|
|
557
|
-
id: z.ZodCUID2;
|
|
558
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
559
|
-
content: z.ZodOptional<z.ZodString>;
|
|
560
|
-
bookmarks: z.ZodArray<z.ZodObject<{
|
|
561
|
-
id: z.ZodCUID2;
|
|
562
|
-
type: z.ZodEnum<{
|
|
563
|
-
readonly LIKE: "LIKE";
|
|
564
|
-
readonly UNLIKE: "UNLIKE";
|
|
565
|
-
readonly BOOKMARK: "BOOKMARK";
|
|
566
|
-
readonly UNBOOKMARK: "UNBOOKMARK";
|
|
567
|
-
readonly VIEW: "VIEW";
|
|
568
|
-
}>;
|
|
569
|
-
actorName: z.ZodString;
|
|
570
|
-
actorId: z.ZodString;
|
|
571
|
-
actorUsername: z.ZodString;
|
|
572
|
-
actorImageUrl: z.ZodOptional<z.ZodURL>;
|
|
573
|
-
followsYou: z.ZodOptional<z.ZodBoolean>;
|
|
574
|
-
isFollowing: z.ZodOptional<z.ZodBoolean>;
|
|
575
|
-
}, z.core.$strip>>;
|
|
576
|
-
totalNo: z.ZodNumber;
|
|
577
|
-
}, z.core.$strip>;
|
|
578
|
-
export type GetPostWithBookmarksOutput = z.infer<typeof GetPostWithBookmarksOutputSchema>;
|
|
579
423
|
export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
580
424
|
feed: z.ZodArray<z.ZodObject<{
|
|
581
425
|
id: z.ZodCUID2;
|
|
@@ -629,7 +473,6 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
|
629
473
|
key: z.ZodString;
|
|
630
474
|
mimeType: z.ZodString;
|
|
631
475
|
url: z.ZodURL;
|
|
632
|
-
userId: z.ZodCUID2;
|
|
633
476
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
634
477
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
635
478
|
readonly PROJECT: "PROJECT";
|
|
@@ -725,7 +568,6 @@ export declare const SearchPostOutputSchema: z.ZodObject<{
|
|
|
725
568
|
key: z.ZodString;
|
|
726
569
|
mimeType: z.ZodString;
|
|
727
570
|
url: z.ZodURL;
|
|
728
|
-
userId: z.ZodCUID2;
|
|
729
571
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
730
572
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
731
573
|
readonly PROJECT: "PROJECT";
|
|
@@ -855,7 +697,6 @@ export declare const PostSearchDocumentSchema: z.ZodObject<{
|
|
|
855
697
|
key: z.ZodString;
|
|
856
698
|
mimeType: z.ZodString;
|
|
857
699
|
url: z.ZodURL;
|
|
858
|
-
userId: z.ZodCUID2;
|
|
859
700
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
860
701
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
861
702
|
readonly PROJECT: "PROJECT";
|
package/dist/schemas/post.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PostSearchDocumentSchema = exports.PostAnalyticsOutputSchema = exports.SearchPostOutputSchema = exports.GetFeedOutputSchema = exports.
|
|
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;
|
|
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
|
-
const comment_1 = require("./comment");
|
|
8
7
|
const entity_stats_1 = require("./entity-stats");
|
|
9
|
-
const activity_1 = require("./activity");
|
|
10
8
|
const clean_html_1 = require("../utils/clean-html");
|
|
11
9
|
exports.PostEntitySchema = zod_openapi_1.z.object({
|
|
12
10
|
id: zod_openapi_1.z
|
|
@@ -96,21 +94,6 @@ exports.FeedPostEntitySchema = exports.PostWithFilesEntitySchema.extend({
|
|
|
96
94
|
isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
|
|
97
95
|
isBookmarked: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
|
|
98
96
|
});
|
|
99
|
-
// ─── Interactions ─────────────────────────────────────────────────────────────
|
|
100
|
-
exports.PostWithLikesEntitySchema = exports.MinimalPostSchema.extend({
|
|
101
|
-
likes: zod_openapi_1.z
|
|
102
|
-
.array(activity_1.ActivitySchema.extend({
|
|
103
|
-
followsYou: zod_openapi_1.z.boolean().optional().openapi({ example: true }),
|
|
104
|
-
isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
|
|
105
|
-
}))
|
|
106
|
-
.openapi({ example: [] }),
|
|
107
|
-
}).openapi({ title: "PostWithPostLikesEntity" });
|
|
108
|
-
exports.PostWithCommentsEntitySchema = exports.MinimalPostSchema.extend({
|
|
109
|
-
comments: zod_openapi_1.z.array(comment_1.CommentEntitySchema).openapi({ example: [] }),
|
|
110
|
-
}).openapi({ title: "PostWithPostCommentsEntity" });
|
|
111
|
-
exports.PostWithBookmarksEntitySchema = exports.MinimalPostSchema.extend({
|
|
112
|
-
bookmarks: zod_openapi_1.z.array(activity_1.ActivitySchema).openapi({ example: [] }),
|
|
113
|
-
}).openapi({ title: "PostWithPostBookmarksEntity" });
|
|
114
97
|
// ─── Inputs ───────────────────────────────────────────────────────────────────
|
|
115
98
|
exports.CreatePostInputSchema = zod_openapi_1.z.object({
|
|
116
99
|
id: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
@@ -232,23 +215,6 @@ exports.LinkPreviewOutputSchema = zod_openapi_1.z.object({
|
|
|
232
215
|
.optional()
|
|
233
216
|
.openapi({ example: "https://example.com/article" }),
|
|
234
217
|
});
|
|
235
|
-
exports.GetPostWithLikesOutputSchema = exports.PostWithLikesEntitySchema.extend({
|
|
236
|
-
nextCursor: zod_openapi_1.z
|
|
237
|
-
.string()
|
|
238
|
-
.optional()
|
|
239
|
-
.nullable()
|
|
240
|
-
.openapi({ example: "ckj1a2b3c0000nxt" }),
|
|
241
|
-
});
|
|
242
|
-
exports.GetPostWithCommentsOutputSchema = exports.PostWithCommentsEntitySchema.extend({
|
|
243
|
-
nextCursor: zod_openapi_1.z
|
|
244
|
-
.string()
|
|
245
|
-
.optional()
|
|
246
|
-
.nullable()
|
|
247
|
-
.openapi({ example: "ckj1a2b3c0000nxt" }),
|
|
248
|
-
});
|
|
249
|
-
exports.GetPostWithBookmarksOutputSchema = exports.PostWithBookmarksEntitySchema.extend({
|
|
250
|
-
totalNo: zod_openapi_1.z.number().int().openapi({ example: 42 }),
|
|
251
|
-
});
|
|
252
218
|
exports.GetFeedOutputSchema = zod_openapi_1.z.object({
|
|
253
219
|
feed: zod_openapi_1.z.array(exports.FeedPostEntitySchema).openapi({ example: [] }),
|
|
254
220
|
nextCursor: zod_openapi_1.z
|
|
@@ -65,9 +65,9 @@ export declare const ProjectEntitySchema: z.ZodObject<{
|
|
|
65
65
|
version: z.ZodNumber;
|
|
66
66
|
}, z.core.$strip>;
|
|
67
67
|
export declare const MinimalProjectSchema: z.ZodObject<{
|
|
68
|
-
id: z.ZodCUID2;
|
|
69
68
|
description: z.ZodOptional<z.ZodString>;
|
|
70
69
|
title: z.ZodString;
|
|
70
|
+
id: z.ZodCUID2;
|
|
71
71
|
imagePlaceholderUrl: z.ZodURL;
|
|
72
72
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
73
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -448,9 +448,9 @@ export declare const SearchProjectsOutputSchema: z.ZodObject<{
|
|
|
448
448
|
nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
449
449
|
}, z.core.$strip>;
|
|
450
450
|
export declare const ProjectWithProjectCommentsEntitySchema: z.ZodObject<{
|
|
451
|
-
id: z.ZodCUID2;
|
|
452
451
|
description: z.ZodOptional<z.ZodString>;
|
|
453
452
|
title: z.ZodString;
|
|
453
|
+
id: z.ZodCUID2;
|
|
454
454
|
imagePlaceholderUrl: z.ZodURL;
|
|
455
455
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
456
456
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -482,9 +482,9 @@ export declare const ProjectWithProjectCommentsEntitySchema: z.ZodObject<{
|
|
|
482
482
|
}, z.core.$strip>>;
|
|
483
483
|
}, z.core.$strip>;
|
|
484
484
|
export declare const GetProjectWithCommentsOutputSchema: z.ZodObject<{
|
|
485
|
-
id: z.ZodCUID2;
|
|
486
485
|
description: z.ZodOptional<z.ZodString>;
|
|
487
486
|
title: z.ZodString;
|
|
487
|
+
id: z.ZodCUID2;
|
|
488
488
|
imagePlaceholderUrl: z.ZodURL;
|
|
489
489
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
490
490
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -517,9 +517,9 @@ export declare const GetProjectWithCommentsOutputSchema: z.ZodObject<{
|
|
|
517
517
|
nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
518
518
|
}, z.core.$strip>;
|
|
519
519
|
export declare const ProjectWithLikesEntitySchema: z.ZodObject<{
|
|
520
|
-
id: z.ZodCUID2;
|
|
521
520
|
description: z.ZodOptional<z.ZodString>;
|
|
522
521
|
title: z.ZodString;
|
|
522
|
+
id: z.ZodCUID2;
|
|
523
523
|
imagePlaceholderUrl: z.ZodURL;
|
|
524
524
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
525
525
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -542,9 +542,9 @@ export declare const ProjectWithLikesEntitySchema: z.ZodObject<{
|
|
|
542
542
|
}, z.core.$strip>>;
|
|
543
543
|
}, z.core.$strip>;
|
|
544
544
|
export declare const GetProjectWithLikesOutputSchema: z.ZodObject<{
|
|
545
|
-
id: z.ZodCUID2;
|
|
546
545
|
description: z.ZodOptional<z.ZodString>;
|
|
547
546
|
title: z.ZodString;
|
|
547
|
+
id: z.ZodCUID2;
|
|
548
548
|
imagePlaceholderUrl: z.ZodURL;
|
|
549
549
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
550
550
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -568,9 +568,9 @@ export declare const GetProjectWithLikesOutputSchema: z.ZodObject<{
|
|
|
568
568
|
nextCursor: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
569
569
|
}, z.core.$strip>;
|
|
570
570
|
export declare const ProjectWithProjectViewsEntitySchema: z.ZodObject<{
|
|
571
|
-
id: z.ZodCUID2;
|
|
572
571
|
description: z.ZodOptional<z.ZodString>;
|
|
573
572
|
title: z.ZodString;
|
|
573
|
+
id: z.ZodCUID2;
|
|
574
574
|
imagePlaceholderUrl: z.ZodURL;
|
|
575
575
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
576
576
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -596,9 +596,9 @@ export declare const ProjectWithProjectViewsEntitySchema: z.ZodObject<{
|
|
|
596
596
|
}, z.core.$strip>>;
|
|
597
597
|
}, z.core.$strip>;
|
|
598
598
|
export declare const ProjectWithProjectBookmarksEntitySchema: z.ZodObject<{
|
|
599
|
-
id: z.ZodCUID2;
|
|
600
599
|
description: z.ZodOptional<z.ZodString>;
|
|
601
600
|
title: z.ZodString;
|
|
601
|
+
id: z.ZodCUID2;
|
|
602
602
|
imagePlaceholderUrl: z.ZodURL;
|
|
603
603
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
604
604
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -226,18 +226,18 @@ export declare const UserStatsEntitySchema: z.ZodObject<{
|
|
|
226
226
|
export declare const UserWithProjectsEntitySchema: z.ZodObject<{
|
|
227
227
|
userId: z.ZodCUID2;
|
|
228
228
|
projects: z.ZodArray<z.ZodObject<{
|
|
229
|
+
description: z.ZodOptional<z.ZodString>;
|
|
230
|
+
title: z.ZodString;
|
|
229
231
|
id: z.ZodCUID2;
|
|
230
232
|
userId: z.ZodCUID2;
|
|
233
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
234
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
235
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
231
236
|
status: z.ZodEnum<{
|
|
232
237
|
readonly ACTIVE: "ACTIVE";
|
|
233
238
|
readonly DRAFT: "DRAFT";
|
|
234
239
|
readonly ARCHIVED: "ARCHIVED";
|
|
235
240
|
}>;
|
|
236
|
-
description: z.ZodOptional<z.ZodString>;
|
|
237
|
-
title: z.ZodString;
|
|
238
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
239
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
240
|
-
url: z.ZodOptional<z.ZodURL>;
|
|
241
241
|
imagePlaceholderUrl: z.ZodURL;
|
|
242
242
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
243
243
|
projectCreatorType: z.ZodEnum<{
|
|
@@ -341,7 +341,6 @@ export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
|
341
341
|
key: z.ZodString;
|
|
342
342
|
mimeType: z.ZodString;
|
|
343
343
|
url: z.ZodURL;
|
|
344
|
-
userId: z.ZodCUID2;
|
|
345
344
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
346
345
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
347
346
|
readonly PROJECT: "PROJECT";
|
|
@@ -377,9 +376,9 @@ export declare const UserWithProjectLikesEntitySchema: z.ZodObject<{
|
|
|
377
376
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
378
377
|
}>;
|
|
379
378
|
project: z.ZodObject<{
|
|
380
|
-
id: z.ZodCUID2;
|
|
381
379
|
description: z.ZodOptional<z.ZodString>;
|
|
382
380
|
title: z.ZodString;
|
|
381
|
+
id: z.ZodCUID2;
|
|
383
382
|
imagePlaceholderUrl: z.ZodURL;
|
|
384
383
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
385
384
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
@@ -647,7 +646,6 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
647
646
|
key: z.ZodString;
|
|
648
647
|
mimeType: z.ZodString;
|
|
649
648
|
url: z.ZodURL;
|
|
650
|
-
userId: z.ZodCUID2;
|
|
651
649
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
652
650
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
653
651
|
readonly PROJECT: "PROJECT";
|
|
@@ -958,7 +956,6 @@ export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
|
958
956
|
key: z.ZodString;
|
|
959
957
|
mimeType: z.ZodString;
|
|
960
958
|
url: z.ZodURL;
|
|
961
|
-
userId: z.ZodCUID2;
|
|
962
959
|
parentId: z.ZodNullable<z.ZodCUID2>;
|
|
963
960
|
parentType: z.ZodNullable<z.ZodEnum<{
|
|
964
961
|
readonly PROJECT: "PROJECT";
|
|
@@ -1310,18 +1307,18 @@ export declare const GetAuthenticatedUserProfileOutputSchema: z.ZodObject<{
|
|
|
1310
1307
|
export declare const GetAuthenticatedUserWithProjectsOutputSchema: z.ZodObject<{
|
|
1311
1308
|
userId: z.ZodCUID2;
|
|
1312
1309
|
projects: z.ZodArray<z.ZodObject<{
|
|
1310
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1311
|
+
title: z.ZodString;
|
|
1313
1312
|
id: z.ZodCUID2;
|
|
1314
1313
|
userId: z.ZodCUID2;
|
|
1314
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
1315
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
1316
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
1315
1317
|
status: z.ZodEnum<{
|
|
1316
1318
|
readonly ACTIVE: "ACTIVE";
|
|
1317
1319
|
readonly DRAFT: "DRAFT";
|
|
1318
1320
|
readonly ARCHIVED: "ARCHIVED";
|
|
1319
1321
|
}>;
|
|
1320
|
-
description: z.ZodOptional<z.ZodString>;
|
|
1321
|
-
title: z.ZodString;
|
|
1322
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
1323
|
-
updatedAt: z.ZodCoercedDate<unknown>;
|
|
1324
|
-
url: z.ZodOptional<z.ZodURL>;
|
|
1325
1322
|
imagePlaceholderUrl: z.ZodURL;
|
|
1326
1323
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1327
1324
|
projectCreatorType: z.ZodEnum<{
|
|
@@ -1459,9 +1456,9 @@ export declare const GetAuthenticatedUserWithProjectLikesOutputSchema: z.ZodObje
|
|
|
1459
1456
|
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
1460
1457
|
}>;
|
|
1461
1458
|
project: z.ZodObject<{
|
|
1462
|
-
id: z.ZodCUID2;
|
|
1463
1459
|
description: z.ZodOptional<z.ZodString>;
|
|
1464
1460
|
title: z.ZodString;
|
|
1461
|
+
id: z.ZodCUID2;
|
|
1465
1462
|
imagePlaceholderUrl: z.ZodURL;
|
|
1466
1463
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1467
1464
|
startDate: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/schemas/common.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
import { CommentEntitySchema } from "./comment";
|
|
3
|
+
import { ActivitySchema } from "./activity";
|
|
2
4
|
|
|
3
5
|
export const CuidSchema = z.cuid2({ error: "Invalid CUID2 is written." });
|
|
4
6
|
|
|
@@ -25,3 +27,23 @@ export const DefaultApiSuccessOutputSchema = z.object({
|
|
|
25
27
|
});
|
|
26
28
|
|
|
27
29
|
export type ApiSuccessOutput = z.infer<typeof DefaultApiSuccessOutputSchema>;
|
|
30
|
+
|
|
31
|
+
export const EntityCommentsOutputSchema = z.object({
|
|
32
|
+
comments: z.array(CommentEntitySchema),
|
|
33
|
+
nextCursor: z.string().nullable(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export const EntityLikesOutputSchema = z.object({
|
|
37
|
+
likes: z.array(ActivitySchema),
|
|
38
|
+
nextCursor: z.string().nullable(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const EntityBookmarksOutputSchema = z.object({
|
|
42
|
+
bookmarks: z.array(ActivitySchema),
|
|
43
|
+
nextCursor: z.string().nullable(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const EntityRepliesOutputSchema = z.object({
|
|
47
|
+
replies: z.array(ActivitySchema),
|
|
48
|
+
nextCursor: z.string().nullable(),
|
|
49
|
+
});
|
package/src/schemas/file.ts
CHANGED
|
@@ -7,9 +7,6 @@ export const FileEntitySchema = z
|
|
|
7
7
|
key: z.string().openapi({ example: "profile-pic-12345" }),
|
|
8
8
|
mimeType: z.string().openapi({ example: "image/jpeg" }),
|
|
9
9
|
url: z.url().openapi({ example: "https://example.com/file.jpg" }),
|
|
10
|
-
userId: z
|
|
11
|
-
.cuid2()
|
|
12
|
-
.openapi({ example: "u123e4567-e89b-12d3-a456-426614174000" }),
|
|
13
10
|
parentId: z.cuid2().nullable().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
14
11
|
parentType: z
|
|
15
12
|
.enum(ACTIVITY_PARENT_TYPES)
|
|
@@ -57,6 +54,7 @@ export const DeleteFileInputSchema = z.object({
|
|
|
57
54
|
fileId: z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
|
|
58
55
|
key: z.string().optional(),
|
|
59
56
|
});
|
|
57
|
+
|
|
60
58
|
export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
|
|
61
59
|
|
|
62
60
|
export const FileKeySchema = z.object({
|
package/src/schemas/post.ts
CHANGED
|
@@ -110,34 +110,6 @@ export const FeedPostEntitySchema = PostWithFilesEntitySchema.extend({
|
|
|
110
110
|
});
|
|
111
111
|
export type FeedPostEntity = z.infer<typeof FeedPostEntitySchema>;
|
|
112
112
|
|
|
113
|
-
// ─── Interactions ─────────────────────────────────────────────────────────────
|
|
114
|
-
|
|
115
|
-
export const PostWithLikesEntitySchema = MinimalPostSchema.extend({
|
|
116
|
-
likes: z
|
|
117
|
-
.array(
|
|
118
|
-
ActivitySchema.extend({
|
|
119
|
-
followsYou: z.boolean().optional().openapi({ example: true }),
|
|
120
|
-
isFollowing: z.boolean().optional().openapi({ example: false }),
|
|
121
|
-
}),
|
|
122
|
-
)
|
|
123
|
-
.openapi({ example: [] }),
|
|
124
|
-
}).openapi({ title: "PostWithPostLikesEntity" });
|
|
125
|
-
export type PostWithPostLikesEntity = z.infer<typeof PostWithLikesEntitySchema>;
|
|
126
|
-
|
|
127
|
-
export const PostWithCommentsEntitySchema = MinimalPostSchema.extend({
|
|
128
|
-
comments: z.array(CommentEntitySchema).openapi({ example: [] }),
|
|
129
|
-
}).openapi({ title: "PostWithPostCommentsEntity" });
|
|
130
|
-
export type PostWithPostCommentsEntity = z.infer<
|
|
131
|
-
typeof PostWithCommentsEntitySchema
|
|
132
|
-
>;
|
|
133
|
-
|
|
134
|
-
export const PostWithBookmarksEntitySchema = MinimalPostSchema.extend({
|
|
135
|
-
bookmarks: z.array(ActivitySchema).openapi({ example: [] }),
|
|
136
|
-
}).openapi({ title: "PostWithPostBookmarksEntity" });
|
|
137
|
-
export type PostWithPostBookmarksEntity = z.infer<
|
|
138
|
-
typeof PostWithBookmarksEntitySchema
|
|
139
|
-
>;
|
|
140
|
-
|
|
141
113
|
// ─── Inputs ───────────────────────────────────────────────────────────────────
|
|
142
114
|
|
|
143
115
|
export const CreatePostInputSchema = z.object({
|
|
@@ -283,37 +255,6 @@ export const LinkPreviewOutputSchema = z.object({
|
|
|
283
255
|
});
|
|
284
256
|
export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;
|
|
285
257
|
|
|
286
|
-
export const GetPostWithLikesOutputSchema = PostWithLikesEntitySchema.extend({
|
|
287
|
-
nextCursor: z
|
|
288
|
-
.string()
|
|
289
|
-
.optional()
|
|
290
|
-
.nullable()
|
|
291
|
-
.openapi({ example: "ckj1a2b3c0000nxt" }),
|
|
292
|
-
});
|
|
293
|
-
export type GetPostWithLikesOutput = z.infer<
|
|
294
|
-
typeof GetPostWithLikesOutputSchema
|
|
295
|
-
>;
|
|
296
|
-
|
|
297
|
-
export const GetPostWithCommentsOutputSchema =
|
|
298
|
-
PostWithCommentsEntitySchema.extend({
|
|
299
|
-
nextCursor: z
|
|
300
|
-
.string()
|
|
301
|
-
.optional()
|
|
302
|
-
.nullable()
|
|
303
|
-
.openapi({ example: "ckj1a2b3c0000nxt" }),
|
|
304
|
-
});
|
|
305
|
-
export type GetPostWithCommentsOutput = z.infer<
|
|
306
|
-
typeof GetPostWithCommentsOutputSchema
|
|
307
|
-
>;
|
|
308
|
-
|
|
309
|
-
export const GetPostWithBookmarksOutputSchema =
|
|
310
|
-
PostWithBookmarksEntitySchema.extend({
|
|
311
|
-
totalNo: z.number().int().openapi({ example: 42 }),
|
|
312
|
-
});
|
|
313
|
-
export type GetPostWithBookmarksOutput = z.infer<
|
|
314
|
-
typeof GetPostWithBookmarksOutputSchema
|
|
315
|
-
>;
|
|
316
|
-
|
|
317
258
|
export const GetFeedOutputSchema = z.object({
|
|
318
259
|
feed: z.array(FeedPostEntitySchema).openapi({ example: [] }),
|
|
319
260
|
nextCursor: z
|