@zyacreatives/shared 1.8.9 → 1.9.1

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.
@@ -89,6 +89,7 @@ export declare const POST_TYPES: {
89
89
  readonly PROJECT: "PROJECT";
90
90
  readonly JOB_OPENING: "JOB_OPENING";
91
91
  readonly DEFAULT_POST: "DEFAULT_POST";
92
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
92
93
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
93
94
  };
94
95
  export type Role = (typeof ROLES)[keyof typeof ROLES];
package/dist/constants.js CHANGED
@@ -92,6 +92,7 @@ exports.POST_TYPES = {
92
92
  PROJECT: "PROJECT",
93
93
  JOB_OPENING: "JOB_OPENING",
94
94
  DEFAULT_POST: "DEFAULT_POST",
95
+ POST_WITH_LINKS: "POST_WITH_LINKS",
95
96
  POST_WITH_MEDIA: "POST_WITH_MEDIA",
96
97
  };
97
98
  exports.API_ROUTES = {
@@ -9,15 +9,22 @@ export declare const PostEntitySchema: z.ZodObject<{
9
9
  creatorFullName: z.ZodOptional<z.ZodString>;
10
10
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
11
11
  content: z.ZodString;
12
- title: z.ZodNullable<z.ZodString>;
12
+ title: z.ZodOptional<z.ZodString>;
13
13
  postType: z.ZodEnum<{
14
14
  readonly MARKETPLACE: "MARKETPLACE";
15
15
  readonly PROJECT: "PROJECT";
16
16
  readonly JOB_OPENING: "JOB_OPENING";
17
17
  readonly DEFAULT_POST: "DEFAULT_POST";
18
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
18
19
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
19
20
  }>;
20
21
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
22
+ linkMeta: z.ZodOptional<z.ZodObject<{
23
+ url: z.ZodURL;
24
+ title: z.ZodOptional<z.ZodString>;
25
+ description: z.ZodOptional<z.ZodString>;
26
+ image: z.ZodOptional<z.ZodURL>;
27
+ }, z.core.$strip>>;
21
28
  }, z.core.$strip>;
22
29
  export declare const PostFileEntitySchema: z.ZodObject<{
23
30
  id: z.ZodString;
@@ -35,15 +42,22 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
35
42
  creatorFullName: z.ZodOptional<z.ZodString>;
36
43
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
37
44
  content: z.ZodString;
38
- title: z.ZodNullable<z.ZodString>;
45
+ title: z.ZodOptional<z.ZodString>;
39
46
  postType: z.ZodEnum<{
40
47
  readonly MARKETPLACE: "MARKETPLACE";
41
48
  readonly PROJECT: "PROJECT";
42
49
  readonly JOB_OPENING: "JOB_OPENING";
43
50
  readonly DEFAULT_POST: "DEFAULT_POST";
51
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
44
52
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
45
53
  }>;
46
54
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
55
+ linkMeta: z.ZodOptional<z.ZodObject<{
56
+ url: z.ZodURL;
57
+ title: z.ZodOptional<z.ZodString>;
58
+ description: z.ZodOptional<z.ZodString>;
59
+ image: z.ZodOptional<z.ZodURL>;
60
+ }, z.core.$strip>>;
47
61
  postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
48
62
  id: z.ZodString;
49
63
  postId: z.ZodString;
@@ -61,6 +75,7 @@ export declare const CreatePostInputSchema: z.ZodObject<{
61
75
  readonly PROJECT: "PROJECT";
62
76
  readonly JOB_OPENING: "JOB_OPENING";
63
77
  readonly DEFAULT_POST: "DEFAULT_POST";
78
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
64
79
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
65
80
  }>>;
66
81
  files: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -81,15 +96,22 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
81
96
  creatorFullName: z.ZodOptional<z.ZodString>;
82
97
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
83
98
  content: z.ZodString;
84
- title: z.ZodNullable<z.ZodString>;
99
+ title: z.ZodOptional<z.ZodString>;
85
100
  postType: z.ZodEnum<{
86
101
  readonly MARKETPLACE: "MARKETPLACE";
87
102
  readonly PROJECT: "PROJECT";
88
103
  readonly JOB_OPENING: "JOB_OPENING";
89
104
  readonly DEFAULT_POST: "DEFAULT_POST";
105
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
90
106
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
91
107
  }>;
92
108
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
109
+ linkMeta: z.ZodOptional<z.ZodObject<{
110
+ url: z.ZodURL;
111
+ title: z.ZodOptional<z.ZodString>;
112
+ description: z.ZodOptional<z.ZodString>;
113
+ image: z.ZodOptional<z.ZodURL>;
114
+ }, z.core.$strip>>;
93
115
  }, z.core.$strip>;
94
116
  export declare const GetPostOutputSchema: z.ZodObject<{
95
117
  id: z.ZodCUID2;
@@ -101,15 +123,22 @@ export declare const GetPostOutputSchema: z.ZodObject<{
101
123
  creatorFullName: z.ZodOptional<z.ZodString>;
102
124
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
103
125
  content: z.ZodString;
104
- title: z.ZodNullable<z.ZodString>;
126
+ title: z.ZodOptional<z.ZodString>;
105
127
  postType: z.ZodEnum<{
106
128
  readonly MARKETPLACE: "MARKETPLACE";
107
129
  readonly PROJECT: "PROJECT";
108
130
  readonly JOB_OPENING: "JOB_OPENING";
109
131
  readonly DEFAULT_POST: "DEFAULT_POST";
132
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
110
133
  readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
111
134
  }>;
112
135
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
136
+ linkMeta: z.ZodOptional<z.ZodObject<{
137
+ url: z.ZodURL;
138
+ title: z.ZodOptional<z.ZodString>;
139
+ description: z.ZodOptional<z.ZodString>;
140
+ image: z.ZodOptional<z.ZodURL>;
141
+ }, z.core.$strip>>;
113
142
  postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
143
  id: z.ZodString;
115
144
  postId: z.ZodString;
@@ -123,13 +152,13 @@ export declare const PostIdSchema: z.ZodObject<{
123
152
  }, z.core.$strip>;
124
153
  export declare const MinimalPostSchema: z.ZodObject<{
125
154
  id: z.ZodCUID2;
126
- title: z.ZodNullable<z.ZodString>;
155
+ title: z.ZodOptional<z.ZodString>;
127
156
  parentId: z.ZodOptional<z.ZodCUID2>;
128
157
  content: z.ZodString;
129
158
  }, z.core.$strip>;
130
159
  export declare const PostWithLikesEntitySchema: z.ZodObject<{
131
160
  id: z.ZodCUID2;
132
- title: z.ZodNullable<z.ZodString>;
161
+ title: z.ZodOptional<z.ZodString>;
133
162
  parentId: z.ZodOptional<z.ZodCUID2>;
134
163
  content: z.ZodString;
135
164
  likes: z.ZodArray<z.ZodObject<{
@@ -145,7 +174,7 @@ export declare const PostWithLikesEntitySchema: z.ZodObject<{
145
174
  }, z.core.$strip>;
146
175
  export declare const PostWithCommentsEntitySchema: z.ZodObject<{
147
176
  id: z.ZodCUID2;
148
- title: z.ZodNullable<z.ZodString>;
177
+ title: z.ZodOptional<z.ZodString>;
149
178
  parentId: z.ZodOptional<z.ZodCUID2>;
150
179
  content: z.ZodString;
151
180
  comments: z.ZodArray<z.ZodObject<{
@@ -167,7 +196,7 @@ export declare const PostWithCommentsEntitySchema: z.ZodObject<{
167
196
  }, z.core.$strip>;
168
197
  export declare const PostWithBookmarksEntitySchema: z.ZodObject<{
169
198
  id: z.ZodCUID2;
170
- title: z.ZodNullable<z.ZodString>;
199
+ title: z.ZodOptional<z.ZodString>;
171
200
  parentId: z.ZodOptional<z.ZodCUID2>;
172
201
  content: z.ZodString;
173
202
  bookmarks: z.ZodArray<z.ZodObject<{
@@ -28,13 +28,30 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
28
28
  .openapi({ description: "Post content", example: "Hello world" }),
29
29
  title: zod_openapi_1.z
30
30
  .string()
31
- .nullable()
31
+ .optional()
32
32
  .openapi({ description: "Optional title", example: "My first post" }),
33
33
  postType: zod_openapi_1.z.enum(constants_1.POST_TYPES).openapi({
34
34
  description: "Type of the post entity this statistic belongs to.",
35
35
  title: "Post Type",
36
36
  }),
37
37
  createdAt: zod_openapi_1.z.coerce.date().optional(),
38
+ linkMeta: zod_openapi_1.z
39
+ .object({
40
+ url: zod_openapi_1.z.url(),
41
+ title: zod_openapi_1.z.string().optional(),
42
+ description: zod_openapi_1.z.string().optional(),
43
+ image: zod_openapi_1.z.url().optional(),
44
+ })
45
+ .optional()
46
+ .openapi({
47
+ description: "Optional metadata for a single link in the post",
48
+ example: {
49
+ url: "https://example.com",
50
+ title: "Example Website",
51
+ description: "This is an example link",
52
+ image: "https://example.com/preview.jpg",
53
+ },
54
+ }),
38
55
  });
39
56
  exports.PostFileEntitySchema = zod_openapi_1.z
40
57
  .object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.8.9",
3
+ "version": "1.9.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -100,6 +100,7 @@ export const POST_TYPES = {
100
100
  PROJECT: "PROJECT",
101
101
  JOB_OPENING: "JOB_OPENING",
102
102
  DEFAULT_POST: "DEFAULT_POST",
103
+ POST_WITH_LINKS: "POST_WITH_LINKS",
103
104
  POST_WITH_MEDIA: "POST_WITH_MEDIA",
104
105
  } as const;
105
106
 
@@ -9,30 +9,56 @@ export const PostEntitySchema = z.object({
9
9
  id: z
10
10
  .cuid2()
11
11
  .openapi({ description: "Post id", example: "ckj1a2b3c0000xyz" }),
12
+
12
13
  parentId: z
13
14
  .cuid2()
14
15
  .optional()
15
16
  .openapi({ description: "Parent id", example: "ckj1a2b3c0000abc" }),
17
+
16
18
  tags: z.array(z.string()).optional(),
17
19
  badge: z.string().optional(),
20
+
18
21
  userId: z
19
22
  .cuid2()
20
23
  .openapi({ description: "User id", example: "ckj1a2b3c0000def" }),
24
+
21
25
  creatorUsername: z.string().optional().openapi({ description: "Username" }),
22
26
  creatorFullName: z.string().optional(),
23
27
  creatorImageUrl: z.cuid2().optional().openapi({ description: "Username" }),
28
+
24
29
  content: z
25
30
  .string()
26
31
  .openapi({ description: "Post content", example: "Hello world" }),
32
+
27
33
  title: z
28
34
  .string()
29
- .nullable()
35
+ .optional()
30
36
  .openapi({ description: "Optional title", example: "My first post" }),
37
+
31
38
  postType: z.enum(POST_TYPES).openapi({
32
39
  description: "Type of the post entity this statistic belongs to.",
33
40
  title: "Post Type",
34
41
  }),
42
+
35
43
  createdAt: z.coerce.date().optional(),
44
+
45
+ linkMeta: z
46
+ .object({
47
+ url: z.url(),
48
+ title: z.string().optional(),
49
+ description: z.string().optional(),
50
+ image: z.url().optional(),
51
+ })
52
+ .optional()
53
+ .openapi({
54
+ description: "Optional metadata for a single link in the post",
55
+ example: {
56
+ url: "https://example.com",
57
+ title: "Example Website",
58
+ description: "This is an example link",
59
+ image: "https://example.com/preview.jpg",
60
+ },
61
+ }),
36
62
  });
37
63
 
38
64
  export const PostFileEntitySchema = z