Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.controller.js
index 12d9a29..aba31a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7871=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','update','then','destroy','error','stack','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','count','includeAll','include','rows','catch','show','params','keys','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xf31c60,_0x22978b){var _0x29f6f1=function(_0x1551ec){while(--_0x1551ec){_0xf31c60['push'](_0xf31c60['shift']());}};_0x29f6f1(++_0x22978b);}(_0x7871,0xca));var _0x1787=function(_0x4a3c84,_0x4453b1){_0x4a3c84=_0x4a3c84-0x0;var _0x3dbd1f=_0x7871[_0x4a3c84];return _0x3dbd1f;};'use strict';var pdf=require(_0x1787('0x0'));var emlformat=require(_0x1787('0x1'));var rimraf=require(_0x1787('0x2'));var zipdir=require(_0x1787('0x3'));var jsonpatch=require(_0x1787('0x4'));var rp=require(_0x1787('0x5'));var moment=require(_0x1787('0x6'));var BPromise=require(_0x1787('0x7'));var Mustache=require(_0x1787('0x8'));var util=require(_0x1787('0x9'));var path=require(_0x1787('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1787('0xb'));var fs=require('fs');var _=require(_0x1787('0xc'));var squel=require(_0x1787('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1787('0xe'));var toCsv=require(_0x1787('0xf'));var querystring=require(_0x1787('0x10'));var Papa=require('papaparse');var Redis=require(_0x1787('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1787('0x12'));var as=require(_0x1787('0x13'));var hardwareService=require(_0x1787('0x14'));var logger=require(_0x1787('0x15'))(_0x1787('0x16'));var utils=require(_0x1787('0x17'));var config=require(_0x1787('0x18'));var licenseUtil=require(_0x1787('0x19'));var db=require(_0x1787('0x1a'))['db'];function respondWithStatusCode(_0x2ed671,_0x154180){_0x154180=_0x154180||0xcc;return function(_0x4804b9){if(_0x4804b9){return _0x2ed671[_0x1787('0x1b')](_0x154180);}return _0x2ed671[_0x1787('0x1c')](_0x154180)[_0x1787('0x1d')]();};}function respondWithResult(_0x14e71c,_0x13ad68){_0x13ad68=_0x13ad68||0xc8;return function(_0x370ac4){if(_0x370ac4){return _0x14e71c['status'](_0x13ad68)['json'](_0x370ac4);}};}function respondWithFilteredResult(_0x41fdbb,_0x2a05e0){return function(_0x92a9c7){if(_0x92a9c7){var _0x51511c=_0x92a9c7['count'],_0xd6a754=_0x2a05e0['offset'],_0x299a4b=_0x2a05e0[_0x1787('0x1e')]+_0x2a05e0[_0x1787('0x1f')],_0x58ad4f;if(_0x299a4b>=_0x51511c){_0x299a4b=_0x51511c;_0x58ad4f=0xc8;}else{_0x58ad4f=0xce;}_0x41fdbb[_0x1787('0x1c')](_0x58ad4f);return _0x41fdbb['set'](_0x1787('0x20'),_0xd6a754+'-'+_0x299a4b+'/'+_0x51511c)[_0x1787('0x21')](_0x92a9c7);}return null;};}function patchUpdates(_0x3ab056){return function(_0xdc1b97){try{jsonpatch[_0x1787('0x22')](_0xdc1b97,_0x3ab056,!![]);}catch(_0x15918b){return BPromise['reject'](_0x15918b);}return _0xdc1b97['save']();};}function saveUpdates(_0x57c9d5,_0x4b60e5){return function(_0x5ecdfe){if(_0x5ecdfe){return _0x5ecdfe[_0x1787('0x23')](_0x57c9d5)[_0x1787('0x24')](function(_0xf900ee){return _0xf900ee;});}return null;};}function removeEntity(_0x47244a,_0x11ad37){return function(_0xd6edbc){if(_0xd6edbc){return _0xd6edbc[_0x1787('0x25')]()['then'](function(){_0x47244a[_0x1787('0x1c')](0xcc)[_0x1787('0x1d')]();});}};}function handleEntityNotFound(_0x1b6a85,_0x365c60){return function(_0x35a17d){if(!_0x35a17d){_0x1b6a85['sendStatus'](0x194);}return _0x35a17d;};}function handleError(_0x4bbe7a,_0x2175ad){_0x2175ad=_0x2175ad||0x1f4;return function(_0x4b240a){logger[_0x1787('0x26')](_0x4b240a[_0x1787('0x27')]);if(_0x4b240a['name']){delete _0x4b240a['name'];}_0x4bbe7a[_0x1787('0x1c')](_0x2175ad)['send'](_0x4b240a);};}exports[_0x1787('0x28')]=function(_0x145f73,_0x40b0c7){var _0x11a900={},_0x547e18={},_0x1567d0={'count':0x0,'rows':[]};var _0x297266=_[_0x1787('0x29')](db[_0x1787('0x2a')][_0x1787('0x2b')],function(_0x51a4e7){return{'name':_0x51a4e7[_0x1787('0x2c')],'type':_0x51a4e7[_0x1787('0x2d')][_0x1787('0x2e')]};});_0x547e18[_0x1787('0x2f')]=_[_0x1787('0x29')](_0x297266,_0x1787('0x30'));_0x547e18[_0x1787('0x31')]=_['keys'](_0x145f73[_0x1787('0x31')]);_0x547e18[_0x1787('0x32')]=_[_0x1787('0x33')](_0x547e18[_0x1787('0x2f')],_0x547e18[_0x1787('0x31')]);_0x11a900[_0x1787('0x34')]=_[_0x1787('0x33')](_0x547e18[_0x1787('0x2f')],qs[_0x1787('0x35')](_0x145f73[_0x1787('0x31')][_0x1787('0x35')]));_0x11a900['attributes']=_0x11a900[_0x1787('0x34')][_0x1787('0x36')]?_0x11a900[_0x1787('0x34')]:_0x547e18['model'];if(!_0x145f73[_0x1787('0x31')]['hasOwnProperty'](_0x1787('0x37'))){_0x11a900[_0x1787('0x1f')]=qs['limit'](_0x145f73[_0x1787('0x31')]['limit']);_0x11a900[_0x1787('0x1e')]=qs[_0x1787('0x1e')](_0x145f73[_0x1787('0x31')][_0x1787('0x1e')]);}_0x11a900[_0x1787('0x38')]=qs[_0x1787('0x39')](_0x145f73['query'][_0x1787('0x39')]);_0x11a900[_0x1787('0x3a')]=qs[_0x1787('0x32')](_['pick'](_0x145f73[_0x1787('0x31')],_0x547e18[_0x1787('0x32')]),_0x297266);if(_0x145f73[_0x1787('0x31')][_0x1787('0x3b')]){_0x11a900['where']=_['merge'](_0x11a900['where'],{'$or':_[_0x1787('0x29')](_0x297266,function(_0x1e5ff5){if(_0x1e5ff5['type']!==_0x1787('0x3c')){var _0x5bd411={};_0x5bd411[_0x1e5ff5[_0x1787('0x30')]]={'$like':'%'+_0x145f73[_0x1787('0x31')][_0x1787('0x3b')]+'%'};return _0x5bd411;}})});}_0x11a900=_[_0x1787('0x3d')]({},_0x11a900,_0x145f73['options']);var _0x48bfa1={'where':_0x11a900[_0x1787('0x3a')]};return db[_0x1787('0x2a')][_0x1787('0x3e')](_0x48bfa1)[_0x1787('0x24')](function(_0x54b312){_0x1567d0[_0x1787('0x3e')]=_0x54b312;if(_0x145f73[_0x1787('0x31')][_0x1787('0x3f')]){_0x11a900[_0x1787('0x40')]=[{'all':!![]}];}return db[_0x1787('0x2a')]['findAll'](_0x11a900);})[_0x1787('0x24')](function(_0x50e19f){_0x1567d0[_0x1787('0x41')]=_0x50e19f;return _0x1567d0;})[_0x1787('0x24')](respondWithFilteredResult(_0x40b0c7,_0x11a900))[_0x1787('0x42')](handleError(_0x40b0c7,null));};exports[_0x1787('0x43')]=function(_0x32fa03,_0x29a1a5){var _0x33563b={'raw':!![],'where':{'id':_0x32fa03[_0x1787('0x44')]['id']}},_0x3f5328={};_0x3f5328[_0x1787('0x2f')]=_[_0x1787('0x45')](db[_0x1787('0x2a')][_0x1787('0x2b')]);_0x3f5328['query']=_[_0x1787('0x45')](_0x32fa03[_0x1787('0x31')]);_0x3f5328[_0x1787('0x32')]=_[_0x1787('0x33')](_0x3f5328[_0x1787('0x2f')],_0x3f5328[_0x1787('0x31')]);_0x33563b[_0x1787('0x34')]=_[_0x1787('0x33')](_0x3f5328[_0x1787('0x2f')],qs[_0x1787('0x35')](_0x32fa03['query'][_0x1787('0x35')]));_0x33563b['attributes']=_0x33563b[_0x1787('0x34')][_0x1787('0x36')]?_0x33563b['attributes']:_0x3f5328[_0x1787('0x2f')];if(_0x32fa03[_0x1787('0x31')][_0x1787('0x3f')]){_0x33563b[_0x1787('0x40')]=[{'all':!![]}];}_0x33563b=_[_0x1787('0x3d')]({},_0x33563b,_0x32fa03[_0x1787('0x46')]);return db[_0x1787('0x2a')][_0x1787('0x47')](_0x33563b)[_0x1787('0x24')](handleEntityNotFound(_0x29a1a5,null))[_0x1787('0x24')](respondWithResult(_0x29a1a5,null))['catch'](handleError(_0x29a1a5,null));};exports['create']=function(_0x46446c,_0x247577){return db[_0x1787('0x2a')][_0x1787('0x48')](_0x46446c[_0x1787('0x49')],{})[_0x1787('0x24')](respondWithResult(_0x247577,0xc9))['catch'](handleError(_0x247577,null));};exports[_0x1787('0x23')]=function(_0x42cb5e,_0x20bb3a){if(_0x42cb5e['body']['id']){delete _0x42cb5e[_0x1787('0x49')]['id'];}return db[_0x1787('0x2a')][_0x1787('0x47')]({'where':{'id':_0x42cb5e[_0x1787('0x44')]['id']}})[_0x1787('0x24')](handleEntityNotFound(_0x20bb3a,null))[_0x1787('0x24')](saveUpdates(_0x42cb5e[_0x1787('0x49')],null))[_0x1787('0x24')](respondWithResult(_0x20bb3a,null))[_0x1787('0x42')](handleError(_0x20bb3a,null));};exports['destroy']=function(_0x58219a,_0x212e86){return db[_0x1787('0x2a')][_0x1787('0x47')]({'where':{'id':_0x58219a[_0x1787('0x44')]['id']}})[_0x1787('0x24')](handleEntityNotFound(_0x212e86,null))[_0x1787('0x24')](removeEntity(_0x212e86,null))['catch'](handleError(_0x212e86,null));};
\ No newline at end of file
+var _0xfff0=['VoiceQueuesLog','includeAll','findAll','catch','params','length','include','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options'];(function(_0x36f688,_0x136a34){var _0x5483e4=function(_0x218af7){while(--_0x218af7){_0x36f688['push'](_0x36f688['shift']());}};_0x5483e4(++_0x136a34);}(_0xfff0,0x139));var _0x0fff=function(_0x19829c,_0x862181){_0x19829c=_0x19829c-0x0;var _0x5e1c18=_0xfff0[_0x19829c];return _0x5e1c18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fff('0x0'));var zipdir=require(_0x0fff('0x1'));var jsonpatch=require(_0x0fff('0x2'));var rp=require('request-promise');var moment=require(_0x0fff('0x3'));var BPromise=require(_0x0fff('0x4'));var Mustache=require(_0x0fff('0x5'));var util=require('util');var path=require(_0x0fff('0x6'));var sox=require(_0x0fff('0x7'));var csv=require('to-csv');var ejs=require(_0x0fff('0x8'));var fs=require('fs');var fs_extra=require(_0x0fff('0x9'));var _=require(_0x0fff('0xa'));var squel=require('squel');var crypto=require(_0x0fff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0fff('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0fff('0xd'));var Papa=require(_0x0fff('0xe'));var Redis=require('ioredis');var authService=require(_0x0fff('0xf'));var qs=require(_0x0fff('0x10'));var as=require(_0x0fff('0x11'));var hardwareService=require(_0x0fff('0x12'));var logger=require(_0x0fff('0x13'))(_0x0fff('0x14'));var utils=require(_0x0fff('0x15'));var config=require(_0x0fff('0x16'));var licenseUtil=require(_0x0fff('0x17'));var db=require(_0x0fff('0x18'))['db'];function respondWithStatusCode(_0x13f768,_0x5abecd){_0x5abecd=_0x5abecd||0xcc;return function(_0x1fb243){if(_0x1fb243){return _0x13f768['sendStatus'](_0x5abecd);}return _0x13f768[_0x0fff('0x19')](_0x5abecd)[_0x0fff('0x1a')]();};}function respondWithResult(_0x38fc82,_0x2c0322){_0x2c0322=_0x2c0322||0xc8;return function(_0x55e5fa){if(_0x55e5fa){return _0x38fc82['status'](_0x2c0322)[_0x0fff('0x1b')](_0x55e5fa);}};}function respondWithFilteredResult(_0x50a9e4,_0x5636fd){return function(_0x51ceea){if(_0x51ceea){var _0x1fb430=typeof _0x5636fd[_0x0fff('0x1c')]==='undefined'&&typeof _0x5636fd[_0x0fff('0x1d')]===_0x0fff('0x1e');var _0x540a67=_0x51ceea['count'];var _0x48f36d=_0x1fb430?0x0:_0x5636fd[_0x0fff('0x1c')];var _0x606792=_0x1fb430?_0x51ceea[_0x0fff('0x1f')]:_0x5636fd[_0x0fff('0x1c')]+_0x5636fd[_0x0fff('0x1d')];var _0xe89b4a;if(_0x606792>=_0x540a67){_0x606792=_0x540a67;_0xe89b4a=0xc8;}else{_0xe89b4a=0xce;}_0x50a9e4['status'](_0xe89b4a);return _0x50a9e4[_0x0fff('0x20')](_0x0fff('0x21'),_0x48f36d+'-'+_0x606792+'/'+_0x540a67)[_0x0fff('0x1b')](_0x51ceea);}return null;};}function patchUpdates(_0x49d211){return function(_0x5e27df){try{jsonpatch[_0x0fff('0x22')](_0x5e27df,_0x49d211,!![]);}catch(_0x330e29){return BPromise[_0x0fff('0x23')](_0x330e29);}return _0x5e27df[_0x0fff('0x24')]();};}function saveUpdates(_0x502393,_0x155132){return function(_0x2f8665){if(_0x2f8665){return _0x2f8665[_0x0fff('0x25')](_0x502393)[_0x0fff('0x26')](function(_0x16e7f4){return _0x16e7f4;});}return null;};}function removeEntity(_0x17fba6,_0x580b8e){return function(_0x6a116c){if(_0x6a116c){return _0x6a116c[_0x0fff('0x27')]()[_0x0fff('0x26')](function(){_0x17fba6[_0x0fff('0x19')](0xcc)[_0x0fff('0x1a')]();});}};}function handleEntityNotFound(_0x23d9f8,_0x482e1e){return function(_0x2c9725){if(!_0x2c9725){_0x23d9f8[_0x0fff('0x28')](0x194);}return _0x2c9725;};}function handleError(_0x2d1610,_0x440f56){_0x440f56=_0x440f56||0x1f4;return function(_0x36d268){logger[_0x0fff('0x29')](_0x36d268[_0x0fff('0x2a')]);if(_0x36d268[_0x0fff('0x2b')]){delete _0x36d268[_0x0fff('0x2b')];}_0x2d1610[_0x0fff('0x19')](_0x440f56)[_0x0fff('0x2c')](_0x36d268);};}exports[_0x0fff('0x2d')]=function(_0x495734,_0x7046a3){var _0x2d1800={},_0x17ab6f={},_0x42441e={'count':0x0,'rows':[]};var _0x1f643d=_[_0x0fff('0x2e')](db['VoiceQueuesLog'][_0x0fff('0x2f')],function(_0xa16c29){return{'name':_0xa16c29[_0x0fff('0x30')],'type':_0xa16c29['type'][_0x0fff('0x31')]};});_0x17ab6f[_0x0fff('0x32')]=_['map'](_0x1f643d,_0x0fff('0x2b'));_0x17ab6f[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0x495734[_0x0fff('0x33')]);_0x17ab6f[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x17ab6f[_0x0fff('0x32')],_0x17ab6f[_0x0fff('0x33')]);_0x2d1800[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x17ab6f['model'],qs[_0x0fff('0x38')](_0x495734[_0x0fff('0x33')][_0x0fff('0x38')]));_0x2d1800[_0x0fff('0x37')]=_0x2d1800[_0x0fff('0x37')]['length']?_0x2d1800['attributes']:_0x17ab6f[_0x0fff('0x32')];if(!_0x495734[_0x0fff('0x33')][_0x0fff('0x39')](_0x0fff('0x3a'))){_0x2d1800['limit']=qs[_0x0fff('0x1d')](_0x495734[_0x0fff('0x33')][_0x0fff('0x1d')]);_0x2d1800[_0x0fff('0x1c')]=qs['offset'](_0x495734[_0x0fff('0x33')][_0x0fff('0x1c')]);}_0x2d1800[_0x0fff('0x3b')]=qs[_0x0fff('0x3c')](_0x495734[_0x0fff('0x33')][_0x0fff('0x3c')]);_0x2d1800[_0x0fff('0x3d')]=qs[_0x0fff('0x35')](_[_0x0fff('0x3e')](_0x495734[_0x0fff('0x33')],_0x17ab6f[_0x0fff('0x35')]),_0x1f643d);if(_0x495734[_0x0fff('0x33')]['filter']){_0x2d1800[_0x0fff('0x3d')]=_[_0x0fff('0x3f')](_0x2d1800[_0x0fff('0x3d')],{'$or':_[_0x0fff('0x2e')](_0x1f643d,function(_0xd65638){if(_0xd65638[_0x0fff('0x40')]!=='VIRTUAL'){var _0x10ff9d={};_0x10ff9d[_0xd65638[_0x0fff('0x2b')]]={'$like':'%'+_0x495734[_0x0fff('0x33')][_0x0fff('0x41')]+'%'};return _0x10ff9d;}})});}_0x2d1800=_[_0x0fff('0x3f')]({},_0x2d1800,_0x495734[_0x0fff('0x42')]);var _0x3dc0b8={'where':_0x2d1800[_0x0fff('0x3d')]};return db[_0x0fff('0x43')]['count'](_0x3dc0b8)[_0x0fff('0x26')](function(_0x4d89c0){_0x42441e[_0x0fff('0x1f')]=_0x4d89c0;if(_0x495734[_0x0fff('0x33')][_0x0fff('0x44')]){_0x2d1800['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x0fff('0x45')](_0x2d1800);})[_0x0fff('0x26')](function(_0x311348){_0x42441e['rows']=_0x311348;return _0x42441e;})['then'](respondWithFilteredResult(_0x7046a3,_0x2d1800))[_0x0fff('0x46')](handleError(_0x7046a3,null));};exports['show']=function(_0xd6ebeb,_0x957265){var _0x8352c1={'raw':!![],'where':{'id':_0xd6ebeb[_0x0fff('0x47')]['id']}},_0x309d75={};_0x309d75[_0x0fff('0x32')]=_['keys'](db[_0x0fff('0x43')][_0x0fff('0x2f')]);_0x309d75[_0x0fff('0x33')]=_[_0x0fff('0x34')](_0xd6ebeb[_0x0fff('0x33')]);_0x309d75[_0x0fff('0x35')]=_[_0x0fff('0x36')](_0x309d75['model'],_0x309d75[_0x0fff('0x33')]);_0x8352c1[_0x0fff('0x37')]=_[_0x0fff('0x36')](_0x309d75['model'],qs[_0x0fff('0x38')](_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x38')]));_0x8352c1[_0x0fff('0x37')]=_0x8352c1[_0x0fff('0x37')][_0x0fff('0x48')]?_0x8352c1[_0x0fff('0x37')]:_0x309d75[_0x0fff('0x32')];if(_0xd6ebeb[_0x0fff('0x33')][_0x0fff('0x44')]){_0x8352c1[_0x0fff('0x49')]=[{'all':!![]}];}_0x8352c1=_['merge']({},_0x8352c1,_0xd6ebeb[_0x0fff('0x42')]);return db[_0x0fff('0x43')]['find'](_0x8352c1)[_0x0fff('0x26')](handleEntityNotFound(_0x957265,null))[_0x0fff('0x26')](respondWithResult(_0x957265,null))[_0x0fff('0x46')](handleError(_0x957265,null));};exports['create']=function(_0x502037,_0x2a0b10){return db['VoiceQueuesLog']['create'](_0x502037[_0x0fff('0x4a')],{})[_0x0fff('0x26')](respondWithResult(_0x2a0b10,0xc9))[_0x0fff('0x46')](handleError(_0x2a0b10,null));};exports[_0x0fff('0x25')]=function(_0x3b4b8e,_0x1a7677){if(_0x3b4b8e['body']['id']){delete _0x3b4b8e[_0x0fff('0x4a')]['id'];}return db[_0x0fff('0x43')][_0x0fff('0x4b')]({'where':{'id':_0x3b4b8e[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x1a7677,null))[_0x0fff('0x26')](saveUpdates(_0x3b4b8e['body'],null))[_0x0fff('0x26')](respondWithResult(_0x1a7677,null))[_0x0fff('0x46')](handleError(_0x1a7677,null));};exports['destroy']=function(_0x1fc872,_0x4bae35){return db['VoiceQueuesLog']['find']({'where':{'id':_0x1fc872[_0x0fff('0x47')]['id']}})[_0x0fff('0x26')](handleEntityNotFound(_0x4bae35,null))[_0x0fff('0x26')](removeEntity(_0x4bae35,null))[_0x0fff('0x46')](handleError(_0x4bae35,null));};
\ No newline at end of file