Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / faxApplication / faxApplication.controller.js
index 9d01cbb..68d95e4 100644 (file)
@@ -1 +1 @@
-const a193_0x5e64=['lodash','index','map','pick','end','fieldName','catch','update','keys','json','show','count','merge','../../config/logger','like','rows','findOne','length','params','status','filter','body','where','type','query','nolimit','name','set','offset','../../mysqldb','include','sort','VIRTUAL','sequelize','limit','model','destroy','options','create','Content-Range','stack','intersection','order','FaxApplication','../../components/parsers/qs','sendStatus','findAll','attributes','then','rawAttributes','fields','filters','includeAll'];(function(_0x2e7647,_0x5e64a0){const _0x47c088=function(_0x629919){while(--_0x629919){_0x2e7647['push'](_0x2e7647['shift']());}};_0x47c088(++_0x5e64a0);}(a193_0x5e64,0x1aa));const a193_0x47c0=function(_0x2e7647,_0x5e64a0){_0x2e7647=_0x2e7647-0x0;let _0x47c088=a193_0x5e64[_0x2e7647];return _0x47c088;};const _0x1ba639=a193_0x47c0;'use strict';const _=require(_0x1ba639('0x33')),qs=require(_0x1ba639('0x2a')),logger=require(_0x1ba639('0xb'))('api'),db=require(_0x1ba639('0x1b'))['db'],{Op}=require(_0x1ba639('0x1f'));function respondWithResult(_0x629919,_0x54d0e7){return _0x54d0e7=_0x54d0e7||0xc8,function(_0x1e05a9){if(_0x1e05a9)return _0x629919['status'](_0x54d0e7)['json'](_0x1e05a9);};}function respondWithFilteredResult(_0x5afbe0,_0x331ef8){return function(_0x2c4c09){const _0x356ad5=a193_0x47c0;if(_0x2c4c09){const _0x127eef=_0x2c4c09[_0x356ad5('0x9')],_0x491f02=_0x331ef8['offset'];let _0x3099bc=_0x331ef8[_0x356ad5('0x1a')]+_0x331ef8[_0x356ad5('0x20')],_0x57f1cf;return _0x3099bc>=_0x127eef?(_0x3099bc=_0x127eef,_0x57f1cf=0xc8):_0x57f1cf=0xce,_0x5afbe0[_0x356ad5('0x11')](_0x57f1cf),_0x5afbe0[_0x356ad5('0x19')](_0x356ad5('0x25'),_0x491f02+'-'+_0x3099bc+'/'+_0x127eef)[_0x356ad5('0x7')](_0x2c4c09);}return null;};}function saveUpdates(_0x57b46a){return function(_0x5e036a){const _0x5dc023=a193_0x47c0;if(_0x5e036a)return _0x5e036a[_0x5dc023('0x5')](_0x57b46a)[_0x5dc023('0x2e')](function(_0xcf00d4){return _0xcf00d4;});return null;};}function removeEntity(_0x24e64c){return function(_0x43d58a){const _0x536415=a193_0x47c0;if(_0x43d58a)return _0x43d58a[_0x536415('0x22')]()[_0x536415('0x2e')](function(){const _0xc90853=_0x536415;_0x24e64c[_0xc90853('0x11')](0xcc)[_0xc90853('0x2')]();});};}function handleEntityNotFound(_0x3f2f39){return function(_0x14fd4e){const _0x441046=a193_0x47c0;return!_0x14fd4e&&_0x3f2f39[_0x441046('0x2b')](0x194),_0x14fd4e;};}function handleError(_0x5c3e6c,_0xb8e3ef){return _0xb8e3ef=_0xb8e3ef||0x1f4,function(_0x43be02){const _0x221525=a193_0x47c0;logger['error'](_0x43be02[_0x221525('0x26')]),_0x43be02['name']&&delete _0x43be02[_0x221525('0x18')],_0x5c3e6c['status'](_0xb8e3ef)['send'](_0x43be02);};}exports[_0x1ba639('0x34')]=function(_0x2cd429,_0x109cec){const _0x52e97b=_0x1ba639;let _0x137a67={};const _0x3483bf={},_0x39e6e4={'count':0x0,'rows':[]},_0x1b49e5=_[_0x52e97b('0x0')](db[_0x52e97b('0x29')][_0x52e97b('0x2f')],function(_0xb32fc6){const _0x48458e=_0x52e97b;return{'name':_0xb32fc6[_0x48458e('0x3')],'type':_0xb32fc6['type']['key']};});_0x3483bf[_0x52e97b('0x21')]=_[_0x52e97b('0x0')](_0x1b49e5,'name'),_0x3483bf[_0x52e97b('0x16')]=_[_0x52e97b('0x6')](_0x2cd429[_0x52e97b('0x16')]),_0x3483bf[_0x52e97b('0x31')]=_['intersection'](_0x3483bf['model'],_0x3483bf['query']),_0x137a67[_0x52e97b('0x2d')]=_['intersection'](_0x3483bf[_0x52e97b('0x21')],qs[_0x52e97b('0x30')](_0x2cd429[_0x52e97b('0x16')][_0x52e97b('0x30')])),_0x137a67[_0x52e97b('0x2d')]=_0x137a67['attributes'][_0x52e97b('0xf')]?_0x137a67[_0x52e97b('0x2d')]:_0x3483bf[_0x52e97b('0x21')];typeof _0x2cd429[_0x52e97b('0x16')][_0x52e97b('0x17')]==='undefined'&&(_0x137a67[_0x52e97b('0x20')]=qs['limit'](_0x2cd429['query'][_0x52e97b('0x20')]),_0x137a67['offset']=qs['offset'](_0x2cd429[_0x52e97b('0x16')]['offset']));_0x137a67[_0x52e97b('0x28')]=qs[_0x52e97b('0x1d')](_0x2cd429[_0x52e97b('0x16')]['sort']),_0x137a67['where']=qs[_0x52e97b('0x31')](_[_0x52e97b('0x1')](_0x2cd429[_0x52e97b('0x16')],_0x3483bf[_0x52e97b('0x31')]),_0x1b49e5);_0x2cd429[_0x52e97b('0x16')][_0x52e97b('0x12')]&&(_0x137a67[_0x52e97b('0x14')]=_[_0x52e97b('0xa')](_0x137a67[_0x52e97b('0x14')],{[Op['or']]:_[_0x52e97b('0x0')](_0x1b49e5,function(_0x586837){const _0x59fe7f=_0x52e97b;if(_0x586837[_0x59fe7f('0x15')]!==_0x59fe7f('0x1e')){const _0x26e914={};return _0x26e914[_0x586837[_0x59fe7f('0x18')]]={[Op[_0x59fe7f('0xc')]]:'%'+_0x2cd429[_0x59fe7f('0x16')][_0x59fe7f('0x12')]+'%'},_0x26e914;}})}));_0x137a67=_[_0x52e97b('0xa')]({},_0x137a67,_0x2cd429[_0x52e97b('0x23')]);const _0x529306={'where':_0x137a67[_0x52e97b('0x14')]};return db[_0x52e97b('0x29')][_0x52e97b('0x9')](_0x529306)[_0x52e97b('0x2e')](function(_0x31da15){const _0x2fca22=_0x52e97b;return _0x39e6e4['count']=_0x31da15,_0x2cd429[_0x2fca22('0x16')][_0x2fca22('0x32')]&&(_0x137a67[_0x2fca22('0x1c')]=[{'all':!![]}]),db[_0x2fca22('0x29')][_0x2fca22('0x2c')](_0x137a67);})[_0x52e97b('0x2e')](function(_0x38d52b){const _0x50b18a=_0x52e97b;return _0x39e6e4[_0x50b18a('0xd')]=_0x38d52b,_0x39e6e4;})[_0x52e97b('0x2e')](respondWithFilteredResult(_0x109cec,_0x137a67))[_0x52e97b('0x4')](handleError(_0x109cec,null));},exports[_0x1ba639('0x8')]=function(_0x36cd59,_0x3345b1){const _0x12b6df=_0x1ba639;let _0x5c2c8e={'raw':!![],'where':{'id':_0x36cd59[_0x12b6df('0x10')]['id']}};const _0x35fedd={};return _0x35fedd['model']=_['keys'](db[_0x12b6df('0x29')][_0x12b6df('0x2f')]),_0x35fedd['query']=_['keys'](_0x36cd59['query']),_0x35fedd['filters']=_[_0x12b6df('0x27')](_0x35fedd[_0x12b6df('0x21')],_0x35fedd[_0x12b6df('0x16')]),_0x5c2c8e[_0x12b6df('0x2d')]=_['intersection'](_0x35fedd['model'],qs['fields'](_0x36cd59[_0x12b6df('0x16')][_0x12b6df('0x30')])),_0x5c2c8e[_0x12b6df('0x2d')]=_0x5c2c8e[_0x12b6df('0x2d')][_0x12b6df('0xf')]?_0x5c2c8e['attributes']:_0x35fedd[_0x12b6df('0x21')],_0x36cd59[_0x12b6df('0x16')]['includeAll']&&(_0x5c2c8e[_0x12b6df('0x1c')]=[{'all':!![]}]),_0x5c2c8e=_[_0x12b6df('0xa')]({},_0x5c2c8e,_0x36cd59[_0x12b6df('0x23')]),db[_0x12b6df('0x29')]['findOne'](_0x5c2c8e)[_0x12b6df('0x2e')](handleEntityNotFound(_0x3345b1,null))['then'](respondWithResult(_0x3345b1,null))[_0x12b6df('0x4')](handleError(_0x3345b1,null));},exports[_0x1ba639('0x24')]=function(_0x1f7bb2,_0x44b79f){const _0x520cfe=_0x1ba639;return db['FaxApplication'][_0x520cfe('0x24')](_0x1f7bb2[_0x520cfe('0x13')],{})[_0x520cfe('0x2e')](respondWithResult(_0x44b79f,0xc9))[_0x520cfe('0x4')](handleError(_0x44b79f,null));},exports['update']=function(_0x431ac0,_0x4d3988){const _0x53fc03=_0x1ba639;return _0x431ac0['body']['id']&&delete _0x431ac0[_0x53fc03('0x13')]['id'],db['FaxApplication']['findOne']({'where':{'id':_0x431ac0['params']['id']}})[_0x53fc03('0x2e')](handleEntityNotFound(_0x4d3988,null))[_0x53fc03('0x2e')](saveUpdates(_0x431ac0['body'],null))['then'](respondWithResult(_0x4d3988,null))[_0x53fc03('0x4')](handleError(_0x4d3988,null));},exports[_0x1ba639('0x22')]=function(_0x38b71f,_0x4fe3d7){const _0x3632b8=_0x1ba639;return db[_0x3632b8('0x29')][_0x3632b8('0xe')]({'where':{'id':_0x38b71f['params']['id']}})[_0x3632b8('0x2e')](handleEntityNotFound(_0x4fe3d7,null))[_0x3632b8('0x2e')](removeEntity(_0x4fe3d7,null))[_0x3632b8('0x4')](handleError(_0x4fe3d7,null));};
\ No newline at end of file
+const a193_0x3aa9=['then','filter','params','destroy','findAll','create','undefined','error','set','offset','../../components/parsers/qs','attributes','json','catch','../../mysqldb','count','options','status','model','stack','intersection','like','fieldName','fields','pick','rawAttributes','keys','../../config/logger','merge','includeAll','api','type','rows','key','index','limit','where','body','query','include','FaxApplication','filters','VIRTUAL','Content-Range','length','findOne','update','name','map'];(function(_0x58a6d6,_0x3aa9f4){const _0x47fd18=function(_0xb499b6){while(--_0xb499b6){_0x58a6d6['push'](_0x58a6d6['shift']());}};_0x47fd18(++_0x3aa9f4);}(a193_0x3aa9,0x1c7));const a193_0x47fd=function(_0x58a6d6,_0x3aa9f4){_0x58a6d6=_0x58a6d6-0x0;let _0x47fd18=a193_0x3aa9[_0x58a6d6];return _0x47fd18;};const _0x543680=a193_0x47fd;'use strict';const _=require('lodash'),qs=require(_0x543680('0x2d')),logger=require(_0x543680('0xd'))(_0x543680('0x10')),db=require(_0x543680('0x0'))['db'],{Op}=require('sequelize');function respondWithResult(_0xb499b6,_0x36c24d){return _0x36c24d=_0x36c24d||0xc8,function(_0x4b97cf){const _0x30f5ac=a193_0x47fd;if(_0x4b97cf)return _0xb499b6['status'](_0x36c24d)[_0x30f5ac('0x2f')](_0x4b97cf);};}function respondWithFilteredResult(_0x495ee1,_0x265dbf){return function(_0x398cd3){const _0x17e67b=a193_0x47fd;if(_0x398cd3){const _0x2324c0=_0x398cd3['count'],_0x36ba01=_0x265dbf[_0x17e67b('0x2c')];let _0x30edba=_0x265dbf[_0x17e67b('0x2c')]+_0x265dbf[_0x17e67b('0x15')],_0x28f3c7;return _0x30edba>=_0x2324c0?(_0x30edba=_0x2324c0,_0x28f3c7=0xc8):_0x28f3c7=0xce,_0x495ee1[_0x17e67b('0x3')](_0x28f3c7),_0x495ee1[_0x17e67b('0x2b')](_0x17e67b('0x1d'),_0x36ba01+'-'+_0x30edba+'/'+_0x2324c0)[_0x17e67b('0x2f')](_0x398cd3);}return null;};}function saveUpdates(_0x1a05a4){return function(_0x562912){const _0x44e4f8=a193_0x47fd;if(_0x562912)return _0x562912[_0x44e4f8('0x20')](_0x1a05a4)['then'](function(_0x5cc730){return _0x5cc730;});return null;};}function removeEntity(_0x5bb577){return function(_0x52a4de){const _0x15ae9c=a193_0x47fd;if(_0x52a4de)return _0x52a4de[_0x15ae9c('0x26')]()[_0x15ae9c('0x23')](function(){const _0x396110=_0x15ae9c;_0x5bb577[_0x396110('0x3')](0xcc)['end']();});};}function handleEntityNotFound(_0x5bac40){return function(_0x35158f){return!_0x35158f&&_0x5bac40['sendStatus'](0x194),_0x35158f;};}function handleError(_0x4d67f1,_0x25800a){return _0x25800a=_0x25800a||0x1f4,function(_0x3af23a){const _0x5baba4=a193_0x47fd;logger[_0x5baba4('0x2a')](_0x3af23a[_0x5baba4('0x5')]),_0x3af23a['name']&&delete _0x3af23a[_0x5baba4('0x21')],_0x4d67f1['status'](_0x25800a)['send'](_0x3af23a);};}exports[_0x543680('0x14')]=function(_0x168977,_0x296b6c){const _0x33f67e=_0x543680;let _0x211a8f={};const _0xe4f4a1={},_0x3d12d6={'count':0x0,'rows':[]},_0x53e7ca=_[_0x33f67e('0x22')](db['FaxApplication'][_0x33f67e('0xb')],function(_0x49f370){const _0x331f92=_0x33f67e;return{'name':_0x49f370[_0x331f92('0x8')],'type':_0x49f370[_0x331f92('0x11')][_0x331f92('0x13')]};});_0xe4f4a1[_0x33f67e('0x4')]=_[_0x33f67e('0x22')](_0x53e7ca,_0x33f67e('0x21')),_0xe4f4a1[_0x33f67e('0x18')]=_[_0x33f67e('0xc')](_0x168977[_0x33f67e('0x18')]),_0xe4f4a1[_0x33f67e('0x1b')]=_[_0x33f67e('0x6')](_0xe4f4a1[_0x33f67e('0x4')],_0xe4f4a1['query']),_0x211a8f['attributes']=_[_0x33f67e('0x6')](_0xe4f4a1[_0x33f67e('0x4')],qs[_0x33f67e('0x9')](_0x168977[_0x33f67e('0x18')][_0x33f67e('0x9')])),_0x211a8f[_0x33f67e('0x2e')]=_0x211a8f[_0x33f67e('0x2e')]['length']?_0x211a8f[_0x33f67e('0x2e')]:_0xe4f4a1[_0x33f67e('0x4')];typeof _0x168977[_0x33f67e('0x18')]['nolimit']===_0x33f67e('0x29')&&(_0x211a8f[_0x33f67e('0x15')]=qs[_0x33f67e('0x15')](_0x168977[_0x33f67e('0x18')]['limit']),_0x211a8f[_0x33f67e('0x2c')]=qs[_0x33f67e('0x2c')](_0x168977[_0x33f67e('0x18')][_0x33f67e('0x2c')]));_0x211a8f['order']=qs['sort'](_0x168977[_0x33f67e('0x18')]['sort']),_0x211a8f[_0x33f67e('0x16')]=qs[_0x33f67e('0x1b')](_[_0x33f67e('0xa')](_0x168977[_0x33f67e('0x18')],_0xe4f4a1[_0x33f67e('0x1b')]),_0x53e7ca);_0x168977[_0x33f67e('0x18')][_0x33f67e('0x24')]&&(_0x211a8f[_0x33f67e('0x16')]=_[_0x33f67e('0xe')](_0x211a8f['where'],{[Op['or']]:_[_0x33f67e('0x22')](_0x53e7ca,function(_0x18286e){const _0x4a8620=_0x33f67e;if(_0x18286e['type']!==_0x4a8620('0x1c')){const _0xd6c3c4={};return _0xd6c3c4[_0x18286e['name']]={[Op[_0x4a8620('0x7')]]:'%'+_0x168977[_0x4a8620('0x18')]['filter']+'%'},_0xd6c3c4;}})}));_0x211a8f=_[_0x33f67e('0xe')]({},_0x211a8f,_0x168977[_0x33f67e('0x2')]);const _0x57b2ab={'where':_0x211a8f[_0x33f67e('0x16')]};return db[_0x33f67e('0x1a')][_0x33f67e('0x1')](_0x57b2ab)['then'](function(_0x825df0){const _0x52d522=_0x33f67e;return _0x3d12d6[_0x52d522('0x1')]=_0x825df0,_0x168977[_0x52d522('0x18')]['includeAll']&&(_0x211a8f[_0x52d522('0x19')]=[{'all':!![]}]),db['FaxApplication'][_0x52d522('0x27')](_0x211a8f);})['then'](function(_0x57c890){const _0x52efd2=_0x33f67e;return _0x3d12d6[_0x52efd2('0x12')]=_0x57c890,_0x3d12d6;})[_0x33f67e('0x23')](respondWithFilteredResult(_0x296b6c,_0x211a8f))[_0x33f67e('0x30')](handleError(_0x296b6c,null));},exports['show']=function(_0x2fb5f2,_0x5cf424){const _0x344b5b=_0x543680;let _0x4138cf={'raw':!![],'where':{'id':_0x2fb5f2[_0x344b5b('0x25')]['id']}};const _0x37d3eb={};return _0x37d3eb['model']=_['keys'](db[_0x344b5b('0x1a')][_0x344b5b('0xb')]),_0x37d3eb['query']=_[_0x344b5b('0xc')](_0x2fb5f2[_0x344b5b('0x18')]),_0x37d3eb[_0x344b5b('0x1b')]=_[_0x344b5b('0x6')](_0x37d3eb[_0x344b5b('0x4')],_0x37d3eb[_0x344b5b('0x18')]),_0x4138cf[_0x344b5b('0x2e')]=_['intersection'](_0x37d3eb[_0x344b5b('0x4')],qs[_0x344b5b('0x9')](_0x2fb5f2[_0x344b5b('0x18')][_0x344b5b('0x9')])),_0x4138cf['attributes']=_0x4138cf[_0x344b5b('0x2e')][_0x344b5b('0x1e')]?_0x4138cf[_0x344b5b('0x2e')]:_0x37d3eb['model'],_0x2fb5f2['query'][_0x344b5b('0xf')]&&(_0x4138cf[_0x344b5b('0x19')]=[{'all':!![]}]),_0x4138cf=_['merge']({},_0x4138cf,_0x2fb5f2['options']),db[_0x344b5b('0x1a')][_0x344b5b('0x1f')](_0x4138cf)[_0x344b5b('0x23')](handleEntityNotFound(_0x5cf424,null))[_0x344b5b('0x23')](respondWithResult(_0x5cf424,null))[_0x344b5b('0x30')](handleError(_0x5cf424,null));},exports['create']=function(_0x23bca7,_0x5d58fe){const _0x3d00d9=_0x543680;return db[_0x3d00d9('0x1a')][_0x3d00d9('0x28')](_0x23bca7[_0x3d00d9('0x17')],{})[_0x3d00d9('0x23')](respondWithResult(_0x5d58fe,0xc9))[_0x3d00d9('0x30')](handleError(_0x5d58fe,null));},exports['update']=function(_0x1335d4,_0x3f0bea){const _0x42b8b0=_0x543680;return _0x1335d4['body']['id']&&delete _0x1335d4[_0x42b8b0('0x17')]['id'],db[_0x42b8b0('0x1a')]['findOne']({'where':{'id':_0x1335d4['params']['id']}})[_0x42b8b0('0x23')](handleEntityNotFound(_0x3f0bea,null))['then'](saveUpdates(_0x1335d4[_0x42b8b0('0x17')],null))[_0x42b8b0('0x23')](respondWithResult(_0x3f0bea,null))[_0x42b8b0('0x30')](handleError(_0x3f0bea,null));},exports[_0x543680('0x26')]=function(_0xc04045,_0x16fd29){const _0x138768=_0x543680;return db[_0x138768('0x1a')][_0x138768('0x1f')]({'where':{'id':_0xc04045[_0x138768('0x25')]['id']}})['then'](handleEntityNotFound(_0x16fd29,null))[_0x138768('0x23')](removeEntity(_0x16fd29,null))[_0x138768('0x30')](handleError(_0x16fd29,null));};
\ No newline at end of file