@zyacreatives/shared 2.1.38 → 2.1.39

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,7 +15,7 @@ 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;
18
+ entityId: z.ZodOptional<z.ZodCUID2>;
19
19
  entityType: z.ZodEnum<{
20
20
  readonly PROJECT: "PROJECT";
21
21
  readonly USER: "USER";
@@ -24,7 +24,7 @@ export declare const NotificationEntitySchema: z.ZodObject<{
24
24
  readonly COMMENT: "COMMENT";
25
25
  readonly JOB_APPLICATION: "JOB_APPLICATION";
26
26
  }>;
27
- parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
27
+ parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
28
28
  parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
29
29
  readonly PROJECT: "PROJECT";
30
30
  readonly USER: "USER";
@@ -33,7 +33,7 @@ export declare const NotificationEntitySchema: z.ZodObject<{
33
33
  readonly COMMENT: "COMMENT";
34
34
  readonly JOB_APPLICATION: "JOB_APPLICATION";
35
35
  }>>>;
36
- rootId: z.ZodString;
36
+ rootId: z.ZodCUID2;
37
37
  rootType: z.ZodEnum<{
38
38
  readonly PROJECT: "PROJECT";
39
39
  readonly USER: "USER";
@@ -52,9 +52,9 @@ export declare const MinimalNotificationEntitySchema: z.ZodObject<{
52
52
  actorId: z.ZodCUID2;
53
53
  }, z.core.$strip>;
54
54
  export declare const NotificationDetailsEntitySchema: z.ZodObject<{
55
- id: z.ZodString;
56
- recipientId: z.ZodString;
57
- actorId: z.ZodString;
55
+ id: z.ZodCUID2;
56
+ recipientId: z.ZodCUID2;
57
+ actorId: z.ZodCUID2;
58
58
  type: z.ZodEnum<{
59
59
  readonly FOLLOW: "Follow";
60
60
  readonly LIKE: "Like";
@@ -67,7 +67,7 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
67
67
  readonly SYSTEM_STRIKE: "System Strike";
68
68
  readonly PROJECT_FEATURED: "Project Featured";
69
69
  }>;
70
- entityId: z.ZodString;
70
+ entityId: z.ZodOptional<z.ZodCUID2>;
71
71
  entityType: z.ZodEnum<{
72
72
  readonly PROJECT: "PROJECT";
73
73
  readonly USER: "USER";
@@ -76,7 +76,7 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
76
76
  readonly COMMENT: "COMMENT";
77
77
  readonly JOB_APPLICATION: "JOB_APPLICATION";
78
78
  }>;
79
- parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
79
+ parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
80
80
  parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
81
81
  readonly PROJECT: "PROJECT";
82
82
  readonly USER: "USER";
@@ -85,7 +85,7 @@ export declare const NotificationDetailsEntitySchema: z.ZodObject<{
85
85
  readonly COMMENT: "COMMENT";
86
86
  readonly JOB_APPLICATION: "JOB_APPLICATION";
87
87
  }>>>;
88
- rootId: z.ZodString;
88
+ rootId: z.ZodCUID2;
89
89
  rootType: z.ZodEnum<{
90
90
  readonly PROJECT: "PROJECT";
91
91
  readonly USER: "USER";
@@ -120,9 +120,9 @@ export declare const ListNotificationsInputSchema: z.ZodObject<{
120
120
  }, z.core.$strip>;
121
121
  export declare const ListNotificationsOutputSchema: z.ZodObject<{
122
122
  notifications: z.ZodArray<z.ZodObject<{
123
- id: z.ZodString;
124
- recipientId: z.ZodString;
125
- actorId: z.ZodString;
123
+ id: z.ZodCUID2;
124
+ recipientId: z.ZodCUID2;
125
+ actorId: z.ZodCUID2;
126
126
  type: z.ZodEnum<{
127
127
  readonly FOLLOW: "Follow";
128
128
  readonly LIKE: "Like";
@@ -135,7 +135,7 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
135
135
  readonly SYSTEM_STRIKE: "System Strike";
136
136
  readonly PROJECT_FEATURED: "Project Featured";
137
137
  }>;
138
- entityId: z.ZodString;
138
+ entityId: z.ZodOptional<z.ZodCUID2>;
139
139
  entityType: z.ZodEnum<{
140
140
  readonly PROJECT: "PROJECT";
141
141
  readonly USER: "USER";
@@ -144,7 +144,7 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
144
144
  readonly COMMENT: "COMMENT";
145
145
  readonly JOB_APPLICATION: "JOB_APPLICATION";
146
146
  }>;
147
- parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
147
+ parentId: z.ZodNullable<z.ZodOptional<z.ZodCUID2>>;
148
148
  parentType: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
149
149
  readonly PROJECT: "PROJECT";
150
150
  readonly USER: "USER";
@@ -153,7 +153,7 @@ export declare const ListNotificationsOutputSchema: z.ZodObject<{
153
153
  readonly COMMENT: "COMMENT";
154
154
  readonly JOB_APPLICATION: "JOB_APPLICATION";
155
155
  }>>>;
156
- rootId: z.ZodString;
156
+ rootId: z.ZodCUID2;
157
157
  rootType: z.ZodEnum<{
158
158
  readonly PROJECT: "PROJECT";
159
159
  readonly USER: "USER";
@@ -5,25 +5,24 @@ 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" }),
13
+ entityId: zod_openapi_1.z.cuid2().optional().openapi({ example: "entity_789" }),
14
14
  entityType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
15
15
  // 2. PARENT: The direct context (e.g., the Comment being replied to)
16
16
  // Optional because top-level interactions (like a comment on a project)
17
17
  // have no parent other than the root.
18
18
  parentId: zod_openapi_1.z
19
- .string()
20
19
  .cuid2()
21
20
  .optional()
22
21
  .nullable()
23
22
  .openapi({ example: "parent_456" }),
24
23
  parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).optional().nullable(),
25
24
  // 3. ROOT: The top-level container (e.g., the Project)
26
- rootId: zod_openapi_1.z.string().cuid2().openapi({ example: "root_123" }),
25
+ rootId: zod_openapi_1.z.cuid2().openapi({ example: "root_123" }),
27
26
  rootType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES),
28
27
  isRead: zod_openapi_1.z.boolean().default(false).openapi({ example: false }),
29
28
  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.39",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,20 +3,20 @@ 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
10
 
11
11
  // 1. ENTITY: The specific thing created (e.g., the Reply)
12
- entityId: z.string().cuid2().openapi({ example: "entity_789" }),
12
+ entityId: z.cuid2().optional().openapi({ example: "entity_789" }),
13
13
  entityType: z.enum(ACTIVITY_PARENT_TYPES),
14
14
 
15
15
  // 2. PARENT: The direct context (e.g., the Comment being replied to)
16
16
  // Optional because top-level interactions (like a comment on a project)
17
17
  // have no parent other than the root.
18
18
  parentId: z
19
- .string()
19
+
20
20
  .cuid2()
21
21
  .optional()
22
22
  .nullable()
@@ -24,7 +24,7 @@ export const NotificationEntitySchema = z
24
24
  parentType: z.enum(ACTIVITY_PARENT_TYPES).optional().nullable(),
25
25
 
26
26
  // 3. ROOT: The top-level container (e.g., the Project)
27
- rootId: z.string().cuid2().openapi({ example: "root_123" }),
27
+ rootId: z.cuid2().openapi({ example: "root_123" }),
28
28
  rootType: z.enum(ACTIVITY_PARENT_TYPES),
29
29
 
30
30
  isRead: z.boolean().default(false).openapi({ example: false }),