@zyacreatives/shared 2.2.35 → 2.2.37
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 +66 -0
- package/dist/schemas/chat.js +11 -1
- package/dist/schemas/message.d.ts +10 -41
- package/dist/schemas/message.js +14 -9
- package/dist/types/chat.d.ts +4 -1
- package/dist/types/message.d.ts +1 -2
- package/package.json +1 -1
- package/src/schemas/chat.ts +15 -0
- package/src/schemas/message.ts +12 -6
- package/src/types/chat.ts +10 -0
- package/src/types/message.ts +0 -3
package/dist/schemas/chat.d.ts
CHANGED
|
@@ -90,3 +90,69 @@ export declare const GetChatsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
90
90
|
unreadCount: z.ZodDefault<z.ZodNumber>;
|
|
91
91
|
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
92
92
|
}, z.core.$strip>>;
|
|
93
|
+
export declare const GetChatsForUserOutputSchema: z.ZodObject<{
|
|
94
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
95
|
+
id: z.ZodCUID2;
|
|
96
|
+
senderId: z.ZodCUID2;
|
|
97
|
+
receiverId: z.ZodCUID2;
|
|
98
|
+
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
99
|
+
messageRequestStatus: z.ZodDefault<z.ZodEnum<{
|
|
100
|
+
readonly PENDING: "PENDING";
|
|
101
|
+
readonly ACCEPTED: "ACCEPTED";
|
|
102
|
+
readonly DECLINED: "DECLINED";
|
|
103
|
+
}>>;
|
|
104
|
+
acceptedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
105
|
+
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
106
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
107
|
+
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
108
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
109
|
+
senderName: z.ZodString;
|
|
110
|
+
senderUsername: z.ZodString;
|
|
111
|
+
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
112
|
+
receiverName: z.ZodString;
|
|
113
|
+
receiverUsername: z.ZodString;
|
|
114
|
+
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
115
|
+
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
116
|
+
lastMessageAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
117
|
+
unreadCount: z.ZodDefault<z.ZodNumber>;
|
|
118
|
+
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export declare const GetMessageRequestsForUserOutputSchema: z.ZodObject<{
|
|
123
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
124
|
+
id: z.ZodCUID2;
|
|
125
|
+
senderId: z.ZodCUID2;
|
|
126
|
+
receiverId: z.ZodCUID2;
|
|
127
|
+
isMessageRequest: z.ZodDefault<z.ZodBoolean>;
|
|
128
|
+
messageRequestStatus: z.ZodDefault<z.ZodEnum<{
|
|
129
|
+
readonly PENDING: "PENDING";
|
|
130
|
+
readonly ACCEPTED: "ACCEPTED";
|
|
131
|
+
readonly DECLINED: "DECLINED";
|
|
132
|
+
}>>;
|
|
133
|
+
acceptedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
134
|
+
declinedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
135
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
136
|
+
updatedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
137
|
+
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
138
|
+
senderName: z.ZodString;
|
|
139
|
+
senderUsername: z.ZodString;
|
|
140
|
+
senderImgUrl: z.ZodNullable<z.ZodString>;
|
|
141
|
+
receiverName: z.ZodString;
|
|
142
|
+
receiverUsername: z.ZodString;
|
|
143
|
+
receiverImgUrl: z.ZodNullable<z.ZodString>;
|
|
144
|
+
lastMessageSent: z.ZodNullable<z.ZodString>;
|
|
145
|
+
lastMessageAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
146
|
+
unreadCount: z.ZodDefault<z.ZodNumber>;
|
|
147
|
+
isOnline: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
export declare const AcceptMessageRequestInputSchema: z.ZodObject<{
|
|
152
|
+
chatId: z.ZodCUID2;
|
|
153
|
+
userId: z.ZodCUID2;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export declare const DeclineMessageRequestInputSchema: z.ZodObject<{
|
|
156
|
+
chatId: z.ZodCUID2;
|
|
157
|
+
userId: z.ZodCUID2;
|
|
158
|
+
}, z.core.$strip>;
|
package/dist/schemas/chat.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetChatsOutputSchema = exports.ChatIdSchema = exports.CreateChatOutputSchema = exports.CreateChatInputSchema = exports.ChatEntitySchema = exports.BaseChatEntitySchema = void 0;
|
|
3
|
+
exports.DeclineMessageRequestInputSchema = exports.AcceptMessageRequestInputSchema = exports.GetMessageRequestsForUserOutputSchema = exports.GetChatsForUserOutputSchema = exports.GetChatsOutputSchema = exports.ChatIdSchema = exports.CreateChatOutputSchema = exports.CreateChatInputSchema = exports.ChatEntitySchema = exports.BaseChatEntitySchema = void 0;
|
|
4
4
|
const zod_openapi_1 = require("@hono/zod-openapi");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
// 1. DB Representation (What is actually in Postgres)
|
|
@@ -40,3 +40,13 @@ exports.ChatIdSchema = zod_openapi_1.z.object({
|
|
|
40
40
|
chatId: zod_openapi_1.z.cuid2(),
|
|
41
41
|
});
|
|
42
42
|
exports.GetChatsOutputSchema = zod_openapi_1.z.array(exports.ChatEntitySchema);
|
|
43
|
+
exports.GetChatsForUserOutputSchema = zod_openapi_1.z.object({
|
|
44
|
+
chats: zod_openapi_1.z.array(exports.ChatEntitySchema),
|
|
45
|
+
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
46
|
+
});
|
|
47
|
+
exports.GetMessageRequestsForUserOutputSchema = exports.GetChatsForUserOutputSchema;
|
|
48
|
+
exports.AcceptMessageRequestInputSchema = zod_openapi_1.z.object({
|
|
49
|
+
chatId: zod_openapi_1.z.cuid2(),
|
|
50
|
+
userId: zod_openapi_1.z.cuid2(),
|
|
51
|
+
});
|
|
52
|
+
exports.DeclineMessageRequestInputSchema = exports.AcceptMessageRequestInputSchema;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
+
export declare const LinkMetaSchema: z.ZodObject<{
|
|
3
|
+
url: z.ZodURL;
|
|
4
|
+
title: z.ZodOptional<z.ZodString>;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
image: z.ZodOptional<z.ZodURL>;
|
|
7
|
+
}, z.core.$strip>;
|
|
2
8
|
export declare const MessageEntitySchema: z.ZodObject<{
|
|
3
9
|
id: z.ZodCUID2;
|
|
4
10
|
chatId: z.ZodCUID2;
|
|
@@ -181,46 +187,9 @@ export declare const GetMessagesOutputSchema: z.ZodObject<{
|
|
|
181
187
|
}, z.core.$strip>>;
|
|
182
188
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
183
189
|
}, z.core.$strip>;
|
|
184
|
-
export declare const
|
|
185
|
-
|
|
190
|
+
export declare const MessageIdSchema: z.ZodObject<{
|
|
191
|
+
messageId: z.ZodCUID2;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export declare const ChatIdParamSchema: z.ZodObject<{
|
|
186
194
|
chatId: z.ZodCUID2;
|
|
187
|
-
senderId: z.ZodCUID2;
|
|
188
|
-
receiverId: z.ZodCUID2;
|
|
189
|
-
content: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
190
|
-
messageType: z.ZodDefault<z.ZodEnum<{
|
|
191
|
-
readonly MARKETPLACE: "MARKETPLACE";
|
|
192
|
-
readonly PROJECT: "PROJECT";
|
|
193
|
-
readonly JOB_OPENING: "JOB_OPENING";
|
|
194
|
-
readonly DEFAULT_MESSAGE: "DEFAULT_MESSAGE";
|
|
195
|
-
readonly MESSAGE_WITH_LINKS: "MESSAGE_WITH_LINKS";
|
|
196
|
-
readonly MESSAGE_WITH_MEDIA: "MESSAGE_WITH_MEDIA";
|
|
197
|
-
readonly MESSAGE_WITH_MEDIA_AND_LINKS: "MESSAGE_WITH_MEDIA_AND_LINKS";
|
|
198
|
-
}>>;
|
|
199
|
-
parentId: z.ZodOptional<z.ZodCUID2>;
|
|
200
|
-
parentType: z.ZodOptional<z.ZodEnum<{
|
|
201
|
-
readonly PROJECT: "PROJECT";
|
|
202
|
-
readonly USER: "USER";
|
|
203
|
-
readonly JOB: "JOB";
|
|
204
|
-
readonly POST: "POST";
|
|
205
|
-
readonly COMMENT: "COMMENT";
|
|
206
|
-
readonly JOB_APPLICATION: "JOB_APPLICATION";
|
|
207
|
-
}>>;
|
|
208
|
-
replyToMessageId: z.ZodOptional<z.ZodCUID2>;
|
|
209
|
-
replyToContent: z.ZodOptional<z.ZodString>;
|
|
210
|
-
replyToImages: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
211
|
-
replyToLinkMeta: z.ZodOptional<z.ZodObject<{
|
|
212
|
-
url: z.ZodURL;
|
|
213
|
-
title: z.ZodOptional<z.ZodString>;
|
|
214
|
-
description: z.ZodOptional<z.ZodString>;
|
|
215
|
-
image: z.ZodOptional<z.ZodURL>;
|
|
216
|
-
}, z.core.$strip>>;
|
|
217
|
-
linkMeta: z.ZodOptional<z.ZodObject<{
|
|
218
|
-
url: z.ZodURL;
|
|
219
|
-
title: z.ZodOptional<z.ZodString>;
|
|
220
|
-
description: z.ZodOptional<z.ZodString>;
|
|
221
|
-
image: z.ZodOptional<z.ZodURL>;
|
|
222
|
-
}, z.core.$strip>>;
|
|
223
|
-
createdAt: z.ZodCoercedDate<unknown>;
|
|
224
|
-
updatedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
225
|
-
deletedAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
226
195
|
}, z.core.$strip>;
|
package/dist/schemas/message.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ChatIdParamSchema = exports.MessageIdSchema = exports.GetMessagesOutputSchema = exports.CreateMessageInputSchema = exports.MessageWithFilesEntitySchema = exports.MessageFileEntitySchema = exports.MessageEntitySchema = exports.LinkMetaSchema = void 0;
|
|
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
7
|
// 1. Base primitives
|
|
8
|
-
|
|
8
|
+
exports.LinkMetaSchema = zod_openapi_1.z.object({
|
|
9
9
|
url: zod_openapi_1.z.url(),
|
|
10
10
|
title: zod_openapi_1.z.string().optional(),
|
|
11
11
|
description: zod_openapi_1.z.string().optional(),
|
|
@@ -21,15 +21,15 @@ exports.MessageEntitySchema = zod_openapi_1.z.object({
|
|
|
21
21
|
content: zod_openapi_1.z.string().optional().default(""),
|
|
22
22
|
messageType: zod_openapi_1.z.enum(constants_1.MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
23
23
|
// Parent/Threading
|
|
24
|
-
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
24
|
+
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
25
25
|
parentType: zod_openapi_1.z.enum(constants_1.ACTIVITY_PARENT_TYPES).optional(),
|
|
26
|
-
// Reply Context
|
|
26
|
+
// Reply Context
|
|
27
27
|
replyToMessageId: zod_openapi_1.z.cuid2().optional(),
|
|
28
28
|
replyToContent: zod_openapi_1.z.string().optional(),
|
|
29
29
|
replyToImages: zod_openapi_1.z.array(zod_openapi_1.z.url()).optional(),
|
|
30
|
-
replyToLinkMeta: LinkMetaSchema.optional(),
|
|
30
|
+
replyToLinkMeta: exports.LinkMetaSchema.optional(),
|
|
31
31
|
// Metadata
|
|
32
|
-
linkMeta: LinkMetaSchema.optional(),
|
|
32
|
+
linkMeta: exports.LinkMetaSchema.optional(),
|
|
33
33
|
createdAt: zod_openapi_1.z.coerce.date(),
|
|
34
34
|
updatedAt: zod_openapi_1.z.coerce.date().optional(),
|
|
35
35
|
deletedAt: zod_openapi_1.z.coerce.date().optional(),
|
|
@@ -46,7 +46,7 @@ exports.MessageWithFilesEntitySchema = exports.MessageEntitySchema.extend({
|
|
|
46
46
|
});
|
|
47
47
|
// 3. Inputs
|
|
48
48
|
exports.CreateMessageInputSchema = zod_openapi_1.z.object({
|
|
49
|
-
id: zod_openapi_1.z.cuid2(),
|
|
49
|
+
id: zod_openapi_1.z.cuid2(),
|
|
50
50
|
chatId: zod_openapi_1.z.cuid2(),
|
|
51
51
|
senderId: zod_openapi_1.z.cuid2(),
|
|
52
52
|
receiverId: zod_openapi_1.z.cuid2(),
|
|
@@ -54,7 +54,7 @@ exports.CreateMessageInputSchema = zod_openapi_1.z.object({
|
|
|
54
54
|
messageType: zod_openapi_1.z.enum(constants_1.MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
55
55
|
parentId: zod_openapi_1.z.cuid2().optional(),
|
|
56
56
|
replyToMessageId: zod_openapi_1.z.cuid2().optional(),
|
|
57
|
-
linkMeta: LinkMetaSchema.optional(),
|
|
57
|
+
linkMeta: exports.LinkMetaSchema.optional(),
|
|
58
58
|
files: zod_openapi_1.z
|
|
59
59
|
.array(file_1.CreateFileInputSchema.extend({ order: zod_openapi_1.z.number().int() }))
|
|
60
60
|
.optional(),
|
|
@@ -63,4 +63,9 @@ exports.GetMessagesOutputSchema = zod_openapi_1.z.object({
|
|
|
63
63
|
messages: zod_openapi_1.z.array(exports.MessageWithFilesEntitySchema),
|
|
64
64
|
nextCursor: zod_openapi_1.z.string().nullable(),
|
|
65
65
|
});
|
|
66
|
-
exports.
|
|
66
|
+
exports.MessageIdSchema = zod_openapi_1.z.object({
|
|
67
|
+
messageId: zod_openapi_1.z.cuid2(),
|
|
68
|
+
});
|
|
69
|
+
exports.ChatIdParamSchema = zod_openapi_1.z.object({
|
|
70
|
+
chatId: zod_openapi_1.z.cuid2(),
|
|
71
|
+
});
|
package/dist/types/chat.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { BaseChatEntitySchema, ChatEntitySchema, ChatIdSchema, CreateChatInputSchema, CreateChatOutputSchema, GetChatsOutputSchema } from "../schemas/chat";
|
|
2
|
+
import { AcceptMessageRequestInputSchema, BaseChatEntitySchema, ChatEntitySchema, ChatIdSchema, CreateChatInputSchema, CreateChatOutputSchema, GetChatsForUserOutputSchema, GetChatsOutputSchema } from "../schemas/chat";
|
|
3
3
|
export type BaseChatEntity = z.infer<typeof BaseChatEntitySchema>;
|
|
4
4
|
export type ChatEntity = z.infer<typeof ChatEntitySchema>;
|
|
5
5
|
export type CreateChatInput = z.infer<typeof CreateChatInputSchema>;
|
|
6
6
|
export type CreateChatOutput = z.infer<typeof CreateChatOutputSchema>;
|
|
7
7
|
export type ChatIdInput = z.infer<typeof ChatIdSchema>;
|
|
8
8
|
export type GetChatsOutput = z.infer<typeof GetChatsOutputSchema>;
|
|
9
|
+
export type GetChatsForUserOutput = z.infer<typeof GetChatsForUserOutputSchema>;
|
|
10
|
+
export type AcceptMessageRequestInput = z.infer<typeof AcceptMessageRequestInputSchema>;
|
|
11
|
+
export type DeclineMessageRequestInput = AcceptMessageRequestInput;
|
package/dist/types/message.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { CreateMessageInputSchema,
|
|
2
|
+
import { CreateMessageInputSchema, GetMessagesOutputSchema, MessageEntitySchema, MessageFileEntitySchema, MessageWithFilesEntitySchema } from "../schemas/message";
|
|
3
3
|
export type MessageEntity = z.infer<typeof MessageEntitySchema>;
|
|
4
4
|
export type MessageFileEntity = z.infer<typeof MessageFileEntitySchema>;
|
|
5
5
|
export type MessageWithFilesEntity = z.infer<typeof MessageWithFilesEntitySchema>;
|
|
6
6
|
export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
|
|
7
|
-
export type CreateMessageOutput = z.infer<typeof CreateMessageOutputSchema>;
|
|
8
7
|
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|
package/package.json
CHANGED
package/src/schemas/chat.ts
CHANGED
|
@@ -45,3 +45,18 @@ export const ChatIdSchema = z.object({
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
export const GetChatsOutputSchema = z.array(ChatEntitySchema);
|
|
48
|
+
|
|
49
|
+
export const GetChatsForUserOutputSchema = z.object({
|
|
50
|
+
chats: z.array(ChatEntitySchema),
|
|
51
|
+
nextCursor: z.string().nullable(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const GetMessageRequestsForUserOutputSchema =
|
|
55
|
+
GetChatsForUserOutputSchema;
|
|
56
|
+
|
|
57
|
+
export const AcceptMessageRequestInputSchema = z.object({
|
|
58
|
+
chatId: z.cuid2(),
|
|
59
|
+
userId: z.cuid2(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const DeclineMessageRequestInputSchema = AcceptMessageRequestInputSchema;
|
package/src/schemas/message.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ACTIVITY_PARENT_TYPES, MESSAGE_TYPES } from "../constants";
|
|
|
3
3
|
import { CreateFileInputSchema } from "./file";
|
|
4
4
|
|
|
5
5
|
// 1. Base primitives
|
|
6
|
-
const LinkMetaSchema = z.object({
|
|
6
|
+
export const LinkMetaSchema = z.object({
|
|
7
7
|
url: z.url(),
|
|
8
8
|
title: z.string().optional(),
|
|
9
9
|
description: z.string().optional(),
|
|
@@ -16,16 +16,16 @@ export const MessageEntitySchema = z.object({
|
|
|
16
16
|
chatId: z.cuid2(),
|
|
17
17
|
senderId: z.cuid2(),
|
|
18
18
|
receiverId: z.cuid2(),
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
// Content & Type
|
|
21
21
|
content: z.string().optional().default(""),
|
|
22
22
|
messageType: z.enum(MESSAGE_TYPES).default("DEFAULT_MESSAGE"),
|
|
23
23
|
|
|
24
24
|
// Parent/Threading
|
|
25
|
-
parentId: z.cuid2().optional(),
|
|
25
|
+
parentId: z.cuid2().optional(),
|
|
26
26
|
parentType: z.enum(ACTIVITY_PARENT_TYPES).optional(),
|
|
27
27
|
|
|
28
|
-
// Reply Context
|
|
28
|
+
// Reply Context
|
|
29
29
|
replyToMessageId: z.cuid2().optional(),
|
|
30
30
|
replyToContent: z.string().optional(),
|
|
31
31
|
replyToImages: z.array(z.url()).optional(),
|
|
@@ -52,7 +52,7 @@ export const MessageWithFilesEntitySchema = MessageEntitySchema.extend({
|
|
|
52
52
|
|
|
53
53
|
// 3. Inputs
|
|
54
54
|
export const CreateMessageInputSchema = z.object({
|
|
55
|
-
id: z.cuid2(),
|
|
55
|
+
id: z.cuid2(),
|
|
56
56
|
chatId: z.cuid2(),
|
|
57
57
|
senderId: z.cuid2(),
|
|
58
58
|
receiverId: z.cuid2(),
|
|
@@ -74,4 +74,10 @@ export const GetMessagesOutputSchema = z.object({
|
|
|
74
74
|
nextCursor: z.string().nullable(),
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
export const
|
|
77
|
+
export const MessageIdSchema = z.object({
|
|
78
|
+
messageId: z.cuid2(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const ChatIdParamSchema = z.object({
|
|
82
|
+
chatId: z.cuid2(),
|
|
83
|
+
});
|
package/src/types/chat.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import {
|
|
3
|
+
AcceptMessageRequestInputSchema,
|
|
3
4
|
BaseChatEntitySchema,
|
|
4
5
|
ChatEntitySchema,
|
|
5
6
|
ChatIdSchema,
|
|
6
7
|
CreateChatInputSchema,
|
|
7
8
|
CreateChatOutputSchema,
|
|
9
|
+
GetChatsForUserOutputSchema,
|
|
8
10
|
GetChatsOutputSchema,
|
|
9
11
|
} from "../schemas/chat";
|
|
10
12
|
|
|
@@ -19,3 +21,11 @@ export type CreateChatOutput = z.infer<typeof CreateChatOutputSchema>;
|
|
|
19
21
|
export type ChatIdInput = z.infer<typeof ChatIdSchema>;
|
|
20
22
|
|
|
21
23
|
export type GetChatsOutput = z.infer<typeof GetChatsOutputSchema>;
|
|
24
|
+
|
|
25
|
+
export type GetChatsForUserOutput = z.infer<typeof GetChatsForUserOutputSchema>;
|
|
26
|
+
|
|
27
|
+
export type AcceptMessageRequestInput = z.infer<
|
|
28
|
+
typeof AcceptMessageRequestInputSchema
|
|
29
|
+
>;
|
|
30
|
+
|
|
31
|
+
export type DeclineMessageRequestInput = AcceptMessageRequestInput;
|
package/src/types/message.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import {
|
|
3
3
|
CreateMessageInputSchema,
|
|
4
|
-
CreateMessageOutputSchema,
|
|
5
4
|
GetMessagesOutputSchema,
|
|
6
5
|
MessageEntitySchema,
|
|
7
6
|
MessageFileEntitySchema,
|
|
@@ -18,6 +17,4 @@ export type MessageWithFilesEntity = z.infer<
|
|
|
18
17
|
|
|
19
18
|
export type CreateMessageInput = z.infer<typeof CreateMessageInputSchema>;
|
|
20
19
|
|
|
21
|
-
export type CreateMessageOutput = z.infer<typeof CreateMessageOutputSchema>;
|
|
22
|
-
|
|
23
20
|
export type GetMessagesOutput = z.infer<typeof GetMessagesOutputSchema>;
|