@lyxa.ai/core 1.3.268 → 1.3.269
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/libraries/socket/events/chatlist-message-send.socket.event.d.ts +12 -0
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +1 -0
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -1
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +13 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +2 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -1
- package/dist/libraries/trpc/middlewares/auth.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/createRoleProtectedProcedure.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/phone-verified.d.ts +1 -1
- package/dist/libraries/trpc/middlewares/publicUserDecoder.d.ts +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/utilities/search.js +0 -2
- package/dist/utilities/search.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { NotificationSettings } from '../PushNotificationEvent';
|
|
|
5
5
|
export declare const ChatlistMessageSendSocketInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
6
6
|
export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
7
7
|
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
8
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
8
9
|
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
9
10
|
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
10
11
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
@@ -23,6 +24,7 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
|
23
24
|
content: string;
|
|
24
25
|
createdAt: Date;
|
|
25
26
|
} | undefined;
|
|
27
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
26
28
|
}, {
|
|
27
29
|
unreadCount: number;
|
|
28
30
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
@@ -30,9 +32,11 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
|
30
32
|
content: string;
|
|
31
33
|
createdAt: Date;
|
|
32
34
|
} | undefined;
|
|
35
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
33
36
|
}>;
|
|
34
37
|
export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
|
|
35
38
|
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
39
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
36
40
|
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
37
41
|
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
38
42
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
@@ -51,6 +55,7 @@ export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
|
|
|
51
55
|
content: string;
|
|
52
56
|
createdAt: Date;
|
|
53
57
|
} | undefined;
|
|
58
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
54
59
|
}, {
|
|
55
60
|
unreadCount: number;
|
|
56
61
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
@@ -58,6 +63,7 @@ export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
|
|
|
58
63
|
content: string;
|
|
59
64
|
createdAt: Date;
|
|
60
65
|
} | undefined;
|
|
66
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
61
67
|
}>;
|
|
62
68
|
export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;
|
|
63
69
|
export type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;
|
|
@@ -67,6 +73,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
67
73
|
input: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
68
74
|
output: z.ZodObject<{
|
|
69
75
|
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
76
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
70
77
|
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
71
78
|
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
72
79
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
@@ -85,6 +92,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
85
92
|
content: string;
|
|
86
93
|
createdAt: Date;
|
|
87
94
|
} | undefined;
|
|
95
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
88
96
|
}, {
|
|
89
97
|
unreadCount: number;
|
|
90
98
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
@@ -92,9 +100,11 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
92
100
|
content: string;
|
|
93
101
|
createdAt: Date;
|
|
94
102
|
} | undefined;
|
|
103
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
95
104
|
}>;
|
|
96
105
|
pushNotificationOutput: z.ZodObject<{
|
|
97
106
|
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
107
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
98
108
|
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
99
109
|
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
100
110
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
@@ -113,6 +123,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
113
123
|
content: string;
|
|
114
124
|
createdAt: Date;
|
|
115
125
|
} | undefined;
|
|
126
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
116
127
|
}, {
|
|
117
128
|
unreadCount: number;
|
|
118
129
|
chatroomId: import("mongoose").Types.ObjectId;
|
|
@@ -120,6 +131,7 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
120
131
|
content: string;
|
|
121
132
|
createdAt: Date;
|
|
122
133
|
} | undefined;
|
|
134
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
123
135
|
}>;
|
|
124
136
|
};
|
|
125
137
|
get notificationSettings(): NotificationSettings | undefined;
|
|
@@ -11,6 +11,7 @@ const BaseSocketEvent_1 = require("../BaseSocketEvent");
|
|
|
11
11
|
exports.ChatlistMessageSendSocketInputSchema = zod_1.default.object({});
|
|
12
12
|
exports.ChatlistMessageSendSocketOutputSchema = zod_1.default.object({
|
|
13
13
|
chatroomId: validation_1.ZodValidation.coerce.objectId(),
|
|
14
|
+
orderId: validation_1.ZodValidation.coerce.objectId().optional(),
|
|
14
15
|
lastMessage: zod_1.default
|
|
15
16
|
.object({
|
|
16
17
|
content: validation_1.ZodValidation.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqE;AACrE,8DAAmE;AACnE,wDAAqD;AAIxC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"chatlist-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatlist-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAqE;AACrE,8DAAmE;AACnE,wDAAqD;AAIxC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACpD,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7D,UAAU,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACnD,WAAW,EAAE,aAAC;SACZ,MAAM,CAAC;QACP,OAAO,EAAE,0BAAa,CAAC,MAAM,EAAE;QAC/B,SAAS,EAAE,0BAAa,CAAC,MAAM,CAAC,IAAI,EAAE;KACtC,CAAC;SACD,QAAQ,EAAE;IACZ,WAAW,EAAE,0BAAa,CAAC,MAAM,EAAE;CACnC,CAAC,CAAC;AAEU,QAAA,mCAAmC,GAAG,6CAAqC,CAAC;AAMzF,MAAa,8BAA+B,SAAQ,iCAInD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;QAC7C,sBAAsB,EAAE,2CAAmC;KAC3D,CAAC;IAEF,IAAW,oBAAoB;QAC9B,OAAO;YACN,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,gBAAS,CAAC,iBAAiB;SACtC,CAAC;IACH,CAAC;IAED,YAAY,OAA2C;QACtD,KAAK,CAAC,sBAAe,CAAC,yBAAyB,EAAE,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5G,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAzBF,wEA0BC","sourcesContent":["import z from 'zod';\nimport { ClickType, SocketEventType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\n\nimport { NotificationSettings } from '../PushNotificationEvent';\n\nexport const ChatlistMessageSendSocketInputSchema = z.object({});\nexport const ChatlistMessageSendSocketOutputSchema = z.object({\n\tchatroomId: ZodValidation.coerce.objectId(),\n\torderId: ZodValidation.coerce.objectId().optional(),\n\tlastMessage: z\n\t\t.object({\n\t\t\tcontent: ZodValidation.string(),\n\t\t\tcreatedAt: ZodValidation.coerce.date(),\n\t\t})\n\t\t.optional(),\n\tunreadCount: ZodValidation.number(),\n});\n\nexport const ChatlistMessageSendPushOutputSchema = ChatlistMessageSendSocketOutputSchema;\n\nexport type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;\nexport type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;\nexport type ChatlistMessageSendSocketInputDTO = DTO<typeof ChatlistMessageSendSocketInputSchema>;\n\nexport class ChatlistMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatlistMessageSendSocketInputSchema,\n\ttypeof ChatlistMessageSendSocketOutputSchema,\n\ttypeof ChatlistMessageSendPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\n\t\tpushNotificationOutput: ChatlistMessageSendPushOutputSchema,\n\t};\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn {\n\t\t\tisPushNotification: true,\n\t\t\tisClickable: true,\n\t\t\tclickType: ClickType.CLICKABLE_MESSAGE,\n\t\t};\n\t}\n\n\tconstructor(payload: ChatlistMessageSendSocketOutputDTO) {\n\t\tsuper(SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload, payload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
|
|
@@ -59,6 +59,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
59
59
|
longitude?: number | undefined;
|
|
60
60
|
}>>;
|
|
61
61
|
chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
62
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
62
63
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
63
64
|
}, "strip", z.ZodTypeAny, {
|
|
64
65
|
media: {
|
|
@@ -83,6 +84,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
83
84
|
longitude?: number | undefined;
|
|
84
85
|
} | undefined;
|
|
85
86
|
content?: string | undefined;
|
|
87
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
86
88
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
87
89
|
}, {
|
|
88
90
|
media: {
|
|
@@ -107,19 +109,23 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
|
|
|
107
109
|
longitude?: number | undefined;
|
|
108
110
|
} | undefined;
|
|
109
111
|
content?: string | undefined;
|
|
112
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
110
113
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
111
114
|
}>;
|
|
112
115
|
export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
|
|
113
116
|
lastMessage: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
114
117
|
chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
118
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
115
119
|
type: z.ZodNativeEnum<typeof ChatroomType>;
|
|
116
120
|
}, "strip", z.ZodTypeAny, {
|
|
117
121
|
type: ChatroomType;
|
|
118
122
|
lastMessage?: string | undefined;
|
|
123
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
119
124
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
120
125
|
}, {
|
|
121
126
|
type: ChatroomType;
|
|
122
127
|
lastMessage?: string | undefined;
|
|
128
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
123
129
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
124
130
|
}>;
|
|
125
131
|
export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatroomMessageSendPushOutputSchema>;
|
|
@@ -183,6 +189,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
183
189
|
longitude?: number | undefined;
|
|
184
190
|
}>>;
|
|
185
191
|
chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
192
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
186
193
|
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
187
194
|
}, "strip", z.ZodTypeAny, {
|
|
188
195
|
media: {
|
|
@@ -207,6 +214,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
207
214
|
longitude?: number | undefined;
|
|
208
215
|
} | undefined;
|
|
209
216
|
content?: string | undefined;
|
|
217
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
210
218
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
211
219
|
}, {
|
|
212
220
|
media: {
|
|
@@ -231,19 +239,23 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
231
239
|
longitude?: number | undefined;
|
|
232
240
|
} | undefined;
|
|
233
241
|
content?: string | undefined;
|
|
242
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
234
243
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
235
244
|
}>;
|
|
236
245
|
pushNotificationOutput: z.ZodObject<{
|
|
237
246
|
lastMessage: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
238
247
|
chatroomId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
248
|
+
orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
|
|
239
249
|
type: z.ZodNativeEnum<typeof ChatroomType>;
|
|
240
250
|
}, "strip", z.ZodTypeAny, {
|
|
241
251
|
type: ChatroomType;
|
|
242
252
|
lastMessage?: string | undefined;
|
|
253
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
243
254
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
244
255
|
}, {
|
|
245
256
|
type: ChatroomType;
|
|
246
257
|
lastMessage?: string | undefined;
|
|
258
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
247
259
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
248
260
|
}>;
|
|
249
261
|
};
|
|
@@ -254,6 +266,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
254
266
|
getPushNotificationPayload(): {
|
|
255
267
|
type: ChatroomType;
|
|
256
268
|
lastMessage?: string | undefined;
|
|
269
|
+
orderId?: import("mongoose").Types.ObjectId | undefined;
|
|
257
270
|
chatroomId?: import("mongoose").Types.ObjectId | undefined;
|
|
258
271
|
} | undefined;
|
|
259
272
|
protected getIdentifier(): string;
|
|
@@ -37,11 +37,13 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
|
|
|
37
37
|
})
|
|
38
38
|
.optional(),
|
|
39
39
|
chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
|
|
40
|
+
orderId: validation_1.ZodValidation.coerce.objectId('orderId').optional(),
|
|
40
41
|
createdAt: validation_1.ZodValidation.coerce.date(),
|
|
41
42
|
});
|
|
42
43
|
exports.ChatroomMessageSendPushOutputSchema = zod_1.default.object({
|
|
43
44
|
lastMessage: validation_1.ZodValidation.string('lastMessage').optional(),
|
|
44
45
|
chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
|
|
46
|
+
orderId: validation_1.ZodValidation.coerce.objectId('orderId').optional(),
|
|
45
47
|
type: validation_1.ZodValidation.enumType(enum_1.ChatroomType, 'type'),
|
|
46
48
|
});
|
|
47
49
|
class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/chatroom-message-send.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAAuG;AACvG,8DAA6E;AAC7E,wDAAqD;AAErD,kCAAuC;AAE1B,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE,qBAAQ;CACpB,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;IACzC,YAAY,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,cAAc,CAAC;IAClE,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;IACnD,UAAU,EAAE,0BAAa,CAAC,QAAQ,CAAC,cAAO,EAAE,YAAY,CAAC;IACzD,MAAM,EAAE,aAAC,CAAC,MAAM,CAAC;QAChB,EAAE,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC;QAC9C,IAAI,EAAE,0BAAa,CAAC,MAAM,CAAC,YAAY,CAAC;QACxC,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,cAAO,EAAE,aAAa,CAAC;KACpD,CAAC;IAC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,sBAAe,CAAC,qBAAqB;YACvD,GAAG,EAAE,OAAO,CAAC,GAAG;SAChB,CAAC,CAAC;QAEH,KAAK,CACJ,sBAAe,CAAC,qBAAqB,EACrC,8BAA8B,CAAC,OAAO,EACtC,OAAO,EACP,WAAW,EACX,uBAAuB,CACvB,CAAC;IACH,CAAC;IAEO,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,KAAK,cAAO,CAAC,KAAK;YACjD,CAAC,CAAC,0BAA0B;YAC5B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAA2D;QAC5E,OAAO,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;IAEM,0BAA0B;QAChC,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAES,aAAa;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;IACtD,CAAC;;AA3DF,wEA4DC","sourcesContent":["import z from 'zod';\nimport { ChatroomType, ClickType, MediaType, SocketEventType, UserRef } from '../../../utilities/enum';\nimport { DTO, IdSchema, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSettings } from '../PushNotificationEvent';\nimport { EventFactory } from '../core';\n\nexport const ChatroomMessageSendSocketInputSchema = z.object({\n\tchatroomId: IdSchema,\n});\n\nexport const ChatroomMessageSendOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId('_id'),\n\tchatroomType: ZodValidation.enumType(ChatroomType, 'chatroomType'),\n\tsenderId: ZodValidation.coerce.objectId('senderId'), // DEPRECATED\n\tsenderType: ZodValidation.enumType(UserRef, 'senderType'), // DEPRECATED\n\tsender: z.object({\n\t\tid: ZodValidation.coerce.objectId('sender.id'),\n\t\tname: ZodValidation.string('senderName'),\n\t\ttype: ZodValidation.enumType(UserRef, 'sender.type'),\n\t}),\n\tcontent: ZodValidation.string('content').optional(),\n\tmedia: z.array(\n\t\tz.object({\n\t\t\tmimeType: ZodValidation.string('mimeType'),\n\t\t\tmediaType: ZodValidation.enumType(MediaType, 'mediaType'),\n\t\t\tmediaUrl: ZodValidation.string('url'),\n\t\t\tthumbnailUrl: ZodValidation.string('thumbnailUrl').optional(),\n\t\t\tname: ZodValidation.string('name').optional(),\n\t\t})\n\t),\n\tlocation: z\n\t\t.object({\n\t\t\tlongitude: ZodValidation.coerce.number('longitude').optional(),\n\t\t\tlatitude: ZodValidation.coerce.number('latitude').optional(),\n\t\t})\n\t\t.optional(),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\torderId: ZodValidation.coerce.objectId('orderId').optional(),\n\tcreatedAt: ZodValidation.coerce.date(),\n});\n\nexport const ChatroomMessageSendPushOutputSchema = z.object({\n\tlastMessage: ZodValidation.string('lastMessage').optional(),\n\tchatroomId: ZodValidation.coerce.objectId('chatroomId').optional(),\n\torderId: ZodValidation.coerce.objectId('orderId').optional(),\n\ttype: ZodValidation.enumType(ChatroomType, 'type'),\n});\n\nexport type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatroomMessageSendPushOutputSchema>;\n\nexport type ChatroomMessageSendSocketOutputDTO = DTO<typeof ChatroomMessageSendOutputSchema>;\nexport type ChatroomMessageSendSocketInputDTO = DTO<typeof ChatroomMessageSendSocketInputSchema>;\n\nexport class ChatroomMessageSendSocketEvent extends BaseSocketEvent<\n\ttypeof ChatroomMessageSendSocketInputSchema,\n\ttypeof ChatroomMessageSendOutputSchema,\n\ttypeof ChatroomMessageSendPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: ChatroomMessageSendSocketInputSchema,\n\t\toutput: ChatroomMessageSendOutputSchema,\n\t\tpushNotificationOutput: ChatroomMessageSendPushOutputSchema,\n\t};\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn {\n\t\t\tisPushNotification: true,\n\t\t\tisClickable: true,\n\t\t\tclickType: ClickType.CLICKABLE_MESSAGE,\n\t\t\ttitle: this.getTitle(),\n\t\t};\n\t}\n\n\tconstructor(payload: ChatroomMessageSendSocketOutputDTO) {\n\t\tconst pushPayload: ChatlistMessageSendPushOutputDTO = {\n\t\t\tlastMessage: payload.content,\n\t\t\tchatroomId: payload.chatroomId,\n\t\t\t//orderId: payload.orderId,\n\t\t\ttype: payload.chatroomType,\n\t\t};\n\n\t\tconst socketNotificationEvent = EventFactory.createEvent(SocketEventType.NOTIFICATION, {\n\t\t\tmessage: 'New message!',\n\t\t\tnotificationType: SocketEventType.CHATROOM_MESSAGE_SEND,\n\t\t\t_id: payload._id,\n\t\t});\n\n\t\tsuper(\n\t\t\tSocketEventType.CHATROOM_MESSAGE_SEND,\n\t\t\tChatroomMessageSendSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tpushPayload,\n\t\t\tsocketNotificationEvent\n\t\t);\n\t}\n\n\tprivate getTitle(): string {\n\t\treturn this.payload().senderType === UserRef.ADMIN\n\t\t\t? 'New message from support'\n\t\t\t: this.payload().sender.name;\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\n\t}\n\n\tpublic getPushNotificationPayload() {\n\t\treturn this.pushNotificationData;\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn this.data.chatroomId?.toString() ?? 'default';\n\t}\n}\n"]}
|
|
@@ -5,10 +5,10 @@ interface AuthOptions {
|
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function createAuthenticatedProcedure(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
8
|
+
req: import("http").IncomingMessage;
|
|
8
9
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
10
|
tokenType: TokenType | undefined;
|
|
10
11
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
-
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
|
@@ -4,10 +4,10 @@ interface RoleProtectedOptions {
|
|
|
4
4
|
allowedRoles: string[];
|
|
5
5
|
}
|
|
6
6
|
export declare function createRoleProtectedProcedure(options: RoleProtectedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
7
|
+
req: import("http").IncomingMessage;
|
|
7
8
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
8
9
|
tokenType: import("../../auth").TokenType | undefined;
|
|
9
10
|
entity: import("../context").EntityContext | undefined;
|
|
10
|
-
req: import("http").IncomingMessage;
|
|
11
11
|
requestId: string | undefined;
|
|
12
12
|
usedRefreshToken: boolean | undefined;
|
|
13
13
|
tokenRenewed: boolean | undefined;
|
|
@@ -3,10 +3,10 @@ interface PhoneVerifiedOptions {
|
|
|
3
3
|
entityTypes: AuthEntityType[];
|
|
4
4
|
}
|
|
5
5
|
export declare function createPhoneVerifiedProcedure(options: PhoneVerifiedOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
6
|
+
req: import("http").IncomingMessage;
|
|
6
7
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
7
8
|
tokenType: import("../../auth").TokenType | undefined;
|
|
8
9
|
entity: import("../context").EntityContext | undefined;
|
|
9
|
-
req: import("http").IncomingMessage;
|
|
10
10
|
requestId: string | undefined;
|
|
11
11
|
usedRefreshToken: boolean | undefined;
|
|
12
12
|
tokenRenewed: boolean | undefined;
|
|
@@ -5,10 +5,10 @@ interface AuthOptions {
|
|
|
5
5
|
autoRefresh?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function publicUserDecoder(options: AuthOptions): import("@trpc/server").TRPCProcedureBuilder<import("../context").LyxaHTTPContext, object, {
|
|
8
|
+
req: import("http").IncomingMessage;
|
|
8
9
|
res: import("http").ServerResponse<import("http").IncomingMessage>;
|
|
9
10
|
tokenType: TokenType | undefined;
|
|
10
11
|
entity: import("../context").EntityContext | undefined;
|
|
11
|
-
req: import("http").IncomingMessage;
|
|
12
12
|
requestId: string | undefined;
|
|
13
13
|
usedRefreshToken: boolean | undefined;
|
|
14
14
|
tokenRenewed: boolean | undefined;
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
package/dist/utilities/search.js
CHANGED
|
@@ -8,8 +8,6 @@ function buildSearchQuery(searchKey, fields) {
|
|
|
8
8
|
const isEmail = searchKey.includes('@');
|
|
9
9
|
const normalizeSearchKey = isEmail ? searchKey : (0, normalize_1.normalizeName)(searchKey);
|
|
10
10
|
const searchTerms = normalizeSearchKey.split(/[ ,]+/).filter(term => term.trim() !== '');
|
|
11
|
-
if (!searchTerms.length)
|
|
12
|
-
return {};
|
|
13
11
|
return {
|
|
14
12
|
$and: searchTerms.map(term => ({
|
|
15
13
|
$or: fields.map(field => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"/","sources":["utilities/search.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"/","sources":["utilities/search.ts"],"names":[],"mappings":";;AAuBA,4CAgBC;AAvCD,2CAA4C;AAuB5C,SAAgB,gBAAgB,CAAC,SAAiB,EAAE,MAAgB;IACnE,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM;QAAE,OAAO,EAAE,CAAC;IAErD,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,yBAAa,EAAC,SAAS,CAAC,CAAC;IAG1E,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAEzF,OAAO;QACN,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC9B,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBACzB,CAAC,KAAK,CAAC,EAAE,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;aAC9B,CAAC,CAAC;SACH,CAAC,CAAC;KACH,CAAC;AACH,CAAC","sourcesContent":["import { normalizeName } from './normalize';\n\n/**\n * Builds a MongoDB/Mongoose search query that searches across multiple fields\n *\n * @param searchKey - The search string to parse (space or comma separated terms)\n * @param fields - Array of field names to search against (default: ['name', 'email', 'phoneNumber'])\n * @returns A MongoDB query object that requires ALL terms to match in ANY of the specified fields\n *\n * @example\n * // Basic usage\n * const query = buildSearchQuery('john doe');\n * // Returns: {\n * // $and: [\n * // { $or: [{ name: /john/i }, { email: /john/i }, { phoneNumber: /john/i }] },\n * // { $or: [{ name: /doe/i }, { email: /doe/i }, { phoneNumber: /doe/i }] }\n * // ]\n * // }\n *\n * @example\n * // Custom fields\n * const query = buildSearchQuery('example', ['name', 'email']);\n */\nexport function buildSearchQuery(searchKey: string, fields: string[]): Record<string, any> {\n\tif (!searchKey?.trim() || !fields?.length) return {};\n\n\tconst isEmail = searchKey.includes('@');\n\tconst normalizeSearchKey = isEmail ? searchKey : normalizeName(searchKey);\n\n\t// Normal behavior for non-email search (names, userId, phoneNumber, etc ...)\n\tconst searchTerms = normalizeSearchKey.split(/[ ,]+/).filter(term => term.trim() !== '');\n\n\treturn {\n\t\t$and: searchTerms.map(term => ({\n\t\t\t$or: fields.map(field => ({\n\t\t\t\t[field]: new RegExp(term, 'i'),\n\t\t\t})),\n\t\t})),\n\t};\n}\n"]}
|