@runnerpro/backend 1.12.17 → 1.12.19

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.
@@ -65,7 +65,7 @@ const getConversation = (req, res, { isClient }) => __awaiter(void 0, void 0, vo
65
65
  const [header] = yield (0, index_1.query)('SELECT [NAME], [PREFERRED LANGUAGE] FROM [CLIENTE] WHERE [ID] = ?', [idCliente]);
66
66
  let messages = yield (0, index_1.query)(`SELECT [CHAT MESSAGE].*,
67
67
  [WORKOUT].[DATE] AS [WORKOUT DATE], [WORKOUT].[TYPE] AS [WORKOUT TYPE], [WORKOUT].[TITLE] AS [WORKOUT TITLE], [WORKOUT].[TITLE PREFERRED LANGUAGE] AS [WORKOUT TITLE],
68
- [WORKOUT].[DURATION] AS [WORKOUT DURATION], [WORKOUT].[DISTANCE] AS [WORKOUT DISTANCE],
68
+ [WORKOUT].[DURATION] AS [WORKOUT DURATION], [WORKOUT].[DISTANCE] AS [WORKOUT DISTANCE], [WORKOUT].[RESUMEN] AS [WORKOUT RESUMEN],
69
69
  [WORKOUT].[PHOTO URL SHARE] AS [WORKOUT PHOTO URL SHARE], [WORKOUT].[PHOTO URL] AS [WORKOUT PHOTO URL], [FEELINGS], [FEELINGS DESCRIPTION]
70
70
  FROM [CHAT MESSAGE]
71
71
  LEFT JOIN [WORKOUT] ON [WORKOUT].[ID] = [CHAT MESSAGE].[ID WORKOUT]
@@ -277,7 +277,9 @@ const sendFile = (req, res, { sendNotification, firebaseMessaging, isClient, buc
277
277
  const { userid } = req.session;
278
278
  const filePath = path_1.default.join('./uploads', req.file.filename);
279
279
  if (req.file.mimetype.includes('video')) {
280
+ console.log('es video');
280
281
  [duration, thumbnail] = yield Promise.all([getVideoDuration(filePath), getThumbnailFromVideo(filePath)]);
282
+ console.log('duration and thumbnail done');
281
283
  }
282
284
  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]);
283
285
  const fileData = fs_1.default.readFileSync(filePath);
@@ -322,6 +324,7 @@ const getThumbnailFromVideo = (videoPath) => __awaiter(void 0, void 0, void 0, f
322
324
  const tempDir = path_1.default.join('./uploads');
323
325
  const outputFilename = `thumbnail_${Date.now()}.png`;
324
326
  const outputPath = path_1.default.join(tempDir, outputFilename);
327
+ console.log('getThumbnailFromVideo');
325
328
  return new Promise((resolve, reject) => {
326
329
  (0, fluent_ffmpeg_1.default)(videoPath)
327
330
  .screenshots({
@@ -334,9 +337,12 @@ const getThumbnailFromVideo = (videoPath) => __awaiter(void 0, void 0, void 0, f
334
337
  .on('end', () => {
335
338
  try {
336
339
  // Leer el archivo como buffer
340
+ console.log('leer archivo como buffer');
337
341
  const buffer = fs_1.default.readFileSync(outputPath);
342
+ console.log('leer archivo como buffer done');
338
343
  // Limpiar archivo temporal
339
344
  fs_1.default.unlinkSync(outputPath);
345
+ console.log('remove done');
340
346
  resolve(buffer);
341
347
  }
342
348
  catch (error) {
@@ -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;AAqZF,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,SAuBpD,CAAC;AA4ZF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.12.17",
3
+ "version": "1.12.19",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"