Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / chatQueueReport / chatQueueReport.controller.js
index da877d4..bc723ec 100644 (file)
@@ -1 +1 @@
-'use strict';const a122_0x2bbc=['options','1UcscCH','1010359xTJXXj','filter','update','offset','params','450236DaXbLK','name','model','intersection','Content-Range','@components/parsers/qs','show','status','stack','query','api','then','includeAll','lodash','13277YadTcs','fields','rows','filters','attributes','limit','index','map','catch','215863perDqj','keys','875302cjuEms','merge','key','sort','body','error','where','pick','include','rawAttributes','count','findAll','601877MvzGfB','describe','json','type','create','destroy','@utils/filter-attributes','order','2633207zMSGjs','length','ChatQueueReport'];const a122_0x284d=function(_0x50a17b,_0x8df1cd){_0x50a17b=_0x50a17b-0x148;let _0x2bbc3c=a122_0x2bbc[_0x50a17b];return _0x2bbc3c;};const a122_0x1e4ae8=a122_0x284d;(function(_0x267811,_0x140c5d){const _0x1c89ae=a122_0x284d;while(!![]){try{const _0x315fb3=parseInt(_0x1c89ae(0x15d))+parseInt(_0x1c89ae(0x174))+-parseInt(_0x1c89ae(0x14f))*parseInt(_0x1c89ae(0x149))+-parseInt(_0x1c89ae(0x168))+-parseInt(_0x1c89ae(0x14a))+-parseInt(_0x1c89ae(0x166))+parseInt(_0x1c89ae(0x17c));if(_0x315fb3===_0x140c5d)break;else _0x267811['push'](_0x267811['shift']());}catch(_0x1c8df6){_0x267811['push'](_0x267811['shift']());}}}(a122_0x2bbc,0xaa119));const _=require(a122_0x1e4ae8(0x15c)),qs=require(a122_0x1e4ae8(0x154)),logger=require('@config/logger')(a122_0x1e4ae8(0x159)),{db}=require('@mysqldb'),{filterAttributes}=require(a122_0x1e4ae8(0x17a));function respondWithResult(_0x13a8fc,_0x34e82f){return _0x34e82f=_0x34e82f||0xc8,function(_0x25ef3b){const _0x31b1dd=a122_0x284d;if(_0x25ef3b)return _0x13a8fc[_0x31b1dd(0x156)](_0x34e82f)[_0x31b1dd(0x176)](_0x25ef3b);};}function respondWithFilteredResult(_0x1272f7,_0x4d32e1){return function(_0x4141e3){const _0x535a94=a122_0x284d;if(_0x4141e3){const _0x3ace24=_0x4141e3[_0x535a94(0x172)],_0x5f3285=_0x4d32e1['offset'];let _0x33b187=_0x4d32e1['offset']+_0x4d32e1[_0x535a94(0x162)],_0x520661;return _0x33b187>=_0x3ace24?(_0x33b187=_0x3ace24,_0x520661=0xc8):_0x520661=0xce,_0x1272f7['status'](_0x520661),_0x1272f7['set'](_0x535a94(0x153),_0x5f3285+'-'+_0x33b187+'/'+_0x3ace24)['json'](_0x4141e3);}return null;};}function saveUpdates(_0x4c54e4){return function(_0x3da494){if(_0x3da494)return _0x3da494['update'](_0x4c54e4)['then'](function(_0x2531fb){return _0x2531fb;});return null;};}function removeEntity(_0x4b3497){return function(_0x5025dd){const _0x303d49=a122_0x284d;if(_0x5025dd)return _0x5025dd[_0x303d49(0x179)]()['then'](function(){const _0x5e6830=_0x303d49;_0x4b3497[_0x5e6830(0x156)](0xcc)['end']();});};}function handleEntityNotFound(_0x66523a){return function(_0x51bf92){return!_0x51bf92&&_0x66523a['sendStatus'](0x194),_0x51bf92;};}function handleError(_0x30c3e4,_0x38a87b){return _0x38a87b=_0x38a87b||0x1f4,function(_0x57df65){const _0x6e7639=a122_0x284d;logger[_0x6e7639(0x16d)](_0x57df65[_0x6e7639(0x157)]),_0x57df65[_0x6e7639(0x150)]&&delete _0x57df65['name'],_0x30c3e4[_0x6e7639(0x156)](_0x38a87b)['send'](_0x57df65);};}exports[a122_0x1e4ae8(0x163)]=function(_0x17860e,_0x489c71){const _0x51a2e1=a122_0x1e4ae8;let _0x263e90={};const _0x4d2143={},_0x5d2cb2={'count':0x0,'rows':[]},_0xaac34d=_[_0x51a2e1(0x164)](db[_0x51a2e1(0x17e)][_0x51a2e1(0x171)],function(_0x136e7f){const _0x4e5df1=_0x51a2e1;return{'name':_0x136e7f['fieldName'],'type':_0x136e7f[_0x4e5df1(0x177)][_0x4e5df1(0x16a)]};});_0x4d2143[_0x51a2e1(0x151)]=_[_0x51a2e1(0x164)](_0xaac34d,_0x51a2e1(0x150)),_0x4d2143[_0x51a2e1(0x158)]=_[_0x51a2e1(0x167)](_0x17860e[_0x51a2e1(0x158)]),_0x4d2143[_0x51a2e1(0x160)]=_[_0x51a2e1(0x152)](_0x4d2143[_0x51a2e1(0x151)],_0x4d2143[_0x51a2e1(0x158)]),_0x263e90[_0x51a2e1(0x161)]=_['intersection'](_0x4d2143[_0x51a2e1(0x151)],qs['fields'](_0x17860e[_0x51a2e1(0x158)]['fields'])),_0x263e90[_0x51a2e1(0x161)]=_0x263e90[_0x51a2e1(0x161)][_0x51a2e1(0x17d)]?_0x263e90[_0x51a2e1(0x161)]:_0x4d2143[_0x51a2e1(0x151)];typeof _0x17860e[_0x51a2e1(0x158)]['nolimit']==='undefined'&&(_0x263e90[_0x51a2e1(0x162)]=qs[_0x51a2e1(0x162)](_0x17860e['query'][_0x51a2e1(0x162)]),_0x263e90[_0x51a2e1(0x14d)]=qs['offset'](_0x17860e[_0x51a2e1(0x158)]['offset']));_0x263e90[_0x51a2e1(0x17b)]=qs[_0x51a2e1(0x16b)](_0x17860e[_0x51a2e1(0x158)][_0x51a2e1(0x16b)]),_0x263e90[_0x51a2e1(0x16e)]=qs[_0x51a2e1(0x160)](_[_0x51a2e1(0x16f)](_0x17860e[_0x51a2e1(0x158)],_0x4d2143[_0x51a2e1(0x160)]),_0xaac34d),_0x263e90=filterAttributes(_0x263e90,_0x17860e['query'][_0x51a2e1(0x14b)],_0xaac34d,_0x17860e['options']);const _0x69bd0d={'where':_0x263e90['where']};return db[_0x51a2e1(0x17e)][_0x51a2e1(0x172)](_0x69bd0d)[_0x51a2e1(0x15a)](function(_0x1d6866){const _0x1adbc1=_0x51a2e1;return _0x5d2cb2[_0x1adbc1(0x172)]=_0x1d6866,_0x17860e['query'][_0x1adbc1(0x15b)]&&(_0x263e90[_0x1adbc1(0x170)]=[{'all':!![]}]),db[_0x1adbc1(0x17e)][_0x1adbc1(0x173)](_0x263e90);})[_0x51a2e1(0x15a)](function(_0x5c3d15){const _0x4ac322=_0x51a2e1;return _0x5d2cb2[_0x4ac322(0x15f)]=_0x5c3d15,_0x5d2cb2;})[_0x51a2e1(0x15a)](respondWithFilteredResult(_0x489c71,_0x263e90))[_0x51a2e1(0x165)](handleError(_0x489c71,null));},exports[a122_0x1e4ae8(0x155)]=function(_0x29e380,_0x13f9b5){const _0x1c18f1=a122_0x1e4ae8;let _0x22a75d={'raw':!![],'where':{'id':_0x29e380['params']['id']}};const _0x705132={};return _0x705132['model']=_['keys'](db['ChatQueueReport'][_0x1c18f1(0x171)]),_0x705132[_0x1c18f1(0x158)]=_[_0x1c18f1(0x167)](_0x29e380['query']),_0x705132[_0x1c18f1(0x160)]=_[_0x1c18f1(0x152)](_0x705132[_0x1c18f1(0x151)],_0x705132['query']),_0x22a75d[_0x1c18f1(0x161)]=_[_0x1c18f1(0x152)](_0x705132[_0x1c18f1(0x151)],qs[_0x1c18f1(0x15e)](_0x29e380[_0x1c18f1(0x158)][_0x1c18f1(0x15e)])),_0x22a75d['attributes']=_0x22a75d[_0x1c18f1(0x161)][_0x1c18f1(0x17d)]?_0x22a75d[_0x1c18f1(0x161)]:_0x705132[_0x1c18f1(0x151)],_0x29e380[_0x1c18f1(0x158)]['includeAll']&&(_0x22a75d[_0x1c18f1(0x170)]=[{'all':!![]}]),_0x22a75d=_[_0x1c18f1(0x169)]({},_0x22a75d,_0x29e380[_0x1c18f1(0x148)]),db[_0x1c18f1(0x17e)]['findOne'](_0x22a75d)[_0x1c18f1(0x15a)](handleEntityNotFound(_0x13f9b5,null))[_0x1c18f1(0x15a)](respondWithResult(_0x13f9b5,null))[_0x1c18f1(0x165)](handleError(_0x13f9b5,null));},exports['create']=function(_0x13f479,_0x42721e){const _0x22f063=a122_0x1e4ae8;return db[_0x22f063(0x17e)][_0x22f063(0x178)](_0x13f479[_0x22f063(0x16c)],{})[_0x22f063(0x15a)](respondWithResult(_0x42721e,0xc9))[_0x22f063(0x165)](handleError(_0x42721e,null));},exports[a122_0x1e4ae8(0x14c)]=function(_0x42b2e0,_0x31285a){const _0x572de4=a122_0x1e4ae8;return _0x42b2e0[_0x572de4(0x16c)]['id']&&delete _0x42b2e0[_0x572de4(0x16c)]['id'],db['ChatQueueReport']['findOne']({'where':{'id':_0x42b2e0[_0x572de4(0x14e)]['id']}})[_0x572de4(0x15a)](handleEntityNotFound(_0x31285a,null))[_0x572de4(0x15a)](saveUpdates(_0x42b2e0[_0x572de4(0x16c)],null))['then'](respondWithResult(_0x31285a,null))[_0x572de4(0x165)](handleError(_0x31285a,null));},exports['destroy']=function(_0xfb889f,_0x770e94){const _0x39c58c=a122_0x1e4ae8;return db[_0x39c58c(0x17e)]['findOne']({'where':{'id':_0xfb889f[_0x39c58c(0x14e)]['id']}})[_0x39c58c(0x15a)](handleEntityNotFound(_0x770e94,null))[_0x39c58c(0x15a)](removeEntity(_0x770e94,null))[_0x39c58c(0x165)](handleError(_0x770e94,null));},exports[a122_0x1e4ae8(0x175)]=function(_0x3302ba,_0x5c527c){const _0x381784=a122_0x1e4ae8;return db[_0x381784(0x17e)][_0x381784(0x175)]()['then'](respondWithResult(_0x5c527c,null))[_0x381784(0x165)](handleError(_0x5c527c,null));};
\ No newline at end of file
+'use strict';const a122_0x116f=['filter','keys','update','show','describe','890845oGbNzT','query','include','pick','create','error','status','set','9ldCsrb','model','sort','@config/logger','stack','end','271984klVMgO','@components/parsers/qs','api','limit','1mcYaKz','intersection','where','attributes','key','name','Content-Range','2919pdntFg','then','lodash','rawAttributes','sendStatus','map','8416Fghfwp','type','offset','body','@mysqldb','256229TOdADT','ChatQueueReport','length','nolimit','params','send','options','1pnIYNj','undefined','fields','destroy','index','1KltEMz','fieldName','852736idAaLy','filters','count','json','findOne','catch','includeAll','1818468FRSakN'];const a122_0x5c91=function(_0x298cfe,_0x104ad3){_0x298cfe=_0x298cfe-0x186;let _0x116f6f=a122_0x116f[_0x298cfe];return _0x116f6f;};const a122_0x302828=a122_0x5c91;(function(_0x54420a,_0x53aecb){const _0x27103e=a122_0x5c91;while(!![]){try{const _0x5067d2=parseInt(_0x27103e(0x1b1))*parseInt(_0x27103e(0x1c2))+parseInt(_0x27103e(0x19a))*-parseInt(_0x27103e(0x1ab))+-parseInt(_0x27103e(0x192))+-parseInt(_0x27103e(0x1c4))+parseInt(_0x27103e(0x1a4))*parseInt(_0x27103e(0x1a0))+parseInt(_0x27103e(0x1b6))*parseInt(_0x27103e(0x1bd))+parseInt(_0x27103e(0x18c));if(_0x5067d2===_0x53aecb)break;else _0x54420a['push'](_0x54420a['shift']());}catch(_0x2ead6b){_0x54420a['push'](_0x54420a['shift']());}}}(a122_0x116f,0x8ee1d));const _=require(a122_0x302828(0x1ad)),qs=require(a122_0x302828(0x1a1)),logger=require(a122_0x302828(0x19d))(a122_0x302828(0x1a2)),{db}=require(a122_0x302828(0x1b5)),{filterAttributes}=require('@utils/filter-attributes');function respondWithResult(_0x571fea,_0x37e106){return _0x37e106=_0x37e106||0xc8,function(_0x4fb563){const _0x4ac18e=a122_0x5c91;if(_0x4fb563)return _0x571fea['status'](_0x37e106)[_0x4ac18e(0x188)](_0x4fb563);};}function respondWithFilteredResult(_0xe38b93,_0x21c598){return function(_0x4a8804){const _0x421d07=a122_0x5c91;if(_0x4a8804){const _0x1b6752=_0x4a8804['count'],_0x43c1c5=_0x21c598[_0x421d07(0x1b3)];let _0x52a667=_0x21c598[_0x421d07(0x1b3)]+_0x21c598[_0x421d07(0x1a3)],_0x5a1b04;return _0x52a667>=_0x1b6752?(_0x52a667=_0x1b6752,_0x5a1b04=0xc8):_0x5a1b04=0xce,_0xe38b93['status'](_0x5a1b04),_0xe38b93[_0x421d07(0x199)](_0x421d07(0x1aa),_0x43c1c5+'-'+_0x52a667+'/'+_0x1b6752)['json'](_0x4a8804);}return null;};}function saveUpdates(_0x262261){return function(_0x1e3f0f){const _0x3f9c19=a122_0x5c91;if(_0x1e3f0f)return _0x1e3f0f[_0x3f9c19(0x18f)](_0x262261)[_0x3f9c19(0x1ac)](function(_0x2f7ecd){return _0x2f7ecd;});return null;};}function removeEntity(_0x2678ad){return function(_0x245e5f){if(_0x245e5f)return _0x245e5f['destroy']()['then'](function(){const _0x1772e8=a122_0x5c91;_0x2678ad[_0x1772e8(0x198)](0xcc)[_0x1772e8(0x19f)]();});};}function handleEntityNotFound(_0x3baa0d){return function(_0x396a31){const _0x309494=a122_0x5c91;return!_0x396a31&&_0x3baa0d[_0x309494(0x1af)](0x194),_0x396a31;};}function handleError(_0x5286be,_0x58c08c){return _0x58c08c=_0x58c08c||0x1f4,function(_0x2b9004){const _0x4f4972=a122_0x5c91;logger[_0x4f4972(0x197)](_0x2b9004[_0x4f4972(0x19e)]),_0x2b9004[_0x4f4972(0x1a9)]&&delete _0x2b9004[_0x4f4972(0x1a9)],_0x5286be[_0x4f4972(0x198)](_0x58c08c)[_0x4f4972(0x1bb)](_0x2b9004);};}exports[a122_0x302828(0x1c1)]=function(_0x877cff,_0x3b0ecc){const _0x48e447=a122_0x302828;let _0x4077e1={};const _0x266b8d={},_0x47a893={'count':0x0,'rows':[]},_0x119187=_['map'](db[_0x48e447(0x1b7)][_0x48e447(0x1ae)],function(_0x3b3087){const _0x5e916d=_0x48e447;return{'name':_0x3b3087[_0x5e916d(0x1c3)],'type':_0x3b3087[_0x5e916d(0x1b2)][_0x5e916d(0x1a8)]};});_0x266b8d[_0x48e447(0x19b)]=_[_0x48e447(0x1b0)](_0x119187,_0x48e447(0x1a9)),_0x266b8d[_0x48e447(0x193)]=_['keys'](_0x877cff[_0x48e447(0x193)]),_0x266b8d[_0x48e447(0x186)]=_['intersection'](_0x266b8d[_0x48e447(0x19b)],_0x266b8d[_0x48e447(0x193)]),_0x4077e1[_0x48e447(0x1a7)]=_[_0x48e447(0x1a5)](_0x266b8d[_0x48e447(0x19b)],qs['fields'](_0x877cff[_0x48e447(0x193)][_0x48e447(0x1bf)])),_0x4077e1[_0x48e447(0x1a7)]=_0x4077e1['attributes']['length']?_0x4077e1['attributes']:_0x266b8d[_0x48e447(0x19b)];typeof _0x877cff['query'][_0x48e447(0x1b9)]===_0x48e447(0x1be)&&(_0x4077e1[_0x48e447(0x1a3)]=qs[_0x48e447(0x1a3)](_0x877cff['query']['limit']),_0x4077e1[_0x48e447(0x1b3)]=qs[_0x48e447(0x1b3)](_0x877cff['query'][_0x48e447(0x1b3)]));_0x4077e1['order']=qs['sort'](_0x877cff['query'][_0x48e447(0x19c)]),_0x4077e1[_0x48e447(0x1a6)]=qs[_0x48e447(0x186)](_[_0x48e447(0x195)](_0x877cff['query'],_0x266b8d['filters']),_0x119187),_0x4077e1=filterAttributes(_0x4077e1,_0x877cff[_0x48e447(0x193)][_0x48e447(0x18d)],_0x119187,_0x877cff[_0x48e447(0x1bc)]);const _0x193809={'where':_0x4077e1[_0x48e447(0x1a6)]};return db[_0x48e447(0x1b7)][_0x48e447(0x187)](_0x193809)[_0x48e447(0x1ac)](function(_0x3635d1){const _0x3d2cc8=_0x48e447;return _0x47a893['count']=_0x3635d1,_0x877cff[_0x3d2cc8(0x193)][_0x3d2cc8(0x18b)]&&(_0x4077e1[_0x3d2cc8(0x194)]=[{'all':!![]}]),db[_0x3d2cc8(0x1b7)]['findAll'](_0x4077e1);})[_0x48e447(0x1ac)](function(_0x7ed6c4){return _0x47a893['rows']=_0x7ed6c4,_0x47a893;})[_0x48e447(0x1ac)](respondWithFilteredResult(_0x3b0ecc,_0x4077e1))[_0x48e447(0x18a)](handleError(_0x3b0ecc,null));},exports[a122_0x302828(0x190)]=function(_0x1e1a2a,_0x514a29){const _0x392728=a122_0x302828;let _0xcfcabf={'raw':!![],'where':{'id':_0x1e1a2a[_0x392728(0x1ba)]['id']}};const _0x4c8322={};return _0x4c8322['model']=_[_0x392728(0x18e)](db[_0x392728(0x1b7)][_0x392728(0x1ae)]),_0x4c8322[_0x392728(0x193)]=_['keys'](_0x1e1a2a['query']),_0x4c8322['filters']=_[_0x392728(0x1a5)](_0x4c8322[_0x392728(0x19b)],_0x4c8322[_0x392728(0x193)]),_0xcfcabf['attributes']=_[_0x392728(0x1a5)](_0x4c8322[_0x392728(0x19b)],qs[_0x392728(0x1bf)](_0x1e1a2a[_0x392728(0x193)][_0x392728(0x1bf)])),_0xcfcabf[_0x392728(0x1a7)]=_0xcfcabf[_0x392728(0x1a7)][_0x392728(0x1b8)]?_0xcfcabf[_0x392728(0x1a7)]:_0x4c8322['model'],_0x1e1a2a[_0x392728(0x193)][_0x392728(0x18b)]&&(_0xcfcabf[_0x392728(0x194)]=[{'all':!![]}]),_0xcfcabf=_['merge']({},_0xcfcabf,_0x1e1a2a[_0x392728(0x1bc)]),db[_0x392728(0x1b7)][_0x392728(0x189)](_0xcfcabf)[_0x392728(0x1ac)](handleEntityNotFound(_0x514a29,null))[_0x392728(0x1ac)](respondWithResult(_0x514a29,null))[_0x392728(0x18a)](handleError(_0x514a29,null));},exports[a122_0x302828(0x196)]=function(_0x1f8d8f,_0x20d6ec){const _0x176e87=a122_0x302828;return db[_0x176e87(0x1b7)]['create'](_0x1f8d8f['body'],{})[_0x176e87(0x1ac)](respondWithResult(_0x20d6ec,0xc9))[_0x176e87(0x18a)](handleError(_0x20d6ec,null));},exports[a122_0x302828(0x18f)]=function(_0x2ba8b9,_0x35a626){const _0x21cfac=a122_0x302828;return _0x2ba8b9[_0x21cfac(0x1b4)]['id']&&delete _0x2ba8b9[_0x21cfac(0x1b4)]['id'],db['ChatQueueReport']['findOne']({'where':{'id':_0x2ba8b9['params']['id']}})['then'](handleEntityNotFound(_0x35a626,null))[_0x21cfac(0x1ac)](saveUpdates(_0x2ba8b9[_0x21cfac(0x1b4)],null))['then'](respondWithResult(_0x35a626,null))['catch'](handleError(_0x35a626,null));},exports[a122_0x302828(0x1c0)]=function(_0x1f865b,_0x116f5a){const _0x582173=a122_0x302828;return db[_0x582173(0x1b7)][_0x582173(0x189)]({'where':{'id':_0x1f865b['params']['id']}})[_0x582173(0x1ac)](handleEntityNotFound(_0x116f5a,null))[_0x582173(0x1ac)](removeEntity(_0x116f5a,null))[_0x582173(0x18a)](handleError(_0x116f5a,null));},exports[a122_0x302828(0x191)]=function(_0x4eec11,_0x48a1a6){const _0x45aa3d=a122_0x302828;return db[_0x45aa3d(0x1b7)][_0x45aa3d(0x191)]()[_0x45aa3d(0x1ac)](respondWithResult(_0x48a1a6,null))[_0x45aa3d(0x18a)](handleError(_0x48a1a6,null));};
\ No newline at end of file