Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / faxApplication / faxApplication.controller.js
index 1f29dc0..90176a5 100644 (file)
@@ -1 +1 @@
-const a193_0x259a=['../../mysqldb','include','error','send','name','findOne','FaxApplication','undefined','merge','then','VIRTUAL','set','filters','destroy','type','body','attributes','key','count','show','nolimit','includeAll','model','sendStatus','stack','options','filter','order','like','update','sequelize','catch','end','status','sort','limit','map','where','rawAttributes','offset','rows','Content-Range','query','fields','json','keys','length','params','intersection','pick'];(function(_0x40a797,_0x259ad4){const _0x2c9bf2=function(_0x469afa){while(--_0x469afa){_0x40a797['push'](_0x40a797['shift']());}};_0x2c9bf2(++_0x259ad4);}(a193_0x259a,0x166));const a193_0x2c9b=function(_0x40a797,_0x259ad4){_0x40a797=_0x40a797-0x0;let _0x2c9bf2=a193_0x259a[_0x40a797];return _0x2c9bf2;};const _0x2dfb5e=a193_0x2c9b;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')('api'),db=require(_0x2dfb5e('0x2a'))['db'],{Op}=require(_0x2dfb5e('0x16'));function respondWithResult(_0x469afa,_0x1bd8c3){return _0x1bd8c3=_0x1bd8c3||0xc8,function(_0x3b171a){const _0x47d61a=a193_0x2c9b;if(_0x3b171a)return _0x469afa[_0x47d61a('0x19')](_0x1bd8c3)['json'](_0x3b171a);};}function respondWithFilteredResult(_0x39c7ad,_0x10860b){return function(_0x1a4a7b){const _0x5d279a=a193_0x2c9b;if(_0x1a4a7b){const _0x5787c3=_0x1a4a7b[_0x5d279a('0xa')],_0x12dc82=_0x10860b[_0x5d279a('0x1f')];let _0x2eedd3=_0x10860b[_0x5d279a('0x1f')]+_0x10860b[_0x5d279a('0x1b')],_0x4bc0f9;return _0x2eedd3>=_0x5787c3?(_0x2eedd3=_0x5787c3,_0x4bc0f9=0xc8):_0x4bc0f9=0xce,_0x39c7ad[_0x5d279a('0x19')](_0x4bc0f9),_0x39c7ad[_0x5d279a('0x3')](_0x5d279a('0x21'),_0x12dc82+'-'+_0x2eedd3+'/'+_0x5787c3)[_0x5d279a('0x24')](_0x1a4a7b);}return null;};}function saveUpdates(_0xda7f46){return function(_0x3b20f7){const _0x2e36d8=a193_0x2c9b;if(_0x3b20f7)return _0x3b20f7[_0x2e36d8('0x15')](_0xda7f46)[_0x2e36d8('0x1')](function(_0x758b9d){return _0x758b9d;});return null;};}function removeEntity(_0x4c4a05){return function(_0x5db762){const _0x146ad2=a193_0x2c9b;if(_0x5db762)return _0x5db762[_0x146ad2('0x5')]()[_0x146ad2('0x1')](function(){const _0x1000aa=_0x146ad2;_0x4c4a05[_0x1000aa('0x19')](0xcc)[_0x1000aa('0x18')]();});};}function handleEntityNotFound(_0x378f7f){return function(_0x38464c){const _0x4c8bc1=a193_0x2c9b;return!_0x38464c&&_0x378f7f[_0x4c8bc1('0xf')](0x194),_0x38464c;};}function handleError(_0x19234a,_0x1fa06c){return _0x1fa06c=_0x1fa06c||0x1f4,function(_0x18cbe3){const _0x3690a9=a193_0x2c9b;logger[_0x3690a9('0x2c')](_0x18cbe3[_0x3690a9('0x10')]),_0x18cbe3[_0x3690a9('0x2e')]&&delete _0x18cbe3['name'],_0x19234a[_0x3690a9('0x19')](_0x1fa06c)[_0x3690a9('0x2d')](_0x18cbe3);};}exports['index']=function(_0x3603a0,_0xfd5fa5){const _0xb3c08f=_0x2dfb5e;let _0x5b1478={};const _0x4502ee={},_0x36b7fc={'count':0x0,'rows':[]},_0x2983ec=_[_0xb3c08f('0x1c')](db[_0xb3c08f('0x30')][_0xb3c08f('0x1e')],function(_0x542980){const _0x2257f9=_0xb3c08f;return{'name':_0x542980['fieldName'],'type':_0x542980[_0x2257f9('0x6')][_0x2257f9('0x9')]};});_0x4502ee['model']=_['map'](_0x2983ec,_0xb3c08f('0x2e')),_0x4502ee[_0xb3c08f('0x22')]=_[_0xb3c08f('0x25')](_0x3603a0[_0xb3c08f('0x22')]),_0x4502ee[_0xb3c08f('0x4')]=_[_0xb3c08f('0x28')](_0x4502ee[_0xb3c08f('0xe')],_0x4502ee[_0xb3c08f('0x22')]),_0x5b1478[_0xb3c08f('0x8')]=_[_0xb3c08f('0x28')](_0x4502ee[_0xb3c08f('0xe')],qs['fields'](_0x3603a0[_0xb3c08f('0x22')]['fields'])),_0x5b1478['attributes']=_0x5b1478['attributes'][_0xb3c08f('0x26')]?_0x5b1478[_0xb3c08f('0x8')]:_0x4502ee[_0xb3c08f('0xe')];typeof _0x3603a0['query'][_0xb3c08f('0xc')]===_0xb3c08f('0x31')&&(_0x5b1478['limit']=qs[_0xb3c08f('0x1b')](_0x3603a0['query'][_0xb3c08f('0x1b')]),_0x5b1478[_0xb3c08f('0x1f')]=qs['offset'](_0x3603a0[_0xb3c08f('0x22')]['offset']));_0x5b1478[_0xb3c08f('0x13')]=qs[_0xb3c08f('0x1a')](_0x3603a0[_0xb3c08f('0x22')][_0xb3c08f('0x1a')]),_0x5b1478['where']=qs[_0xb3c08f('0x4')](_[_0xb3c08f('0x29')](_0x3603a0['query'],_0x4502ee[_0xb3c08f('0x4')]),_0x2983ec);_0x3603a0['query'][_0xb3c08f('0x12')]&&(_0x5b1478['where']=_['merge'](_0x5b1478['where'],{[Op['or']]:_[_0xb3c08f('0x1c')](_0x2983ec,function(_0x752d1e){const _0x12ec55=_0xb3c08f;if(_0x752d1e[_0x12ec55('0x6')]!==_0x12ec55('0x2')){const _0x68ba6c={};return _0x68ba6c[_0x752d1e['name']]={[Op[_0x12ec55('0x14')]]:'%'+_0x3603a0[_0x12ec55('0x22')][_0x12ec55('0x12')]+'%'},_0x68ba6c;}})}));_0x5b1478=_[_0xb3c08f('0x0')]({},_0x5b1478,_0x3603a0[_0xb3c08f('0x11')]);const _0x8e3472={'where':_0x5b1478[_0xb3c08f('0x1d')]};return db[_0xb3c08f('0x30')][_0xb3c08f('0xa')](_0x8e3472)[_0xb3c08f('0x1')](function(_0xa3878a){const _0x4b499f=_0xb3c08f;return _0x36b7fc[_0x4b499f('0xa')]=_0xa3878a,_0x3603a0['query'][_0x4b499f('0xd')]&&(_0x5b1478[_0x4b499f('0x2b')]=[{'all':!![]}]),db[_0x4b499f('0x30')]['findAll'](_0x5b1478);})[_0xb3c08f('0x1')](function(_0x255e89){const _0x80ce60=_0xb3c08f;return _0x36b7fc[_0x80ce60('0x20')]=_0x255e89,_0x36b7fc;})['then'](respondWithFilteredResult(_0xfd5fa5,_0x5b1478))[_0xb3c08f('0x17')](handleError(_0xfd5fa5,null));},exports[_0x2dfb5e('0xb')]=function(_0x4e558c,_0x34430b){const _0x2ee2b2=_0x2dfb5e;let _0x2c47f9={'raw':!![],'where':{'id':_0x4e558c[_0x2ee2b2('0x27')]['id']}};const _0x2231e2={};return _0x2231e2[_0x2ee2b2('0xe')]=_[_0x2ee2b2('0x25')](db['FaxApplication'][_0x2ee2b2('0x1e')]),_0x2231e2[_0x2ee2b2('0x22')]=_[_0x2ee2b2('0x25')](_0x4e558c['query']),_0x2231e2[_0x2ee2b2('0x4')]=_[_0x2ee2b2('0x28')](_0x2231e2[_0x2ee2b2('0xe')],_0x2231e2[_0x2ee2b2('0x22')]),_0x2c47f9['attributes']=_['intersection'](_0x2231e2[_0x2ee2b2('0xe')],qs[_0x2ee2b2('0x23')](_0x4e558c[_0x2ee2b2('0x22')][_0x2ee2b2('0x23')])),_0x2c47f9[_0x2ee2b2('0x8')]=_0x2c47f9[_0x2ee2b2('0x8')][_0x2ee2b2('0x26')]?_0x2c47f9[_0x2ee2b2('0x8')]:_0x2231e2[_0x2ee2b2('0xe')],_0x4e558c[_0x2ee2b2('0x22')][_0x2ee2b2('0xd')]&&(_0x2c47f9[_0x2ee2b2('0x2b')]=[{'all':!![]}]),_0x2c47f9=_[_0x2ee2b2('0x0')]({},_0x2c47f9,_0x4e558c[_0x2ee2b2('0x11')]),db[_0x2ee2b2('0x30')][_0x2ee2b2('0x2f')](_0x2c47f9)[_0x2ee2b2('0x1')](handleEntityNotFound(_0x34430b,null))[_0x2ee2b2('0x1')](respondWithResult(_0x34430b,null))[_0x2ee2b2('0x17')](handleError(_0x34430b,null));},exports['create']=function(_0xd5b1c3,_0x4b8815){const _0x530405=_0x2dfb5e;return db[_0x530405('0x30')]['create'](_0xd5b1c3[_0x530405('0x7')],{})[_0x530405('0x1')](respondWithResult(_0x4b8815,0xc9))[_0x530405('0x17')](handleError(_0x4b8815,null));},exports[_0x2dfb5e('0x15')]=function(_0x53e87a,_0x7d28c5){const _0x315142=_0x2dfb5e;return _0x53e87a[_0x315142('0x7')]['id']&&delete _0x53e87a['body']['id'],db['FaxApplication'][_0x315142('0x2f')]({'where':{'id':_0x53e87a[_0x315142('0x27')]['id']}})[_0x315142('0x1')](handleEntityNotFound(_0x7d28c5,null))[_0x315142('0x1')](saveUpdates(_0x53e87a[_0x315142('0x7')],null))[_0x315142('0x1')](respondWithResult(_0x7d28c5,null))[_0x315142('0x17')](handleError(_0x7d28c5,null));},exports[_0x2dfb5e('0x5')]=function(_0x1b9b57,_0x3b9f70){const _0x208f95=_0x2dfb5e;return db['FaxApplication'][_0x208f95('0x2f')]({'where':{'id':_0x1b9b57[_0x208f95('0x27')]['id']}})[_0x208f95('0x1')](handleEntityNotFound(_0x3b9f70,null))[_0x208f95('0x1')](removeEntity(_0x3b9f70,null))[_0x208f95('0x17')](handleError(_0x3b9f70,null));};
\ No newline at end of file
+const a193_0x211b=['FaxApplication','filter','send','nolimit','count','filters','keys','catch','map','body','intersection','includeAll','set','update','sequelize','create','offset','end','destroy','attributes','rows','json','show','../../mysqldb','status','rawAttributes','fieldName','options','name','Content-Range','where','include','error','query','key','limit','../../config/logger','model','findOne','../../components/parsers/qs','fields','params','type','index','sort','merge','api','length','sendStatus','then'];(function(_0x408dc1,_0x211bfb){const _0x20d065=function(_0x274c54){while(--_0x274c54){_0x408dc1['push'](_0x408dc1['shift']());}};_0x20d065(++_0x211bfb);}(a193_0x211b,0x145));const a193_0x20d0=function(_0x408dc1,_0x211bfb){_0x408dc1=_0x408dc1-0x0;let _0x20d065=a193_0x211b[_0x408dc1];return _0x20d065;};const _0x389db7=a193_0x20d0;'use strict';const _=require('lodash'),qs=require(_0x389db7('0xe')),logger=require(_0x389db7('0xb'))(_0x389db7('0x15')),db=require(_0x389db7('0x30'))['db'],{Op}=require(_0x389db7('0x27'));function respondWithResult(_0x274c54,_0x5ecd61){return _0x5ecd61=_0x5ecd61||0xc8,function(_0x3effcc){const _0x1173c8=a193_0x20d0;if(_0x3effcc)return _0x274c54['status'](_0x5ecd61)[_0x1173c8('0x2e')](_0x3effcc);};}function respondWithFilteredResult(_0x43fb13,_0x13d3fb){return function(_0x50cf7b){const _0x3044f7=a193_0x20d0;if(_0x50cf7b){const _0x492227=_0x50cf7b[_0x3044f7('0x1d')],_0x4e5a8a=_0x13d3fb[_0x3044f7('0x29')];let _0x45c52a=_0x13d3fb[_0x3044f7('0x29')]+_0x13d3fb['limit'],_0x194908;return _0x45c52a>=_0x492227?(_0x45c52a=_0x492227,_0x194908=0xc8):_0x194908=0xce,_0x43fb13[_0x3044f7('0x31')](_0x194908),_0x43fb13[_0x3044f7('0x25')](_0x3044f7('0x4'),_0x4e5a8a+'-'+_0x45c52a+'/'+_0x492227)[_0x3044f7('0x2e')](_0x50cf7b);}return null;};}function saveUpdates(_0x46d089){return function(_0x475422){const _0x3e1d51=a193_0x20d0;if(_0x475422)return _0x475422['update'](_0x46d089)[_0x3e1d51('0x18')](function(_0x58f51c){return _0x58f51c;});return null;};}function removeEntity(_0xadeb2b){return function(_0x41d93f){const _0x13bf76=a193_0x20d0;if(_0x41d93f)return _0x41d93f[_0x13bf76('0x2b')]()[_0x13bf76('0x18')](function(){const _0x4f4a99=_0x13bf76;_0xadeb2b['status'](0xcc)[_0x4f4a99('0x2a')]();});};}function handleEntityNotFound(_0x94be40){return function(_0x2d0713){const _0xcbe44d=a193_0x20d0;return!_0x2d0713&&_0x94be40[_0xcbe44d('0x17')](0x194),_0x2d0713;};}function handleError(_0x556c9f,_0x356c73){return _0x356c73=_0x356c73||0x1f4,function(_0x5cbda2){const _0x26f174=a193_0x20d0;logger[_0x26f174('0x7')](_0x5cbda2['stack']),_0x5cbda2['name']&&delete _0x5cbda2[_0x26f174('0x3')],_0x556c9f['status'](_0x356c73)[_0x26f174('0x1b')](_0x5cbda2);};}exports[_0x389db7('0x12')]=function(_0x353dee,_0x3252b1){const _0x3a25c1=_0x389db7;let _0x14ae42={};const _0x15bd2c={},_0x413307={'count':0x0,'rows':[]},_0x233bf9=_['map'](db[_0x3a25c1('0x19')][_0x3a25c1('0x0')],function(_0x503d4){const _0x5c2648=_0x3a25c1;return{'name':_0x503d4[_0x5c2648('0x1')],'type':_0x503d4[_0x5c2648('0x11')][_0x5c2648('0x9')]};});_0x15bd2c[_0x3a25c1('0xc')]=_[_0x3a25c1('0x21')](_0x233bf9,_0x3a25c1('0x3')),_0x15bd2c[_0x3a25c1('0x8')]=_['keys'](_0x353dee[_0x3a25c1('0x8')]),_0x15bd2c['filters']=_['intersection'](_0x15bd2c['model'],_0x15bd2c[_0x3a25c1('0x8')]),_0x14ae42[_0x3a25c1('0x2c')]=_['intersection'](_0x15bd2c[_0x3a25c1('0xc')],qs['fields'](_0x353dee[_0x3a25c1('0x8')][_0x3a25c1('0xf')])),_0x14ae42[_0x3a25c1('0x2c')]=_0x14ae42[_0x3a25c1('0x2c')][_0x3a25c1('0x16')]?_0x14ae42['attributes']:_0x15bd2c['model'];typeof _0x353dee['query'][_0x3a25c1('0x1c')]==='undefined'&&(_0x14ae42[_0x3a25c1('0xa')]=qs[_0x3a25c1('0xa')](_0x353dee['query'][_0x3a25c1('0xa')]),_0x14ae42[_0x3a25c1('0x29')]=qs[_0x3a25c1('0x29')](_0x353dee[_0x3a25c1('0x8')][_0x3a25c1('0x29')]));_0x14ae42['order']=qs[_0x3a25c1('0x13')](_0x353dee[_0x3a25c1('0x8')][_0x3a25c1('0x13')]),_0x14ae42[_0x3a25c1('0x5')]=qs[_0x3a25c1('0x1e')](_['pick'](_0x353dee[_0x3a25c1('0x8')],_0x15bd2c[_0x3a25c1('0x1e')]),_0x233bf9);_0x353dee['query'][_0x3a25c1('0x1a')]&&(_0x14ae42[_0x3a25c1('0x5')]=_[_0x3a25c1('0x14')](_0x14ae42[_0x3a25c1('0x5')],{[Op['or']]:_[_0x3a25c1('0x21')](_0x233bf9,function(_0x996b89){const _0x487ce8=_0x3a25c1;if(_0x996b89[_0x487ce8('0x11')]!=='VIRTUAL'){const _0x3f7130={};return _0x3f7130[_0x996b89[_0x487ce8('0x3')]]={[Op['like']]:'%'+_0x353dee[_0x487ce8('0x8')][_0x487ce8('0x1a')]+'%'},_0x3f7130;}})}));_0x14ae42=_[_0x3a25c1('0x14')]({},_0x14ae42,_0x353dee[_0x3a25c1('0x2')]);const _0x25f32b={'where':_0x14ae42['where']};return db[_0x3a25c1('0x19')][_0x3a25c1('0x1d')](_0x25f32b)[_0x3a25c1('0x18')](function(_0x4f9310){const _0x5273bc=_0x3a25c1;return _0x413307[_0x5273bc('0x1d')]=_0x4f9310,_0x353dee[_0x5273bc('0x8')][_0x5273bc('0x24')]&&(_0x14ae42['include']=[{'all':!![]}]),db[_0x5273bc('0x19')]['findAll'](_0x14ae42);})[_0x3a25c1('0x18')](function(_0x56f853){const _0x4bf0a9=_0x3a25c1;return _0x413307[_0x4bf0a9('0x2d')]=_0x56f853,_0x413307;})[_0x3a25c1('0x18')](respondWithFilteredResult(_0x3252b1,_0x14ae42))[_0x3a25c1('0x20')](handleError(_0x3252b1,null));},exports[_0x389db7('0x2f')]=function(_0x3d13db,_0x615882){const _0x2cde14=_0x389db7;let _0x4d79d1={'raw':!![],'where':{'id':_0x3d13db[_0x2cde14('0x10')]['id']}};const _0x4369cb={};return _0x4369cb[_0x2cde14('0xc')]=_['keys'](db[_0x2cde14('0x19')][_0x2cde14('0x0')]),_0x4369cb[_0x2cde14('0x8')]=_[_0x2cde14('0x1f')](_0x3d13db[_0x2cde14('0x8')]),_0x4369cb[_0x2cde14('0x1e')]=_[_0x2cde14('0x23')](_0x4369cb['model'],_0x4369cb[_0x2cde14('0x8')]),_0x4d79d1[_0x2cde14('0x2c')]=_[_0x2cde14('0x23')](_0x4369cb[_0x2cde14('0xc')],qs[_0x2cde14('0xf')](_0x3d13db[_0x2cde14('0x8')][_0x2cde14('0xf')])),_0x4d79d1[_0x2cde14('0x2c')]=_0x4d79d1[_0x2cde14('0x2c')][_0x2cde14('0x16')]?_0x4d79d1[_0x2cde14('0x2c')]:_0x4369cb[_0x2cde14('0xc')],_0x3d13db[_0x2cde14('0x8')]['includeAll']&&(_0x4d79d1[_0x2cde14('0x6')]=[{'all':!![]}]),_0x4d79d1=_[_0x2cde14('0x14')]({},_0x4d79d1,_0x3d13db[_0x2cde14('0x2')]),db['FaxApplication'][_0x2cde14('0xd')](_0x4d79d1)[_0x2cde14('0x18')](handleEntityNotFound(_0x615882,null))[_0x2cde14('0x18')](respondWithResult(_0x615882,null))[_0x2cde14('0x20')](handleError(_0x615882,null));},exports[_0x389db7('0x28')]=function(_0x5f2fe8,_0x5442f3){const _0x718dd9=_0x389db7;return db[_0x718dd9('0x19')][_0x718dd9('0x28')](_0x5f2fe8[_0x718dd9('0x22')],{})[_0x718dd9('0x18')](respondWithResult(_0x5442f3,0xc9))[_0x718dd9('0x20')](handleError(_0x5442f3,null));},exports[_0x389db7('0x26')]=function(_0x14c599,_0x49f40b){const _0x283a5e=_0x389db7;return _0x14c599['body']['id']&&delete _0x14c599['body']['id'],db['FaxApplication']['findOne']({'where':{'id':_0x14c599[_0x283a5e('0x10')]['id']}})[_0x283a5e('0x18')](handleEntityNotFound(_0x49f40b,null))[_0x283a5e('0x18')](saveUpdates(_0x14c599['body'],null))[_0x283a5e('0x18')](respondWithResult(_0x49f40b,null))['catch'](handleError(_0x49f40b,null));},exports[_0x389db7('0x2b')]=function(_0x1ce72d,_0x4ce82c){const _0x4a1ff6=_0x389db7;return db['FaxApplication'][_0x4a1ff6('0xd')]({'where':{'id':_0x1ce72d[_0x4a1ff6('0x10')]['id']}})[_0x4a1ff6('0x18')](handleEntityNotFound(_0x4ce82c,null))[_0x4a1ff6('0x18')](removeEntity(_0x4ce82c,null))[_0x4a1ff6('0x20')](handleError(_0x4ce82c,null));};
\ No newline at end of file