Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / api / smsTransferReport / smsTransferReport.controller.js
1 const a579_0x2c24=['destroy','where','rows','json','findAll','merge','../../mysqldb','fields','end','describe','create','show','lodash','stack','error','like','filters','rawAttributes','attributes','query','order','Content-Range','then','params','undefined','SmsTransferReport','nolimit','map','api','length','model','offset','findOne','../../config/logger','body','fieldName','intersection','name','sort','../../components/parsers/qs','type','limit','key','keys','send','update','sequelize','catch','include','status','includeAll','options','count'];(function(_0x36d93e,_0x2c247a){const _0xc195d3=function(_0x302d0e){while(--_0x302d0e){_0x36d93e['push'](_0x36d93e['shift']());}};_0xc195d3(++_0x2c247a);}(a579_0x2c24,0x1f0));const a579_0xc195=function(_0x36d93e,_0x2c247a){_0x36d93e=_0x36d93e-0x0;let _0xc195d3=a579_0x2c24[_0x36d93e];return _0xc195d3;};const _0x316f4c=a579_0xc195;'use strict';const _=require(_0x316f4c('0x2e')),qs=require(_0x316f4c('0x14')),logger=require(_0x316f4c('0xe'))(_0x316f4c('0x9')),db=require(_0x316f4c('0x28'))['db'],{Op}=require(_0x316f4c('0x1b'));function respondWithResult(_0x302d0e,_0x462c3c){return _0x462c3c=_0x462c3c||0xc8,function(_0xb354ab){const _0x25c65e=a579_0xc195;if(_0xb354ab)return _0x302d0e[_0x25c65e('0x1e')](_0x462c3c)['json'](_0xb354ab);};}function respondWithFilteredResult(_0x9bedfa,_0x48d99e){return function(_0x19f758){const _0xd82759=a579_0xc195;if(_0x19f758){const _0x3c55e5=_0x19f758[_0xd82759('0x21')],_0x2a88d6=_0x48d99e[_0xd82759('0xc')];let _0x42d2d0=_0x48d99e[_0xd82759('0xc')]+_0x48d99e[_0xd82759('0x16')],_0x256e58;return _0x42d2d0>=_0x3c55e5?(_0x42d2d0=_0x3c55e5,_0x256e58=0xc8):_0x256e58=0xce,_0x9bedfa[_0xd82759('0x1e')](_0x256e58),_0x9bedfa['set'](_0xd82759('0x2'),_0x2a88d6+'-'+_0x42d2d0+'/'+_0x3c55e5)[_0xd82759('0x25')](_0x19f758);}return null;};}function saveUpdates(_0x30f925){return function(_0x491b87){const _0x1dbdff=a579_0xc195;if(_0x491b87)return _0x491b87[_0x1dbdff('0x1a')](_0x30f925)[_0x1dbdff('0x3')](function(_0x438008){return _0x438008;});return null;};}function removeEntity(_0x32d797){return function(_0x84e4b2){if(_0x84e4b2)return _0x84e4b2['destroy']()['then'](function(){const _0x286d1a=a579_0xc195;_0x32d797[_0x286d1a('0x1e')](0xcc)[_0x286d1a('0x2a')]();});};}function handleEntityNotFound(_0x2ae10b){return function(_0x8c4543){return!_0x8c4543&&_0x2ae10b['sendStatus'](0x194),_0x8c4543;};}function handleError(_0x2fb413,_0x532e0e){return _0x532e0e=_0x532e0e||0x1f4,function(_0x463d12){const _0xb081c9=a579_0xc195;logger[_0xb081c9('0x30')](_0x463d12[_0xb081c9('0x2f')]),_0x463d12[_0xb081c9('0x12')]&&delete _0x463d12[_0xb081c9('0x12')],_0x2fb413[_0xb081c9('0x1e')](_0x532e0e)[_0xb081c9('0x19')](_0x463d12);};}exports['index']=function(_0xf69901,_0x985bcd){const _0x55deac=_0x316f4c;let _0x49dfba={};const _0x3f04a6={},_0xa83f16={'count':0x0,'rows':[]},_0x3ed8ec=_[_0x55deac('0x8')](db[_0x55deac('0x6')][_0x55deac('0x33')],function(_0x388035){const _0x337b4a=_0x55deac;return{'name':_0x388035[_0x337b4a('0x10')],'type':_0x388035[_0x337b4a('0x15')][_0x337b4a('0x17')]};});_0x3f04a6[_0x55deac('0xb')]=_[_0x55deac('0x8')](_0x3ed8ec,_0x55deac('0x12')),_0x3f04a6[_0x55deac('0x0')]=_['keys'](_0xf69901[_0x55deac('0x0')]),_0x3f04a6['filters']=_[_0x55deac('0x11')](_0x3f04a6[_0x55deac('0xb')],_0x3f04a6[_0x55deac('0x0')]),_0x49dfba[_0x55deac('0x34')]=_['intersection'](_0x3f04a6['model'],qs[_0x55deac('0x29')](_0xf69901[_0x55deac('0x0')][_0x55deac('0x29')])),_0x49dfba['attributes']=_0x49dfba[_0x55deac('0x34')][_0x55deac('0xa')]?_0x49dfba['attributes']:_0x3f04a6[_0x55deac('0xb')];typeof _0xf69901[_0x55deac('0x0')][_0x55deac('0x7')]===_0x55deac('0x5')&&(_0x49dfba[_0x55deac('0x16')]=qs[_0x55deac('0x16')](_0xf69901[_0x55deac('0x0')]['limit']),_0x49dfba[_0x55deac('0xc')]=qs[_0x55deac('0xc')](_0xf69901[_0x55deac('0x0')][_0x55deac('0xc')]));_0x49dfba[_0x55deac('0x1')]=qs['sort'](_0xf69901['query'][_0x55deac('0x13')]),_0x49dfba[_0x55deac('0x23')]=qs[_0x55deac('0x32')](_['pick'](_0xf69901[_0x55deac('0x0')],_0x3f04a6[_0x55deac('0x32')]),_0x3ed8ec);_0xf69901['query']['filter']&&(_0x49dfba[_0x55deac('0x23')]=_[_0x55deac('0x27')](_0x49dfba[_0x55deac('0x23')],{[Op['or']]:_[_0x55deac('0x8')](_0x3ed8ec,function(_0x1575d9){const _0x3221ab=_0x55deac;if(_0x1575d9[_0x3221ab('0x15')]!=='VIRTUAL'){const _0x3ec091={};return _0x3ec091[_0x1575d9[_0x3221ab('0x12')]]={[Op[_0x3221ab('0x31')]]:'%'+_0xf69901[_0x3221ab('0x0')]['filter']+'%'},_0x3ec091;}})}));_0x49dfba=_[_0x55deac('0x27')]({},_0x49dfba,_0xf69901[_0x55deac('0x20')]);const _0x32322d={'where':_0x49dfba[_0x55deac('0x23')]};return db[_0x55deac('0x6')][_0x55deac('0x21')](_0x32322d)['then'](function(_0x99b51c){const _0x544faa=_0x55deac;return _0xa83f16[_0x544faa('0x21')]=_0x99b51c,_0xf69901[_0x544faa('0x0')][_0x544faa('0x1f')]&&(_0x49dfba[_0x544faa('0x1d')]=[{'all':!![]}]),db[_0x544faa('0x6')][_0x544faa('0x26')](_0x49dfba);})[_0x55deac('0x3')](function(_0x5e289d){const _0x255bfc=_0x55deac;return _0xa83f16[_0x255bfc('0x24')]=_0x5e289d,_0xa83f16;})[_0x55deac('0x3')](respondWithFilteredResult(_0x985bcd,_0x49dfba))['catch'](handleError(_0x985bcd,null));},exports[_0x316f4c('0x2d')]=function(_0x4e48d1,_0x4c1b09){const _0x144342=_0x316f4c;let _0x307fa8={'raw':!![],'where':{'id':_0x4e48d1['params']['id']}};const _0x268c63={};return _0x268c63[_0x144342('0xb')]=_[_0x144342('0x18')](db[_0x144342('0x6')][_0x144342('0x33')]),_0x268c63[_0x144342('0x0')]=_['keys'](_0x4e48d1['query']),_0x268c63['filters']=_[_0x144342('0x11')](_0x268c63[_0x144342('0xb')],_0x268c63[_0x144342('0x0')]),_0x307fa8[_0x144342('0x34')]=_['intersection'](_0x268c63[_0x144342('0xb')],qs['fields'](_0x4e48d1['query'][_0x144342('0x29')])),_0x307fa8[_0x144342('0x34')]=_0x307fa8[_0x144342('0x34')][_0x144342('0xa')]?_0x307fa8[_0x144342('0x34')]:_0x268c63[_0x144342('0xb')],_0x4e48d1[_0x144342('0x0')]['includeAll']&&(_0x307fa8[_0x144342('0x1d')]=[{'all':!![]}]),_0x307fa8=_[_0x144342('0x27')]({},_0x307fa8,_0x4e48d1[_0x144342('0x20')]),db[_0x144342('0x6')][_0x144342('0xd')](_0x307fa8)[_0x144342('0x3')](handleEntityNotFound(_0x4c1b09,null))['then'](respondWithResult(_0x4c1b09,null))[_0x144342('0x1c')](handleError(_0x4c1b09,null));},exports[_0x316f4c('0x2c')]=function(_0x477e51,_0x39805d){const _0x172a23=_0x316f4c;return db[_0x172a23('0x6')]['create'](_0x477e51[_0x172a23('0xf')],{})[_0x172a23('0x3')](respondWithResult(_0x39805d,0xc9))[_0x172a23('0x1c')](handleError(_0x39805d,null));},exports[_0x316f4c('0x1a')]=function(_0x26e450,_0x575f07){const _0x304d1b=_0x316f4c;return _0x26e450['body']['id']&&delete _0x26e450[_0x304d1b('0xf')]['id'],db[_0x304d1b('0x6')][_0x304d1b('0xd')]({'where':{'id':_0x26e450['params']['id']}})[_0x304d1b('0x3')](handleEntityNotFound(_0x575f07,null))['then'](saveUpdates(_0x26e450[_0x304d1b('0xf')],null))[_0x304d1b('0x3')](respondWithResult(_0x575f07,null))[_0x304d1b('0x1c')](handleError(_0x575f07,null));},exports[_0x316f4c('0x22')]=function(_0x1e7b69,_0x1c25e1){const _0x40a12a=_0x316f4c;return db[_0x40a12a('0x6')][_0x40a12a('0xd')]({'where':{'id':_0x1e7b69[_0x40a12a('0x4')]['id']}})[_0x40a12a('0x3')](handleEntityNotFound(_0x1c25e1,null))[_0x40a12a('0x3')](removeEntity(_0x1c25e1,null))[_0x40a12a('0x1c')](handleError(_0x1c25e1,null));},exports[_0x316f4c('0x2b')]=function(_0x1b96f0,_0x219ded){const _0x119d93=_0x316f4c;return db[_0x119d93('0x6')][_0x119d93('0x2b')]()[_0x119d93('0x3')](respondWithResult(_0x219ded,null))[_0x119d93('0x1c')](handleError(_0x219ded,null));};