@lyxa.ai/core 1.2.85 → 1.2.86
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/event/EventEnums.d.ts +1 -2
- package/dist/libraries/event/EventEnums.js +0 -1
- package/dist/libraries/event/EventEnums.js.map +1 -1
- package/dist/libraries/event/index.d.ts +1 -6
- package/dist/libraries/event/index.js +4 -6
- package/dist/libraries/event/index.js.map +1 -1
- package/dist/libraries/mongo/models/providers/core-email-auth-identity.model.js +6 -1
- package/dist/libraries/mongo/models/providers/core-email-auth-identity.model.js.map +1 -1
- package/dist/libraries/socket/BaseSocketEvent.d.ts +4 -9
- package/dist/libraries/socket/BaseSocketEvent.js +1 -13
- package/dist/libraries/socket/BaseSocketEvent.js.map +1 -1
- package/dist/libraries/socket/PushNotificationEvent.d.ts +10 -27
- package/dist/libraries/socket/PushNotificationEvent.js +5 -30
- package/dist/libraries/socket/PushNotificationEvent.js.map +1 -1
- package/dist/libraries/socket/core/socket-event-publisher.js +7 -4
- package/dist/libraries/socket/core/socket-event-publisher.js.map +1 -1
- package/dist/libraries/socket/core/socket-event-registry.map.d.ts +0 -55
- package/dist/libraries/socket/core/socket-event-registry.map.js +0 -5
- package/dist/libraries/socket/core/socket-event-registry.map.js.map +1 -1
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.d.ts +2 -66
- package/dist/libraries/socket/events/chatlist-message-send.socket.event.js +3 -10
- 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 +2 -0
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js +6 -4
- package/dist/libraries/socket/events/chatroom-message-send.socket.event.js.map +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/enum.d.ts +1 -5
- package/dist/types/utilities/enum.js +0 -4
- package/dist/types/utilities/enum.js.map +1 -1
- package/dist/utilities/enum.d.ts +1 -5
- package/dist/utilities/enum.js +0 -4
- package/dist/utilities/enum.js.map +1 -1
- package/package.json +1 -1
- package/dist/libraries/socket/events/ticket-actions.socket.event.d.ts +0 -59
- package/dist/libraries/socket/events/ticket-actions.socket.event.js +0 -33
- package/dist/libraries/socket/events/ticket-actions.socket.event.js.map +0 -1
|
@@ -5,6 +5,5 @@ export declare enum PublishEventEnums {
|
|
|
5
5
|
CART_ITEM_UPSERT_EVENT = "cart_item_upsert_event",
|
|
6
6
|
SHOP_ACTIVE_TIMINGS_BATCH_PROCESS_EVENT = "shop_active_timings_batch_process_event",
|
|
7
7
|
MONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT = "mongo_stream_changes_batch_process_shops_event",
|
|
8
|
-
BULK_UPDATE_SHOPS_SEARCH_FIELDS_EVENT = "bulk_update_shops_search_fields_event"
|
|
9
|
-
SOCKET_PUSH_NOTIFICATION_EVENT = "socket_push_notification_event"
|
|
8
|
+
BULK_UPDATE_SHOPS_SEARCH_FIELDS_EVENT = "bulk_update_shops_search_fields_event"
|
|
10
9
|
}
|
|
@@ -10,6 +10,5 @@ var PublishEventEnums;
|
|
|
10
10
|
PublishEventEnums["SHOP_ACTIVE_TIMINGS_BATCH_PROCESS_EVENT"] = "shop_active_timings_batch_process_event";
|
|
11
11
|
PublishEventEnums["MONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT"] = "mongo_stream_changes_batch_process_shops_event";
|
|
12
12
|
PublishEventEnums["BULK_UPDATE_SHOPS_SEARCH_FIELDS_EVENT"] = "bulk_update_shops_search_fields_event";
|
|
13
|
-
PublishEventEnums["SOCKET_PUSH_NOTIFICATION_EVENT"] = "socket_push_notification_event";
|
|
14
13
|
})(PublishEventEnums || (exports.PublishEventEnums = PublishEventEnums = {}));
|
|
15
14
|
//# sourceMappingURL=EventEnums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEnums.js","sourceRoot":"/","sources":["libraries/event/EventEnums.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"EventEnums.js","sourceRoot":"/","sources":["libraries/event/EventEnums.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC5B,4EAAuD,CAAA;IACvD,sEAAiD,CAAA;IACjD,4EAAuD,CAAA;IACvD,sEAAiD,CAAA;IACjD,wGAAmF,CAAA;IACnF,sHAAiG,CAAA;IACjG,oGAA+E,CAAA;AAChF,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B","sourcesContent":["export enum PublishEventEnums {\n\tADMIN_ACTIVITY_LOGS_EVENT = 'admin_activity_logs_event',\n\tMESSAGE_RECEIVED_EVENT = 'message_received_event',\n\tTICKET_NOTIFICATION_EVENT = 'ticket_notification_event',\n\tCART_ITEM_UPSERT_EVENT = 'cart_item_upsert_event',\n\tSHOP_ACTIVE_TIMINGS_BATCH_PROCESS_EVENT = 'shop_active_timings_batch_process_event',\n\tMONGO_STREAM_CHANGES_BATCH_PROCESS_SHOPS_EVENT = 'mongo_stream_changes_batch_process_shops_event',\n\tBULK_UPDATE_SHOPS_SEARCH_FIELDS_EVENT = 'bulk_update_shops_search_fields_event',\n}\n"]}
|
|
@@ -5,10 +5,5 @@ export declare const INSTANCE_ROUTE_PREFIX = "instance";
|
|
|
5
5
|
export declare function initEventBus(rabbitUrl: string): Promise<void>;
|
|
6
6
|
export declare function getChannel(): amqp.Channel;
|
|
7
7
|
export declare function publishEvent<TPayload extends Record<string, unknown>>(event: BaseEvent<TPayload>): Promise<void>;
|
|
8
|
-
export
|
|
9
|
-
exclusive?: boolean;
|
|
10
|
-
durable?: boolean;
|
|
11
|
-
autoDelete?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare function subscribeToEvent(eventId: string, onMessage: (payload: any) => Promise<void>, options?: RabbitMqOptions): Promise<void>;
|
|
8
|
+
export declare function subscribeToEvent(eventId: string, onMessage: (payload: any) => Promise<void>): Promise<void>;
|
|
14
9
|
export declare function closeEventBus(): Promise<void>;
|
|
@@ -33,16 +33,14 @@ async function publishEvent(event) {
|
|
|
33
33
|
contentType: 'application/json',
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
async function subscribeToEvent(eventId, onMessage
|
|
36
|
+
async function subscribeToEvent(eventId, onMessage) {
|
|
37
37
|
const ch = getChannel();
|
|
38
|
-
const queueName =
|
|
39
|
-
|
|
38
|
+
const queueName = `${eventId}`;
|
|
39
|
+
await ch.assertQueue(queueName, {
|
|
40
40
|
durable: true,
|
|
41
41
|
exclusive: false,
|
|
42
42
|
autoDelete: false,
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
await ch.assertQueue(queueName, queueOptions);
|
|
43
|
+
});
|
|
46
44
|
await ch.bindQueue(queueName, exports.EXCHANGE_NAME, eventId);
|
|
47
45
|
await ch.consume(queueName, async (msg) => {
|
|
48
46
|
if (msg !== null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/event/index.ts"],"names":[],"mappings":";;;;;;AASA,oCAKC;AAED,gCAGC;AAED,oCASC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/event/index.ts"],"names":[],"mappings":";;;;;;AASA,oCAKC;AAED,gCAGC;AAED,oCASC;AAED,4CAkCC;AAED,sCAIC;AAxED,sDAA2B;AAE3B,mEAA+D;AAE/D,IAAI,UAA6B,CAAC;AAClC,IAAI,OAAqB,CAAC;AACb,QAAA,aAAa,GAAG,aAAa,CAAC;AAC9B,QAAA,qBAAqB,GAAG,UAAU,CAAC;AAEzC,KAAK,UAAU,YAAY,CAAC,SAAiB;IACnD,UAAU,GAAG,MAAM,iBAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,GAAG,MAAM,UAAU,CAAC,aAAa,EAAE,CAAC;IAC3C,MAAM,OAAO,CAAC,cAAc,CAAC,qBAAa,EAAE,OAAO,EAAE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,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACb,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,OAAO,CAAC,KAAK,CAAC,yBAAyB,OAAO,kBAAkB,IAAA,8BAAa,GAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YAC1F,CAAC;QACF,CAAC;IACF,CAAC,EACD,EAAE,KAAK,EAAE,KAAK,EAAE,CAChB,CAAC;IAGF,OAAO,CAAC,GAAG,CAAC,wBAAwB,OAAO,GAAG,CAAC,CAAC;AACjD,CAAC;AAEM,KAAK,UAAU,aAAa;IAClC,IAAI,OAAO;QAAE,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACnC,IAAI,UAAU;QAAE,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAA,8BAAa,GAAE,GAAG,CAAC,CAAC;AAClE,CAAC","sourcesContent":["import amqp from 'amqplib';\nimport { BaseEvent } from './BaseEvent';\nimport { getInstanceId } from '../../utilities/instance.utils';\n\nlet connection: amqp.ChannelModel;\nlet channel: amqp.Channel;\nexport const EXCHANGE_NAME = 'lyxa.events';\nexport const INSTANCE_ROUTE_PREFIX = 'instance'; // routing key: instance.{instanceName}.{eventType}\n\nexport async function initEventBus(rabbitUrl: string) {\n\tconnection = await amqp.connect(rabbitUrl);\n\tchannel = await connection.createChannel();\n\tawait channel.assertExchange(EXCHANGE_NAME, 'topic', { durable: true });\n\tconsole.log(`EventBus initialized with instance ID: ${getInstanceId()}`);\n}\n\nexport function getChannel(): amqp.Channel {\n\tif (!channel) throw new Error('Channel not initialized. Call initEventBus first.');\n\treturn channel;\n}\n\nexport async function publishEvent<TPayload extends Record<string, unknown>>(\n\tevent: BaseEvent<TPayload>\n): Promise<void> {\n\tconst ch = getChannel();\n\tconst messageBuffer = Buffer.from(JSON.stringify(event.payload));\n\tch.publish(EXCHANGE_NAME, event.eventId, messageBuffer, {\n\t\tcontentType: 'application/json',\n\t});\n\t// console.log(`Published event [${event.eventId}] with payload`, event.payload);\n}\n\nexport async function subscribeToEvent(\n\teventId: string,\n\tonMessage: (payload: any) => Promise<void>\n): Promise<void> {\n\tconst ch = getChannel();\n\t// const queueName = `${eventId}-${getInstanceId()}`;\n\tconst queueName = `${eventId}`;\n\n\tawait ch.assertQueue(queueName, {\n\t\tdurable: true, // survive broker restart\n\t\texclusive: false, // Allow multiple consumers to attach. Only one connection can use it (each pod has own queue). Set to TRUE if each pod needs it's own queue\n\t\tautoDelete: false, // Queue removed when pod disconnects when set to TRUE\n\t});\n\n\tawait ch.bindQueue(queueName, EXCHANGE_NAME, eventId);\n\n\tawait ch.consume(\n\t\tqueueName,\n\t\tasync msg => {\n\t\t\tif (msg !== null) {\n\t\t\t\tconst payload = JSON.parse(msg.content.toString());\n\t\t\t\ttry {\n\t\t\t\t\tawait onMessage(payload);\n\t\t\t\t\tch.ack(msg);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tconsole.error(`Error handling event [${eventId}] on instance [${getInstanceId()}]`, err);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{ noAck: false }\n\t);\n\n\t// console.log(`Subscribed to event [${eventId}] on queue [${queueName}]`);\n\tconsole.log(`Subscribed to event [${eventId}]`);\n}\n\nexport async function closeEventBus(): Promise<void> {\n\tif (channel) await channel.close();\n\tif (connection) await connection.close();\n\tconsole.log(`EventBus closed for instance [${getInstanceId()}]`);\n}"]}
|
|
@@ -54,10 +54,15 @@ exports.CoreEmailAuthIdentity = CoreEmailAuthIdentity = __decorate([
|
|
|
54
54
|
}),
|
|
55
55
|
(0, typegoose_1.pre)('findOneAndUpdate', async function (next) {
|
|
56
56
|
const update = this.getUpdate();
|
|
57
|
+
if (!update)
|
|
58
|
+
return next();
|
|
57
59
|
if (update?.password) {
|
|
58
60
|
update.password = await hashPassword(update.password);
|
|
59
|
-
this.setUpdate(update);
|
|
60
61
|
}
|
|
62
|
+
if (update.$set?.password) {
|
|
63
|
+
update.$set.password = await hashPassword(update.$set.password);
|
|
64
|
+
}
|
|
65
|
+
this.setUpdate(update);
|
|
61
66
|
next();
|
|
62
67
|
})
|
|
63
68
|
], CoreEmailAuthIdentity);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-email-auth-identity.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/core-email-auth-identity.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,0EAA+D;AAC/D,mEAAyD;AACzD,wDAA8B;AAE9B,yEAAsE;AAEtE,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,OAAO,kBAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;
|
|
1
|
+
{"version":3,"file":"core-email-auth-identity.model.js","sourceRoot":"/","sources":["libraries/mongo/models/providers/core-email-auth-identity.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAoE;AACpE,0EAA+D;AAC/D,mEAAyD;AACzD,wDAA8B;AAE9B,yEAAsE;AAEtE,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC3C,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACtC,OAAO,kBAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC;AAsBM,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,2CAAgB;IAEnD,KAAK,CAAU;IAGf,QAAQ,CAAU;IAGlB,IAAI,CAAe;IAGnB,aAAa,CAAuB;CAC3C,CAAA;AAZY,sDAAqB;AAE1B;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDACjB;AAGf;IADN,IAAA,gBAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDACd;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,4BAAS,EAAE,CAAC;;mDACA;AAGnB;IADN,IAAA,gBAAI,EAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;8BACE,yCAAmB;4DAAC;gCAX/B,qBAAqB;IArBjC,IAAA,eAAG,EAAwB,MAAM,EAAE,KAAK,WAAW,IAAI;QACvD,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,QAAQ,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnD,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;IACD,IAAA,eAAG,EAAoC,kBAAkB,EAAE,KAAK,WAAW,IAAI;QAC/E,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAyB,CAAC;QACvD,IAAI,CAAC,MAAM;YAAE,OAAO,IAAI,EAAE,CAAC;QAE3B,IAAI,MAAM,EAAE,QAAQ,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC,QAAQ,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,EAAE,CAAC;IACR,CAAC,CAAC;GACW,qBAAqB,CAYjC","sourcesContent":["import { modelOptions, prop, pre, Ref } from '@typegoose/typegoose';\nimport { CoreAuthIdentity } from '../core-auth-identity.model';\nimport { OTPFields } from '../embedded/otp-fields.model';\nimport bcrypt from 'bcryptjs';\nimport { Query } from 'mongoose';\nimport { ResetPasswordFields } from '../embedded/rest-password.model';\n\nasync function hashPassword(password: string): Promise<string> {\n\tconst salt = await bcrypt.genSalt(10);\n\treturn bcrypt.hash(password, salt);\n}\n@pre<CoreEmailAuthIdentity>('save', async function (next) {\n\tif (this.isModified('password')) {\n\t\tthis.password = await hashPassword(this.password);\n\t}\n\tnext();\n})\n@pre<Query<any, CoreEmailAuthIdentity>>('findOneAndUpdate', async function (next) {\n\tconst update = this.getUpdate() as Record<string, any>;\n\tif (!update) return next();\n\n\tif (update?.password) {\n\t\tupdate.password = await hashPassword(update.password);\n\t}\n\n\tif (update.$set?.password) {\n\t\tupdate.$set.password = await hashPassword(update.$set.password);\n\t}\n\n\tthis.setUpdate(update);\n\tnext();\n})\nexport class CoreEmailAuthIdentity extends CoreAuthIdentity {\n\t@prop({ required: true, type: String })\n\tpublic email!: string;\n\n\t@prop({ required: true, type: String })\n\tpublic password!: string;\n\n\t@prop({ type: OTPFields })\n\tpublic otps?: OTPFields[];\n\n\t@prop({ _id: false })\n\tpublic resetPassword?: ResetPasswordFields;\n}\n"]}
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import z, { ZodTypeAny } from 'zod';
|
|
2
2
|
import { SocketEventType } from '../../utilities/enum';
|
|
3
|
-
import {
|
|
4
|
-
export declare abstract class BaseSocketEvent<SIn extends ZodTypeAny, SOut extends ZodTypeAny
|
|
3
|
+
import { NotificationSocketEvent } from './events/notification.socket.event';
|
|
4
|
+
export declare abstract class BaseSocketEvent<SIn extends ZodTypeAny, SOut extends ZodTypeAny> {
|
|
5
5
|
protected readonly _eventType: SocketEventType;
|
|
6
6
|
readonly inputSchema: SIn;
|
|
7
7
|
readonly outputSchema: SOut;
|
|
8
|
-
readonly pushNotificationOutputSchema?: SPush;
|
|
9
8
|
protected readonly data: z.infer<SOut>;
|
|
10
|
-
protected readonly pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined;
|
|
11
9
|
static identifier(input: any): string;
|
|
12
|
-
notification?():
|
|
10
|
+
notification?(): NotificationSocketEvent | null;
|
|
13
11
|
pushNotification?: boolean;
|
|
14
12
|
protected constructor(eventType: SocketEventType, schemas: {
|
|
15
13
|
input: SIn;
|
|
16
14
|
output: SOut;
|
|
17
|
-
|
|
18
|
-
}, data: z.infer<SOut>, pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined);
|
|
15
|
+
}, data: z.infer<SOut>);
|
|
19
16
|
payload(): z.infer<SOut>;
|
|
20
|
-
getPushNotificationPayload(): SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined;
|
|
21
17
|
eventType(): SocketEventType;
|
|
22
18
|
getSubscriptionKey(): string;
|
|
23
|
-
get notificationSettings(): NotificationSettings | undefined;
|
|
24
19
|
}
|
|
@@ -5,29 +5,20 @@ class BaseSocketEvent {
|
|
|
5
5
|
_eventType;
|
|
6
6
|
inputSchema;
|
|
7
7
|
outputSchema;
|
|
8
|
-
pushNotificationOutputSchema;
|
|
9
8
|
data;
|
|
10
|
-
pushNotificationData;
|
|
11
9
|
static identifier(input) {
|
|
12
10
|
return 'default';
|
|
13
11
|
}
|
|
14
12
|
pushNotification = false;
|
|
15
|
-
constructor(eventType, schemas, data
|
|
13
|
+
constructor(eventType, schemas, data) {
|
|
16
14
|
this._eventType = eventType;
|
|
17
15
|
this.inputSchema = schemas.input;
|
|
18
16
|
this.outputSchema = schemas.output;
|
|
19
17
|
this.data = this.outputSchema.parse(data);
|
|
20
|
-
if (schemas.pushNotificationOutput && pushNotificationData) {
|
|
21
|
-
this.pushNotificationOutputSchema = schemas.pushNotificationOutput;
|
|
22
|
-
this.pushNotificationData = schemas.pushNotificationOutput.parse(pushNotificationData);
|
|
23
|
-
}
|
|
24
18
|
}
|
|
25
19
|
payload() {
|
|
26
20
|
return this.data;
|
|
27
21
|
}
|
|
28
|
-
getPushNotificationPayload() {
|
|
29
|
-
return this.pushNotificationData;
|
|
30
|
-
}
|
|
31
22
|
eventType() {
|
|
32
23
|
return this._eventType;
|
|
33
24
|
}
|
|
@@ -35,9 +26,6 @@ class BaseSocketEvent {
|
|
|
35
26
|
const identifier = this.constructor.identifier(this.data);
|
|
36
27
|
return `${this._eventType}:${identifier}`;
|
|
37
28
|
}
|
|
38
|
-
get notificationSettings() {
|
|
39
|
-
return this.constructor.notificationSettings;
|
|
40
|
-
}
|
|
41
29
|
}
|
|
42
30
|
exports.BaseSocketEvent = BaseSocketEvent;
|
|
43
31
|
//# sourceMappingURL=BaseSocketEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSocketEvent.js","sourceRoot":"/","sources":["libraries/socket/BaseSocketEvent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"BaseSocketEvent.js","sourceRoot":"/","sources":["libraries/socket/BaseSocketEvent.ts"],"names":[],"mappings":";;;AAIA,MAAsB,eAAe;IACjB,UAAU,CAAkB;IACtC,WAAW,CAAM;IACjB,YAAY,CAAO;IACT,IAAI,CAAgB;IAEvC,MAAM,CAAC,UAAU,CAAC,KAAU;QAC3B,OAAO,SAAS,CAAC;IAClB,CAAC;IAGM,gBAAgB,GAAa,KAAK,CAAC;IAE1C,YACC,SAA0B,EAC1B,OAAqC,EACrC,IAAmB;QAEnB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;QAEnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEM,OAAO;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAEM,SAAS;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACxB,MAAM,UAAU,GAAI,IAAI,CAAC,WAAsC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtF,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE,CAAC;IAC3C,CAAC;CACD;AArCD,0CAqCC","sourcesContent":["import z, { ZodTypeAny } from 'zod';\nimport { SocketEventType } from '../../utilities/enum';\nimport { NotificationSocketEvent } from './events/notification.socket.event';\n\nexport abstract class BaseSocketEvent<SIn extends ZodTypeAny, SOut extends ZodTypeAny> {\n\tprotected readonly _eventType: SocketEventType;\n\treadonly inputSchema: SIn;\n\treadonly outputSchema: SOut;\n\tprotected readonly data: z.infer<SOut>;\n\n\tstatic identifier(input: any): string {\n\t\treturn 'default';\n\t}\n\n\tpublic notification?(): NotificationSocketEvent | null;\n\tpublic pushNotification?: boolean = false;\n\n\tprotected constructor(\n\t\teventType: SocketEventType,\n\t\tschemas: { input: SIn; output: SOut },\n\t\tdata: z.infer<SOut>\n\t) {\n\t\tthis._eventType = eventType;\n\t\tthis.inputSchema = schemas.input;\n\t\tthis.outputSchema = schemas.output;\n\n\t\tthis.data = this.outputSchema.parse(data);\n\t}\n\n\tpublic payload(): z.infer<SOut> {\n\t\treturn this.data;\n\t}\n\n\tpublic eventType(): SocketEventType {\n\t\treturn this._eventType;\n\t}\n\n\tpublic getSubscriptionKey(): string {\n\t\tconst identifier = (this.constructor as typeof BaseSocketEvent).identifier(this.data);\n\t\treturn `${this._eventType}:${identifier}`;\n\t}\n}\n"]}
|
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
import { BaseEvent } from '../event/BaseEvent';
|
|
2
|
-
import {
|
|
3
|
-
import { EntitySubscription } from './core/socket-redis-connections';
|
|
2
|
+
import { BaseSocketEvent, EntitySubscription } from './core';
|
|
4
3
|
import { REGISTRY } from './core/socket-event-registry.map';
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} ? import('zod').infer<(typeof REGISTRY)[K]['schemas']['pushNotificationOutput']> : (typeof REGISTRY)[K] extends {
|
|
11
|
-
schemas: {
|
|
12
|
-
output: any;
|
|
13
|
-
};
|
|
14
|
-
} ? import('zod').infer<(typeof REGISTRY)[K]['schemas']['output']> : any;
|
|
15
|
-
};
|
|
16
|
-
export type NotificationSettings = {
|
|
17
|
-
isPushNotification: false;
|
|
18
|
-
} | {
|
|
19
|
-
isPushNotification: true;
|
|
20
|
-
isClickable: boolean;
|
|
21
|
-
clickType: ClickType;
|
|
22
|
-
};
|
|
23
|
-
export type PushNotificationEventData<T extends SocketEventType = SocketEventType> = {
|
|
24
|
-
eventName: T;
|
|
4
|
+
type EventCtorPayload<T> = T extends {
|
|
5
|
+
ctor: new (...args: any) => BaseSocketEvent<any, infer P>;
|
|
6
|
+
} ? P : never;
|
|
7
|
+
export type PushNotificationEventData<T extends keyof typeof REGISTRY> = {
|
|
8
|
+
type: T;
|
|
25
9
|
recipients: EntitySubscription[];
|
|
26
|
-
payload:
|
|
27
|
-
notificationSettings: NotificationSettings;
|
|
10
|
+
payload: EventCtorPayload<(typeof REGISTRY)[T]>;
|
|
28
11
|
};
|
|
29
|
-
export declare class PushNotificationEvent<T extends
|
|
30
|
-
constructor(
|
|
12
|
+
export declare class PushNotificationEvent<T extends keyof typeof REGISTRY> extends BaseEvent<PushNotificationEventData<T>> {
|
|
13
|
+
constructor(type: T, payload: EventCtorPayload<(typeof REGISTRY)[T]>, recipients: EntitySubscription[]);
|
|
31
14
|
get type(): T;
|
|
32
15
|
get recipients(): EntitySubscription[];
|
|
33
|
-
getPayload():
|
|
16
|
+
getPayload(): EventCtorPayload<(typeof REGISTRY)[T]>;
|
|
34
17
|
}
|
|
35
18
|
export {};
|
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.PushNotificationEvent = void 0;
|
|
13
4
|
const BaseEvent_1 = require("../event/BaseEvent");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
constructor(eventName, data, recipients, settings) {
|
|
18
|
-
const payload = data;
|
|
19
|
-
super(EventEnums_1.PublishEventEnums.SOCKET_PUSH_NOTIFICATION_EVENT, {
|
|
20
|
-
eventName,
|
|
21
|
-
recipients,
|
|
22
|
-
payload,
|
|
23
|
-
notificationSettings: settings,
|
|
24
|
-
});
|
|
5
|
+
class PushNotificationEvent extends BaseEvent_1.BaseEvent {
|
|
6
|
+
constructor(type, payload, recipients) {
|
|
7
|
+
super('notification.push', { type, recipients, payload });
|
|
25
8
|
}
|
|
26
9
|
get type() {
|
|
27
|
-
return this.payload.
|
|
10
|
+
return this.payload.type;
|
|
28
11
|
}
|
|
29
12
|
get recipients() {
|
|
30
13
|
return this.payload.recipients;
|
|
@@ -32,14 +15,6 @@ let PushNotificationEvent = class PushNotificationEvent extends BaseEvent_1.Base
|
|
|
32
15
|
getPayload() {
|
|
33
16
|
return this.payload.payload;
|
|
34
17
|
}
|
|
35
|
-
}
|
|
18
|
+
}
|
|
36
19
|
exports.PushNotificationEvent = PushNotificationEvent;
|
|
37
|
-
exports.PushNotificationEvent = PushNotificationEvent = __decorate([
|
|
38
|
-
(0, metadata_1.EventMetadata)('notification.push', [
|
|
39
|
-
{ name: 'eventName', type: 'SocketEventType' },
|
|
40
|
-
{ name: 'recipients', type: 'EntitySubscription[]' },
|
|
41
|
-
{ name: 'payload', type: 'any' },
|
|
42
|
-
]),
|
|
43
|
-
__metadata("design:paramtypes", [String, Object, Array, Object])
|
|
44
|
-
], PushNotificationEvent);
|
|
45
20
|
//# sourceMappingURL=PushNotificationEvent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PushNotificationEvent.js","sourceRoot":"/","sources":["libraries/socket/PushNotificationEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PushNotificationEvent.js","sourceRoot":"/","sources":["libraries/socket/PushNotificationEvent.ts"],"names":[],"mappings":";;;AAAA,kDAA+C;AAc/C,MAAa,qBAAuD,SAAQ,qBAE3E;IACA,YAAY,IAAO,EAAE,OAA+C,EAAE,UAAgC;QACrG,KAAK,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,IAAI;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;IAChC,CAAC;IAED,UAAU;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7B,CAAC;CACD;AAlBD,sDAkBC","sourcesContent":["import { BaseEvent } from '../event/BaseEvent';\nimport { BaseSocketEvent, EntitySubscription } from './core';\nimport { REGISTRY } from './core/socket-event-registry.map';\n\ntype EventCtorPayload<T> = T extends { ctor: new (...args: any) => BaseSocketEvent<any, infer P> }\n\t? P\n\t: never;\n\nexport type PushNotificationEventData<T extends keyof typeof REGISTRY> = {\n\ttype: T;\n\trecipients: EntitySubscription[];\n\tpayload: EventCtorPayload<(typeof REGISTRY)[T]>;\n};\n\nexport class PushNotificationEvent<T extends keyof typeof REGISTRY> extends BaseEvent<\n\tPushNotificationEventData<T>\n> {\n\tconstructor(type: T, payload: EventCtorPayload<(typeof REGISTRY)[T]>, recipients: EntitySubscription[]) {\n\t\tsuper('notification.push', { type, recipients, payload });\n\t}\n\n\tget type(): T {\n\t\treturn this.payload.type;\n\t}\n\n\tget recipients(): EntitySubscription[] {\n\t\treturn this.payload.recipients;\n\t}\n\n\tgetPayload(): EventCtorPayload<(typeof REGISTRY)[T]> {\n\t\treturn this.payload.payload;\n\t}\n}\n"]}
|
|
@@ -72,10 +72,13 @@ async function publishSocketEvent(event, recipients) {
|
|
|
72
72
|
publishToInstances(subscribed, localKey, payload);
|
|
73
73
|
}
|
|
74
74
|
if (unsubscribed.length > 0) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
const notificationEvent = event.notification?.();
|
|
76
|
+
const pushNotificationEvent = event.pushNotification;
|
|
77
|
+
if (pushNotificationEvent) {
|
|
78
|
+
(0, event_1.publishEvent)(new PushNotificationEvent_1.PushNotificationEvent(event.eventType(), event.payload(), unsubscribed)).catch(err => console.error('[Socket] Push failed:', err));
|
|
79
|
+
}
|
|
80
|
+
if (notificationEvent) {
|
|
81
|
+
publishNotificationSocketEvent(notificationEvent, unsubscribed).catch(err => console.error('[Socket] Notification failed:', err));
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socket-event-publisher.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-publisher.ts"],"names":[],"mappings":";;AA6FA,
|
|
1
|
+
{"version":3,"file":"socket-event-publisher.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-publisher.ts"],"names":[],"mappings":";;AA6FA,gDA8BC;AAGD,wEAmCC;AAjKD,gCAAwC;AAExC,yEAA0F;AAE1F,uCAA6F;AAC7F,oEAAiE;AAIjE,MAAM,eAAe,GAAG;IACvB,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,IAAI;CACP,CAAC;AAGX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ityEventSocketsKey } from './socket-redis-connections';\nimport { NotificationSocketEvent } from '../events';\nimport { EXCHANGE_NAME, getChannel, INSTANCE_ROUTE_PREFIX, publishEvent } from '../../event';\nimport { PushNotificationEvent } from '../PushNotificationEvent';\nimport { PushNotificationEventType } from '../../../utilities/enum';\n\n// Reusable publish options\nconst PUBLISH_OPTIONS = {\n\tcontentType: 'application/json',\n\tpersistent: true,\n} as const;\n\n// Zero-overhead publishing - minimal allocations\nfunction publishToInstances(\n\trecipientsWithInstances: Array<{ recipient: EntitySubscription; instances: string[] }>,\n\tlocalKey: string,\n\tpayload: any\n): void {\n\tif (recipientsWithInstances.length === 0) return;\n\n\tconst channel = getChannel();\n\n\t// Pre-serialize message once\n\tconst message = { localKey, payload, recipient: null as any };\n\n\t// Fire-and-forget with minimal overhead\n\tfor (let i = 0; i < recipientsWithInstances.length; i++) {\n\t\tconst { recipient, instances } = recipientsWithInstances[i];\n\t\tmessage.recipient = recipient;\n\t\tconst messageStr = JSON.stringify(message);\n\n\t\tfor (let j = 0; j < instances.length; j++) {\n\t\t\tconst routingKey = `${INSTANCE_ROUTE_PREFIX}.${instances[j]}`;\n\n\t\t\ttry {\n\t\t\t\t// Direct publish - Buffer.from creates minimal overhead\n\t\t\t\tchannel.publish(EXCHANGE_NAME, routingKey, Buffer.from(messageStr, 'utf8'), PUBLISH_OPTIONS);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(`[Socket] Publish failed: ${routingKey}`, error);\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Ultra-simple: Direct Redis lookups, no batch/cache/parsing!\nasync function getActiveSubscribedRecipients(\n\trecipients: EntitySubscription[],\n\tlocalKey: string\n): Promise<{\n\tsubscribed: Array<{ recipient: EntitySubscription; instances: string[] }>;\n\tunsubscribed: EntitySubscription[];\n}> {\n\tif (recipients.length === 0) {\n\t\treturn { subscribed: [], unsubscribed: [] };\n\t}\n\n\tconst redis = getLibraries().getRedisService();\n\tconst subscribed: Array<{ recipient: EntitySubscription; instances: string[] }> = [];\n\tconst unsubscribed: EntitySubscription[] = [];\n\n\t// Parallel lookups - one key per recipient\n\tawait Promise.all(\n\t\trecipients.map(async recipient => {\n\t\t\tconst sockets = await redis.getSetMembers(getEntityEventSocketsKey(recipient, localKey));\n\n\t\t\tif (sockets.length > 0) {\n\t\t\t\t// Extract instances\n\t\t\t\tconst instanceSet = new Set<string>();\n\t\t\t\tfor (let i = 0; i < sockets.length; i++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst socketInfo = JSON.parse(sockets[i]);\n\t\t\t\t\t\tinstanceSet.add(socketInfo.instanceId);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Skip malformed socket data\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (instanceSet.size > 0) {\n\t\t\t\t\tsubscribed.push({ recipient, instances: Array.from(instanceSet) });\n\t\t\t\t} else {\n\t\t\t\t\tunsubscribed.push(recipient);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunsubscribed.push(recipient);\n\t\t\t}\n\t\t})\n\t);\n\n\treturn { subscribed, unsubscribed };\n}\n\n// Minimal overhead publish - early returns, lazy evaluation\nexport async function publishSocketEvent(\n\tevent: BaseSocketEvent<any, any>,\n\trecipients: EntitySubscription[]\n): Promise<void> {\n\tif (recipients.length === 0) return;\n\n\tconst localKey = event.getSubscriptionKey();\n\tconst payload = event.payload();\n\n\tconst { subscribed, unsubscribed } = await getActiveSubscribedRecipients(recipients, localKey);\n\n\tif (subscribed.length > 0) {\n\t\tpublishToInstances(subscribed, localKey, payload);\n\t}\n\n\tif (unsubscribed.length > 0) {\n\t\tconst notificationEvent = event.notification?.();\n\t\tconst pushNotificationEvent = event.pushNotification;\n\t\tif (pushNotificationEvent) {\n\t\t\tpublishEvent(new PushNotificationEvent(event.eventType(), event.payload(), unsubscribed)).catch(err =>\n\t\t\t\tconsole.error('[Socket] Push failed:', err)\n\t\t\t);\n\t\t}\n\n\t\tif (notificationEvent) {\n\t\t\tpublishNotificationSocketEvent(notificationEvent, unsubscribed).catch(err =>\n\t\t\t\tconsole.error('[Socket] Notification failed:', err)\n\t\t\t);\n\t\t}\n\t}\n}\n\n// Ultra-simple notification publish: Direct lookups!\nexport async function publishNotificationSocketEvent(\n\tevent: NotificationSocketEvent,\n\trecipients: EntitySubscription[]\n): Promise<void> {\n\tif (recipients.length === 0) return;\n\n\tconst eventKey = event.getSubscriptionKey();\n\tconst redis = getLibraries().getRedisService();\n\tconst validInstances: Array<{ recipient: EntitySubscription; instances: string[] }> = [];\n\n\t// Parallel direct lookups\n\tawait Promise.all(\n\t\trecipients.map(async recipient => {\n\t\t\tconst sockets = await redis.getSetMembers(getEntityEventSocketsKey(recipient, eventKey));\n\n\t\t\tif (sockets.length > 0) {\n\t\t\t\tconst instanceSet = new Set<string>();\n\t\t\t\tfor (let i = 0; i < sockets.length; i++) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst socketInfo = JSON.parse(sockets[i]);\n\t\t\t\t\t\tinstanceSet.add(socketInfo.instanceId);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\t// Skip malformed socket data\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (instanceSet.size > 0) {\n\t\t\t\t\tvalidInstances.push({ recipient, instances: Array.from(instanceSet) });\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t);\n\n\tif (validInstances.length > 0) {\n\t\tpublishToInstances(validInstances, eventKey, event.payload());\n\t}\n}\n"]}
|
|
@@ -5,7 +5,6 @@ import { EventRegistration } from './index';
|
|
|
5
5
|
import { NotificationSocketEvent } from '../events/notification.socket.event';
|
|
6
6
|
import { RiderConnectSocketEvent } from '../events/rider-connect.socket.event';
|
|
7
7
|
import { RiderLocationUpdateSocketEvent } from '../events/rider-location-update.socket.event';
|
|
8
|
-
import { TicketActionsSocketEvent } from '../events/ticket-actions.socket.event';
|
|
9
8
|
export declare const REGISTRY: {
|
|
10
9
|
readonly CHATROOM_MESSAGE_SEND: {
|
|
11
10
|
readonly ctor: typeof ChatroomMessageSendSocketEvent;
|
|
@@ -143,34 +142,6 @@ export declare const REGISTRY: {
|
|
|
143
142
|
createdAt: Date;
|
|
144
143
|
} | undefined;
|
|
145
144
|
}>;
|
|
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
145
|
};
|
|
175
146
|
};
|
|
176
147
|
readonly TICKET_ASSIGN: {
|
|
@@ -322,32 +293,6 @@ export declare const REGISTRY: {
|
|
|
322
293
|
};
|
|
323
294
|
readonly identifier: typeof RiderLocationUpdateSocketEvent.identifier;
|
|
324
295
|
};
|
|
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
|
-
};
|
|
351
296
|
};
|
|
352
297
|
export type Registry = {
|
|
353
298
|
[K in keyof typeof REGISTRY]: (typeof REGISTRY)[K] extends EventRegistration<any> ? (typeof REGISTRY)[K] : never;
|
|
@@ -8,7 +8,6 @@ const ticket_unassign_socket_event_1 = require("../events/ticket-unassign.socket
|
|
|
8
8
|
const notification_socket_event_1 = require("../events/notification.socket.event");
|
|
9
9
|
const rider_connect_socket_event_1 = require("../events/rider-connect.socket.event");
|
|
10
10
|
const rider_location_update_socket_event_1 = require("../events/rider-location-update.socket.event");
|
|
11
|
-
const ticket_actions_socket_event_1 = require("../events/ticket-actions.socket.event");
|
|
12
11
|
exports.REGISTRY = {
|
|
13
12
|
[enum_1.SocketEventType.CHATROOM_MESSAGE_SEND]: {
|
|
14
13
|
ctor: events_1.ChatroomMessageSendSocketEvent,
|
|
@@ -41,9 +40,5 @@ exports.REGISTRY = {
|
|
|
41
40
|
schemas: rider_location_update_socket_event_1.RiderLocationUpdateSocketEvent.schemas,
|
|
42
41
|
identifier: rider_location_update_socket_event_1.RiderLocationUpdateSocketEvent.identifier,
|
|
43
42
|
},
|
|
44
|
-
[enum_1.SocketEventType.TICKET_ACTIONS]: {
|
|
45
|
-
ctor: ticket_actions_socket_event_1.TicketActionsSocketEvent,
|
|
46
|
-
schemas: ticket_actions_socket_event_1.TicketActionsSocketEvent.schemas,
|
|
47
|
-
},
|
|
48
43
|
};
|
|
49
44
|
//# 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;
|
|
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;AAEjF,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;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';\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} 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,5 +1,4 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { ClickType } from '../../../utilities/enum';
|
|
3
2
|
import { DTO } from '../../../utilities/validation';
|
|
4
3
|
import { BaseSocketEvent } from '../BaseSocketEvent';
|
|
5
4
|
export declare const ChatlistMessageSendSocketInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
@@ -31,38 +30,8 @@ export declare const ChatlistMessageSendSocketOutputSchema: z.ZodObject<{
|
|
|
31
30
|
createdAt: Date;
|
|
32
31
|
} | undefined;
|
|
33
32
|
}>;
|
|
34
|
-
export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
|
|
35
|
-
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
36
|
-
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
37
|
-
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
38
|
-
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
content: string;
|
|
41
|
-
createdAt: Date;
|
|
42
|
-
}, {
|
|
43
|
-
content: string;
|
|
44
|
-
createdAt: Date;
|
|
45
|
-
}>>;
|
|
46
|
-
unreadCount: z.ZodNumber;
|
|
47
|
-
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
unreadCount: number;
|
|
49
|
-
chatroomId: import("mongoose").Types.ObjectId;
|
|
50
|
-
lastMessage?: {
|
|
51
|
-
content: string;
|
|
52
|
-
createdAt: Date;
|
|
53
|
-
} | undefined;
|
|
54
|
-
}, {
|
|
55
|
-
unreadCount: number;
|
|
56
|
-
chatroomId: import("mongoose").Types.ObjectId;
|
|
57
|
-
lastMessage?: {
|
|
58
|
-
content: string;
|
|
59
|
-
createdAt: Date;
|
|
60
|
-
} | undefined;
|
|
61
|
-
}>;
|
|
62
|
-
export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;
|
|
63
33
|
export type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;
|
|
64
|
-
export
|
|
65
|
-
export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<typeof ChatlistMessageSendSocketInputSchema, typeof ChatlistMessageSendSocketOutputSchema, typeof ChatlistMessageSendPushOutputSchema> {
|
|
34
|
+
export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<typeof ChatlistMessageSendSocketInputSchema, typeof ChatlistMessageSendSocketOutputSchema> {
|
|
66
35
|
static readonly schemas: {
|
|
67
36
|
input: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
68
37
|
output: z.ZodObject<{
|
|
@@ -93,39 +62,6 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
|
|
|
93
62
|
createdAt: Date;
|
|
94
63
|
} | undefined;
|
|
95
64
|
}>;
|
|
96
|
-
pushNotificationOutput: z.ZodObject<{
|
|
97
|
-
chatroomId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
|
|
98
|
-
lastMessage: z.ZodOptional<z.ZodObject<{
|
|
99
|
-
content: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
100
|
-
createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
|
|
101
|
-
}, "strip", z.ZodTypeAny, {
|
|
102
|
-
content: string;
|
|
103
|
-
createdAt: Date;
|
|
104
|
-
}, {
|
|
105
|
-
content: string;
|
|
106
|
-
createdAt: Date;
|
|
107
|
-
}>>;
|
|
108
|
-
unreadCount: z.ZodNumber;
|
|
109
|
-
}, "strip", z.ZodTypeAny, {
|
|
110
|
-
unreadCount: number;
|
|
111
|
-
chatroomId: import("mongoose").Types.ObjectId;
|
|
112
|
-
lastMessage?: {
|
|
113
|
-
content: string;
|
|
114
|
-
createdAt: Date;
|
|
115
|
-
} | undefined;
|
|
116
|
-
}, {
|
|
117
|
-
unreadCount: number;
|
|
118
|
-
chatroomId: import("mongoose").Types.ObjectId;
|
|
119
|
-
lastMessage?: {
|
|
120
|
-
content: string;
|
|
121
|
-
createdAt: Date;
|
|
122
|
-
} | undefined;
|
|
123
|
-
}>;
|
|
124
|
-
};
|
|
125
|
-
static readonly notificationSettings: {
|
|
126
|
-
isPushNotification: boolean;
|
|
127
|
-
isClickable: boolean;
|
|
128
|
-
clickType: ClickType;
|
|
129
65
|
};
|
|
130
|
-
constructor(payload: ChatlistMessageSendSocketOutputDTO
|
|
66
|
+
constructor(payload: ChatlistMessageSendSocketOutputDTO);
|
|
131
67
|
}
|