@zyacreatives/shared 2.1.49 → 2.1.50

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.
@@ -0,0 +1,15 @@
1
+ import z from "zod";
2
+ export declare const ActivitySchema: z.ZodObject<{
3
+ activityId: z.ZodCUID2;
4
+ activityType: z.ZodEnum<{
5
+ readonly LIKE: "LIKE";
6
+ readonly UNLIKE: "UNLIKE";
7
+ readonly BOOKMARK: "BOOKMARK";
8
+ readonly UNBOOKMARK: "UNBOOKMARK";
9
+ readonly VIEW: "VIEW";
10
+ }>;
11
+ actorName: z.ZodString;
12
+ actorId: z.ZodString;
13
+ actorUsername: z.ZodString;
14
+ actorImageUrl: z.ZodOptional<z.ZodURL>;
15
+ }, z.core.$strip>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ActivitySchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const constants_1 = require("../constants");
9
+ exports.ActivitySchema = zod_1.default.object({
10
+ activityId: zod_1.default.cuid2().openapi({
11
+ description: "Unique identifier for the bookmarked entity.",
12
+ title: "Entity ID",
13
+ }),
14
+ activityType: zod_1.default.enum(constants_1.ACTIVITY_TYPES),
15
+ actorName: zod_1.default.string(),
16
+ actorId: zod_1.default.string(),
17
+ actorUsername: zod_1.default.string(),
18
+ actorImageUrl: zod_1.default.url().optional(),
19
+ });
@@ -264,19 +264,21 @@ 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
- id: z.ZodCUID2;
268
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
269
- userId: z.ZodCUID2;
270
- parentId: z.ZodCUID2;
271
- parentType: z.ZodEnum<{
272
- readonly PROJECT: "PROJECT";
273
- readonly USER: "USER";
274
- readonly JOB: "JOB";
275
- readonly POST: "POST";
276
- readonly COMMENT: "COMMENT";
277
- readonly JOB_APPLICATION: "JOB_APPLICATION";
267
+ activityId: z.ZodCUID2;
268
+ activityType: z.ZodEnum<{
269
+ readonly LIKE: "LIKE";
270
+ readonly UNLIKE: "UNLIKE";
271
+ readonly BOOKMARK: "BOOKMARK";
272
+ readonly UNBOOKMARK: "UNBOOKMARK";
273
+ readonly VIEW: "VIEW";
278
274
  }>;
275
+ actorName: z.ZodString;
276
+ actorId: z.ZodString;
277
+ actorUsername: z.ZodString;
278
+ actorImageUrl: z.ZodOptional<z.ZodURL>;
279
279
  }, z.core.$strip>>;
280
+ totalFetched: z.ZodNumber;
281
+ totalNo: z.ZodNumber;
280
282
  }, z.core.$strip>;
281
283
  export declare const PostWithCommentsEntitySchema: z.ZodObject<{
282
284
  id: z.ZodCUID2;
@@ -308,19 +310,21 @@ export declare const PostWithBookmarksEntitySchema: z.ZodObject<{
308
310
  parentId: z.ZodOptional<z.ZodCUID2>;
309
311
  content: z.ZodOptional<z.ZodString>;
310
312
  bookmarks: z.ZodArray<z.ZodObject<{
311
- id: z.ZodCUID2;
312
- createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
313
- userId: z.ZodCUID2;
314
- parentId: z.ZodCUID2;
315
- parentType: z.ZodEnum<{
316
- readonly PROJECT: "PROJECT";
317
- readonly USER: "USER";
318
- readonly JOB: "JOB";
319
- readonly POST: "POST";
320
- readonly COMMENT: "COMMENT";
321
- readonly JOB_APPLICATION: "JOB_APPLICATION";
313
+ activityId: z.ZodCUID2;
314
+ activityType: z.ZodEnum<{
315
+ readonly LIKE: "LIKE";
316
+ readonly UNLIKE: "UNLIKE";
317
+ readonly BOOKMARK: "BOOKMARK";
318
+ readonly UNBOOKMARK: "UNBOOKMARK";
319
+ readonly VIEW: "VIEW";
322
320
  }>;
321
+ actorName: z.ZodString;
322
+ actorId: z.ZodString;
323
+ actorUsername: z.ZodString;
324
+ actorImageUrl: z.ZodOptional<z.ZodURL>;
323
325
  }, z.core.$strip>>;
326
+ totalFetched: z.ZodNumber;
327
+ totalNo: z.ZodNumber;
324
328
  }, z.core.$strip>;
325
329
  export declare const LinkPreviewInputSchema: z.ZodObject<{
326
330
  url: z.ZodString;
@@ -4,10 +4,9 @@ exports.SearchPostOutputSchema = exports.SearchPostInputSchema = exports.GetFeed
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
- const bookmark_1 = require("./bookmark");
8
7
  const comment_1 = require("./comment");
9
- const like_1 = require("./like");
10
8
  const entity_stats_1 = require("./entity-stats");
9
+ const activity_1 = require("./activity");
11
10
  exports.PostEntitySchema = zod_openapi_1.z.object({
12
11
  id: zod_openapi_1.z
13
12
  .cuid2()
@@ -151,7 +150,9 @@ exports.MinimalPostSchema = exports.PostEntitySchema.pick({
151
150
  content: true,
152
151
  });
153
152
  exports.PostWithLikesEntitySchema = exports.MinimalPostSchema.extend({
154
- likes: zod_openapi_1.z.array(like_1.LikeEntitySchema),
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(),
155
156
  }).openapi({
156
157
  title: "PostWithPostLikesEntity",
157
158
  });
@@ -161,7 +162,9 @@ exports.PostWithCommentsEntitySchema = exports.MinimalPostSchema.extend({
161
162
  title: "PostWithPostCommentsEntity",
162
163
  });
163
164
  exports.PostWithBookmarksEntitySchema = exports.MinimalPostSchema.extend({
164
- bookmarks: zod_openapi_1.z.array(bookmark_1.BookmarkEntitySchema),
165
+ bookmarks: zod_openapi_1.z.array(activity_1.ActivitySchema),
166
+ totalFetched: zod_openapi_1.z.number().int(),
167
+ totalNo: zod_openapi_1.z.number().int(),
165
168
  }).openapi({
166
169
  title: "PostWithPostBookmarksEntity",
167
170
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.1.49",
3
+ "version": "2.1.50",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,14 @@
1
+ import z from "zod";
2
+ import { ACTIVITY_TYPES } from "../constants";
3
+
4
+ export const ActivitySchema = z.object({
5
+ activityId: z.cuid2().openapi({
6
+ description: "Unique identifier for the bookmarked entity.",
7
+ title: "Entity ID",
8
+ }),
9
+ activityType: z.enum(ACTIVITY_TYPES),
10
+ actorName: z.string(),
11
+ actorId: z.string(),
12
+ actorUsername: z.string(),
13
+ actorImageUrl: z.url().optional(),
14
+ });
@@ -9,6 +9,7 @@ import { BookmarkEntitySchema } from "./bookmark";
9
9
  import { CommentEntitySchema } from "./comment";
10
10
  import { LikeEntitySchema } from "./like";
11
11
  import { EntityStatsSchema } from "./entity-stats";
12
+ import { ActivitySchema } from "./activity";
12
13
 
13
14
  export const PostEntitySchema = z.object({
14
15
  id: z
@@ -170,7 +171,9 @@ export const MinimalPostSchema = PostEntitySchema.pick({
170
171
  });
171
172
 
172
173
  export const PostWithLikesEntitySchema = MinimalPostSchema.extend({
173
- likes: z.array(LikeEntitySchema),
174
+ likes: z.array(ActivitySchema),
175
+ totalFetched: z.number().int(),
176
+ totalNo: z.number().int(),
174
177
  }).openapi({
175
178
  title: "PostWithPostLikesEntity",
176
179
  });
@@ -182,7 +185,9 @@ export const PostWithCommentsEntitySchema = MinimalPostSchema.extend({
182
185
  });
183
186
 
184
187
  export const PostWithBookmarksEntitySchema = MinimalPostSchema.extend({
185
- bookmarks: z.array(BookmarkEntitySchema),
188
+ bookmarks: z.array(ActivitySchema),
189
+ totalFetched: z.number().int(),
190
+ totalNo: z.number().int(),
186
191
  }).openapi({
187
192
  title: "PostWithPostBookmarksEntity",
188
193
  });