@zyacreatives/shared 2.0.56 → 2.0.58

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.
@@ -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;
@@ -92,6 +100,10 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
92
100
  }, z.core.$strip>;
93
101
  export declare const CreatePostInputSchema: z.ZodObject<{
94
102
  parentId: z.ZodOptional<z.ZodCUID2>;
103
+ parentType: z.ZodDefault<z.ZodEnum<{
104
+ readonly PROJECT: "PROJECT";
105
+ readonly POST: "POST";
106
+ }>>;
95
107
  content: z.ZodOptional<z.ZodString>;
96
108
  postType: z.ZodDefault<z.ZodEnum<{
97
109
  readonly MARKETPLACE: "MARKETPLACE";
@@ -128,6 +140,10 @@ export declare const CreatePostInputSchema: z.ZodObject<{
128
140
  export declare const CreatePostOutputSchema: z.ZodObject<{
129
141
  id: z.ZodCUID2;
130
142
  parentId: z.ZodOptional<z.ZodCUID2>;
143
+ parentType: z.ZodDefault<z.ZodEnum<{
144
+ readonly PROJECT: "PROJECT";
145
+ readonly POST: "POST";
146
+ }>>;
131
147
  tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
148
  name: z.ZodString;
133
149
  id: z.ZodInt;
@@ -167,6 +183,10 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
167
183
  export declare const GetPostOutputSchema: z.ZodObject<{
168
184
  id: z.ZodCUID2;
169
185
  parentId: z.ZodOptional<z.ZodCUID2>;
186
+ parentType: z.ZodDefault<z.ZodEnum<{
187
+ readonly PROJECT: "PROJECT";
188
+ readonly POST: "POST";
189
+ }>>;
170
190
  tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
171
191
  name: z.ZodString;
172
192
  id: z.ZodInt;
@@ -281,6 +301,10 @@ export declare const LinkPreviewOutputSchema: z.ZodObject<{
281
301
  export declare const FeedPostEntitySchema: z.ZodObject<{
282
302
  id: z.ZodCUID2;
283
303
  parentId: z.ZodOptional<z.ZodCUID2>;
304
+ parentType: z.ZodDefault<z.ZodEnum<{
305
+ readonly PROJECT: "PROJECT";
306
+ readonly POST: "POST";
307
+ }>>;
284
308
  tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
285
309
  name: z.ZodString;
286
310
  id: z.ZodInt;
@@ -349,6 +373,10 @@ export declare const GetFeedOutputSchema: z.ZodObject<{
349
373
  feed: z.ZodArray<z.ZodObject<{
350
374
  id: z.ZodCUID2;
351
375
  parentId: z.ZodOptional<z.ZodCUID2>;
376
+ parentType: z.ZodDefault<z.ZodEnum<{
377
+ readonly PROJECT: "PROJECT";
378
+ readonly POST: "POST";
379
+ }>>;
352
380
  tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
353
381
  name: z.ZodString;
354
382
  id: z.ZodInt;
@@ -420,6 +448,10 @@ export declare const SearchPostOutputSchema: z.ZodObject<{
420
448
  posts: z.ZodArray<z.ZodObject<{
421
449
  id: z.ZodCUID2;
422
450
  parentId: z.ZodOptional<z.ZodCUID2>;
451
+ parentType: z.ZodDefault<z.ZodEnum<{
452
+ readonly PROJECT: "PROJECT";
453
+ readonly POST: "POST";
454
+ }>>;
423
455
  tags: z.ZodOptional<z.ZodArray<z.ZodObject<{
424
456
  name: z.ZodString;
425
457
  id: z.ZodInt;
@@ -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(),
@@ -87,6 +88,7 @@ exports.CreatePostInputSchema = zod_openapi_1.z.object({
87
88
  .cuid2({ message: "Invalid parentId" })
88
89
  .optional()
89
90
  .openapi({ description: "Parent id", example: "ckl1a2b3c0000abc" }),
91
+ parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).default(constants_1.ACTIVITY_PARENT_TYPES.POST),
90
92
  content: zod_openapi_1.z
91
93
  .string()
92
94
  .min(1, { message: "Post content cannot be empty" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.56",
3
+ "version": "2.0.58",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,9 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { POST_BADGE_TYPES, POST_TYPES } from "../constants";
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({
@@ -95,7 +99,7 @@ export const CreatePostInputSchema = z.object({
95
99
  .cuid2({ message: "Invalid parentId" })
96
100
  .optional()
97
101
  .openapi({ description: "Parent id", example: "ckl1a2b3c0000abc" }),
98
-
102
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).default(ACTIVITY_PARENT_TYPES.POST),
99
103
  content: z
100
104
  .string()
101
105
  .min(1, { message: "Post content cannot be empty" })