@zyacreatives/shared 2.2.32 → 2.2.34
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.
package/dist/schemas/chat.d.ts
CHANGED
|
@@ -32,12 +32,12 @@ export declare const ChatEntitySchema: z.ZodObject<{
|
|
|
32
32
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
33
33
|
senderName: z.ZodString;
|
|
34
34
|
senderUsername: z.ZodString;
|
|
35
|
-
senderImgUrl: z.
|
|
35
|
+
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
36
36
|
receiverName: z.ZodString;
|
|
37
37
|
receiverUsername: z.ZodString;
|
|
38
|
-
receiverImgUrl: z.
|
|
39
|
-
lastMessageSent: z.
|
|
40
|
-
lastMessageAt: z.
|
|
38
|
+
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
39
|
+
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
40
|
+
lastMessageAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
41
41
|
unreadCount: z.ZodDefault<z.ZodNumber>;
|
|
42
42
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
43
43
|
}, z.core.$strip>;
|
|
@@ -81,12 +81,12 @@ export declare const GetChatsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
81
81
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
82
82
|
senderName: z.ZodString;
|
|
83
83
|
senderUsername: z.ZodString;
|
|
84
|
-
senderImgUrl: z.
|
|
84
|
+
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
85
85
|
receiverName: z.ZodString;
|
|
86
86
|
receiverUsername: z.ZodString;
|
|
87
|
-
receiverImgUrl: z.
|
|
88
|
-
lastMessageSent: z.
|
|
89
|
-
lastMessageAt: z.
|
|
87
|
+
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
88
|
+
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
89
|
+
lastMessageAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
90
90
|
unreadCount: z.ZodDefault<z.ZodNumber>;
|
|
91
91
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
92
92
|
}, z.core.$strip>>;
|
package/dist/schemas/chat.js
CHANGED
|
@@ -21,13 +21,13 @@ exports.ChatEntitySchema = exports.BaseChatEntitySchema.extend({
|
|
|
21
21
|
// User Details (Joined)
|
|
22
22
|
senderName: zod_openapi_1.z.string(),
|
|
23
23
|
senderUsername: zod_openapi_1.z.string(),
|
|
24
|
-
senderImgUrl: zod_openapi_1.z.string().
|
|
24
|
+
senderImgUrl: zod_openapi_1.z.string().nullable(),
|
|
25
25
|
receiverName: zod_openapi_1.z.string(),
|
|
26
26
|
receiverUsername: zod_openapi_1.z.string(),
|
|
27
|
-
receiverImgUrl: zod_openapi_1.z.string().
|
|
27
|
+
receiverImgUrl: zod_openapi_1.z.string().nullable(),
|
|
28
28
|
// Ephemeral/Cached Data
|
|
29
|
-
lastMessageSent: zod_openapi_1.z.string().
|
|
30
|
-
lastMessageAt: zod_openapi_1.z.coerce.date().
|
|
29
|
+
lastMessageSent: zod_openapi_1.z.string().nullable(),
|
|
30
|
+
lastMessageAt: zod_openapi_1.z.coerce.date().nullable(), // Important for UI sorting
|
|
31
31
|
unreadCount: zod_openapi_1.z.number().int().default(0),
|
|
32
32
|
isOnline: zod_openapi_1.z.boolean().default(false),
|
|
33
33
|
});
|
|
@@ -3,6 +3,7 @@ export declare const MessageEntitySchema: z.ZodObject<{
|
|
|
3
3
|
id: z.ZodCUID2;
|
|
4
4
|
chatId: z.ZodCUID2;
|
|
5
5
|
senderId: z.ZodCUID2;
|
|
6
|
+
receiverId: z.ZodCUID2;
|
|
6
7
|
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
7
8
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
8
9
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
@@ -52,6 +53,7 @@ export declare const MessageWithFilesEntitySchema: z.ZodObject<{
|
|
|
52
53
|
id: z.ZodCUID2;
|
|
53
54
|
chatId: z.ZodCUID2;
|
|
54
55
|
senderId: z.ZodCUID2;
|
|
56
|
+
receiverId: z.ZodCUID2;
|
|
55
57
|
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
56
58
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
57
59
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
@@ -131,6 +133,7 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
|
131
133
|
id: z.ZodCUID2;
|
|
132
134
|
chatId: z.ZodCUID2;
|
|
133
135
|
senderId: z.ZodCUID2;
|
|
136
|
+
receiverId: z.ZodCUID2;
|
|
134
137
|
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
135
138
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
136
139
|
readonly MARKETPLACE: "MARKETPLACE";
|
|
@@ -182,6 +185,7 @@ export declare const CreateMessageOutputSchema: z.ZodObject<{
|
|
|
182
185
|
id: z.ZodCUID2;
|
|
183
186
|
chatId: z.ZodCUID2;
|
|
184
187
|
senderId: z.ZodCUID2;
|
|
188
|
+
receiverId: z.ZodCUID2;
|
|
185
189
|
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
186
190
|
messageType: z.ZodDefault<z.ZodEnum<{
|
|
187
191
|
readonly MARKETPLACE: "MARKETPLACE";
|
package/dist/schemas/message.js
CHANGED
|
@@ -16,6 +16,7 @@ exports.MessageEntitySchema = zod_openapi_1.z.object({
|
|
|
16
16
|
id: zod_openapi_1.z.cuid2(),
|
|
17
17
|
chatId: zod_openapi_1.z.cuid2(),
|
|
18
18
|
senderId: zod_openapi_1.z.cuid2(),
|
|
19
|
+
receiverId: zod_openapi_1.z.cuid2(),
|
|
19
20
|
// Content & Type
|
|
20
21
|
content: zod_openapi_1.z.string().optional().default(""),
|
|
21
22
|
messageType: zod_openapi_1.z.enum(constants_1.MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
@@ -54,7 +55,9 @@ exports.CreateMessageInputSchema = zod_openapi_1.z.object({
|
|
|
54
55
|
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
55
56
|
replyToMessageId: zod_openapi_1.z.cuid2().optional(),
|
|
56
57
|
linkMeta: LinkMetaSchema.optional(),
|
|
57
|
-
files: zod_openapi_1.z
|
|
58
|
+
files: zod_openapi_1.z
|
|
59
|
+
.array(file_1.CreateFileInputSchema.extend({ order: zod_openapi_1.z.number().int() }))
|
|
60
|
+
.optional(),
|
|
58
61
|
});
|
|
59
62
|
exports.GetMessagesOutputSchema = zod_openapi_1.z.object({
|
|
60
63
|
messages: zod_openapi_1.z.array(exports.MessageWithFilesEntitySchema),
|
package/package.json
CHANGED
package/src/schemas/chat.ts
CHANGED
|
@@ -20,15 +20,15 @@ export const ChatEntitySchema = BaseChatEntitySchema.extend({
|
|
|
20
20
|
// User Details (Joined)
|
|
21
21
|
senderName: z.string(),
|
|
22
22
|
senderUsername: z.string(),
|
|
23
|
-
senderImgUrl: z.string().
|
|
23
|
+
senderImgUrl: z.string().nullable(),
|
|
24
24
|
|
|
25
25
|
receiverName: z.string(),
|
|
26
26
|
receiverUsername: z.string(),
|
|
27
|
-
receiverImgUrl: z.string().
|
|
27
|
+
receiverImgUrl: z.string().nullable(),
|
|
28
28
|
|
|
29
29
|
// Ephemeral/Cached Data
|
|
30
|
-
lastMessageSent: z.string().
|
|
31
|
-
lastMessageAt: z.coerce.date().
|
|
30
|
+
lastMessageSent: z.string().nullable(),
|
|
31
|
+
lastMessageAt: z.coerce.date().nullable(), // Important for UI sorting
|
|
32
32
|
unreadCount: z.number().int().default(0),
|
|
33
33
|
isOnline: z.boolean().default(false),
|
|
34
34
|
});
|
package/src/schemas/message.ts
CHANGED
|
@@ -15,15 +15,16 @@ export const MessageEntitySchema = z.object({
|
|
|
15
15
|
id: z.cuid2(),
|
|
16
16
|
chatId: z.cuid2(),
|
|
17
17
|
senderId: z.cuid2(),
|
|
18
|
+
receiverId: z.cuid2(),
|
|
18
19
|
|
|
19
20
|
// Content & Type
|
|
20
21
|
content: z.string().optional().default(""),
|
|
21
22
|
messageType: z.enum(MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
22
|
-
|
|
23
|
+
|
|
23
24
|
// Parent/Threading
|
|
24
25
|
parentId: z.cuid2().optional(), // For threads/comments
|
|
25
26
|
parentType: z.enum(ACTIVITY_PARENT_TYPES).optional(),
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
// Reply Context (Flattened for UI convenience)
|
|
28
29
|
replyToMessageId: z.cuid2().optional(),
|
|
29
30
|
replyToContent: z.string().optional(),
|
|
@@ -55,15 +56,17 @@ export const CreateMessageInputSchema = z.object({
|
|
|
55
56
|
chatId: z.cuid2(),
|
|
56
57
|
senderId: z.cuid2(),
|
|
57
58
|
receiverId: z.cuid2(),
|
|
58
|
-
|
|
59
|
+
|
|
59
60
|
content: z.string().optional(),
|
|
60
61
|
messageType: z.enum(MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
61
|
-
|
|
62
|
+
|
|
62
63
|
parentId: z.cuid2().optional(),
|
|
63
64
|
replyToMessageId: z.cuid2().optional(),
|
|
64
|
-
|
|
65
|
+
|
|
65
66
|
linkMeta: LinkMetaSchema.optional(),
|
|
66
|
-
files: z
|
|
67
|
+
files: z
|
|
68
|
+
.array(CreateFileInputSchema.extend({ order: z.number().int() }))
|
|
69
|
+
.optional(),
|
|
67
70
|
});
|
|
68
71
|
|
|
69
72
|
export const GetMessagesOutputSchema = z.object({
|
|
@@ -72,4 +75,3 @@ export const GetMessagesOutputSchema = z.object({
|
|
|
72
75
|
});
|
|
73
76
|
|
|
74
77
|
export const CreateMessageOutputSchema = MessageEntitySchema;
|
|
75
|
-
|