@lyxa.ai/core 1.3.19 → 1.3.21

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.
@@ -19,8 +19,9 @@ class BaseSocketEvent {
19
19
  this.data = this.outputSchema.parse(data);
20
20
  if (schemas.pushNotificationOutput) {
21
21
  this.pushNotificationOutputSchema = schemas.pushNotificationOutput;
22
- const pushData = pushNotificationData ?? data;
23
- this.pushNotificationData = schemas.pushNotificationOutput.parse(pushData);
22
+ if (pushNotificationData !== undefined) {
23
+ this.pushNotificationData = schemas.pushNotificationOutput.parse(pushNotificationData);
24
+ }
24
25
  }
25
26
  }
26
27
  payload() {
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSocketEvent.js","sourceRoot":"/","sources":["libraries/socket/BaseSocketEvent.ts"],"names":[],"mappings":";;;AAMA,MAAsB,eAAe;IAGjB,UAAU,CAAkB;IAC/B,WAAW,CAAM;IACjB,YAAY,CAAO;IACnB,4BAA4B,CAAS;IAClC,IAAI,CAAgB;IACpB,oBAAoB,CAAyD;IAIhG,IAAW,oBAAoB;QAC9B,OAAO,SAAS,CAAC;IAClB,CAAC;IAGM,gBAAgB,GAAa,KAAK,CAAC;IAE1C,YACC,SAA0B,EAC1B,OAAqE,EACrE,IAAmB,EACnB,oBAA4E;QAE5E,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAG1C,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;YACpC,IAAI,CAAC,4BAA4B,GAAG,OAAO,CAAC,sBAAsB,CAAC;YACnE,MAAM,QAAQ,GAAG,oBAAoB,IAAK,IAA8D,CAAC;YACzG,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5E,CAAC;IACF,CAAC;IAGM,OAAO;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAEM,0BAA0B;QAChC,OAAO,IAAI,CAAC,oBAAyF,CAAC;IACvG,CAAC;IAGM,SAAS;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACxB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACxC,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE,CAAC;IAC3C,CAAC;CACD;AAxDD,0CAwDC","sourcesContent":["\nimport z, { ZodTypeAny } from 'zod';\nimport { SocketEventType } from '../../utilities/enum';\nimport { PushNotificationEvent, NotificationSettings } from './PushNotificationEvent';\n\n\nexport abstract class BaseSocketEvent<SIn extends ZodTypeAny,\n\tSOut extends ZodTypeAny,\n\tSPush extends ZodTypeAny | undefined = undefined> {\n\tprotected readonly _eventType: SocketEventType;\n\tpublic readonly inputSchema: SIn;\n\tpublic readonly outputSchema: SOut;\n\tpublic readonly pushNotificationOutputSchema?: SPush;\n\tprotected readonly data: z.infer<SOut>;\n\tprotected readonly pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined;\n\n\tprotected abstract getIdentifier(): string;\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn undefined;\n\t}\n\n\tpublic notification?(): PushNotificationEvent | null;\n\tpublic pushNotification?: boolean = false;\n\n\tprotected constructor(\n\t\teventType: SocketEventType,\n\t\tschemas: { input: SIn; output: SOut; pushNotificationOutput?: SPush },\n\t\tdata: z.infer<SOut>,\n\t\tpushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined\n\t) {\n\t\tthis._eventType = eventType;\n\t\tthis.inputSchema = schemas.input;\n\t\tthis.outputSchema = schemas.output;\n\t\tthis.data = this.outputSchema.parse(data);\n\n\t\t// Auto-derive push notification payload from main data if schema exists\n\t\tif (schemas.pushNotificationOutput) {\n\t\t\tthis.pushNotificationOutputSchema = schemas.pushNotificationOutput;\n\t\t\tconst pushData = pushNotificationData ?? (data as SPush extends ZodTypeAny ? z.infer<SPush> : undefined);\n\t\t\tthis.pushNotificationData = schemas.pushNotificationOutput.parse(pushData);\n\t\t}\n\t}\n\n\n\tpublic payload(): z.infer<SOut> {\n\t\treturn this.data;\n\t}\n\n\tpublic getPushNotificationPayload(): SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined {\n\t\treturn this.pushNotificationData as SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined;\n\t}\n\n\n\tpublic eventType(): SocketEventType {\n\t\treturn this._eventType;\n\t}\n\n\tpublic getSubscriptionKey(): string {\n\t\tconst identifier = this.getIdentifier();\n\t\treturn `${this._eventType}:${identifier}`;\n\t}\n}\n"]}
1
+ {"version":3,"file":"BaseSocketEvent.js","sourceRoot":"/","sources":["libraries/socket/BaseSocketEvent.ts"],"names":[],"mappings":";;;AAMA,MAAsB,eAAe;IAGjB,UAAU,CAAkB;IAC/B,WAAW,CAAM;IACjB,YAAY,CAAO;IACnB,4BAA4B,CAAS;IAClC,IAAI,CAAgB;IACpB,oBAAoB,CAAyD;IAIhG,IAAW,oBAAoB;QAC9B,OAAO,SAAS,CAAC;IAClB,CAAC;IAGM,gBAAgB,GAAa,KAAK,CAAC;IAEvC,YACI,SAA0B,EAC1B,OAAqE,EACrE,IAAmB,EACnB,oBAA4E;QAE5E,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAG1C,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;YACjC,IAAI,CAAC,4BAA4B,GAAG,OAAO,CAAC,sBAAsB,CAAC;YAEnE,IAAI,oBAAoB,KAAK,SAAS,EAAE,CAAC;gBACrC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,KAAK,CAAC,oBAAoB,CAA0D,CAAC;YACpJ,CAAC;QACL,CAAC;IACL,CAAC;IACG,OAAO;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IAEM,0BAA0B;QAChC,OAAO,IAAI,CAAC,oBAAyF,CAAC;IACvG,CAAC;IAGM,SAAS;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAEM,kBAAkB;QACxB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACxC,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,UAAU,EAAE,CAAC;IAC3C,CAAC;CACD;AAxDD,0CAwDC","sourcesContent":["\nimport z, { ZodTypeAny } from 'zod';\nimport { SocketEventType } from '../../utilities/enum';\nimport { PushNotificationEvent, NotificationSettings } from './PushNotificationEvent';\n\n\nexport abstract class BaseSocketEvent<SIn extends ZodTypeAny,\n\tSOut extends ZodTypeAny,\n\tSPush extends ZodTypeAny | undefined = undefined> {\n\tprotected readonly _eventType: SocketEventType;\n\tpublic readonly inputSchema: SIn;\n\tpublic readonly outputSchema: SOut;\n\tpublic readonly pushNotificationOutputSchema?: SPush;\n\tprotected readonly data: z.infer<SOut>;\n\tprotected readonly pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined;\n\n\tprotected abstract getIdentifier(): string;\n\n\tpublic get notificationSettings(): NotificationSettings | undefined {\n\t\treturn undefined;\n\t}\n\n\tpublic notification?(): PushNotificationEvent | null;\n\tpublic pushNotification?: boolean = false;\n\n protected constructor(\n eventType: SocketEventType,\n schemas: { input: SIn; output: SOut; pushNotificationOutput?: SPush },\n data: z.infer<SOut>,\n pushNotificationData?: SPush extends ZodTypeAny ? z.infer<SPush> : undefined\n ) {\n this._eventType = eventType;\n this.inputSchema = schemas.input;\n this.outputSchema = schemas.output;\n this.data = this.outputSchema.parse(data);\n\n // Set push notification data if schema exists\n if (schemas.pushNotificationOutput) {\n this.pushNotificationOutputSchema = schemas.pushNotificationOutput;\n // If pushNotificationData is explicitly provided, use it; otherwise undefined\n if (pushNotificationData !== undefined) {\n this.pushNotificationData = schemas.pushNotificationOutput.parse(pushNotificationData) as SPush extends ZodTypeAny ? z.infer<SPush> : undefined;\n }\n }\n }\n\tpublic payload(): z.infer<SOut> {\n\t\treturn this.data;\n\t}\n\n\tpublic getPushNotificationPayload(): SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined {\n\t\treturn this.pushNotificationData as SPush extends ZodTypeAny ? z.infer<SPush> | undefined : undefined;\n\t}\n\n\n\tpublic eventType(): SocketEventType {\n\t\treturn this._eventType;\n\t}\n\n\tpublic getSubscriptionKey(): string {\n\t\tconst identifier = this.getIdentifier();\n\t\treturn `${this._eventType}:${identifier}`;\n\t}\n}\n"]}
@@ -68,16 +68,15 @@ async function publishSocketEvent(event, recipients) {
68
68
  const localKey = event.getSubscriptionKey();
69
69
  const payload = event.payload();
70
70
  const { subscribed, unsubscribed } = await getActiveSubscribedRecipients(recipients, localKey);
71
- console.log("subscribed", subscribed);
72
- console.log("unsubscribed", unsubscribed);
71
+ console.log('payloadaa', payload);
72
+ console.log('subscribed', subscribed);
73
+ console.log('unsubscribed', unsubscribed);
73
74
  if (subscribed.length > 0) {
74
75
  publishToInstances(subscribed, localKey, payload);
75
76
  }
76
77
  if (unsubscribed.length > 0 && event.notificationSettings?.isPushNotification) {
77
78
  const pushNotificationPayload = event.getPushNotificationPayload();
78
79
  const settings = event.notificationSettings;
79
- console.log("pushNotificationPayload", pushNotificationPayload);
80
- console.log("settings", settings);
81
80
  await (0, event_1.publishEvent)(new PushNotificationEvent_1.PushNotificationEvent(event.eventType(), pushNotificationPayload, unsubscribed, settings)).catch(err => console.error('[Socket] Push notification failed:', err));
82
81
  }
83
82
  }
@@ -1 +1 @@
1
- {"version":3,"file":"socket-event-publisher.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-publisher.ts"],"names":[],"mappings":";;AA+FA,gDAgCC;AAED,wEAmCC;AApKD,gCAAwC;AAExC,yEAA0F;AAE1F,uCAA6F;AAC7F,oEAAuF;AAIvF,MAAM,eAAe,GAAG;IACvB,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,IAAI;CACP,CAAC;AAGX,SAAS,kBAAkB,CAC1B,uBAAsF,EACtF,QAAgB,EAChB,OAAgB;IAEhB,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEjD,MAAM,OAAO,GAAG,IAAA,kBAAU,GAAE,CAAC;IAG7B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,IAAW,EAAE,CAAC;IAG9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAE3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,GAAG,6BAAqB,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YAE9D,IAAI,CAAC;gBAEJ,OAAO,CAAC,OAAO,CAAC,qBAAa,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC;YAC9F,CAAC;YAAC,OAAO,KAAK,EAAE,C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EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACxE,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CACF,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,kBAAkB,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC","sourcesContent":["import { getLibraries } from '../../..';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { EntitySubscription, getEntityEventSocketsKey } from './socket-redis-connections';\nimport { NotificationSocketEvent } from '../events';\nimport { EXCHANGE_NAME, getChannel, INSTANCE_ROUTE_PREFIX, publishEvent } from '../../event';\nimport { PushNotificationEvent, NotificationSettings } from '../PushNotificationEvent';\nimport { PushNotificationEventType, ClickType } 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: unknown\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\nimport type { ZodTypeAny } from 'zod';\n\n// Minimal overhead publish - early returns, lazy evaluation\nexport async function publishSocketEvent(\n\tevent: BaseSocketEvent<ZodTypeAny, ZodTypeAny, ZodTypeAny | undefined>,\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\tconsole.log(\"subscribed\", subscribed);\n\tconsole.log(\"unsubscribed\", unsubscribed);\n\n\n\t// Send socket events to subscribed users\n\tif (subscribed.length > 0) {\n\t\tpublishToInstances(subscribed, localKey, payload);\n\t}\n\n\t// Send push notifications to unsubscribed users\n\tif (unsubscribed.length > 0 && event.notificationSettings?.isPushNotification) {\n\t\tconst pushNotificationPayload = event.getPushNotificationPayload();\n\t\tconst settings = event.notificationSettings;\n\n\t\tconsole.log(\"pushNotificationPayload\", pushNotificationPayload);\n\t\tconsole.log(\"settings\", settings);\n\n\t\tawait publishEvent(\n\t\t\tnew PushNotificationEvent(event.eventType(), pushNotificationPayload, unsubscribed, settings)\n\t\t).catch(err => console.error('[Socket] Push notification failed:', err));\n\t}\n}\n\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"]}
1
+ {"version":3,"file":"socket-event-publisher.js","sourceRoot":"/","sources":["libraries/socket/core/socket-event-publisher.ts"],"names":[],"mappings":";;AA6FA,gDA2BC;AAED,wEAmCC;AA7JD,gCAAwC;AAExC,yEAA0F;AAE1F,uCAA6F;AAC7F,oEAAiE;AAIjE,MAAM,eAAe,GAAG;IACvB,WAAW,EAAE,kBAAkB;IAC/B,UAAU,EAAE,IAAI;CACP,CAAC;AAGX,SAAS,kBAAkB,CAC1B,uBAAsF,EACtF,QAAgB,EAChB,OAAgB;IAEhB,IAAI,uBAAuB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEjD,MAAM,OAAO,GAAG,IAAA,kBAAU,GAAE,CAAC;IAG7B,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,IAAW,EAAE,CAAC;IAG9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAE3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,UAAU,GAAG,GAAG,6BAAqB,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YAE9D,IAAI,CAAC;gBAEJ,OAAO,CAAC,OAAO,CAAC,qBAAa,EAAE,UAAU,EAAE,MAAM,CAAC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c,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACxE,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CACF,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,kBAAkB,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC","sourcesContent":["import { getLibraries } from '../../..';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { EntitySubscription, getEntityEventSocketsKey } from './socket-redis-connections';\nimport { NotificationSocketEvent } from '../events';\nimport { EXCHANGE_NAME, getChannel, INSTANCE_ROUTE_PREFIX, publishEvent } from '../../event';\nimport { PushNotificationEvent } from '../PushNotificationEvent';\nimport type { ZodTypeAny } from 'zod';\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: unknown\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<ZodTypeAny, ZodTypeAny, ZodTypeAny | undefined>,\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\tconsole.log('payloadaa', payload);\n\n\tconsole.log('subscribed', subscribed);\n\tconsole.log('unsubscribed', unsubscribed);\n\n\tif (subscribed.length > 0) {\n\t\tpublishToInstances(subscribed, localKey, payload);\n\t}\n\n\tif (unsubscribed.length > 0 && event.notificationSettings?.isPushNotification) {\n\t\tconst pushNotificationPayload = event.getPushNotificationPayload();\n\t\tconst settings = event.notificationSettings;\n\t\tawait publishEvent(\n\t\t\tnew PushNotificationEvent(event.eventType(), pushNotificationPayload, unsubscribed, settings)\n\t\t).catch(err => console.error('[Socket] Push notification failed:', err));\n\t}\n}\n\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"]}
@@ -62,7 +62,7 @@ export declare const ChatlistMessageSendPushOutputSchema: z.ZodObject<{
62
62
  export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatlistMessageSendPushOutputSchema>;
63
63
  export type ChatlistMessageSendSocketOutputDTO = DTO<typeof ChatlistMessageSendSocketOutputSchema>;
64
64
  export type ChatlistMessageSendSocketInputDTO = DTO<typeof ChatlistMessageSendSocketInputSchema>;
65
- export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<typeof ChatlistMessageSendSocketInputSchema, typeof ChatlistMessageSendSocketOutputSchema> {
65
+ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<typeof ChatlistMessageSendSocketInputSchema, typeof ChatlistMessageSendSocketOutputSchema, typeof ChatlistMessageSendPushOutputSchema> {
66
66
  static readonly schemas: {
67
67
  input: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
68
68
  output: z.ZodObject<{
@@ -93,6 +93,34 @@ export declare class ChatlistMessageSendSocketEvent extends BaseSocketEvent<type
93
93
  createdAt: Date;
94
94
  } | undefined;
95
95
  }>;
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
+ }>;
96
124
  };
97
125
  get notificationSettings(): NotificationSettings | undefined;
98
126
  constructor(payload: ChatlistMessageSendSocketOutputDTO);
@@ -24,6 +24,7 @@ class ChatlistMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
24
24
  static schemas = {
25
25
  input: exports.ChatlistMessageSendSocketInputSchema,
26
26
  output: exports.ChatlistMessageSendSocketOutputSchema,
27
+ pushNotificationOutput: exports.ChatlistMessageSendPushOutputSchema,
27
28
  };
28
29
  get notificationSettings() {
29
30
  return {
@@ -33,7 +34,7 @@ class ChatlistMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
33
34
  };
34
35
  }
35
36
  constructor(payload) {
36
- super(enum_1.SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload);
37
+ super(enum_1.SocketEventType.CHATLIST_MESSAGE_RECEIVED, ChatlistMessageSendSocketEvent.schemas, payload, payload);
37
38
  }
38
39
  getIdentifier() {
39
40
  return 'default';
@@ -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;IAC3C,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,iCAGnD;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,4CAAoC;QAC3C,MAAM,EAAE,6CAAqC;KAC7C,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,CAAC,CAAC;IACnG,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAvBF,wEAwBC","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\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> {\n\tstatic readonly schemas = {\n\t\tinput: ChatlistMessageSendSocketInputSchema,\n\t\toutput: ChatlistMessageSendSocketOutputSchema,\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);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
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,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\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"]}
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- import { MediaType, UserRef } from '../../../utilities/enum';
2
+ import { ChatroomType, MediaType, UserRef } from '../../../utilities/enum';
3
3
  import { DTO } from '../../../utilities/validation';
4
4
  import { BaseSocketEvent } from '../BaseSocketEvent';
5
5
  import { NotificationSettings } from '../PushNotificationEvent';
@@ -12,6 +12,7 @@ export declare const ChatroomMessageSendSocketInputSchema: z.ZodObject<{
12
12
  }>;
13
13
  export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
14
14
  _id: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
15
+ chatroomType: z.ZodNativeEnum<typeof ChatroomType>;
15
16
  senderId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
16
17
  senderType: z.ZodNativeEnum<typeof UserRef>;
17
18
  sender: z.ZodObject<{
@@ -71,6 +72,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
71
72
  id: import("mongoose").Types.ObjectId;
72
73
  };
73
74
  senderType: UserRef;
75
+ chatroomType: ChatroomType;
74
76
  senderId: import("mongoose").Types.ObjectId;
75
77
  location?: {
76
78
  latitude?: number | undefined;
@@ -93,6 +95,7 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
93
95
  id: import("mongoose").Types.ObjectId;
94
96
  };
95
97
  senderType: UserRef;
98
+ chatroomType: ChatroomType;
96
99
  senderId: import("mongoose").Types.ObjectId;
97
100
  location?: {
98
101
  latitude?: number | undefined;
@@ -104,10 +107,13 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
104
107
  export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
105
108
  lastMessage: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
106
109
  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>>;
110
+ type: z.ZodNativeEnum<typeof ChatroomType>;
107
111
  }, "strip", z.ZodTypeAny, {
112
+ type: ChatroomType;
108
113
  lastMessage?: string | undefined;
109
114
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
110
115
  }, {
116
+ type: ChatroomType;
111
117
  lastMessage?: string | undefined;
112
118
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
113
119
  }>;
@@ -125,6 +131,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
125
131
  }>;
126
132
  output: z.ZodObject<{
127
133
  _id: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
134
+ chatroomType: z.ZodNativeEnum<typeof ChatroomType>;
128
135
  senderId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
129
136
  senderType: z.ZodNativeEnum<typeof UserRef>;
130
137
  sender: z.ZodObject<{
@@ -184,6 +191,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
184
191
  id: import("mongoose").Types.ObjectId;
185
192
  };
186
193
  senderType: UserRef;
194
+ chatroomType: ChatroomType;
187
195
  senderId: import("mongoose").Types.ObjectId;
188
196
  location?: {
189
197
  latitude?: number | undefined;
@@ -206,6 +214,7 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
206
214
  id: import("mongoose").Types.ObjectId;
207
215
  };
208
216
  senderType: UserRef;
217
+ chatroomType: ChatroomType;
209
218
  senderId: import("mongoose").Types.ObjectId;
210
219
  location?: {
211
220
  latitude?: number | undefined;
@@ -217,10 +226,13 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
217
226
  pushNotificationOutput: z.ZodObject<{
218
227
  lastMessage: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
219
228
  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>>;
229
+ type: z.ZodNativeEnum<typeof ChatroomType>;
220
230
  }, "strip", z.ZodTypeAny, {
231
+ type: ChatroomType;
221
232
  lastMessage?: string | undefined;
222
233
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
223
234
  }, {
235
+ type: ChatroomType;
224
236
  lastMessage?: string | undefined;
225
237
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
226
238
  }>;
@@ -228,5 +240,10 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
228
240
  get notificationSettings(): NotificationSettings | undefined;
229
241
  constructor(payload: ChatroomMessageSendSocketOutputDTO);
230
242
  static identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string;
243
+ getPushNotificationPayload(): {
244
+ type: ChatroomType;
245
+ lastMessage?: string | undefined;
246
+ chatroomId?: import("mongoose").Types.ObjectId | undefined;
247
+ } | undefined;
231
248
  protected getIdentifier(): string;
232
249
  }
@@ -13,6 +13,7 @@ exports.ChatroomMessageSendSocketInputSchema = zod_1.default.object({
13
13
  });
14
14
  exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
15
15
  _id: validation_1.ZodValidation.coerce.objectId('_id'),
16
+ chatroomType: validation_1.ZodValidation.enumType(enum_1.ChatroomType, 'chatroomType'),
16
17
  senderId: validation_1.ZodValidation.coerce.objectId('senderId'),
17
18
  senderType: validation_1.ZodValidation.enumType(enum_1.UserRef, 'senderType'),
18
19
  sender: zod_1.default.object({
@@ -39,6 +40,7 @@ exports.ChatroomMessageSendOutputSchema = zod_1.default.object({
39
40
  exports.ChatroomMessageSendPushOutputSchema = zod_1.default.object({
40
41
  lastMessage: validation_1.ZodValidation.string('lastMessage').optional(),
41
42
  chatroomId: validation_1.ZodValidation.coerce.objectId('chatroomId').optional(),
43
+ type: validation_1.ZodValidation.enumType(enum_1.ChatroomType, 'type'),
42
44
  });
43
45
  class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
44
46
  static schemas = {
@@ -57,12 +59,16 @@ class ChatroomMessageSendSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
57
59
  const pushPayload = {
58
60
  lastMessage: payload.content,
59
61
  chatroomId: payload.chatroomId,
62
+ type: payload.chatroomType,
60
63
  };
61
64
  super(enum_1.SocketEventType.CHATROOM_MESSAGE_SEND, ChatroomMessageSendSocketEvent.schemas, payload, pushPayload);
62
65
  }
63
66
  static identifier(input) {
64
67
  return input.chatroomId.toString();
65
68
  }
69
+ getPushNotificationPayload() {
70
+ return this.pushNotificationData;
71
+ }
66
72
  getIdentifier() {
67
73
  return this.data.chatroomId?.toString() ?? 'default';
68
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"chatroom-message-send.socket.event.js","sourceRoot":"/","sources":["libra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I,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;IACtD,CAAC;;AAvCF,wEAwCC","sourcesContent":["import z from 'zod';\nimport { ClickType, MediaType, SocketEventType, UserRef } from '../../../utilities/enum';\nimport { DTO, IdSchema, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSettings } from '../PushNotificationEvent';\n\nexport const ChatroomMessageSendSocketInputSchema = z.object({\n\tchatroomId: IdSchema,\n});\n\nexport const ChatroomMessageSendOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId('_id'),\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\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\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});\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};\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};\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);\n\t}\n\n\tstatic identifier(input: z.infer<typeof ChatroomMessageSendSocketInputSchema>): string {\n\t\treturn input.chatroomId.toString();\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn this.data.chatroomId?.toString() ?? 'default';\n\t}\n}\n"]}
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;AAGxC,QAAA,oCAAoC,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5D,UAAU,EAAE,qBAAQ;CACpB,CAAC,CAAC;AAEU,QAAA,+BAA+B,GA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tB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,SAAS,CAAC;IACtD,CAAC;;AA5CF,wEA6CC","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';\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\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\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\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};\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\ttype: payload.chatroomType,\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);\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"]}
@@ -65,5 +65,10 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
65
65
  };
66
66
  get notificationSettings(): NotificationSettings | undefined;
67
67
  constructor(payload: TicketActionsSocketOutputDTO);
68
+ getPushNotificationPayload(): {
69
+ type: TicketType;
70
+ status: TicketStatus;
71
+ ticketId: import("mongoose").Types.ObjectId;
72
+ } | undefined;
68
73
  protected getIdentifier(): string;
69
74
  }
@@ -40,6 +40,9 @@ class TicketActionsSocketEvent extends BaseSocketEvent_1.BaseSocketEvent {
40
40
  };
41
41
  super(enum_1.SocketEventType.TICKET_ACTIONS, TicketActionsSocketEvent.schemas, payload, pushPayload);
42
42
  }
43
+ getPushNotificationPayload() {
44
+ return this.pushNotificationData;
45
+ }
43
46
  getIdentifier() {
44
47
  return 'default';
45
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ticket-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/ticket-actions.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAA+F;AAC/F,8DAAmE;AACnE,wDAAqD;AAGxC,QAAA,8BAA8B,GAAG,aAAC,CAAC,SAAS,EAAE,CAAC;AAC/C,QAAA,+BAA+B,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,QAAQ,CAAC;IACtD,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,iBAAU,EAAE,MAAM,CAAC;CAChD,CAAC,CAAC;AAEU,QAAA,6BAA6B,GAAG,aAAC,CAAC,MAAM,CAAC;IACrD,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,QAAQ,CAAC;IACtD,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,iBAAU,EAAE,MAAM,CAAC;CAChD,CAAC,CAAC;AAMH,MAAa,wBAAyB,SAAQ,iCAI7C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,sCAA8B;QACrC,MAAM,EAAE,uCAA+B;QACvC,sBAAsB,EAAE,qCAA6B;KACrD,CAAC;IAEF,IAAW,oBAAoB;QAC9B,OAAO;YACN,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,gBAAS,CAAC,gBAAgB;SACrC,CAAC;IACH,CAAC;IAED,YAAY,OAAqC;QAChD,MAAM,WAAW,GAA+B;YAC/C,QAAQ,EAAE,OAAO,CAAC,GAAG;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;SAClB,CAAC;QAEF,KAAK,CAAC,sBAAe,CAAC,cAAc,EAAE,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/F,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AA/BF,4DAgCC","sourcesContent":["import z from 'zod';\nimport { ClickType, SocketEventType, TicketStatus, TicketType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSettings } from '../PushNotificationEvent';\n\nexport const TicketActionsSocketInputSchema = z.undefined();\nexport const TicketActionsSocketOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId(),\n\tstatus: ZodValidation.enumType(TicketStatus, 'status'),\n\ttype: ZodValidation.enumType(TicketType, 'type'),\n});\n\nexport const TicketActionsPushOutputSchema = z.object({\n\tticketId: ZodValidation.coerce.objectId(),\n\tstatus: ZodValidation.enumType(TicketStatus, 'status'),\n\ttype: ZodValidation.enumType(TicketType, 'type'),\n});\n\nexport type TicketActionsSocketOutputDTO = DTO<typeof TicketActionsSocketOutputSchema>;\nexport type TicketActionsPushOutputDTO = DTO<typeof TicketActionsPushOutputSchema>;\nexport type TicketActionsSocketInputDTO = DTO<typeof TicketActionsSocketInputSchema>;\n\nexport class TicketActionsSocketEvent extends BaseSocketEvent<\n\ttypeof TicketActionsSocketInputSchema,\n\ttypeof TicketActionsSocketOutputSchema,\n\ttypeof TicketActionsPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: TicketActionsSocketInputSchema,\n\t\toutput: TicketActionsSocketOutputSchema,\n\t\tpushNotificationOutput: TicketActionsPushOutputSchema,\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_TICKET,\n\t\t};\n\t}\n\n\tconstructor(payload: TicketActionsSocketOutputDTO) {\n\t\tconst pushPayload: TicketActionsPushOutputDTO = {\n\t\t\tticketId: payload._id,\n\t\t\tstatus: payload.status,\n\t\t\ttype: payload.type,\n\t\t};\n\n\t\tsuper(SocketEventType.TICKET_ACTIONS, TicketActionsSocketEvent.schemas, payload, pushPayload);\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
1
+ {"version":3,"file":"ticket-actions.socket.event.js","sourceRoot":"/","sources":["libraries/socket/events/ticket-actions.socket.event.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AACpB,kDAA+F;AAC/F,8DAAmE;AACnE,wDAAqD;AAGxC,QAAA,8BAA8B,GAAG,aAAC,CAAC,SAAS,EAAE,CAAC;AAC/C,QAAA,+BAA+B,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,GAAG,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,QAAQ,CAAC;IACtD,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,iBAAU,EAAE,MAAM,CAAC;CAChD,CAAC,CAAC;AAEU,QAAA,6BAA6B,GAAG,aAAC,CAAC,MAAM,CAAC;IACrD,QAAQ,EAAE,0BAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,0BAAa,CAAC,QAAQ,CAAC,mBAAY,EAAE,QAAQ,CAAC;IACtD,IAAI,EAAE,0BAAa,CAAC,QAAQ,CAAC,iBAAU,EAAE,MAAM,CAAC;CAChD,CAAC,CAAC;AAMH,MAAa,wBAAyB,SAAQ,iCAI7C;IACA,MAAM,CAAU,OAAO,GAAG;QACzB,KAAK,EAAE,sCAA8B;QACrC,MAAM,EAAE,uCAA+B;QACvC,sBAAsB,EAAE,qCAA6B;KACrD,CAAC;IAEF,IAAW,oBAAoB;QAC9B,OAAO;YACN,kBAAkB,EAAE,IAAI;YACxB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,gBAAS,CAAC,gBAAgB;SACrC,CAAC;IACH,CAAC;IAED,YAAY,OAAqC;QAChD,MAAM,WAAW,GAA+B;YAC/C,QAAQ,EAAE,OAAO,CAAC,GAAG;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;SAClB,CAAC;QAEF,KAAK,CAAC,sBAAe,CAAC,cAAc,EAAE,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/F,CAAC;IAEM,0BAA0B;QAChC,OAAO,IAAI,CAAC,oBAAoB,CAAC;IAClC,CAAC;IAES,aAAa;QACtB,OAAO,SAAS,CAAC;IAClB,CAAC;;AAnCF,4DAoCC","sourcesContent":["import z from 'zod';\nimport { ClickType, SocketEventType, TicketStatus, TicketType } from '../../../utilities/enum';\nimport { DTO, ZodValidation } from '../../../utilities/validation';\nimport { BaseSocketEvent } from '../BaseSocketEvent';\nimport { NotificationSettings } from '../PushNotificationEvent';\n\nexport const TicketActionsSocketInputSchema = z.undefined();\nexport const TicketActionsSocketOutputSchema = z.object({\n\t_id: ZodValidation.coerce.objectId(),\n\tstatus: ZodValidation.enumType(TicketStatus, 'status'),\n\ttype: ZodValidation.enumType(TicketType, 'type'),\n});\n\nexport const TicketActionsPushOutputSchema = z.object({\n\tticketId: ZodValidation.coerce.objectId(),\n\tstatus: ZodValidation.enumType(TicketStatus, 'status'),\n\ttype: ZodValidation.enumType(TicketType, 'type'),\n});\n\nexport type TicketActionsSocketOutputDTO = DTO<typeof TicketActionsSocketOutputSchema>;\nexport type TicketActionsPushOutputDTO = DTO<typeof TicketActionsPushOutputSchema>;\nexport type TicketActionsSocketInputDTO = DTO<typeof TicketActionsSocketInputSchema>;\n\nexport class TicketActionsSocketEvent extends BaseSocketEvent<\n\ttypeof TicketActionsSocketInputSchema,\n\ttypeof TicketActionsSocketOutputSchema,\n\ttypeof TicketActionsPushOutputSchema\n> {\n\tstatic readonly schemas = {\n\t\tinput: TicketActionsSocketInputSchema,\n\t\toutput: TicketActionsSocketOutputSchema,\n\t\tpushNotificationOutput: TicketActionsPushOutputSchema,\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_TICKET,\n\t\t};\n\t}\n\n\tconstructor(payload: TicketActionsSocketOutputDTO) {\n\t\tconst pushPayload: TicketActionsPushOutputDTO = {\n\t\t\tticketId: payload._id,\n\t\t\tstatus: payload.status,\n\t\t\ttype: payload.type,\n\t\t};\n\n\t\tsuper(SocketEventType.TICKET_ACTIONS, TicketActionsSocketEvent.schemas, payload, pushPayload);\n\t}\n\n\tpublic getPushNotificationPayload() {\n\t\treturn this.pushNotificationData;\n\t}\n\n\tprotected getIdentifier(): string {\n\t\treturn 'default';\n\t}\n}\n"]}
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.3.19
25
+ Version: 1.3.21
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",