@lyxa.ai/core 1.3.267 → 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/socket/events/order-actions.socket.event.d.ts +2 -1
- package/dist/libraries/socket/events/order-actions.socket.event.js +1 -0
- package/dist/libraries/socket/events/order-actions.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/types/utilities/validation/common-validation.d.ts +12 -12
- 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,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EAAE,OAAO,CAAC,YAAY;SAC1B,CAAC;QAEF,MAAM,uBAAuB,GAAG,mBAAY,CAAC,WAAW,CAAC,sBAAe,CAAC,YAAY,EAAE;YACtF,OAAO,EAAE,cAAc;YACvB,gBAAgB,EAAE,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,7 +5,8 @@ import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
|
5
5
|
export declare enum OrderAction {
|
|
6
6
|
PLACED = "placed",
|
|
7
7
|
ADJUSTMENT = "adjustment",
|
|
8
|
-
REPLACEMENT = "replacement"
|
|
8
|
+
REPLACEMENT = "replacement",
|
|
9
|
+
CANCELLED = "cancelled"
|
|
9
10
|
}
|
|
10
11
|
export declare const OrderActionsOutputSchema: z.ZodObject<{
|
|
11
12
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
|
|
@@ -11,6 +11,7 @@ var OrderAction;
|
|
|
11
11
|
OrderAction["PLACED"] = "placed";
|
|
12
12
|
OrderAction["ADJUSTMENT"] = "adjustment";
|
|
13
13
|
OrderAction["REPLACEMENT"] = "replacement";
|
|
14
|
+
OrderAction["CANCELLED"] = "cancelled";
|
|
14
15
|
})(OrderAction || (exports.OrderAction = OrderAction = {}));
|
|
15
16
|
const OrderUserSchema = zod_1.z.object({
|
|
16
17
|
_id: validation_1.ZodValidation.objectId('User ID'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAGpE,IAAY,
|
|
1
|
+
{"version":3,"file":"order-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/order-actions.socket.event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,+DAAoE;AACpE,kDAA6F;AAC7F,wDAAqD;AACrD,uEAAoE;AAGpE,IAAY,WAKX;AALD,WAAY,WAAW;IACtB,gCAAiB,CAAA;IACjB,wCAAyB,CAAA;IACzB,0CAA2B,CAAA;IAC3B,sCAAuB,CAAA;AACxB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,GAAG,EAAE,0BAAa,CAAC,QAAQ,CA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IACH,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AA3CF,0DA4CC","sourcesContent":["import { z } from 'zod';\nimport { DTO, ZodValidation } from '../../../utilities/validation/';\nimport { PaymentMethod, RegularOrderStatus, SocketEventType } from '../../../utilities/enum';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { SocketNotificationEvent } from './socketNotificationEvent';\nimport { EventFactory } from '../core';\n\nexport enum OrderAction {\n\tPLACED = 'placed',\n\tADJUSTMENT = 'adjustment',\n\tREPLACEMENT = 'replacement',\n\tCANCELLED = 'cancelled',\n}\n\nconst OrderUserSchema = z.object({\n\t_id: ZodValidation.objectId('User ID'),\n\tname: ZodValidation.string('User Name'),\n});\n\nexport const OrderActionsOutputSchema = z.object({\n\t_id: ZodValidation.objectId('Order ID'),\n\tshopId: ZodValidation.objectId('shopId'),\n\torderId: ZodValidation.string('Readable Order ID'),\n\tuser: OrderUserSchema,\n\torderStatus: ZodValidation.enumType(RegularOrderStatus, 'status'),\n\torderAction: ZodValidation.enumType(OrderAction, 'orderAction'),\n\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\tpreparationTimeMinutes: ZodValidation.number('Preparation Time (minutes)', {\n\t\tisNonnegative: true,\n\t}),\n\tadjustedFinance: z.object({\n\t\tpaymentMethod: ZodValidation.enumType(PaymentMethod, 'paymentMethod'),\n\t\tshopProfit: ZodValidation.number('shopProfit'),\n\t\tpricing: z.object({\n\t\t\ttotal: ZodValidation.number('total'),\n\t\t\tsecondaryTotal: ZodValidation.number('secondaryTotal'),\n\t\t\tpaidAmount: ZodValidation.number('paidAmount'),\n\t\t\tsecondaryPaidAmount: ZodValidation.number('secondaryPaidAmount'),\n\t\t\tdeliveryFee: ZodValidation.number('deliveryFee'),\n\t\t\tsecondaryDeliveryFee: ZodValidation.number('secondaryDeliveryFee'),\n\t\t\triderTips: ZodValidation.number('riderTip'),\n\t\t\tsecondaryRiderTips: ZodValidation.number('secondaryRiderTips'),\n\t\t}),\n\t}),\n\tcreatedAt: ZodValidation.coerce.date('Order Creation Date'),\n\ttriggerAt: ZodValidation.coerce.date('Order Trigger Date'),\n\torderActionType: ZodValidation.enumType(OrderAction, 'order action type'),\n});\n\nexport const OrderActionsInputSchema = z.undefined();\n\nexport type OrderActionSocketInputDTO = DTO<typeof OrderActionsInputSchema>;\nexport type OrderActionSocketOutputDTO = DTO<typeof OrderActionsOutputSchema>;\n\nexport class OrderActionsSocketEvent extends BaseSocketEvent<\n\ttypeof OrderActionsInputSchema,\n\ttypeof OrderActionsOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: OrderActionsInputSchema,\n\t\toutput: OrderActionsOutputSchema,\n\t};\n\n\t// Map each OrderAction to its message\n\tprivate static getMessageForAction(orderAction: OrderAction): string {\n\t\tswitch (orderAction) {\n\t\t\tcase OrderAction.PLACED:\n\t\t\t\treturn 'New Order!';\n\t\t\tcase OrderAction.ADJUSTMENT:\n\t\t\t\treturn 'Order has been adjusted';\n\t\t\tcase OrderAction.REPLACEMENT:\n\t\t\t\treturn 'Order has been replaced';\n\t\t\tdefault:\n\t\t\t\treturn 'Order update';\n\t\t}\n\t}\n\n\tconstructor(payload: OrderActionSocketOutputDTO) {\n\t\tconst message = OrderActionsSocketEvent.getMessageForAction(payload.orderAction);\n\t\tconst socketNotificationEvent = new SocketNotificationEvent({\n\t\t\tmessage,\n\t\t\tnotificationType: SocketEventType.ORDER_ACTIONS,\n\t\t\t_id: payload._id,\n\t\t\torderActionType: payload.orderAction,\n\t\t});\n\n\t\tsuper(\n\t\t\tSocketEventType.ORDER_ACTIONS,\n\t\t\tOrderActionsSocketEvent.schemas,\n\t\t\tpayload,\n\t\t\tundefined,\n\t\t\tsocketNotificationEvent\n\t\t);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn '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
|
@@ -26,8 +26,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
26
26
|
searchFields?: string[] | undefined;
|
|
27
27
|
} | undefined;
|
|
28
28
|
sort?: Record<string, 1 | -1> | undefined;
|
|
29
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
30
29
|
populate?: any;
|
|
30
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
31
31
|
query?: Record<string, any> | undefined;
|
|
32
32
|
}, {
|
|
33
33
|
search?: {
|
|
@@ -36,8 +36,8 @@ export declare const FilterSchema: z.ZodOptional<z.ZodObject<{
|
|
|
36
36
|
} | undefined;
|
|
37
37
|
sort?: Record<string, 1 | -1> | undefined;
|
|
38
38
|
size?: number | undefined;
|
|
39
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
40
39
|
populate?: any;
|
|
40
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
41
41
|
query?: Record<string, any> | undefined;
|
|
42
42
|
page?: number | undefined;
|
|
43
43
|
}>>;
|
|
@@ -733,12 +733,12 @@ export declare const GetByIdInputSchema: z.ZodObject<{
|
|
|
733
733
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
734
734
|
}, "strip", z.ZodTypeAny, {
|
|
735
735
|
_id: import("mongoose").Types.ObjectId;
|
|
736
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
737
736
|
populate?: any;
|
|
737
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
738
738
|
}, {
|
|
739
739
|
_id: string | import("mongoose").Types.ObjectId;
|
|
740
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
741
740
|
populate?: any;
|
|
741
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
742
742
|
}>;
|
|
743
743
|
export type GetByIdInputDTO = DTO<typeof GetByIdInputSchema>;
|
|
744
744
|
export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
@@ -751,12 +751,12 @@ export declare const GetProductByIdInputSchema: z.ZodObject<{
|
|
|
751
751
|
_id: import("mongoose").Types.ObjectId;
|
|
752
752
|
withAttributeHiddenItems: boolean;
|
|
753
753
|
withAddonsHiddenItems: boolean;
|
|
754
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
755
754
|
populate?: any;
|
|
755
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
756
756
|
}, {
|
|
757
757
|
_id: string | import("mongoose").Types.ObjectId;
|
|
758
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
759
758
|
populate?: any;
|
|
759
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
760
760
|
withAttributeHiddenItems?: boolean | undefined;
|
|
761
761
|
withAddonsHiddenItems?: boolean | undefined;
|
|
762
762
|
}>;
|
|
@@ -768,13 +768,13 @@ export declare const GetOrderByIdInputSchema: z.ZodObject<{
|
|
|
768
768
|
userOrderCompletionScope: z.ZodOptional<z.ZodNativeEnum<typeof UserOrderCompletionScope>>;
|
|
769
769
|
}, "strip", z.ZodTypeAny, {
|
|
770
770
|
_id: import("mongoose").Types.ObjectId;
|
|
771
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
772
771
|
populate?: any;
|
|
772
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
773
773
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
774
774
|
}, {
|
|
775
775
|
_id: string | import("mongoose").Types.ObjectId;
|
|
776
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
777
776
|
populate?: any;
|
|
777
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
778
778
|
userOrderCompletionScope?: UserOrderCompletionScope | undefined;
|
|
779
779
|
}>;
|
|
780
780
|
export type GetOrderByIdInputDTO = DTO<typeof GetOrderByIdInputSchema>;
|
|
@@ -782,11 +782,11 @@ export declare const GetByTokenInputSchema: z.ZodOptional<z.ZodObject<{
|
|
|
782
782
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
783
783
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
784
784
|
}, "strip", z.ZodTypeAny, {
|
|
785
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
786
785
|
populate?: any;
|
|
787
|
-
}, {
|
|
788
786
|
select?: Record<string, 0 | 1> | undefined;
|
|
787
|
+
}, {
|
|
789
788
|
populate?: any;
|
|
789
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
790
790
|
}>>;
|
|
791
791
|
export type GetByTokenInputDTO = DTO<typeof GetByTokenInputSchema>;
|
|
792
792
|
export declare const GetOneQuerySchema: z.ZodObject<{
|
|
@@ -794,12 +794,12 @@ export declare const GetOneQuerySchema: z.ZodObject<{
|
|
|
794
794
|
select: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>>>;
|
|
795
795
|
populate: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">]>>;
|
|
796
796
|
}, "strip", z.ZodTypeAny, {
|
|
797
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
798
797
|
populate?: any;
|
|
798
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
799
799
|
query?: Record<string, any> | undefined;
|
|
800
800
|
}, {
|
|
801
|
-
select?: Record<string, 0 | 1> | undefined;
|
|
802
801
|
populate?: any;
|
|
802
|
+
select?: Record<string, 0 | 1> | undefined;
|
|
803
803
|
query?: Record<string, any> | undefined;
|
|
804
804
|
}>;
|
|
805
805
|
export type GetOneQueryDTO = DTO<typeof GetOneQuerySchema>;
|
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"]}
|