@zyacreatives/shared 2.0.24 → 2.0.25

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.
@@ -266,3 +266,59 @@ export declare const LinkPreviewOutputSchema: z.ZodObject<{
266
266
  image: z.ZodOptional<z.ZodString>;
267
267
  url: z.ZodOptional<z.ZodString>;
268
268
  }, z.core.$strip>;
269
+ export declare const FeedPostEntitySchema: z.ZodObject<{
270
+ id: z.ZodCUID2;
271
+ parentId: z.ZodOptional<z.ZodCUID2>;
272
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
273
+ badge: z.ZodOptional<z.ZodEnum<{
274
+ readonly NETWORKING: "Networking";
275
+ readonly FUNDING: "Funding";
276
+ readonly COLLABORATION: "Collaboration";
277
+ readonly OPPORTUNITIES: "Opportunities";
278
+ readonly SHOWCASE: "Showcase";
279
+ readonly LEARNING: "Learning";
280
+ readonly DISCUSSION: "Discussion";
281
+ readonly MENTORSHIP: "Mentorship";
282
+ }>>;
283
+ userId: z.ZodCUID2;
284
+ creatorUsername: z.ZodOptional<z.ZodString>;
285
+ creatorFullName: z.ZodOptional<z.ZodString>;
286
+ creatorImageUrl: z.ZodOptional<z.ZodCUID2>;
287
+ content: z.ZodOptional<z.ZodString>;
288
+ postType: z.ZodEnum<{
289
+ readonly MARKETPLACE: "MARKETPLACE";
290
+ readonly PROJECT: "PROJECT";
291
+ readonly JOB_OPENING: "JOB_OPENING";
292
+ readonly DEFAULT_POST: "DEFAULT_POST";
293
+ readonly POST_WITH_LINKS: "POST_WITH_LINKS";
294
+ readonly POST_WITH_MEDIA: "POST_WITH_MEDIA";
295
+ readonly POST_WITH_MEDIA_AND_LINKS: "POST_WITH_MEDIA_AND_LINKS";
296
+ }>;
297
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
298
+ linkMeta: z.ZodOptional<z.ZodObject<{
299
+ url: z.ZodURL;
300
+ title: z.ZodOptional<z.ZodString>;
301
+ description: z.ZodOptional<z.ZodString>;
302
+ image: z.ZodOptional<z.ZodURL>;
303
+ }, z.core.$strip>>;
304
+ postFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
305
+ id: z.ZodString;
306
+ postId: z.ZodString;
307
+ fileId: z.ZodString;
308
+ order: z.ZodNumber;
309
+ url: z.ZodURL;
310
+ }, z.core.$strip>>>;
311
+ stats: {
312
+ updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
313
+ createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
314
+ parentId: z.ZodCUID2;
315
+ parentType: z.ZodEnum<{
316
+ readonly PROJECT: "PROJECT";
317
+ readonly POST: "POST";
318
+ }>;
319
+ likesCount: z.ZodNumber;
320
+ bookmarksCount: z.ZodNumber;
321
+ viewsCount: z.ZodNumber;
322
+ commentsCount: z.ZodNumber;
323
+ };
324
+ }, z.core.$strip>;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LinkPreviewOutputSchema = exports.LinkPreviewInputSchema = exports.PostWithBookmarksEntitySchema = exports.PostWithCommentsEntitySchema = exports.PostWithLikesEntitySchema = exports.MinimalPostSchema = exports.PostIdSchema = exports.GetPostOutputSchema = exports.CreatePostOutputSchema = exports.CreatePostInputSchema = exports.PostWithFilesEntitySchema = exports.PostFileEntitySchema = exports.PostEntitySchema = void 0;
3
+ exports.FeedPostEntitySchema = exports.LinkPreviewOutputSchema = exports.LinkPreviewInputSchema = exports.PostWithBookmarksEntitySchema = exports.PostWithCommentsEntitySchema = exports.PostWithLikesEntitySchema = exports.MinimalPostSchema = exports.PostIdSchema = exports.GetPostOutputSchema = exports.CreatePostOutputSchema = exports.CreatePostInputSchema = exports.PostWithFilesEntitySchema = exports.PostFileEntitySchema = exports.PostEntitySchema = void 0;
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  const file_1 = require("./file");
7
7
  const bookmark_1 = require("./bookmark");
8
8
  const comment_1 = require("./comment");
9
9
  const like_1 = require("./like");
10
+ const entity_stats_1 = require("./entity-stats");
10
11
  exports.PostEntitySchema = zod_openapi_1.z.object({
11
12
  id: zod_openapi_1.z
12
13
  .cuid2()
@@ -147,3 +148,6 @@ exports.LinkPreviewOutputSchema = zod_openapi_1.z.object({
147
148
  image: zod_openapi_1.z.string().optional(),
148
149
  url: zod_openapi_1.z.string().optional(),
149
150
  });
151
+ exports.FeedPostEntitySchema = exports.PostWithFilesEntitySchema.extend({
152
+ stats: entity_stats_1.EntityStatsSchema.shape
153
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreatePostInputSchema, CreatePostOutputSchema, GetPostOutputSchema, LinkPreviewInputSchema, LinkPreviewOutputSchema, PostEntitySchema, PostFileEntitySchema, PostIdSchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema } from "../schemas/post";
2
+ import { CreatePostInputSchema, CreatePostOutputSchema, FeedPostEntitySchema, GetPostOutputSchema, LinkPreviewInputSchema, LinkPreviewOutputSchema, PostEntitySchema, PostFileEntitySchema, PostIdSchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema } from "../schemas/post";
3
3
  export type PostEntity = z.infer<typeof PostEntitySchema>;
4
4
  export type PostFileEntity = z.infer<typeof PostFileEntitySchema>;
5
5
  export type PostWithFilesEntity = z.infer<typeof PostWithFilesEntitySchema>;
@@ -12,3 +12,4 @@ export type PostWithPostCommentsEntity = z.infer<typeof PostWithCommentsEntitySc
12
12
  export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;
13
13
  export type LinkPreviewInput = z.infer<typeof LinkPreviewInputSchema>;
14
14
  export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;
15
+ export type FeedPostEntity = z.infer<typeof FeedPostEntitySchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.0.24",
3
+ "version": "2.0.25",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -4,6 +4,7 @@ import { CreateFileInputSchema, FileEntitySchema } from "./file";
4
4
  import { BookmarkEntitySchema } from "./bookmark";
5
5
  import { CommentEntitySchema } from "./comment";
6
6
  import { LikeEntitySchema } from "./like";
7
+ import { EntityStatsSchema } from "./entity-stats";
7
8
 
8
9
  export const PostEntitySchema = z.object({
9
10
  id: z
@@ -162,3 +163,8 @@ export const LinkPreviewOutputSchema = z.object({
162
163
  image: z.string().optional(),
163
164
  url: z.string().optional(),
164
165
  });
166
+
167
+
168
+ export const FeedPostEntitySchema = PostWithFilesEntitySchema.extend({
169
+ stats: EntityStatsSchema.shape
170
+ })
package/src/types/post.ts CHANGED
@@ -2,6 +2,7 @@ import { z } from "@hono/zod-openapi";
2
2
  import {
3
3
  CreatePostInputSchema,
4
4
  CreatePostOutputSchema,
5
+ FeedPostEntitySchema,
5
6
  GetPostOutputSchema,
6
7
  LinkPreviewInputSchema,
7
8
  LinkPreviewOutputSchema,
@@ -30,3 +31,4 @@ export type PostWithPostCommentsEntity = z.infer<
30
31
  export type GetPostOutput = z.infer<typeof GetPostOutputSchema>;
31
32
  export type LinkPreviewInput = z.infer<typeof LinkPreviewInputSchema>;
32
33
  export type LinkPreviewOutput = z.infer<typeof LinkPreviewOutputSchema>;
34
+ export type FeedPostEntity = z.infer<typeof FeedPostEntitySchema>;