@zyacreatives/shared 2.0.56 → 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 +28 -0
- package/dist/schemas/post.js +1 -0
- package/package.json +1 -1
- package/src/schemas/post.ts +6 -2
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;
|
|
@@ -420,6 +444,10 @@ 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(),
|
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({
|