Built motion from commit aab208717af8d15f4fa224cdb6a202877019af9b. Version 3.0.0...
[motion-next.git] / server / api / faxApplication / faxApplication.controller.js
index 5c7da30..4528dc4 100644 (file)
@@ -1 +1 @@
-const a193_0x1389=['../../components/parsers/qs','length','intersection','body','offset','order','model','undefined','map','sequelize','create','key','filter','catch','destroy','set','sendStatus','include','includeAll','params','then','lodash','like','api','index','name','json','FaxApplication','count','findAll','error','rows','VIRTUAL','type','where','options','filters','../../config/logger','fields','merge','attributes','rawAttributes','../../mysqldb','status','keys','pick','limit','stack','findOne','send','query','sort'];(function(_0x2f8b60,_0x138996){const _0x22def7=function(_0x58cd4e){while(--_0x58cd4e){_0x2f8b60['push'](_0x2f8b60['shift']());}};_0x22def7(++_0x138996);}(a193_0x1389,0x1e0));const a193_0x22de=function(_0x2f8b60,_0x138996){_0x2f8b60=_0x2f8b60-0x0;let _0x22def7=a193_0x1389[_0x2f8b60];return _0x22def7;};const _0x594dcb=a193_0x22de;'use strict';const _=require(_0x594dcb('0x9')),qs=require(_0x594dcb('0x28')),logger=require(_0x594dcb('0x19'))(_0x594dcb('0xb')),db=require(_0x594dcb('0x1e'))['db'],{Op}=require(_0x594dcb('0x31'));function respondWithResult(_0x58cd4e,_0x27e42e){return _0x27e42e=_0x27e42e||0xc8,function(_0x5f3b23){const _0x38d4ca=a193_0x22de;if(_0x5f3b23)return _0x58cd4e['status'](_0x27e42e)[_0x38d4ca('0xe')](_0x5f3b23);};}function respondWithFilteredResult(_0x287ed6,_0x27092a){return function(_0x5701b1){const _0x228159=a193_0x22de;if(_0x5701b1){const _0x28d814=_0x5701b1[_0x228159('0x10')],_0x4fbbbe=_0x27092a['offset'];let _0x290382=_0x27092a[_0x228159('0x2c')]+_0x27092a[_0x228159('0x22')],_0x37e0f7;return _0x290382>=_0x28d814?(_0x290382=_0x28d814,_0x37e0f7=0xc8):_0x37e0f7=0xce,_0x287ed6[_0x228159('0x1f')](_0x37e0f7),_0x287ed6[_0x228159('0x3')]('Content-Range',_0x4fbbbe+'-'+_0x290382+'/'+_0x28d814)[_0x228159('0xe')](_0x5701b1);}return null;};}function saveUpdates(_0x9c7f49){return function(_0x1d1e6e){const _0x2cd889=a193_0x22de;if(_0x1d1e6e)return _0x1d1e6e['update'](_0x9c7f49)[_0x2cd889('0x8')](function(_0x2dd383){return _0x2dd383;});return null;};}function removeEntity(_0x2dff39){return function(_0x27be39){const _0x4665e6=a193_0x22de;if(_0x27be39)return _0x27be39[_0x4665e6('0x2')]()[_0x4665e6('0x8')](function(){const _0x49ce2b=_0x4665e6;_0x2dff39[_0x49ce2b('0x1f')](0xcc)['end']();});};}function handleEntityNotFound(_0x2d3c1b){return function(_0x3b090c){const _0x3a9cb1=a193_0x22de;return!_0x3b090c&&_0x2d3c1b[_0x3a9cb1('0x4')](0x194),_0x3b090c;};}function handleError(_0x126a58,_0x2b4fb9){return _0x2b4fb9=_0x2b4fb9||0x1f4,function(_0x2b4543){const _0x3e8ab6=a193_0x22de;logger[_0x3e8ab6('0x12')](_0x2b4543[_0x3e8ab6('0x23')]),_0x2b4543[_0x3e8ab6('0xd')]&&delete _0x2b4543[_0x3e8ab6('0xd')],_0x126a58[_0x3e8ab6('0x1f')](_0x2b4fb9)[_0x3e8ab6('0x25')](_0x2b4543);};}exports[_0x594dcb('0xc')]=function(_0x14afd3,_0x502318){const _0x51a557=_0x594dcb;let _0x128ce7={};const _0x53489e={},_0x3653d3={'count':0x0,'rows':[]},_0x5ed47f=_[_0x51a557('0x30')](db['FaxApplication']['rawAttributes'],function(_0x32244e){const _0x3d627e=_0x51a557;return{'name':_0x32244e['fieldName'],'type':_0x32244e[_0x3d627e('0x15')][_0x3d627e('0x33')]};});_0x53489e[_0x51a557('0x2e')]=_[_0x51a557('0x30')](_0x5ed47f,_0x51a557('0xd')),_0x53489e[_0x51a557('0x26')]=_['keys'](_0x14afd3[_0x51a557('0x26')]),_0x53489e[_0x51a557('0x18')]=_[_0x51a557('0x2a')](_0x53489e[_0x51a557('0x2e')],_0x53489e[_0x51a557('0x26')]),_0x128ce7[_0x51a557('0x1c')]=_[_0x51a557('0x2a')](_0x53489e[_0x51a557('0x2e')],qs[_0x51a557('0x1a')](_0x14afd3[_0x51a557('0x26')][_0x51a557('0x1a')])),_0x128ce7[_0x51a557('0x1c')]=_0x128ce7['attributes']['length']?_0x128ce7[_0x51a557('0x1c')]:_0x53489e[_0x51a557('0x2e')];typeof _0x14afd3[_0x51a557('0x26')]['nolimit']===_0x51a557('0x2f')&&(_0x128ce7[_0x51a557('0x22')]=qs[_0x51a557('0x22')](_0x14afd3['query'][_0x51a557('0x22')]),_0x128ce7[_0x51a557('0x2c')]=qs[_0x51a557('0x2c')](_0x14afd3[_0x51a557('0x26')]['offset']));_0x128ce7[_0x51a557('0x2d')]=qs[_0x51a557('0x27')](_0x14afd3[_0x51a557('0x26')][_0x51a557('0x27')]),_0x128ce7['where']=qs[_0x51a557('0x18')](_[_0x51a557('0x21')](_0x14afd3['query'],_0x53489e[_0x51a557('0x18')]),_0x5ed47f);_0x14afd3['query'][_0x51a557('0x0')]&&(_0x128ce7[_0x51a557('0x16')]=_['merge'](_0x128ce7[_0x51a557('0x16')],{[Op['or']]:_[_0x51a557('0x30')](_0x5ed47f,function(_0x41a71e){const _0x4cace2=_0x51a557;if(_0x41a71e[_0x4cace2('0x15')]!==_0x4cace2('0x14')){const _0xece8f4={};return _0xece8f4[_0x41a71e[_0x4cace2('0xd')]]={[Op[_0x4cace2('0xa')]]:'%'+_0x14afd3['query'][_0x4cace2('0x0')]+'%'},_0xece8f4;}})}));_0x128ce7=_[_0x51a557('0x1b')]({},_0x128ce7,_0x14afd3[_0x51a557('0x17')]);const _0x3cbd07={'where':_0x128ce7[_0x51a557('0x16')]};return db['FaxApplication'][_0x51a557('0x10')](_0x3cbd07)[_0x51a557('0x8')](function(_0x1a62e4){const _0x2fbf7f=_0x51a557;return _0x3653d3['count']=_0x1a62e4,_0x14afd3[_0x2fbf7f('0x26')][_0x2fbf7f('0x6')]&&(_0x128ce7[_0x2fbf7f('0x5')]=[{'all':!![]}]),db['FaxApplication'][_0x2fbf7f('0x11')](_0x128ce7);})[_0x51a557('0x8')](function(_0x52fb3b){const _0x19a45e=_0x51a557;return _0x3653d3[_0x19a45e('0x13')]=_0x52fb3b,_0x3653d3;})[_0x51a557('0x8')](respondWithFilteredResult(_0x502318,_0x128ce7))[_0x51a557('0x1')](handleError(_0x502318,null));},exports['show']=function(_0x3bbadd,_0xd344cd){const _0x40b67b=_0x594dcb;let _0x45c54d={'raw':!![],'where':{'id':_0x3bbadd[_0x40b67b('0x7')]['id']}};const _0x541c66={};return _0x541c66[_0x40b67b('0x2e')]=_[_0x40b67b('0x20')](db['FaxApplication'][_0x40b67b('0x1d')]),_0x541c66['query']=_[_0x40b67b('0x20')](_0x3bbadd[_0x40b67b('0x26')]),_0x541c66[_0x40b67b('0x18')]=_[_0x40b67b('0x2a')](_0x541c66['model'],_0x541c66[_0x40b67b('0x26')]),_0x45c54d[_0x40b67b('0x1c')]=_[_0x40b67b('0x2a')](_0x541c66[_0x40b67b('0x2e')],qs[_0x40b67b('0x1a')](_0x3bbadd[_0x40b67b('0x26')][_0x40b67b('0x1a')])),_0x45c54d[_0x40b67b('0x1c')]=_0x45c54d[_0x40b67b('0x1c')][_0x40b67b('0x29')]?_0x45c54d['attributes']:_0x541c66['model'],_0x3bbadd[_0x40b67b('0x26')]['includeAll']&&(_0x45c54d[_0x40b67b('0x5')]=[{'all':!![]}]),_0x45c54d=_['merge']({},_0x45c54d,_0x3bbadd[_0x40b67b('0x17')]),db[_0x40b67b('0xf')][_0x40b67b('0x24')](_0x45c54d)['then'](handleEntityNotFound(_0xd344cd,null))[_0x40b67b('0x8')](respondWithResult(_0xd344cd,null))[_0x40b67b('0x1')](handleError(_0xd344cd,null));},exports['create']=function(_0x392338,_0x183085){const _0x4b2f04=_0x594dcb;return db[_0x4b2f04('0xf')][_0x4b2f04('0x32')](_0x392338[_0x4b2f04('0x2b')],{})[_0x4b2f04('0x8')](respondWithResult(_0x183085,0xc9))[_0x4b2f04('0x1')](handleError(_0x183085,null));},exports['update']=function(_0x36988c,_0x557196){const _0x495a02=_0x594dcb;return _0x36988c[_0x495a02('0x2b')]['id']&&delete _0x36988c[_0x495a02('0x2b')]['id'],db[_0x495a02('0xf')]['findOne']({'where':{'id':_0x36988c[_0x495a02('0x7')]['id']}})[_0x495a02('0x8')](handleEntityNotFound(_0x557196,null))[_0x495a02('0x8')](saveUpdates(_0x36988c[_0x495a02('0x2b')],null))[_0x495a02('0x8')](respondWithResult(_0x557196,null))[_0x495a02('0x1')](handleError(_0x557196,null));},exports[_0x594dcb('0x2')]=function(_0x4a7fff,_0x3cf646){const _0x161bed=_0x594dcb;return db[_0x161bed('0xf')][_0x161bed('0x24')]({'where':{'id':_0x4a7fff[_0x161bed('0x7')]['id']}})['then'](handleEntityNotFound(_0x3cf646,null))[_0x161bed('0x8')](removeEntity(_0x3cf646,null))[_0x161bed('0x1')](handleError(_0x3cf646,null));};
\ No newline at end of file
+const a193_0x55b4=['body','length','then','name','rows','merge','../../mysqldb','pick','show','fieldName','Content-Range','offset','count','nolimit','index','filters','includeAll','options','map','key','attributes','api','sequelize','update','end','params','undefined','status','include','set','type','model','findAll','../../components/parsers/qs','order','findOne','filter','sort','lodash','FaxApplication','json','like','send','create','rawAttributes','../../config/logger','where','fields','query','destroy','limit','intersection','catch','keys'];(function(_0x5081c3,_0x55b4f2){const _0x22f5ec=function(_0x4ac8e0){while(--_0x4ac8e0){_0x5081c3['push'](_0x5081c3['shift']());}};_0x22f5ec(++_0x55b4f2);}(a193_0x55b4,0x1c0));const a193_0x22f5=function(_0x5081c3,_0x55b4f2){_0x5081c3=_0x5081c3-0x0;let _0x22f5ec=a193_0x55b4[_0x5081c3];return _0x22f5ec;};const _0x7a8215=a193_0x22f5;'use strict';const _=require(_0x7a8215('0x16')),qs=require(_0x7a8215('0x11')),logger=require(_0x7a8215('0x1d'))(_0x7a8215('0x5')),db=require(_0x7a8215('0x2c'))['db'],{Op}=require(_0x7a8215('0x6'));function respondWithResult(_0x4ac8e0,_0xfb4255){return _0xfb4255=_0xfb4255||0xc8,function(_0x25456a){const _0xdd56f0=a193_0x22f5;if(_0x25456a)return _0x4ac8e0['status'](_0xfb4255)[_0xdd56f0('0x18')](_0x25456a);};}function respondWithFilteredResult(_0x5eae52,_0x3be936){return function(_0x3187fb){const _0x97fe04=a193_0x22f5;if(_0x3187fb){const _0x4e75c4=_0x3187fb[_0x97fe04('0x32')],_0xc10504=_0x3be936[_0x97fe04('0x31')];let _0x14725d=_0x3be936[_0x97fe04('0x31')]+_0x3be936[_0x97fe04('0x22')],_0xe84bf3;return _0x14725d>=_0x4e75c4?(_0x14725d=_0x4e75c4,_0xe84bf3=0xc8):_0xe84bf3=0xce,_0x5eae52[_0x97fe04('0xb')](_0xe84bf3),_0x5eae52[_0x97fe04('0xd')](_0x97fe04('0x30'),_0xc10504+'-'+_0x14725d+'/'+_0x4e75c4)[_0x97fe04('0x18')](_0x3187fb);}return null;};}function saveUpdates(_0x114ef2){return function(_0x41b626){const _0x42e8aa=a193_0x22f5;if(_0x41b626)return _0x41b626[_0x42e8aa('0x7')](_0x114ef2)[_0x42e8aa('0x28')](function(_0xb26ace){return _0xb26ace;});return null;};}function removeEntity(_0x55bb13){return function(_0x288f23){const _0x47f05e=a193_0x22f5;if(_0x288f23)return _0x288f23[_0x47f05e('0x21')]()[_0x47f05e('0x28')](function(){const _0x3dcb39=_0x47f05e;_0x55bb13[_0x3dcb39('0xb')](0xcc)[_0x3dcb39('0x8')]();});};}function handleEntityNotFound(_0x453ddf){return function(_0x2ba1e1){return!_0x2ba1e1&&_0x453ddf['sendStatus'](0x194),_0x2ba1e1;};}function handleError(_0x267cac,_0x560d8a){return _0x560d8a=_0x560d8a||0x1f4,function(_0x429ccd){const _0x1034a0=a193_0x22f5;logger['error'](_0x429ccd['stack']),_0x429ccd[_0x1034a0('0x29')]&&delete _0x429ccd[_0x1034a0('0x29')],_0x267cac[_0x1034a0('0xb')](_0x560d8a)[_0x1034a0('0x1a')](_0x429ccd);};}exports[_0x7a8215('0x34')]=function(_0x4f484f,_0x1c01e9){const _0x5a2392=_0x7a8215;let _0x420a5c={};const _0x45cd2d={},_0x14e049={'count':0x0,'rows':[]},_0x373858=_[_0x5a2392('0x2')](db[_0x5a2392('0x17')][_0x5a2392('0x1c')],function(_0x42a730){const _0x47667c=_0x5a2392;return{'name':_0x42a730[_0x47667c('0x2f')],'type':_0x42a730[_0x47667c('0xe')][_0x47667c('0x3')]};});_0x45cd2d['model']=_['map'](_0x373858,'name'),_0x45cd2d[_0x5a2392('0x20')]=_[_0x5a2392('0x25')](_0x4f484f[_0x5a2392('0x20')]),_0x45cd2d[_0x5a2392('0x35')]=_[_0x5a2392('0x23')](_0x45cd2d['model'],_0x45cd2d[_0x5a2392('0x20')]),_0x420a5c[_0x5a2392('0x4')]=_[_0x5a2392('0x23')](_0x45cd2d['model'],qs[_0x5a2392('0x1f')](_0x4f484f[_0x5a2392('0x20')][_0x5a2392('0x1f')])),_0x420a5c[_0x5a2392('0x4')]=_0x420a5c[_0x5a2392('0x4')]['length']?_0x420a5c[_0x5a2392('0x4')]:_0x45cd2d[_0x5a2392('0xf')];typeof _0x4f484f[_0x5a2392('0x20')][_0x5a2392('0x33')]===_0x5a2392('0xa')&&(_0x420a5c[_0x5a2392('0x22')]=qs['limit'](_0x4f484f[_0x5a2392('0x20')]['limit']),_0x420a5c[_0x5a2392('0x31')]=qs[_0x5a2392('0x31')](_0x4f484f[_0x5a2392('0x20')]['offset']));_0x420a5c[_0x5a2392('0x12')]=qs[_0x5a2392('0x15')](_0x4f484f[_0x5a2392('0x20')][_0x5a2392('0x15')]),_0x420a5c['where']=qs[_0x5a2392('0x35')](_[_0x5a2392('0x2d')](_0x4f484f[_0x5a2392('0x20')],_0x45cd2d[_0x5a2392('0x35')]),_0x373858);_0x4f484f[_0x5a2392('0x20')][_0x5a2392('0x14')]&&(_0x420a5c['where']=_[_0x5a2392('0x2b')](_0x420a5c[_0x5a2392('0x1e')],{[Op['or']]:_[_0x5a2392('0x2')](_0x373858,function(_0x6dbef5){const _0x116fb4=_0x5a2392;if(_0x6dbef5[_0x116fb4('0xe')]!=='VIRTUAL'){const _0x52d708={};return _0x52d708[_0x6dbef5[_0x116fb4('0x29')]]={[Op[_0x116fb4('0x19')]]:'%'+_0x4f484f['query'][_0x116fb4('0x14')]+'%'},_0x52d708;}})}));_0x420a5c=_['merge']({},_0x420a5c,_0x4f484f[_0x5a2392('0x1')]);const _0x28e74f={'where':_0x420a5c['where']};return db[_0x5a2392('0x17')][_0x5a2392('0x32')](_0x28e74f)[_0x5a2392('0x28')](function(_0x29b4f7){const _0x59a6d4=_0x5a2392;return _0x14e049['count']=_0x29b4f7,_0x4f484f[_0x59a6d4('0x20')]['includeAll']&&(_0x420a5c['include']=[{'all':!![]}]),db[_0x59a6d4('0x17')][_0x59a6d4('0x10')](_0x420a5c);})['then'](function(_0x5eca21){const _0x65df67=_0x5a2392;return _0x14e049[_0x65df67('0x2a')]=_0x5eca21,_0x14e049;})['then'](respondWithFilteredResult(_0x1c01e9,_0x420a5c))['catch'](handleError(_0x1c01e9,null));},exports[_0x7a8215('0x2e')]=function(_0x16760b,_0x171b56){const _0x1320ed=_0x7a8215;let _0x191bb7={'raw':!![],'where':{'id':_0x16760b['params']['id']}};const _0x359990={};return _0x359990[_0x1320ed('0xf')]=_[_0x1320ed('0x25')](db[_0x1320ed('0x17')][_0x1320ed('0x1c')]),_0x359990[_0x1320ed('0x20')]=_[_0x1320ed('0x25')](_0x16760b[_0x1320ed('0x20')]),_0x359990['filters']=_[_0x1320ed('0x23')](_0x359990['model'],_0x359990['query']),_0x191bb7[_0x1320ed('0x4')]=_[_0x1320ed('0x23')](_0x359990['model'],qs['fields'](_0x16760b[_0x1320ed('0x20')][_0x1320ed('0x1f')])),_0x191bb7['attributes']=_0x191bb7[_0x1320ed('0x4')][_0x1320ed('0x27')]?_0x191bb7[_0x1320ed('0x4')]:_0x359990[_0x1320ed('0xf')],_0x16760b[_0x1320ed('0x20')][_0x1320ed('0x0')]&&(_0x191bb7[_0x1320ed('0xc')]=[{'all':!![]}]),_0x191bb7=_[_0x1320ed('0x2b')]({},_0x191bb7,_0x16760b[_0x1320ed('0x1')]),db[_0x1320ed('0x17')][_0x1320ed('0x13')](_0x191bb7)[_0x1320ed('0x28')](handleEntityNotFound(_0x171b56,null))[_0x1320ed('0x28')](respondWithResult(_0x171b56,null))[_0x1320ed('0x24')](handleError(_0x171b56,null));},exports[_0x7a8215('0x1b')]=function(_0x222e73,_0x46fc85){const _0x453345=_0x7a8215;return db[_0x453345('0x17')]['create'](_0x222e73[_0x453345('0x26')],{})[_0x453345('0x28')](respondWithResult(_0x46fc85,0xc9))[_0x453345('0x24')](handleError(_0x46fc85,null));},exports['update']=function(_0x17b268,_0x3e1532){const _0x3961e9=_0x7a8215;return _0x17b268[_0x3961e9('0x26')]['id']&&delete _0x17b268[_0x3961e9('0x26')]['id'],db['FaxApplication'][_0x3961e9('0x13')]({'where':{'id':_0x17b268[_0x3961e9('0x9')]['id']}})[_0x3961e9('0x28')](handleEntityNotFound(_0x3e1532,null))[_0x3961e9('0x28')](saveUpdates(_0x17b268['body'],null))['then'](respondWithResult(_0x3e1532,null))[_0x3961e9('0x24')](handleError(_0x3e1532,null));},exports['destroy']=function(_0x2a4eb7,_0x57a313){const _0x2e366e=_0x7a8215;return db[_0x2e366e('0x17')][_0x2e366e('0x13')]({'where':{'id':_0x2a4eb7[_0x2e366e('0x9')]['id']}})[_0x2e366e('0x28')](handleEntityNotFound(_0x57a313,null))[_0x2e366e('0x28')](removeEntity(_0x57a313,null))[_0x2e366e('0x24')](handleError(_0x57a313,null));};
\ No newline at end of file