Built motion from commit (unavailable).|2.5.27
[motion2.git] / server / api / voicePrefix / voicePrefix.controller.js
index a7cd5ad..373f079 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb091=['prefix','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','charAt','update','system-','addAgents','ids','removeAgents','isArray','userVoicePrefix:remove','emit','pick','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','index','VoicePrefix','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','rawAttributes','find','catch','sequelize','transaction','create','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','appdata','NoOp','VoicePrefixId','Extensions\x20creation\x20failed'];(function(_0x437c10,_0x464d93){var _0x345deb=function(_0x34cd07){while(--_0x34cd07){_0x437c10['push'](_0x437c10['shift']());}};_0x345deb(++_0x464d93);}(_0xb091,0x16e));var _0x1b09=function(_0x158e09,_0x3a6427){_0x158e09=_0x158e09-0x0;var _0x48585b=_0xb091[_0x158e09];return _0x48585b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1b09('0x0'));var rimraf=require(_0x1b09('0x1'));var zipdir=require(_0x1b09('0x2'));var jsonpatch=require(_0x1b09('0x3'));var rp=require('request-promise');var moment=require(_0x1b09('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b09('0x5'));var path=require(_0x1b09('0x6'));var sox=require('sox');var csv=require(_0x1b09('0x7'));var ejs=require(_0x1b09('0x8'));var fs=require('fs');var _=require(_0x1b09('0x9'));var squel=require('squel');var crypto=require(_0x1b09('0xa'));var jsforce=require(_0x1b09('0xb'));var deskjs=require(_0x1b09('0xc'));var toCsv=require(_0x1b09('0x7'));var querystring=require(_0x1b09('0xd'));var Papa=require(_0x1b09('0xe'));var Redis=require(_0x1b09('0xf'));var authService=require(_0x1b09('0x10'));var qs=require(_0x1b09('0x11'));var as=require(_0x1b09('0x12'));var hardwareService=require(_0x1b09('0x13'));var logger=require('../../config/logger')(_0x1b09('0x14'));var utils=require(_0x1b09('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1b09('0x16'))['db'];config[_0x1b09('0x17')]=_[_0x1b09('0x18')](config[_0x1b09('0x17')],{'host':_0x1b09('0x19'),'port':0x18eb});var socket=require(_0x1b09('0x1a'))(new Redis(config[_0x1b09('0x17')]));require('./voicePrefix.socket')[_0x1b09('0x1b')](socket);function respondWithStatusCode(_0x515ade,_0x455a8e){_0x455a8e=_0x455a8e||0xcc;return function(_0x27a731){if(_0x27a731){return _0x515ade[_0x1b09('0x1c')](_0x455a8e);}return _0x515ade[_0x1b09('0x1d')](_0x455a8e)[_0x1b09('0x1e')]();};}function respondWithResult(_0x1dc96b,_0x64689a){_0x64689a=_0x64689a||0xc8;return function(_0x33129b){if(_0x33129b){return _0x1dc96b[_0x1b09('0x1d')](_0x64689a)[_0x1b09('0x1f')](_0x33129b);}};}function respondWithFilteredResult(_0x311158,_0x231ef6){return function(_0x646575){if(_0x646575){var _0x4c64e1=_0x646575['count'],_0x214c6b=_0x231ef6[_0x1b09('0x20')],_0x1c1ef9=_0x231ef6['offset']+_0x231ef6[_0x1b09('0x21')],_0x5483ef;if(_0x1c1ef9>=_0x4c64e1){_0x1c1ef9=_0x4c64e1;_0x5483ef=0xc8;}else{_0x5483ef=0xce;}_0x311158['status'](_0x5483ef);return _0x311158[_0x1b09('0x22')](_0x1b09('0x23'),_0x214c6b+'-'+_0x1c1ef9+'/'+_0x4c64e1)[_0x1b09('0x1f')](_0x646575);}return null;};}function patchUpdates(_0x1e8f97){return function(_0x29dd70){try{jsonpatch[_0x1b09('0x24')](_0x29dd70,_0x1e8f97,!![]);}catch(_0x363e78){return BPromise[_0x1b09('0x25')](_0x363e78);}return _0x29dd70['save']();};}function saveUpdates(_0x5e2806,_0x27f4f5){return function(_0x41c786){if(_0x41c786){return _0x41c786['update'](_0x5e2806)[_0x1b09('0x26')](function(_0x11d0d5){return _0x11d0d5;});}return null;};}function removeEntity(_0x6e132c,_0xb22064){return function(_0x5a9677){if(_0x5a9677){return _0x5a9677[_0x1b09('0x27')]()[_0x1b09('0x26')](function(){var _0x4936d0=_0x5a9677[_0x1b09('0x28')]({'plain':!![]});var _0x472d30='VoicePrefixes';return db[_0x1b09('0x29')][_0x1b09('0x27')]({'where':{'type':_0x472d30,'resourceId':_0x4936d0['id']}})[_0x1b09('0x26')](function(){return _0x5a9677;});})[_0x1b09('0x26')](function(){_0x6e132c['status'](0xcc)[_0x1b09('0x1e')]();});}};}function handleEntityNotFound(_0x3cdbc5,_0x532589){return function(_0x2d1ec0){if(!_0x2d1ec0){_0x3cdbc5[_0x1b09('0x1c')](0x194);}return _0x2d1ec0;};}function handleError(_0x26befb,_0x1cbbd5){_0x1cbbd5=_0x1cbbd5||0x1f4;return function(_0x11098e){logger[_0x1b09('0x2a')](_0x11098e[_0x1b09('0x2b')]);if(_0x11098e['name']){delete _0x11098e[_0x1b09('0x2c')];}_0x26befb[_0x1b09('0x1d')](_0x1cbbd5)['send'](_0x11098e);};}exports[_0x1b09('0x2d')]=function(_0x1a6130,_0x1b98da){var _0x122b1c={},_0x62a96b={},_0x4b3aec={'count':0x0,'rows':[]};var _0x4540de=_['map'](db[_0x1b09('0x2e')]['rawAttributes'],function(_0x1ee079){return{'name':_0x1ee079[_0x1b09('0x2f')],'type':_0x1ee079[_0x1b09('0x30')][_0x1b09('0x31')]};});_0x62a96b[_0x1b09('0x32')]=_[_0x1b09('0x33')](_0x4540de,_0x1b09('0x2c'));_0x62a96b[_0x1b09('0x34')]=_[_0x1b09('0x35')](_0x1a6130[_0x1b09('0x34')]);_0x62a96b['filters']=_[_0x1b09('0x36')](_0x62a96b[_0x1b09('0x32')],_0x62a96b[_0x1b09('0x34')]);_0x122b1c['attributes']=_[_0x1b09('0x36')](_0x62a96b[_0x1b09('0x32')],qs[_0x1b09('0x37')](_0x1a6130[_0x1b09('0x34')][_0x1b09('0x37')]));_0x122b1c[_0x1b09('0x38')]=_0x122b1c[_0x1b09('0x38')][_0x1b09('0x39')]?_0x122b1c['attributes']:_0x62a96b[_0x1b09('0x32')];if(!_0x1a6130['query'][_0x1b09('0x3a')]('nolimit')){_0x122b1c[_0x1b09('0x21')]=qs[_0x1b09('0x21')](_0x1a6130[_0x1b09('0x34')][_0x1b09('0x21')]);_0x122b1c[_0x1b09('0x20')]=qs[_0x1b09('0x20')](_0x1a6130[_0x1b09('0x34')][_0x1b09('0x20')]);}_0x122b1c[_0x1b09('0x3b')]=qs[_0x1b09('0x3c')](_0x1a6130[_0x1b09('0x34')][_0x1b09('0x3c')]);_0x122b1c[_0x1b09('0x3d')]=qs['filters'](_['pick'](_0x1a6130[_0x1b09('0x34')],_0x62a96b[_0x1b09('0x3e')]),_0x4540de);if(_0x1a6130[_0x1b09('0x34')][_0x1b09('0x3f')]){_0x122b1c[_0x1b09('0x3d')]=_[_0x1b09('0x40')](_0x122b1c[_0x1b09('0x3d')],{'$or':_[_0x1b09('0x33')](_0x4540de,function(_0x4dd7e2){if(_0x4dd7e2['type']!==_0x1b09('0x41')){var _0x51d5eb={};_0x51d5eb[_0x4dd7e2[_0x1b09('0x2c')]]={'$like':'%'+_0x1a6130[_0x1b09('0x34')][_0x1b09('0x3f')]+'%'};return _0x51d5eb;}})});}_0x122b1c=_['merge']({},_0x122b1c,_0x1a6130[_0x1b09('0x42')]);var _0x23bdde={'where':_0x122b1c[_0x1b09('0x3d')]};return db['VoicePrefix'][_0x1b09('0x43')](_0x23bdde)[_0x1b09('0x26')](function(_0x237b99){_0x4b3aec[_0x1b09('0x43')]=_0x237b99;if(_0x1a6130['query'][_0x1b09('0x44')]){_0x122b1c[_0x1b09('0x45')]=[{'all':!![]}];}return db['VoicePrefix'][_0x1b09('0x46')](_0x122b1c);})[_0x1b09('0x26')](function(_0x4d8597){_0x4b3aec['rows']=_0x4d8597;return _0x4b3aec;})['then'](respondWithFilteredResult(_0x1b98da,_0x122b1c))['catch'](handleError(_0x1b98da,null));};exports[_0x1b09('0x47')]=function(_0xabc336,_0x1314b8){var _0x50bafc={'raw':![],'where':{'id':_0xabc336[_0x1b09('0x48')]['id']}},_0x207af5={};_0x207af5['model']=_[_0x1b09('0x35')](db[_0x1b09('0x2e')][_0x1b09('0x49')]);_0x207af5[_0x1b09('0x34')]=_[_0x1b09('0x35')](_0xabc336[_0x1b09('0x34')]);_0x207af5[_0x1b09('0x3e')]=_[_0x1b09('0x36')](_0x207af5[_0x1b09('0x32')],_0x207af5[_0x1b09('0x34')]);_0x50bafc['attributes']=_[_0x1b09('0x36')](_0x207af5[_0x1b09('0x32')],qs[_0x1b09('0x37')](_0xabc336['query'][_0x1b09('0x37')]));_0x50bafc['attributes']=_0x50bafc[_0x1b09('0x38')][_0x1b09('0x39')]?_0x50bafc['attributes']:_0x207af5[_0x1b09('0x32')];if(_0xabc336[_0x1b09('0x34')][_0x1b09('0x44')]){_0x50bafc[_0x1b09('0x45')]=[{'all':!![]}];}_0x50bafc=_[_0x1b09('0x40')]({},_0x50bafc,_0xabc336[_0x1b09('0x42')]);return db['VoicePrefix'][_0x1b09('0x4a')](_0x50bafc)['then'](handleEntityNotFound(_0x1314b8,null))[_0x1b09('0x26')](respondWithResult(_0x1314b8,null))['catch'](handleError(_0x1314b8,null));};exports['destroy']=function(_0x55376,_0x141b98){return db[_0x1b09('0x2e')][_0x1b09('0x4a')]({'where':{'id':_0x55376[_0x1b09('0x48')]['id']}})[_0x1b09('0x26')](handleEntityNotFound(_0x141b98,null))[_0x1b09('0x26')](removeEntity(_0x141b98,null))[_0x1b09('0x4b')](handleError(_0x141b98,null));};exports['describe']=function(_0x24028e,_0x3c6ea6){return db[_0x1b09('0x2e')]['describe']()['then'](respondWithResult(_0x3c6ea6,null))[_0x1b09('0x4b')](handleError(_0x3c6ea6,null));};exports['create']=function(_0x2abc94,_0x3e3dc2){var _0x49b051;return db[_0x1b09('0x4c')][_0x1b09('0x4d')](function(_0x5941df){return db[_0x1b09('0x2e')][_0x1b09('0x4e')](_0x2abc94[_0x1b09('0x4f')],{'transaction':_0x5941df})[_0x1b09('0x26')](function(_0x18adb5){_0x49b051=_0x18adb5['get']({'plain':!![]});return db[_0x1b09('0x50')][_0x1b09('0x4a')]({'where':{'id':_0x49b051[_0x1b09('0x51')]},'raw':!![]})[_0x1b09('0x26')](function(_0x34e660){return createVoicePrefixExtensions(_0x49b051,_0x34e660,_0x5941df);});});})[_0x1b09('0x26')](function(){var _0x7ee6af=_0x2abc94['user']['get']({'plain':!![]});if(!_0x7ee6af)throw new Error(_0x1b09('0x52'));if(_0x7ee6af[_0x1b09('0x53')]===_0x1b09('0x54')){var _0x533eb5=_0x49b051;return db[_0x1b09('0x55')][_0x1b09('0x4a')]({'where':{'name':_0x1b09('0x56'),'userProfileId':_0x7ee6af['userProfileId']},'raw':!![]})[_0x1b09('0x26')](function(_0x2dcdb6){if(_0x2dcdb6&&_0x2dcdb6[_0x1b09('0x57')]===0x0){return db[_0x1b09('0x29')][_0x1b09('0x4e')]({'name':_0x533eb5[_0x1b09('0x2c')],'resourceId':_0x533eb5['id'],'type':_0x2dcdb6[_0x1b09('0x2c')],'sectionId':_0x2dcdb6['id']},{})[_0x1b09('0x26')](function(){return _0x49b051;});}else{return _0x49b051;}})[_0x1b09('0x4b')](function(_0xcab572){logger[_0x1b09('0x2a')](_0x1b09('0x58'),_0xcab572);throw _0xcab572;});}return _0x49b051;})[_0x1b09('0x26')](respondWithResult(_0x3e3dc2,null))[_0x1b09('0x4b')](handleError(_0x3e3dc2,null));};function Extension(_0x7dd20a,_0x4ca41c,_0x5766cb,_0x2cc31e){this['context']=_0x1b09('0x59');this[_0x1b09('0x5a')]=_0x7dd20a;this[_0x1b09('0x5b')]=_0x5766cb;this['type']='system';this[_0x1b09('0x5c')]=_0x1b09('0x5d');this['priority']=_0x4ca41c;this[_0x1b09('0x5e')]=_0x2cc31e;}function createVoicePrefixExtensions(_0x2f2388,_0x1ba539,_0x410b16){return new BPromise(function(_0x284185,_0x1f8f1c){var _0x24a20d=new Extension(formatPrefixName(_0x2f2388['prefix']),0x1,_0x1b09('0x5f'),'Voice\x20Prefix');_0x24a20d[_0x1b09('0x60')]=_0x2f2388['id'];return db[_0x1b09('0x50')][_0x1b09('0x4e')](_0x24a20d,{'transaction':_0x410b16})[_0x1b09('0x26')](function(_0x1ed857){var _0x178ab7=_0x1ed857[_0x1b09('0x28')]({'plain':!![]});var _0x44ffc1=_[_0x1b09('0x33')](addVoicePrefixExtensions(_0x2f2388,_0x1ba539),function(_0x3e1dba){_0x3e1dba[_0x1b09('0x51')]=_0x178ab7['id'];_0x3e1dba[_0x1b09('0x60')]=_0x2f2388['id'];return _0x3e1dba;});return db['VoiceExtension']['bulkCreate'](_0x44ffc1,{'transaction':_0x410b16})[_0x1b09('0x26')](function(_0x314411){if(!_0x314411){return _0x1f8f1c(_0x1b09('0x61'));}else{return _0x284185(_0x314411);}})['catch'](function(_0x42fa10){return _0x1f8f1c(_0x42fa10);});});;});};function addVoicePrefixExtensions(_0x7b6db1,_0x2b422c){var _0x57bec1=[];var _0x28d473=formatPrefixName(_0x7b6db1[_0x1b09('0x62')]);_0x57bec1[_0x1b09('0x63')](new Extension(_0x28d473,0x2,'Set',_0x1b09('0x64')+_0x7b6db1['name']));if(_0x7b6db1['callerIdAll']){_0x57bec1[_0x1b09('0x63')](new Extension(_0x28d473,0x3,_0x1b09('0x65'),_0x1b09('0x66')+_0x7b6db1['callerIdAll']));}else{_0x57bec1[_0x1b09('0x63')](new Extension(_0x28d473,0x3,'NoOp',_0x1b09('0x67')));}_0x57bec1[_0x1b09('0x63')](new Extension(_0x28d473,0x4,'goto',_0x2b422c[_0x1b09('0x68')]+','+'${EXTEN:'+(0x8+_0x7b6db1[_0x1b09('0x2c')][_0x1b09('0x39')])+'}'+','+0x1));return _0x57bec1;}function formatPrefixName(_0x52b5cf){var _0x1acf31='_';for(var _0x597a68=0x0;_0x597a68<_0x52b5cf[_0x1b09('0x39')];_0x597a68++){if(_0x52b5cf[_0x1b09('0x69')](_0x597a68)=='-'){_0x1acf31+=_0x52b5cf[_0x1b09('0x69')](_0x597a68);}else{_0x1acf31+='['+_0x52b5cf[_0x1b09('0x69')](_0x597a68)+']';}}_0x1acf31+='.';return _0x1acf31;}exports[_0x1b09('0x6a')]=function(_0x576060,_0x2ed2a7,_0x150b7e){var _0x410138=_0x576060['body'];_0x410138[_0x1b09('0x62')]=_0x1b09('0x6b')+_0x410138[_0x1b09('0x2c')]+'-';return db[_0x1b09('0x4c')][_0x1b09('0x4d')](function(_0x5051dc){return db[_0x1b09('0x2e')]['update'](_0x410138,{'where':{'id':_0x410138['id']},'transaction':_0x5051dc})[_0x1b09('0x26')](function(){return db[_0x1b09('0x50')][_0x1b09('0x27')]({'where':{'VoicePrefixId':_0x410138['id']},'transaction':_0x5051dc})[_0x1b09('0x26')](function(){return db[_0x1b09('0x50')][_0x1b09('0x4a')]({'where':{'id':_0x410138[_0x1b09('0x51')]},'raw':!![]})[_0x1b09('0x26')](function(_0x4e74de){return createVoicePrefixExtensions(_0x410138,_0x4e74de,_0x5051dc);});});});})[_0x1b09('0x26')](function(){return db[_0x1b09('0x2e')]['findById'](_0x410138['id']);})[_0x1b09('0x26')](respondWithResult(_0x2ed2a7,null))[_0x1b09('0x4b')](handleError(_0x2ed2a7,null));};exports[_0x1b09('0x6c')]=function(_0x24871f,_0x309168,_0xe6d81b){return db[_0x1b09('0x2e')][_0x1b09('0x4a')]({'where':{'id':_0x24871f[_0x1b09('0x48')]['id']}})['then'](handleEntityNotFound(_0x309168,null))[_0x1b09('0x26')](function(_0xd83b8c){if(_0xd83b8c){return _0xd83b8c[_0x1b09('0x6c')](_0x24871f[_0x1b09('0x4f')][_0x1b09('0x6d')],_['omit'](_0x24871f[_0x1b09('0x4f')],[_0x1b09('0x6d'),'id'])||{})['spread'](function(_0x2eeb15){for(var _0x5add57=0x0;_0x5add57<_0x24871f[_0x1b09('0x4f')][_0x1b09('0x6d')][_0x1b09('0x39')];_0x5add57+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':_0x24871f['body'][_0x1b09('0x6d')][_0x5add57],'VoicePrefixId':_0x24871f[_0x1b09('0x48')]['id']});}return _0x2eeb15;});}})[_0x1b09('0x26')](respondWithResult(_0x309168,null))[_0x1b09('0x4b')](handleError(_0x309168,null));};exports[_0x1b09('0x6e')]=function(_0x326564,_0x1b71cc,_0x408d2b){return db[_0x1b09('0x2e')][_0x1b09('0x4a')]({'where':{'id':_0x326564[_0x1b09('0x48')]['id']}})[_0x1b09('0x26')](handleEntityNotFound(_0x1b71cc,null))['then'](function(_0x47a45c){if(_0x47a45c){return _0x47a45c[_0x1b09('0x6e')](_0x326564[_0x1b09('0x34')][_0x1b09('0x6d')])[_0x1b09('0x26')](function(){if(_[_0x1b09('0x6f')](_0x326564[_0x1b09('0x34')][_0x1b09('0x6d')])){for(var _0x52f219=0x0;_0x52f219<_0x326564[_0x1b09('0x34')][_0x1b09('0x6d')][_0x1b09('0x39')];_0x52f219+=0x1){socket['emit'](_0x1b09('0x70'),{'UserId':Number(_0x326564[_0x1b09('0x34')][_0x1b09('0x6d')][_0x52f219]),'VoicePrefixId':Number(_0x326564[_0x1b09('0x48')]['id'])});}}else{socket[_0x1b09('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x326564['query'][_0x1b09('0x6d')]),'VoicePrefixId':Number(_0x326564[_0x1b09('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b71cc,null))[_0x1b09('0x4b')](handleError(_0x1b71cc,null));};exports['getAgents']=function(_0x3b66fc,_0x42bbc0,_0x18d0e9){var _0x595a32={};var _0x14f277={};var _0x4c504d;var _0x4c4b37;return db[_0x1b09('0x2e')]['findOne']({'where':{'id':_0x3b66fc['params']['id']}})['then'](handleEntityNotFound(_0x42bbc0,null))[_0x1b09('0x26')](function(_0x21bdaa){if(_0x21bdaa){_0x4c504d=_0x21bdaa;_0x14f277[_0x1b09('0x32')]=_[_0x1b09('0x35')](db['User'][_0x1b09('0x49')]);_0x14f277[_0x1b09('0x34')]=_[_0x1b09('0x35')](_0x3b66fc[_0x1b09('0x34')]);_0x14f277[_0x1b09('0x3e')]=_['intersection'](_0x14f277[_0x1b09('0x32')],_0x14f277[_0x1b09('0x34')]);_0x595a32[_0x1b09('0x38')]=_[_0x1b09('0x36')](_0x14f277['model'],qs['fields'](_0x3b66fc['query'][_0x1b09('0x37')]));_0x595a32[_0x1b09('0x38')]=_0x595a32[_0x1b09('0x38')][_0x1b09('0x39')]?_0x595a32[_0x1b09('0x38')]:_0x14f277[_0x1b09('0x32')];_0x595a32['order']=qs[_0x1b09('0x3c')](_0x3b66fc[_0x1b09('0x34')]['sort']);_0x595a32['where']=qs[_0x1b09('0x3e')](_[_0x1b09('0x72')](_0x3b66fc[_0x1b09('0x34')],_0x14f277['filters']));if(_0x3b66fc['query'][_0x1b09('0x3f')]){_0x595a32['where']=_[_0x1b09('0x40')](_0x595a32['where'],{'$or':_['map'](_0x595a32[_0x1b09('0x38')],function(_0xbd17f8){var _0x40f6bf={};_0x40f6bf[_0xbd17f8]={'$like':'%'+_0x3b66fc['query'][_0x1b09('0x3f')]+'%'};return _0x40f6bf;})});}_0x595a32=_[_0x1b09('0x40')]({},_0x595a32,_0x3b66fc[_0x1b09('0x42')]);return _0x4c504d[_0x1b09('0x73')](_0x595a32);}})[_0x1b09('0x26')](function(_0x315303){if(_0x315303){_0x4c4b37=_0x315303[_0x1b09('0x39')];if(!_0x3b66fc['query'][_0x1b09('0x3a')]('nolimit')){_0x595a32[_0x1b09('0x21')]=qs[_0x1b09('0x21')](_0x3b66fc['query'][_0x1b09('0x21')]);_0x595a32[_0x1b09('0x20')]=qs['offset'](_0x3b66fc['query'][_0x1b09('0x20')]);}return _0x4c504d[_0x1b09('0x73')](_0x595a32);}})[_0x1b09('0x26')](function(_0x266139){if(_0x266139){return _0x266139?{'count':_0x4c4b37,'rows':_0x266139}:null;}})[_0x1b09('0x26')](respondWithResult(_0x42bbc0,null))[_0x1b09('0x4b')](handleError(_0x42bbc0,null));};
\ No newline at end of file
+var _0x803f=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','stack','name','send','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','findAll','catch','show','params','include','merge','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','autoAssociation','UserProfileResource','context','from-sip','exten','app','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','callerIdAll','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','findOne','User','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x803f,0x144));var _0xf803=function(_0x93fa94,_0x38ea85){_0x93fa94=_0x93fa94-0x0;var _0x35eb88=_0x803f[_0x93fa94];return _0x35eb88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf803('0x0'));var zipdir=require(_0xf803('0x1'));var jsonpatch=require(_0xf803('0x2'));var rp=require(_0xf803('0x3'));var moment=require(_0xf803('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf803('0x5'));var util=require(_0xf803('0x6'));var path=require(_0xf803('0x7'));var sox=require(_0xf803('0x8'));var csv=require(_0xf803('0x9'));var ejs=require(_0xf803('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf803('0xb'));var squel=require(_0xf803('0xc'));var crypto=require(_0xf803('0xd'));var jsforce=require(_0xf803('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf803('0xf'));var Papa=require('papaparse');var Redis=require(_0xf803('0x10'));var authService=require(_0xf803('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf803('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf803('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf803('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf803('0x15')]=_[_0xf803('0x16')](config[_0xf803('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xf803('0x17'))(new Redis(config[_0xf803('0x15')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0xaf3d8d,_0x266308){_0x266308=_0x266308||0xcc;return function(_0x217079){if(_0x217079){return _0xaf3d8d[_0xf803('0x18')](_0x266308);}return _0xaf3d8d[_0xf803('0x19')](_0x266308)[_0xf803('0x1a')]();};}function respondWithResult(_0x56a5db,_0x454471){_0x454471=_0x454471||0xc8;return function(_0x5f281c){if(_0x5f281c){return _0x56a5db[_0xf803('0x19')](_0x454471)[_0xf803('0x1b')](_0x5f281c);}};}function respondWithFilteredResult(_0x1d645b,_0x2e30dc){return function(_0x5641a0){if(_0x5641a0){var _0x232bc8=_0x5641a0[_0xf803('0x1c')],_0x4d2ce7=_0x2e30dc[_0xf803('0x1d')],_0x4594de=_0x2e30dc['offset']+_0x2e30dc[_0xf803('0x1e')],_0x41c219;if(_0x4594de>=_0x232bc8){_0x4594de=_0x232bc8;_0x41c219=0xc8;}else{_0x41c219=0xce;}_0x1d645b['status'](_0x41c219);return _0x1d645b['set'](_0xf803('0x1f'),_0x4d2ce7+'-'+_0x4594de+'/'+_0x232bc8)[_0xf803('0x1b')](_0x5641a0);}return null;};}function patchUpdates(_0x6e7c8d){return function(_0xb3e488){try{jsonpatch[_0xf803('0x20')](_0xb3e488,_0x6e7c8d,!![]);}catch(_0x831a71){return BPromise['reject'](_0x831a71);}return _0xb3e488[_0xf803('0x21')]();};}function saveUpdates(_0x59f6f2,_0x48d266){return function(_0x11282a){if(_0x11282a){return _0x11282a[_0xf803('0x22')](_0x59f6f2)[_0xf803('0x23')](function(_0x4cd887){return _0x4cd887;});}return null;};}function removeEntity(_0x1b998e,_0x5afaee){return function(_0x2e8e3b){if(_0x2e8e3b){return _0x2e8e3b[_0xf803('0x24')]()[_0xf803('0x23')](function(){var _0x5390a8=_0x2e8e3b[_0xf803('0x25')]({'plain':!![]});var _0x69c7fc=_0xf803('0x26');return db['UserProfileResource'][_0xf803('0x24')]({'where':{'type':_0x69c7fc,'resourceId':_0x5390a8['id']}})[_0xf803('0x23')](function(){return _0x2e8e3b;});})[_0xf803('0x23')](function(){_0x1b998e[_0xf803('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad8b6,_0x5d5912){return function(_0x18e68b){if(!_0x18e68b){_0x3ad8b6[_0xf803('0x18')](0x194);}return _0x18e68b;};}function handleError(_0x1404de,_0x554d17){_0x554d17=_0x554d17||0x1f4;return function(_0x419229){logger['error'](_0x419229[_0xf803('0x27')]);if(_0x419229[_0xf803('0x28')]){delete _0x419229[_0xf803('0x28')];}_0x1404de[_0xf803('0x19')](_0x554d17)[_0xf803('0x29')](_0x419229);};}exports['index']=function(_0x1335bc,_0x4c77ff){var _0x467543={},_0x1a0b38={},_0x553a49={'count':0x0,'rows':[]};var _0x261270=_[_0xf803('0x2a')](db[_0xf803('0x2b')][_0xf803('0x2c')],function(_0x1e4ddc){return{'name':_0x1e4ddc['fieldName'],'type':_0x1e4ddc[_0xf803('0x2d')][_0xf803('0x2e')]};});_0x1a0b38[_0xf803('0x2f')]=_[_0xf803('0x2a')](_0x261270,'name');_0x1a0b38[_0xf803('0x30')]=_[_0xf803('0x31')](_0x1335bc[_0xf803('0x30')]);_0x1a0b38[_0xf803('0x32')]=_[_0xf803('0x33')](_0x1a0b38[_0xf803('0x2f')],_0x1a0b38[_0xf803('0x30')]);_0x467543[_0xf803('0x34')]=_['intersection'](_0x1a0b38[_0xf803('0x2f')],qs['fields'](_0x1335bc[_0xf803('0x30')][_0xf803('0x35')]));_0x467543[_0xf803('0x34')]=_0x467543[_0xf803('0x34')][_0xf803('0x36')]?_0x467543[_0xf803('0x34')]:_0x1a0b38['model'];if(!_0x1335bc[_0xf803('0x30')][_0xf803('0x37')]('nolimit')){_0x467543[_0xf803('0x1e')]=qs[_0xf803('0x1e')](_0x1335bc[_0xf803('0x30')][_0xf803('0x1e')]);_0x467543[_0xf803('0x1d')]=qs['offset'](_0x1335bc[_0xf803('0x30')]['offset']);}_0x467543[_0xf803('0x38')]=qs[_0xf803('0x39')](_0x1335bc[_0xf803('0x30')][_0xf803('0x39')]);_0x467543[_0xf803('0x3a')]=qs[_0xf803('0x32')](_[_0xf803('0x3b')](_0x1335bc[_0xf803('0x30')],_0x1a0b38['filters']),_0x261270);if(_0x1335bc[_0xf803('0x30')]['filter']){_0x467543[_0xf803('0x3a')]=_['merge'](_0x467543['where'],{'$or':_[_0xf803('0x2a')](_0x261270,function(_0x5be7a5){if(_0x5be7a5[_0xf803('0x2d')]!==_0xf803('0x3c')){var _0x131d46={};_0x131d46[_0x5be7a5[_0xf803('0x28')]]={'$like':'%'+_0x1335bc[_0xf803('0x30')][_0xf803('0x3d')]+'%'};return _0x131d46;}})});}_0x467543=_['merge']({},_0x467543,_0x1335bc['options']);var _0x39279d={'where':_0x467543['where']};return db[_0xf803('0x2b')][_0xf803('0x1c')](_0x39279d)[_0xf803('0x23')](function(_0x325f06){_0x553a49[_0xf803('0x1c')]=_0x325f06;if(_0x1335bc[_0xf803('0x30')][_0xf803('0x3e')]){_0x467543['include']=[{'all':!![]}];}return db[_0xf803('0x2b')][_0xf803('0x3f')](_0x467543);})[_0xf803('0x23')](function(_0x1abde3){_0x553a49['rows']=_0x1abde3;return _0x553a49;})[_0xf803('0x23')](respondWithFilteredResult(_0x4c77ff,_0x467543))[_0xf803('0x40')](handleError(_0x4c77ff,null));};exports[_0xf803('0x41')]=function(_0xfc0991,_0x35132d){var _0xff25a0={'raw':![],'where':{'id':_0xfc0991[_0xf803('0x42')]['id']}},_0x53e223={};_0x53e223[_0xf803('0x2f')]=_[_0xf803('0x31')](db[_0xf803('0x2b')][_0xf803('0x2c')]);_0x53e223[_0xf803('0x30')]=_['keys'](_0xfc0991[_0xf803('0x30')]);_0x53e223[_0xf803('0x32')]=_[_0xf803('0x33')](_0x53e223[_0xf803('0x2f')],_0x53e223[_0xf803('0x30')]);_0xff25a0[_0xf803('0x34')]=_[_0xf803('0x33')](_0x53e223['model'],qs[_0xf803('0x35')](_0xfc0991['query'][_0xf803('0x35')]));_0xff25a0[_0xf803('0x34')]=_0xff25a0[_0xf803('0x34')][_0xf803('0x36')]?_0xff25a0[_0xf803('0x34')]:_0x53e223['model'];if(_0xfc0991[_0xf803('0x30')][_0xf803('0x3e')]){_0xff25a0[_0xf803('0x43')]=[{'all':!![]}];}_0xff25a0=_[_0xf803('0x44')]({},_0xff25a0,_0xfc0991[_0xf803('0x45')]);return db['VoicePrefix'][_0xf803('0x46')](_0xff25a0)[_0xf803('0x23')](handleEntityNotFound(_0x35132d,null))['then'](respondWithResult(_0x35132d,null))[_0xf803('0x40')](handleError(_0x35132d,null));};exports[_0xf803('0x24')]=function(_0x259973,_0x5544c5){return db[_0xf803('0x2b')][_0xf803('0x46')]({'where':{'id':_0x259973[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x5544c5,null))[_0xf803('0x23')](removeEntity(_0x5544c5,null))['catch'](handleError(_0x5544c5,null));};exports[_0xf803('0x47')]=function(_0x3f7f97,_0x7ca2e8){return db[_0xf803('0x2b')][_0xf803('0x47')]()[_0xf803('0x23')](respondWithResult(_0x7ca2e8,null))[_0xf803('0x40')](handleError(_0x7ca2e8,null));};exports[_0xf803('0x48')]=function(_0x59c3d9,_0x5d3bc6){var _0x85ef04;return db[_0xf803('0x49')][_0xf803('0x4a')](function(_0xd40ab2){return db['VoicePrefix'][_0xf803('0x48')](_0x59c3d9['body'],{'transaction':_0xd40ab2})[_0xf803('0x23')](function(_0x837f54){_0x85ef04=_0x837f54[_0xf803('0x25')]({'plain':!![]});return db[_0xf803('0x4b')][_0xf803('0x46')]({'where':{'id':_0x85ef04[_0xf803('0x4c')]},'raw':!![]})['then'](function(_0xe14b1f){return createVoicePrefixExtensions(_0x85ef04,_0xe14b1f,_0xd40ab2);});});})[_0xf803('0x23')](function(){var _0x11bbe2=_0x59c3d9[_0xf803('0x4d')][_0xf803('0x25')]({'plain':!![]});if(!_0x11bbe2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11bbe2[_0xf803('0x4e')]===_0xf803('0x4d')){var _0xea9eef=_0x85ef04;return db[_0xf803('0x4f')]['find']({'where':{'name':_0xf803('0x26'),'userProfileId':_0x11bbe2['userProfileId']},'raw':!![]})[_0xf803('0x23')](function(_0x5bd57d){if(_0x5bd57d&&_0x5bd57d[_0xf803('0x50')]===0x0){return db[_0xf803('0x51')][_0xf803('0x48')]({'name':_0xea9eef[_0xf803('0x28')],'resourceId':_0xea9eef['id'],'type':_0x5bd57d[_0xf803('0x28')],'sectionId':_0x5bd57d['id']},{})['then'](function(){return _0x85ef04;});}else{return _0x85ef04;}})[_0xf803('0x40')](function(_0x2486ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2486ad);throw _0x2486ad;});}return _0x85ef04;})['then'](respondWithResult(_0x5d3bc6,null))[_0xf803('0x40')](handleError(_0x5d3bc6,null));};function Extension(_0x59bbfb,_0x22a7d0,_0x4821a9,_0x43424b){this[_0xf803('0x52')]=_0xf803('0x53');this[_0xf803('0x54')]=_0x59bbfb;this[_0xf803('0x55')]=_0x4821a9;this[_0xf803('0x2d')]='system';this['description']='Voice\x20Prefix\x20Extension';this[_0xf803('0x56')]=_0x22a7d0;this['appdata']=_0x43424b;}function createVoicePrefixExtensions(_0x110b92,_0x10f5ca,_0x5cc77d){return new BPromise(function(_0x251473,_0x1781d8){var _0xa0d21b=new Extension(formatPrefixName(_0x110b92[_0xf803('0x57')]),0x1,'NoOp',_0xf803('0x58'));_0xa0d21b[_0xf803('0x59')]=_0x110b92['id'];return db[_0xf803('0x4b')][_0xf803('0x48')](_0xa0d21b,{'transaction':_0x5cc77d})[_0xf803('0x23')](function(_0x581bb7){var _0x274819=_0x581bb7[_0xf803('0x25')]({'plain':!![]});var _0x33f01c=_[_0xf803('0x2a')](addVoicePrefixExtensions(_0x110b92,_0x10f5ca),function(_0x34c1ee){_0x34c1ee['VoiceExtensionId']=_0x274819['id'];_0x34c1ee[_0xf803('0x59')]=_0x110b92['id'];return _0x34c1ee;});return db[_0xf803('0x4b')][_0xf803('0x5a')](_0x33f01c,{'transaction':_0x5cc77d})[_0xf803('0x23')](function(_0x5dfa99){if(!_0x5dfa99){return _0x1781d8('Extensions\x20creation\x20failed');}else{return _0x251473(_0x5dfa99);}})[_0xf803('0x40')](function(_0x23444b){return _0x1781d8(_0x23444b);});});;});};function addVoicePrefixExtensions(_0x59f473,_0x31e07b){var _0x567565=[];var _0x91a198=formatPrefixName(_0x59f473[_0xf803('0x57')]);_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x2,_0xf803('0x5c'),'CDR(prefix)='+_0x59f473[_0xf803('0x28')]));if(_0x59f473[_0xf803('0x5d')]){_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x3,_0xf803('0x5c'),'PREFIX-CALLERIDALL='+_0x59f473[_0xf803('0x5d')]));}else{_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x3,_0xf803('0x5e'),_0xf803('0x5f')));}_0x567565[_0xf803('0x5b')](new Extension(_0x91a198,0x4,_0xf803('0x60'),_0x31e07b[_0xf803('0x52')]+','+_0xf803('0x61')+(0x8+_0x59f473['name'][_0xf803('0x36')])+'}'+','+0x1));return _0x567565;}function formatPrefixName(_0x553463){var _0x35e828='_';for(var _0x1fd8ff=0x0;_0x1fd8ff<_0x553463['length'];_0x1fd8ff++){if(_0x553463[_0xf803('0x62')](_0x1fd8ff)=='-'){_0x35e828+=_0x553463[_0xf803('0x62')](_0x1fd8ff);}else{_0x35e828+='['+_0x553463['charAt'](_0x1fd8ff)+']';}}_0x35e828+='.';return _0x35e828;}exports['update']=function(_0x7c52f3,_0xe13470,_0x2c34fe){var _0x2420b3=_0x7c52f3[_0xf803('0x63')];_0x2420b3[_0xf803('0x57')]=_0xf803('0x64')+_0x2420b3[_0xf803('0x28')]+'-';return db['sequelize'][_0xf803('0x4a')](function(_0x3dcded){return db[_0xf803('0x2b')]['update'](_0x2420b3,{'where':{'id':_0x2420b3['id']},'transaction':_0x3dcded})['then'](function(){return db['VoiceExtension'][_0xf803('0x24')]({'where':{'VoicePrefixId':_0x2420b3['id']},'transaction':_0x3dcded})[_0xf803('0x23')](function(){return db[_0xf803('0x4b')][_0xf803('0x46')]({'where':{'id':_0x2420b3[_0xf803('0x4c')]},'raw':!![]})['then'](function(_0x26f8ed){return createVoicePrefixExtensions(_0x2420b3,_0x26f8ed,_0x3dcded);});});});})[_0xf803('0x23')](function(){return db[_0xf803('0x2b')][_0xf803('0x65')](_0x2420b3['id']);})[_0xf803('0x23')](respondWithResult(_0xe13470,null))[_0xf803('0x40')](handleError(_0xe13470,null));};exports['addAgents']=function(_0x3b015a,_0x30615f,_0x1bf875){return db[_0xf803('0x2b')][_0xf803('0x46')]({'where':{'id':_0x3b015a[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x30615f,null))[_0xf803('0x23')](function(_0x456769){if(_0x456769){return _0x456769[_0xf803('0x66')](_0x3b015a[_0xf803('0x63')][_0xf803('0x67')],_[_0xf803('0x68')](_0x3b015a[_0xf803('0x63')],[_0xf803('0x67'),'id'])||{})[_0xf803('0x69')](function(_0x27ddb8){for(var _0x66af0a=0x0;_0x66af0a<_0x3b015a['body'][_0xf803('0x67')]['length'];_0x66af0a+=0x1){socket[_0xf803('0x6a')](_0xf803('0x6b'),{'UserId':_0x3b015a[_0xf803('0x63')][_0xf803('0x67')][_0x66af0a],'VoicePrefixId':_0x3b015a[_0xf803('0x42')]['id']});}return _0x27ddb8;});}})[_0xf803('0x23')](respondWithResult(_0x30615f,null))['catch'](handleError(_0x30615f,null));};exports[_0xf803('0x6c')]=function(_0x3c991f,_0x68d56f,_0x5f3ad){return db['VoicePrefix'][_0xf803('0x46')]({'where':{'id':_0x3c991f[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x68d56f,null))[_0xf803('0x23')](function(_0xab0f9f){if(_0xab0f9f){return _0xab0f9f[_0xf803('0x6c')](_0x3c991f['query'][_0xf803('0x67')])[_0xf803('0x23')](function(){if(_['isArray'](_0x3c991f[_0xf803('0x30')][_0xf803('0x67')])){for(var _0x1150e3=0x0;_0x1150e3<_0x3c991f['query'][_0xf803('0x67')][_0xf803('0x36')];_0x1150e3+=0x1){socket['emit'](_0xf803('0x6d'),{'UserId':Number(_0x3c991f[_0xf803('0x30')][_0xf803('0x67')][_0x1150e3]),'VoicePrefixId':Number(_0x3c991f['params']['id'])});}}else{socket[_0xf803('0x6a')](_0xf803('0x6d'),{'UserId':Number(_0x3c991f[_0xf803('0x30')][_0xf803('0x67')]),'VoicePrefixId':Number(_0x3c991f['params']['id'])});}});}})[_0xf803('0x23')](respondWithStatusCode(_0x68d56f,null))[_0xf803('0x40')](handleError(_0x68d56f,null));};exports['getAgents']=function(_0x5e63df,_0x13f414,_0x104258){var _0x320f30={};var _0x427641={};var _0x892b34;var _0x417168;return db[_0xf803('0x2b')][_0xf803('0x6e')]({'where':{'id':_0x5e63df[_0xf803('0x42')]['id']}})[_0xf803('0x23')](handleEntityNotFound(_0x13f414,null))['then'](function(_0x524aee){if(_0x524aee){_0x892b34=_0x524aee;_0x427641['model']=_[_0xf803('0x31')](db[_0xf803('0x6f')][_0xf803('0x2c')]);_0x427641['query']=_['keys'](_0x5e63df[_0xf803('0x30')]);_0x427641[_0xf803('0x32')]=_['intersection'](_0x427641[_0xf803('0x2f')],_0x427641[_0xf803('0x30')]);_0x320f30[_0xf803('0x34')]=_[_0xf803('0x33')](_0x427641[_0xf803('0x2f')],qs[_0xf803('0x35')](_0x5e63df[_0xf803('0x30')]['fields']));_0x320f30['attributes']=_0x320f30[_0xf803('0x34')]['length']?_0x320f30[_0xf803('0x34')]:_0x427641['model'];_0x320f30[_0xf803('0x38')]=qs[_0xf803('0x39')](_0x5e63df[_0xf803('0x30')][_0xf803('0x39')]);_0x320f30['where']=qs[_0xf803('0x32')](_[_0xf803('0x3b')](_0x5e63df[_0xf803('0x30')],_0x427641[_0xf803('0x32')]));if(_0x5e63df[_0xf803('0x30')]['filter']){_0x320f30[_0xf803('0x3a')]=_[_0xf803('0x44')](_0x320f30[_0xf803('0x3a')],{'$or':_['map'](_0x320f30[_0xf803('0x34')],function(_0x5bea71){var _0x5e7a7b={};_0x5e7a7b[_0x5bea71]={'$like':'%'+_0x5e63df[_0xf803('0x30')]['filter']+'%'};return _0x5e7a7b;})});}_0x320f30=_[_0xf803('0x44')]({},_0x320f30,_0x5e63df[_0xf803('0x45')]);return _0x892b34[_0xf803('0x70')](_0x320f30);}})[_0xf803('0x23')](function(_0x1dde00){if(_0x1dde00){_0x417168=_0x1dde00[_0xf803('0x36')];if(!_0x5e63df[_0xf803('0x30')]['hasOwnProperty'](_0xf803('0x71'))){_0x320f30[_0xf803('0x1e')]=qs[_0xf803('0x1e')](_0x5e63df['query']['limit']);_0x320f30['offset']=qs[_0xf803('0x1d')](_0x5e63df[_0xf803('0x30')][_0xf803('0x1d')]);}return _0x892b34[_0xf803('0x70')](_0x320f30);}})[_0xf803('0x23')](function(_0x59eb39){if(_0x59eb39){return _0x59eb39?{'count':_0x417168,'rows':_0x59eb39}:null;}})['then'](respondWithResult(_0x13f414,null))[_0xf803('0x40')](handleError(_0x13f414,null));};
\ No newline at end of file