Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.controller.js
index 34997ce..aba31a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5817=['to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','VoiceQueuesLog','count','findAll','show','keys','includeAll','include','options','find','catch','create','body','update','params','html-pdf','rimraf','request-promise','moment','mustache','path','sox'];(function(_0x4690f1,_0x10f22f){var _0x5c2b55=function(_0x311b95){while(--_0x311b95){_0x4690f1['push'](_0x4690f1['shift']());}};_0x5c2b55(++_0x10f22f);}(_0x5817,0x166));var _0x7581=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5817[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x7581('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7581('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7581('0x2'));var moment=require(_0x7581('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7581('0x4'));var util=require('util');var path=require(_0x7581('0x5'));var sox=require(_0x7581('0x6'));var csv=require(_0x7581('0x7'));var ejs=require(_0x7581('0x8'));var fs=require('fs');var _=require(_0x7581('0x9'));var squel=require(_0x7581('0xa'));var crypto=require('crypto');var jsforce=require(_0x7581('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7581('0x7'));var querystring=require(_0x7581('0xc'));var Papa=require('papaparse');var Redis=require(_0x7581('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x7581('0xe'));var as=require(_0x7581('0xf'));var hardwareService=require(_0x7581('0x10'));var logger=require(_0x7581('0x11'))(_0x7581('0x12'));var utils=require(_0x7581('0x13'));var config=require(_0x7581('0x14'));var licenseUtil=require(_0x7581('0x15'));var db=require(_0x7581('0x16'))['db'];function respondWithStatusCode(_0x1e41f5,_0xa23e34){_0xa23e34=_0xa23e34||0xcc;return function(_0x51f4c8){if(_0x51f4c8){return _0x1e41f5['sendStatus'](_0xa23e34);}return _0x1e41f5[_0x7581('0x17')](_0xa23e34)[_0x7581('0x18')]();};}function respondWithResult(_0x34c51f,_0x445694){_0x445694=_0x445694||0xc8;return function(_0xf54e74){if(_0xf54e74){return _0x34c51f[_0x7581('0x17')](_0x445694)['json'](_0xf54e74);}};}function respondWithFilteredResult(_0x2c5dfb,_0x5bb3dd){return function(_0x5c579b){if(_0x5c579b){var _0x5978dd=_0x5c579b['count'],_0x58f16c=_0x5bb3dd[_0x7581('0x19')],_0x2ed1d9=_0x5bb3dd[_0x7581('0x19')]+_0x5bb3dd['limit'],_0x501898;if(_0x2ed1d9>=_0x5978dd){_0x2ed1d9=_0x5978dd;_0x501898=0xc8;}else{_0x501898=0xce;}_0x2c5dfb[_0x7581('0x17')](_0x501898);return _0x2c5dfb[_0x7581('0x1a')]('Content-Range',_0x58f16c+'-'+_0x2ed1d9+'/'+_0x5978dd)[_0x7581('0x1b')](_0x5c579b);}return null;};}function patchUpdates(_0x3d75de){return function(_0x73ccca){try{jsonpatch[_0x7581('0x1c')](_0x73ccca,_0x3d75de,!![]);}catch(_0x5b45af){return BPromise[_0x7581('0x1d')](_0x5b45af);}return _0x73ccca[_0x7581('0x1e')]();};}function saveUpdates(_0x559649,_0x45d71e){return function(_0x7b0aed){if(_0x7b0aed){return _0x7b0aed['update'](_0x559649)[_0x7581('0x1f')](function(_0x4b5189){return _0x4b5189;});}return null;};}function removeEntity(_0x194406,_0x31a236){return function(_0x380ef7){if(_0x380ef7){return _0x380ef7[_0x7581('0x20')]()[_0x7581('0x1f')](function(){_0x194406[_0x7581('0x17')](0xcc)[_0x7581('0x18')]();});}};}function handleEntityNotFound(_0x139266,_0x7f8a5a){return function(_0xe58ec9){if(!_0xe58ec9){_0x139266[_0x7581('0x21')](0x194);}return _0xe58ec9;};}function handleError(_0x4bcfc6,_0x23c8e4){_0x23c8e4=_0x23c8e4||0x1f4;return function(_0x4172c5){logger[_0x7581('0x22')](_0x4172c5[_0x7581('0x23')]);if(_0x4172c5[_0x7581('0x24')]){delete _0x4172c5[_0x7581('0x24')];}_0x4bcfc6[_0x7581('0x17')](_0x23c8e4)[_0x7581('0x25')](_0x4172c5);};}exports[_0x7581('0x26')]=function(_0xdb4dc8,_0x1d6a04){var _0x17a39a={},_0x296c64={},_0x224820={'count':0x0,'rows':[]};var _0x3b2151=_[_0x7581('0x27')](db['VoiceQueuesLog'][_0x7581('0x28')],function(_0x2279e7){return{'name':_0x2279e7[_0x7581('0x29')],'type':_0x2279e7[_0x7581('0x2a')]['key']};});_0x296c64[_0x7581('0x2b')]=_[_0x7581('0x27')](_0x3b2151,_0x7581('0x24'));_0x296c64[_0x7581('0x2c')]=_['keys'](_0xdb4dc8[_0x7581('0x2c')]);_0x296c64[_0x7581('0x2d')]=_[_0x7581('0x2e')](_0x296c64[_0x7581('0x2b')],_0x296c64['query']);_0x17a39a['attributes']=_['intersection'](_0x296c64[_0x7581('0x2b')],qs[_0x7581('0x2f')](_0xdb4dc8['query']['fields']));_0x17a39a[_0x7581('0x30')]=_0x17a39a[_0x7581('0x30')][_0x7581('0x31')]?_0x17a39a[_0x7581('0x30')]:_0x296c64[_0x7581('0x2b')];if(!_0xdb4dc8[_0x7581('0x2c')][_0x7581('0x32')]('nolimit')){_0x17a39a[_0x7581('0x33')]=qs[_0x7581('0x33')](_0xdb4dc8['query'][_0x7581('0x33')]);_0x17a39a['offset']=qs[_0x7581('0x19')](_0xdb4dc8[_0x7581('0x2c')][_0x7581('0x19')]);}_0x17a39a[_0x7581('0x34')]=qs[_0x7581('0x35')](_0xdb4dc8[_0x7581('0x2c')][_0x7581('0x35')]);_0x17a39a[_0x7581('0x36')]=qs[_0x7581('0x2d')](_[_0x7581('0x37')](_0xdb4dc8[_0x7581('0x2c')],_0x296c64[_0x7581('0x2d')]),_0x3b2151);if(_0xdb4dc8[_0x7581('0x2c')]['filter']){_0x17a39a[_0x7581('0x36')]=_[_0x7581('0x38')](_0x17a39a[_0x7581('0x36')],{'$or':_[_0x7581('0x27')](_0x3b2151,function(_0x1e8e71){if(_0x1e8e71[_0x7581('0x2a')]!==_0x7581('0x39')){var _0x53e17a={};_0x53e17a[_0x1e8e71[_0x7581('0x24')]]={'$like':'%'+_0xdb4dc8[_0x7581('0x2c')][_0x7581('0x3a')]+'%'};return _0x53e17a;}})});}_0x17a39a=_[_0x7581('0x38')]({},_0x17a39a,_0xdb4dc8['options']);var _0x30a2dd={'where':_0x17a39a[_0x7581('0x36')]};return db[_0x7581('0x3b')][_0x7581('0x3c')](_0x30a2dd)[_0x7581('0x1f')](function(_0x230460){_0x224820[_0x7581('0x3c')]=_0x230460;if(_0xdb4dc8[_0x7581('0x2c')]['includeAll']){_0x17a39a['include']=[{'all':!![]}];}return db[_0x7581('0x3b')][_0x7581('0x3d')](_0x17a39a);})[_0x7581('0x1f')](function(_0x19fdbb){_0x224820['rows']=_0x19fdbb;return _0x224820;})[_0x7581('0x1f')](respondWithFilteredResult(_0x1d6a04,_0x17a39a))['catch'](handleError(_0x1d6a04,null));};exports[_0x7581('0x3e')]=function(_0x25b8e5,_0x5a3313){var _0x23db9d={'raw':!![],'where':{'id':_0x25b8e5['params']['id']}},_0x42ba07={};_0x42ba07['model']=_[_0x7581('0x3f')](db[_0x7581('0x3b')][_0x7581('0x28')]);_0x42ba07[_0x7581('0x2c')]=_[_0x7581('0x3f')](_0x25b8e5[_0x7581('0x2c')]);_0x42ba07[_0x7581('0x2d')]=_[_0x7581('0x2e')](_0x42ba07[_0x7581('0x2b')],_0x42ba07[_0x7581('0x2c')]);_0x23db9d[_0x7581('0x30')]=_['intersection'](_0x42ba07[_0x7581('0x2b')],qs['fields'](_0x25b8e5[_0x7581('0x2c')][_0x7581('0x2f')]));_0x23db9d[_0x7581('0x30')]=_0x23db9d[_0x7581('0x30')][_0x7581('0x31')]?_0x23db9d[_0x7581('0x30')]:_0x42ba07[_0x7581('0x2b')];if(_0x25b8e5[_0x7581('0x2c')][_0x7581('0x40')]){_0x23db9d[_0x7581('0x41')]=[{'all':!![]}];}_0x23db9d=_[_0x7581('0x38')]({},_0x23db9d,_0x25b8e5[_0x7581('0x42')]);return db['VoiceQueuesLog'][_0x7581('0x43')](_0x23db9d)[_0x7581('0x1f')](handleEntityNotFound(_0x5a3313,null))['then'](respondWithResult(_0x5a3313,null))[_0x7581('0x44')](handleError(_0x5a3313,null));};exports[_0x7581('0x45')]=function(_0xf830f9,_0x334f6e){return db['VoiceQueuesLog'][_0x7581('0x45')](_0xf830f9[_0x7581('0x46')],{})[_0x7581('0x1f')](respondWithResult(_0x334f6e,0xc9))[_0x7581('0x44')](handleError(_0x334f6e,null));};exports[_0x7581('0x47')]=function(_0x147308,_0x3aeeb6){if(_0x147308['body']['id']){delete _0x147308[_0x7581('0x46')]['id'];}return db[_0x7581('0x3b')]['find']({'where':{'id':_0x147308['params']['id']}})[_0x7581('0x1f')](handleEntityNotFound(_0x3aeeb6,null))[_0x7581('0x1f')](saveUpdates(_0x147308[_0x7581('0x46')],null))[_0x7581('0x1f')](respondWithResult(_0x3aeeb6,null))[_0x7581('0x44')](handleError(_0x3aeeb6,null));};exports[_0x7581('0x20')]=function(_0x424f80,_0x2e6094){return db['VoiceQueuesLog'][_0x7581('0x43')]({'where':{'id':_0x424f80[_0x7581('0x48')]['id']}})[_0x7581('0x1f')](handleEntityNotFound(_0x2e6094,null))[_0x7581('0x1f')](removeEntity(_0x2e6094,null))[_0x7581('0x44')](handleError(_0x2e6094,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