@lyxa.ai/core 1.2.87 → 1.2.89

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.
Files changed (46) hide show
  1. package/dist/libraries/event/index.js +1 -0
  2. package/dist/libraries/event/index.js.map +1 -1
  3. package/dist/libraries/socket/BaseSocketEvent.d.ts +2 -2
  4. package/dist/libraries/socket/BaseSocketEvent.js +6 -8
  5. package/dist/libraries/socket/BaseSocketEvent.js.map +1 -1
  6. package/dist/libraries/socket/PushNotificationEvent.js.map +1 -1
  7. package/dist/libraries/socket/adapters/socket-subscription.d.ts +3 -3
  8. package/dist/libraries/socket/adapters/socket-subscription.js.map +1 -1
  9. package/dist/libraries/socket/core/socket-event-publisher.d.ts +2 -1
  10. package/dist/libraries/socket/core/socket-event-publisher.js +8 -6
  11. package/dist/libraries/socket/core/socket-event-publisher.js.map +1 -1
  12. package/dist/libraries/socket/core/socket-event-registry.d.ts +10 -19
  13. package/dist/libraries/socket/core/socket-event-registry.js +10 -8
  14. package/dist/libraries/socket/core/socket-event-registry.js.map +1 -1
  15. package/dist/libraries/socket/core/socket-event-registry.map.d.ts +21 -344
  16. package/dist/libraries/socket/core/socket-event-registry.map.js +17 -35
  17. package/dist/libraries/socket/core/socket-event-registry.map.js.map +1 -1
  18. package/dist/libraries/socket/core/socket-redis-connections.js +17 -3
  19. package/dist/libraries/socket/core/socket-redis-connections.js.map +1 -1
  20. package/dist/libraries/socket/events/chatlist-message-send.socket.event.d.ts +5 -36
  21. package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +12 -8
  22. package/dist/libraries/socket/events/chatlist-message-send.socket.event.js.map +1 -1
  23. package/dist/libraries/socket/events/chatroom-message-send.socket.event.d.ts +95 -1
  24. package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +22 -1
  25. package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -1
  26. package/dist/libraries/socket/events/notification.socket.event.d.ts +1 -0
  27. package/dist/libraries/socket/events/notification.socket.event.js +3 -0
  28. package/dist/libraries/socket/events/notification.socket.event.js.map +1 -1
  29. package/dist/libraries/socket/events/rider-connect.socket.event.d.ts +1 -0
  30. package/dist/libraries/socket/events/rider-connect.socket.event.js +3 -0
  31. package/dist/libraries/socket/events/rider-connect.socket.event.js.map +1 -1
  32. package/dist/libraries/socket/events/rider-location-update.socket.event.d.ts +1 -0
  33. package/dist/libraries/socket/events/rider-location-update.socket.event.js +3 -0
  34. package/dist/libraries/socket/events/rider-location-update.socket.event.js.map +1 -1
  35. package/dist/libraries/socket/events/ticket-actions.socket.event.d.ts +5 -7
  36. package/dist/libraries/socket/events/ticket-actions.socket.event.js +16 -7
  37. package/dist/libraries/socket/events/ticket-actions.socket.event.js.map +1 -1
  38. package/dist/libraries/socket/events/ticket-assign.socket.event.d.ts +1 -0
  39. package/dist/libraries/socket/events/ticket-assign.socket.event.js +3 -0
  40. package/dist/libraries/socket/events/ticket-assign.socket.event.js.map +1 -1
  41. package/dist/libraries/socket/events/ticket-unassign.socket.event.d.ts +2 -0
  42. package/dist/libraries/socket/events/ticket-unassign.socket.event.js +6 -0
  43. package/dist/libraries/socket/events/ticket-unassign.socket.event.js.map +1 -1
  44. package/dist/types/README.md +1 -1
  45. package/dist/types/package.json +1 -1
  46. package/package.json +1 -1
@@ -1,354 +1,31 @@
1
1
  import { ChatlistMessageSendSocketEvent, ChatroomMessageSendSocketEvent } from '../events';
2
2
  import { TicketAssignEvent } from '../events/ticket-assign.socket.event';
3
3
  import { TicketUnassignEvent } from '../events/ticket-unassign.socket.event';
4
- import { EventRegistration } from './index';
5
4
  import { NotificationSocketEvent } from '../events/notification.socket.event';
6
5
  import { RiderConnectSocketEvent } from '../events/rider-connect.socket.event';
7
6
  import { RiderLocationUpdateSocketEvent } from '../events/rider-location-update.socket.event';
8
7
  import { TicketActionsSocketEvent } from '../events/ticket-actions.socket.event';
8
+ import type { ZodTypeAny } from 'zod';
9
9
  export declare const REGISTRY: {
10
- readonly CHATROOM_MESSAGE_SEND: {
11
- readonly ctor: typeof ChatroomMessageSendSocketEvent;
12
- readonly schemas: {
13
- input: import("zod").ZodObject<{
14
- chatroomId: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
15
- }, "strip", import("zod").ZodTypeAny, {
16
- chatroomId: import("mongoose").Types.ObjectId;
17
- }, {
18
- chatroomId: string | import("mongoose").Types.ObjectId;
19
- }>;
20
- output: import("zod").ZodObject<{
21
- _id: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
22
- senderId: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
23
- senderType: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").UserRef>;
24
- sender: import("zod").ZodObject<{
25
- id: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
26
- type: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").UserRef>;
27
- }, "strip", import("zod").ZodTypeAny, {
28
- type: import("../../../utilities/enum").UserRef;
29
- id: import("mongoose").Types.ObjectId;
30
- }, {
31
- type: import("../../../utilities/enum").UserRef;
32
- id: import("mongoose").Types.ObjectId;
33
- }>;
34
- content: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
35
- media: import("zod").ZodArray<import("zod").ZodObject<{
36
- mimeType: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
37
- mediaType: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").MediaType>;
38
- mediaUrl: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
39
- thumbnailUrl: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
40
- name: import("zod").ZodOptional<import("zod").ZodString> | import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
41
- }, "strip", import("zod").ZodTypeAny, {
42
- mediaType: import("../../../utilities/enum").MediaType;
43
- mediaUrl: string;
44
- mimeType: string;
45
- name?: string | undefined;
46
- thumbnailUrl?: string | undefined;
47
- }, {
48
- mediaType: import("../../../utilities/enum").MediaType;
49
- mediaUrl: string;
50
- mimeType: string;
51
- name?: string | undefined;
52
- thumbnailUrl?: string | undefined;
53
- }>, "many">;
54
- location: import("zod").ZodOptional<import("zod").ZodObject<{
55
- longitude: import("zod").ZodOptional<import("zod").ZodNumber>;
56
- latitude: import("zod").ZodOptional<import("zod").ZodNumber>;
57
- }, "strip", import("zod").ZodTypeAny, {
58
- latitude?: number | undefined;
59
- longitude?: number | undefined;
60
- }, {
61
- latitude?: number | undefined;
62
- longitude?: number | undefined;
63
- }>>;
64
- chatroomId: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
65
- createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
66
- }, "strip", import("zod").ZodTypeAny, {
67
- media: {
68
- mediaType: import("../../../utilities/enum").MediaType;
69
- mediaUrl: string;
70
- mimeType: string;
71
- name?: string | undefined;
72
- thumbnailUrl?: string | undefined;
73
- }[];
74
- _id: import("mongoose").Types.ObjectId;
75
- createdAt: Date;
76
- sender: {
77
- type: import("../../../utilities/enum").UserRef;
78
- id: import("mongoose").Types.ObjectId;
79
- };
80
- senderType: import("../../../utilities/enum").UserRef;
81
- senderId: import("mongoose").Types.ObjectId;
82
- location?: {
83
- latitude?: number | undefined;
84
- longitude?: number | undefined;
85
- } | undefined;
86
- content?: string | undefined;
87
- chatroomId?: import("mongoose").Types.ObjectId | undefined;
88
- }, {
89
- media: {
90
- mediaType: import("../../../utilities/enum").MediaType;
91
- mediaUrl: string;
92
- mimeType: string;
93
- name?: string | undefined;
94
- thumbnailUrl?: string | undefined;
95
- }[];
96
- _id: import("mongoose").Types.ObjectId;
97
- createdAt: Date;
98
- sender: {
99
- type: import("../../../utilities/enum").UserRef;
100
- id: import("mongoose").Types.ObjectId;
101
- };
102
- senderType: import("../../../utilities/enum").UserRef;
103
- senderId: import("mongoose").Types.ObjectId;
104
- location?: {
105
- latitude?: number | undefined;
106
- longitude?: number | undefined;
107
- } | undefined;
108
- content?: string | undefined;
109
- chatroomId?: import("mongoose").Types.ObjectId | undefined;
110
- }>;
111
- };
112
- readonly identifier: typeof ChatroomMessageSendSocketEvent.identifier;
113
- };
114
- readonly CHATLIST_MESSAGE_RECEIVED: {
115
- readonly ctor: typeof ChatlistMessageSendSocketEvent;
116
- readonly schemas: {
117
- input: import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>;
118
- output: import("zod").ZodObject<{
119
- chatroomId: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
120
- lastMessage: import("zod").ZodOptional<import("zod").ZodObject<{
121
- content: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
122
- createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
123
- }, "strip", import("zod").ZodTypeAny, {
124
- content: string;
125
- createdAt: Date;
126
- }, {
127
- content: string;
128
- createdAt: Date;
129
- }>>;
130
- unreadCount: import("zod").ZodNumber;
131
- }, "strip", import("zod").ZodTypeAny, {
132
- unreadCount: number;
133
- chatroomId: import("mongoose").Types.ObjectId;
134
- lastMessage?: {
135
- content: string;
136
- createdAt: Date;
137
- } | undefined;
138
- }, {
139
- unreadCount: number;
140
- chatroomId: import("mongoose").Types.ObjectId;
141
- lastMessage?: {
142
- content: string;
143
- createdAt: Date;
144
- } | undefined;
145
- }>;
146
- pushNotificationOutput: import("zod").ZodObject<{
147
- chatroomId: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
148
- lastMessage: import("zod").ZodOptional<import("zod").ZodObject<{
149
- content: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
150
- createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodDate, Date, Date>, Date, Date>;
151
- }, "strip", import("zod").ZodTypeAny, {
152
- content: string;
153
- createdAt: Date;
154
- }, {
155
- content: string;
156
- createdAt: Date;
157
- }>>;
158
- unreadCount: import("zod").ZodNumber;
159
- }, "strip", import("zod").ZodTypeAny, {
160
- unreadCount: number;
161
- chatroomId: import("mongoose").Types.ObjectId;
162
- lastMessage?: {
163
- content: string;
164
- createdAt: Date;
165
- } | undefined;
166
- }, {
167
- unreadCount: number;
168
- chatroomId: import("mongoose").Types.ObjectId;
169
- lastMessage?: {
170
- content: string;
171
- createdAt: Date;
172
- } | undefined;
173
- }>;
174
- };
175
- };
176
- readonly TICKET_ASSIGN: {
177
- readonly ctor: typeof TicketAssignEvent;
178
- readonly schemas: {
179
- input: import("zod").ZodUndefined;
180
- output: import("zod").ZodObject<{
181
- _id: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
182
- type: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").TicketType>;
183
- status: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").TicketStatus>;
184
- client: import("zod").ZodObject<{
185
- _id: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
186
- type: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").UserRef>;
187
- name: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
188
- profilePhoto: import("zod").ZodNullable<import("zod").ZodString> | import("zod").ZodNullable<import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>>;
189
- }, "strip", import("zod").ZodTypeAny, {
190
- name: string;
191
- type: import("../../../utilities/enum").UserRef;
192
- _id: import("mongoose").Types.ObjectId;
193
- profilePhoto: string | null;
194
- }, {
195
- name: string;
196
- type: import("../../../utilities/enum").UserRef;
197
- _id: string | import("mongoose").Types.ObjectId;
198
- profilePhoto: string | null;
199
- }>;
200
- createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, Date, string>, import("zod").ZodDate]>, Date, string | Date>, Date, string | Date>;
201
- updatedAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, Date, string>, import("zod").ZodDate]>, Date, string | Date>, Date, string | Date>;
202
- orderId: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
203
- chatroomId: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
204
- lastMessage: import("zod").ZodObject<{
205
- content: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
206
- createdAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, Date, string>, import("zod").ZodDate]>, Date, string | Date>, Date, string | Date>;
207
- }, "strip", import("zod").ZodTypeAny, {
208
- content: string;
209
- createdAt: Date;
210
- }, {
211
- content: string;
212
- createdAt: string | Date;
213
- }>;
214
- unreadCount: import("zod").ZodNumber;
215
- }, "strip", import("zod").ZodTypeAny, {
216
- type: import("../../../utilities/enum").TicketType;
217
- client: {
218
- name: string;
219
- type: import("../../../utilities/enum").UserRef;
220
- _id: import("mongoose").Types.ObjectId;
221
- profilePhoto: string | null;
222
- };
223
- status: import("../../../utilities/enum").TicketStatus;
224
- _id: import("mongoose").Types.ObjectId;
225
- createdAt: Date;
226
- updatedAt: Date;
227
- lastMessage: {
228
- content: string;
229
- createdAt: Date;
230
- };
231
- unreadCount: number;
232
- chatroomId: import("mongoose").Types.ObjectId;
233
- orderId?: import("mongoose").Types.ObjectId | undefined;
234
- }, {
235
- type: import("../../../utilities/enum").TicketType;
236
- client: {
237
- name: string;
238
- type: import("../../../utilities/enum").UserRef;
239
- _id: string | import("mongoose").Types.ObjectId;
240
- profilePhoto: string | null;
241
- };
242
- status: import("../../../utilities/enum").TicketStatus;
243
- _id: string | import("mongoose").Types.ObjectId;
244
- createdAt: string | Date;
245
- updatedAt: string | Date;
246
- lastMessage: {
247
- content: string;
248
- createdAt: string | Date;
249
- };
250
- unreadCount: number;
251
- chatroomId: string | import("mongoose").Types.ObjectId;
252
- orderId?: string | import("mongoose").Types.ObjectId | undefined;
253
- }>;
254
- };
255
- };
256
- readonly TICKET_UNASSIGN: {
257
- readonly ctor: typeof TicketUnassignEvent;
258
- readonly schemas: {
259
- input: import("zod").ZodUndefined;
260
- output: import("zod").ZodObject<{
261
- _id: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
262
- }, "strip", import("zod").ZodTypeAny, {
263
- _id: import("mongoose").Types.ObjectId;
264
- }, {
265
- _id: import("mongoose").Types.ObjectId;
266
- }>;
267
- };
268
- readonly identifier: typeof import("./index").BaseSocketEvent.identifier;
269
- };
270
- readonly NOTIFICATION: {
271
- readonly ctor: typeof NotificationSocketEvent;
272
- readonly schemas: {
273
- input: import("zod").ZodUndefined;
274
- output: import("zod").ZodObject<{
275
- message: import("zod").ZodString | import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, string, string>;
276
- }, "strip", import("zod").ZodTypeAny, {
277
- message: string;
278
- }, {
279
- message: string;
280
- }>;
281
- };
282
- };
283
- readonly RIDER_CONNECT: {
284
- readonly ctor: typeof RiderConnectSocketEvent;
285
- readonly schemas: {
286
- input: import("zod").ZodUndefined;
287
- output: import("zod").ZodAny;
288
- };
289
- };
290
- readonly RIDER_LOCATION_UPDATE: {
291
- readonly ctor: typeof RiderLocationUpdateSocketEvent;
292
- readonly schemas: {
293
- input: import("zod").ZodObject<{
294
- riderId: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
295
- orderId: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>>;
296
- }, "strip", import("zod").ZodTypeAny, {
297
- riderId: import("mongoose").Types.ObjectId;
298
- orderId?: import("mongoose").Types.ObjectId | undefined;
299
- }, {
300
- riderId: string | import("mongoose").Types.ObjectId;
301
- orderId?: string | import("mongoose").Types.ObjectId | undefined;
302
- }>;
303
- output: import("zod").ZodObject<{
304
- _id: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
305
- riderId: import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, import("mongoose").Types.ObjectId, string>, import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>]>;
306
- latitude: import("zod").ZodNumber;
307
- longitude: import("zod").ZodNumber;
308
- updatedAt: import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodEffects<import("zod").ZodString, string, string>, Date, string>, import("zod").ZodDate]>, Date, string | Date>, Date, string | Date>;
309
- }, "strip", import("zod").ZodTypeAny, {
310
- _id: import("mongoose").Types.ObjectId;
311
- updatedAt: Date;
312
- latitude: number;
313
- longitude: number;
314
- riderId: import("mongoose").Types.ObjectId;
315
- }, {
316
- _id: string | import("mongoose").Types.ObjectId;
317
- updatedAt: string | Date;
318
- latitude: number;
319
- longitude: number;
320
- riderId: string | import("mongoose").Types.ObjectId;
321
- }>;
322
- };
323
- readonly identifier: typeof RiderLocationUpdateSocketEvent.identifier;
324
- };
325
- readonly TICKET_ACCEPT: {
326
- readonly ctor: typeof TicketActionsSocketEvent;
327
- readonly schemas: {
328
- input: import("zod").ZodUndefined;
329
- output: import("zod").ZodObject<{
330
- _id: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
331
- status: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").TicketStatus>;
332
- }, "strip", import("zod").ZodTypeAny, {
333
- status: import("../../../utilities/enum").TicketStatus;
334
- _id: import("mongoose").Types.ObjectId;
335
- }, {
336
- status: import("../../../utilities/enum").TicketStatus;
337
- _id: import("mongoose").Types.ObjectId;
338
- }>;
339
- pushNotificationOutput: import("zod").ZodObject<{
340
- _id: import("zod").ZodEffects<import("zod").ZodType<import("mongoose").Types.ObjectId, import("zod").ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
341
- status: import("zod").ZodNativeEnum<typeof import("../../../utilities/enum").TicketStatus>;
342
- }, "strip", import("zod").ZodTypeAny, {
343
- status: import("../../../utilities/enum").TicketStatus;
344
- _id: import("mongoose").Types.ObjectId;
345
- }, {
346
- status: import("../../../utilities/enum").TicketStatus;
347
- _id: import("mongoose").Types.ObjectId;
348
- }>;
349
- };
350
- };
10
+ readonly CHATROOM_MESSAGE_SEND: typeof ChatroomMessageSendSocketEvent;
11
+ readonly CHATLIST_MESSAGE_RECEIVED: typeof ChatlistMessageSendSocketEvent;
12
+ readonly TICKET_ASSIGN: typeof TicketAssignEvent;
13
+ readonly TICKET_UNASSIGN: typeof TicketUnassignEvent;
14
+ readonly NOTIFICATION: typeof NotificationSocketEvent;
15
+ readonly RIDER_CONNECT: typeof RiderConnectSocketEvent;
16
+ readonly RIDER_LOCATION_UPDATE: typeof RiderLocationUpdateSocketEvent;
17
+ readonly TICKET_ACCEPT: typeof TicketActionsSocketEvent;
351
18
  };
352
- export type Registry = {
353
- [K in keyof typeof REGISTRY]: (typeof REGISTRY)[K] extends EventRegistration<any> ? (typeof REGISTRY)[K] : never;
19
+ export type Registry = typeof REGISTRY;
20
+ type EventSchemas = {
21
+ input: ZodTypeAny;
22
+ output: ZodTypeAny;
23
+ pushNotificationOutput?: ZodTypeAny;
354
24
  };
25
+ export declare function getSchemas<T extends {
26
+ schemas: EventSchemas;
27
+ }>(eventClass: T): T['schemas'];
28
+ export declare function getIdentifier<T extends object>(eventClass: T): T extends {
29
+ identifier: infer I;
30
+ } ? I : undefined;
31
+ export {};
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.REGISTRY = void 0;
4
+ exports.getSchemas = getSchemas;
5
+ exports.getIdentifier = getIdentifier;
4
6
  const enum_1 = require("../../../utilities/enum");
5
7
  const events_1 = require("../events");
6
8
  const ticket_assign_socket_event_1 = require("../events/ticket-assign.socket.event");
@@ -10,40 +12,20 @@ const rider_connect_socket_event_1 = require("../events/rider-connect.socket.eve
10
12
  const rider_location_update_socket_event_1 = require("../events/rider-location-update.socket.event");
11
13
  const ticket_actions_socket_event_1 = require("../events/ticket-actions.socket.event");
12
14
  exports.REGISTRY = {
13
- [enum_1.SocketEventType.CHATROOM_MESSAGE_SEND]: {
14
- ctor: events_1.ChatroomMessageSendSocketEvent,
15
- schemas: events_1.ChatroomMessageSendSocketEvent.schemas,
16
- identifier: events_1.ChatroomMessageSendSocketEvent.identifier,
17
- },
18
- [enum_1.SocketEventType.CHATLIST_MESSAGE_RECEIVED]: {
19
- ctor: events_1.ChatlistMessageSendSocketEvent,
20
- schemas: events_1.ChatlistMessageSendSocketEvent.schemas,
21
- },
22
- [enum_1.SocketEventType.TICKET_ASSIGN]: {
23
- ctor: ticket_assign_socket_event_1.TicketAssignEvent,
24
- schemas: ticket_assign_socket_event_1.TicketAssignEvent.schemas,
25
- },
26
- [enum_1.SocketEventType.TICKET_UNASSIGN]: {
27
- ctor: ticket_unassign_socket_event_1.TicketUnassignEvent,
28
- schemas: ticket_unassign_socket_event_1.TicketUnassignEvent.schemas,
29
- identifier: ticket_unassign_socket_event_1.TicketUnassignEvent.identifier,
30
- },
31
- [enum_1.SocketEventType.NOTIFICATION]: {
32
- ctor: notification_socket_event_1.NotificationSocketEvent,
33
- schemas: notification_socket_event_1.NotificationSocketEvent.schemas,
34
- },
35
- [enum_1.SocketEventType.RIDER_CONNECT]: {
36
- ctor: rider_connect_socket_event_1.RiderConnectSocketEvent,
37
- schemas: rider_connect_socket_event_1.RiderConnectSocketEvent.schemas,
38
- },
39
- [enum_1.SocketEventType.RIDER_LOCATION_UPDATE]: {
40
- ctor: rider_location_update_socket_event_1.RiderLocationUpdateSocketEvent,
41
- schemas: rider_location_update_socket_event_1.RiderLocationUpdateSocketEvent.schemas,
42
- identifier: rider_location_update_socket_event_1.RiderLocationUpdateSocketEvent.identifier,
43
- },
44
- [enum_1.SocketEventType.TICKET_ACTIONS]: {
45
- ctor: ticket_actions_socket_event_1.TicketActionsSocketEvent,
46
- schemas: ticket_actions_socket_event_1.TicketActionsSocketEvent.schemas,
47
- },
15
+ [enum_1.SocketEventType.CHATROOM_MESSAGE_SEND]: events_1.ChatroomMessageSendSocketEvent,
16
+ [enum_1.SocketEventType.CHATLIST_MESSAGE_RECEIVED]: events_1.ChatlistMessageSendSocketEvent,
17
+ [enum_1.SocketEventType.TICKET_ASSIGN]: ticket_assign_socket_event_1.TicketAssignEvent,
18
+ [enum_1.SocketEventType.TICKET_UNASSIGN]: ticket_unassign_socket_event_1.TicketUnassignEvent,
19
+ [enum_1.SocketEventType.NOTIFICATION]: notification_socket_event_1.NotificationSocketEvent,
20
+ [enum_1.SocketEventType.RIDER_CONNECT]: rider_connect_socket_event_1.RiderConnectSocketEvent,
21
+ [enum_1.SocketEventType.RIDER_LOCATION_UPDATE]: rider_location_update_socket_event_1.RiderLocationUpdateSocketEvent,
22
+ [enum_1.SocketEventType.TICKET_ACTIONS]: ticket_actions_socket_event_1.TicketActionsSocketEvent,
48
23
  };
24
+ function getSchemas(eventClass) {
25
+ return eventClass.schemas;
26
+ }
27
+ function getIdentifier(eventClass) {
28
+ const hasIdentifier = 'identifier' in eventClass && typeof eventClass.identifier === 'function';
29
+ return (hasIdentifier ? eventClass.identifier : undefined);
30
+ }
49
31
  //# sourceMappingURL=socket-event-registry.map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"socket-event-registry.map.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.map.ts"],"names":[],"mappings":";;;AAAA,kDAA0D;AAC1D,sCAA2F;AAC3F,qFAAyE;AACzE,yFAA6E;AAE7E,mFAA8E;AAC9E,qFAA+E;AAC/E,qGAA8F;AAC9F,uFAAiF;AAEpE,QAAA,QAAQ,GAAG;IACvB,CAAC,sBAAe,CAAC,qBAAqB,CAAC,EAAE;QACxC,IAAI,EAAE,uCAA8B;QACpC,OAAO,EAAE,uCAA8B,CAAC,OAAO;QAC/C,UAAU,EAAE,uCAA8B,CAAC,UAAU;KACrD;IACD,CAAC,sBAAe,CAAC,yBAAyB,CAAC,EAAE;QAC5C,IAAI,EAAE,uCAA8B;QACpC,OAAO,EAAE,uCAA8B,CAAC,OAAO;KAC/C;IACD,CAAC,sBAAe,CAAC,aAAa,CAAC,EAAE;QAChC,IAAI,EAAE,8CAAiB;QACvB,OAAO,EAAE,8CAAiB,CAAC,OAAO;KAClC;IACD,CAAC,sBAAe,CAAC,eAAe,CAAC,EAAE;QAClC,IAAI,EAAE,kDAAmB;QACzB,OAAO,EAAE,kDAAmB,CAAC,OAAO;QACpC,UAAU,EAAE,kDAAmB,CAAC,UAAU;KAC1C;IACD,CAAC,sBAAe,CAAC,YAAY,CAAC,EAAE;QAC/B,IAAI,EAAE,mDAAuB;QAC7B,OAAO,EAAE,mDAAuB,CAAC,OAAO;KACxC;IACD,CAAC,sBAAe,CAAC,aAAa,CAAC,EAAE;QAChC,IAAI,EAAE,oDAAuB;QAC7B,OAAO,EAAE,oDAAuB,CAAC,OAAO;KACxC;IACD,CAAC,sBAAe,CAAC,qBAAqB,CAAC,EAAE;QACxC,IAAI,EAAE,mEAA8B;QACpC,OAAO,EAAE,mEAA8B,CAAC,OAAO;QAC/C,UAAU,EAAE,mEAA8B,CAAC,UAAU;KACrD;IACD,CAAC,sBAAe,CAAC,cAAc,CAAC,EAAE;QACjC,IAAI,EAAE,sDAAwB;QAC9B,OAAO,EAAE,sDAAwB,CAAC,OAAO;KACzC;CACQ,CAAC","sourcesContent":["import { SocketEventType } from '../../../utilities/enum';\nimport { ChatlistMessageSendSocketEvent, ChatroomMessageSendSocketEvent } from '../events';\nimport { TicketAssignEvent } from '../events/ticket-assign.socket.event';\nimport { TicketUnassignEvent } from '../events/ticket-unassign.socket.event';\nimport { EventRegistration } from './index';\nimport { NotificationSocketEvent } from '../events/notification.socket.event';\nimport { RiderConnectSocketEvent } from '../events/rider-connect.socket.event';\nimport { RiderLocationUpdateSocketEvent } from '../events/rider-location-update.socket.event';\nimport { TicketActionsSocketEvent } from '../events/ticket-actions.socket.event';\n\nexport const REGISTRY = {\n\t[SocketEventType.CHATROOM_MESSAGE_SEND]: {\n\t\tctor: ChatroomMessageSendSocketEvent,\n\t\tschemas: ChatroomMessageSendSocketEvent.schemas,\n\t\tidentifier: ChatroomMessageSendSocketEvent.identifier,\n\t},\n\t[SocketEventType.CHATLIST_MESSAGE_RECEIVED]: {\n\t\tctor: ChatlistMessageSendSocketEvent,\n\t\tschemas: ChatlistMessageSendSocketEvent.schemas,\n\t},\n\t[SocketEventType.TICKET_ASSIGN]: {\n\t\tctor: TicketAssignEvent,\n\t\tschemas: TicketAssignEvent.schemas,\n\t},\n\t[SocketEventType.TICKET_UNASSIGN]: {\n\t\tctor: TicketUnassignEvent,\n\t\tschemas: TicketUnassignEvent.schemas,\n\t\tidentifier: TicketUnassignEvent.identifier,\n\t},\n\t[SocketEventType.NOTIFICATION]: {\n\t\tctor: NotificationSocketEvent,\n\t\tschemas: NotificationSocketEvent.schemas,\n\t},\n\t[SocketEventType.RIDER_CONNECT]: {\n\t\tctor: RiderConnectSocketEvent,\n\t\tschemas: RiderConnectSocketEvent.schemas,\n\t},\n\t[SocketEventType.RIDER_LOCATION_UPDATE]: {\n\t\tctor: RiderLocationUpdateSocketEvent,\n\t\tschemas: RiderLocationUpdateSocketEvent.schemas,\n\t\tidentifier: RiderLocationUpdateSocketEvent.identifier,\n\t},\n\t[SocketEventType.TICKET_ACTIONS]: {\n\t\tctor: TicketActionsSocketEvent,\n\t\tschemas: TicketActionsSocketEvent.schemas,\n\t},\n} as const;\n\nexport type Registry = {\n\t[K in keyof typeof REGISTRY]: (typeof REGISTRY)[K] extends EventRegistration<any>\n\t\t? (typeof REGISTRY)[K]\n\t\t: never;\n};\n"]}
1
+ {"version":3,"file":"socket-event-registry.map.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-registry.map.ts"],"names":[],"mappings":";;;AA+BA,gCAEC;AAGD,sCAUC;AA9CD,kDAA0D;AAC1D,sCAA2F;AAC3F,qFAAyE;AACzE,yFAA6E;AAC7E,mFAA8E;AAC9E,qFAA+E;AAC/E,qGAA8F;AAC9F,uFAAiF;AAGpE,QAAA,QAAQ,GAAG;IACvB,CAAC,sBAAe,CAAC,qBAAqB,CAAC,EAAE,uCAA8B;IACvE,CAAC,sBAAe,CAAC,yBAAyB,CAAC,EAAE,uCAA8B;IAC3E,CAAC,sBAAe,CAAC,aAAa,CAAC,EAAE,8CAAiB;IAClD,CAAC,sBAAe,CAAC,eAAe,CAAC,EAAE,kDAAmB;IACtD,CAAC,sBAAe,CAAC,YAAY,CAAC,EAAE,mDAAuB;IACvD,CAAC,sBAAe,CAAC,aAAa,CAAC,EAAE,oDAAuB;IACxD,CAAC,sBAAe,CAAC,qBAAqB,CAAC,EAAE,mEAA8B;IACvE,CAAC,sBAAe,CAAC,cAAc,CAAC,EAAE,sDAAwB;CACjD,CAAC;AAYX,SAAgB,UAAU,CAAsC,UAAa;IAC5E,OAAO,UAAU,CAAC,OAAO,CAAC;AAC3B,CAAC;AAGD,SAAgB,aAAa,CAC5B,UAAa;IAEb,MAAM,aAAa,GAClB,YAAY,IAAI,UAAU,IAAI,OAAQ,UAAqC,CAAC,UAAU,KAAK,UAAU,CAAC;IACvG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAE,UAAoC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAIxE,CAAC;AACd,CAAC","sourcesContent":["import { SocketEventType } from '../../../utilities/enum';\nimport { ChatlistMessageSendSocketEvent, ChatroomMessageSendSocketEvent } from '../events';\nimport { TicketAssignEvent } from '../events/ticket-assign.socket.event';\nimport { TicketUnassignEvent } from '../events/ticket-unassign.socket.event';\nimport { NotificationSocketEvent } from '../events/notification.socket.event';\nimport { RiderConnectSocketEvent } from '../events/rider-connect.socket.event';\nimport { RiderLocationUpdateSocketEvent } from '../events/rider-location-update.socket.event';\nimport { TicketActionsSocketEvent } from '../events/ticket-actions.socket.event';\nimport type { ZodTypeAny } from 'zod';\n\nexport const REGISTRY = {\n\t[SocketEventType.CHATROOM_MESSAGE_SEND]: ChatroomMessageSendSocketEvent,\n\t[SocketEventType.CHATLIST_MESSAGE_RECEIVED]: ChatlistMessageSendSocketEvent,\n\t[SocketEventType.TICKET_ASSIGN]: TicketAssignEvent,\n\t[SocketEventType.TICKET_UNASSIGN]: TicketUnassignEvent,\n\t[SocketEventType.NOTIFICATION]: NotificationSocketEvent,\n\t[SocketEventType.RIDER_CONNECT]: RiderConnectSocketEvent,\n\t[SocketEventType.RIDER_LOCATION_UPDATE]: RiderLocationUpdateSocketEvent,\n\t[SocketEventType.TICKET_ACTIONS]: TicketActionsSocketEvent,\n} as const;\n\nexport type Registry = typeof REGISTRY;\n\n// Type-safe schema structure constraint\ntype EventSchemas = {\n\tinput: ZodTypeAny;\n\toutput: ZodTypeAny;\n\tpushNotificationOutput?: ZodTypeAny;\n};\n\n// Extract schemas from event class with full type inference\nexport function getSchemas<T extends { schemas: EventSchemas }>(eventClass: T): T['schemas'] {\n\treturn eventClass.schemas;\n}\n\n// Extract identifier function if present, otherwise undefined \nexport function getIdentifier<T extends object>(\n\teventClass: T\n): T extends { identifier: infer I } ? I : undefined {\n\tconst hasIdentifier =\n\t\t'identifier' in eventClass && typeof (eventClass as { identifier?: never }).identifier === 'function';\n\treturn (hasIdentifier ? (eventClass as { identifier: never }).identifier : undefined) as T extends {\n\t\tidentifier: infer I;\n\t}\n\t\t? I\n\t\t: undefined;\n}\n"]}
@@ -82,14 +82,28 @@ async function connectEntityToSocketEvent(entity, socketRedisEventInformation) {
82
82
  subscriptionCache.delete(cacheKey);
83
83
  eventSubscribersCache.delete(socketRedisEventInformation.eventKey);
84
84
  }
85
+ async function scanKeys(redis, pattern) {
86
+ const keys = [];
87
+ let cursor = '0';
88
+ do {
89
+ const [newCursor, foundKeys] = await redis.scan(cursor, 'MATCH', pattern, 'COUNT', 100);
90
+ cursor = newCursor;
91
+ if (foundKeys.length > 0) {
92
+ keys.push(...foundKeys);
93
+ }
94
+ } while (cursor !== '0');
95
+ return keys;
96
+ }
85
97
  async function getConnectedEntityByType(type) {
86
98
  const redis = (0, __1.getLibraries)().getRedisService();
87
99
  const pattern = `socket:entity:${type}:*`;
88
- const keys = await redis.redisClient.keys(pattern);
100
+ const keys = await scanKeys(redis.redisClient, pattern);
89
101
  const idSet = new Set();
90
102
  for (const key of keys) {
91
103
  const parts = key.split(':');
92
- idSet.add(parts[3]);
104
+ if (parts.length >= 4) {
105
+ idSet.add(parts[3]);
106
+ }
93
107
  }
94
108
  return Array.from(idSet);
95
109
  }
@@ -192,7 +206,7 @@ async function disconnectAllEntitiesFromInstance(entityType) {
192
206
  const instanceId = (0, instance_utils_1.getInstanceId)();
193
207
  const redis = (0, __1.getLibraries)().getRedisService();
194
208
  const pattern = entityType ? `socket:entity:${entityType}:*` : 'socket:entity:*';
195
- const entityEventKeys = await redis.redisClient.keys(pattern);
209
+ const entityEventKeys = await scanKeys(redis.redisClient, pattern);
196
210
  if (!entityEventKeys.length)
197
211
  return;
198
212
  const affectedEvents = new Set();