Built motion from commit 709aa6fb5ed03aa61bc373fcdbf622215d37d30b. Version 3.0.0...
[motion-next.git] / server / api / faxTransferReport / faxTransferReport.controller.js
index 5c042c8..c3eedd3 100644 (file)
@@ -1 +1 @@
-const a224_0x26b2=['fields','Content-Range','destroy','type','../../components/parsers/qs','FaxTransferReport','nolimit','order','send','merge','filter','fieldName','show','catch','sendStatus','offset','describe','map','options','update','json','count','then','error','attributes','params','length','like','where','status','intersection','include','create','name','rawAttributes','rows','includeAll','body','limit','index','findAll','keys','findOne','set','filters','query','model','sort'];(function(_0x744b7,_0x26b25a){const _0x136525=function(_0x5dabe0){while(--_0x5dabe0){_0x744b7['push'](_0x744b7['shift']());}};_0x136525(++_0x26b25a);}(a224_0x26b2,0x112));const a224_0x1365=function(_0x744b7,_0x26b25a){_0x744b7=_0x744b7-0x0;let _0x136525=a224_0x26b2[_0x744b7];return _0x136525;};const _0x174567=a224_0x1365;'use strict';const _=require('lodash'),qs=require(_0x174567('0x12')),logger=require('../../config/logger')('api'),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithResult(_0x5dabe0,_0x5d8941){return _0x5d8941=_0x5d8941||0xc8,function(_0x27501a){const _0x479bc5=a224_0x1365;if(_0x27501a)return _0x5dabe0['status'](_0x5d8941)[_0x479bc5('0x22')](_0x27501a);};}function respondWithFilteredResult(_0x20caac,_0x2208eb){return function(_0x74d7f2){const _0x33bb70=a224_0x1365;if(_0x74d7f2){const _0x594a9b=_0x74d7f2[_0x33bb70('0x23')],_0x2b8bb0=_0x2208eb[_0x33bb70('0x1d')];let _0x10f172=_0x2208eb[_0x33bb70('0x1d')]+_0x2208eb[_0x33bb70('0x4')],_0x3b1b92;return _0x10f172>=_0x594a9b?(_0x10f172=_0x594a9b,_0x3b1b92=0xc8):_0x3b1b92=0xce,_0x20caac[_0x33bb70('0x2b')](_0x3b1b92),_0x20caac[_0x33bb70('0x9')](_0x33bb70('0xf'),_0x2b8bb0+'-'+_0x10f172+'/'+_0x594a9b)[_0x33bb70('0x22')](_0x74d7f2);}return null;};}function saveUpdates(_0x49d9f0){return function(_0x87e69d){const _0x649a20=a224_0x1365;if(_0x87e69d)return _0x87e69d[_0x649a20('0x21')](_0x49d9f0)['then'](function(_0x3973eb){return _0x3973eb;});return null;};}function removeEntity(_0x21be55){return function(_0x373885){const _0x4e7866=a224_0x1365;if(_0x373885)return _0x373885[_0x4e7866('0x10')]()[_0x4e7866('0x24')](function(){const _0x145b93=_0x4e7866;_0x21be55[_0x145b93('0x2b')](0xcc)['end']();});};}function handleEntityNotFound(_0x284560){return function(_0x4bd771){const _0xabcf99=a224_0x1365;return!_0x4bd771&&_0x284560[_0xabcf99('0x1c')](0x194),_0x4bd771;};}function handleError(_0x4b4597,_0x384e5b){return _0x384e5b=_0x384e5b||0x1f4,function(_0x488847){const _0x1a35e3=a224_0x1365;logger[_0x1a35e3('0x25')](_0x488847['stack']),_0x488847[_0x1a35e3('0x2f')]&&delete _0x488847['name'],_0x4b4597[_0x1a35e3('0x2b')](_0x384e5b)[_0x1a35e3('0x16')](_0x488847);};}exports[_0x174567('0x5')]=function(_0x2c9e92,_0x5ccb04){const _0x255dc0=_0x174567;let _0xbb93a0={};const _0x71febc={},_0x547fc2={'count':0x0,'rows':[]},_0x135f03=_[_0x255dc0('0x1f')](db[_0x255dc0('0x13')]['rawAttributes'],function(_0x11722a){const _0x468dce=_0x255dc0;return{'name':_0x11722a[_0x468dce('0x19')],'type':_0x11722a[_0x468dce('0x11')]['key']};});_0x71febc[_0x255dc0('0xc')]=_[_0x255dc0('0x1f')](_0x135f03,_0x255dc0('0x2f')),_0x71febc['query']=_[_0x255dc0('0x7')](_0x2c9e92[_0x255dc0('0xb')]),_0x71febc[_0x255dc0('0xa')]=_[_0x255dc0('0x2c')](_0x71febc[_0x255dc0('0xc')],_0x71febc[_0x255dc0('0xb')]),_0xbb93a0[_0x255dc0('0x26')]=_['intersection'](_0x71febc[_0x255dc0('0xc')],qs['fields'](_0x2c9e92[_0x255dc0('0xb')][_0x255dc0('0xe')])),_0xbb93a0[_0x255dc0('0x26')]=_0xbb93a0[_0x255dc0('0x26')]['length']?_0xbb93a0[_0x255dc0('0x26')]:_0x71febc[_0x255dc0('0xc')];typeof _0x2c9e92[_0x255dc0('0xb')][_0x255dc0('0x14')]==='undefined'&&(_0xbb93a0[_0x255dc0('0x4')]=qs['limit'](_0x2c9e92[_0x255dc0('0xb')][_0x255dc0('0x4')]),_0xbb93a0['offset']=qs[_0x255dc0('0x1d')](_0x2c9e92['query'][_0x255dc0('0x1d')]));_0xbb93a0[_0x255dc0('0x15')]=qs['sort'](_0x2c9e92[_0x255dc0('0xb')][_0x255dc0('0xd')]),_0xbb93a0[_0x255dc0('0x2a')]=qs['filters'](_['pick'](_0x2c9e92[_0x255dc0('0xb')],_0x71febc[_0x255dc0('0xa')]),_0x135f03);_0x2c9e92[_0x255dc0('0xb')][_0x255dc0('0x18')]&&(_0xbb93a0['where']=_[_0x255dc0('0x17')](_0xbb93a0[_0x255dc0('0x2a')],{[Op['or']]:_['map'](_0x135f03,function(_0x40bbcb){const _0x452506=_0x255dc0;if(_0x40bbcb[_0x452506('0x11')]!=='VIRTUAL'){const _0x5aeb18={};return _0x5aeb18[_0x40bbcb[_0x452506('0x2f')]]={[Op[_0x452506('0x29')]]:'%'+_0x2c9e92[_0x452506('0xb')]['filter']+'%'},_0x5aeb18;}})}));_0xbb93a0=_[_0x255dc0('0x17')]({},_0xbb93a0,_0x2c9e92[_0x255dc0('0x20')]);const _0x1693cb={'where':_0xbb93a0['where']};return db[_0x255dc0('0x13')]['count'](_0x1693cb)[_0x255dc0('0x24')](function(_0x2cfbae){const _0x3c6493=_0x255dc0;return _0x547fc2[_0x3c6493('0x23')]=_0x2cfbae,_0x2c9e92[_0x3c6493('0xb')][_0x3c6493('0x2')]&&(_0xbb93a0[_0x3c6493('0x2d')]=[{'all':!![]}]),db['FaxTransferReport'][_0x3c6493('0x6')](_0xbb93a0);})[_0x255dc0('0x24')](function(_0x1c7662){const _0x261324=_0x255dc0;return _0x547fc2[_0x261324('0x1')]=_0x1c7662,_0x547fc2;})['then'](respondWithFilteredResult(_0x5ccb04,_0xbb93a0))[_0x255dc0('0x1b')](handleError(_0x5ccb04,null));},exports[_0x174567('0x1a')]=function(_0x3151df,_0x50ffdf){const _0x266b2e=_0x174567;let _0x38204f={'raw':!![],'where':{'id':_0x3151df['params']['id']}};const _0x5ea772={};return _0x5ea772[_0x266b2e('0xc')]=_['keys'](db['FaxTransferReport'][_0x266b2e('0x0')]),_0x5ea772[_0x266b2e('0xb')]=_[_0x266b2e('0x7')](_0x3151df[_0x266b2e('0xb')]),_0x5ea772[_0x266b2e('0xa')]=_[_0x266b2e('0x2c')](_0x5ea772['model'],_0x5ea772[_0x266b2e('0xb')]),_0x38204f[_0x266b2e('0x26')]=_[_0x266b2e('0x2c')](_0x5ea772[_0x266b2e('0xc')],qs[_0x266b2e('0xe')](_0x3151df[_0x266b2e('0xb')][_0x266b2e('0xe')])),_0x38204f[_0x266b2e('0x26')]=_0x38204f[_0x266b2e('0x26')][_0x266b2e('0x28')]?_0x38204f['attributes']:_0x5ea772[_0x266b2e('0xc')],_0x3151df[_0x266b2e('0xb')][_0x266b2e('0x2')]&&(_0x38204f[_0x266b2e('0x2d')]=[{'all':!![]}]),_0x38204f=_[_0x266b2e('0x17')]({},_0x38204f,_0x3151df[_0x266b2e('0x20')]),db[_0x266b2e('0x13')][_0x266b2e('0x8')](_0x38204f)['then'](handleEntityNotFound(_0x50ffdf,null))[_0x266b2e('0x24')](respondWithResult(_0x50ffdf,null))[_0x266b2e('0x1b')](handleError(_0x50ffdf,null));},exports[_0x174567('0x2e')]=function(_0x136974,_0x530170){const _0x32179b=_0x174567;return db[_0x32179b('0x13')]['create'](_0x136974[_0x32179b('0x3')],{})[_0x32179b('0x24')](respondWithResult(_0x530170,0xc9))['catch'](handleError(_0x530170,null));},exports[_0x174567('0x21')]=function(_0x2a2e95,_0x4bdccb){const _0xf328cc=_0x174567;return _0x2a2e95[_0xf328cc('0x3')]['id']&&delete _0x2a2e95[_0xf328cc('0x3')]['id'],db[_0xf328cc('0x13')][_0xf328cc('0x8')]({'where':{'id':_0x2a2e95[_0xf328cc('0x27')]['id']}})[_0xf328cc('0x24')](handleEntityNotFound(_0x4bdccb,null))[_0xf328cc('0x24')](saveUpdates(_0x2a2e95[_0xf328cc('0x3')],null))[_0xf328cc('0x24')](respondWithResult(_0x4bdccb,null))[_0xf328cc('0x1b')](handleError(_0x4bdccb,null));},exports[_0x174567('0x10')]=function(_0x3da9d5,_0x6630e0){const _0x14a956=_0x174567;return db['FaxTransferReport'][_0x14a956('0x8')]({'where':{'id':_0x3da9d5[_0x14a956('0x27')]['id']}})[_0x14a956('0x24')](handleEntityNotFound(_0x6630e0,null))[_0x14a956('0x24')](removeEntity(_0x6630e0,null))['catch'](handleError(_0x6630e0,null));},exports[_0x174567('0x1e')]=function(_0x17c12c,_0x522a76){const _0x38f7e5=_0x174567;return db['FaxTransferReport'][_0x38f7e5('0x1e')]()[_0x38f7e5('0x24')](respondWithResult(_0x522a76,null))[_0x38f7e5('0x1b')](handleError(_0x522a76,null));};
\ No newline at end of file
+const a224_0x71b0=['where','attributes','../../components/parsers/qs','undefined','model','keys','map','type','body','params','findOne','rawAttributes','catch','VIRTUAL','order','query','Content-Range','like','filters','sequelize','options','includeAll','findAll','error','fields','FaxTransferReport','key','end','sort','name','limit','index','json','intersection','nolimit','destroy','length','stack','update','describe','then','../../config/logger','filter','api','merge','send','create','count','fieldName','../../mysqldb','status','offset','include','pick','sendStatus','rows'];(function(_0x2d5f86,_0x71b022){const _0x563037=function(_0x65bb02){while(--_0x65bb02){_0x2d5f86['push'](_0x2d5f86['shift']());}};_0x563037(++_0x71b022);}(a224_0x71b0,0x1a6));const a224_0x5630=function(_0x2d5f86,_0x71b022){_0x2d5f86=_0x2d5f86-0x0;let _0x563037=a224_0x71b0[_0x2d5f86];return _0x563037;};const _0x2c4172=a224_0x5630;'use strict';const _=require('lodash'),qs=require(_0x2c4172('0x1c')),logger=require(_0x2c4172('0xb'))(_0x2c4172('0xd')),db=require(_0x2c4172('0x13'))['db'],{Op}=require(_0x2c4172('0x2d'));function respondWithResult(_0x65bb02,_0x4bd0a3){return _0x4bd0a3=_0x4bd0a3||0xc8,function(_0x418382){const _0x35ab1=a224_0x5630;if(_0x418382)return _0x65bb02[_0x35ab1('0x14')](_0x4bd0a3)[_0x35ab1('0x2')](_0x418382);};}function respondWithFilteredResult(_0x317f93,_0x45e91c){return function(_0x449ee4){const _0x194902=a224_0x5630;if(_0x449ee4){const _0x280c1a=_0x449ee4[_0x194902('0x11')],_0x48fdb6=_0x45e91c[_0x194902('0x15')];let _0x22fe2a=_0x45e91c[_0x194902('0x15')]+_0x45e91c['limit'],_0x332cb0;return _0x22fe2a>=_0x280c1a?(_0x22fe2a=_0x280c1a,_0x332cb0=0xc8):_0x332cb0=0xce,_0x317f93[_0x194902('0x14')](_0x332cb0),_0x317f93['set'](_0x194902('0x2a'),_0x48fdb6+'-'+_0x22fe2a+'/'+_0x280c1a)[_0x194902('0x2')](_0x449ee4);}return null;};}function saveUpdates(_0x372d9c){return function(_0x3c717c){const _0x2466c1=a224_0x5630;if(_0x3c717c)return _0x3c717c[_0x2466c1('0x8')](_0x372d9c)[_0x2466c1('0xa')](function(_0x46b781){return _0x46b781;});return null;};}function removeEntity(_0x56c7af){return function(_0x426aeb){const _0x4755cc=a224_0x5630;if(_0x426aeb)return _0x426aeb[_0x4755cc('0x5')]()[_0x4755cc('0xa')](function(){const _0x50b540=_0x4755cc;_0x56c7af['status'](0xcc)[_0x50b540('0x35')]();});};}function handleEntityNotFound(_0x5a77de){return function(_0x2ea8e7){const _0x3e763e=a224_0x5630;return!_0x2ea8e7&&_0x5a77de[_0x3e763e('0x18')](0x194),_0x2ea8e7;};}function handleError(_0x52b420,_0x22375b){return _0x22375b=_0x22375b||0x1f4,function(_0x35aacf){const _0x1b6847=a224_0x5630;logger[_0x1b6847('0x31')](_0x35aacf[_0x1b6847('0x7')]),_0x35aacf[_0x1b6847('0x37')]&&delete _0x35aacf['name'],_0x52b420['status'](_0x22375b)[_0x1b6847('0xf')](_0x35aacf);};}exports[_0x2c4172('0x1')]=function(_0x170bca,_0x4cae0e){const _0x539ce8=_0x2c4172;let _0x3c75b1={};const _0x4e9cf8={},_0x186052={'count':0x0,'rows':[]},_0x13dbb1=_[_0x539ce8('0x20')](db['FaxTransferReport'][_0x539ce8('0x25')],function(_0x29e68c){const _0x349a55=_0x539ce8;return{'name':_0x29e68c[_0x349a55('0x12')],'type':_0x29e68c[_0x349a55('0x21')][_0x349a55('0x34')]};});_0x4e9cf8['model']=_[_0x539ce8('0x20')](_0x13dbb1,_0x539ce8('0x37')),_0x4e9cf8[_0x539ce8('0x29')]=_[_0x539ce8('0x1f')](_0x170bca[_0x539ce8('0x29')]),_0x4e9cf8[_0x539ce8('0x2c')]=_[_0x539ce8('0x3')](_0x4e9cf8[_0x539ce8('0x1e')],_0x4e9cf8[_0x539ce8('0x29')]),_0x3c75b1['attributes']=_[_0x539ce8('0x3')](_0x4e9cf8['model'],qs['fields'](_0x170bca[_0x539ce8('0x29')][_0x539ce8('0x32')])),_0x3c75b1[_0x539ce8('0x1b')]=_0x3c75b1['attributes'][_0x539ce8('0x6')]?_0x3c75b1['attributes']:_0x4e9cf8['model'];typeof _0x170bca['query'][_0x539ce8('0x4')]===_0x539ce8('0x1d')&&(_0x3c75b1[_0x539ce8('0x0')]=qs['limit'](_0x170bca[_0x539ce8('0x29')]['limit']),_0x3c75b1[_0x539ce8('0x15')]=qs[_0x539ce8('0x15')](_0x170bca[_0x539ce8('0x29')][_0x539ce8('0x15')]));_0x3c75b1[_0x539ce8('0x28')]=qs[_0x539ce8('0x36')](_0x170bca['query'][_0x539ce8('0x36')]),_0x3c75b1['where']=qs['filters'](_[_0x539ce8('0x17')](_0x170bca['query'],_0x4e9cf8['filters']),_0x13dbb1);_0x170bca[_0x539ce8('0x29')][_0x539ce8('0xc')]&&(_0x3c75b1[_0x539ce8('0x1a')]=_[_0x539ce8('0xe')](_0x3c75b1[_0x539ce8('0x1a')],{[Op['or']]:_['map'](_0x13dbb1,function(_0x3b1956){const _0x196a87=_0x539ce8;if(_0x3b1956[_0x196a87('0x21')]!==_0x196a87('0x27')){const _0x1677b6={};return _0x1677b6[_0x3b1956[_0x196a87('0x37')]]={[Op[_0x196a87('0x2b')]]:'%'+_0x170bca[_0x196a87('0x29')][_0x196a87('0xc')]+'%'},_0x1677b6;}})}));_0x3c75b1=_[_0x539ce8('0xe')]({},_0x3c75b1,_0x170bca[_0x539ce8('0x2e')]);const _0x15ec5e={'where':_0x3c75b1[_0x539ce8('0x1a')]};return db[_0x539ce8('0x33')][_0x539ce8('0x11')](_0x15ec5e)[_0x539ce8('0xa')](function(_0x48e32c){const _0x4428d1=_0x539ce8;return _0x186052[_0x4428d1('0x11')]=_0x48e32c,_0x170bca['query']['includeAll']&&(_0x3c75b1[_0x4428d1('0x16')]=[{'all':!![]}]),db[_0x4428d1('0x33')][_0x4428d1('0x30')](_0x3c75b1);})[_0x539ce8('0xa')](function(_0x51f3fd){const _0x51e49b=_0x539ce8;return _0x186052[_0x51e49b('0x19')]=_0x51f3fd,_0x186052;})['then'](respondWithFilteredResult(_0x4cae0e,_0x3c75b1))['catch'](handleError(_0x4cae0e,null));},exports['show']=function(_0x417a78,_0x306bfe){const _0xb14d85=_0x2c4172;let _0x4ec456={'raw':!![],'where':{'id':_0x417a78[_0xb14d85('0x23')]['id']}};const _0x48dd24={};return _0x48dd24[_0xb14d85('0x1e')]=_[_0xb14d85('0x1f')](db['FaxTransferReport']['rawAttributes']),_0x48dd24[_0xb14d85('0x29')]=_[_0xb14d85('0x1f')](_0x417a78[_0xb14d85('0x29')]),_0x48dd24['filters']=_['intersection'](_0x48dd24[_0xb14d85('0x1e')],_0x48dd24['query']),_0x4ec456[_0xb14d85('0x1b')]=_[_0xb14d85('0x3')](_0x48dd24['model'],qs[_0xb14d85('0x32')](_0x417a78[_0xb14d85('0x29')][_0xb14d85('0x32')])),_0x4ec456[_0xb14d85('0x1b')]=_0x4ec456[_0xb14d85('0x1b')]['length']?_0x4ec456[_0xb14d85('0x1b')]:_0x48dd24['model'],_0x417a78[_0xb14d85('0x29')][_0xb14d85('0x2f')]&&(_0x4ec456[_0xb14d85('0x16')]=[{'all':!![]}]),_0x4ec456=_[_0xb14d85('0xe')]({},_0x4ec456,_0x417a78[_0xb14d85('0x2e')]),db[_0xb14d85('0x33')][_0xb14d85('0x24')](_0x4ec456)[_0xb14d85('0xa')](handleEntityNotFound(_0x306bfe,null))[_0xb14d85('0xa')](respondWithResult(_0x306bfe,null))['catch'](handleError(_0x306bfe,null));},exports[_0x2c4172('0x10')]=function(_0x64fa03,_0x196cc7){const _0x29e0ea=_0x2c4172;return db['FaxTransferReport'][_0x29e0ea('0x10')](_0x64fa03[_0x29e0ea('0x22')],{})[_0x29e0ea('0xa')](respondWithResult(_0x196cc7,0xc9))[_0x29e0ea('0x26')](handleError(_0x196cc7,null));},exports[_0x2c4172('0x8')]=function(_0x3f29c8,_0x4e2acd){const _0x404c51=_0x2c4172;return _0x3f29c8[_0x404c51('0x22')]['id']&&delete _0x3f29c8['body']['id'],db[_0x404c51('0x33')]['findOne']({'where':{'id':_0x3f29c8[_0x404c51('0x23')]['id']}})[_0x404c51('0xa')](handleEntityNotFound(_0x4e2acd,null))['then'](saveUpdates(_0x3f29c8[_0x404c51('0x22')],null))[_0x404c51('0xa')](respondWithResult(_0x4e2acd,null))['catch'](handleError(_0x4e2acd,null));},exports[_0x2c4172('0x5')]=function(_0x28bfd7,_0x1d008a){const _0x4cb151=_0x2c4172;return db[_0x4cb151('0x33')][_0x4cb151('0x24')]({'where':{'id':_0x28bfd7[_0x4cb151('0x23')]['id']}})[_0x4cb151('0xa')](handleEntityNotFound(_0x1d008a,null))[_0x4cb151('0xa')](removeEntity(_0x1d008a,null))[_0x4cb151('0x26')](handleError(_0x1d008a,null));},exports[_0x2c4172('0x9')]=function(_0xfee9,_0x3b5488){const _0xf92aa1=_0x2c4172;return db[_0xf92aa1('0x33')][_0xf92aa1('0x9')]()[_0xf92aa1('0xa')](respondWithResult(_0x3b5488,null))[_0xf92aa1('0x26')](handleError(_0x3b5488,null));};
\ No newline at end of file