@zyacreatives/shared 2.1.31 → 2.1.32

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.
@@ -14,10 +14,12 @@ export declare const NotificationEntitySchema: z.ZodObject<{
14
14
  readonly SYSTEM_STRIKE: "System Strike";
15
15
  readonly PROJECT_FEATURED: "Project Featured";
16
16
  }>;
17
- parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
18
- parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
19
- [x: string]: string;
20
- }>>>;
17
+ parentId: z.ZodOptional<z.ZodCUID2>;
18
+ parentType: z.ZodEnum<{
19
+ readonly PROJECT: "PROJECT";
20
+ readonly JOB: "JOB";
21
+ readonly POST: "POST";
22
+ }>;
21
23
  isRead: z.ZodDefault<z.ZodBoolean>;
22
24
  createdAt: z.ZodCoercedDate<unknown>;
23
25
  deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -42,10 +44,12 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
42
44
  readonly SYSTEM_STRIKE: "System Strike";
43
45
  readonly PROJECT_FEATURED: "Project Featured";
44
46
  }>;
45
- parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
46
- parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
47
- [x: string]: string;
48
- }>>>;
47
+ parentId: z.ZodOptional<z.ZodCUID2>;
48
+ parentType: z.ZodEnum<{
49
+ readonly PROJECT: "PROJECT";
50
+ readonly JOB: "JOB";
51
+ readonly POST: "POST";
52
+ }>;
49
53
  isRead: z.ZodDefault<z.ZodBoolean>;
50
54
  createdAt: z.ZodCoercedDate<unknown>;
51
55
  deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -84,10 +88,12 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
84
88
  readonly SYSTEM_STRIKE: "System Strike";
85
89
  readonly PROJECT_FEATURED: "Project Featured";
86
90
  }>;
87
- parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
88
- parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
89
- [x: string]: string;
90
- }>>>;
91
+ parentId: z.ZodOptional<z.ZodCUID2>;
92
+ parentType: z.ZodEnum<{
93
+ readonly PROJECT: "PROJECT";
94
+ readonly JOB: "JOB";
95
+ readonly POST: "POST";
96
+ }>;
91
97
  isRead: z.ZodDefault<z.ZodBoolean>;
92
98
  createdAt: z.ZodCoercedDate<unknown>;
93
99
  deletedAt: z.ZodNullable<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
@@ -9,15 +9,10 @@ exports.NotificationEntitySchema = zod_openapi_1.z
9
9
  recipientId: zod_openapi_1.z.cuid2().openapi({ example: "user_recipient_123" }),
10
10
  actorId: zod_openapi_1.z.cuid2().openapi({ example: "user_actor_456" }),
11
11
  type: zod_openapi_1.z.enum(constants_1.NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
12
- parentId: zod_openapi_1.z.cuid2().optional().nullable(),
13
- parentType: zod_openapi_1.z
14
- .enum(Object.values(constants_1.ACTIVITY_PARENT_TYPES))
15
- .optional()
16
- .nullable(),
12
+ parentId: zod_openapi_1.z.cuid2().optional(),
13
+ parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
17
14
  isRead: zod_openapi_1.z.boolean().default(false).openapi({ example: false }),
18
- createdAt: zod_openapi_1.z.coerce
19
- .date()
20
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
15
+ createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
21
16
  deletedAt: zod_openapi_1.z.coerce.date().optional().nullable(),
22
17
  })
23
18
  .openapi("NotificationEntity");
@@ -33,10 +28,7 @@ exports.NotificationDetailsEntitySchema = exports.NotificationEntitySchema.exten
33
28
  });
34
29
  exports.ListNotificationsInputSchema = zod_openapi_1.z
35
30
  .object({
36
- type: zod_openapi_1.z
37
- .enum(constants_1.NOTIFICATION_TYPES)
38
- .openapi({ example: "LIKE" })
39
- .optional(),
31
+ type: zod_openapi_1.z.enum(constants_1.NOTIFICATION_TYPES).openapi({ example: "LIKE" }).optional(),
40
32
  cursor: zod_openapi_1.z.string().optional(),
41
33
  unreadOnly: zod_openapi_1.z
42
34
  .preprocess((val) => val === "true" || val === true, zod_openapi_1.z.boolean())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.1.31",
3
+ "version": "2.1.32",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,60 +2,52 @@ import { z } from "@hono/zod-openapi";
2
2
  import { ACTIVITY_PARENT_TYPES, NOTIFICATION_TYPES } from "../constants";
3
3
 
4
4
  export const NotificationEntitySchema = z
5
- .object({
6
- id: z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
7
- recipientId: z.cuid2().openapi({ example: "user_recipient_123" }),
8
- actorId: z.cuid2().openapi({ example: "user_actor_456" }),
9
- type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
10
- parentId: z.cuid2().optional().nullable(),
11
- parentType: z
12
- .enum(Object.values(ACTIVITY_PARENT_TYPES) as [string, ...string[]])
13
- .optional()
14
- .nullable(),
15
- isRead: z.boolean().default(false).openapi({ example: false }),
16
- createdAt: z.coerce
17
- .date()
18
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
19
- deletedAt: z.coerce.date().optional().nullable(),
20
- })
21
- .openapi("NotificationEntity");
5
+ .object({
6
+ id: z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
7
+ recipientId: z.cuid2().openapi({ example: "user_recipient_123" }),
8
+ actorId: z.cuid2().openapi({ example: "user_actor_456" }),
9
+ type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
10
+ parentId: z.cuid2().optional(),
11
+ parentType: z.enum(ACTIVITY_PARENT_TYPES),
12
+ isRead: z.boolean().default(false).openapi({ example: false }),
13
+ createdAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
14
+ deletedAt: z.coerce.date().optional().nullable(),
15
+ })
16
+ .openapi("NotificationEntity");
22
17
 
23
18
  export const MinimalNotificationEntitySchema = z.object({
24
- id: z.cuid2(),
25
- recipientId: z.cuid2(),
26
- actorId: z.cuid2(),
19
+ id: z.cuid2(),
20
+ recipientId: z.cuid2(),
21
+ actorId: z.cuid2(),
27
22
  });
28
23
 
29
24
  export const NotificationDetailsEntitySchema = NotificationEntitySchema.extend({
30
- itemTitle: z.string().optional(),
31
- itemContent: z.string().optional(),
32
- itemImgUrl: z.string().optional(),
25
+ itemTitle: z.string().optional(),
26
+ itemContent: z.string().optional(),
27
+ itemImgUrl: z.string().optional(),
33
28
  });
34
29
 
35
30
  export const ListNotificationsInputSchema = z
36
- .object({
37
- type: z
38
- .enum(NOTIFICATION_TYPES)
39
- .openapi({ example: "LIKE" })
40
- .optional(),
41
- cursor: z.string().optional(),
42
- unreadOnly: z
43
- .preprocess((val) => val === "true" || val === true, z.boolean())
44
- .optional()
45
- .default(false),
46
- })
47
- .openapi("ListNotificationsInput");
31
+ .object({
32
+ type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }).optional(),
33
+ cursor: z.string().optional(),
34
+ unreadOnly: z
35
+ .preprocess((val) => val === "true" || val === true, z.boolean())
36
+ .optional()
37
+ .default(false),
38
+ })
39
+ .openapi("ListNotificationsInput");
48
40
 
49
41
  export const ListNotificationsOutputSchema = z.object({
50
- notifications: z.array(NotificationDetailsEntitySchema),
51
- nextCursor: z.string().optional().nullable(),
52
- unreadCount: z.number().int().openapi({ example: 5 }),
42
+ notifications: z.array(NotificationDetailsEntitySchema),
43
+ nextCursor: z.string().optional().nullable(),
44
+ unreadCount: z.number().int().openapi({ example: 5 }),
53
45
  });
54
46
 
55
47
  export const MarkReadInputSchema = z.object({
56
- notificationIds: z.array(z.cuid2()).min(1),
48
+ notificationIds: z.array(z.cuid2()).min(1),
57
49
  });
58
50
 
59
51
  export const NotificationCountOutputSchema = z.object({
60
- unreadCount: z.number().int().openapi({ example: 12 }),
52
+ unreadCount: z.number().int().openapi({ example: 12 }),
61
53
  });