tango-app-api-client 3.6.0 → 3.6.2

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-client",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -31,7 +31,7 @@
31
31
  "sharp": "^0.34.3",
32
32
  "swagger-ui-express": "^5.0.0",
33
33
  "tango-api-schema": "^2.3.6",
34
- "tango-app-api-middleware": "^3.4.2",
34
+ "tango-app-api-middleware": "^3.6.0",
35
35
  "winston": "^3.11.0",
36
36
  "winston-daily-rotate-file": "^5.0.0"
37
37
  },
@@ -1,5 +1,5 @@
1
1
  import { billingDetailsUpdate, brandInfoUpdate, domainDetailsConfigurationUpdate, featureConfigurationUpdate, getClientData, signatoryDetailsUpdate, ticketConfigurationUpdate, documentsUpdate, getUserData, CsmUsersGet, OpsUsersGet, userConfigurationUpdate, findClient, aggregateClient, createAuditQueue, findOne, insert, update, findOneClient, updateOneClient } from '../service/client.service.js';
2
- import { checkFileExist, signedUrl, chunkArray, download, logger, getOpenSearchData, insertOpenSearchData, sendEmailWithSES, createCustomer, createVirtualAccount, getUuid, fileRestrictedUpload, getXsscheck } from 'tango-app-api-middleware';
2
+ import { checkFileExist, signedUrl, chunkArray, download, logger, getOpenSearchData, insertOpenSearchData, sendEmailWithSES, createCustomer, createVirtualAccount, getUuid, fileRestrictedUpload, getXsscheck, customSignedUrl } from 'tango-app-api-middleware';
3
3
  import { countDocumentsUser, findOneAndUpdateUser, findOneUser, getUserNameEmailById, updateManyUser } from '../service/user.service.js';
4
4
  import { aggregateStore, countDocumentsStore, findStore, updateManyStore } from '../service/store.service.js';
5
5
  import { aggregateCamera, countDocumentsCamera } from '../service/camera.service.js';
@@ -475,7 +475,7 @@ export async function getClients( req, res ) {
475
475
  export async function clientDetails( req, res ) {
476
476
  try {
477
477
  const bucket = JSON.parse( process.env.BUCKET );
478
- const url=JSON.parse( process.env.URL );
478
+ // const url=JSON.parse( process.env.URL );
479
479
  const client = await getClientData( { id: req.params.id } );
480
480
  if ( client ) {
481
481
  const isLogoExist = await checkFileExist( { Bucket: bucket.assets, Key: `${client.clientId}/logo/${client.profileDetails?.logo}` } );
@@ -488,48 +488,48 @@ export async function clientDetails( req, res ) {
488
488
 
489
489
 
490
490
  if ( isLogoExist ) {
491
- const signedFilUrl = `${url.assests}/${client.clientId}/logo/${client.profileDetails?.logo}`; // await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/logo/${client.profileDetails?.logo}` } );
491
+ const signedFilUrl =await customSignedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/logo/${client.profileDetails?.logo}` }, 30 ); // `${url.assests}/${client.clientId}/logo/${client.profileDetails?.logo}`; // await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/logo/${client.profileDetails?.logo}` } );
492
492
  client.profileDetails.logo = signedFilUrl;
493
493
  } else {
494
494
  client.profileDetails.logo = '';
495
495
  }
496
496
 
497
497
  if ( isGstCertificateExist ) {
498
- const signedFilUrl = `${url.assests}/${client.clientId}/documents/${client.document?.gst?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.gst?.path}` } );
498
+ const signedFilUrl = await customSignedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.gst?.path}` }, 30 );// `${url.assests}/${client.clientId}/documents/${client.document?.gst?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.gst?.path}` } );
499
499
  client.document.gst.path = signedFilUrl;
500
500
  } else {
501
501
  client.document.gst.path = '';
502
502
  }
503
503
 
504
504
  if ( isAddressCertificateExist ) {
505
- const signedFilUrl = `${url.assests}/${client.clientId}/documents/${client.document?.addressProof?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.addressProof?.path}` } );
505
+ const signedFilUrl =await customSignedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.addressProof?.path}` }, 30 ); // `${url.assests}/${client.clientId}/documents/${client.document?.addressProof?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.addressProof?.path}` } );
506
506
  client.document.addressProof.path = signedFilUrl;
507
507
  } else {
508
508
  client.document.addressProof.path = '';
509
509
  }
510
510
  if ( isPanCertificateExist ) {
511
- const signedFilUrl =`${url.assests}/${client.clientId}/documents/${client.document?.pan?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.pan?.path}` } );
511
+ const signedFilUrl = await customSignedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.pan?.path}` }, 30 );// `${url.assests}/${client.clientId}/documents/${client.document?.pan?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.pan?.path}` } );
512
512
  client.document.pan.path = signedFilUrl;
513
513
  } else {
514
514
  client.document.pan.path = '';
515
515
  }
516
516
 
517
517
  if ( isCinCertificateExist ) {
518
- const signedFilUrl =`${url.assests}/${client.clientId}/documents/${client.document?.cin?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.cin?.path}` } );
518
+ const signedFilUrl =await customSignedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.cin?.path}` }, 30 ); // `${url.assests}/${client.clientId}/documents/${client.document?.cin?.path}`;// await signedUrl( { Bucket: bucket.assets, file_path: `${client.clientId}/documents/${client.document?.cin?.path}` } );
519
519
  client.document.cin.path = signedFilUrl;
520
520
  } else {
521
521
  client.document.cin.path = '';
522
522
  }
523
523
 
524
524
  if ( isContractCertificateExist ) {
525
- const signedFilUrl =`${url.assests}/documents/contract.pdf`;// await signedUrl( { Bucket: bucket.assets, file_path: `documents/contract.pdf` } );
525
+ const signedFilUrl = await customSignedUrl( { Bucket: bucket.assets, file_path: `documents/contract.pdf` }, 30 ); // `${url.assests}/documents/contract.pdf`;// await signedUrl( { Bucket: bucket.assets, file_path: `documents/contract.pdf` } );
526
526
  client._doc.document.contract = signedFilUrl;
527
527
  } else {
528
528
  client._doc.document.contract = '';
529
529
  }
530
530
 
531
531
  if ( isTermsAndConditionsExist ) {
532
- const signedFilUrl =`${url.assests}/documents/terms&conditions.pdf`;// await signedUrl( { Bucket: bucket.assets, file_path: `documents/terms&conditions.pdf` } );
532
+ const signedFilUrl =await customSignedUrl( { Bucket: bucket.assets, file_path: `documents/terms&conditions.pdf` }, 30 ); // `${url.assests}/documents/terms&conditions.pdf`;// await signedUrl( { Bucket: bucket.assets, file_path: `documents/terms&conditions.pdf` } );
533
533
  client._doc.document.termsAndconditions = signedFilUrl;
534
534
  } else {
535
535
  client._doc.document.termsAndconditions = '';