@runnerpro/backend 1.14.15 → 1.14.17

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.
@@ -245,7 +245,7 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
245
245
  // Cambiar el tono del texto a uno neutro y corregir la ortografía
246
246
  cambiarTonoEntrenadorNeutro(text),
247
247
  // Si es entrenador, se marca leído cuando se envía un mensaje
248
- getPreferredLanguageForChat({ text, idCliente, isClient }),
248
+ markReadMessage({ idCliente, isClient }),
249
249
  ]);
250
250
  }
251
251
  // Devuelve el texto en el otro idioma si el cliente no habla español y el idioma del cliente
@@ -265,6 +265,7 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }
265
265
  sendNotification({
266
266
  firebaseMessaging,
267
267
  idCliente,
268
+ title: '💬 Nuevo mensaje de tu entrenador',
268
269
  body: `Rubén: ${textPreferredLanguage || textSpanish}`,
269
270
  screen: common_1.NOTIFICATION_SCREEN_TYPES.CHAT,
270
271
  });
@@ -368,11 +369,19 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
368
369
  }
369
370
  fs_1.default.unlinkSync(filePath);
370
371
  if (!isClient) {
372
+ let textFile = 'Archivo adjunto';
373
+ if (Number(type) === 4)
374
+ textFile = 'Audio';
375
+ if (req.file.mimetype.includes('video'))
376
+ textFile = 'Vídeo';
377
+ if (req.file.mimetype.includes('image'))
378
+ textFile = 'Imagen';
371
379
  const [cliente] = yield (0, index_1.query)('SELECT [PREFERRED LANGUAGE] FROM [CLIENTE] WHERE [ID] = ?', [idCliente]);
372
380
  sendNotification({
373
381
  firebaseMessaging,
374
382
  idCliente,
375
- body: `Rubén: ${(0, index_2.t)(Number(type) === 4 ? 'Audio' : 'Archivo adjunto', cliente.preferredLanguage)}`,
383
+ title: (0, index_2.t)('💬 Nuevo mensaje de tu entrenador', cliente.preferredLanguage),
384
+ body: `Rubén: ${(0, index_2.t)(textFile, cliente.preferredLanguage)}`,
376
385
  screen: common_1.NOTIFICATION_SCREEN_TYPES.CHAT,
377
386
  });
378
387
  }
@@ -44,7 +44,8 @@ const sendMessageChatToClient = (idCliente, text, textPreferredLanguage, preferr
44
44
  yield (0, index_2.sendNotification)({
45
45
  firebaseMessaging: (0, messaging_1.getMessaging)(),
46
46
  idCliente,
47
- body: (0, common_1.removeAccent)((textPreferredLanguage || text).substring(0, 50)) + ((textPreferredLanguage || text).length > 50 ? '...' : ''),
47
+ title: '💬 Nuevo mensaje de tu entrenador',
48
+ body: `Rubén: ${textPreferredLanguage || text}`,
48
49
  screen: common_1.NOTIFICATION_SCREEN_TYPES.CHAT,
49
50
  });
50
51
  }
@@ -4,5 +4,8 @@ exports.en = void 0;
4
4
  const en = {
5
5
  'Archivo adjunto': 'Attached file',
6
6
  Audio: 'Audio',
7
+ Vídeo: 'Video',
8
+ Imagen: 'Image',
9
+ '💬 Nuevo mensaje de tu entrenador': '💬 New message from your trainer',
7
10
  };
8
11
  exports.en = en;
@@ -4,5 +4,8 @@ exports.es = void 0;
4
4
  const es = {
5
5
  'Archivo adjunto': 'Archivo adjunto',
6
6
  Audio: 'Audio',
7
+ Vídeo: 'Vídeo',
8
+ Imagen: 'Imagen',
9
+ '💬 Nuevo mensaje de tu entrenador': '💬 Nuevo mensaje de tu entrenador',
7
10
  };
8
11
  exports.es = es;
@@ -4,5 +4,8 @@ exports.fr = void 0;
4
4
  const fr = {
5
5
  'Archivo adjunto': 'Pièce jointe',
6
6
  Audio: 'Audio',
7
+ Vídeo: 'Vidéo',
8
+ Imagen: 'Image',
9
+ '💬 Nuevo mensaje de tu entrenador': '💬 Nouveau message de votre entraîneur',
7
10
  };
8
11
  exports.fr = fr;
@@ -4,5 +4,8 @@ exports.it = void 0;
4
4
  const it = {
5
5
  'Archivo adjunto': 'File allegato',
6
6
  Audio: 'Audio',
7
+ Vídeo: 'Video',
8
+ Imagen: 'Immagine',
9
+ '💬 Nuevo mensaje de tu entrenador': '💬 Nuovo messaggio da tuo allenatore',
7
10
  };
8
11
  exports.it = it;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AA+fF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AAqgBF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sendMessageChatToClient.d.ts","sourceRoot":"","sources":["../../../../src/chat/sendMessageChatToClient.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,uBAAuB,gHAyC5B,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"sendMessageChatToClient.d.ts","sourceRoot":"","sources":["../../../../src/chat/sendMessageChatToClient.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,uBAAuB,gHA0C5B,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,6 +1,9 @@
1
1
  declare const en: {
2
2
  'Archivo adjunto': string;
3
3
  Audio: string;
4
+ Vídeo: string;
5
+ Imagen: string;
6
+ '\uD83D\uDCAC Nuevo mensaje de tu entrenador': string;
4
7
  };
5
8
  export { en };
6
9
  //# sourceMappingURL=en.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/locale/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;CAGP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/locale/en.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;;;;CAMP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
@@ -1,6 +1,9 @@
1
1
  declare const es: {
2
2
  'Archivo adjunto': string;
3
3
  Audio: string;
4
+ Vídeo: string;
5
+ Imagen: string;
6
+ '\uD83D\uDCAC Nuevo mensaje de tu entrenador': string;
4
7
  };
5
8
  export { es };
6
9
  //# sourceMappingURL=es.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../src/locale/es.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;CAGP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../src/locale/es.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;;;;CAMP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
@@ -1,6 +1,9 @@
1
1
  declare const fr: {
2
2
  'Archivo adjunto': string;
3
3
  Audio: string;
4
+ Vídeo: string;
5
+ Imagen: string;
6
+ '\uD83D\uDCAC Nuevo mensaje de tu entrenador': string;
4
7
  };
5
8
  export { fr };
6
9
  //# sourceMappingURL=fr.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../src/locale/fr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;CAGP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../src/locale/fr.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;;;;CAMP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
@@ -1,6 +1,9 @@
1
1
  declare const it: {
2
2
  'Archivo adjunto': string;
3
3
  Audio: string;
4
+ Vídeo: string;
5
+ Imagen: string;
6
+ '\uD83D\uDCAC Nuevo mensaje de tu entrenador': string;
4
7
  };
5
8
  export { it };
6
9
  //# sourceMappingURL=it.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../../src/locale/it.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;CAGP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../../src/locale/it.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,EAAE;;;;;;CAMP,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.14.15",
3
+ "version": "1.14.17",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"