@runnerpro/backend 1.14.8 → 1.14.9

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.
@@ -201,12 +201,21 @@ const getConversationFile = (req, res, { bucket, isClient }) => __awaiter(void 0
201
201
  });
202
202
  if (!result)
203
203
  return res.status(404).send('Not found');
204
- res.writeHead(200, {
205
- 'Content-Type': result.message.text,
206
- 'Content-disposition': 'inline',
207
- 'Content-Length': result.file.length,
208
- });
209
- res.end(result.file);
204
+ if (result.message.mimetype.includes('video')) {
205
+ res.setHeader('Cache-Control', 'public, max-age=604800');
206
+ res.setHeader('Expires', new Date(Date.now() + 604800000).toUTCString());
207
+ res.send({
208
+ video: result.file.toString('base64'),
209
+ });
210
+ }
211
+ else {
212
+ res.writeHead(200, {
213
+ 'Content-Type': result.message.text,
214
+ 'Content-disposition': 'inline',
215
+ 'Content-Length': result.file.length,
216
+ });
217
+ res.end(result.file);
218
+ }
210
219
  });
211
220
  const getChatFile = ({ bucket, id, isClient, userid }) => __awaiter(void 0, void 0, void 0, function* () {
212
221
  const idBBDD = id.includes('-original') ? id.replace('-original', '') : id;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../../../src/chat/api/conversation.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,iBAAiB,0BAA2B,GAAG,SA0BpD,CAAC;AAofF,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,SA0BpD,CAAC;AA4fF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runnerpro/backend",
3
- "version": "1.14.8",
3
+ "version": "1.14.9",
4
4
  "description": "A collection of common backend functions",
5
5
  "exports": {
6
6
  ".": "./lib/cjs/index.js"