@runnerpro/backend 1.12.26 → 1.13.0
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.
|
@@ -214,13 +214,17 @@ const getChatFile = ({ bucket, id, isClient, userid }) => __awaiter(void 0, void
|
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
const sendMessage = (req, res, { sendNotification, firebaseMessaging, isClient }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
217
|
-
const {
|
|
217
|
+
const { replyMessageId, new: newMessage } = req.body;
|
|
218
|
+
let { text } = req.body;
|
|
218
219
|
const { userid } = req.session;
|
|
219
220
|
const idCliente = isClient ? req.session.userid : req.body.idCliente;
|
|
220
221
|
let idWorkout, type = 1;
|
|
221
|
-
|
|
222
|
-
|
|
222
|
+
if (!isClient) {
|
|
223
|
+
// Si es entrenador, se marca leído cuando se envía un mensaje
|
|
223
224
|
yield markReadMessage({ isClient, idCliente });
|
|
225
|
+
// Cambiar el tono del texto a uno neutro y corregir la ortografía
|
|
226
|
+
text = cambiarTonoEntrenadorNeutro(text);
|
|
227
|
+
}
|
|
224
228
|
// Devuelve el texto en el otro idioma si el cliente no habla español y el idioma del cliente
|
|
225
229
|
const { textSpanish, textPreferredLanguage, preferredLanguage } = yield getPreferredLanguageForChat({
|
|
226
230
|
text,
|
|
@@ -395,6 +399,9 @@ const markReadMessage = ({ isClient, idCliente }) => __awaiter(void 0, void 0, v
|
|
|
395
399
|
if (!isClient)
|
|
396
400
|
yield (0, saveResponseTime_1.saveResponseTime)(idCliente);
|
|
397
401
|
});
|
|
402
|
+
const cambiarTonoEntrenadorNeutro = (text) => {
|
|
403
|
+
return text;
|
|
404
|
+
};
|
|
398
405
|
const resizeImage = (data, filePath, mimetype) => __awaiter(void 0, void 0, void 0, function* () {
|
|
399
406
|
if (mimetype.includes('webp'))
|
|
400
407
|
return data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAuBpD,CAAC;AAgaF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runnerpro/backend",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "A collection of common backend functions",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./lib/cjs/index.js"
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@google-cloud/storage": "^7.11.3",
|
|
66
66
|
"@google-cloud/translate": "^8.3.0",
|
|
67
|
+
"@google-cloud/vertexai": "^1.10.0",
|
|
67
68
|
"@notionhq/client": "^2.2.15",
|
|
68
69
|
"exifr": "^7.1.3",
|
|
69
70
|
"ffmpeg-static": "^5.2.0",
|