YiAi/YiAiQuickDeploy/dist/modules/upload/upload.service.js
2024-07-02 16:38:26 +08:00

1 line
17 KiB
JavaScript

'use strict';const _0x16cf5b=_0x2db4;(function(_0x250ad4,_0x5e8509){const _0x12b1d5=_0x2db4,_0x3eec26=_0x250ad4();while(!![]){try{const _0x405917=parseInt(_0x12b1d5(0x1cb))/0x1*(parseInt(_0x12b1d5(0x1ce))/0x2)+parseInt(_0x12b1d5(0x1fb))/0x3*(parseInt(_0x12b1d5(0x1b6))/0x4)+parseInt(_0x12b1d5(0x1d9))/0x5*(-parseInt(_0x12b1d5(0x210))/0x6)+parseInt(_0x12b1d5(0x1f5))/0x7+parseInt(_0x12b1d5(0x1b9))/0x8+parseInt(_0x12b1d5(0x1df))/0x9+-parseInt(_0x12b1d5(0x1e6))/0xa;if(_0x405917===_0x5e8509)break;else _0x3eec26['push'](_0x3eec26['shift']());}catch(_0x1e3f36){_0x3eec26['push'](_0x3eec26['shift']());}}}(_0x5c17,0x37461));function _0x5c17(){const _0x539dbd=['aliOssBucket','234FGnMtW','请先前往后台配置上传图片的方式','使用Chevereto上传','aliOssStatus','Logger','globalConfigService','function','then','Location','cos-nodejs-sdk-v5','metadata','url',',\x20阿里云:\x20','上传图片失败[ali]','ISDEV','defineProperty','__decorate','cosSecretId','slice','cheveretoStatus','上传图片失败[ten]','145554dhCPIo','上传图片失败[ten][url]','message','cheveretoKey','uploadFileByChevereto','chevereto','image','getUploadConfig','__esModule','removeSpecialCharacters','GlobalConfigService','uploadFileFromUrl','split','获取图片资源失败、请重新试试吧!','append','source','https://$2','uploadFileByTencentCos','上传失败:\x20','../globalConfig/globalConfig.service','stream-to-buffer','endsWith','length','getUploadType','BAD_REQUEST','mjdev','3908shCfUb','tencent','uploadFileByTencentCosFromUrl','3462000UheaCK','default','getConfigs','debug','使用阿里云OSS上传','cos\x20->\x20err:\x20','aliOssAccessKeySecret','getBufferFromUrl','aliOssRegion','mjProxyUrl','design:paramtypes','code','putObject','png','get','https://cdn.discordapp.com/attachments/1097409128491651135/1169910551275638855/snine_60b5c001b_A_young_girl_smiles_brightly_in_the_pure_blue_f_8a41fe5f-5101-4c1e-b948-a748a0583577.png?ex=65571f1b&is=6544aa1b&hm=b82f2d88224eb7942e24c63a8e519c7693de12a2b96daa0f327dfb8f691b1480&','HttpException','replace','2081gkqEut','log','uploadFileByAliOssFromUrl','338nWxHaL','response','env','decorate','上传图片失败[Chevereto]','TODO->error:\x20\x20','stream','base64','data','uploadFileByCheveretoFromUrl','form-data','20rMZyRY','uploadFileByAliOss','@nestjs/common','使用腾讯云COS上传','http://172.247.48.137:8000','上传配置状态\x20-\x20腾讯云:\x20','2902977GIGQLE',',\x20Chevereto:\x20','res:\x20','error:\x20','mjProxy','上传图片失败[ALI][url]','Injectable','11759610fUAsVO','object','error','put','当前已开启全球加速----------------->','cosBucket','tencentCos','tencentCosStatus','stringify','UploadService','上传图片失败[Chevereto|buffer]\x20-->\x20','/mj/replaceUpload','HttpStatus','ali','tencentCosAcceleratedDomain','2213400kVXKzX','post','https://','aliyun','createRandomUid'];_0x5c17=function(){return _0x539dbd;};return _0x5c17();}var __decorate=this&&this[_0x16cf5b(0x20b)]||function(_0x42d436,_0x160d03,_0x42f84f,_0x1fbfc1){const _0x5cce1c=_0x16cf5b;var _0x2eeeb2=arguments[_0x5cce1c(0x1b2)],_0x30d0ba=_0x2eeeb2<0x3?_0x160d03:_0x1fbfc1===null?_0x1fbfc1=Object['getOwnPropertyDescriptor'](_0x160d03,_0x42f84f):_0x1fbfc1,_0x40781f;if(typeof Reflect===_0x5cce1c(0x1e7)&&typeof Reflect[_0x5cce1c(0x1d1)]===_0x5cce1c(0x201))_0x30d0ba=Reflect[_0x5cce1c(0x1d1)](_0x42d436,_0x160d03,_0x42f84f,_0x1fbfc1);else{for(var _0x38dc3b=_0x42d436['length']-0x1;_0x38dc3b>=0x0;_0x38dc3b--)if(_0x40781f=_0x42d436[_0x38dc3b])_0x30d0ba=(_0x2eeeb2<0x3?_0x40781f(_0x30d0ba):_0x2eeeb2>0x3?_0x40781f(_0x160d03,_0x42f84f,_0x30d0ba):_0x40781f(_0x160d03,_0x42f84f))||_0x30d0ba;}return _0x2eeeb2>0x3&&_0x30d0ba&&Object['defineProperty'](_0x160d03,_0x42f84f,_0x30d0ba),_0x30d0ba;},__metadata=this&&this['__metadata']||function(_0x1fe91d,_0x3f0631){const _0x507438=_0x16cf5b;if(typeof Reflect===_0x507438(0x1e7)&&typeof Reflect[_0x507438(0x205)]==='function')return Reflect[_0x507438(0x205)](_0x1fe91d,_0x3f0631);};Object[_0x16cf5b(0x20a)](exports,_0x16cf5b(0x218),{'value':!![]}),exports[_0x16cf5b(0x1ef)]=void 0x0;function _0x2db4(_0x4434b9,_0x1c0297){const _0x5c172a=_0x5c17();return _0x2db4=function(_0x2db438,_0x912b){_0x2db438=_0x2db438-0x1ac;let _0x1c86cf=_0x5c172a[_0x2db438];return _0x1c86cf;},_0x2db4(_0x4434b9,_0x1c0297);}const common_1=require(_0x16cf5b(0x1db)),TENCENTCOS=require(_0x16cf5b(0x204)),ALIOSS=require('ali-oss'),axios_1=require('axios'),streamToBuffer=require(_0x16cf5b(0x1b0)),utils_1=require('../../common/utils'),globalConfig_service_1=require(_0x16cf5b(0x1af)),FormData=require(_0x16cf5b(0x1d8));let UploadService=class UploadService{constructor(_0x278c02){const _0x5e9e8b=_0x16cf5b;this[_0x5e9e8b(0x200)]=_0x278c02;}['onModuleInit'](){}async['uploadFile'](_0x3b3352){const _0x3ebf0f=_0x16cf5b,{filename:_0x5e0daa,originalname:_0x3c6268,buffer:_0x157cbb,dir:dir='ai',mimetype:_0x1f36fd}=_0x3b3352,_0x265caf=_0x1f36fd?_0x1f36fd[_0x3ebf0f(0x21c)]('/')[0x1]:'',_0xffad9c=_0x3c6268||_0x5e0daa;common_1[_0x3ebf0f(0x1ff)][_0x3ebf0f(0x1bc)]('准备上传文件:\x20'+_0xffad9c+',\x20类型:\x20'+_0x265caf,'UploadService');const {tencentCosStatus:tencentCosStatus=0x0,aliOssStatus:aliOssStatus=0x0,cheveretoStatus:cheveretoStatus=0x0}=await this['globalConfigService']['getConfigs']([_0x3ebf0f(0x1ed),_0x3ebf0f(0x1fe),_0x3ebf0f(0x20e)]);common_1[_0x3ebf0f(0x1ff)]['debug'](_0x3ebf0f(0x1de)+tencentCosStatus+_0x3ebf0f(0x207)+aliOssStatus+_0x3ebf0f(0x1e0)+cheveretoStatus,_0x3ebf0f(0x1ef));if(!Number(tencentCosStatus)&&!Number(aliOssStatus)&&!Number(cheveretoStatus))throw new common_1[(_0x3ebf0f(0x1c9))](_0x3ebf0f(0x1fc),common_1['HttpStatus'][_0x3ebf0f(0x1b4)]);try{if(Number(tencentCosStatus))return common_1[_0x3ebf0f(0x1ff)][_0x3ebf0f(0x1bc)](_0x3ebf0f(0x1dc),_0x3ebf0f(0x1ef)),await this[_0x3ebf0f(0x1ad)]({'filename':_0xffad9c,'buffer':_0x157cbb,'dir':dir,'fileTyle':_0x265caf});if(Number(aliOssStatus))return common_1['Logger']['debug'](_0x3ebf0f(0x1bd),_0x3ebf0f(0x1ef)),await this[_0x3ebf0f(0x1da)]({'filename':_0xffad9c,'buffer':_0x157cbb,'dir':dir,'fileTyle':_0x265caf});if(Number(cheveretoStatus)){common_1[_0x3ebf0f(0x1ff)][_0x3ebf0f(0x1bc)](_0x3ebf0f(0x1fd),_0x3ebf0f(0x1ef));const {filename:_0x469c66,buffer:_0x40091c,dir:_0x2f23f7}=_0x3b3352;return await this[_0x3ebf0f(0x214)]({'filename':_0x469c66,'buffer':_0x40091c['toString'](_0x3ebf0f(0x1d5)),'dir':_0x2f23f7,'fileTyle':_0x265caf});}}catch(_0x5bbf4f){common_1[_0x3ebf0f(0x1ff)]['error'](_0x3ebf0f(0x1ae)+_0x5bbf4f[_0x3ebf0f(0x212)],_0x3ebf0f(0x1ef));throw _0x5bbf4f;}}async[_0x16cf5b(0x1b3)](){const _0x2fd1e2=_0x16cf5b,{tencentCosStatus:tencentCosStatus=0x0,aliOssStatus:aliOssStatus=0x0,cheveretoStatus:cheveretoStatus=0x0}=await this[_0x2fd1e2(0x200)][_0x2fd1e2(0x1bb)]([_0x2fd1e2(0x1ed),_0x2fd1e2(0x1fe),_0x2fd1e2(0x20e)]);if(Number(tencentCosStatus))return _0x2fd1e2(0x1b7);if(Number(aliOssStatus))return _0x2fd1e2(0x1f3);if(Number(cheveretoStatus))return _0x2fd1e2(0x215);}async[_0x16cf5b(0x21b)]({filename:_0x587b1e,url:_0x3d9cc6,dir:dir='mj'}){const _0xc47a44=_0x16cf5b;dir=process[_0xc47a44(0x1d0)][_0xc47a44(0x209)]?_0xc47a44(0x1b5):dir;const {tencentCosStatus:tencentCosStatus=0x0,aliOssStatus:aliOssStatus=0x0,cheveretoStatus:cheveretoStatus=0x0}=await this[_0xc47a44(0x200)][_0xc47a44(0x1bb)]([_0xc47a44(0x1ed),_0xc47a44(0x1fe),_0xc47a44(0x20e)]);if(!Number(tencentCosStatus)&&!Number(aliOssStatus)&&!Number(cheveretoStatus))throw new common_1[(_0xc47a44(0x1c9))]('请先前往后台配置上传图片的方式',common_1[_0xc47a44(0x1f2)][_0xc47a44(0x1b4)]);if(Number(tencentCosStatus))return this[_0xc47a44(0x1b8)]({'filename':_0x587b1e,'url':_0x3d9cc6,'dir':dir});if(Number(aliOssStatus)){const _0x46bda0=await this[_0xc47a44(0x1cd)]({'filename':_0x587b1e,'url':_0x3d9cc6,'dir':dir});return _0x46bda0;}if(Number(cheveretoStatus))return await this[_0xc47a44(0x1d7)]({'filename':_0x587b1e,'url':_0x3d9cc6,'dir':dir});}async[_0x16cf5b(0x1ad)]({filename:_0x162a14,buffer:_0x287375,dir:_0x5b705c,fileTyle:_0x452bea}){const _0x1a278d=_0x16cf5b,{Bucket:_0xd95c32,Region:_0x2428d7,SecretId:_0x2d957f,SecretKey:_0x5f36dd}=await this[_0x1a278d(0x217)](_0x1a278d(0x1b7));this[_0x1a278d(0x1ec)]=new TENCENTCOS({'SecretId':_0x2d957f,'SecretKey':_0x5f36dd,'FileParallelLimit':0xa});try{return new Promise(async(_0xe48c78,_0x2add6a)=>{const _0x5d06b7=_0x1a278d,_0x5b5272=_0x452bea||_0x5d06b7(0x1c6);this['tencentCos'][_0x5d06b7(0x1c5)]({'Bucket':(0x0,utils_1[_0x5d06b7(0x219)])(_0xd95c32),'Region':(0x0,utils_1[_0x5d06b7(0x219)])(_0x2428d7),'Key':_0x5b705c+'/'+(_0x162a14||(0x0,utils_1[_0x5d06b7(0x1f9)])()+'.'+_0x452bea),'StorageClass':'STANDARD','Body':_0x287375},async(_0x287a44,_0x52deed)=>{const _0x105b09=_0x5d06b7;if(_0x287a44)return console[_0x105b09(0x1cc)](_0x105b09(0x1be),_0x287a44),_0x2add6a(_0x287a44);let _0x35a1c6=_0x52deed[_0x105b09(0x203)][_0x105b09(0x1ca)](/^(http:\/\/|https:\/\/|\/\/|)(.*)/,_0x105b09(0x1ac));const {acceleratedDomain:_0x59e2fa}=await this[_0x105b09(0x217)](_0x105b09(0x1b7));return _0x59e2fa&&(_0x35a1c6=_0x35a1c6[_0x105b09(0x1ca)](/^(https:\/\/[^/]+)(\/.*)$/,_0x105b09(0x1f7)+_0x59e2fa+'$2'),console[_0x105b09(0x1cc)](_0x105b09(0x1ea),_0x35a1c6)),_0xe48c78(_0x35a1c6);});});}catch(_0x4b85e1){console[_0x1a278d(0x1cc)](_0x1a278d(0x1e2),_0x4b85e1);throw new common_1[(_0x1a278d(0x1c9))](_0x1a278d(0x20f),common_1[_0x1a278d(0x1f2)][_0x1a278d(0x1b4)]);}}async['uploadFileByTencentCosFromUrl']({filename:_0x483a23,url:_0x83e856,dir:_0x3f7f0b}){const _0x2d959c=_0x16cf5b,{Bucket:_0x18027c,Region:_0x1fb2a1,SecretId:_0x4251f5,SecretKey:_0x17e4f7}=await this[_0x2d959c(0x217)](_0x2d959c(0x1b7));this['tencentCos']=new TENCENTCOS({'SecretId':_0x4251f5,'SecretKey':_0x17e4f7,'FileParallelLimit':0xa});try{const _0x15ccca=await this[_0x2d959c(0x200)]['getConfigs']([_0x2d959c(0x1e3)])||0x0,_0x5ce9bb=await this[_0x2d959c(0x1c0)](_0x83e856);return await this['uploadFileByTencentCos']({'filename':_0x483a23,'buffer':_0x5ce9bb,'dir':_0x3f7f0b,'fileTyle':''});}catch(_0x58c461){console[_0x2d959c(0x1cc)](_0x2d959c(0x1d3),_0x58c461);throw new common_1['HttpException'](_0x2d959c(0x211),common_1[_0x2d959c(0x1f2)][_0x2d959c(0x1b4)]);}}async[_0x16cf5b(0x1da)]({filename:_0x2ae0f2,buffer:_0x5a1d5d,dir:_0x3b4fb8,fileTyle:fileTyle=_0x16cf5b(0x1c6)}){const _0xac0284=_0x16cf5b,{region:_0x232a25,bucket:_0x4ce03c,accessKeyId:_0x4c2bc5,accessKeySecret:_0x135e4d}=await this['getUploadConfig'](_0xac0284(0x1f3)),_0x2b87b0=new ALIOSS({'region':(0x0,utils_1[_0xac0284(0x219)])(_0x232a25),'accessKeyId':_0x4c2bc5,'accessKeySecret':_0x135e4d,'bucket':(0x0,utils_1['removeSpecialCharacters'])(_0x4ce03c)});try{return console[_0xac0284(0x1cc)]('ali\x20开始上传'),new Promise((_0x4d47b3,_0x3a8db2)=>{const _0x19fe69=_0xac0284;_0x2b87b0[_0x19fe69(0x1e9)](_0x3b4fb8+'/'+(_0x2ae0f2||(0x0,utils_1[_0x19fe69(0x1f9)])()+'.'+fileTyle),_0x5a1d5d)[_0x19fe69(0x202)](_0x108331=>{_0x4d47b3(_0x108331['url']);})['catch'](_0x27667d=>{_0x3a8db2(_0x27667d);});});}catch(_0x3a40f4){throw new common_1[(_0xac0284(0x1c9))](_0xac0284(0x208),common_1['HttpStatus']['BAD_REQUEST']);}}async[_0x16cf5b(0x1cd)]({filename:_0x5e6e2f,url:_0x4226c1,dir:_0x50b7c9}){const _0x598bb=_0x16cf5b,{region:_0x4cf0d5,bucket:_0x4b16a2,accessKeyId:_0x2a87c5,accessKeySecret:_0x220306}=await this[_0x598bb(0x217)](_0x598bb(0x1f3)),_0x4057c9=new ALIOSS({'region':_0x4cf0d5,'accessKeyId':_0x2a87c5,'accessKeySecret':_0x220306,'bucket':_0x4b16a2});try{const _0x31a275=await this[_0x598bb(0x200)][_0x598bb(0x1bb)]([_0x598bb(0x1e3)])||0x0;if(Number(_0x31a275)===0x1){const _0x256a09={'url':_0x4226c1,'cosParams':{'region':_0x4cf0d5,'bucket':_0x4b16a2,'accessKeyId':_0x2a87c5,'accessKeySecret':_0x220306},'cosType':_0x598bb(0x1f8)},_0x3c7e9f=await this['globalConfigService'][_0x598bb(0x1bb)]([_0x598bb(0x1c2)])||_0x598bb(0x1dd),_0x46d7c5=await axios_1[_0x598bb(0x1ba)][_0x598bb(0x1f6)](_0x3c7e9f+'/mj/replaceUpload',_0x256a09);if(!(_0x46d7c5===null||_0x46d7c5===void 0x0?void 0x0:_0x46d7c5['data']))throw new common_1['HttpException'](_0x598bb(0x1e4),common_1['HttpStatus']['BAD_REQUEST']);return _0x46d7c5[_0x598bb(0x1d6)];}else{const _0x39495e=await this[_0x598bb(0x1c0)](_0x4226c1);return await this[_0x598bb(0x1da)]({'filename':_0x5e6e2f,'buffer':_0x39495e,'dir':_0x50b7c9});}}catch(_0x2090c9){throw new common_1[(_0x598bb(0x1c9))](_0x598bb(0x1e4),common_1[_0x598bb(0x1f2)][_0x598bb(0x1b4)]);}}async[_0x16cf5b(0x214)]({filename:filename='',buffer:_0x2a760b,dir:dir='ai',fileTyle:fileTyle='png'}){const _0x25a3cf=_0x16cf5b;var _0x1ab7d2;const {key:_0x38da11,uploadPath:_0x4cb99e}=await this[_0x25a3cf(0x217)](_0x25a3cf(0x215));let _0x305a86=_0x4cb99e['endsWith']('/')?_0x4cb99e[_0x25a3cf(0x20d)](0x0,-0x1):_0x4cb99e;const _0x294341=new FormData();_0x294341[_0x25a3cf(0x21e)](_0x25a3cf(0x21f),_0x2a760b),_0x294341['append']('key',_0x38da11);try{const _0x2b245d=await axios_1[_0x25a3cf(0x1ba)][_0x25a3cf(0x1f6)](_0x305a86,_0x294341,{'headers':{'X-API-Key':_0x38da11}});if((_0x2b245d===null||_0x2b245d===void 0x0?void 0x0:_0x2b245d['status'])===0xc8)return _0x2b245d['data'][_0x25a3cf(0x216)][_0x25a3cf(0x206)];else console[_0x25a3cf(0x1cc)]('Chevereto\x20--->\x20res',_0x2b245d===null||_0x2b245d===void 0x0?void 0x0:_0x2b245d[_0x25a3cf(0x1d6)][_0x25a3cf(0x1c4)],_0x2b245d===null||_0x2b245d===void 0x0?void 0x0:_0x2b245d['data'][_0x25a3cf(0x1e8)][_0x25a3cf(0x212)]),common_1[_0x25a3cf(0x1ff)][_0x25a3cf(0x1e8)](_0x25a3cf(0x1d2),JSON[_0x25a3cf(0x1ee)](_0x2b245d['data']));}catch(_0x492d86){console[_0x25a3cf(0x1cc)](_0x25a3cf(0x1e2),_0x492d86);throw new common_1['HttpException'](_0x25a3cf(0x1f0)+((_0x1ab7d2=_0x492d86[_0x25a3cf(0x1cf)])===null||_0x1ab7d2===void 0x0?void 0x0:_0x1ab7d2['data']['error'][_0x25a3cf(0x212)]),common_1[_0x25a3cf(0x1f2)][_0x25a3cf(0x1b4)]);}}async[_0x16cf5b(0x1d7)]({filename:_0x562d59,url:_0x54b2af,dir:_0x5bac9a}){const _0x1a240b=_0x16cf5b;try{const _0x584e30=await this['globalConfigService'][_0x1a240b(0x1bb)](['mjProxy'])||0x0;if(Number(_0x584e30)===0x1){const {key:_0x82db40,uploadPath:_0x3ff219}=await this['getUploadConfig']('chevereto');let _0x5bb2c7=_0x3ff219[_0x1a240b(0x1b1)]('/')?_0x3ff219[_0x1a240b(0x20d)](0x0,-0x1):_0x3ff219;const _0x1ae1fe={'cosType':_0x1a240b(0x215),'url':_0x54b2af,'cosParams':{'key':_0x82db40,'uploadPath':_0x5bb2c7}},_0x1c2356=await this[_0x1a240b(0x200)][_0x1a240b(0x1bb)]([_0x1a240b(0x1c2)])||_0x1a240b(0x1dd),_0x66b25f=await axios_1[_0x1a240b(0x1ba)][_0x1a240b(0x1f6)](_0x1c2356+_0x1a240b(0x1f1),_0x1ae1fe);if(!_0x66b25f['data'])throw new common_1[(_0x1a240b(0x1c9))]('上传图片失败[Chevereto][url]',common_1[_0x1a240b(0x1f2)][_0x1a240b(0x1b4)]);return _0x66b25f[_0x1a240b(0x1d6)];}else{const _0x2e165c=await this[_0x1a240b(0x1c0)](_0x54b2af);return await this[_0x1a240b(0x214)]({'filename':_0x562d59,'buffer':_0x2e165c,'dir':_0x5bac9a});}}catch(_0x1af66a){console[_0x1a240b(0x1cc)](_0x1a240b(0x1e2),_0x1af66a);throw new common_1['HttpException'](_0x1af66a[_0x1a240b(0x1cf)],common_1[_0x1a240b(0x1f2)]['BAD_REQUEST']);}}async['getUploadConfig'](_0x24325a){const _0x2c5ea9=_0x16cf5b;if(_0x24325a===_0x2c5ea9(0x1f3)){const {aliOssRegion:_0x172ca3,aliOssBucket:_0x535df8,aliOssAccessKeyId:_0x4e14c6,aliOssAccessKeySecret:_0x301592}=await this[_0x2c5ea9(0x200)]['getConfigs']([_0x2c5ea9(0x1c1),_0x2c5ea9(0x1fa),'aliOssAccessKeyId',_0x2c5ea9(0x1bf)]);return{'region':_0x172ca3,'bucket':_0x535df8,'accessKeyId':_0x4e14c6,'accessKeySecret':_0x301592};}if(_0x24325a===_0x2c5ea9(0x1b7)){const {cosBucket:_0x12c1c5,cosRegion:_0x287841,cosSecretId:_0x3c1856,cosSecretKey:_0x2ca668,tencentCosAcceleratedDomain:_0x46275f}=await this[_0x2c5ea9(0x200)]['getConfigs']([_0x2c5ea9(0x1eb),'cosRegion',_0x2c5ea9(0x20c),'cosSecretKey',_0x2c5ea9(0x1f4)]);return{'Bucket':_0x12c1c5,'Region':_0x287841,'SecretId':_0x3c1856,'SecretKey':_0x2ca668,'acceleratedDomain':_0x46275f};}if(_0x24325a===_0x2c5ea9(0x215)){const {cheveretoKey:_0x57c755,cheveretoUploadPath:_0x4361a1}=await this[_0x2c5ea9(0x200)]['getConfigs']([_0x2c5ea9(0x213),'cheveretoUploadPath']);return{'key':_0x57c755,'uploadPath':_0x4361a1};}}async['test'](){const _0xa8ca1d=_0x16cf5b,_0x1b8109={'filename':'mjtest.png','dir':'mj','url':_0xa8ca1d(0x1c8)},_0x4a2adf=await this['uploadFileFromUrl'](_0x1b8109);return console[_0xa8ca1d(0x1cc)](_0xa8ca1d(0x1e1),_0x4a2adf),_0x4a2adf;}async[_0x16cf5b(0x1c0)](_0x2ecfb8){const _0x4ff066=_0x16cf5b,_0x23e8a6=await this['globalConfigService'][_0x4ff066(0x1bb)]([_0x4ff066(0x1e3)])||0x0,_0x10c173=await axios_1['default'][_0x4ff066(0x1c7)](_0x2ecfb8,{'responseType':_0x4ff066(0x1d4)});return new Promise((_0x155b33,_0x3c06ed)=>{const _0xdd798d=_0x4ff066;streamToBuffer(_0x10c173[_0xdd798d(0x1d6)],(_0x1ef50a,_0x4162b3)=>{const _0x4a4e71=_0xdd798d;if(_0x1ef50a)throw new common_1[(_0x4a4e71(0x1c9))](_0x4a4e71(0x21d),common_1['HttpStatus'][_0x4a4e71(0x1b4)]);else _0x155b33(_0x4162b3);});});}};UploadService=__decorate([(0x0,common_1[_0x16cf5b(0x1e5)])(),__metadata(_0x16cf5b(0x1c3),[globalConfig_service_1[_0x16cf5b(0x21a)]])],UploadService),exports['UploadService']=UploadService;