Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / integrationReport / integrationReport.controller.js
index 0ba56f1..560f270 100644 (file)
@@ -1 +1 @@
-const a363_0x100b=['filters','sort','VIRTUAL','index','model','fieldName','show','../../mysqldb','sendStatus','pick','error','body','api','stack','sequelize','options','merge','like','count','findOne','params','status','limit','Content-Range','intersection','keys','where','attributes','order','key','map','include','fields','describe','../../config/logger','rawAttributes','lodash','nolimit','end','includeAll','update','findAll','destroy','length','filter','catch','IntegrationReport','name','set','type','json','offset','query','then','create'];(function(_0x5a948a,_0x100b05){const _0xbf05eb=function(_0x58c884){while(--_0x58c884){_0x5a948a['push'](_0x5a948a['shift']());}};_0xbf05eb(++_0x100b05);}(a363_0x100b,0x133));const a363_0xbf05=function(_0x5a948a,_0x100b05){_0x5a948a=_0x5a948a-0x0;let _0xbf05eb=a363_0x100b[_0x5a948a];return _0xbf05eb;};const _0x23dc0d=a363_0xbf05;'use strict';const _=require(_0x23dc0d('0x4')),qs=require('../../components/parsers/qs'),logger=require(_0x23dc0d('0x2'))(_0x23dc0d('0x23')),db=require(_0x23dc0d('0x1e'))['db'],{Op}=require(_0x23dc0d('0x25'));function respondWithResult(_0x58c884,_0x196b6a){return _0x196b6a=_0x196b6a||0xc8,function(_0x194b9b){const _0x584017=a363_0xbf05;if(_0x194b9b)return _0x58c884['status'](_0x196b6a)[_0x584017('0x12')](_0x194b9b);};}function respondWithFilteredResult(_0x3e0a6e,_0x21f014){return function(_0x45ee71){const _0x481c8e=a363_0xbf05;if(_0x45ee71){const _0x5dc9a8=_0x45ee71[_0x481c8e('0x29')],_0xda0094=_0x21f014[_0x481c8e('0x13')];let _0x28bb49=_0x21f014['offset']+_0x21f014[_0x481c8e('0x2d')],_0x3128bd;return _0x28bb49>=_0x5dc9a8?(_0x28bb49=_0x5dc9a8,_0x3128bd=0xc8):_0x3128bd=0xce,_0x3e0a6e[_0x481c8e('0x2c')](_0x3128bd),_0x3e0a6e[_0x481c8e('0x10')](_0x481c8e('0x2e'),_0xda0094+'-'+_0x28bb49+'/'+_0x5dc9a8)['json'](_0x45ee71);}return null;};}function saveUpdates(_0x2531bc){return function(_0x26d562){const _0x168376=a363_0xbf05;if(_0x26d562)return _0x26d562[_0x168376('0x8')](_0x2531bc)[_0x168376('0x15')](function(_0x43d295){return _0x43d295;});return null;};}function removeEntity(_0x567589){return function(_0x20804a){const _0xf5b28e=a363_0xbf05;if(_0x20804a)return _0x20804a[_0xf5b28e('0xa')]()['then'](function(){const _0x597638=_0xf5b28e;_0x567589['status'](0xcc)[_0x597638('0x6')]();});};}function handleEntityNotFound(_0x406f47){return function(_0x15bacf){const _0x438c62=a363_0xbf05;return!_0x15bacf&&_0x406f47[_0x438c62('0x1f')](0x194),_0x15bacf;};}function handleError(_0x216997,_0x4d133a){return _0x4d133a=_0x4d133a||0x1f4,function(_0x35b0be){const _0x420c9a=a363_0xbf05;logger[_0x420c9a('0x21')](_0x35b0be[_0x420c9a('0x24')]),_0x35b0be[_0x420c9a('0xf')]&&delete _0x35b0be[_0x420c9a('0xf')],_0x216997[_0x420c9a('0x2c')](_0x4d133a)['send'](_0x35b0be);};}exports[_0x23dc0d('0x1a')]=function(_0x3b058f,_0x2f96ed){const _0x26db71=_0x23dc0d;let _0x1e1c75={};const _0x2ed405={},_0x1e43a6={'count':0x0,'rows':[]},_0x23a033=_[_0x26db71('0x35')](db[_0x26db71('0xe')][_0x26db71('0x3')],function(_0x4c49d8){const _0x5d2843=_0x26db71;return{'name':_0x4c49d8[_0x5d2843('0x1c')],'type':_0x4c49d8[_0x5d2843('0x11')][_0x5d2843('0x34')]};});_0x2ed405[_0x26db71('0x1b')]=_['map'](_0x23a033,_0x26db71('0xf')),_0x2ed405[_0x26db71('0x14')]=_['keys'](_0x3b058f[_0x26db71('0x14')]),_0x2ed405[_0x26db71('0x17')]=_['intersection'](_0x2ed405[_0x26db71('0x1b')],_0x2ed405['query']),_0x1e1c75['attributes']=_[_0x26db71('0x2f')](_0x2ed405[_0x26db71('0x1b')],qs[_0x26db71('0x0')](_0x3b058f[_0x26db71('0x14')][_0x26db71('0x0')])),_0x1e1c75['attributes']=_0x1e1c75[_0x26db71('0x32')]['length']?_0x1e1c75[_0x26db71('0x32')]:_0x2ed405['model'];typeof _0x3b058f[_0x26db71('0x14')][_0x26db71('0x5')]==='undefined'&&(_0x1e1c75[_0x26db71('0x2d')]=qs['limit'](_0x3b058f[_0x26db71('0x14')][_0x26db71('0x2d')]),_0x1e1c75['offset']=qs[_0x26db71('0x13')](_0x3b058f[_0x26db71('0x14')][_0x26db71('0x13')]));_0x1e1c75[_0x26db71('0x33')]=qs[_0x26db71('0x18')](_0x3b058f[_0x26db71('0x14')][_0x26db71('0x18')]),_0x1e1c75[_0x26db71('0x31')]=qs['filters'](_[_0x26db71('0x20')](_0x3b058f[_0x26db71('0x14')],_0x2ed405[_0x26db71('0x17')]),_0x23a033);_0x3b058f[_0x26db71('0x14')][_0x26db71('0xc')]&&(_0x1e1c75[_0x26db71('0x31')]=_[_0x26db71('0x27')](_0x1e1c75[_0x26db71('0x31')],{[Op['or']]:_[_0x26db71('0x35')](_0x23a033,function(_0x2b10d3){const _0x1d4d6f=_0x26db71;if(_0x2b10d3[_0x1d4d6f('0x11')]!==_0x1d4d6f('0x19')){const _0x596fbd={};return _0x596fbd[_0x2b10d3[_0x1d4d6f('0xf')]]={[Op[_0x1d4d6f('0x28')]]:'%'+_0x3b058f['query'][_0x1d4d6f('0xc')]+'%'},_0x596fbd;}})}));_0x1e1c75=_[_0x26db71('0x27')]({},_0x1e1c75,_0x3b058f[_0x26db71('0x26')]);const _0x3d2669={'where':_0x1e1c75[_0x26db71('0x31')]};return db[_0x26db71('0xe')][_0x26db71('0x29')](_0x3d2669)['then'](function(_0xb25989){const _0x4bfd9a=_0x26db71;return _0x1e43a6['count']=_0xb25989,_0x3b058f[_0x4bfd9a('0x14')]['includeAll']&&(_0x1e1c75[_0x4bfd9a('0x36')]=[{'all':!![]}]),db[_0x4bfd9a('0xe')][_0x4bfd9a('0x9')](_0x1e1c75);})[_0x26db71('0x15')](function(_0x48c0c0){return _0x1e43a6['rows']=_0x48c0c0,_0x1e43a6;})['then'](respondWithFilteredResult(_0x2f96ed,_0x1e1c75))[_0x26db71('0xd')](handleError(_0x2f96ed,null));},exports[_0x23dc0d('0x1d')]=function(_0x1312c3,_0x1b1432){const _0x5cb825=_0x23dc0d;let _0x3bc399={'raw':![],'where':{'id':_0x1312c3['params']['id']}};const _0x4981c9={};return _0x4981c9[_0x5cb825('0x1b')]=_['keys'](db[_0x5cb825('0xe')]['rawAttributes']),_0x4981c9['query']=_[_0x5cb825('0x30')](_0x1312c3[_0x5cb825('0x14')]),_0x4981c9['filters']=_[_0x5cb825('0x2f')](_0x4981c9['model'],_0x4981c9[_0x5cb825('0x14')]),_0x3bc399[_0x5cb825('0x32')]=_[_0x5cb825('0x2f')](_0x4981c9[_0x5cb825('0x1b')],qs[_0x5cb825('0x0')](_0x1312c3[_0x5cb825('0x14')]['fields'])),_0x3bc399[_0x5cb825('0x32')]=_0x3bc399[_0x5cb825('0x32')][_0x5cb825('0xb')]?_0x3bc399[_0x5cb825('0x32')]:_0x4981c9[_0x5cb825('0x1b')],_0x1312c3[_0x5cb825('0x14')][_0x5cb825('0x7')]&&(_0x3bc399[_0x5cb825('0x36')]=[{'all':!![]}]),_0x3bc399=_[_0x5cb825('0x27')]({},_0x3bc399,_0x1312c3[_0x5cb825('0x26')]),db['IntegrationReport'][_0x5cb825('0x2a')](_0x3bc399)[_0x5cb825('0x15')](handleEntityNotFound(_0x1b1432,null))[_0x5cb825('0x15')](respondWithResult(_0x1b1432,null))['catch'](handleError(_0x1b1432,null));},exports[_0x23dc0d('0x16')]=function(_0x2188a2,_0x391eb6){const _0x1bb84a=_0x23dc0d;return db[_0x1bb84a('0xe')][_0x1bb84a('0x16')](_0x2188a2['body'],{})[_0x1bb84a('0x15')](respondWithResult(_0x391eb6,0xc9))[_0x1bb84a('0xd')](handleError(_0x391eb6,null));},exports[_0x23dc0d('0x8')]=function(_0x369daf,_0x1c366b){const _0x1589af=_0x23dc0d;return _0x369daf[_0x1589af('0x22')]['id']&&delete _0x369daf[_0x1589af('0x22')]['id'],db[_0x1589af('0xe')]['findOne']({'where':{'id':_0x369daf[_0x1589af('0x2b')]['id']}})[_0x1589af('0x15')](handleEntityNotFound(_0x1c366b,null))[_0x1589af('0x15')](saveUpdates(_0x369daf[_0x1589af('0x22')],null))['then'](respondWithResult(_0x1c366b,null))['catch'](handleError(_0x1c366b,null));},exports[_0x23dc0d('0xa')]=function(_0x3ec973,_0x4cfcfa){const _0x4c79eb=_0x23dc0d;return db[_0x4c79eb('0xe')][_0x4c79eb('0x2a')]({'where':{'id':_0x3ec973[_0x4c79eb('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4cfcfa,null))[_0x4c79eb('0x15')](removeEntity(_0x4cfcfa,null))[_0x4c79eb('0xd')](handleError(_0x4cfcfa,null));},exports[_0x23dc0d('0x1')]=function(_0x48fd9e,_0x487c89){const _0x44621d=_0x23dc0d;return db[_0x44621d('0xe')]['describe']()[_0x44621d('0x15')](respondWithResult(_0x487c89,null))[_0x44621d('0xd')](handleError(_0x487c89,null));};
\ No newline at end of file
+const a363_0x39f9=['VIRTUAL','findAll','lodash','query','options','fieldName','rawAttributes','api','like','sort','merge','index','send','nolimit','type','Content-Range','then','length','params','count','findOne','show','end','pick','fields','includeAll','update','include','attributes','undefined','../../config/logger','offset','status','model','body','keys','filters','filter','where','limit','order','IntegrationReport','map','../../mysqldb','catch','name','rows','error','intersection','destroy','create','describe','json'];(function(_0x3aec51,_0x39f9b9){const _0xef5479=function(_0x444960){while(--_0x444960){_0x3aec51['push'](_0x3aec51['shift']());}};_0xef5479(++_0x39f9b9);}(a363_0x39f9,0x1dc));const a363_0xef54=function(_0x3aec51,_0x39f9b9){_0x3aec51=_0x3aec51-0x0;let _0xef5479=a363_0x39f9[_0x3aec51];return _0xef5479;};const _0x548941=a363_0xef54;'use strict';const _=require(_0x548941('0x3')),qs=require('../../components/parsers/qs'),logger=require(_0x548941('0x1f'))(_0x548941('0x8')),db=require(_0x548941('0x2c'))['db'],{Op}=require('sequelize');function respondWithResult(_0x444960,_0x556239){return _0x556239=_0x556239||0xc8,function(_0x59644a){const _0x4d9c77=a363_0xef54;if(_0x59644a)return _0x444960[_0x4d9c77('0x21')](_0x556239)[_0x4d9c77('0x0')](_0x59644a);};}function respondWithFilteredResult(_0x4d9742,_0x54f1e5){return function(_0x558a2c){const _0x5e65db=a363_0xef54;if(_0x558a2c){const _0x5545e8=_0x558a2c['count'],_0x526557=_0x54f1e5[_0x5e65db('0x20')];let _0x815db8=_0x54f1e5[_0x5e65db('0x20')]+_0x54f1e5[_0x5e65db('0x28')],_0x4bbcbb;return _0x815db8>=_0x5545e8?(_0x815db8=_0x5545e8,_0x4bbcbb=0xc8):_0x4bbcbb=0xce,_0x4d9742[_0x5e65db('0x21')](_0x4bbcbb),_0x4d9742['set'](_0x5e65db('0x10'),_0x526557+'-'+_0x815db8+'/'+_0x5545e8)[_0x5e65db('0x0')](_0x558a2c);}return null;};}function saveUpdates(_0x53e2dc){return function(_0x2be8f5){const _0x5a266d=a363_0xef54;if(_0x2be8f5)return _0x2be8f5[_0x5a266d('0x1b')](_0x53e2dc)[_0x5a266d('0x11')](function(_0x5f058f){return _0x5f058f;});return null;};}function removeEntity(_0x593feb){return function(_0x37498b){const _0x18a719=a363_0xef54;if(_0x37498b)return _0x37498b['destroy']()[_0x18a719('0x11')](function(){const _0x49acf4=_0x18a719;_0x593feb[_0x49acf4('0x21')](0xcc)[_0x49acf4('0x17')]();});};}function handleEntityNotFound(_0x557a97){return function(_0x49e9a2){return!_0x49e9a2&&_0x557a97['sendStatus'](0x194),_0x49e9a2;};}function handleError(_0x347764,_0x4cc584){return _0x4cc584=_0x4cc584||0x1f4,function(_0x8c1728){const _0x498a94=a363_0xef54;logger[_0x498a94('0x30')](_0x8c1728['stack']),_0x8c1728[_0x498a94('0x2e')]&&delete _0x8c1728['name'],_0x347764[_0x498a94('0x21')](_0x4cc584)[_0x498a94('0xd')](_0x8c1728);};}exports[_0x548941('0xc')]=function(_0x53109e,_0x31c5b5){const _0x5edbf2=_0x548941;let _0x1b9197={};const _0x50beb3={},_0x332927={'count':0x0,'rows':[]},_0x2db9ab=_[_0x5edbf2('0x2b')](db[_0x5edbf2('0x2a')][_0x5edbf2('0x7')],function(_0x588bf5){const _0xcac084=_0x5edbf2;return{'name':_0x588bf5[_0xcac084('0x6')],'type':_0x588bf5[_0xcac084('0xf')]['key']};});_0x50beb3[_0x5edbf2('0x22')]=_['map'](_0x2db9ab,_0x5edbf2('0x2e')),_0x50beb3[_0x5edbf2('0x4')]=_[_0x5edbf2('0x24')](_0x53109e[_0x5edbf2('0x4')]),_0x50beb3[_0x5edbf2('0x25')]=_[_0x5edbf2('0x31')](_0x50beb3[_0x5edbf2('0x22')],_0x50beb3[_0x5edbf2('0x4')]),_0x1b9197['attributes']=_['intersection'](_0x50beb3[_0x5edbf2('0x22')],qs[_0x5edbf2('0x19')](_0x53109e['query'][_0x5edbf2('0x19')])),_0x1b9197[_0x5edbf2('0x1d')]=_0x1b9197['attributes'][_0x5edbf2('0x12')]?_0x1b9197['attributes']:_0x50beb3[_0x5edbf2('0x22')];typeof _0x53109e[_0x5edbf2('0x4')][_0x5edbf2('0xe')]===_0x5edbf2('0x1e')&&(_0x1b9197[_0x5edbf2('0x28')]=qs[_0x5edbf2('0x28')](_0x53109e['query']['limit']),_0x1b9197['offset']=qs[_0x5edbf2('0x20')](_0x53109e[_0x5edbf2('0x4')][_0x5edbf2('0x20')]));_0x1b9197[_0x5edbf2('0x29')]=qs[_0x5edbf2('0xa')](_0x53109e[_0x5edbf2('0x4')][_0x5edbf2('0xa')]),_0x1b9197['where']=qs[_0x5edbf2('0x25')](_[_0x5edbf2('0x18')](_0x53109e[_0x5edbf2('0x4')],_0x50beb3[_0x5edbf2('0x25')]),_0x2db9ab);_0x53109e[_0x5edbf2('0x4')][_0x5edbf2('0x26')]&&(_0x1b9197['where']=_[_0x5edbf2('0xb')](_0x1b9197[_0x5edbf2('0x27')],{[Op['or']]:_['map'](_0x2db9ab,function(_0x2ee8c5){const _0x5da67e=_0x5edbf2;if(_0x2ee8c5['type']!==_0x5da67e('0x1')){const _0x49c9ac={};return _0x49c9ac[_0x2ee8c5[_0x5da67e('0x2e')]]={[Op[_0x5da67e('0x9')]]:'%'+_0x53109e[_0x5da67e('0x4')][_0x5da67e('0x26')]+'%'},_0x49c9ac;}})}));_0x1b9197=_['merge']({},_0x1b9197,_0x53109e[_0x5edbf2('0x5')]);const _0x5bfbae={'where':_0x1b9197[_0x5edbf2('0x27')]};return db[_0x5edbf2('0x2a')][_0x5edbf2('0x14')](_0x5bfbae)['then'](function(_0x3c4c9b){const _0x4be04f=_0x5edbf2;return _0x332927['count']=_0x3c4c9b,_0x53109e[_0x4be04f('0x4')]['includeAll']&&(_0x1b9197[_0x4be04f('0x1c')]=[{'all':!![]}]),db[_0x4be04f('0x2a')][_0x4be04f('0x2')](_0x1b9197);})[_0x5edbf2('0x11')](function(_0x3a148c){const _0x14da47=_0x5edbf2;return _0x332927[_0x14da47('0x2f')]=_0x3a148c,_0x332927;})[_0x5edbf2('0x11')](respondWithFilteredResult(_0x31c5b5,_0x1b9197))[_0x5edbf2('0x2d')](handleError(_0x31c5b5,null));},exports[_0x548941('0x16')]=function(_0x399452,_0x50fef4){const _0x1969ee=_0x548941;let _0x16ed13={'raw':![],'where':{'id':_0x399452[_0x1969ee('0x13')]['id']}};const _0x9b045d={};return _0x9b045d[_0x1969ee('0x22')]=_['keys'](db[_0x1969ee('0x2a')]['rawAttributes']),_0x9b045d[_0x1969ee('0x4')]=_[_0x1969ee('0x24')](_0x399452[_0x1969ee('0x4')]),_0x9b045d[_0x1969ee('0x25')]=_[_0x1969ee('0x31')](_0x9b045d[_0x1969ee('0x22')],_0x9b045d[_0x1969ee('0x4')]),_0x16ed13[_0x1969ee('0x1d')]=_[_0x1969ee('0x31')](_0x9b045d[_0x1969ee('0x22')],qs[_0x1969ee('0x19')](_0x399452[_0x1969ee('0x4')][_0x1969ee('0x19')])),_0x16ed13[_0x1969ee('0x1d')]=_0x16ed13[_0x1969ee('0x1d')][_0x1969ee('0x12')]?_0x16ed13[_0x1969ee('0x1d')]:_0x9b045d[_0x1969ee('0x22')],_0x399452[_0x1969ee('0x4')][_0x1969ee('0x1a')]&&(_0x16ed13[_0x1969ee('0x1c')]=[{'all':!![]}]),_0x16ed13=_[_0x1969ee('0xb')]({},_0x16ed13,_0x399452[_0x1969ee('0x5')]),db[_0x1969ee('0x2a')][_0x1969ee('0x15')](_0x16ed13)[_0x1969ee('0x11')](handleEntityNotFound(_0x50fef4,null))[_0x1969ee('0x11')](respondWithResult(_0x50fef4,null))[_0x1969ee('0x2d')](handleError(_0x50fef4,null));},exports[_0x548941('0x33')]=function(_0x4a6eab,_0x27e360){const _0x540d7e=_0x548941;return db[_0x540d7e('0x2a')][_0x540d7e('0x33')](_0x4a6eab[_0x540d7e('0x23')],{})[_0x540d7e('0x11')](respondWithResult(_0x27e360,0xc9))[_0x540d7e('0x2d')](handleError(_0x27e360,null));},exports['update']=function(_0x368cdd,_0x4d7c5f){const _0x2d4c00=_0x548941;return _0x368cdd[_0x2d4c00('0x23')]['id']&&delete _0x368cdd[_0x2d4c00('0x23')]['id'],db[_0x2d4c00('0x2a')][_0x2d4c00('0x15')]({'where':{'id':_0x368cdd['params']['id']}})[_0x2d4c00('0x11')](handleEntityNotFound(_0x4d7c5f,null))[_0x2d4c00('0x11')](saveUpdates(_0x368cdd[_0x2d4c00('0x23')],null))[_0x2d4c00('0x11')](respondWithResult(_0x4d7c5f,null))['catch'](handleError(_0x4d7c5f,null));},exports[_0x548941('0x32')]=function(_0x269b6b,_0x3fea90){const _0x3435ee=_0x548941;return db[_0x3435ee('0x2a')]['findOne']({'where':{'id':_0x269b6b['params']['id']}})['then'](handleEntityNotFound(_0x3fea90,null))[_0x3435ee('0x11')](removeEntity(_0x3fea90,null))[_0x3435ee('0x2d')](handleError(_0x3fea90,null));},exports[_0x548941('0x34')]=function(_0x50ea41,_0x49fa7d){const _0x38de64=_0x548941;return db['IntegrationReport']['describe']()[_0x38de64('0x11')](respondWithResult(_0x49fa7d,null))['catch'](handleError(_0x49fa7d,null));};
\ No newline at end of file