@zyacreatives/shared 2.4.0 → 2.4.2
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/common.d.ts +4 -0
- package/dist/schemas/post.d.ts +9 -0
- package/dist/schemas/post.js +19 -13
- package/dist/schemas/user.d.ts +3 -0
- package/package.json +1 -1
- package/src/schemas/common.ts +4 -0
- package/src/schemas/post.ts +19 -29
package/dist/schemas/common.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export declare const EntityCommentsOutputSchema: z.ZodObject<{
|
|
|
53
53
|
}, z.core.$strip>>;
|
|
54
54
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
55
55
|
}, z.core.$strip>;
|
|
56
|
+
export type EntityCommentsOutput = z.infer<typeof EntityCommentsOutputSchema>;
|
|
56
57
|
export declare const EntityLikesOutputSchema: z.ZodObject<{
|
|
57
58
|
likes: z.ZodArray<z.ZodObject<{
|
|
58
59
|
id: z.ZodCUID2;
|
|
@@ -72,6 +73,7 @@ export declare const EntityLikesOutputSchema: z.ZodObject<{
|
|
|
72
73
|
}, z.core.$strip>>;
|
|
73
74
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
74
75
|
}, z.core.$strip>;
|
|
76
|
+
export type EntityLikesOutput = z.infer<typeof EntityLikesOutputSchema>;
|
|
75
77
|
export declare const EntityBookmarksOutputSchema: z.ZodObject<{
|
|
76
78
|
bookmarks: z.ZodArray<z.ZodObject<{
|
|
77
79
|
id: z.ZodCUID2;
|
|
@@ -91,6 +93,7 @@ export declare const EntityBookmarksOutputSchema: z.ZodObject<{
|
|
|
91
93
|
}, z.core.$strip>>;
|
|
92
94
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
93
95
|
}, z.core.$strip>;
|
|
96
|
+
export type EntityBookmarksOutput = z.infer<typeof EntityBookmarksOutputSchema>;
|
|
94
97
|
export declare const EntityRepliesOutputSchema: z.ZodObject<{
|
|
95
98
|
replies: z.ZodArray<z.ZodObject<{
|
|
96
99
|
id: z.ZodCUID2;
|
|
@@ -110,3 +113,4 @@ export declare const EntityRepliesOutputSchema: z.ZodObject<{
|
|
|
110
113
|
}, z.core.$strip>>;
|
|
111
114
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
112
115
|
}, z.core.$strip>;
|
|
116
|
+
export type EntityRepliesOutput = z.infer<typeof EntityRepliesOutputSchema>;
|
package/dist/schemas/post.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export declare const PostEntitySchema: z.ZodObject<{
|
|
|
15
15
|
name: z.ZodString;
|
|
16
16
|
id: z.ZodInt;
|
|
17
17
|
}, z.core.$strip>>>;
|
|
18
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
19
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
19
20
|
readonly NETWORKING: "Networking";
|
|
20
21
|
readonly FUNDING: "Funding";
|
|
@@ -64,6 +65,7 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
|
|
|
64
65
|
name: z.ZodString;
|
|
65
66
|
id: z.ZodInt;
|
|
66
67
|
}, z.core.$strip>>>;
|
|
68
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
69
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
68
70
|
readonly NETWORKING: "Networking";
|
|
69
71
|
readonly FUNDING: "Funding";
|
|
@@ -139,6 +141,7 @@ export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
|
139
141
|
name: z.ZodString;
|
|
140
142
|
id: z.ZodInt;
|
|
141
143
|
}, z.core.$strip>>>;
|
|
144
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
145
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
143
146
|
readonly NETWORKING: "Networking";
|
|
144
147
|
readonly FUNDING: "Funding";
|
|
@@ -254,6 +257,7 @@ export declare const CreatePostInputSchema: z.ZodObject<{
|
|
|
254
257
|
isThumbnail: z.ZodOptional<z.ZodBoolean>;
|
|
255
258
|
}, z.core.$strip>>>;
|
|
256
259
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodCUID2>>;
|
|
257
261
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
258
262
|
readonly NETWORKING: "Networking";
|
|
259
263
|
readonly FUNDING: "Funding";
|
|
@@ -310,6 +314,7 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
|
|
|
310
314
|
name: z.ZodString;
|
|
311
315
|
id: z.ZodInt;
|
|
312
316
|
}, z.core.$strip>>>;
|
|
317
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
313
318
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
314
319
|
readonly NETWORKING: "Networking";
|
|
315
320
|
readonly FUNDING: "Funding";
|
|
@@ -359,6 +364,7 @@ export declare const GetPostOutputSchema: z.ZodObject<{
|
|
|
359
364
|
name: z.ZodString;
|
|
360
365
|
id: z.ZodInt;
|
|
361
366
|
}, z.core.$strip>>>;
|
|
367
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
362
368
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
363
369
|
readonly NETWORKING: "Networking";
|
|
364
370
|
readonly FUNDING: "Funding";
|
|
@@ -437,6 +443,7 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
|
437
443
|
name: z.ZodString;
|
|
438
444
|
id: z.ZodInt;
|
|
439
445
|
}, z.core.$strip>>>;
|
|
446
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
440
447
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
441
448
|
readonly NETWORKING: "Networking";
|
|
442
449
|
readonly FUNDING: "Funding";
|
|
@@ -532,6 +539,7 @@ export declare const SearchPostOutputSchema: z.ZodObject<{
|
|
|
532
539
|
name: z.ZodString;
|
|
533
540
|
id: z.ZodInt;
|
|
534
541
|
}, z.core.$strip>>>;
|
|
542
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
535
543
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
536
544
|
readonly NETWORKING: "Networking";
|
|
537
545
|
readonly FUNDING: "Funding";
|
|
@@ -713,6 +721,7 @@ export declare const PostSearchDocumentSchema: z.ZodObject<{
|
|
|
713
721
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
714
722
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
715
723
|
}, z.core.$strip>>>;
|
|
724
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodCUID2>>;
|
|
716
725
|
createdAt: z.ZodNullable<z.ZodString>;
|
|
717
726
|
}, z.core.$strip>;
|
|
718
727
|
export type PostSearchDocument = z.infer<typeof PostSearchDocumentSchema>;
|
package/dist/schemas/post.js
CHANGED
|
@@ -25,6 +25,10 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
|
|
|
25
25
|
}))
|
|
26
26
|
.optional()
|
|
27
27
|
.openapi({ example: [{ name: "javascript", id: 101 }] }),
|
|
28
|
+
mentions: zod_openapi_1.z
|
|
29
|
+
.array(zod_openapi_1.z.string())
|
|
30
|
+
.optional()
|
|
31
|
+
.openapi({ example: ["cuid123", "cuid456"] }),
|
|
28
32
|
badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional().openapi({ example: "FEATURED" }),
|
|
29
33
|
userId: zod_openapi_1.z
|
|
30
34
|
.cuid2()
|
|
@@ -75,12 +79,11 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
|
|
|
75
79
|
description: "Optional metadata for a single link in the post",
|
|
76
80
|
}),
|
|
77
81
|
});
|
|
78
|
-
// ─── Composed ─────────────────────────────────────────────────────────────────
|
|
79
82
|
exports.PostWithFilesEntitySchema = exports.PostEntitySchema.extend({
|
|
80
|
-
files: zod_openapi_1.z
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
files: zod_openapi_1.z
|
|
84
|
+
.array(file_1.FileEntitySchema)
|
|
85
|
+
.optional()
|
|
86
|
+
.openapi({ description: "Files attached to the post", example: [] }),
|
|
84
87
|
});
|
|
85
88
|
exports.MinimalPostSchema = exports.PostEntitySchema.pick({
|
|
86
89
|
id: true,
|
|
@@ -94,7 +97,6 @@ exports.FeedPostEntitySchema = exports.PostWithFilesEntitySchema.extend({
|
|
|
94
97
|
isFollowing: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
|
|
95
98
|
isBookmarked: zod_openapi_1.z.boolean().optional().openapi({ example: false }),
|
|
96
99
|
});
|
|
97
|
-
// ─── Inputs ───────────────────────────────────────────────────────────────────
|
|
98
100
|
exports.CreatePostInputSchema = zod_openapi_1.z.object({
|
|
99
101
|
id: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
100
102
|
parentId: zod_openapi_1.z
|
|
@@ -140,13 +142,15 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
|
|
|
140
142
|
],
|
|
141
143
|
}),
|
|
142
144
|
tags: zod_openapi_1.z
|
|
143
|
-
.array(zod_openapi_1.z
|
|
144
|
-
.string()
|
|
145
|
-
.min(1, { message: "Tag cannot be empty" })
|
|
146
|
-
.openapi({ example: "react" }))
|
|
145
|
+
.array(zod_openapi_1.z.string().min(1, { message: "Tag cannot be empty" }))
|
|
147
146
|
.max(3, { message: "Cannot add more than 3 tags" })
|
|
148
147
|
.optional()
|
|
149
148
|
.openapi({ example: ["react", "frontend"] }),
|
|
149
|
+
mentions: zod_openapi_1.z
|
|
150
|
+
.array(zod_openapi_1.z.cuid2())
|
|
151
|
+
.max(15, { message: "Cannot mention more than 15 users" })
|
|
152
|
+
.optional()
|
|
153
|
+
.openapi({ example: ["cuid123"] }),
|
|
150
154
|
badge: zod_openapi_1.z.enum(constants_1.POST_BADGE_TYPES).optional().openapi({ example: "TRENDING" }),
|
|
151
155
|
linkMeta: zod_openapi_1.z
|
|
152
156
|
.object({
|
|
@@ -197,7 +201,6 @@ exports.SearchPostInputSchema = zod_openapi_1.z.object({
|
|
|
197
201
|
.openapi({ example: "typescript utility types" }),
|
|
198
202
|
cursor: zod_openapi_1.z.string().optional().openapi({ example: "ckj1a2b3c0000cur" }),
|
|
199
203
|
});
|
|
200
|
-
// ─── Outputs ──────────────────────────────────────────────────────────────────
|
|
201
204
|
exports.CreatePostOutputSchema = exports.PostEntitySchema;
|
|
202
205
|
exports.GetPostOutputSchema = exports.PostWithFilesEntitySchema;
|
|
203
206
|
exports.LinkPreviewOutputSchema = zod_openapi_1.z.object({
|
|
@@ -231,7 +234,6 @@ exports.SearchPostOutputSchema = zod_openapi_1.z.object({
|
|
|
231
234
|
.nullable()
|
|
232
235
|
.openapi({ example: "ckj1a2b3c0000nxt" }),
|
|
233
236
|
});
|
|
234
|
-
// ─── Analytics ────────────────────────────────────────────────────────────────
|
|
235
237
|
const AnalyticsChartItemSchema = zod_openapi_1.z.object({
|
|
236
238
|
x: zod_openapi_1.z.string().openapi({ example: "2026-03-11" }),
|
|
237
239
|
y: zod_openapi_1.z.number().openapi({ example: 150 }),
|
|
@@ -270,7 +272,6 @@ exports.PostAnalyticsOutputSchema = zod_openapi_1.z.object({
|
|
|
270
272
|
}),
|
|
271
273
|
}),
|
|
272
274
|
});
|
|
273
|
-
// ─── Search Index ─────────────────────────────────────────────────────────────
|
|
274
275
|
exports.PostSearchDocumentSchema = zod_openapi_1.z
|
|
275
276
|
.object({
|
|
276
277
|
id: zod_openapi_1.z.cuid2().openapi({ example: "ckj1a2b3c0000doc" }),
|
|
@@ -305,6 +306,11 @@ exports.PostSearchDocumentSchema = zod_openapi_1.z
|
|
|
305
306
|
.nullable()
|
|
306
307
|
.openapi({ example: "https://github.com/image.png" }),
|
|
307
308
|
files: zod_openapi_1.z.array(file_1.FileEntitySchema).nullable().openapi({ example: [] }),
|
|
309
|
+
mentions: zod_openapi_1.z
|
|
310
|
+
.array(zod_openapi_1.z.cuid2())
|
|
311
|
+
.max(15, { message: "Cannot mention more than 15 users" })
|
|
312
|
+
.optional()
|
|
313
|
+
.openapi({ example: ["cuid123"] }),
|
|
308
314
|
createdAt: zod_openapi_1.z
|
|
309
315
|
.string()
|
|
310
316
|
.nullable()
|
package/dist/schemas/user.d.ts
CHANGED
|
@@ -305,6 +305,7 @@ export declare const UserWithPostsEntitySchema: z.ZodObject<{
|
|
|
305
305
|
name: z.ZodString;
|
|
306
306
|
id: z.ZodInt;
|
|
307
307
|
}, z.core.$strip>>>;
|
|
308
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
308
309
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
309
310
|
readonly NETWORKING: "Networking";
|
|
310
311
|
readonly FUNDING: "Funding";
|
|
@@ -610,6 +611,7 @@ export declare const UserWithPostBookmarksEntitySchema: z.ZodObject<{
|
|
|
610
611
|
name: z.ZodString;
|
|
611
612
|
id: z.ZodInt;
|
|
612
613
|
}, z.core.$strip>>>;
|
|
614
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
613
615
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
614
616
|
readonly NETWORKING: "Networking";
|
|
615
617
|
readonly FUNDING: "Funding";
|
|
@@ -920,6 +922,7 @@ export declare const GetUserWithPostBookmarksOutputSchema: z.ZodObject<{
|
|
|
920
922
|
name: z.ZodString;
|
|
921
923
|
id: z.ZodInt;
|
|
922
924
|
}, z.core.$strip>>>;
|
|
925
|
+
mentions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
923
926
|
badge: z.ZodOptional<z.ZodEnum<{
|
|
924
927
|
readonly NETWORKING: "Networking";
|
|
925
928
|
readonly FUNDING: "Funding";
|
package/package.json
CHANGED
package/src/schemas/common.ts
CHANGED
|
@@ -32,18 +32,22 @@ export const EntityCommentsOutputSchema = z.object({
|
|
|
32
32
|
comments: z.array(CommentEntitySchema),
|
|
33
33
|
nextCursor: z.string().nullable(),
|
|
34
34
|
});
|
|
35
|
+
export type EntityCommentsOutput = z.infer<typeof EntityCommentsOutputSchema>;
|
|
35
36
|
|
|
36
37
|
export const EntityLikesOutputSchema = z.object({
|
|
37
38
|
likes: z.array(ActivitySchema),
|
|
38
39
|
nextCursor: z.string().nullable(),
|
|
39
40
|
});
|
|
41
|
+
export type EntityLikesOutput = z.infer<typeof EntityLikesOutputSchema>;
|
|
40
42
|
|
|
41
43
|
export const EntityBookmarksOutputSchema = z.object({
|
|
42
44
|
bookmarks: z.array(ActivitySchema),
|
|
43
45
|
nextCursor: z.string().nullable(),
|
|
44
46
|
});
|
|
47
|
+
export type EntityBookmarksOutput = z.infer<typeof EntityBookmarksOutputSchema>;
|
|
45
48
|
|
|
46
49
|
export const EntityRepliesOutputSchema = z.object({
|
|
47
50
|
replies: z.array(ActivitySchema),
|
|
48
51
|
nextCursor: z.string().nullable(),
|
|
49
52
|
});
|
|
53
|
+
export type EntityRepliesOutput = z.infer<typeof EntityRepliesOutputSchema>;
|
package/src/schemas/post.ts
CHANGED
|
@@ -31,6 +31,10 @@ export const PostEntitySchema = z.object({
|
|
|
31
31
|
)
|
|
32
32
|
.optional()
|
|
33
33
|
.openapi({ example: [{ name: "javascript", id: 101 }] }),
|
|
34
|
+
mentions: z
|
|
35
|
+
.array(z.string())
|
|
36
|
+
.optional()
|
|
37
|
+
.openapi({ example: ["cuid123", "cuid456"] }),
|
|
34
38
|
badge: z.enum(POST_BADGE_TYPES).optional().openapi({ example: "FEATURED" }),
|
|
35
39
|
userId: z
|
|
36
40
|
.cuid2()
|
|
@@ -85,13 +89,11 @@ export const PostEntitySchema = z.object({
|
|
|
85
89
|
});
|
|
86
90
|
export type PostEntity = z.infer<typeof PostEntitySchema>;
|
|
87
91
|
|
|
88
|
-
// ─── Composed ─────────────────────────────────────────────────────────────────
|
|
89
|
-
|
|
90
92
|
export const PostWithFilesEntitySchema = PostEntitySchema.extend({
|
|
91
|
-
files: z
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
files: z
|
|
94
|
+
.array(FileEntitySchema)
|
|
95
|
+
.optional()
|
|
96
|
+
.openapi({ description: "Files attached to the post", example: [] }),
|
|
95
97
|
});
|
|
96
98
|
export type PostWithFilesEntity = z.infer<typeof PostWithFilesEntitySchema>;
|
|
97
99
|
|
|
@@ -110,8 +112,6 @@ export const FeedPostEntitySchema = PostWithFilesEntitySchema.extend({
|
|
|
110
112
|
});
|
|
111
113
|
export type FeedPostEntity = z.infer<typeof FeedPostEntitySchema>;
|
|
112
114
|
|
|
113
|
-
// ─── Inputs ───────────────────────────────────────────────────────────────────
|
|
114
|
-
|
|
115
115
|
export const CreatePostInputSchema = z.object({
|
|
116
116
|
id: z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
117
117
|
parentId: z
|
|
@@ -159,15 +159,15 @@ export const CreatePostInputSchema = z.object({
|
|
|
159
159
|
],
|
|
160
160
|
}),
|
|
161
161
|
tags: z
|
|
162
|
-
.array(
|
|
163
|
-
z
|
|
164
|
-
.string()
|
|
165
|
-
.min(1, { message: "Tag cannot be empty" })
|
|
166
|
-
.openapi({ example: "react" }),
|
|
167
|
-
)
|
|
162
|
+
.array(z.string().min(1, { message: "Tag cannot be empty" }))
|
|
168
163
|
.max(3, { message: "Cannot add more than 3 tags" })
|
|
169
164
|
.optional()
|
|
170
165
|
.openapi({ example: ["react", "frontend"] }),
|
|
166
|
+
mentions: z
|
|
167
|
+
.array(z.cuid2())
|
|
168
|
+
.max(15, { message: "Cannot mention more than 15 users" })
|
|
169
|
+
.optional()
|
|
170
|
+
.openapi({ example: ["cuid123"] }),
|
|
171
171
|
badge: z.enum(POST_BADGE_TYPES).optional().openapi({ example: "TRENDING" }),
|
|
172
172
|
linkMeta: z
|
|
173
173
|
.object({
|
|
@@ -200,12 +200,10 @@ export const PostIdSchema = z.object({
|
|
|
200
200
|
postId: z.cuid2().openapi({ example: "ckj1a2b3c0000xyz" }),
|
|
201
201
|
});
|
|
202
202
|
export type PostIdInput = z.infer<typeof PostIdSchema>;
|
|
203
|
-
|
|
204
203
|
export const LinkPreviewInputSchema = z.object({
|
|
205
204
|
url: z.url().openapi({ example: "https://example.com/article" }),
|
|
206
205
|
});
|
|
207
206
|
export type LinkPreviewInput = z.infer<typeof LinkPreviewInputSchema>;
|
|
208
|
-
|
|
209
207
|
export const ReportPostInputSchema = z.object({
|
|
210
208
|
complaint: z
|
|
211
209
|
.string()
|
|
@@ -213,13 +211,11 @@ export const ReportPostInputSchema = z.object({
|
|
|
213
211
|
.openapi({ example: "This post contains spam." }),
|
|
214
212
|
});
|
|
215
213
|
export type ReportPostInput = z.infer<typeof ReportPostInputSchema>;
|
|
216
|
-
|
|
217
214
|
export const GetFeedInputSchema = z.object({
|
|
218
215
|
limit: z.number().int().optional().openapi({ example: 20 }),
|
|
219
216
|
cursor: z.string().optional().openapi({ example: "ckj1a2b3c0000cur" }),
|
|
220
217
|
});
|
|
221
218
|
export type GetFeedInput = z.infer<typeof GetFeedInputSchema>;
|
|
222
|
-
|
|
223
219
|
export const SearchPostInputSchema = z.object({
|
|
224
220
|
queryString: z
|
|
225
221
|
.string()
|
|
@@ -230,14 +226,10 @@ export const SearchPostInputSchema = z.object({
|
|
|
230
226
|
});
|
|
231
227
|
export type SearchPostInput = z.infer<typeof SearchPostInputSchema>;
|
|
232
228
|
|
|
233
|
-
// ─── Outputs ──────────────────────────────────────────────────────────────────
|
|
234
|
-
|
|
235
229
|
export const CreatePostOutputSchema = PostEntitySchema;
|
|
236
230
|
export type CreatePostOutput = z.infer<typeof CreatePostOutputSchema>;
|
|
237
|
-
|
|
238
231
|
export const GetPostOutputSchema = PostWithFilesEntitySchema;
|
|
239
232
|
export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;
|
|
240
|
-
|
|
241
233
|
export const LinkPreviewOutputSchema = z.object({
|
|
242
234
|
title: z.string().openapi({ example: "Great Article" }),
|
|
243
235
|
description: z
|
|
@@ -254,7 +246,6 @@ export const LinkPreviewOutputSchema = z.object({
|
|
|
254
246
|
.openapi({ example: "https://example.com/article" }),
|
|
255
247
|
});
|
|
256
248
|
export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;
|
|
257
|
-
|
|
258
249
|
export const GetFeedOutputSchema = z.object({
|
|
259
250
|
feed: z.array(FeedPostEntitySchema).openapi({ example: [] }),
|
|
260
251
|
nextCursor: z
|
|
@@ -264,7 +255,6 @@ export const GetFeedOutputSchema = z.object({
|
|
|
264
255
|
.openapi({ example: "ckj1a2b3c0000nxt" }),
|
|
265
256
|
});
|
|
266
257
|
export type GetFeedOutput = z.infer<typeof GetFeedOutputSchema>;
|
|
267
|
-
|
|
268
258
|
export const SearchPostOutputSchema = z.object({
|
|
269
259
|
posts: z.array(FeedPostEntitySchema).openapi({ example: [] }),
|
|
270
260
|
nextCursor: z
|
|
@@ -275,13 +265,10 @@ export const SearchPostOutputSchema = z.object({
|
|
|
275
265
|
});
|
|
276
266
|
export type SearchPostOutput = z.infer<typeof SearchPostOutputSchema>;
|
|
277
267
|
|
|
278
|
-
// ─── Analytics ────────────────────────────────────────────────────────────────
|
|
279
|
-
|
|
280
268
|
const AnalyticsChartItemSchema = z.object({
|
|
281
269
|
x: z.string().openapi({ example: "2026-03-11" }),
|
|
282
270
|
y: z.number().openapi({ example: 150 }),
|
|
283
271
|
});
|
|
284
|
-
|
|
285
272
|
export const PostAnalyticsOutputSchema = z.object({
|
|
286
273
|
awareness: z.object({
|
|
287
274
|
reach: z.number().openapi({ example: 5000 }),
|
|
@@ -318,8 +305,6 @@ export const PostAnalyticsOutputSchema = z.object({
|
|
|
318
305
|
});
|
|
319
306
|
export type PostAnalyticsOutput = z.infer<typeof PostAnalyticsOutputSchema>;
|
|
320
307
|
|
|
321
|
-
// ─── Search Index ─────────────────────────────────────────────────────────────
|
|
322
|
-
|
|
323
308
|
export const PostSearchDocumentSchema = z
|
|
324
309
|
.object({
|
|
325
310
|
id: z.cuid2().openapi({ example: "ckj1a2b3c0000doc" }),
|
|
@@ -354,6 +339,11 @@ export const PostSearchDocumentSchema = z
|
|
|
354
339
|
.nullable()
|
|
355
340
|
.openapi({ example: "https://github.com/image.png" }),
|
|
356
341
|
files: z.array(FileEntitySchema).nullable().openapi({ example: [] }),
|
|
342
|
+
mentions: z
|
|
343
|
+
.array(z.cuid2())
|
|
344
|
+
.max(15, { message: "Cannot mention more than 15 users" })
|
|
345
|
+
.optional()
|
|
346
|
+
.openapi({ example: ["cuid123"] }),
|
|
357
347
|
createdAt: z
|
|
358
348
|
.string()
|
|
359
349
|
.nullable()
|