Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / faxQueueReport / faxQueueReport.controller.js
index 215b6ca..6a2d47d 100644 (file)
@@ -1 +1 @@
-const a260_0x4708=['../../config/logger','fields','status','include','body','index','order','limit','key','options','destroy','length','send','sort','catch','merge','includeAll','create','api','query','findAll','type','filter','pick','intersection','model','undefined','attributes','count','map','update','nolimit','filters','name','set','stack','show','sendStatus','findOne','json','VIRTUAL','then','offset','params','lodash','where','keys','describe','FaxQueueReport','rawAttributes','like'];(function(_0x4f23dc,_0x2db4ce){const _0x4708d0=function(_0xac7725){while(--_0xac7725){_0x4f23dc['push'](_0x4f23dc['shift']());}};_0x4708d0(++_0x2db4ce);}(a260_0x4708,0x6b));const a260_0xac77=function(_0x4f23dc,_0x2db4ce){_0x4f23dc=_0x4f23dc-0x180;let _0x4708d0=a260_0x4708[_0x4f23dc];return _0x4708d0;};const a260_0x56c30d=a260_0xac77;'use strict';const _=require(a260_0x56c30d(0x1a7)),qs=require('../../components/parsers/qs'),logger=require(a260_0x56c30d(0x1ae))(a260_0x56c30d(0x18d)),{db}=require('../../mysqldb'),{Op}=require('sequelize');function respondWithResult(_0x31f245,_0x3d123b){return _0x3d123b=_0x3d123b||0xc8,function(_0x37ff32){const _0x28fa5c=a260_0xac77;if(_0x37ff32)return _0x31f245[_0x28fa5c(0x1b0)](_0x3d123b)[_0x28fa5c(0x1a2)](_0x37ff32);};}function respondWithFilteredResult(_0x48693f,_0x32c05d){return function(_0xe87c6d){const _0x332e61=a260_0xac77;if(_0xe87c6d){const _0x239d2e=_0xe87c6d[_0x332e61(0x197)],_0x2a922e=_0x32c05d[_0x332e61(0x1a5)];let _0x24882e=_0x32c05d[_0x332e61(0x1a5)]+_0x32c05d['limit'],_0x59d6ee;return _0x24882e>=_0x239d2e?(_0x24882e=_0x239d2e,_0x59d6ee=0xc8):_0x59d6ee=0xce,_0x48693f[_0x332e61(0x1b0)](_0x59d6ee),_0x48693f[_0x332e61(0x19d)]('Content-Range',_0x2a922e+'-'+_0x24882e+'/'+_0x239d2e)[_0x332e61(0x1a2)](_0xe87c6d);}return null;};}function saveUpdates(_0x46d341){return function(_0x17fb01){const _0x1f5b03=a260_0xac77;if(_0x17fb01)return _0x17fb01[_0x1f5b03(0x199)](_0x46d341)[_0x1f5b03(0x1a4)](function(_0x2f41b2){return _0x2f41b2;});return null;};}function removeEntity(_0x3cc888){return function(_0x351c50){const _0x159cd7=a260_0xac77;if(_0x351c50)return _0x351c50[_0x159cd7(0x185)]()['then'](function(){_0x3cc888['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x29e4fc){return function(_0x27c2f6){const _0x2da857=a260_0xac77;return!_0x27c2f6&&_0x29e4fc[_0x2da857(0x1a0)](0x194),_0x27c2f6;};}function handleError(_0x2c0f44,_0x873ff2){return _0x873ff2=_0x873ff2||0x1f4,function(_0x157be1){const _0x1274d9=a260_0xac77;logger['error'](_0x157be1[_0x1274d9(0x19e)]),_0x157be1[_0x1274d9(0x19c)]&&delete _0x157be1['name'],_0x2c0f44[_0x1274d9(0x1b0)](_0x873ff2)[_0x1274d9(0x187)](_0x157be1);};}exports[a260_0x56c30d(0x180)]=function(_0x528a69,_0x3f80d3){const _0x233204=a260_0x56c30d;let _0x3d26c3={};const _0x579e67={},_0xbd00da={'count':0x0,'rows':[]},_0x8891e0=_[_0x233204(0x198)](db[_0x233204(0x1ab)][_0x233204(0x1ac)],function(_0x52d7b2){const _0x749aa4=_0x233204;return{'name':_0x52d7b2['fieldName'],'type':_0x52d7b2[_0x749aa4(0x190)][_0x749aa4(0x183)]};});_0x579e67[_0x233204(0x194)]=_[_0x233204(0x198)](_0x8891e0,_0x233204(0x19c)),_0x579e67[_0x233204(0x18e)]=_[_0x233204(0x1a9)](_0x528a69[_0x233204(0x18e)]),_0x579e67['filters']=_['intersection'](_0x579e67['model'],_0x579e67[_0x233204(0x18e)]),_0x3d26c3['attributes']=_[_0x233204(0x193)](_0x579e67[_0x233204(0x194)],qs['fields'](_0x528a69['query'][_0x233204(0x1af)])),_0x3d26c3[_0x233204(0x196)]=_0x3d26c3['attributes']['length']?_0x3d26c3[_0x233204(0x196)]:_0x579e67[_0x233204(0x194)];typeof _0x528a69[_0x233204(0x18e)][_0x233204(0x19a)]===_0x233204(0x195)&&(_0x3d26c3['limit']=qs[_0x233204(0x182)](_0x528a69[_0x233204(0x18e)]['limit']),_0x3d26c3[_0x233204(0x1a5)]=qs[_0x233204(0x1a5)](_0x528a69[_0x233204(0x18e)][_0x233204(0x1a5)]));_0x3d26c3[_0x233204(0x181)]=qs[_0x233204(0x188)](_0x528a69['query'][_0x233204(0x188)]),_0x3d26c3[_0x233204(0x1a8)]=qs[_0x233204(0x19b)](_[_0x233204(0x192)](_0x528a69['query'],_0x579e67['filters']),_0x8891e0);_0x528a69[_0x233204(0x18e)]['filter']&&(_0x3d26c3[_0x233204(0x1a8)]=_['merge'](_0x3d26c3[_0x233204(0x1a8)],{[Op['or']]:_[_0x233204(0x198)](_0x8891e0,function(_0x1a8b66){const _0x51495e=_0x233204;if(_0x1a8b66[_0x51495e(0x190)]!==_0x51495e(0x1a3)){const _0x1a02c1={};return _0x1a02c1[_0x1a8b66[_0x51495e(0x19c)]]={[Op[_0x51495e(0x1ad)]]:'%'+_0x528a69[_0x51495e(0x18e)][_0x51495e(0x191)]+'%'},_0x1a02c1;}})}));_0x3d26c3=_[_0x233204(0x18a)]({},_0x3d26c3,_0x528a69[_0x233204(0x184)]);const _0xd61190={'where':_0x3d26c3['where']};return db[_0x233204(0x1ab)]['count'](_0xd61190)['then'](function(_0x3f1e40){const _0x4b9217=_0x233204;return _0xbd00da[_0x4b9217(0x197)]=_0x3f1e40,_0x528a69[_0x4b9217(0x18e)][_0x4b9217(0x18b)]&&(_0x3d26c3[_0x4b9217(0x1b1)]=[{'all':!![]}]),db[_0x4b9217(0x1ab)][_0x4b9217(0x18f)](_0x3d26c3);})['then'](function(_0x1941d0){return _0xbd00da['rows']=_0x1941d0,_0xbd00da;})[_0x233204(0x1a4)](respondWithFilteredResult(_0x3f80d3,_0x3d26c3))[_0x233204(0x189)](handleError(_0x3f80d3,null));},exports[a260_0x56c30d(0x19f)]=function(_0x14b2da,_0x38d266){const _0x38bc56=a260_0x56c30d;let _0x5531b8={'raw':!![],'where':{'id':_0x14b2da['params']['id']}};const _0x4f7fbe={};return _0x4f7fbe[_0x38bc56(0x194)]=_[_0x38bc56(0x1a9)](db[_0x38bc56(0x1ab)][_0x38bc56(0x1ac)]),_0x4f7fbe['query']=_[_0x38bc56(0x1a9)](_0x14b2da[_0x38bc56(0x18e)]),_0x4f7fbe[_0x38bc56(0x19b)]=_[_0x38bc56(0x193)](_0x4f7fbe[_0x38bc56(0x194)],_0x4f7fbe['query']),_0x5531b8[_0x38bc56(0x196)]=_[_0x38bc56(0x193)](_0x4f7fbe[_0x38bc56(0x194)],qs[_0x38bc56(0x1af)](_0x14b2da[_0x38bc56(0x18e)][_0x38bc56(0x1af)])),_0x5531b8[_0x38bc56(0x196)]=_0x5531b8[_0x38bc56(0x196)][_0x38bc56(0x186)]?_0x5531b8['attributes']:_0x4f7fbe[_0x38bc56(0x194)],_0x14b2da[_0x38bc56(0x18e)][_0x38bc56(0x18b)]&&(_0x5531b8[_0x38bc56(0x1b1)]=[{'all':!![]}]),_0x5531b8=_['merge']({},_0x5531b8,_0x14b2da[_0x38bc56(0x184)]),db['FaxQueueReport']['findOne'](_0x5531b8)[_0x38bc56(0x1a4)](handleEntityNotFound(_0x38d266,null))[_0x38bc56(0x1a4)](respondWithResult(_0x38d266,null))[_0x38bc56(0x189)](handleError(_0x38d266,null));},exports[a260_0x56c30d(0x18c)]=function(_0xd15d54,_0x3c198e){const _0x180233=a260_0x56c30d;return db[_0x180233(0x1ab)][_0x180233(0x18c)](_0xd15d54[_0x180233(0x1b2)],{})[_0x180233(0x1a4)](respondWithResult(_0x3c198e,0xc9))[_0x180233(0x189)](handleError(_0x3c198e,null));},exports[a260_0x56c30d(0x199)]=function(_0x58d9a4,_0x3bbfd7){const _0x16ff97=a260_0x56c30d;return _0x58d9a4[_0x16ff97(0x1b2)]['id']&&delete _0x58d9a4[_0x16ff97(0x1b2)]['id'],db[_0x16ff97(0x1ab)][_0x16ff97(0x1a1)]({'where':{'id':_0x58d9a4[_0x16ff97(0x1a6)]['id']}})[_0x16ff97(0x1a4)](handleEntityNotFound(_0x3bbfd7,null))['then'](saveUpdates(_0x58d9a4['body'],null))[_0x16ff97(0x1a4)](respondWithResult(_0x3bbfd7,null))['catch'](handleError(_0x3bbfd7,null));},exports[a260_0x56c30d(0x185)]=function(_0x4db33d,_0x34698c){const _0xfb65c9=a260_0x56c30d;return db[_0xfb65c9(0x1ab)][_0xfb65c9(0x1a1)]({'where':{'id':_0x4db33d[_0xfb65c9(0x1a6)]['id']}})[_0xfb65c9(0x1a4)](handleEntityNotFound(_0x34698c,null))['then'](removeEntity(_0x34698c,null))[_0xfb65c9(0x189)](handleError(_0x34698c,null));},exports[a260_0x56c30d(0x1aa)]=function(_0x49424e,_0x178ed8){const _0x576a1b=a260_0x56c30d;return db[_0x576a1b(0x1ab)][_0x576a1b(0x1aa)]()['then'](respondWithResult(_0x178ed8,null))[_0x576a1b(0x189)](handleError(_0x178ed8,null));};
\ No newline at end of file
+const a260_0x5b3c=['pick','end','send','includeAll','findOne','name','where','order','rawAttributes','set','json','model','../../components/parsers/qs','key','filters','type','length','../../mysqldb','fieldName','params','fields','stack','intersection','filter','undefined','show','index','merge','options','../../config/logger','FaxQueueReport','update','Content-Range','destroy','rows','include','status','catch','findAll','body','attributes','create','keys','then','limit','map','sort','query','offset','sendStatus'];(function(_0xb63a40,_0x4a5414){const _0x5b3c76=function(_0x2ebe10){while(--_0x2ebe10){_0xb63a40['push'](_0xb63a40['shift']());}};_0x5b3c76(++_0x4a5414);}(a260_0x5b3c,0x82));const a260_0x2ebe=function(_0xb63a40,_0x4a5414){_0xb63a40=_0xb63a40-0x7f;let _0x5b3c76=a260_0x5b3c[_0xb63a40];return _0x5b3c76;};const a260_0x42e97d=a260_0x2ebe;'use strict';const _=require('lodash'),qs=require(a260_0x42e97d(0x9f)),logger=require(a260_0x42e97d(0xb0))('api'),{db}=require(a260_0x42e97d(0xa4)),{Op}=require('sequelize');function respondWithResult(_0x5dbada,_0x1fbd49){return _0x1fbd49=_0x1fbd49||0xc8,function(_0x551d78){const _0x20e1a8=a260_0x2ebe;if(_0x551d78)return _0x5dbada[_0x20e1a8(0x85)](_0x1fbd49)['json'](_0x551d78);};}function respondWithFilteredResult(_0x1fa4d4,_0x1906a5){return function(_0x5a4177){const _0x1486b2=a260_0x2ebe;if(_0x5a4177){const _0x3ce365=_0x5a4177['count'],_0x3cdb36=_0x1906a5['offset'];let _0x5c73bd=_0x1906a5[_0x1486b2(0x91)]+_0x1906a5[_0x1486b2(0x8d)],_0x3fc09b;return _0x5c73bd>=_0x3ce365?(_0x5c73bd=_0x3ce365,_0x3fc09b=0xc8):_0x3fc09b=0xce,_0x1fa4d4[_0x1486b2(0x85)](_0x3fc09b),_0x1fa4d4[_0x1486b2(0x9c)](_0x1486b2(0x81),_0x3cdb36+'-'+_0x5c73bd+'/'+_0x3ce365)[_0x1486b2(0x9d)](_0x5a4177);}return null;};}function saveUpdates(_0x53ccfe){return function(_0x59a5c8){const _0x317af3=a260_0x2ebe;if(_0x59a5c8)return _0x59a5c8[_0x317af3(0x80)](_0x53ccfe)[_0x317af3(0x8c)](function(_0x2a95c5){return _0x2a95c5;});return null;};}function removeEntity(_0x534030){return function(_0x4d2373){const _0x32525e=a260_0x2ebe;if(_0x4d2373)return _0x4d2373[_0x32525e(0x82)]()[_0x32525e(0x8c)](function(){const _0x43c004=_0x32525e;_0x534030[_0x43c004(0x85)](0xcc)[_0x43c004(0x94)]();});};}function handleEntityNotFound(_0x2e3faf){return function(_0x1c1e35){const _0x5a3e14=a260_0x2ebe;return!_0x1c1e35&&_0x2e3faf[_0x5a3e14(0x92)](0x194),_0x1c1e35;};}function handleError(_0x1eb6cb,_0x2726ba){return _0x2726ba=_0x2726ba||0x1f4,function(_0x2463e0){const _0xbad7cd=a260_0x2ebe;logger['error'](_0x2463e0[_0xbad7cd(0xa8)]),_0x2463e0[_0xbad7cd(0x98)]&&delete _0x2463e0['name'],_0x1eb6cb[_0xbad7cd(0x85)](_0x2726ba)[_0xbad7cd(0x95)](_0x2463e0);};}exports[a260_0x42e97d(0xad)]=function(_0x5bef3f,_0x2a8390){const _0x23559f=a260_0x42e97d;let _0x1c7d46={};const _0x27cef1={},_0xee8c2={'count':0x0,'rows':[]},_0x53f8a7=_[_0x23559f(0x8e)](db['FaxQueueReport'][_0x23559f(0x9b)],function(_0x3e5c23){const _0x115688=_0x23559f;return{'name':_0x3e5c23[_0x115688(0xa5)],'type':_0x3e5c23[_0x115688(0xa2)][_0x115688(0xa0)]};});_0x27cef1[_0x23559f(0x9e)]=_[_0x23559f(0x8e)](_0x53f8a7,'name'),_0x27cef1['query']=_[_0x23559f(0x8b)](_0x5bef3f[_0x23559f(0x90)]),_0x27cef1['filters']=_[_0x23559f(0xa9)](_0x27cef1[_0x23559f(0x9e)],_0x27cef1['query']),_0x1c7d46['attributes']=_[_0x23559f(0xa9)](_0x27cef1[_0x23559f(0x9e)],qs['fields'](_0x5bef3f['query'][_0x23559f(0xa7)])),_0x1c7d46[_0x23559f(0x89)]=_0x1c7d46[_0x23559f(0x89)][_0x23559f(0xa3)]?_0x1c7d46['attributes']:_0x27cef1['model'];typeof _0x5bef3f[_0x23559f(0x90)]['nolimit']===_0x23559f(0xab)&&(_0x1c7d46[_0x23559f(0x8d)]=qs['limit'](_0x5bef3f[_0x23559f(0x90)][_0x23559f(0x8d)]),_0x1c7d46['offset']=qs[_0x23559f(0x91)](_0x5bef3f[_0x23559f(0x90)][_0x23559f(0x91)]));_0x1c7d46[_0x23559f(0x9a)]=qs[_0x23559f(0x8f)](_0x5bef3f[_0x23559f(0x90)][_0x23559f(0x8f)]),_0x1c7d46[_0x23559f(0x99)]=qs[_0x23559f(0xa1)](_[_0x23559f(0x93)](_0x5bef3f['query'],_0x27cef1['filters']),_0x53f8a7);_0x5bef3f[_0x23559f(0x90)]['filter']&&(_0x1c7d46[_0x23559f(0x99)]=_['merge'](_0x1c7d46[_0x23559f(0x99)],{[Op['or']]:_['map'](_0x53f8a7,function(_0x5db7a6){const _0x8530b9=_0x23559f;if(_0x5db7a6['type']!=='VIRTUAL'){const _0xd30bf3={};return _0xd30bf3[_0x5db7a6[_0x8530b9(0x98)]]={[Op['like']]:'%'+_0x5bef3f[_0x8530b9(0x90)][_0x8530b9(0xaa)]+'%'},_0xd30bf3;}})}));_0x1c7d46=_[_0x23559f(0xae)]({},_0x1c7d46,_0x5bef3f['options']);const _0x29dcb5={'where':_0x1c7d46[_0x23559f(0x99)]};return db[_0x23559f(0x7f)]['count'](_0x29dcb5)['then'](function(_0x5d30b5){const _0x58c573=_0x23559f;return _0xee8c2['count']=_0x5d30b5,_0x5bef3f[_0x58c573(0x90)][_0x58c573(0x96)]&&(_0x1c7d46[_0x58c573(0x84)]=[{'all':!![]}]),db[_0x58c573(0x7f)][_0x58c573(0x87)](_0x1c7d46);})[_0x23559f(0x8c)](function(_0x52fab3){const _0x481349=_0x23559f;return _0xee8c2[_0x481349(0x83)]=_0x52fab3,_0xee8c2;})['then'](respondWithFilteredResult(_0x2a8390,_0x1c7d46))['catch'](handleError(_0x2a8390,null));},exports[a260_0x42e97d(0xac)]=function(_0x281aa7,_0x26c452){const _0x76833=a260_0x42e97d;let _0x43cc84={'raw':!![],'where':{'id':_0x281aa7[_0x76833(0xa6)]['id']}};const _0x2147d6={};return _0x2147d6['model']=_[_0x76833(0x8b)](db[_0x76833(0x7f)][_0x76833(0x9b)]),_0x2147d6[_0x76833(0x90)]=_[_0x76833(0x8b)](_0x281aa7[_0x76833(0x90)]),_0x2147d6[_0x76833(0xa1)]=_[_0x76833(0xa9)](_0x2147d6['model'],_0x2147d6['query']),_0x43cc84[_0x76833(0x89)]=_[_0x76833(0xa9)](_0x2147d6[_0x76833(0x9e)],qs[_0x76833(0xa7)](_0x281aa7[_0x76833(0x90)][_0x76833(0xa7)])),_0x43cc84[_0x76833(0x89)]=_0x43cc84[_0x76833(0x89)][_0x76833(0xa3)]?_0x43cc84[_0x76833(0x89)]:_0x2147d6[_0x76833(0x9e)],_0x281aa7[_0x76833(0x90)][_0x76833(0x96)]&&(_0x43cc84[_0x76833(0x84)]=[{'all':!![]}]),_0x43cc84=_['merge']({},_0x43cc84,_0x281aa7[_0x76833(0xaf)]),db[_0x76833(0x7f)][_0x76833(0x97)](_0x43cc84)[_0x76833(0x8c)](handleEntityNotFound(_0x26c452,null))['then'](respondWithResult(_0x26c452,null))['catch'](handleError(_0x26c452,null));},exports[a260_0x42e97d(0x8a)]=function(_0x1884ca,_0x58e1fc){const _0x48da38=a260_0x42e97d;return db['FaxQueueReport'][_0x48da38(0x8a)](_0x1884ca[_0x48da38(0x88)],{})[_0x48da38(0x8c)](respondWithResult(_0x58e1fc,0xc9))[_0x48da38(0x86)](handleError(_0x58e1fc,null));},exports[a260_0x42e97d(0x80)]=function(_0x11417c,_0x2bc50e){const _0x163f5f=a260_0x42e97d;return _0x11417c[_0x163f5f(0x88)]['id']&&delete _0x11417c['body']['id'],db[_0x163f5f(0x7f)][_0x163f5f(0x97)]({'where':{'id':_0x11417c[_0x163f5f(0xa6)]['id']}})['then'](handleEntityNotFound(_0x2bc50e,null))[_0x163f5f(0x8c)](saveUpdates(_0x11417c[_0x163f5f(0x88)],null))[_0x163f5f(0x8c)](respondWithResult(_0x2bc50e,null))[_0x163f5f(0x86)](handleError(_0x2bc50e,null));},exports[a260_0x42e97d(0x82)]=function(_0x1e1db5,_0xbc5875){const _0x294dcc=a260_0x42e97d;return db['FaxQueueReport'][_0x294dcc(0x97)]({'where':{'id':_0x1e1db5[_0x294dcc(0xa6)]['id']}})['then'](handleEntityNotFound(_0xbc5875,null))[_0x294dcc(0x8c)](removeEntity(_0xbc5875,null))[_0x294dcc(0x86)](handleError(_0xbc5875,null));},exports['describe']=function(_0x5656fa,_0x4629bc){const _0x42d4b8=a260_0x42e97d;return db[_0x42d4b8(0x7f)]['describe']()[_0x42d4b8(0x8c)](respondWithResult(_0x4629bc,null))[_0x42d4b8(0x86)](handleError(_0x4629bc,null));};
\ No newline at end of file