@runnerpro/backend 1.8.4 → 1.8.5
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.
|
@@ -29,7 +29,6 @@ const path_1 = __importDefault(require("path"));
|
|
|
29
29
|
const util_1 = require("util");
|
|
30
30
|
const jimp_1 = __importDefault(require("jimp"));
|
|
31
31
|
const exifr_1 = __importDefault(require("exifr"));
|
|
32
|
-
const axios_1 = __importDefault(require("axios"));
|
|
33
32
|
const index_1 = require("../../index");
|
|
34
33
|
const common_1 = require("@runnerpro/common");
|
|
35
34
|
const index_2 = require("../../locale/index");
|
|
@@ -44,7 +43,6 @@ const conversationRoute = (_a) => {
|
|
|
44
43
|
},
|
|
45
44
|
});
|
|
46
45
|
router.get('/conversation', (req, res, next) => getConversation(req, res, params).catch((error) => (0, index_1.err)(req, res, error, next)));
|
|
47
|
-
router.get('/conversation/suggestion', (req, res, next) => getConversationSuggestion(req, res).catch((error) => (0, index_1.err)(req, res, error, next)));
|
|
48
46
|
router.get('/conversation/image/:id', (req, res, next) => getConversationImage(req, res, params).catch((error) => (0, index_1.err)(req, res, error, next)));
|
|
49
47
|
router.get('/conversation/file/:id', (req, res, next) => getConversationFile(req, res, params).catch((error) => (0, index_1.err)(req, res, error, next)));
|
|
50
48
|
router.post('/conversation/send', (req, res, next) => sendMessage(req, res, params).catch((error) => (0, index_1.err)(req, res, error, next)));
|
|
@@ -139,27 +137,6 @@ const getChatFile = ({ query, bucket, id, isClient, userid }) => __awaiter(void
|
|
|
139
137
|
return null;
|
|
140
138
|
}
|
|
141
139
|
});
|
|
142
|
-
const getConversationSuggestion = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
143
|
-
let result;
|
|
144
|
-
try {
|
|
145
|
-
result = yield axios_1.default
|
|
146
|
-
.post(`${process.env.BACKEND_IA_URL}/api/chat/suggestion`, { userId: req.query.user }, {
|
|
147
|
-
headers: {
|
|
148
|
-
'ngrok-skip-browser-warning': true, // working with ngrok
|
|
149
|
-
'Content-Type': 'application/json',
|
|
150
|
-
Authorization: `Bearer ${process.env.IA_ACCESS_TOKEN}`,
|
|
151
|
-
},
|
|
152
|
-
})
|
|
153
|
-
.then((response) => response.data);
|
|
154
|
-
}
|
|
155
|
-
catch (e) {
|
|
156
|
-
(0, index_1.err)(null, null, e, null);
|
|
157
|
-
result = { error: 'Ha habido un error con el servidor' };
|
|
158
|
-
}
|
|
159
|
-
finally {
|
|
160
|
-
res.send(result);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
140
|
const sendMessage = (req, res, { sendNotification, firebaseMessaging, query, isClient }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
164
141
|
const { text, replyMessageId } = req.body;
|
|
165
142
|
const { userid } = req.session;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"
|
|
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"}
|