Built motion from commit 4a18b36e645f5fa4a517d36f9783bde259878164. Version 3.0.0...
[motion-next.git] / server / api / faxApplication / faxApplication.controller.js
index 929a814..8c46789 100644 (file)
@@ -1 +1 @@
-const a193_0x5242=['show','FaxApplication','include','body','rows','nolimit','filter','Content-Range','fields','merge','update','../../components/parsers/qs','rawAttributes','VIRTUAL','map','status','findAll','json','offset','like','keys','includeAll','fieldName','sequelize','params','length','lodash','findOne','type','model','create','index','send','key','../../mysqldb','sort','api','stack','end','set','destroy','then','where','count','name','intersection','filters','query','catch','../../config/logger','attributes','limit','error'];(function(_0x29cd39,_0x524201){const _0x3ed76f=function(_0xe75e33){while(--_0xe75e33){_0x29cd39['push'](_0x29cd39['shift']());}};_0x3ed76f(++_0x524201);}(a193_0x5242,0x13e));const a193_0x3ed7=function(_0x29cd39,_0x524201){_0x29cd39=_0x29cd39-0x0;let _0x3ed76f=a193_0x5242[_0x29cd39];return _0x3ed76f;};const _0x230f90=a193_0x3ed7;'use strict';const _=require(_0x230f90('0x1a')),qs=require(_0x230f90('0xb')),logger=require(_0x230f90('0x31'))(_0x230f90('0x24')),db=require(_0x230f90('0x22'))['db'],{Op}=require(_0x230f90('0x17'));function respondWithResult(_0xe75e33,_0x309196){return _0x309196=_0x309196||0xc8,function(_0x14a8f8){const _0x4b7873=a193_0x3ed7;if(_0x14a8f8)return _0xe75e33[_0x4b7873('0xf')](_0x309196)[_0x4b7873('0x11')](_0x14a8f8);};}function respondWithFilteredResult(_0x368ec0,_0x5323e9){return function(_0x449876){const _0x1de366=a193_0x3ed7;if(_0x449876){const _0x296403=_0x449876[_0x1de366('0x2b')],_0x9de0b6=_0x5323e9[_0x1de366('0x12')];let _0x282111=_0x5323e9[_0x1de366('0x12')]+_0x5323e9['limit'],_0x26e537;return _0x282111>=_0x296403?(_0x282111=_0x296403,_0x26e537=0xc8):_0x26e537=0xce,_0x368ec0[_0x1de366('0xf')](_0x26e537),_0x368ec0[_0x1de366('0x27')](_0x1de366('0x7'),_0x9de0b6+'-'+_0x282111+'/'+_0x296403)['json'](_0x449876);}return null;};}function saveUpdates(_0x14d7fe){return function(_0x91a13){const _0x372fd6=a193_0x3ed7;if(_0x91a13)return _0x91a13[_0x372fd6('0xa')](_0x14d7fe)[_0x372fd6('0x29')](function(_0x42711f){return _0x42711f;});return null;};}function removeEntity(_0x14af25){return function(_0x5b2cd0){const _0x5e0aa0=a193_0x3ed7;if(_0x5b2cd0)return _0x5b2cd0[_0x5e0aa0('0x28')]()[_0x5e0aa0('0x29')](function(){const _0x1554a8=_0x5e0aa0;_0x14af25['status'](0xcc)[_0x1554a8('0x26')]();});};}function handleEntityNotFound(_0x5585cb){return function(_0x2353ce){return!_0x2353ce&&_0x5585cb['sendStatus'](0x194),_0x2353ce;};}function handleError(_0x2f8a35,_0x16a5af){return _0x16a5af=_0x16a5af||0x1f4,function(_0x2fa754){const _0x4c3996=a193_0x3ed7;logger[_0x4c3996('0x34')](_0x2fa754[_0x4c3996('0x25')]),_0x2fa754[_0x4c3996('0x2c')]&&delete _0x2fa754[_0x4c3996('0x2c')],_0x2f8a35[_0x4c3996('0xf')](_0x16a5af)[_0x4c3996('0x20')](_0x2fa754);};}exports[_0x230f90('0x1f')]=function(_0x483c43,_0x285e3f){const _0x4a0fc2=_0x230f90;let _0x3a5dd1={};const _0x121365={},_0x368204={'count':0x0,'rows':[]},_0x161470=_[_0x4a0fc2('0xe')](db[_0x4a0fc2('0x1')][_0x4a0fc2('0xc')],function(_0x1d11eb){const _0x52674b=_0x4a0fc2;return{'name':_0x1d11eb[_0x52674b('0x16')],'type':_0x1d11eb[_0x52674b('0x1c')][_0x52674b('0x21')]};});_0x121365[_0x4a0fc2('0x1d')]=_[_0x4a0fc2('0xe')](_0x161470,'name'),_0x121365[_0x4a0fc2('0x2f')]=_[_0x4a0fc2('0x14')](_0x483c43[_0x4a0fc2('0x2f')]),_0x121365[_0x4a0fc2('0x2e')]=_['intersection'](_0x121365['model'],_0x121365[_0x4a0fc2('0x2f')]),_0x3a5dd1[_0x4a0fc2('0x32')]=_[_0x4a0fc2('0x2d')](_0x121365['model'],qs[_0x4a0fc2('0x8')](_0x483c43['query']['fields'])),_0x3a5dd1[_0x4a0fc2('0x32')]=_0x3a5dd1[_0x4a0fc2('0x32')][_0x4a0fc2('0x19')]?_0x3a5dd1['attributes']:_0x121365[_0x4a0fc2('0x1d')];typeof _0x483c43[_0x4a0fc2('0x2f')][_0x4a0fc2('0x5')]==='undefined'&&(_0x3a5dd1['limit']=qs[_0x4a0fc2('0x33')](_0x483c43[_0x4a0fc2('0x2f')]['limit']),_0x3a5dd1[_0x4a0fc2('0x12')]=qs['offset'](_0x483c43[_0x4a0fc2('0x2f')][_0x4a0fc2('0x12')]));_0x3a5dd1['order']=qs[_0x4a0fc2('0x23')](_0x483c43[_0x4a0fc2('0x2f')]['sort']),_0x3a5dd1[_0x4a0fc2('0x2a')]=qs['filters'](_['pick'](_0x483c43[_0x4a0fc2('0x2f')],_0x121365[_0x4a0fc2('0x2e')]),_0x161470);_0x483c43[_0x4a0fc2('0x2f')]['filter']&&(_0x3a5dd1[_0x4a0fc2('0x2a')]=_[_0x4a0fc2('0x9')](_0x3a5dd1[_0x4a0fc2('0x2a')],{[Op['or']]:_['map'](_0x161470,function(_0x324536){const _0x4f1395=_0x4a0fc2;if(_0x324536[_0x4f1395('0x1c')]!==_0x4f1395('0xd')){const _0x415d69={};return _0x415d69[_0x324536[_0x4f1395('0x2c')]]={[Op[_0x4f1395('0x13')]]:'%'+_0x483c43[_0x4f1395('0x2f')][_0x4f1395('0x6')]+'%'},_0x415d69;}})}));_0x3a5dd1=_[_0x4a0fc2('0x9')]({},_0x3a5dd1,_0x483c43['options']);const _0x171529={'where':_0x3a5dd1['where']};return db[_0x4a0fc2('0x1')][_0x4a0fc2('0x2b')](_0x171529)[_0x4a0fc2('0x29')](function(_0x3588e6){const _0x597230=_0x4a0fc2;return _0x368204[_0x597230('0x2b')]=_0x3588e6,_0x483c43[_0x597230('0x2f')]['includeAll']&&(_0x3a5dd1[_0x597230('0x2')]=[{'all':!![]}]),db[_0x597230('0x1')][_0x597230('0x10')](_0x3a5dd1);})[_0x4a0fc2('0x29')](function(_0x421ed3){const _0x550ceb=_0x4a0fc2;return _0x368204[_0x550ceb('0x4')]=_0x421ed3,_0x368204;})['then'](respondWithFilteredResult(_0x285e3f,_0x3a5dd1))[_0x4a0fc2('0x30')](handleError(_0x285e3f,null));},exports[_0x230f90('0x0')]=function(_0x12a88d,_0x186572){const _0x9de5b6=_0x230f90;let _0x50d6ff={'raw':!![],'where':{'id':_0x12a88d['params']['id']}};const _0x2caec2={};return _0x2caec2[_0x9de5b6('0x1d')]=_[_0x9de5b6('0x14')](db[_0x9de5b6('0x1')][_0x9de5b6('0xc')]),_0x2caec2['query']=_[_0x9de5b6('0x14')](_0x12a88d['query']),_0x2caec2['filters']=_['intersection'](_0x2caec2[_0x9de5b6('0x1d')],_0x2caec2[_0x9de5b6('0x2f')]),_0x50d6ff['attributes']=_[_0x9de5b6('0x2d')](_0x2caec2['model'],qs[_0x9de5b6('0x8')](_0x12a88d['query'][_0x9de5b6('0x8')])),_0x50d6ff['attributes']=_0x50d6ff['attributes'][_0x9de5b6('0x19')]?_0x50d6ff[_0x9de5b6('0x32')]:_0x2caec2[_0x9de5b6('0x1d')],_0x12a88d[_0x9de5b6('0x2f')][_0x9de5b6('0x15')]&&(_0x50d6ff[_0x9de5b6('0x2')]=[{'all':!![]}]),_0x50d6ff=_[_0x9de5b6('0x9')]({},_0x50d6ff,_0x12a88d['options']),db[_0x9de5b6('0x1')][_0x9de5b6('0x1b')](_0x50d6ff)[_0x9de5b6('0x29')](handleEntityNotFound(_0x186572,null))[_0x9de5b6('0x29')](respondWithResult(_0x186572,null))[_0x9de5b6('0x30')](handleError(_0x186572,null));},exports[_0x230f90('0x1e')]=function(_0x1b76b0,_0x207a47){const _0x5a01ed=_0x230f90;return db[_0x5a01ed('0x1')]['create'](_0x1b76b0[_0x5a01ed('0x3')],{})[_0x5a01ed('0x29')](respondWithResult(_0x207a47,0xc9))[_0x5a01ed('0x30')](handleError(_0x207a47,null));},exports[_0x230f90('0xa')]=function(_0x5adf81,_0x59ca9a){const _0x209b61=_0x230f90;return _0x5adf81[_0x209b61('0x3')]['id']&&delete _0x5adf81[_0x209b61('0x3')]['id'],db[_0x209b61('0x1')][_0x209b61('0x1b')]({'where':{'id':_0x5adf81[_0x209b61('0x18')]['id']}})['then'](handleEntityNotFound(_0x59ca9a,null))['then'](saveUpdates(_0x5adf81['body'],null))[_0x209b61('0x29')](respondWithResult(_0x59ca9a,null))[_0x209b61('0x30')](handleError(_0x59ca9a,null));},exports[_0x230f90('0x28')]=function(_0xe5139d,_0x5431e3){const _0x135700=_0x230f90;return db[_0x135700('0x1')][_0x135700('0x1b')]({'where':{'id':_0xe5139d[_0x135700('0x18')]['id']}})[_0x135700('0x29')](handleEntityNotFound(_0x5431e3,null))[_0x135700('0x29')](removeEntity(_0x5431e3,null))[_0x135700('0x30')](handleError(_0x5431e3,null));};
\ No newline at end of file
+const a193_0x1891=['fields','filter','keys','status','model','rawAttributes','merge','type','send','../../components/parsers/qs','stack','../../mysqldb','order','../../config/logger','intersection','sort','offset','fieldName','include','FaxApplication','undefined','query','filters','api','end','limit','error','options','update','count','name','map','findAll','where','destroy','params','rows','set','index','key','attributes','body','nolimit','like','length','then','json','create','catch','findOne','lodash','VIRTUAL','includeAll'];(function(_0x4128b1,_0x189110){const _0x26929f=function(_0x405c0b){while(--_0x405c0b){_0x4128b1['push'](_0x4128b1['shift']());}};_0x26929f(++_0x189110);}(a193_0x1891,0x1e4));const a193_0x2692=function(_0x4128b1,_0x189110){_0x4128b1=_0x4128b1-0x0;let _0x26929f=a193_0x1891[_0x4128b1];return _0x26929f;};const _0x2ed59a=a193_0x2692;'use strict';const _=require(_0x2ed59a('0x2b')),qs=require(_0x2ed59a('0x2')),logger=require(_0x2ed59a('0x6'))(_0x2ed59a('0x10')),db=require(_0x2ed59a('0x4'))['db'],{Op}=require('sequelize');function respondWithResult(_0x405c0b,_0x317649){return _0x317649=_0x317649||0xc8,function(_0x415e03){const _0xa89edc=a193_0x2692;if(_0x415e03)return _0x405c0b[_0xa89edc('0x31')](_0x317649)[_0xa89edc('0x27')](_0x415e03);};}function respondWithFilteredResult(_0x1cf675,_0x59b603){return function(_0x451e92){const _0x5fff95=a193_0x2692;if(_0x451e92){const _0x479959=_0x451e92['count'],_0x3d881b=_0x59b603[_0x5fff95('0x9')];let _0x2fbdf2=_0x59b603[_0x5fff95('0x9')]+_0x59b603[_0x5fff95('0x12')],_0x5b6d83;return _0x2fbdf2>=_0x479959?(_0x2fbdf2=_0x479959,_0x5b6d83=0xc8):_0x5b6d83=0xce,_0x1cf675[_0x5fff95('0x31')](_0x5b6d83),_0x1cf675[_0x5fff95('0x1e')]('Content-Range',_0x3d881b+'-'+_0x2fbdf2+'/'+_0x479959)[_0x5fff95('0x27')](_0x451e92);}return null;};}function saveUpdates(_0x381f74){return function(_0x3b651d){const _0x2578c9=a193_0x2692;if(_0x3b651d)return _0x3b651d[_0x2578c9('0x15')](_0x381f74)[_0x2578c9('0x26')](function(_0x7a7bf3){return _0x7a7bf3;});return null;};}function removeEntity(_0x4fcd88){return function(_0x3a0347){const _0xa1f4c6=a193_0x2692;if(_0x3a0347)return _0x3a0347[_0xa1f4c6('0x1b')]()[_0xa1f4c6('0x26')](function(){const _0x3cdedb=_0xa1f4c6;_0x4fcd88[_0x3cdedb('0x31')](0xcc)[_0x3cdedb('0x11')]();});};}function handleEntityNotFound(_0x23778e){return function(_0x1e7ae1){return!_0x1e7ae1&&_0x23778e['sendStatus'](0x194),_0x1e7ae1;};}function handleError(_0x47f27b,_0x4c0ea2){return _0x4c0ea2=_0x4c0ea2||0x1f4,function(_0x341893){const _0x349594=a193_0x2692;logger[_0x349594('0x13')](_0x341893[_0x349594('0x3')]),_0x341893[_0x349594('0x17')]&&delete _0x341893[_0x349594('0x17')],_0x47f27b[_0x349594('0x31')](_0x4c0ea2)[_0x349594('0x1')](_0x341893);};}exports[_0x2ed59a('0x1f')]=function(_0x280cda,_0x530850){const _0x824e98=_0x2ed59a;let _0x4049a6={};const _0x12155f={},_0x5c531a={'count':0x0,'rows':[]},_0x182f89=_[_0x824e98('0x18')](db[_0x824e98('0xc')][_0x824e98('0x33')],function(_0x2c9ada){const _0xd093e2=_0x824e98;return{'name':_0x2c9ada[_0xd093e2('0xa')],'type':_0x2c9ada['type'][_0xd093e2('0x20')]};});_0x12155f['model']=_[_0x824e98('0x18')](_0x182f89,'name'),_0x12155f['query']=_['keys'](_0x280cda[_0x824e98('0xe')]),_0x12155f[_0x824e98('0xf')]=_[_0x824e98('0x7')](_0x12155f[_0x824e98('0x32')],_0x12155f[_0x824e98('0xe')]),_0x4049a6[_0x824e98('0x21')]=_[_0x824e98('0x7')](_0x12155f[_0x824e98('0x32')],qs[_0x824e98('0x2e')](_0x280cda[_0x824e98('0xe')][_0x824e98('0x2e')])),_0x4049a6[_0x824e98('0x21')]=_0x4049a6[_0x824e98('0x21')][_0x824e98('0x25')]?_0x4049a6[_0x824e98('0x21')]:_0x12155f[_0x824e98('0x32')];typeof _0x280cda[_0x824e98('0xe')][_0x824e98('0x23')]===_0x824e98('0xd')&&(_0x4049a6[_0x824e98('0x12')]=qs['limit'](_0x280cda[_0x824e98('0xe')]['limit']),_0x4049a6[_0x824e98('0x9')]=qs['offset'](_0x280cda[_0x824e98('0xe')][_0x824e98('0x9')]));_0x4049a6[_0x824e98('0x5')]=qs[_0x824e98('0x8')](_0x280cda[_0x824e98('0xe')][_0x824e98('0x8')]),_0x4049a6[_0x824e98('0x1a')]=qs[_0x824e98('0xf')](_['pick'](_0x280cda[_0x824e98('0xe')],_0x12155f['filters']),_0x182f89);_0x280cda[_0x824e98('0xe')][_0x824e98('0x2f')]&&(_0x4049a6[_0x824e98('0x1a')]=_[_0x824e98('0x34')](_0x4049a6['where'],{[Op['or']]:_['map'](_0x182f89,function(_0x68f068){const _0x44571f=_0x824e98;if(_0x68f068[_0x44571f('0x0')]!==_0x44571f('0x2c')){const _0x3ddf93={};return _0x3ddf93[_0x68f068[_0x44571f('0x17')]]={[Op[_0x44571f('0x24')]]:'%'+_0x280cda[_0x44571f('0xe')][_0x44571f('0x2f')]+'%'},_0x3ddf93;}})}));_0x4049a6=_[_0x824e98('0x34')]({},_0x4049a6,_0x280cda[_0x824e98('0x14')]);const _0x24ac40={'where':_0x4049a6[_0x824e98('0x1a')]};return db[_0x824e98('0xc')][_0x824e98('0x16')](_0x24ac40)['then'](function(_0x24d143){const _0x3a1aa5=_0x824e98;return _0x5c531a[_0x3a1aa5('0x16')]=_0x24d143,_0x280cda[_0x3a1aa5('0xe')][_0x3a1aa5('0x2d')]&&(_0x4049a6[_0x3a1aa5('0xb')]=[{'all':!![]}]),db[_0x3a1aa5('0xc')][_0x3a1aa5('0x19')](_0x4049a6);})[_0x824e98('0x26')](function(_0x53de71){const _0x45da72=_0x824e98;return _0x5c531a[_0x45da72('0x1d')]=_0x53de71,_0x5c531a;})['then'](respondWithFilteredResult(_0x530850,_0x4049a6))[_0x824e98('0x29')](handleError(_0x530850,null));},exports['show']=function(_0x26c9e5,_0x29a0c7){const _0x855e3f=_0x2ed59a;let _0x269451={'raw':!![],'where':{'id':_0x26c9e5[_0x855e3f('0x1c')]['id']}};const _0x44cf7f={};return _0x44cf7f[_0x855e3f('0x32')]=_['keys'](db[_0x855e3f('0xc')][_0x855e3f('0x33')]),_0x44cf7f[_0x855e3f('0xe')]=_[_0x855e3f('0x30')](_0x26c9e5['query']),_0x44cf7f[_0x855e3f('0xf')]=_[_0x855e3f('0x7')](_0x44cf7f[_0x855e3f('0x32')],_0x44cf7f[_0x855e3f('0xe')]),_0x269451[_0x855e3f('0x21')]=_[_0x855e3f('0x7')](_0x44cf7f['model'],qs[_0x855e3f('0x2e')](_0x26c9e5['query'][_0x855e3f('0x2e')])),_0x269451[_0x855e3f('0x21')]=_0x269451[_0x855e3f('0x21')][_0x855e3f('0x25')]?_0x269451['attributes']:_0x44cf7f[_0x855e3f('0x32')],_0x26c9e5[_0x855e3f('0xe')]['includeAll']&&(_0x269451['include']=[{'all':!![]}]),_0x269451=_['merge']({},_0x269451,_0x26c9e5[_0x855e3f('0x14')]),db['FaxApplication'][_0x855e3f('0x2a')](_0x269451)[_0x855e3f('0x26')](handleEntityNotFound(_0x29a0c7,null))['then'](respondWithResult(_0x29a0c7,null))[_0x855e3f('0x29')](handleError(_0x29a0c7,null));},exports[_0x2ed59a('0x28')]=function(_0x5c5883,_0x44f9e4){const _0x56c40f=_0x2ed59a;return db[_0x56c40f('0xc')][_0x56c40f('0x28')](_0x5c5883[_0x56c40f('0x22')],{})[_0x56c40f('0x26')](respondWithResult(_0x44f9e4,0xc9))[_0x56c40f('0x29')](handleError(_0x44f9e4,null));},exports['update']=function(_0x57d272,_0x12fd69){const _0x3c8a8b=_0x2ed59a;return _0x57d272[_0x3c8a8b('0x22')]['id']&&delete _0x57d272[_0x3c8a8b('0x22')]['id'],db[_0x3c8a8b('0xc')][_0x3c8a8b('0x2a')]({'where':{'id':_0x57d272[_0x3c8a8b('0x1c')]['id']}})[_0x3c8a8b('0x26')](handleEntityNotFound(_0x12fd69,null))['then'](saveUpdates(_0x57d272[_0x3c8a8b('0x22')],null))['then'](respondWithResult(_0x12fd69,null))['catch'](handleError(_0x12fd69,null));},exports[_0x2ed59a('0x1b')]=function(_0x24192c,_0x34f46f){const _0x24dda8=_0x2ed59a;return db['FaxApplication'][_0x24dda8('0x2a')]({'where':{'id':_0x24192c[_0x24dda8('0x1c')]['id']}})[_0x24dda8('0x26')](handleEntityNotFound(_0x34f46f,null))[_0x24dda8('0x26')](removeEntity(_0x34f46f,null))[_0x24dda8('0x29')](handleError(_0x34f46f,null));};
\ No newline at end of file