@zyacreatives/shared 1.8.8 → 1.9.0

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 = {
@@ -5,7 +5,7 @@ export declare const PostEntitySchema: z.ZodObject<{
5
5
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
6
  badge: z.ZodOptional<z.ZodString>;
7
7
  userId: z.ZodCUID2;
8
- creatorUsername: z.ZodString;
8
+ creatorUsername: z.ZodOptional<z.ZodString>;
9
9
  creatorFullName: z.ZodOptional<z.ZodString>;
10
10
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
11
11
  content: z.ZodString;
@@ -15,9 +15,16 @@ export declare const PostEntitySchema: z.ZodObject<{
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;
@@ -31,7 +38,7 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
31
38
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
39
  badge: z.ZodOptional<z.ZodString>;
33
40
  userId: z.ZodCUID2;
34
- creatorUsername: z.ZodString;
41
+ creatorUsername: z.ZodOptional<z.ZodString>;
35
42
  creatorFullName: z.ZodOptional<z.ZodString>;
36
43
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
37
44
  content: z.ZodString;
@@ -41,9 +48,16 @@ export declare const PostWithFilesEntitySchema: z.ZodObject<{
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<{
@@ -77,7 +92,7 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
77
92
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
93
  badge: z.ZodOptional<z.ZodString>;
79
94
  userId: z.ZodCUID2;
80
- creatorUsername: z.ZodString;
95
+ creatorUsername: z.ZodOptional<z.ZodString>;
81
96
  creatorFullName: z.ZodOptional<z.ZodString>;
82
97
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
83
98
  content: z.ZodString;
@@ -87,9 +102,16 @@ export declare const CreatePostOutputSchema: z.ZodObject<{
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;
@@ -97,7 +119,7 @@ export declare const GetPostOutputSchema: z.ZodObject<{
97
119
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
120
  badge: z.ZodOptional<z.ZodString>;
99
121
  userId: z.ZodCUID2;
100
- creatorUsername: z.ZodString;
122
+ creatorUsername: z.ZodOptional<z.ZodString>;
101
123
  creatorFullName: z.ZodOptional<z.ZodString>;
102
124
  creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
103
125
  content: z.ZodString;
@@ -107,9 +129,16 @@ export declare const GetPostOutputSchema: z.ZodObject<{
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;
@@ -20,7 +20,7 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
20
20
  userId: zod_openapi_1.z
21
21
  .cuid2()
22
22
  .openapi({ description: "User id", example: "ckj1a2b3c0000def" }),
23
- creatorUsername: zod_openapi_1.z.string().openapi({ description: "Username" }),
23
+ creatorUsername: zod_openapi_1.z.string().optional().openapi({ description: "Username" }),
24
24
  creatorFullName: zod_openapi_1.z.string().optional(),
25
25
  creatorImageUrl: zod_openapi_1.z.cuid2().optional().openapi({ description: "Username" }),
26
26
  content: zod_openapi_1.z
@@ -35,6 +35,23 @@ exports.PostEntitySchema = zod_openapi_1.z.object({
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.8",
3
+ "version": "1.9.0",
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" }),
21
- creatorUsername: z.string().openapi({ description: "Username" }),
24
+
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
35
  .nullable()
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