@zyacreatives/shared 2.1.50 → 2.1.52

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.
@@ -1,7 +1,7 @@
1
1
  import z from "zod";
2
2
  export declare const ActivitySchema: z.ZodObject<{
3
- activityId: z.ZodCUID2;
4
- activityType: z.ZodEnum<{
3
+ id: z.ZodCUID2;
4
+ type: z.ZodEnum<{
5
5
  readonly LIKE: "LIKE";
6
6
  readonly UNLIKE: "UNLIKE";
7
7
  readonly BOOKMARK: "BOOKMARK";
@@ -7,11 +7,11 @@ exports.ActivitySchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  const constants_1 = require("../constants");
9
9
  exports.ActivitySchema = zod_1.default.object({
10
- activityId: zod_1.default.cuid2().openapi({
10
+ id: zod_1.default.cuid2().openapi({
11
11
  description: "Unique identifier for the bookmarked entity.",
12
12
  title: "Entity ID",
13
13
  }),
14
- activityType: zod_1.default.enum(constants_1.ACTIVITY_TYPES),
14
+ type: zod_1.default.enum(constants_1.ACTIVITY_TYPES),
15
15
  actorName: zod_1.default.string(),
16
16
  actorId: zod_1.default.string(),
17
17
  actorUsername: zod_1.default.string(),
@@ -264,8 +264,27 @@ export declare const PostWithLikesEntitySchema: z.ZodObject<{
264
264
  parentId: z.ZodOptional<z.ZodCUID2>;
265
265
  content: z.ZodOptional<z.ZodString>;
266
266
  likes: z.ZodArray<z.ZodObject<{
267
- activityId: z.ZodCUID2;
268
- activityType: z.ZodEnum<{
267
+ id: z.ZodCUID2;
268
+ type: z.ZodEnum<{
269
+ readonly LIKE: "LIKE";
270
+ readonly UNLIKE: "UNLIKE";
271
+ readonly BOOKMARK: "BOOKMARK";
272
+ readonly UNBOOKMARK: "UNBOOKMARK";
273
+ readonly VIEW: "VIEW";
274
+ }>;
275
+ actorName: z.ZodString;
276
+ actorId: z.ZodString;
277
+ actorUsername: z.ZodString;
278
+ actorImageUrl: z.ZodOptional<z.ZodURL>;
279
+ }, z.core.$strip>>;
280
+ }, z.core.$strip>;
281
+ export declare const GetPostWithLikesOutputSchema: z.ZodObject<{
282
+ id: z.ZodCUID2;
283
+ parentId: z.ZodOptional<z.ZodCUID2>;
284
+ content: z.ZodOptional<z.ZodString>;
285
+ likes: z.ZodArray<z.ZodObject<{
286
+ id: z.ZodCUID2;
287
+ type: z.ZodEnum<{
269
288
  readonly LIKE: "LIKE";
270
289
  readonly UNLIKE: "UNLIKE";
271
290
  readonly BOOKMARK: "BOOKMARK";
@@ -310,8 +329,8 @@ export declare const PostWithBookmarksEntitySchema: z.ZodObject<{
310
329
  parentId: z.ZodOptional<z.ZodCUID2>;
311
330
  content: z.ZodOptional<z.ZodString>;
312
331
  bookmarks: z.ZodArray<z.ZodObject<{
313
- activityId: z.ZodCUID2;
314
- activityType: z.ZodEnum<{
332
+ id: z.ZodCUID2;
333
+ type: z.ZodEnum<{
315
334
  readonly LIKE: "LIKE";
316
335
  readonly UNLIKE: "UNLIKE";
317
336
  readonly BOOKMARK: "BOOKMARK";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SearchPostOutputSchema = exports.SearchPostInputSchema = exports.GetFeedOutputSchema = exports.GetFeedInputSchema = 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;
3
+ exports.SearchPostOutputSchema = exports.SearchPostInputSchema = exports.GetFeedOutputSchema = exports.GetFeedInputSchema = exports.FeedPostEntitySchema = exports.LinkPreviewOutputSchema = exports.LinkPreviewInputSchema = exports.PostWithBookmarksEntitySchema = exports.PostWithCommentsEntitySchema = exports.GetPostWithLikesOutputSchema = 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");
@@ -151,11 +151,13 @@ exports.MinimalPostSchema = exports.PostEntitySchema.pick({
151
151
  });
152
152
  exports.PostWithLikesEntitySchema = exports.MinimalPostSchema.extend({
153
153
  likes: zod_openapi_1.z.array(activity_1.ActivitySchema),
154
- totalFetched: zod_openapi_1.z.number().int(),
155
- totalNo: zod_openapi_1.z.number().int(),
156
154
  }).openapi({
157
155
  title: "PostWithPostLikesEntity",
158
156
  });
157
+ exports.GetPostWithLikesOutputSchema = exports.PostWithLikesEntitySchema.extend({
158
+ totalFetched: zod_openapi_1.z.number().int(),
159
+ totalNo: zod_openapi_1.z.number().int(),
160
+ });
159
161
  exports.PostWithCommentsEntitySchema = exports.MinimalPostSchema.extend({
160
162
  comments: zod_openapi_1.z.array(comment_1.CommentEntitySchema),
161
163
  }).openapi({
@@ -1,5 +1,5 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { CreatePostInputSchema, CreatePostOutputSchema, FeedPostEntitySchema, GetFeedInputSchema, GetFeedOutputSchema, GetPostOutputSchema, LinkPreviewInputSchema, LinkPreviewOutputSchema, PostEntitySchema, PostFileEntitySchema, PostIdSchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema, SearchPostInputSchema, SearchPostOutputSchema } from "../schemas/post";
2
+ import { CreatePostInputSchema, CreatePostOutputSchema, FeedPostEntitySchema, GetFeedInputSchema, GetFeedOutputSchema, GetPostOutputSchema, GetPostWithLikesOutputSchema, LinkPreviewInputSchema, LinkPreviewOutputSchema, PostEntitySchema, PostFileEntitySchema, PostIdSchema, PostWithBookmarksEntitySchema, PostWithCommentsEntitySchema, PostWithFilesEntitySchema, PostWithLikesEntitySchema, SearchPostInputSchema, SearchPostOutputSchema } 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>;
@@ -17,3 +17,4 @@ export type GetFeedInput = z.infer<typeof GetFeedInputSchema>;
17
17
  export type GetFeedOutput = z.infer<typeof GetFeedOutputSchema>;
18
18
  export type SearchPostInput = z.infer<typeof SearchPostInputSchema>;
19
19
  export type SearchPostOutput = z.infer<typeof SearchPostOutputSchema>;
20
+ export type GetPostWithLikesOutput = z.infer<typeof GetPostWithLikesOutputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.1.50",
3
+ "version": "2.1.52",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,11 +2,11 @@ import z from "zod";
2
2
  import { ACTIVITY_TYPES } from "../constants";
3
3
 
4
4
  export const ActivitySchema = z.object({
5
- activityId: z.cuid2().openapi({
5
+ id: z.cuid2().openapi({
6
6
  description: "Unique identifier for the bookmarked entity.",
7
7
  title: "Entity ID",
8
8
  }),
9
- activityType: z.enum(ACTIVITY_TYPES),
9
+ type: z.enum(ACTIVITY_TYPES),
10
10
  actorName: z.string(),
11
11
  actorId: z.string(),
12
12
  actorUsername: z.string(),
@@ -172,12 +172,15 @@ export const MinimalPostSchema = PostEntitySchema.pick({
172
172
 
173
173
  export const PostWithLikesEntitySchema = MinimalPostSchema.extend({
174
174
  likes: z.array(ActivitySchema),
175
- totalFetched: z.number().int(),
176
- totalNo: z.number().int(),
177
175
  }).openapi({
178
176
  title: "PostWithPostLikesEntity",
179
177
  });
180
178
 
179
+ export const GetPostWithLikesOutputSchema = PostWithLikesEntitySchema.extend({
180
+ totalFetched: z.number().int(),
181
+ totalNo: z.number().int(),
182
+ });
183
+
181
184
  export const PostWithCommentsEntitySchema = MinimalPostSchema.extend({
182
185
  comments: z.array(CommentEntitySchema),
183
186
  }).openapi({
package/src/types/post.ts CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  GetFeedInputSchema,
7
7
  GetFeedOutputSchema,
8
8
  GetPostOutputSchema,
9
+ GetPostWithLikesOutputSchema,
9
10
  LinkPreviewInputSchema,
10
11
  LinkPreviewOutputSchema,
11
12
  PostEntitySchema,
@@ -41,3 +42,7 @@ export type GetFeedOutput = z.infer<typeof GetFeedOutputSchema>;
41
42
 
42
43
  export type SearchPostInput = z.infer<typeof SearchPostInputSchema>;
43
44
  export type SearchPostOutput = z.infer<typeof SearchPostOutputSchema>;
45
+
46
+ export type GetPostWithLikesOutput = z.infer<
47
+ typeof GetPostWithLikesOutputSchema
48
+ >;