@runnerpro/backend 1.12.12 → 1.12.14
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.
|
@@ -167,7 +167,7 @@ const getConversationImage = (req, res, { bucket, isClient }) => __awaiter(void
|
|
|
167
167
|
mimetype: result.message.mimetype,
|
|
168
168
|
});
|
|
169
169
|
});
|
|
170
|
-
const getConversationThumbnail = (req, res, { bucket
|
|
170
|
+
const getConversationThumbnail = (req, res, { bucket }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
171
171
|
const { id: idVideo } = req.params;
|
|
172
172
|
const [file] = yield bucket.file(`Chat/${idVideo}-thumbnail`).exists();
|
|
173
173
|
if (!file)
|
|
@@ -189,6 +189,7 @@ const getConversationFile = (req, res, { bucket, isClient }) => __awaiter(void 0
|
|
|
189
189
|
});
|
|
190
190
|
if (!result)
|
|
191
191
|
return res.status(404).send('Not found');
|
|
192
|
+
console.log(result);
|
|
192
193
|
res.writeHead(200, {
|
|
193
194
|
'Content-Type': result.message.text,
|
|
194
195
|
'Content-disposition': 'inline',
|
|
@@ -203,6 +204,7 @@ const getChatFile = ({ bucket, id, isClient, userid }) => __awaiter(void 0, void
|
|
|
203
204
|
isClient,
|
|
204
205
|
userid,
|
|
205
206
|
]);
|
|
207
|
+
console.log({ message });
|
|
206
208
|
if (!message)
|
|
207
209
|
return null;
|
|
208
210
|
try {
|
|
@@ -273,7 +275,6 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
|
|
|
273
275
|
[duration, thumbnail] = yield Promise.all([getVideoDuration(filePath), getThumbnailFromVideo(filePath)]);
|
|
274
276
|
}
|
|
275
277
|
const [{ id: idFile }] = yield (0, index_1.query)('INSERT INTO [CHAT MESSAGE] ([ID CLIENTE], [ID SENDER], [TEXT], [MIMETYPE], [DURATION], [TYPE]) VALUES (?, ?, ?, ?, ?, ?) RETURNING [ID]', [isClient ? userid : idCliente, userid, req.file.originalname, req.file.mimetype, duration || null, type || 2]);
|
|
276
|
-
res.send({ idFile });
|
|
277
278
|
const fileData = fs_1.default.readFileSync(filePath);
|
|
278
279
|
const files = [];
|
|
279
280
|
if (req.file.mimetype.includes('image')) {
|
|
@@ -297,6 +298,7 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
|
|
|
297
298
|
for (const file of files) {
|
|
298
299
|
yield bucket.file(`Chat/${file.id}`).save(file.data);
|
|
299
300
|
}
|
|
301
|
+
res.send({ idFile });
|
|
300
302
|
fs_1.default.unlinkSync(filePath);
|
|
301
303
|
if (!isClient) {
|
|
302
304
|
const [cliente] = yield (0, index_1.query)('SELECT [PREFERRED LANGUAGE] FROM [CLIENTE] WHERE [ID] = ?', [idCliente]);
|
|
@@ -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;AA8YF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|