@zyacreatives/shared 2.0.55 → 2.0.57
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/post.d.ts +29 -1
- package/dist/schemas/post.js +2 -1
- package/package.json +1 -1
- package/src/schemas/post.ts +7 -3
package/dist/schemas/post.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ import { z } from "@hono/zod-openapi";
|
|
|
2
2
|
export declare const PostEntitySchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodCUID2;
|
|
4
4
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
5
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
readonly PROJECT: "PROJECT";
|
|
7
|
+
readonly POST: "POST";
|
|
8
|
+
}>>;
|
|
5
9
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
6
10
|
name: z.ZodString;
|
|
7
11
|
id: z.ZodInt;
|
|
@@ -47,6 +51,10 @@ export declare const PostFileEntitySchema: z.ZodObject<{
|
|
|
47
51
|
export declare const PostWithFilesEntitySchema: z.ZodObject<{
|
|
48
52
|
id: z.ZodCUID2;
|
|
49
53
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
54
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
55
|
+
readonly PROJECT: "PROJECT";
|
|
56
|
+
readonly POST: "POST";
|
|
57
|
+
}>>;
|
|
50
58
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
51
59
|
name: z.ZodString;
|
|
52
60
|
id: z.ZodInt;
|
|
@@ -128,6 +136,10 @@ export declare const CreatePostInputSchema: z.ZodObject<{
|
|
|
128
136
|
export declare const CreatePostOutputSchema: z.ZodObject<{
|
|
129
137
|
id: z.ZodCUID2;
|
|
130
138
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
139
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
140
|
+
readonly PROJECT: "PROJECT";
|
|
141
|
+
readonly POST: "POST";
|
|
142
|
+
}>>;
|
|
131
143
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
132
144
|
name: z.ZodString;
|
|
133
145
|
id: z.ZodInt;
|
|
@@ -167,6 +179,10 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
|
|
|
167
179
|
export declare const GetPostOutputSchema: z.ZodObject<{
|
|
168
180
|
id: z.ZodCUID2;
|
|
169
181
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
182
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
183
|
+
readonly PROJECT: "PROJECT";
|
|
184
|
+
readonly POST: "POST";
|
|
185
|
+
}>>;
|
|
170
186
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
187
|
name: z.ZodString;
|
|
172
188
|
id: z.ZodInt;
|
|
@@ -281,6 +297,10 @@ export declare const LinkPreviewOutputSchema: z.ZodObject<{
|
|
|
281
297
|
export declare const FeedPostEntitySchema: z.ZodObject<{
|
|
282
298
|
id: z.ZodCUID2;
|
|
283
299
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
300
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
301
|
+
readonly PROJECT: "PROJECT";
|
|
302
|
+
readonly POST: "POST";
|
|
303
|
+
}>>;
|
|
284
304
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
285
305
|
name: z.ZodString;
|
|
286
306
|
id: z.ZodInt;
|
|
@@ -349,6 +369,10 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
|
349
369
|
feed: z.ZodArray<z.ZodObject<{
|
|
350
370
|
id: z.ZodCUID2;
|
|
351
371
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
372
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
373
|
+
readonly PROJECT: "PROJECT";
|
|
374
|
+
readonly POST: "POST";
|
|
375
|
+
}>>;
|
|
352
376
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
353
377
|
name: z.ZodString;
|
|
354
378
|
id: z.ZodInt;
|
|
@@ -413,13 +437,17 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
|
|
|
413
437
|
}, z.core.$strip>;
|
|
414
438
|
export declare const SearchPostInputSchema: z.ZodObject<{
|
|
415
439
|
string: z.ZodString;
|
|
416
|
-
limit: z.ZodDefault<z.
|
|
440
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
417
441
|
cursor: z.ZodOptional<z.ZodString>;
|
|
418
442
|
}, z.core.$strip>;
|
|
419
443
|
export declare const SearchPostOutputSchema: z.ZodObject<{
|
|
420
444
|
posts: z.ZodArray<z.ZodObject<{
|
|
421
445
|
id: z.ZodCUID2;
|
|
422
446
|
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
447
|
+
parentType: z.ZodDefault<z.ZodEnum<{
|
|
448
|
+
readonly PROJECT: "PROJECT";
|
|
449
|
+
readonly POST: "POST";
|
|
450
|
+
}>>;
|
|
423
451
|
tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
424
452
|
name: z.ZodString;
|
|
425
453
|
id: z.ZodInt;
|
package/dist/schemas/post.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
|
|
|
16
16
|
.cuid2()
|
|
17
17
|
.optional()
|
|
18
18
|
.openapi({ description: "Parent id", example: "ckj1a2b3c0000abc" }),
|
|
19
|
+
parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).default(constants_1.ACTIVITY_PARENT_TYPES.POST),
|
|
19
20
|
tags: zod_openapi_1.z
|
|
20
21
|
.array(zod_openapi_1.z.object({
|
|
21
22
|
name: zod_openapi_1.z.string(),
|
|
@@ -193,7 +194,7 @@ exports.SearchPostInputSchema = zod_openapi_1.z.object({
|
|
|
193
194
|
.string()
|
|
194
195
|
.min(1, { message: "Search string cannot be empty" })
|
|
195
196
|
.max(200, { message: "Search string cannot exceed 200 characters" }),
|
|
196
|
-
limit: zod_openapi_1.z
|
|
197
|
+
limit: zod_openapi_1.z.coerce
|
|
197
198
|
.number()
|
|
198
199
|
.int({ message: "Limit must be an integer" })
|
|
199
200
|
.min(1, { message: "Limit must be at least 1" })
|
package/package.json
CHANGED
package/src/schemas/post.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ACTIVITY_PARENT_TYPES,
|
|
4
|
+
POST_BADGE_TYPES,
|
|
5
|
+
POST_TYPES,
|
|
6
|
+
} from "../constants";
|
|
3
7
|
import { CreateFileInputSchema, FileEntitySchema } from "./file";
|
|
4
8
|
import { BookmarkEntitySchema } from "./bookmark";
|
|
5
9
|
import { CommentEntitySchema } from "./comment";
|
|
@@ -14,7 +18,7 @@ export const PostEntitySchema = z.object({
|
|
|
14
18
|
.cuid2()
|
|
15
19
|
.optional()
|
|
16
20
|
.openapi({ description: "Parent id", example: "ckj1a2b3c0000abc" }),
|
|
17
|
-
|
|
21
|
+
parentType: z.enum(ACTIVITY_PARENT_TYPES).default(ACTIVITY_PARENT_TYPES.POST),
|
|
18
22
|
tags: z
|
|
19
23
|
.array(
|
|
20
24
|
z.object({
|
|
@@ -219,7 +223,7 @@ export const SearchPostInputSchema = z.object({
|
|
|
219
223
|
.string()
|
|
220
224
|
.min(1, { message: "Search string cannot be empty" })
|
|
221
225
|
.max(200, { message: "Search string cannot exceed 200 characters" }),
|
|
222
|
-
limit: z
|
|
226
|
+
limit: z.coerce
|
|
223
227
|
.number()
|
|
224
228
|
.int({ message: "Limit must be an integer" })
|
|
225
229
|
.min(1, { message: "Limit must be at least 1" })
|