reqover
Version:
Reqover is language agnostic tool that gives a picture about coverage of APIs based on Open API (Swagger).
1 lines • 3.16 kB
JavaScript
const a4_0x2b699d=a4_0x57aa;(function(_0x577592,_0x53e9cf){const _0xa734b7=a4_0x57aa,_0x25f67a=_0x577592();while(!![]){try{const _0x1d8dc6=-parseInt(_0xa734b7(0xb0))/0x1+-parseInt(_0xa734b7(0xa0))/0x2+parseInt(_0xa734b7(0xaf))/0x3*(-parseInt(_0xa734b7(0xa8))/0x4)+parseInt(_0xa734b7(0xb7))/0x5*(-parseInt(_0xa734b7(0xa6))/0x6)+parseInt(_0xa734b7(0xaa))/0x7+parseInt(_0xa734b7(0x9c))/0x8*(parseInt(_0xa734b7(0x9d))/0x9)+-parseInt(_0xa734b7(0xa7))/0xa*(-parseInt(_0xa734b7(0xa9))/0xb);if(_0x1d8dc6===_0x53e9cf)break;else _0x25f67a['push'](_0x25f67a['shift']());}catch(_0x24ffbc){_0x25f67a['push'](_0x25f67a['shift']());}}}(a4_0x7951,0x207db));const request=require('superagent'),fs=require('fs'),admZip=require('adm-zip'),path=require(a4_0x2b699d(0xa2)),ejs=require('ejs'),href='https://github.com/reqover/reqover-report/releases/download',name=a4_0x2b699d(0xb1),reportDir=a4_0x2b699d(0xa5);function downloadReport(_0x21ceae){const _0x4ab8a0=a4_0x2b699d,_0x1888f6=reportDir+'/'+name;!fs[_0x4ab8a0(0xa4)](reportDir)&&fs[_0x4ab8a0(0x9e)](reportDir,{'recursive':!![]});if(fs[_0x4ab8a0(0xa4)](_0x1888f6)){unzip(_0x1888f6,reportDir);return;}request['get'](href+'/'+_0x21ceae+'/'+name)['on'](_0x4ab8a0(0xb5),function(_0x5ae9f8){const _0x2f33eb=_0x4ab8a0;console[_0x2f33eb(0xab)](_0x5ae9f8);})[_0x4ab8a0(0x9b)](fs[_0x4ab8a0(0xad)](_0x1888f6))['on'](_0x4ab8a0(0xb2),function(){const _0x3669ed=_0x4ab8a0;console[_0x3669ed(0xab)](_0x3669ed(0xae)+reportDir),setTimeout(()=>{unzip(_0x1888f6,reportDir);},0x3e8);});}function a4_0x57aa(_0x4eb1a6,_0x2884ae){const _0x7951b0=a4_0x7951();return a4_0x57aa=function(_0x57aa42,_0x47e00f){_0x57aa42=_0x57aa42-0x9a;let _0x303aa5=_0x7951b0[_0x57aa42];return _0x303aa5;},a4_0x57aa(_0x4eb1a6,_0x2884ae);}function unzip(_0x67669,_0x493217){const _0x29f1f9=new admZip(_0x67669);_0x29f1f9['extractAllTo'](_0x493217,![],!![]);}function a4_0x7951(){const _0x3a9fad=['report.zip','finish','parse','/template/assets','error','/template/swagger.ejs','10fLCKMB','writeFileSync','/assets','pipe','156584SdoBBG','18WqwhaS','mkdirSync','readFileSync','346928FOvbab','renderFile','path','copyFileSync','existsSync','.reqover','290796ZkJGUy','3910pQtSbh','61916WiCACW','10967WFqkDD','1239021YrUfbf','log','cpSync','createWriteStream','Download\x20is\x20finished\x20to\x20','12ERHBNS','140581mbRPRo'];a4_0x7951=function(){return _0x3a9fad;};return a4_0x7951();}function copyData(_0x406895,_0xa735a9,_0xd84d89){const _0x181d7f=a4_0x2b699d;!fs[_0x181d7f(0xa4)](_0xa735a9)&&fs[_0x181d7f(0x9e)](_0xa735a9,{'recursive':!![]}),fs[_0x181d7f(0xa3)](_0x406895,path['join'](_0xa735a9,_0xd84d89));}async function generateReport(_0x42a855,_0x25dc4b){const _0x411ff9=a4_0x2b699d,_0x5c8367=JSON[_0x411ff9(0xb3)](fs[_0x411ff9(0x9f)](_0x42a855)),_0xdc8b27=await ejs[_0x411ff9(0xa1)](__dirname+_0x411ff9(0xb6),{'data':_0x5c8367});!fs[_0x411ff9(0xa4)](_0x25dc4b)&&fs[_0x411ff9(0x9e)](_0x25dc4b,{'recursive':!![]}),fs[_0x411ff9(0xb8)](_0x25dc4b+'/index.html',_0xdc8b27),fs[_0x411ff9(0xac)](__dirname+_0x411ff9(0xb4),_0x25dc4b+_0x411ff9(0x9a),{'recursive':!![]});}module['exports']={'downloadReport':downloadReport,'copyData':copyData,'generateReport':generateReport};