tango-app-api-infra 3.0.53-dev → 3.1.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-infra",
3
- "version": "3.0.53-dev",
3
+ "version": "3.1.0",
4
4
  "description": "infra",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "mongodb": "^6.4.0",
26
26
  "nodemon": "^3.1.0",
27
27
  "tango-api-schema": "^2.0.77",
28
- "tango-app-api-middleware": "^1.0.54-dev",
28
+ "tango-app-api-middleware": "^3.1.1",
29
29
  "winston": "^3.12.0",
30
30
  "winston-daily-rotate-file": "^5.0.0"
31
31
  },
@@ -288,7 +288,7 @@ export async function viewTicket( req, res ) {
288
288
  if ( ticket.attachments.hasOwnProperty( index ) ) {
289
289
  let file = ticket.attachments[index];
290
290
  let params = {
291
- Bucket: 'tango-client-sandbox',
291
+ Bucket: appConfig.cloud.aws.bucket.ticket,
292
292
  file_path: file.filePath,
293
293
  };
294
294
  let attachments = await signedUrl( params );
@@ -340,7 +340,7 @@ export async function uploadAttachments( req, res ) {
340
340
  for ( let singleImg in req.files.img ) {
341
341
  if ( req.files.img.hasOwnProperty( singleImg ) ) {
342
342
  let params = {
343
- Bucket: 'tango-client-sandbox',
343
+ Bucket: appConfig.cloud.aws.bucket.ticket,
344
344
  Key: req.params.ticketId + '/',
345
345
  ContentType: 'multipart/form-data',
346
346
  body: req.files.img[singleImg].data,
@@ -364,7 +364,7 @@ export async function uploadAttachments( req, res ) {
364
364
  let oldticket = await findOneTangoTicket( { ticketId: req.params.ticketId } );
365
365
  let attachments = oldticket.attachments;
366
366
  let params = {
367
- Bucket: 'tango-client-sandbox',
367
+ Bucket: appConfig.cloud.aws.bucket.ticket,
368
368
  Key: req.params.ticketId + '/',
369
369
  ContentType: 'multipart/form-data',
370
370
  body: req.files.img.data,
@@ -4,7 +4,7 @@ import { aggregateTangoTicket } from '../services/tangoTicket.service.js';
4
4
  import { findOneStore } from '../services/store.service.js';
5
5
  import dayjs from 'dayjs';
6
6
  import { findinfraReason } from '../services/infraReason.service.js';
7
- import { signedUrl } from 'tango-app-api-middleware';
7
+ import { signedUrl, appConfig } from 'tango-app-api-middleware';
8
8
  export async function storeTicketList( req, res ) {
9
9
  try {
10
10
  let date = await getUTC( new Date( req.body.fromDate ), new Date( req.body.toDate ) );
@@ -803,7 +803,7 @@ export async function cameraAngleChange( req, res ) {
803
803
  let changeDetected = result.camera_info.filter( ( cam ) => cam.stream == req.body.StreamName );
804
804
  if ( changeDetected.length == 1 ) {
805
805
  let params = {
806
- Bucket: 'tango-client-sandbox',
806
+ Bucket: appConfig.cloud.aws.bucket.ticket,
807
807
  file_path: changeDetected[0].path,
808
808
  };
809
809
  let Image = await signedUrl( params );