Built motion from commit (unavailable).|2.5.30
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.controller.js
index 89f3696..aba31a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9880=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','status','end','json','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','keys','find','create','body','update','params'];(function(_0x454630,_0x1437d8){var _0x45ae17=function(_0x4a18ec){while(--_0x4a18ec){_0x454630['push'](_0x454630['shift']());}};_0x45ae17(++_0x1437d8);}(_0x9880,0x94));var _0x0988=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x9880[_0x3ff4a3];return _0x38676f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0988('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0988('0x1'));var jsonpatch=require(_0x0988('0x2'));var rp=require(_0x0988('0x3'));var moment=require(_0x0988('0x4'));var BPromise=require(_0x0988('0x5'));var Mustache=require(_0x0988('0x6'));var util=require(_0x0988('0x7'));var path=require(_0x0988('0x8'));var sox=require(_0x0988('0x9'));var csv=require(_0x0988('0xa'));var ejs=require(_0x0988('0xb'));var fs=require('fs');var _=require(_0x0988('0xc'));var squel=require('squel');var crypto=require(_0x0988('0xd'));var jsforce=require(_0x0988('0xe'));var deskjs=require(_0x0988('0xf'));var toCsv=require(_0x0988('0xa'));var querystring=require(_0x0988('0x10'));var Papa=require(_0x0988('0x11'));var Redis=require(_0x0988('0x12'));var authService=require(_0x0988('0x13'));var qs=require(_0x0988('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0988('0x15'));var logger=require(_0x0988('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x0988('0x17'));var licenseUtil=require(_0x0988('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15cc28,_0x408b5b){_0x408b5b=_0x408b5b||0xcc;return function(_0x1a1490){if(_0x1a1490){return _0x15cc28['sendStatus'](_0x408b5b);}return _0x15cc28[_0x0988('0x19')](_0x408b5b)[_0x0988('0x1a')]();};}function respondWithResult(_0x1c1a8b,_0x17b6b4){_0x17b6b4=_0x17b6b4||0xc8;return function(_0x15814a){if(_0x15814a){return _0x1c1a8b['status'](_0x17b6b4)[_0x0988('0x1b')](_0x15814a);}};}function respondWithFilteredResult(_0x3a1ffb,_0x4e08cd){return function(_0x57a382){if(_0x57a382){var _0xbc412e=_0x57a382[_0x0988('0x1c')],_0x5d926a=_0x4e08cd['offset'],_0x1bca24=_0x4e08cd['offset']+_0x4e08cd['limit'],_0x2286e0;if(_0x1bca24>=_0xbc412e){_0x1bca24=_0xbc412e;_0x2286e0=0xc8;}else{_0x2286e0=0xce;}_0x3a1ffb[_0x0988('0x19')](_0x2286e0);return _0x3a1ffb[_0x0988('0x1d')](_0x0988('0x1e'),_0x5d926a+'-'+_0x1bca24+'/'+_0xbc412e)[_0x0988('0x1b')](_0x57a382);}return null;};}function patchUpdates(_0x4879ef){return function(_0x332387){try{jsonpatch['apply'](_0x332387,_0x4879ef,!![]);}catch(_0xcee3b2){return BPromise[_0x0988('0x1f')](_0xcee3b2);}return _0x332387[_0x0988('0x20')]();};}function saveUpdates(_0x3223a9,_0x53d9be){return function(_0x30eb14){if(_0x30eb14){return _0x30eb14['update'](_0x3223a9)[_0x0988('0x21')](function(_0x287a0f){return _0x287a0f;});}return null;};}function removeEntity(_0x47dba6,_0x5797a4){return function(_0x20c678){if(_0x20c678){return _0x20c678[_0x0988('0x22')]()[_0x0988('0x21')](function(){_0x47dba6[_0x0988('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3656db,_0x1ec38e){return function(_0x44dcae){if(!_0x44dcae){_0x3656db[_0x0988('0x23')](0x194);}return _0x44dcae;};}function handleError(_0xb2b724,_0x502b10){_0x502b10=_0x502b10||0x1f4;return function(_0x1b902e){logger[_0x0988('0x24')](_0x1b902e[_0x0988('0x25')]);if(_0x1b902e[_0x0988('0x26')]){delete _0x1b902e['name'];}_0xb2b724[_0x0988('0x19')](_0x502b10)[_0x0988('0x27')](_0x1b902e);};}exports[_0x0988('0x28')]=function(_0x56177f,_0x3abf32){var _0x5023e1={},_0x4b09d4={},_0x2fcd46={'count':0x0,'rows':[]};var _0x370f20=_[_0x0988('0x29')](db[_0x0988('0x2a')][_0x0988('0x2b')],function(_0x51a6ee){return{'name':_0x51a6ee[_0x0988('0x2c')],'type':_0x51a6ee[_0x0988('0x2d')][_0x0988('0x2e')]};});_0x4b09d4[_0x0988('0x2f')]=_[_0x0988('0x29')](_0x370f20,_0x0988('0x26'));_0x4b09d4[_0x0988('0x30')]=_['keys'](_0x56177f['query']);_0x4b09d4[_0x0988('0x31')]=_[_0x0988('0x32')](_0x4b09d4[_0x0988('0x2f')],_0x4b09d4[_0x0988('0x30')]);_0x5023e1[_0x0988('0x33')]=_['intersection'](_0x4b09d4[_0x0988('0x2f')],qs[_0x0988('0x34')](_0x56177f['query'][_0x0988('0x34')]));_0x5023e1[_0x0988('0x33')]=_0x5023e1[_0x0988('0x33')][_0x0988('0x35')]?_0x5023e1[_0x0988('0x33')]:_0x4b09d4['model'];if(!_0x56177f['query'][_0x0988('0x36')](_0x0988('0x37'))){_0x5023e1[_0x0988('0x38')]=qs[_0x0988('0x38')](_0x56177f['query'][_0x0988('0x38')]);_0x5023e1[_0x0988('0x39')]=qs[_0x0988('0x39')](_0x56177f[_0x0988('0x30')][_0x0988('0x39')]);}_0x5023e1[_0x0988('0x3a')]=qs['sort'](_0x56177f['query']['sort']);_0x5023e1[_0x0988('0x3b')]=qs[_0x0988('0x31')](_['pick'](_0x56177f[_0x0988('0x30')],_0x4b09d4[_0x0988('0x31')]),_0x370f20);if(_0x56177f[_0x0988('0x30')][_0x0988('0x3c')]){_0x5023e1['where']=_[_0x0988('0x3d')](_0x5023e1[_0x0988('0x3b')],{'$or':_[_0x0988('0x29')](_0x370f20,function(_0x37a51e){if(_0x37a51e[_0x0988('0x2d')]!==_0x0988('0x3e')){var _0x1fb15a={};_0x1fb15a[_0x37a51e[_0x0988('0x26')]]={'$like':'%'+_0x56177f['query']['filter']+'%'};return _0x1fb15a;}})});}_0x5023e1=_[_0x0988('0x3d')]({},_0x5023e1,_0x56177f[_0x0988('0x3f')]);var _0x58ec01={'where':_0x5023e1[_0x0988('0x3b')]};return db['VoiceQueuesLog'][_0x0988('0x1c')](_0x58ec01)[_0x0988('0x21')](function(_0x125e67){_0x2fcd46[_0x0988('0x1c')]=_0x125e67;if(_0x56177f['query'][_0x0988('0x40')]){_0x5023e1[_0x0988('0x41')]=[{'all':!![]}];}return db[_0x0988('0x2a')]['findAll'](_0x5023e1);})[_0x0988('0x21')](function(_0x5ccb83){_0x2fcd46[_0x0988('0x42')]=_0x5ccb83;return _0x2fcd46;})[_0x0988('0x21')](respondWithFilteredResult(_0x3abf32,_0x5023e1))[_0x0988('0x43')](handleError(_0x3abf32,null));};exports['show']=function(_0x117609,_0x265053){var _0xefd70={'raw':!![],'where':{'id':_0x117609['params']['id']}},_0x4f1adc={};_0x4f1adc['model']=_[_0x0988('0x44')](db[_0x0988('0x2a')]['rawAttributes']);_0x4f1adc[_0x0988('0x30')]=_['keys'](_0x117609[_0x0988('0x30')]);_0x4f1adc['filters']=_['intersection'](_0x4f1adc[_0x0988('0x2f')],_0x4f1adc[_0x0988('0x30')]);_0xefd70[_0x0988('0x33')]=_[_0x0988('0x32')](_0x4f1adc[_0x0988('0x2f')],qs['fields'](_0x117609[_0x0988('0x30')][_0x0988('0x34')]));_0xefd70['attributes']=_0xefd70['attributes'][_0x0988('0x35')]?_0xefd70[_0x0988('0x33')]:_0x4f1adc[_0x0988('0x2f')];if(_0x117609[_0x0988('0x30')][_0x0988('0x40')]){_0xefd70['include']=[{'all':!![]}];}_0xefd70=_['merge']({},_0xefd70,_0x117609[_0x0988('0x3f')]);return db[_0x0988('0x2a')][_0x0988('0x45')](_0xefd70)['then'](handleEntityNotFound(_0x265053,null))[_0x0988('0x21')](respondWithResult(_0x265053,null))[_0x0988('0x43')](handleError(_0x265053,null));};exports[_0x0988('0x46')]=function(_0x2c098b,_0x5217b2){return db[_0x0988('0x2a')]['create'](_0x2c098b[_0x0988('0x47')],{})['then'](respondWithResult(_0x5217b2,0xc9))[_0x0988('0x43')](handleError(_0x5217b2,null));};exports[_0x0988('0x48')]=function(_0x5e4714,_0x1edf7a){if(_0x5e4714[_0x0988('0x47')]['id']){delete _0x5e4714[_0x0988('0x47')]['id'];}return db[_0x0988('0x2a')][_0x0988('0x45')]({'where':{'id':_0x5e4714[_0x0988('0x49')]['id']}})[_0x0988('0x21')](handleEntityNotFound(_0x1edf7a,null))[_0x0988('0x21')](saveUpdates(_0x5e4714[_0x0988('0x47')],null))[_0x0988('0x21')](respondWithResult(_0x1edf7a,null))[_0x0988('0x43')](handleError(_0x1edf7a,null));};exports[_0x0988('0x22')]=function(_0x2a41ff,_0x442526){return db[_0x0988('0x2a')][_0x0988('0x45')]({'where':{'id':_0x2a41ff['params']['id']}})['then'](handleEntityNotFound(_0x442526,null))['then'](removeEntity(_0x442526,null))[_0x0988('0x43')](handleError(_0x442526,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