@lyxa.ai/core 1.4.334-alpha-11 → 1.4.334-alpha-13

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.
@@ -1,4 +1,4 @@
1
1
  export declare class LiveActivityTokenInfo {
2
2
  deviceId?: string;
3
- liveActivityToken?: number;
3
+ liveActivityToken?: string;
4
4
  }
@@ -21,7 +21,7 @@ __decorate([
21
21
  __metadata("design:type", String)
22
22
  ], LiveActivityTokenInfo.prototype, "deviceId", void 0);
23
23
  __decorate([
24
- (0, typegoose_1.prop)({ type: String, default: 0 }),
25
- __metadata("design:type", Number)
24
+ (0, typegoose_1.prop)({ type: String, default: '' }),
25
+ __metadata("design:type", String)
26
26
  ], LiveActivityTokenInfo.prototype, "liveActivityToken", void 0);
27
27
  //# sourceMappingURL=live-activity-token-info.model.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"live-activity-token-info.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/live-activity-token-info.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAEjD,MAAa,qBAAqB;IAE1B,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;CAClC;AAND,sDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;uDACX;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;gEACD","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\n\nexport class LiveActivityTokenInfo {\n\t@prop({ type: String, default: '' })\n\tpublic deviceId?: string;\n\n\t@prop({ type: String, default: 0 })\n\tpublic liveActivityToken?: number;\n}\n"]}
1
+ {"version":3,"file":"live-activity-token-info.model.js","sourceRoot":"/","sources":["libraries/mongo/models/embedded/live-activity-token-info.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAiD;AAEjD,MAAa,qBAAqB;IAE1B,QAAQ,CAAU;IAGlB,iBAAiB,CAAU;CAClC;AAND,sDAMC;AAJO;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;uDACX;AAGlB;IADN,IAAA,gBAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;gEACF","sourcesContent":["import { prop, Ref } from '@typegoose/typegoose';\n\nexport class LiveActivityTokenInfo {\n\t@prop({ type: String, default: '' })\n\tpublic deviceId?: string;\n\n\t@prop({ type: String, default: '' })\n\tpublic liveActivityToken?: string;\n}\n"]}
@@ -124,7 +124,7 @@ class LiveActivityMessageBuilder {
124
124
  aps: {
125
125
  timestamp: (0, dayjs_1.default)().unix(),
126
126
  event: payload.data.event,
127
- 'content-state': { status: payload.data.status, etaMinutes: payload.data.deliveryETAInMinutes },
127
+ 'content-state': { status: payload.data.status, etaMinutes: Number(payload.data.deliveryETAInMinutes) },
128
128
  },
129
129
  },
130
130
  headers: {
@@ -1 +1 @@
1
- {"version":3,"file":"firebase-message.builder.js","sourceRoot":"/","sources":["libraries/notification/firebase-message.builder.ts"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;AAE1B,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,mDAA+B,CAAA;AAChC,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAMD,MAAa,6BAA6B;IAClC,YAAY,CAClB,IAAsB,EACtB,OAA+B,EAC/B,MAAgB;QAEhB,QAAQ,IAAI,EAAE,CAAC;YACd,KAAK,gBAAgB,CAAC,OAAO;gBAC5B,OAAO,IAAI,qBAAqB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClE,KAAK,gBAAgB,CAAC,GAAG;gBACxB,OAAO,I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ACtC,gBAAgB,EAAE,OAAO,CAAC,IAAI,IAAI,EAAE;aACpC;YACD,MAAM,EAAE,MAAM;SACd,CAAC;IACH,CAAC;CACD;AAdD,sDAcC;AAED,MAAa,0BAA0B;IACtC,YAAY,CAAC,OAA+B,EAAE,MAAgB;QAI7D,OAAO;YAEN,YAAY,EAAE;gBACb,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;aAClB;YACD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACL,OAAO,EAAE;oBACR,GAAG,EAAE;wBACJ,SAAS,EAAE,IAAA,eAAK,GAAE,CAAC,IAAI,EAAE;wBACzB,KAAK,EAAE,OAAQ,CAAC,IAAK,CAAC,KAAK;wBAC3B,eAAe,EAAE,EAAE,MAAM,EAAE,OAAQ,CAAC,IAAK,CAAC,MAAM,EAAE,UAAU,EAAE,OAAQ,CAAC,IAAK,CAAC,oBAAoB,EAAE;qBACnG;iBACD;gBACD,OAAO,EAAE;oBACR,gBAAgB,EAAE,cAAc;oBAChC,eAAe,EAAE,IAAI;oBACrB,YAAY,EAAE,qCAAqC;iBACnD;aACD;SACD,CAAC;IACH,CAAC;CACD;AA5BD,gEA4BC","sourcesContent":["import { messaging } from 'firebase-admin';\nimport { FCMNotificationPayload } from './lyxa-fcm.service';\nimport dayjs from 'dayjs';\n\nexport enum MultiMessageType {\n\tOLD = 'old',\n\tCONSOLE = 'console',\n\tDEFAULT = 'default',\n\tLIVE_ACTIVITY = 'live_activity'\n}\n\nexport interface IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;\n}\n\nexport class FirebaseMessageBuilderFactory {\n\tpublic buildMessage(\n\t\ttype: MultiMessageType,\n\t\tpayload: FCMNotificationPayload,\n\t\ttokens: string[]\n\t): messaging.MulticastMessage {\n\t\tswitch (type) {\n\t\t\tcase MultiMessageType.CONSOLE:\n\t\t\t\treturn new ConsoleMessageBuilder().buildMessage(payload, tokens);\n\t\t\tcase MultiMessageType.OLD:\n\t\t\t\treturn new OldMessageBuilder().buildMessage(payload, tokens);\n\t\t\tcase MultiMessageType.LIVE_ACTIVITY:\n\t\t\t\treturn new LiveActivityMessageBuilder().buildMessage(payload, tokens);\n\t\t\t// case MultiMessageType.DEFAULT:\n\t\t\t// \treturn new DefaultMessageBuilder().buildMessage(payload, tokens);\n\t\t\tdefault:\n\t\t\t\treturn new DefaultMessageBuilder().buildMessage(payload, tokens);\n\t\t}\n\t}\n}\n\nexport class DefaultMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\t\tconst channelId = payload.sound ? 'order_alert' : 'default';\n\n\t\treturn {\n\t\t\tdata: { ...payload.data, channelId: isInvisible ? 'silent' : channelId },\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tandroid: {\n\t\t\t\tpriority: 'high',\n\t\t\t\tnotification: {\n\t\t\t\t\tchannelId: 'silent',\n\t\t\t\t},\n\t\t\t},\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\tsound: payload.sound || 'default',\n\t\t\t\t\t\tcontentAvailable: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\theaders: {\n\t\t\t\t\t'apns-push-type': 'background',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport class OldMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\n\t\tconst message: messaging.MulticastMessage = {\n\t\t\tdata: payload.data || {},\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tandroid: { priority: 'high' },\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\tsound: payload.sound || 'default',\n\t\t\t\t\t\tcontentAvailable: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tif (!isInvisible) {\n\t\t\tmessage.notification = {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t};\n\n\t\t\tmessage.android = {\n\t\t\t\tpriority: 'high',\n\t\t\t\tnotification: {\n\t\t\t\t\tchannelId: payload.sound ? 'android_Push_Notification_Channel_1' : 'default',\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn message;\n\t}\n}\n\nexport class ConsoleMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\t\tconst channelId = payload.sound ? 'order_alert' : 'default';\n\t\treturn {\n\t\t\tdata: {\n\t\t\t\t...payload.data,\n\t\t\t\tchannelId: isInvisible ? 'silent' : channelId,\n\t\t\t\tnotificationTitle: payload.title ?? '',\n\t\t\t\tnotificationBody: payload.body ?? '',\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t};\n\t}\n}\n\nexport class LiveActivityMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\t// const isInvisible = payload.invisible === true;\n\t\t// const channelId = payload.sound ? 'order_alert' : 'default';\n\n\t\treturn {\n\t\t\t// data: { ...payload.data, channelId: isInvisible ? 'silent' : channelId },\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\ttimestamp: dayjs().unix(),\n\t\t\t\t\t\tevent: payload!.data!.event,\n\t\t\t\t\t\t'content-state': { status: payload!.data!.status, etaMinutes: payload!.data!.deliveryETAInMinutes },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\theaders: {\n\t\t\t\t\t'apns-push-type': 'liveactivity',\n\t\t\t\t\t'apns-priority': '10',\n\t\t\t\t\t'apns-topic': 'com.lyxa.app.push-type.liveactivity',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"firebase-message.builder.js","sourceRoot":"/","sources":["libraries/notification/firebase-message.builder.ts"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;AAE1B,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC3B,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,mDAA+B,CAAA;AAChC,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAMD,MAAa,6BAA6B;IAClC,YAAY,CAClB,IAAsB,EACtB,OAA+B,EAC/B,MAAgB;QAEhB,QAAQ,IAAI,EAAE,CAAC;YACd,KAAK,gBAAgB,CAAC,OAAO;gBAC5B,OAAO,IAAI,qBAAqB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAClE,KAAK,gBAAgB,CAAC,GAAG;gBACxB,OAAO,IAAI,iBAAiB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAC9D,KAAK,gBAAgB,CAAC,aAAa;gBAClC,OAAO,IAAI,0BAA0B,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAGvE;gBACC,OAAO,IAAI,qBAAqB,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnE,CAAC;IACF,CAAC;CACD;AAnBD,sEAmBC;AAED,MAAa,qBAAqB;IACjC,YAAY,CAAC,OAA+B,EAAE,MAAgB;QAC7D,MAAM,WAAW,GAAG,OAAO,CAAC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AI,EAAE;wBACzB,KAAK,EAAE,OAAQ,CAAC,IAAK,CAAC,KAAK;wBAC3B,eAAe,EAAE,EAAE,MAAM,EAAE,OAAQ,CAAC,IAAK,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,OAAQ,CAAC,IAAK,CAAC,oBAAoB,CAAC,EAAE;qBAC3G;iBACD;gBACD,OAAO,EAAE;oBACR,gBAAgB,EAAE,cAAc;oBAChC,eAAe,EAAE,IAAI;oBACrB,YAAY,EAAE,qCAAqC;iBACnD;aACD;SACD,CAAC;IACH,CAAC;CACD;AA5BD,gEA4BC","sourcesContent":["import { messaging } from 'firebase-admin';\nimport { FCMNotificationPayload } from './lyxa-fcm.service';\nimport dayjs from 'dayjs';\n\nexport enum MultiMessageType {\n\tOLD = 'old',\n\tCONSOLE = 'console',\n\tDEFAULT = 'default',\n\tLIVE_ACTIVITY = 'live_activity'\n}\n\nexport interface IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage;\n}\n\nexport class FirebaseMessageBuilderFactory {\n\tpublic buildMessage(\n\t\ttype: MultiMessageType,\n\t\tpayload: FCMNotificationPayload,\n\t\ttokens: string[]\n\t): messaging.MulticastMessage {\n\t\tswitch (type) {\n\t\t\tcase MultiMessageType.CONSOLE:\n\t\t\t\treturn new ConsoleMessageBuilder().buildMessage(payload, tokens);\n\t\t\tcase MultiMessageType.OLD:\n\t\t\t\treturn new OldMessageBuilder().buildMessage(payload, tokens);\n\t\t\tcase MultiMessageType.LIVE_ACTIVITY:\n\t\t\t\treturn new LiveActivityMessageBuilder().buildMessage(payload, tokens);\n\t\t\t// case MultiMessageType.DEFAULT:\n\t\t\t// \treturn new DefaultMessageBuilder().buildMessage(payload, tokens);\n\t\t\tdefault:\n\t\t\t\treturn new DefaultMessageBuilder().buildMessage(payload, tokens);\n\t\t}\n\t}\n}\n\nexport class DefaultMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\t\tconst channelId = payload.sound ? 'order_alert' : 'default';\n\n\t\treturn {\n\t\t\tdata: { ...payload.data, channelId: isInvisible ? 'silent' : channelId },\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tandroid: {\n\t\t\t\tpriority: 'high',\n\t\t\t\tnotification: {\n\t\t\t\t\tchannelId: 'silent',\n\t\t\t\t},\n\t\t\t},\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\tsound: payload.sound || 'default',\n\t\t\t\t\t\tcontentAvailable: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\theaders: {\n\t\t\t\t\t'apns-push-type': 'background',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n}\n\nexport class OldMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\n\t\tconst message: messaging.MulticastMessage = {\n\t\t\tdata: payload.data || {},\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tandroid: { priority: 'high' },\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\tsound: payload.sound || 'default',\n\t\t\t\t\t\tcontentAvailable: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\n\t\tif (!isInvisible) {\n\t\t\tmessage.notification = {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t};\n\n\t\t\tmessage.android = {\n\t\t\t\tpriority: 'high',\n\t\t\t\tnotification: {\n\t\t\t\t\tchannelId: payload.sound ? 'android_Push_Notification_Channel_1' : 'default',\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\treturn message;\n\t}\n}\n\nexport class ConsoleMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\tconst isInvisible = payload.invisible === true;\n\t\tconst channelId = payload.sound ? 'order_alert' : 'default';\n\t\treturn {\n\t\t\tdata: {\n\t\t\t\t...payload.data,\n\t\t\t\tchannelId: isInvisible ? 'silent' : channelId,\n\t\t\t\tnotificationTitle: payload.title ?? '',\n\t\t\t\tnotificationBody: payload.body ?? '',\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t};\n\t}\n}\n\nexport class LiveActivityMessageBuilder implements IFirebaseMessageBuilder {\n\tbuildMessage(payload: FCMNotificationPayload, tokens: string[]): messaging.MulticastMessage {\n\t\t// const isInvisible = payload.invisible === true;\n\t\t// const channelId = payload.sound ? 'order_alert' : 'default';\n\n\t\treturn {\n\t\t\t// data: { ...payload.data, channelId: isInvisible ? 'silent' : channelId },\n\t\t\tnotification: {\n\t\t\t\ttitle: payload.title,\n\t\t\t\tbody: payload.body,\n\t\t\t},\n\t\t\ttokens: tokens,\n\t\t\tapns: {\n\t\t\t\tpayload: {\n\t\t\t\t\taps: {\n\t\t\t\t\t\ttimestamp: dayjs().unix(),\n\t\t\t\t\t\tevent: payload!.data!.event,\n\t\t\t\t\t\t'content-state': { status: payload!.data!.status, etaMinutes: Number(payload!.data!.deliveryETAInMinutes) },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\theaders: {\n\t\t\t\t\t'apns-push-type': 'liveactivity',\n\t\t\t\t\t'apns-priority': '10',\n\t\t\t\t\t'apns-topic': 'com.lyxa.app.push-type.liveactivity',\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n}\n"]}
@@ -36,6 +36,7 @@ let LyxaFcmSender = class LyxaFcmSender {
36
36
  console.log("notification: ", messages[0].notification);
37
37
  console.log("notification: ", messages[0].tokens);
38
38
  console.log("notification: ", messages[0].apns);
39
+ console.log("notification content state apn: ", messages[0].apns?.payload?.aps['content-state']);
39
40
  return await this.sendToAllTokens(project, type, payload, messages);
40
41
  }
41
42
  buildMultiCastMessages(type, tokens, payload) {
@@ -57,10 +58,10 @@ let LyxaFcmSender = class LyxaFcmSender {
57
58
  let logData;
58
59
  try {
59
60
  console.log("fcm service send message: ", { project, message });
60
- console.log("sendToAllTokens: ", messages[0].apns?.payload);
61
- console.log("sendToAllTokens: ", messages[0].apns?.headers);
62
- console.log("sendToAllTokens: ", messages[0].apns?.liveActivityToken);
63
- console.log("sendToAllTokens: ", messages[0].apns?.fcmOptions);
61
+ console.log("sendToAllTokens payload: ", messages[0].apns?.payload);
62
+ console.log("sendToAllTokens headers: ", messages[0].apns?.headers);
63
+ console.log("sendToAllTokens liveActivityToken: ", messages[0].apns?.liveActivityToken);
64
+ console.log("sendToAllTokens fcmOptions: ", messages[0].apns?.fcmOptions);
64
65
  const result = await this.fcmService.sendMessage(project, message);
65
66
  const payloadKnownValid = result.successCount > 0;
66
67
  result.responses.forEach((r, i) => {
@@ -1 +1 @@
1
- {"version":3,"file":"lyxa-fcm-sender.js","sourceRoot":"/","sources":["libraries/notification/lyxa-fcm-sender.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAiC;AACjC,iEAA4D;AAC5D,yEAA6F;AAG7F,6BAAqC;AAU9B,IAAM,aAAa,GAAnB,MAAM,aAAa;;IAsBP;IACA;IAtBX,MAAM,CAAU,SAAS,GAAG,GAAG,CAAC;IAa/B,MAAM,CAAU,2BAA2B,GAAwB,IAAI,GAAG,CAAC;QAElF,6CAA6C;QAE7C,sCAAsC;KACtC,CAAC,CAAC;IAEH,YACkB,UAA8B,EAC9B,OAAsC;QADtC,eAAU,GAAV,UAAU,CAAoB;QAC9B,YAAO,GAAP,OAAO,CAA+B;IACrD,CAAC;IAQG,KAAK,CAAC,YAAY,CACxB,OAAmB,EACnB,IAAsB,EACtB,MAAgB,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,IAAI,EAAE,OAAO;iBACb,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBAId,YAAY,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;gBAErC,OAAO,GAAG;oBACT,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACnC,OAAO;oBACP,IAAI;oBACJ,mBAAmB,EAAE,IAAI,KAAK,2CAAgB,CAAC,OAAO;oBACtD,WAAW,EAAE,OAAO,CAAC,MAAM;oBAC3B,YAAY,EAAE,OAAO;oBACrB,OAAO;iBACP,CAAC;gBACF,MAAM,CAAC,KAAK,CAAC,+CAA+C,EAAE,GAAG,EAAE;oBAClE,GAAG,EAAE,4BAA4B;oBACjC,IAAI,EAAE,OAAO;iBACb,CAAC,CAAC;YACJ,CAAC;QACF,CAAC,CAAC,CACF,CAAC;QAEF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;IACzC,CAAC;IAcO,iBAAiB,CAAC,SAA6B,EAAE,iBAA0B;QAClF,IAAI,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QAC7B,IAAI,eAAa,CAAC,2BAA2B,CAAC,GAAG,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1E,IAAI,SAAS,KAAK,4BAA4B;YAAE,OAAO,iBAAiB,CAAC;QACzE,OAAO,KAAK,CAAC;IACd,CAAC;;AAxKW,sCAAa;wBAAb,aAAa;IADzB,IAAA,gBAAO,GAAE;qCAuBqB,yCAAkB;QACrB,wDAA6B;GAvB5C,aAAa,CAyKzB","sourcesContent":["import { Service } from 'typedi';\nimport { FirebaseFcmService } from './firebase-fcm.service';\nimport { FirebaseMessageBuilderFactory, MultiMessageType } from './firebase-message.builder';\nimport { messaging } from 'firebase-admin';\nimport { FCMNotificationPayload, FcmProject } from './lyxa-fcm.service';\nimport { getLibraries } from '../..';\n\nexport interface FcmSendResult {\n\t/** Every token that failed to receive the message, for any reason. */\n\tfailedTokens: string[];\n\t/** Subset of failedTokens that are confirmed invalid and must be deleted. */\n\ttokensToDelete: string[];\n}\n\n@Service()\nexport class LyxaFcmSender {\n\tpublic static readonly MAX_BATCH = 500;\n\n\t/**\n\t * FCM error codes that unambiguously mean the registration token itself is\n\t * malformed or no longer registered, so it will never be valid again and is\n\t * safe to delete from our records.\n\t *\n\t * Everything else (server/internal errors, rate limits, auth/credential\n\t * issues, transport failures) is transient and must NOT cause deletion.\n\t *\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens#ensuring-registration-token-freshness\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens\n\t */\n\tprivate static readonly REMOVABLE_TOKEN_ERROR_CODES: ReadonlySet<string> = new Set([\n\t\t// UNREGISTERED (404): token was unregistered (app uninstalled / token refreshed).\n\t\t'messaging/registration-token-not-registered',\n\t\t// Token is not a valid FCM registration token (wrong format).\n\t\t'messaging/invalid-registration-token',\n\t]);\n\n\tconstructor(\n\t\tprivate readonly fcmService: FirebaseFcmService,\n\t\tprivate readonly builder: FirebaseMessageBuilderFactory\n\t) {}\n\n\t/**\n\t * Sends notifications and reports the outcome. `failedTokens` contains every\n\t * failure; `tokensToDelete` is the subset that is confirmed invalid and must\n\t * be removed from our records. Transient failures stay out of\n\t * `tokensToDelete` so they never trigger token deletion.\n\t */\n\tpublic async sendMessages(\n\t\tproject: FcmProject,\n\t\ttype: MultiMessageType,\n\t\ttokens: string[],\n\t\tpayload: FCMNotificationPayload\n\t): Promise<FcmSendResult> {\n\t\tif (!tokens.length) return { failedTokens: [], tokensToDelete: [] };\n\t\tconst messages = this.buildMultiCastMessages(type, tokens, payload);\t\t\n\t\tconsole.log({ project, type, payload, messages })\n\t\tconsole.log(\"notification: \", messages[0].notification)\n\t\tconsole.log(\"notification: \", messages[0].tokens)\n\t\tconsole.log(\"notification: \", messages[0].apns)\n\t\treturn await this.sendToAllTokens(project, type, payload, messages);\n\t}\n\n\tprivate buildMultiCastMessages(\n\t\ttype: MultiMessageType,\n\t\ttokens: string[],\n\t\tpayload: FCMNotificationPayload\n\t): messaging.MulticastMessage[] {\n\t\tconst tokenChunks = this.chunkArray(tokens, LyxaFcmSender.MAX_BATCH);\n\t\treturn tokenChunks.map(chunk => this.builder.buildMessage(type, payload, chunk));\n\t}\n\n\tprivate chunkArray<T>(arr: T[], size: number): T[][] {\n\t\tconst chunks: T[][] = [];\n\t\tfor (let i = 0; i < arr.length; i += size) {\n\t\t\tchunks.push(arr.slice(i, i + size));\n\t\t}\n\t\treturn chunks;\n\t}\n\n\tprivate async sendToAllTokens(\n\t\tproject: FcmProject,\n\t\ttype: MultiMessageType,\n\t\tpayload: FCMNotificationPayload,\n\t\tmessages: messaging.MulticastMessage[]\n\t): Promise<FcmSendResult> {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst failedTokens: string[] = [];\n\t\tconst tokensToDelete: string[] = [];\n\n\t\tawait Promise.all(\n\t\t\tmessages.map(async message => {\n\t\t\t\tlet logData: Record<string, unknown>;\n\n\t\t\t\ttry {\n\t\t\t\t\tconsole.log(\"fcm service send message: \",{ project, message })\n\t\t\t\t\tconsole.log(\"sendToAllTokens: \", messages[0].apns?.payload)\n\t\t\t\t\tconsole.log(\"sendToAllTokens: \", messages[0].apns?.headers)\n\t\t\t\t\tconsole.log(\"sendToAllTokens: \", messages[0].apns?.liveActivityToken)\n\t\t\t\t\tconsole.log(\"sendToAllTokens: \", messages[0].apns?.fcmOptions)\n\t\t\t\t\tconst result = await this.fcmService.sendMessage(project, message);\n\n\t\t\t\t\t// A sibling token succeeding with the identical payload proves the\n\t\t\t\t\t// payload is valid, which is required before treating an\n\t\t\t\t\t// INVALID_ARGUMENT error as a bad token (see shouldRemoveToken).\n\t\t\t\t\tconst payloadKnownValid = result.successCount > 0;\n\n\t\t\t\t\tresult.responses.forEach((r, i) => {\n\t\t\t\t\t\tif (r.success) return;\n\t\t\t\t\t\tfailedTokens.push(message.tokens[i]);\n\t\t\t\t\t\tif (this.shouldRemoveToken(r.error?.code, payloadKnownValid)) {\n\t\t\t\t\t\t\ttokensToDelete.push(message.tokens[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tlogData = {\n\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tconsoleNotification: type === MultiMessageType.CONSOLE,\n\t\t\t\t\t\tgroupTokens: message.tokens,\n\t\t\t\t\t\tgroupPayload: payload,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tsuccessCount: result.successCount,\n\t\t\t\t\t\t\tfailureCount: result.failureCount,\n\t\t\t\t\t\t\tresponses: result.responses.map((r, i) => ({\n\t\t\t\t\t\t\t\ttoken: message.tokens[i],\n\t\t\t\t\t\t\t\tsuccess: r.success,\n\t\t\t\t\t\t\t\t...(r.error && {\n\t\t\t\t\t\t\t\t\terrorCode: r.error.code,\n\t\t\t\t\t\t\t\t\terrorMessage: r.error.message,\n\t\t\t\t\t\t\t\t\twillDelete: this.shouldRemoveToken(r.error.code, payloadKnownValid),\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tlogger.info('Called Firebase function sendEachForMulticast', {\n\t\t\t\t\t\ttag: 'notification.attempted.new',\n\t\t\t\t\t\tdata: logData,\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// The whole batch send threw (transport/auth/infra failure), not a\n\t\t\t\t\t// per-token rejection. They count as failed, but are not proven\n\t\t\t\t\t// invalid, so they must not be deleted.\n\t\t\t\t\tfailedTokens.push(...message.tokens);\n\n\t\t\t\t\tlogData = {\n\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tconsoleNotification: type === MultiMessageType.CONSOLE,\n\t\t\t\t\t\tgroupTokens: message.tokens,\n\t\t\t\t\t\tgroupPayload: payload,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t};\n\t\t\t\t\tlogger.error('Called Firebase function sendEachForMulticast', err, {\n\t\t\t\t\t\ttag: 'notification.attempted.new',\n\t\t\t\t\t\tdata: logData,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\treturn { failedTokens, tokensToDelete };\n\t}\n\n\t/**\n\t * Decides whether a per-token FCM failure means the token should be removed.\n\t *\n\t * Only the codes in {@link LyxaFcmSender.REMOVABLE_TOKEN_ERROR_CODES} are\n\t * unconditionally removable. `messaging/invalid-argument` (INVALID_ARGUMENT)\n\t * is special: Firebase notes it \"can also be returned in cases of issues in\n\t * the message payload, so it signals an invalid token only if the payload is\n\t * completely valid.\" We therefore only remove on it when we know the payload\n\t * was valid (a sibling token in the same batch succeeded).\n\t *\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens\n\t */\n\tprivate shouldRemoveToken(errorCode: string | undefined, payloadKnownValid: boolean): boolean {\n\t\tif (!errorCode) return false;\n\t\tif (LyxaFcmSender.REMOVABLE_TOKEN_ERROR_CODES.has(errorCode)) return true;\n\t\tif (errorCode === 'messaging/invalid-argument') return payloadKnownValid;\n\t\treturn false;\n\t}\n}\n"]}
1
+ {"version":3,"file":"lyxa-fcm-sender.js","sourceRoot":"/","sources":["libraries/notification/lyxa-fcm-sender.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAiC;AACjC,iEAA4D;AAC5D,yEAA6F;AAG7F,6BAAqC;AAU9B,IAAM,aAAa,GAAnB,MAAM,aAAa;;IAsBP;IACA;IAtBX,MAAM,CAAU,SAAS,GAAG,GAAG,CAAC;IAa/B,MAAM,CAAU,2BAA2B,GAAwB,IAAI,GAAG,CAAC;QAElF,6CAA6C;QAE7C,sCAAsC;KACtC,CAAC,CAAC;IAEH,YACkB,UAA8B,EAC9B,OAAsC;QADtC,eAAU,GAAV,U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5C,aAAa,CA0KzB","sourcesContent":["import { Service } from 'typedi';\nimport { FirebaseFcmService } from './firebase-fcm.service';\nimport { FirebaseMessageBuilderFactory, MultiMessageType } from './firebase-message.builder';\nimport { messaging } from 'firebase-admin';\nimport { FCMNotificationPayload, FcmProject } from './lyxa-fcm.service';\nimport { getLibraries } from '../..';\n\nexport interface FcmSendResult {\n\t/** Every token that failed to receive the message, for any reason. */\n\tfailedTokens: string[];\n\t/** Subset of failedTokens that are confirmed invalid and must be deleted. */\n\ttokensToDelete: string[];\n}\n\n@Service()\nexport class LyxaFcmSender {\n\tpublic static readonly MAX_BATCH = 500;\n\n\t/**\n\t * FCM error codes that unambiguously mean the registration token itself is\n\t * malformed or no longer registered, so it will never be valid again and is\n\t * safe to delete from our records.\n\t *\n\t * Everything else (server/internal errors, rate limits, auth/credential\n\t * issues, transport failures) is transient and must NOT cause deletion.\n\t *\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens#ensuring-registration-token-freshness\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens\n\t */\n\tprivate static readonly REMOVABLE_TOKEN_ERROR_CODES: ReadonlySet<string> = new Set([\n\t\t// UNREGISTERED (404): token was unregistered (app uninstalled / token refreshed).\n\t\t'messaging/registration-token-not-registered',\n\t\t// Token is not a valid FCM registration token (wrong format).\n\t\t'messaging/invalid-registration-token',\n\t]);\n\n\tconstructor(\n\t\tprivate readonly fcmService: FirebaseFcmService,\n\t\tprivate readonly builder: FirebaseMessageBuilderFactory\n\t) {}\n\n\t/**\n\t * Sends notifications and reports the outcome. `failedTokens` contains every\n\t * failure; `tokensToDelete` is the subset that is confirmed invalid and must\n\t * be removed from our records. Transient failures stay out of\n\t * `tokensToDelete` so they never trigger token deletion.\n\t */\n\tpublic async sendMessages(\n\t\tproject: FcmProject,\n\t\ttype: MultiMessageType,\n\t\ttokens: string[],\n\t\tpayload: FCMNotificationPayload\n\t): Promise<FcmSendResult> {\n\t\tif (!tokens.length) return { failedTokens: [], tokensToDelete: [] };\n\t\tconst messages = this.buildMultiCastMessages(type, tokens, payload);\t\t\n\t\tconsole.log({ project, type, payload, messages })\n\t\tconsole.log(\"notification: \", messages[0].notification)\n\t\tconsole.log(\"notification: \", messages[0].tokens)\n\t\tconsole.log(\"notification: \", messages[0].apns)\n\t\tconsole.log(\"notification content state apn: \", messages[0].apns?.payload?.aps['content-state'])\n\t\treturn await this.sendToAllTokens(project, type, payload, messages);\n\t}\n\n\tprivate buildMultiCastMessages(\n\t\ttype: MultiMessageType,\n\t\ttokens: string[],\n\t\tpayload: FCMNotificationPayload\n\t): messaging.MulticastMessage[] {\n\t\tconst tokenChunks = this.chunkArray(tokens, LyxaFcmSender.MAX_BATCH);\n\t\treturn tokenChunks.map(chunk => this.builder.buildMessage(type, payload, chunk));\n\t}\n\n\tprivate chunkArray<T>(arr: T[], size: number): T[][] {\n\t\tconst chunks: T[][] = [];\n\t\tfor (let i = 0; i < arr.length; i += size) {\n\t\t\tchunks.push(arr.slice(i, i + size));\n\t\t}\n\t\treturn chunks;\n\t}\n\n\tprivate async sendToAllTokens(\n\t\tproject: FcmProject,\n\t\ttype: MultiMessageType,\n\t\tpayload: FCMNotificationPayload,\n\t\tmessages: messaging.MulticastMessage[]\n\t): Promise<FcmSendResult> {\n\t\tconst logger = getLibraries().getLoggerKit();\n\t\tconst failedTokens: string[] = [];\n\t\tconst tokensToDelete: string[] = [];\n\n\t\tawait Promise.all(\n\t\t\tmessages.map(async message => {\n\t\t\t\tlet logData: Record<string, unknown>;\n\n\t\t\t\ttry {\n\t\t\t\t\tconsole.log(\"fcm service send message: \",{ project, message })\n\t\t\t\t\tconsole.log(\"sendToAllTokens payload: \", messages[0].apns?.payload)\n\t\t\t\t\tconsole.log(\"sendToAllTokens headers: \", messages[0].apns?.headers)\n\t\t\t\t\tconsole.log(\"sendToAllTokens liveActivityToken: \", messages[0].apns?.liveActivityToken)\n\t\t\t\t\tconsole.log(\"sendToAllTokens fcmOptions: \", messages[0].apns?.fcmOptions)\n\t\t\t\t\tconst result = await this.fcmService.sendMessage(project, message);\n\n\t\t\t\t\t// A sibling token succeeding with the identical payload proves the\n\t\t\t\t\t// payload is valid, which is required before treating an\n\t\t\t\t\t// INVALID_ARGUMENT error as a bad token (see shouldRemoveToken).\n\t\t\t\t\tconst payloadKnownValid = result.successCount > 0;\n\n\t\t\t\t\tresult.responses.forEach((r, i) => {\n\t\t\t\t\t\tif (r.success) return;\n\t\t\t\t\t\tfailedTokens.push(message.tokens[i]);\n\t\t\t\t\t\tif (this.shouldRemoveToken(r.error?.code, payloadKnownValid)) {\n\t\t\t\t\t\t\ttokensToDelete.push(message.tokens[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tlogData = {\n\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tconsoleNotification: type === MultiMessageType.CONSOLE,\n\t\t\t\t\t\tgroupTokens: message.tokens,\n\t\t\t\t\t\tgroupPayload: payload,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tresponse: {\n\t\t\t\t\t\t\tsuccessCount: result.successCount,\n\t\t\t\t\t\t\tfailureCount: result.failureCount,\n\t\t\t\t\t\t\tresponses: result.responses.map((r, i) => ({\n\t\t\t\t\t\t\t\ttoken: message.tokens[i],\n\t\t\t\t\t\t\t\tsuccess: r.success,\n\t\t\t\t\t\t\t\t...(r.error && {\n\t\t\t\t\t\t\t\t\terrorCode: r.error.code,\n\t\t\t\t\t\t\t\t\terrorMessage: r.error.message,\n\t\t\t\t\t\t\t\t\twillDelete: this.shouldRemoveToken(r.error.code, payloadKnownValid),\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t})),\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tlogger.info('Called Firebase function sendEachForMulticast', {\n\t\t\t\t\t\ttag: 'notification.attempted.new',\n\t\t\t\t\t\tdata: logData,\n\t\t\t\t\t});\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// The whole batch send threw (transport/auth/infra failure), not a\n\t\t\t\t\t// per-token rejection. They count as failed, but are not proven\n\t\t\t\t\t// invalid, so they must not be deleted.\n\t\t\t\t\tfailedTokens.push(...message.tokens);\n\n\t\t\t\t\tlogData = {\n\t\t\t\t\t\ttimestamp: new Date().toISOString(),\n\t\t\t\t\t\tproject,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tconsoleNotification: type === MultiMessageType.CONSOLE,\n\t\t\t\t\t\tgroupTokens: message.tokens,\n\t\t\t\t\t\tgroupPayload: payload,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t};\n\t\t\t\t\tlogger.error('Called Firebase function sendEachForMulticast', err, {\n\t\t\t\t\t\ttag: 'notification.attempted.new',\n\t\t\t\t\t\tdata: logData,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\n\t\treturn { failedTokens, tokensToDelete };\n\t}\n\n\t/**\n\t * Decides whether a per-token FCM failure means the token should be removed.\n\t *\n\t * Only the codes in {@link LyxaFcmSender.REMOVABLE_TOKEN_ERROR_CODES} are\n\t * unconditionally removable. `messaging/invalid-argument` (INVALID_ARGUMENT)\n\t * is special: Firebase notes it \"can also be returned in cases of issues in\n\t * the message payload, so it signals an invalid token only if the payload is\n\t * completely valid.\" We therefore only remove on it when we know the payload\n\t * was valid (a sibling token in the same batch succeeded).\n\t *\n\t * @see https://firebase.google.com/docs/cloud-messaging/manage-tokens\n\t */\n\tprivate shouldRemoveToken(errorCode: string | undefined, payloadKnownValid: boolean): boolean {\n\t\tif (!errorCode) return false;\n\t\tif (LyxaFcmSender.REMOVABLE_TOKEN_ERROR_CODES.has(errorCode)) return true;\n\t\tif (errorCode === 'messaging/invalid-argument') return payloadKnownValid;\n\t\treturn false;\n\t}\n}\n"]}
@@ -20,13 +20,13 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
20
20
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
21
21
  type: z.ZodNativeEnum<typeof UserRef>;
22
22
  }, "strip", z.ZodTypeAny, {
23
- name: string;
24
- id: import("mongoose").Types.ObjectId;
25
23
  type: UserRef;
26
- }, {
27
- name: string;
28
24
  id: import("mongoose").Types.ObjectId;
25
+ name: string;
26
+ }, {
29
27
  type: UserRef;
28
+ id: import("mongoose").Types.ObjectId;
29
+ name: string;
30
30
  }>;
31
31
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
32
32
  media: z.ZodArray<z.ZodObject<{
@@ -36,14 +36,14 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
36
36
  thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
37
37
  name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- mediaType: MediaType;
40
39
  mediaUrl: string;
40
+ mediaType: MediaType;
41
41
  mimeType: string;
42
42
  name?: string | undefined;
43
43
  thumbnailUrl?: string | undefined;
44
44
  }, {
45
- mediaType: MediaType;
46
45
  mediaUrl: string;
46
+ mediaType: MediaType;
47
47
  mimeType: string;
48
48
  name?: string | undefined;
49
49
  thumbnailUrl?: string | undefined;
@@ -63,17 +63,17 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
63
63
  orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
64
64
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
65
65
  }, "strip", z.ZodTypeAny, {
66
- createdAt: Date;
67
66
  _id: import("mongoose").Types.ObjectId;
67
+ createdAt: Date;
68
68
  sender: {
69
- name: string;
70
- id: import("mongoose").Types.ObjectId;
71
69
  type: UserRef;
70
+ id: import("mongoose").Types.ObjectId;
71
+ name: string;
72
72
  };
73
73
  senderType: UserRef;
74
74
  media: {
75
- mediaType: MediaType;
76
75
  mediaUrl: string;
76
+ mediaType: MediaType;
77
77
  mimeType: string;
78
78
  name?: string | undefined;
79
79
  thumbnailUrl?: string | undefined;
@@ -85,21 +85,21 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
85
85
  latitude?: number | undefined;
86
86
  longitude?: number | undefined;
87
87
  } | undefined;
88
- ticketId?: import("mongoose").Types.ObjectId | undefined;
89
88
  content?: string | undefined;
89
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
90
90
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
91
91
  }, {
92
- createdAt: Date;
93
92
  _id: import("mongoose").Types.ObjectId;
93
+ createdAt: Date;
94
94
  sender: {
95
- name: string;
96
- id: import("mongoose").Types.ObjectId;
97
95
  type: UserRef;
96
+ id: import("mongoose").Types.ObjectId;
97
+ name: string;
98
98
  };
99
99
  senderType: UserRef;
100
100
  media: {
101
- mediaType: MediaType;
102
101
  mediaUrl: string;
102
+ mediaType: MediaType;
103
103
  mimeType: string;
104
104
  name?: string | undefined;
105
105
  thumbnailUrl?: string | undefined;
@@ -111,8 +111,8 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
111
111
  latitude?: number | undefined;
112
112
  longitude?: number | undefined;
113
113
  } | undefined;
114
- ticketId?: import("mongoose").Types.ObjectId | undefined;
115
114
  content?: string | undefined;
115
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
116
116
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
117
117
  }>;
118
118
  export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
@@ -156,13 +156,13 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
156
156
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
157
157
  type: z.ZodNativeEnum<typeof UserRef>;
158
158
  }, "strip", z.ZodTypeAny, {
159
- name: string;
160
- id: import("mongoose").Types.ObjectId;
161
159
  type: UserRef;
162
- }, {
163
- name: string;
164
160
  id: import("mongoose").Types.ObjectId;
161
+ name: string;
162
+ }, {
165
163
  type: UserRef;
164
+ id: import("mongoose").Types.ObjectId;
165
+ name: string;
166
166
  }>;
167
167
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
168
168
  media: z.ZodArray<z.ZodObject<{
@@ -172,14 +172,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
172
172
  thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
173
173
  name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
174
174
  }, "strip", z.ZodTypeAny, {
175
- mediaType: MediaType;
176
175
  mediaUrl: string;
176
+ mediaType: MediaType;
177
177
  mimeType: string;
178
178
  name?: string | undefined;
179
179
  thumbnailUrl?: string | undefined;
180
180
  }, {
181
- mediaType: MediaType;
182
181
  mediaUrl: string;
182
+ mediaType: MediaType;
183
183
  mimeType: string;
184
184
  name?: string | undefined;
185
185
  thumbnailUrl?: string | undefined;
@@ -199,17 +199,17 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
199
199
  orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
200
200
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
201
201
  }, "strip", z.ZodTypeAny, {
202
- createdAt: Date;
203
202
  _id: import("mongoose").Types.ObjectId;
203
+ createdAt: Date;
204
204
  sender: {
205
- name: string;
206
- id: import("mongoose").Types.ObjectId;
207
205
  type: UserRef;
206
+ id: import("mongoose").Types.ObjectId;
207
+ name: string;
208
208
  };
209
209
  senderType: UserRef;
210
210
  media: {
211
- mediaType: MediaType;
212
211
  mediaUrl: string;
212
+ mediaType: MediaType;
213
213
  mimeType: string;
214
214
  name?: string | undefined;
215
215
  thumbnailUrl?: string | undefined;
@@ -221,21 +221,21 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
221
221
  latitude?: number | undefined;
222
222
  longitude?: number | undefined;
223
223
  } | undefined;
224
- ticketId?: import("mongoose").Types.ObjectId | undefined;
225
224
  content?: string | undefined;
225
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
226
226
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
227
227
  }, {
228
- createdAt: Date;
229
228
  _id: import("mongoose").Types.ObjectId;
229
+ createdAt: Date;
230
230
  sender: {
231
- name: string;
232
- id: import("mongoose").Types.ObjectId;
233
231
  type: UserRef;
232
+ id: import("mongoose").Types.ObjectId;
233
+ name: string;
234
234
  };
235
235
  senderType: UserRef;
236
236
  media: {
237
- mediaType: MediaType;
238
237
  mediaUrl: string;
238
+ mediaType: MediaType;
239
239
  mimeType: string;
240
240
  name?: string | undefined;
241
241
  thumbnailUrl?: string | undefined;
@@ -247,8 +247,8 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
247
247
  latitude?: number | undefined;
248
248
  longitude?: number | undefined;
249
249
  } | undefined;
250
- ticketId?: import("mongoose").Types.ObjectId | undefined;
251
250
  content?: string | undefined;
251
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
252
252
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
253
253
  }>;
254
254
  pushNotificationOutput: z.ZodObject<{
@@ -16,11 +16,11 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
16
16
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
17
17
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
18
18
  }, "strip", z.ZodTypeAny, {
19
- name: string;
20
19
  _id: import("mongoose").Types.ObjectId;
21
- }, {
22
20
  name: string;
21
+ }, {
23
22
  _id: string | import("mongoose").Types.ObjectId;
23
+ name: string;
24
24
  }>;
25
25
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
26
26
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -40,19 +40,19 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
40
40
  secondaryRiderTips: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  deliveryFee: number;
43
- secondaryDeliveryFee: number;
44
43
  riderTips: number;
45
- secondaryRiderTips: number;
46
44
  total: number;
45
+ secondaryDeliveryFee: number;
46
+ secondaryRiderTips: number;
47
47
  secondaryTotal: number;
48
48
  paidAmount: number;
49
49
  secondaryPaidAmount: number;
50
50
  }, {
51
51
  deliveryFee: number;
52
- secondaryDeliveryFee: number;
53
52
  riderTips: number;
54
- secondaryRiderTips: number;
55
53
  total: number;
54
+ secondaryDeliveryFee: number;
55
+ secondaryRiderTips: number;
56
56
  secondaryTotal: number;
57
57
  paidAmount: number;
58
58
  secondaryPaidAmount: number;
@@ -61,10 +61,10 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
61
61
  paymentMethod: PaymentMethod;
62
62
  pricing: {
63
63
  deliveryFee: number;
64
- secondaryDeliveryFee: number;
65
64
  riderTips: number;
66
- secondaryRiderTips: number;
67
65
  total: number;
66
+ secondaryDeliveryFee: number;
67
+ secondaryRiderTips: number;
68
68
  secondaryTotal: number;
69
69
  paidAmount: number;
70
70
  secondaryPaidAmount: number;
@@ -74,10 +74,10 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
74
74
  paymentMethod: PaymentMethod;
75
75
  pricing: {
76
76
  deliveryFee: number;
77
- secondaryDeliveryFee: number;
78
77
  riderTips: number;
79
- secondaryRiderTips: number;
80
78
  total: number;
79
+ secondaryDeliveryFee: number;
80
+ secondaryRiderTips: number;
81
81
  secondaryTotal: number;
82
82
  paidAmount: number;
83
83
  secondaryPaidAmount: number;
@@ -88,59 +88,59 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
88
88
  triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
89
89
  orderActionType: z.ZodNativeEnum<typeof OrderAction>;
90
90
  }, "strip", z.ZodTypeAny, {
91
- createdAt: Date;
92
- _id: import("mongoose").Types.ObjectId;
93
91
  user: {
94
- name: string;
95
92
  _id: import("mongoose").Types.ObjectId;
93
+ name: string;
96
94
  };
95
+ _id: import("mongoose").Types.ObjectId;
97
96
  orderId: string;
98
97
  triggerAt: Date;
98
+ createdAt: Date;
99
99
  shopId: import("mongoose").Types.ObjectId;
100
+ paymentMethod: PaymentMethod;
100
101
  adjustedFinance: {
101
102
  paymentMethod: PaymentMethod;
102
103
  pricing: {
103
104
  deliveryFee: number;
104
- secondaryDeliveryFee: number;
105
105
  riderTips: number;
106
- secondaryRiderTips: number;
107
106
  total: number;
107
+ secondaryDeliveryFee: number;
108
+ secondaryRiderTips: number;
108
109
  secondaryTotal: number;
109
110
  paidAmount: number;
110
111
  secondaryPaidAmount: number;
111
112
  };
112
113
  shopProfit: number;
113
114
  };
114
- paymentMethod: PaymentMethod;
115
115
  orderActionType: OrderAction;
116
116
  orderStatus: RegularOrderStatus;
117
117
  orderAction: OrderAction;
118
118
  preparationTimeMinutes: number;
119
119
  }, {
120
- createdAt: Date;
121
- _id: string | import("mongoose").Types.ObjectId;
122
120
  user: {
123
- name: string;
124
121
  _id: string | import("mongoose").Types.ObjectId;
122
+ name: string;
125
123
  };
124
+ _id: string | import("mongoose").Types.ObjectId;
126
125
  orderId: string;
127
126
  triggerAt: Date;
127
+ createdAt: Date;
128
128
  shopId: string | import("mongoose").Types.ObjectId;
129
+ paymentMethod: PaymentMethod;
129
130
  adjustedFinance: {
130
131
  paymentMethod: PaymentMethod;
131
132
  pricing: {
132
133
  deliveryFee: number;
133
- secondaryDeliveryFee: number;
134
134
  riderTips: number;
135
- secondaryRiderTips: number;
136
135
  total: number;
136
+ secondaryDeliveryFee: number;
137
+ secondaryRiderTips: number;
137
138
  secondaryTotal: number;
138
139
  paidAmount: number;
139
140
  secondaryPaidAmount: number;
140
141
  };
141
142
  shopProfit: number;
142
143
  };
143
- paymentMethod: PaymentMethod;
144
144
  orderActionType: OrderAction;
145
145
  orderStatus: RegularOrderStatus;
146
146
  orderAction: OrderAction;
@@ -160,11 +160,11 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
160
160
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
161
161
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
162
162
  }, "strip", z.ZodTypeAny, {
163
- name: string;
164
163
  _id: import("mongoose").Types.ObjectId;
165
- }, {
166
164
  name: string;
165
+ }, {
167
166
  _id: string | import("mongoose").Types.ObjectId;
167
+ name: string;
168
168
  }>;
169
169
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
170
170
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -184,19 +184,19 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
184
184
  secondaryRiderTips: z.ZodNumber;
185
185
  }, "strip", z.ZodTypeAny, {
186
186
  deliveryFee: number;
187
- secondaryDeliveryFee: number;
188
187
  riderTips: number;
189
- secondaryRiderTips: number;
190
188
  total: number;
189
+ secondaryDeliveryFee: number;
190
+ secondaryRiderTips: number;
191
191
  secondaryTotal: number;
192
192
  paidAmount: number;
193
193
  secondaryPaidAmount: number;
194
194
  }, {
195
195
  deliveryFee: number;
196
- secondaryDeliveryFee: number;
197
196
  riderTips: number;
198
- secondaryRiderTips: number;
199
197
  total: number;
198
+ secondaryDeliveryFee: number;
199
+ secondaryRiderTips: number;
200
200
  secondaryTotal: number;
201
201
  paidAmount: number;
202
202
  secondaryPaidAmount: number;
@@ -205,10 +205,10 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
205
205
  paymentMethod: PaymentMethod;
206
206
  pricing: {
207
207
  deliveryFee: number;
208
- secondaryDeliveryFee: number;
209
208
  riderTips: number;
210
- secondaryRiderTips: number;
211
209
  total: number;
210
+ secondaryDeliveryFee: number;
211
+ secondaryRiderTips: number;
212
212
  secondaryTotal: number;
213
213
  paidAmount: number;
214
214
  secondaryPaidAmount: number;
@@ -218,10 +218,10 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
218
218
  paymentMethod: PaymentMethod;
219
219
  pricing: {
220
220
  deliveryFee: number;
221
- secondaryDeliveryFee: number;
222
221
  riderTips: number;
223
- secondaryRiderTips: number;
224
222
  total: number;
223
+ secondaryDeliveryFee: number;
224
+ secondaryRiderTips: number;
225
225
  secondaryTotal: number;
226
226
  paidAmount: number;
227
227
  secondaryPaidAmount: number;
@@ -232,59 +232,59 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
232
232
  triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
233
233
  orderActionType: z.ZodNativeEnum<typeof OrderAction>;
234
234
  }, "strip", z.ZodTypeAny, {
235
- createdAt: Date;
236
- _id: import("mongoose").Types.ObjectId;
237
235
  user: {
238
- name: string;
239
236
  _id: import("mongoose").Types.ObjectId;
237
+ name: string;
240
238
  };
239
+ _id: import("mongoose").Types.ObjectId;
241
240
  orderId: string;
242
241
  triggerAt: Date;
242
+ createdAt: Date;
243
243
  shopId: import("mongoose").Types.ObjectId;
244
+ paymentMethod: PaymentMethod;
244
245
  adjustedFinance: {
245
246
  paymentMethod: PaymentMethod;
246
247
  pricing: {
247
248
  deliveryFee: number;
248
- secondaryDeliveryFee: number;
249
249
  riderTips: number;
250
- secondaryRiderTips: number;
251
250
  total: number;
251
+ secondaryDeliveryFee: number;
252
+ secondaryRiderTips: number;
252
253
  secondaryTotal: number;
253
254
  paidAmount: number;
254
255
  secondaryPaidAmount: number;
255
256
  };
256
257
  shopProfit: number;
257
258
  };
258
- paymentMethod: PaymentMethod;
259
259
  orderActionType: OrderAction;
260
260
  orderStatus: RegularOrderStatus;
261
261
  orderAction: OrderAction;
262
262
  preparationTimeMinutes: number;
263
263
  }, {
264
- createdAt: Date;
265
- _id: string | import("mongoose").Types.ObjectId;
266
264
  user: {
267
- name: string;
268
265
  _id: string | import("mongoose").Types.ObjectId;
266
+ name: string;
269
267
  };
268
+ _id: string | import("mongoose").Types.ObjectId;
270
269
  orderId: string;
271
270
  triggerAt: Date;
271
+ createdAt: Date;
272
272
  shopId: string | import("mongoose").Types.ObjectId;
273
+ paymentMethod: PaymentMethod;
273
274
  adjustedFinance: {
274
275
  paymentMethod: PaymentMethod;
275
276
  pricing: {
276
277
  deliveryFee: number;
277
- secondaryDeliveryFee: number;
278
278
  riderTips: number;
279
- secondaryRiderTips: number;
280
279
  total: number;
280
+ secondaryDeliveryFee: number;
281
+ secondaryRiderTips: number;
281
282
  secondaryTotal: number;
282
283
  paidAmount: number;
283
284
  secondaryPaidAmount: number;
284
285
  };
285
286
  shopProfit: number;
286
287
  };
287
- paymentMethod: PaymentMethod;
288
288
  orderActionType: OrderAction;
289
289
  orderStatus: RegularOrderStatus;
290
290
  orderAction: OrderAction;
@@ -19,15 +19,15 @@ export declare const RiderLocationUpdateSocketOutputSchema: z.ZodObject<{
19
19
  bearing: z.ZodOptional<z.ZodNumber>;
20
20
  updatedAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- updatedAt: Date;
23
22
  _id: import("mongoose").Types.ObjectId;
23
+ updatedAt: Date;
24
24
  riderId: import("mongoose").Types.ObjectId;
25
25
  latitude: number;
26
26
  longitude: number;
27
27
  bearing?: number | undefined;
28
28
  }, {
29
- updatedAt: string | Date;
30
29
  _id: string | import("mongoose").Types.ObjectId;
30
+ updatedAt: string | Date;
31
31
  riderId: string | import("mongoose").Types.ObjectId;
32
32
  latitude: number;
33
33
  longitude: number;
@@ -55,15 +55,15 @@ export declare class RiderLocationUpdateSocketEvent extends BaseSocketEvent<type
55
55
  bearing: z.ZodOptional<z.ZodNumber>;
56
56
  updatedAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
57
57
  }, "strip", z.ZodTypeAny, {
58
- updatedAt: Date;
59
58
  _id: import("mongoose").Types.ObjectId;
59
+ updatedAt: Date;
60
60
  riderId: import("mongoose").Types.ObjectId;
61
61
  latitude: number;
62
62
  longitude: number;
63
63
  bearing?: number | undefined;
64
64
  }, {
65
- updatedAt: string | Date;
66
65
  _id: string | import("mongoose").Types.ObjectId;
66
+ updatedAt: string | Date;
67
67
  riderId: string | import("mongoose").Types.ObjectId;
68
68
  latitude: number;
69
69
  longitude: number;
@@ -12,16 +12,16 @@ export declare const TicketActionsSocketOutputSchema: z.ZodObject<{
12
12
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
13
13
  silent: z.ZodOptional<z.ZodBoolean>;
14
14
  }, "strip", z.ZodTypeAny, {
15
+ type: TicketType;
15
16
  status: TicketStatus;
16
17
  _id: import("mongoose").Types.ObjectId;
17
- type: TicketType;
18
18
  title?: string | undefined;
19
19
  content?: string | undefined;
20
20
  silent?: boolean | undefined;
21
21
  }, {
22
+ type: TicketType;
22
23
  status: TicketStatus;
23
24
  _id: import("mongoose").Types.ObjectId;
24
- type: TicketType;
25
25
  title?: string | undefined;
26
26
  content?: string | undefined;
27
27
  silent?: boolean | undefined;
@@ -33,14 +33,14 @@ export declare const TicketActionsPushOutputSchema: z.ZodObject<{
33
33
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
34
34
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
35
35
  }, "strip", z.ZodTypeAny, {
36
- status: TicketStatus;
37
36
  type: TicketType;
37
+ status: TicketStatus;
38
38
  ticketId: import("mongoose").Types.ObjectId;
39
39
  title?: string | undefined;
40
40
  content?: string | undefined;
41
41
  }, {
42
- status: TicketStatus;
43
42
  type: TicketType;
43
+ status: TicketStatus;
44
44
  ticketId: import("mongoose").Types.ObjectId;
45
45
  title?: string | undefined;
46
46
  content?: string | undefined;
@@ -59,16 +59,16 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
59
59
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
60
60
  silent: z.ZodOptional<z.ZodBoolean>;
61
61
  }, "strip", z.ZodTypeAny, {
62
+ type: TicketType;
62
63
  status: TicketStatus;
63
64
  _id: import("mongoose").Types.ObjectId;
64
- type: TicketType;
65
65
  title?: string | undefined;
66
66
  content?: string | undefined;
67
67
  silent?: boolean | undefined;
68
68
  }, {
69
+ type: TicketType;
69
70
  status: TicketStatus;
70
71
  _id: import("mongoose").Types.ObjectId;
71
- type: TicketType;
72
72
  title?: string | undefined;
73
73
  content?: string | undefined;
74
74
  silent?: boolean | undefined;
@@ -80,14 +80,14 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
80
80
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
81
81
  title: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
82
82
  }, "strip", z.ZodTypeAny, {
83
- status: TicketStatus;
84
83
  type: TicketType;
84
+ status: TicketStatus;
85
85
  ticketId: import("mongoose").Types.ObjectId;
86
86
  title?: string | undefined;
87
87
  content?: string | undefined;
88
88
  }, {
89
- status: TicketStatus;
90
89
  type: TicketType;
90
+ status: TicketStatus;
91
91
  ticketId: import("mongoose").Types.ObjectId;
92
92
  title?: string | undefined;
93
93
  content?: string | undefined;
@@ -96,8 +96,8 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
96
96
  get notificationSettings(): NotificationSettings | undefined;
97
97
  constructor(payload: TicketActionsSocketOutputDTO);
98
98
  getPushNotificationPayload(): {
99
- status: TicketStatus;
100
99
  type: TicketType;
100
+ status: TicketStatus;
101
101
  ticketId: import("mongoose").Types.ObjectId;
102
102
  title?: string | undefined;
103
103
  content?: string | undefined;
@@ -13,14 +13,14 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
13
13
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
14
14
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- name: string;
17
- _id: import("mongoose").Types.ObjectId;
18
16
  type: UserRef;
17
+ _id: import("mongoose").Types.ObjectId;
18
+ name: string;
19
19
  profilePhoto: string | null;
20
20
  }, {
21
- name: string;
22
- _id: string | import("mongoose").Types.ObjectId;
23
21
  type: UserRef;
22
+ _id: string | import("mongoose").Types.ObjectId;
23
+ name: string;
24
24
  profilePhoto: string | null;
25
25
  }>;
26
26
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
@@ -39,41 +39,41 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
39
39
  }>;
40
40
  unreadCount: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
+ type: TicketType;
42
43
  status: TicketStatus;
44
+ _id: import("mongoose").Types.ObjectId;
43
45
  createdAt: Date;
44
46
  updatedAt: Date;
45
- _id: import("mongoose").Types.ObjectId;
46
- type: TicketType;
47
47
  lastMessage: {
48
48
  createdAt: Date;
49
49
  content: string;
50
50
  };
51
+ unreadCount: number;
51
52
  client: {
52
- name: string;
53
- _id: import("mongoose").Types.ObjectId;
54
53
  type: UserRef;
54
+ _id: import("mongoose").Types.ObjectId;
55
+ name: string;
55
56
  profilePhoto: string | null;
56
57
  };
57
- unreadCount: number;
58
58
  chatroomId: import("mongoose").Types.ObjectId;
59
59
  orderId?: import("mongoose").Types.ObjectId | undefined;
60
60
  }, {
61
+ type: TicketType;
61
62
  status: TicketStatus;
63
+ _id: string | import("mongoose").Types.ObjectId;
62
64
  createdAt: string | Date;
63
65
  updatedAt: string | Date;
64
- _id: string | import("mongoose").Types.ObjectId;
65
- type: TicketType;
66
66
  lastMessage: {
67
67
  createdAt: string | Date;
68
68
  content: string;
69
69
  };
70
+ unreadCount: number;
70
71
  client: {
71
- name: string;
72
- _id: string | import("mongoose").Types.ObjectId;
73
72
  type: UserRef;
73
+ _id: string | import("mongoose").Types.ObjectId;
74
+ name: string;
74
75
  profilePhoto: string | null;
75
76
  };
76
- unreadCount: number;
77
77
  chatroomId: string | import("mongoose").Types.ObjectId;
78
78
  orderId?: string | import("mongoose").Types.ObjectId | undefined;
79
79
  }>;
@@ -91,14 +91,14 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
91
91
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
92
92
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
93
93
  }, "strip", z.ZodTypeAny, {
94
- name: string;
95
- _id: import("mongoose").Types.ObjectId;
96
94
  type: UserRef;
95
+ _id: import("mongoose").Types.ObjectId;
96
+ name: string;
97
97
  profilePhoto: string | null;
98
98
  }, {
99
- name: string;
100
- _id: string | import("mongoose").Types.ObjectId;
101
99
  type: UserRef;
100
+ _id: string | import("mongoose").Types.ObjectId;
101
+ name: string;
102
102
  profilePhoto: string | null;
103
103
  }>;
104
104
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
@@ -117,41 +117,41 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
117
117
  }>;
118
118
  unreadCount: z.ZodNumber;
119
119
  }, "strip", z.ZodTypeAny, {
120
+ type: TicketType;
120
121
  status: TicketStatus;
122
+ _id: import("mongoose").Types.ObjectId;
121
123
  createdAt: Date;
122
124
  updatedAt: Date;
123
- _id: import("mongoose").Types.ObjectId;
124
- type: TicketType;
125
125
  lastMessage: {
126
126
  createdAt: Date;
127
127
  content: string;
128
128
  };
129
+ unreadCount: number;
129
130
  client: {
130
- name: string;
131
- _id: import("mongoose").Types.ObjectId;
132
131
  type: UserRef;
132
+ _id: import("mongoose").Types.ObjectId;
133
+ name: string;
133
134
  profilePhoto: string | null;
134
135
  };
135
- unreadCount: number;
136
136
  chatroomId: import("mongoose").Types.ObjectId;
137
137
  orderId?: import("mongoose").Types.ObjectId | undefined;
138
138
  }, {
139
+ type: TicketType;
139
140
  status: TicketStatus;
141
+ _id: string | import("mongoose").Types.ObjectId;
140
142
  createdAt: string | Date;
141
143
  updatedAt: string | Date;
142
- _id: string | import("mongoose").Types.ObjectId;
143
- type: TicketType;
144
144
  lastMessage: {
145
145
  createdAt: string | Date;
146
146
  content: string;
147
147
  };
148
+ unreadCount: number;
148
149
  client: {
149
- name: string;
150
- _id: string | import("mongoose").Types.ObjectId;
151
150
  type: UserRef;
151
+ _id: string | import("mongoose").Types.ObjectId;
152
+ name: string;
152
153
  profilePhoto: string | null;
153
154
  };
154
- unreadCount: number;
155
155
  chatroomId: string | import("mongoose").Types.ObjectId;
156
156
  orderId?: string | import("mongoose").Types.ObjectId | undefined;
157
157
  }>;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.334-alpha-11
25
+ Version: 1.4.334-alpha-13
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.334-alpha-11",
3
+ "version": "1.4.334-alpha-13",
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.4.334-alpha-11",
3
+ "version": "1.4.334-alpha-13",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",