@zyacreatives/shared 2.1.38 → 2.1.40

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,8 +1,8 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  export declare const NotificationEntitySchema: z.ZodObject<{
3
- id: z.ZodString;
4
- recipientId: z.ZodString;
5
- actorId: z.ZodString;
3
+ id: z.ZodCUID2;
4
+ recipientId: z.ZodCUID2;
5
+ actorId: z.ZodCUID2;
6
6
  type: z.ZodEnum<{
7
7
  readonly FOLLOW: "Follow";
8
8
  readonly LIKE: "Like";
@@ -15,16 +15,8 @@ export declare const NotificationEntitySchema: z.ZodObject<{
15
15
  readonly SYSTEM_STRIKE: "System Strike";
16
16
  readonly PROJECT_FEATURED: "Project Featured";
17
17
  }>;
18
- entityId: z.ZodString;
19
- entityType: z.ZodEnum<{
20
- readonly PROJECT: "PROJECT";
21
- readonly USER: "USER";
22
- readonly JOB: "JOB";
23
- readonly POST: "POST";
24
- readonly COMMENT: "COMMENT";
25
- readonly JOB_APPLICATION: "JOB_APPLICATION";
26
- }>;
27
- parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
18
+ entityId: z.ZodOptional<z.ZodCUID2>;
19
+ parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
28
20
  parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
29
21
  readonly PROJECT: "PROJECT";
30
22
  readonly USER: "USER";
@@ -33,7 +25,7 @@ export declare const NotificationEntitySchema: z.ZodObject<{
33
25
  readonly COMMENT: "COMMENT";
34
26
  readonly JOB_APPLICATION: "JOB_APPLICATION";
35
27
  }>>>;
36
- rootId: z.ZodString;
28
+ rootId: z.ZodCUID2;
37
29
  rootType: z.ZodEnum<{
38
30
  readonly PROJECT: "PROJECT";
39
31
  readonly USER: "USER";
@@ -52,9 +44,9 @@ export declare const MinimalNotificationEntitySchema: z.ZodObject<{
52
44
  actorId: z.ZodCUID2;
53
45
  }, z.core.$strip>;
54
46
  export declare const NotificationDetailsEntitySchema: z.ZodObject<{
55
- id: z.ZodString;
56
- recipientId: z.ZodString;
57
- actorId: z.ZodString;
47
+ id: z.ZodCUID2;
48
+ recipientId: z.ZodCUID2;
49
+ actorId: z.ZodCUID2;
58
50
  type: z.ZodEnum<{
59
51
  readonly FOLLOW: "Follow";
60
52
  readonly LIKE: "Like";
@@ -67,16 +59,8 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
67
59
  readonly SYSTEM_STRIKE: "System Strike";
68
60
  readonly PROJECT_FEATURED: "Project Featured";
69
61
  }>;
70
- entityId: z.ZodString;
71
- entityType: z.ZodEnum<{
72
- readonly PROJECT: "PROJECT";
73
- readonly USER: "USER";
74
- readonly JOB: "JOB";
75
- readonly POST: "POST";
76
- readonly COMMENT: "COMMENT";
77
- readonly JOB_APPLICATION: "JOB_APPLICATION";
78
- }>;
79
- parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
62
+ entityId: z.ZodOptional<z.ZodCUID2>;
63
+ parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
80
64
  parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
81
65
  readonly PROJECT: "PROJECT";
82
66
  readonly USER: "USER";
@@ -85,7 +69,7 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
85
69
  readonly COMMENT: "COMMENT";
86
70
  readonly JOB_APPLICATION: "JOB_APPLICATION";
87
71
  }>>>;
88
- rootId: z.ZodString;
72
+ rootId: z.ZodCUID2;
89
73
  rootType: z.ZodEnum<{
90
74
  readonly PROJECT: "PROJECT";
91
75
  readonly USER: "USER";
@@ -120,9 +104,9 @@ export declare const ListNotificationsInputSchema: z.ZodObject<{
120
104
  }, z.core.$strip>;
121
105
  export declare const ListNotificationsOutputSchema: z.ZodObject<{
122
106
  notifications: z.ZodArray<z.ZodObject<{
123
- id: z.ZodString;
124
- recipientId: z.ZodString;
125
- actorId: z.ZodString;
107
+ id: z.ZodCUID2;
108
+ recipientId: z.ZodCUID2;
109
+ actorId: z.ZodCUID2;
126
110
  type: z.ZodEnum<{
127
111
  readonly FOLLOW: "Follow";
128
112
  readonly LIKE: "Like";
@@ -135,16 +119,8 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
135
119
  readonly SYSTEM_STRIKE: "System Strike";
136
120
  readonly PROJECT_FEATURED: "Project Featured";
137
121
  }>;
138
- entityId: z.ZodString;
139
- entityType: z.ZodEnum<{
140
- readonly PROJECT: "PROJECT";
141
- readonly USER: "USER";
142
- readonly JOB: "JOB";
143
- readonly POST: "POST";
144
- readonly COMMENT: "COMMENT";
145
- readonly JOB_APPLICATION: "JOB_APPLICATION";
146
- }>;
147
- parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
122
+ entityId: z.ZodOptional<z.ZodCUID2>;
123
+ parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
148
124
  parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
149
125
  readonly PROJECT: "PROJECT";
150
126
  readonly USER: "USER";
@@ -153,7 +129,7 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
153
129
  readonly COMMENT: "COMMENT";
154
130
  readonly JOB_APPLICATION: "JOB_APPLICATION";
155
131
  }>>>;
156
- rootId: z.ZodString;
132
+ rootId: z.ZodCUID2;
157
133
  rootType: z.ZodEnum<{
158
134
  readonly PROJECT: "PROJECT";
159
135
  readonly USER: "USER";
@@ -5,25 +5,23 @@ const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  const constants_1 = require("../constants");
6
6
  exports.NotificationEntitySchema = zod_openapi_1.z
7
7
  .object({
8
- id: zod_openapi_1.z.string().cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
9
- recipientId: zod_openapi_1.z.string().cuid2().openapi({ example: "user_recipient_123" }),
10
- actorId: zod_openapi_1.z.string().cuid2().openapi({ example: "user_actor_456" }),
8
+ id: zod_openapi_1.z.cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
9
+ recipientId: zod_openapi_1.z.cuid2().openapi({ example: "user_recipient_123" }),
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
12
  // 1. ENTITY: The specific thing created (e.g., the Reply)
13
- entityId: zod_openapi_1.z.string().cuid2().openapi({ example: "entity_789" }),
14
- entityType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
13
+ entityId: zod_openapi_1.z.cuid2().optional().openapi({ example: "entity_789" }),
15
14
  // 2. PARENT: The direct context (e.g., the Comment being replied to)
16
15
  // Optional because top-level interactions (like a comment on a project)
17
16
  // have no parent other than the root.
18
17
  parentId: zod_openapi_1.z
19
- .string()
20
18
  .cuid2()
21
19
  .optional()
22
20
  .nullable()
23
21
  .openapi({ example: "parent_456" }),
24
22
  parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).optional().nullable(),
25
23
  // 3. ROOT: The top-level container (e.g., the Project)
26
- rootId: zod_openapi_1.z.string().cuid2().openapi({ example: "root_123" }),
24
+ rootId: zod_openapi_1.z.cuid2().openapi({ example: "root_123" }),
27
25
  rootType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
28
26
  isRead: zod_openapi_1.z.boolean().default(false).openapi({ example: false }),
29
27
  createdAt: zod_openapi_1.z.coerce.date().openapi({ example: "2026-01-05T09:00:00.000Z" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "2.1.38",
3
+ "version": "2.1.40",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,20 +3,18 @@ import { ACTIVITY_PARENT_TYPES, NOTIFICATION_TYPES } from "../constants";
3
3
 
4
4
  export const NotificationEntitySchema = z
5
5
  .object({
6
- id: z.string().cuid2().openapi({ example: "not_cksd0v6q0000s9a5y8z7p3x9" }),
7
- recipientId: z.string().cuid2().openapi({ example: "user_recipient_123" }),
8
- actorId: z.string().cuid2().openapi({ example: "user_actor_456" }),
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
9
  type: z.enum(NOTIFICATION_TYPES).openapi({ example: "LIKE" }),
10
-
11
10
  // 1. ENTITY: The specific thing created (e.g., the Reply)
12
- entityId: z.string().cuid2().openapi({ example: "entity_789" }),
13
- entityType: z.enum(ACTIVITY_PARENT_TYPES),
11
+ entityId: z.cuid2().optional().openapi({ example: "entity_789" }),
14
12
 
15
13
  // 2. PARENT: The direct context (e.g., the Comment being replied to)
16
14
  // Optional because top-level interactions (like a comment on a project)
17
15
  // have no parent other than the root.
18
16
  parentId: z
19
- .string()
17
+
20
18
  .cuid2()
21
19
  .optional()
22
20
  .nullable()
@@ -24,7 +22,7 @@ export const NotificationEntitySchema = z
24
22
  parentType: z.enum(ACTIVITY_PARENT_TYPES).optional().nullable(),
25
23
 
26
24
  // 3. ROOT: The top-level container (e.g., the Project)
27
- rootId: z.string().cuid2().openapi({ example: "root_123" }),
25
+ rootId: z.cuid2().openapi({ example: "root_123" }),
28
26
  rootType: z.enum(ACTIVITY_PARENT_TYPES),
29
27
 
30
28
  isRead: z.boolean().default(false).openapi({ example: false }),