@runnerpro/backend 1.8.5 → 1.8.6

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.
@@ -33,6 +33,7 @@ const index_1 = require("../../index");
33
33
  const common_1 = require("@runnerpro/common");
34
34
  const index_2 = require("../../locale/index");
35
35
  const multer_1 = __importDefault(require("multer"));
36
+ const axios_1 = __importDefault(require("axios"));
36
37
  const conversationRoute = (_a) => {
37
38
  var { router } = _a, params = __rest(_a, ["router"]);
38
39
  const uploadFile = (0, multer_1.default)({
@@ -159,6 +160,14 @@ const sendMessage = (req, res, { sendNotification, firebaseMessaging, query, isC
159
160
  body: `Rubén: ${textPreferredLanguage || textSpanish}`,
160
161
  screen: common_1.NOTIFICATION_SCREEN_TYPES.CHAT,
161
162
  });
163
+ // Enviar a N8N lo que ha escrito el entrenador
164
+ const [lastSuggestionMsg] = yield query('SELECT [ID] FROM [CHAT MESSAGE] WHERE [ID CLIENTE] = ? AND [SUGGESTION TEXT] IS NOT NULL ORDER BY [ID] DESC LIMIT 1', [idCliente]);
165
+ if (lastSuggestionMsg) {
166
+ yield axios_1.default.put(`${process.env.N8N_URL}/edc2484f-7010-44c1-8c1d-82924496a2eb`, {
167
+ id: lastSuggestionMsg.id,
168
+ msg: textSpanish,
169
+ });
170
+ }
162
171
  }
163
172
  res.send({ status: 'ok' });
164
173
  });
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAiBpD,CAAC;AAiQF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SAiBpD,CAAC;AA4QF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"