Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / mailTransferReport / mailTransferReport.controller.js
1 'use strict';const a534_0x1aa2=['699wBqsWO','options','nolimit','attributes','body','635695SJVBRk','MailTransferReport','order','undefined','includeAll','then','1432984lWhXOP','lodash','1437TuvaqD','type','query','show','@utils/filter-attributes','error','update','128824BsqflJ','347223axkcaA','intersection','sort','json','params','end','include','findOne','model','index','map','keys','create','1625340nscjIY','filter','status','1617116iOosTf','destroy','count','fields','name','@config/logger','key','@components/parsers/qs','findAll','merge','describe','catch','set','api','length','limit','@mysqldb','offset','where','1uzuXqH','filters'];const a534_0x9e37=function(_0x4f9cb9,_0x4ae12e){_0x4f9cb9=_0x4f9cb9-0x1ec;let _0x1aa22b=a534_0x1aa2[_0x4f9cb9];return _0x1aa22b;};const a534_0x5d9707=a534_0x9e37;(function(_0x5b62ee,_0x2806c9){const _0x90a4cb=a534_0x9e37;while(!![]){try{const _0x1aafa3=parseInt(_0x90a4cb(0x216))+parseInt(_0x90a4cb(0x224))+-parseInt(_0x90a4cb(0x20f))*parseInt(_0x90a4cb(0x202))+-parseInt(_0x90a4cb(0x217))+parseInt(_0x90a4cb(0x207))*parseInt(_0x90a4cb(0x200))+-parseInt(_0x90a4cb(0x1ed))+parseInt(_0x90a4cb(0x20d));if(_0x1aafa3===_0x2806c9)break;else _0x5b62ee['push'](_0x5b62ee['shift']());}catch(_0x45abc9){_0x5b62ee['push'](_0x5b62ee['shift']());}}}(a534_0x1aa2,0xd0819));const _=require(a534_0x5d9707(0x20e)),qs=require(a534_0x5d9707(0x1f4)),logger=require(a534_0x5d9707(0x1f2))(a534_0x5d9707(0x1fa)),{db}=require(a534_0x5d9707(0x1fd)),{filterAttributes}=require(a534_0x5d9707(0x213));function respondWithResult(_0x212551,_0x3168c0){return _0x3168c0=_0x3168c0||0xc8,function(_0x53d472){const _0x2a2f8c=a534_0x9e37;if(_0x53d472)return _0x212551[_0x2a2f8c(0x1ec)](_0x3168c0)[_0x2a2f8c(0x21a)](_0x53d472);};}function respondWithFilteredResult(_0x4cbd4d,_0x1b06ab){return function(_0x5a192c){const _0x40ba93=a534_0x9e37;if(_0x5a192c){const _0x324cc5=_0x5a192c[_0x40ba93(0x1ef)],_0xe8e252=_0x1b06ab[_0x40ba93(0x1fe)];let _0xc50980=_0x1b06ab[_0x40ba93(0x1fe)]+_0x1b06ab[_0x40ba93(0x1fc)],_0x1296eb;return _0xc50980>=_0x324cc5?(_0xc50980=_0x324cc5,_0x1296eb=0xc8):_0x1296eb=0xce,_0x4cbd4d[_0x40ba93(0x1ec)](_0x1296eb),_0x4cbd4d[_0x40ba93(0x1f9)]('Content-Range',_0xe8e252+'-'+_0xc50980+'/'+_0x324cc5)[_0x40ba93(0x21a)](_0x5a192c);}return null;};}function saveUpdates(_0x2c9c7b){return function(_0x2065f9){const _0x591ba8=a534_0x9e37;if(_0x2065f9)return _0x2065f9['update'](_0x2c9c7b)[_0x591ba8(0x20c)](function(_0x27e459){return _0x27e459;});return null;};}function removeEntity(_0x166463){return function(_0x53d42d){const _0x3b3e84=a534_0x9e37;if(_0x53d42d)return _0x53d42d[_0x3b3e84(0x1ee)]()['then'](function(){const _0x3910ef=_0x3b3e84;_0x166463['status'](0xcc)[_0x3910ef(0x21c)]();});};}function handleEntityNotFound(_0x1a8bc5){return function(_0x282dff){return!_0x282dff&&_0x1a8bc5['sendStatus'](0x194),_0x282dff;};}function handleError(_0x4e75a4,_0x57908b){return _0x57908b=_0x57908b||0x1f4,function(_0x29beeb){const _0x4ecff5=a534_0x9e37;logger[_0x4ecff5(0x214)](_0x29beeb['stack']),_0x29beeb[_0x4ecff5(0x1f1)]&&delete _0x29beeb[_0x4ecff5(0x1f1)],_0x4e75a4['status'](_0x57908b)['send'](_0x29beeb);};}exports[a534_0x5d9707(0x220)]=function(_0x51ff22,_0x302489){const _0x252597=a534_0x5d9707;let _0x286018={};const _0x139b99={},_0x5d38ef={'count':0x0,'rows':[]},_0x323ee4=_['map'](db['MailTransferReport']['rawAttributes'],function(_0x5e93af){const _0x29fa46=a534_0x9e37;return{'name':_0x5e93af['fieldName'],'type':_0x5e93af[_0x29fa46(0x210)][_0x29fa46(0x1f3)]};});_0x139b99[_0x252597(0x21f)]=_[_0x252597(0x221)](_0x323ee4,_0x252597(0x1f1)),_0x139b99[_0x252597(0x211)]=_['keys'](_0x51ff22[_0x252597(0x211)]),_0x139b99[_0x252597(0x201)]=_[_0x252597(0x218)](_0x139b99[_0x252597(0x21f)],_0x139b99['query']),_0x286018[_0x252597(0x205)]=_[_0x252597(0x218)](_0x139b99['model'],qs[_0x252597(0x1f0)](_0x51ff22[_0x252597(0x211)][_0x252597(0x1f0)])),_0x286018[_0x252597(0x205)]=_0x286018[_0x252597(0x205)][_0x252597(0x1fb)]?_0x286018[_0x252597(0x205)]:_0x139b99[_0x252597(0x21f)];typeof _0x51ff22[_0x252597(0x211)][_0x252597(0x204)]===_0x252597(0x20a)&&(_0x286018[_0x252597(0x1fc)]=qs[_0x252597(0x1fc)](_0x51ff22[_0x252597(0x211)][_0x252597(0x1fc)]),_0x286018[_0x252597(0x1fe)]=qs['offset'](_0x51ff22[_0x252597(0x211)][_0x252597(0x1fe)]));_0x286018[_0x252597(0x209)]=qs[_0x252597(0x219)](_0x51ff22[_0x252597(0x211)][_0x252597(0x219)]),_0x286018[_0x252597(0x1ff)]=qs[_0x252597(0x201)](_['pick'](_0x51ff22[_0x252597(0x211)],_0x139b99[_0x252597(0x201)]),_0x323ee4),_0x286018=filterAttributes(_0x286018,_0x51ff22['query'][_0x252597(0x225)],_0x323ee4,_0x51ff22['options']);const _0x2e2513={'where':_0x286018[_0x252597(0x1ff)]};return db['MailTransferReport']['count'](_0x2e2513)[_0x252597(0x20c)](function(_0x50e04a){const _0x109115=_0x252597;return _0x5d38ef[_0x109115(0x1ef)]=_0x50e04a,_0x51ff22[_0x109115(0x211)][_0x109115(0x20b)]&&(_0x286018[_0x109115(0x21d)]=[{'all':!![]}]),db[_0x109115(0x208)][_0x109115(0x1f5)](_0x286018);})[_0x252597(0x20c)](function(_0x1e24e7){return _0x5d38ef['rows']=_0x1e24e7,_0x5d38ef;})['then'](respondWithFilteredResult(_0x302489,_0x286018))[_0x252597(0x1f8)](handleError(_0x302489,null));},exports[a534_0x5d9707(0x212)]=function(_0xf4a219,_0x58cfe3){const _0x5c5827=a534_0x5d9707;let _0x57f93a={'raw':!![],'where':{'id':_0xf4a219[_0x5c5827(0x21b)]['id']}};const _0x5f0519={};return _0x5f0519[_0x5c5827(0x21f)]=_[_0x5c5827(0x222)](db[_0x5c5827(0x208)]['rawAttributes']),_0x5f0519[_0x5c5827(0x211)]=_[_0x5c5827(0x222)](_0xf4a219['query']),_0x5f0519[_0x5c5827(0x201)]=_[_0x5c5827(0x218)](_0x5f0519['model'],_0x5f0519[_0x5c5827(0x211)]),_0x57f93a[_0x5c5827(0x205)]=_[_0x5c5827(0x218)](_0x5f0519['model'],qs[_0x5c5827(0x1f0)](_0xf4a219['query'][_0x5c5827(0x1f0)])),_0x57f93a[_0x5c5827(0x205)]=_0x57f93a[_0x5c5827(0x205)]['length']?_0x57f93a['attributes']:_0x5f0519['model'],_0xf4a219['query'][_0x5c5827(0x20b)]&&(_0x57f93a[_0x5c5827(0x21d)]=[{'all':!![]}]),_0x57f93a=_[_0x5c5827(0x1f6)]({},_0x57f93a,_0xf4a219[_0x5c5827(0x203)]),db['MailTransferReport'][_0x5c5827(0x21e)](_0x57f93a)[_0x5c5827(0x20c)](handleEntityNotFound(_0x58cfe3,null))[_0x5c5827(0x20c)](respondWithResult(_0x58cfe3,null))[_0x5c5827(0x1f8)](handleError(_0x58cfe3,null));},exports[a534_0x5d9707(0x223)]=function(_0x51c1fc,_0xe5a66){const _0x46a83d=a534_0x5d9707;return db[_0x46a83d(0x208)][_0x46a83d(0x223)](_0x51c1fc[_0x46a83d(0x206)],{})[_0x46a83d(0x20c)](respondWithResult(_0xe5a66,0xc9))[_0x46a83d(0x1f8)](handleError(_0xe5a66,null));},exports[a534_0x5d9707(0x215)]=function(_0x35acb4,_0x2020fa){const _0x487a90=a534_0x5d9707;return _0x35acb4[_0x487a90(0x206)]['id']&&delete _0x35acb4['body']['id'],db['MailTransferReport']['findOne']({'where':{'id':_0x35acb4[_0x487a90(0x21b)]['id']}})[_0x487a90(0x20c)](handleEntityNotFound(_0x2020fa,null))['then'](saveUpdates(_0x35acb4[_0x487a90(0x206)],null))[_0x487a90(0x20c)](respondWithResult(_0x2020fa,null))[_0x487a90(0x1f8)](handleError(_0x2020fa,null));},exports['destroy']=function(_0x1a1a9b,_0x353faa){const _0x224f96=a534_0x5d9707;return db['MailTransferReport'][_0x224f96(0x21e)]({'where':{'id':_0x1a1a9b[_0x224f96(0x21b)]['id']}})[_0x224f96(0x20c)](handleEntityNotFound(_0x353faa,null))[_0x224f96(0x20c)](removeEntity(_0x353faa,null))[_0x224f96(0x1f8)](handleError(_0x353faa,null));},exports[a534_0x5d9707(0x1f7)]=function(_0x5ec555,_0x4ab160){const _0x3cdbe2=a534_0x5d9707;return db['MailTransferReport'][_0x3cdbe2(0x1f7)]()[_0x3cdbe2(0x20c)](respondWithResult(_0x4ab160,null))[_0x3cdbe2(0x1f8)](handleError(_0x4ab160,null));};