Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / api / voicePrefix / voicePrefix.controller.js
index 2a4b8a3..4a04919 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x553a=['includeAll','include','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','${EXTEN:','charAt','body','system-','addAgents','ids','omit','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','eml-format','zip-dir','fast-json-patch','request-promise','mustache','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','get','VoicePrefixes','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','map','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','catch','params','rawAttributes'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x553a,0x192));var _0xa553=function(_0x31f7c5,_0x3bf428){_0x31f7c5=_0x31f7c5-0x0;var _0x19fabc=_0x553a[_0x31f7c5];return _0x19fabc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa553('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa553('0x1'));var jsonpatch=require(_0xa553('0x2'));var rp=require(_0xa553('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa553('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa553('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa553('0x6'));var squel=require(_0xa553('0x7'));var crypto=require(_0xa553('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa553('0x9'));var toCsv=require('to-csv');var querystring=require(_0xa553('0xa'));var Papa=require(_0xa553('0xb'));var Redis=require(_0xa553('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa553('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa553('0xe'))(_0xa553('0xf'));var utils=require(_0xa553('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xa553('0x11'));var db=require(_0xa553('0x12'))['db'];config[_0xa553('0x13')]=_['defaults'](config[_0xa553('0x13')],{'host':_0xa553('0x14'),'port':0x18eb});var socket=require(_0xa553('0x15'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xa553('0x16')](socket);function respondWithStatusCode(_0x26dcc5,_0x14b019){_0x14b019=_0x14b019||0xcc;return function(_0x37dd93){if(_0x37dd93){return _0x26dcc5['sendStatus'](_0x14b019);}return _0x26dcc5[_0xa553('0x17')](_0x14b019)['end']();};}function respondWithResult(_0xaedbbc,_0x5a1270){_0x5a1270=_0x5a1270||0xc8;return function(_0x509342){if(_0x509342){return _0xaedbbc[_0xa553('0x17')](_0x5a1270)['json'](_0x509342);}};}function respondWithFilteredResult(_0x453a3a,_0x11d237){return function(_0x30d91e){if(_0x30d91e){var _0x54a9f9=_0x30d91e[_0xa553('0x18')],_0x102ef5=_0x11d237[_0xa553('0x19')],_0x7331f3=_0x11d237['offset']+_0x11d237[_0xa553('0x1a')],_0x4fd13a;if(_0x7331f3>=_0x54a9f9){_0x7331f3=_0x54a9f9;_0x4fd13a=0xc8;}else{_0x4fd13a=0xce;}_0x453a3a['status'](_0x4fd13a);return _0x453a3a[_0xa553('0x1b')](_0xa553('0x1c'),_0x102ef5+'-'+_0x7331f3+'/'+_0x54a9f9)[_0xa553('0x1d')](_0x30d91e);}return null;};}function patchUpdates(_0x238a99){return function(_0x5792b9){try{jsonpatch[_0xa553('0x1e')](_0x5792b9,_0x238a99,!![]);}catch(_0x250ead){return BPromise[_0xa553('0x1f')](_0x250ead);}return _0x5792b9['save']();};}function saveUpdates(_0x17b058,_0x4b467d){return function(_0x4d57e4){if(_0x4d57e4){return _0x4d57e4[_0xa553('0x20')](_0x17b058)[_0xa553('0x21')](function(_0x478efb){return _0x478efb;});}return null;};}function removeEntity(_0x306f1a,_0x1c95bd){return function(_0x23a79a){if(_0x23a79a){return _0x23a79a['destroy']()[_0xa553('0x21')](function(){var _0x28fa86=_0x23a79a[_0xa553('0x22')]({'plain':!![]});var _0x7b0d73=_0xa553('0x23');return db[_0xa553('0x24')][_0xa553('0x25')]({'where':{'type':_0x7b0d73,'resourceId':_0x28fa86['id']}})[_0xa553('0x21')](function(){return _0x23a79a;});})['then'](function(){_0x306f1a['status'](0xcc)[_0xa553('0x26')]();});}};}function handleEntityNotFound(_0xa63ae2,_0x11b61e){return function(_0x1d7c3d){if(!_0x1d7c3d){_0xa63ae2[_0xa553('0x27')](0x194);}return _0x1d7c3d;};}function handleError(_0x407382,_0x3fe657){_0x3fe657=_0x3fe657||0x1f4;return function(_0x4ca838){logger[_0xa553('0x28')](_0x4ca838[_0xa553('0x29')]);if(_0x4ca838[_0xa553('0x2a')]){delete _0x4ca838[_0xa553('0x2a')];}_0x407382[_0xa553('0x17')](_0x3fe657)[_0xa553('0x2b')](_0x4ca838);};}exports[_0xa553('0x2c')]=function(_0x2325a5,_0x3f9351){var _0x6f7ebd={},_0x5bb6aa={},_0x2dd442={'count':0x0,'rows':[]};var _0x5baa42=_[_0xa553('0x2d')](db['VoicePrefix']['rawAttributes'],function(_0x489afc){return{'name':_0x489afc['fieldName'],'type':_0x489afc[_0xa553('0x2e')][_0xa553('0x2f')]};});_0x5bb6aa[_0xa553('0x30')]=_[_0xa553('0x2d')](_0x5baa42,_0xa553('0x2a'));_0x5bb6aa['query']=_[_0xa553('0x31')](_0x2325a5['query']);_0x5bb6aa[_0xa553('0x32')]=_[_0xa553('0x33')](_0x5bb6aa['model'],_0x5bb6aa['query']);_0x6f7ebd[_0xa553('0x34')]=_[_0xa553('0x33')](_0x5bb6aa[_0xa553('0x30')],qs[_0xa553('0x35')](_0x2325a5[_0xa553('0x36')][_0xa553('0x35')]));_0x6f7ebd['attributes']=_0x6f7ebd['attributes'][_0xa553('0x37')]?_0x6f7ebd['attributes']:_0x5bb6aa['model'];if(!_0x2325a5[_0xa553('0x36')][_0xa553('0x38')](_0xa553('0x39'))){_0x6f7ebd[_0xa553('0x1a')]=qs[_0xa553('0x1a')](_0x2325a5[_0xa553('0x36')][_0xa553('0x1a')]);_0x6f7ebd[_0xa553('0x19')]=qs[_0xa553('0x19')](_0x2325a5[_0xa553('0x36')][_0xa553('0x19')]);}_0x6f7ebd[_0xa553('0x3a')]=qs[_0xa553('0x3b')](_0x2325a5[_0xa553('0x36')][_0xa553('0x3b')]);_0x6f7ebd[_0xa553('0x3c')]=qs[_0xa553('0x32')](_[_0xa553('0x3d')](_0x2325a5[_0xa553('0x36')],_0x5bb6aa[_0xa553('0x32')]),_0x5baa42);if(_0x2325a5[_0xa553('0x36')][_0xa553('0x3e')]){_0x6f7ebd['where']=_[_0xa553('0x3f')](_0x6f7ebd[_0xa553('0x3c')],{'$or':_[_0xa553('0x2d')](_0x5baa42,function(_0x16ed6c){if(_0x16ed6c[_0xa553('0x2e')]!==_0xa553('0x40')){var _0x550b2b={};_0x550b2b[_0x16ed6c[_0xa553('0x2a')]]={'$like':'%'+_0x2325a5['query'][_0xa553('0x3e')]+'%'};return _0x550b2b;}})});}_0x6f7ebd=_[_0xa553('0x3f')]({},_0x6f7ebd,_0x2325a5[_0xa553('0x41')]);var _0x2aa74f={'where':_0x6f7ebd[_0xa553('0x3c')]};return db[_0xa553('0x42')][_0xa553('0x18')](_0x2aa74f)[_0xa553('0x21')](function(_0x41646f){_0x2dd442[_0xa553('0x18')]=_0x41646f;if(_0x2325a5[_0xa553('0x36')]['includeAll']){_0x6f7ebd['include']=[{'all':!![]}];}return db[_0xa553('0x42')]['findAll'](_0x6f7ebd);})[_0xa553('0x21')](function(_0x4786f0){_0x2dd442['rows']=_0x4786f0;return _0x2dd442;})[_0xa553('0x21')](respondWithFilteredResult(_0x3f9351,_0x6f7ebd))[_0xa553('0x43')](handleError(_0x3f9351,null));};exports['show']=function(_0x124446,_0x3fbdaf){var _0x5707f9={'raw':![],'where':{'id':_0x124446[_0xa553('0x44')]['id']}},_0x3b92b2={};_0x3b92b2['model']=_[_0xa553('0x31')](db[_0xa553('0x42')][_0xa553('0x45')]);_0x3b92b2[_0xa553('0x36')]=_['keys'](_0x124446[_0xa553('0x36')]);_0x3b92b2[_0xa553('0x32')]=_[_0xa553('0x33')](_0x3b92b2['model'],_0x3b92b2[_0xa553('0x36')]);_0x5707f9[_0xa553('0x34')]=_[_0xa553('0x33')](_0x3b92b2[_0xa553('0x30')],qs[_0xa553('0x35')](_0x124446[_0xa553('0x36')]['fields']));_0x5707f9['attributes']=_0x5707f9[_0xa553('0x34')][_0xa553('0x37')]?_0x5707f9[_0xa553('0x34')]:_0x3b92b2[_0xa553('0x30')];if(_0x124446[_0xa553('0x36')][_0xa553('0x46')]){_0x5707f9[_0xa553('0x47')]=[{'all':!![]}];}_0x5707f9=_[_0xa553('0x3f')]({},_0x5707f9,_0x124446['options']);return db[_0xa553('0x42')][_0xa553('0x48')](_0x5707f9)[_0xa553('0x21')](handleEntityNotFound(_0x3fbdaf,null))[_0xa553('0x21')](respondWithResult(_0x3fbdaf,null))[_0xa553('0x43')](handleError(_0x3fbdaf,null));};exports[_0xa553('0x25')]=function(_0x39582b,_0x395e93){return db[_0xa553('0x42')]['find']({'where':{'id':_0x39582b[_0xa553('0x44')]['id']}})[_0xa553('0x21')](handleEntityNotFound(_0x395e93,null))['then'](removeEntity(_0x395e93,null))[_0xa553('0x43')](handleError(_0x395e93,null));};exports[_0xa553('0x49')]=function(_0x3d194b,_0x4f377f){return db[_0xa553('0x42')][_0xa553('0x49')]()[_0xa553('0x21')](respondWithResult(_0x4f377f,null))['catch'](handleError(_0x4f377f,null));};exports[_0xa553('0x4a')]=function(_0x4301b2,_0x2409c3){var _0x3bf537;return db[_0xa553('0x4b')][_0xa553('0x4c')](function(_0x4a463f){return db[_0xa553('0x42')]['create'](_0x4301b2['body'],{'transaction':_0x4a463f})[_0xa553('0x21')](function(_0x4bcc89){_0x3bf537=_0x4bcc89[_0xa553('0x22')]({'plain':!![]});return db[_0xa553('0x4d')][_0xa553('0x48')]({'where':{'id':_0x3bf537[_0xa553('0x4e')]},'raw':!![]})[_0xa553('0x21')](function(_0x4381a4){return createVoicePrefixExtensions(_0x3bf537,_0x4381a4,_0x4a463f);});});})[_0xa553('0x21')](function(){var _0x75621a=_0x4301b2['user'][_0xa553('0x22')]({'plain':!![]});if(!_0x75621a)throw new Error(_0xa553('0x4f'));if(_0x75621a[_0xa553('0x50')]===_0xa553('0x51')){var _0x1a703f=_0x3bf537;return db[_0xa553('0x52')][_0xa553('0x48')]({'where':{'name':_0xa553('0x23'),'userProfileId':_0x75621a[_0xa553('0x53')]},'raw':!![]})['then'](function(_0x51615f){if(_0x51615f&&_0x51615f[_0xa553('0x54')]===0x0){return db[_0xa553('0x24')][_0xa553('0x4a')]({'name':_0x1a703f['name'],'resourceId':_0x1a703f['id'],'type':_0x51615f[_0xa553('0x2a')],'sectionId':_0x51615f['id']},{})['then'](function(){return _0x3bf537;});}else{return _0x3bf537;}})['catch'](function(_0x3732f6){logger[_0xa553('0x28')](_0xa553('0x55'),_0x3732f6);throw _0x3732f6;});}return _0x3bf537;})['then'](respondWithResult(_0x2409c3,null))[_0xa553('0x43')](handleError(_0x2409c3,null));};function Extension(_0x5f3d33,_0x56b3b1,_0x7a5544,_0x4e4e38){this[_0xa553('0x56')]=_0xa553('0x57');this[_0xa553('0x58')]=_0x5f3d33;this['app']=_0x7a5544;this[_0xa553('0x2e')]='system';this[_0xa553('0x59')]=_0xa553('0x5a');this[_0xa553('0x5b')]=_0x56b3b1;this[_0xa553('0x5c')]=_0x4e4e38;}function createVoicePrefixExtensions(_0x561c35,_0x2150df,_0x51de2c){return new BPromise(function(_0x3ee0c7,_0x1517e0){var _0x511a08=new Extension(formatPrefixName(_0x561c35[_0xa553('0x5d')]),0x1,_0xa553('0x5e'),_0xa553('0x5f'));_0x511a08['VoicePrefixId']=_0x561c35['id'];return db[_0xa553('0x4d')]['create'](_0x511a08,{'transaction':_0x51de2c})['then'](function(_0x3778b3){var _0x4519f1=_0x3778b3['get']({'plain':!![]});var _0x152986=_[_0xa553('0x2d')](addVoicePrefixExtensions(_0x561c35,_0x2150df),function(_0x161214){_0x161214[_0xa553('0x4e')]=_0x4519f1['id'];_0x161214[_0xa553('0x60')]=_0x561c35['id'];return _0x161214;});return db[_0xa553('0x4d')][_0xa553('0x61')](_0x152986,{'transaction':_0x51de2c})[_0xa553('0x21')](function(_0x5d1627){if(!_0x5d1627){return _0x1517e0(_0xa553('0x62'));}else{return _0x3ee0c7(_0x5d1627);}})[_0xa553('0x43')](function(_0x3daeaa){return _0x1517e0(_0x3daeaa);});});;});};function addVoicePrefixExtensions(_0x48a4ac,_0x452f72){var _0x142992=[];var _0x591019=formatPrefixName(_0x48a4ac['prefix']);_0x142992[_0xa553('0x63')](new Extension(_0x591019,0x2,_0xa553('0x64'),_0xa553('0x65')+_0x48a4ac[_0xa553('0x2a')]));if(_0x48a4ac[_0xa553('0x66')]){_0x142992[_0xa553('0x63')](new Extension(_0x591019,0x3,_0xa553('0x64'),_0xa553('0x67')+_0x48a4ac[_0xa553('0x66')]));}else{_0x142992[_0xa553('0x63')](new Extension(_0x591019,0x3,_0xa553('0x5e'),'No\x20callerid\x20available'));}_0x142992['push'](new Extension(_0x591019,0x4,'goto',_0x452f72[_0xa553('0x56')]+','+_0xa553('0x68')+(0x8+_0x48a4ac[_0xa553('0x2a')][_0xa553('0x37')])+'}'+','+0x1));return _0x142992;}function formatPrefixName(_0x203f00){var _0x4018ca='_';for(var _0x3ab97b=0x0;_0x3ab97b<_0x203f00[_0xa553('0x37')];_0x3ab97b++){if(_0x203f00[_0xa553('0x69')](_0x3ab97b)=='-'){_0x4018ca+=_0x203f00[_0xa553('0x69')](_0x3ab97b);}else{_0x4018ca+='['+_0x203f00['charAt'](_0x3ab97b)+']';}}_0x4018ca+='.';return _0x4018ca;}exports[_0xa553('0x20')]=function(_0xe5c093,_0x4aef64,_0x1ab1ad){var _0x330183=_0xe5c093[_0xa553('0x6a')];_0x330183[_0xa553('0x5d')]=_0xa553('0x6b')+_0x330183[_0xa553('0x2a')]+'-';return db[_0xa553('0x4b')][_0xa553('0x4c')](function(_0x2973b6){return db[_0xa553('0x42')]['update'](_0x330183,{'where':{'id':_0x330183['id']},'transaction':_0x2973b6})['then'](function(){return db[_0xa553('0x4d')][_0xa553('0x25')]({'where':{'VoicePrefixId':_0x330183['id']},'transaction':_0x2973b6})[_0xa553('0x21')](function(){return db['VoiceExtension'][_0xa553('0x48')]({'where':{'id':_0x330183['VoiceExtensionId']},'raw':!![]})[_0xa553('0x21')](function(_0x3d0a55){return createVoicePrefixExtensions(_0x330183,_0x3d0a55,_0x2973b6);});});});})[_0xa553('0x21')](function(){return db['VoicePrefix']['findById'](_0x330183['id']);})[_0xa553('0x21')](respondWithResult(_0x4aef64,null))[_0xa553('0x43')](handleError(_0x4aef64,null));};exports[_0xa553('0x6c')]=function(_0x3b0e85,_0x25cd8b,_0x6089ff){return db[_0xa553('0x42')]['find']({'where':{'id':_0x3b0e85[_0xa553('0x44')]['id']}})[_0xa553('0x21')](handleEntityNotFound(_0x25cd8b,null))[_0xa553('0x21')](function(_0x3e32c6){if(_0x3e32c6){return _0x3e32c6[_0xa553('0x6c')](_0x3b0e85[_0xa553('0x6a')][_0xa553('0x6d')],_[_0xa553('0x6e')](_0x3b0e85[_0xa553('0x6a')],[_0xa553('0x6d'),'id'])||{})[_0xa553('0x6f')](function(_0x514b1b){for(var _0x14e013=0x0;_0x14e013<_0x3b0e85[_0xa553('0x6a')]['ids'][_0xa553('0x37')];_0x14e013+=0x1){socket[_0xa553('0x70')]('userVoicePrefix:save',{'UserId':_0x3b0e85['body'][_0xa553('0x6d')][_0x14e013],'VoicePrefixId':_0x3b0e85[_0xa553('0x44')]['id']});}return _0x514b1b;});}})[_0xa553('0x21')](respondWithResult(_0x25cd8b,null))['catch'](handleError(_0x25cd8b,null));};exports[_0xa553('0x71')]=function(_0x37b290,_0x15cd7d,_0x2fcc86){return db[_0xa553('0x42')][_0xa553('0x48')]({'where':{'id':_0x37b290['params']['id']}})[_0xa553('0x21')](handleEntityNotFound(_0x15cd7d,null))[_0xa553('0x21')](function(_0x53d868){if(_0x53d868){return _0x53d868[_0xa553('0x71')](_0x37b290[_0xa553('0x36')][_0xa553('0x6d')])[_0xa553('0x21')](function(){if(_['isArray'](_0x37b290[_0xa553('0x36')]['ids'])){for(var _0x17497b=0x0;_0x17497b<_0x37b290[_0xa553('0x36')][_0xa553('0x6d')][_0xa553('0x37')];_0x17497b+=0x1){socket['emit'](_0xa553('0x72'),{'UserId':Number(_0x37b290[_0xa553('0x36')][_0xa553('0x6d')][_0x17497b]),'VoicePrefixId':Number(_0x37b290[_0xa553('0x44')]['id'])});}}else{socket[_0xa553('0x70')](_0xa553('0x72'),{'UserId':Number(_0x37b290['query'][_0xa553('0x6d')]),'VoicePrefixId':Number(_0x37b290[_0xa553('0x44')]['id'])});}});}})[_0xa553('0x21')](respondWithStatusCode(_0x15cd7d,null))[_0xa553('0x43')](handleError(_0x15cd7d,null));};exports[_0xa553('0x73')]=function(_0x12b604,_0x748457,_0x3cdab7){var _0x3ed04a={};var _0x37a8bc={};var _0xfcc8ee;var _0x43fc15;return db[_0xa553('0x42')][_0xa553('0x74')]({'where':{'id':_0x12b604[_0xa553('0x44')]['id']}})[_0xa553('0x21')](handleEntityNotFound(_0x748457,null))[_0xa553('0x21')](function(_0x5b2fa1){if(_0x5b2fa1){_0xfcc8ee=_0x5b2fa1;_0x37a8bc[_0xa553('0x30')]=_['keys'](db[_0xa553('0x75')][_0xa553('0x45')]);_0x37a8bc[_0xa553('0x36')]=_[_0xa553('0x31')](_0x12b604[_0xa553('0x36')]);_0x37a8bc[_0xa553('0x32')]=_[_0xa553('0x33')](_0x37a8bc[_0xa553('0x30')],_0x37a8bc[_0xa553('0x36')]);_0x3ed04a[_0xa553('0x34')]=_[_0xa553('0x33')](_0x37a8bc['model'],qs['fields'](_0x12b604['query']['fields']));_0x3ed04a['attributes']=_0x3ed04a['attributes'][_0xa553('0x37')]?_0x3ed04a[_0xa553('0x34')]:_0x37a8bc[_0xa553('0x30')];_0x3ed04a[_0xa553('0x3a')]=qs[_0xa553('0x3b')](_0x12b604[_0xa553('0x36')][_0xa553('0x3b')]);_0x3ed04a[_0xa553('0x3c')]=qs['filters'](_[_0xa553('0x3d')](_0x12b604[_0xa553('0x36')],_0x37a8bc[_0xa553('0x32')]));if(_0x12b604['query'][_0xa553('0x3e')]){_0x3ed04a['where']=_[_0xa553('0x3f')](_0x3ed04a[_0xa553('0x3c')],{'$or':_[_0xa553('0x2d')](_0x3ed04a[_0xa553('0x34')],function(_0x5e61ed){var _0x371c7d={};_0x371c7d[_0x5e61ed]={'$like':'%'+_0x12b604[_0xa553('0x36')][_0xa553('0x3e')]+'%'};return _0x371c7d;})});}_0x3ed04a=_['merge']({},_0x3ed04a,_0x12b604[_0xa553('0x41')]);return _0xfcc8ee[_0xa553('0x73')](_0x3ed04a);}})[_0xa553('0x21')](function(_0x495aff){if(_0x495aff){_0x43fc15=_0x495aff['length'];if(!_0x12b604[_0xa553('0x36')]['hasOwnProperty']('nolimit')){_0x3ed04a['limit']=qs[_0xa553('0x1a')](_0x12b604['query']['limit']);_0x3ed04a['offset']=qs[_0xa553('0x19')](_0x12b604[_0xa553('0x36')][_0xa553('0x19')]);}return _0xfcc8ee[_0xa553('0x73')](_0x3ed04a);}})[_0xa553('0x21')](function(_0x55d7b7){if(_0x55d7b7){return _0x55d7b7?{'count':_0x43fc15,'rows':_0x55d7b7}:null;}})[_0xa553('0x21')](respondWithResult(_0x748457,null))[_0xa553('0x43')](handleError(_0x748457,null));};
\ No newline at end of file
+var _0x5f71=['fieldName','type','key','query','keys','filters','intersection','model','attributes','length','nolimit','where','pick','filter','merge','map','options','includeAll','findAll','rows','show','rawAttributes','fields','include','find','catch','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','charAt','system-','update','findById','addAgents','ids','omit','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','sort','hasOwnProperty','html-pdf','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','UserProfileResource','destroy','error','stack','name','send','VoicePrefix'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x5f71,0xc9));var _0x15f7=function(_0xc1d509,_0x2529ec){_0xc1d509=_0xc1d509-0x0;var _0x2b3bcb=_0x5f71[_0xc1d509];return _0x2b3bcb;};'use strict';var pdf=require(_0x15f7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x15f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15f7('0x3'));var util=require(_0x15f7('0x4'));var path=require('path');var sox=require(_0x15f7('0x5'));var csv=require(_0x15f7('0x6'));var ejs=require(_0x15f7('0x7'));var fs=require('fs');var _=require(_0x15f7('0x8'));var squel=require(_0x15f7('0x9'));var crypto=require(_0x15f7('0xa'));var jsforce=require(_0x15f7('0xb'));var deskjs=require(_0x15f7('0xc'));var toCsv=require(_0x15f7('0x6'));var querystring=require(_0x15f7('0xd'));var Papa=require(_0x15f7('0xe'));var Redis=require(_0x15f7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x15f7('0x10'));var hardwareService=require(_0x15f7('0x11'));var logger=require('../../config/logger')(_0x15f7('0x12'));var utils=require(_0x15f7('0x13'));var config=require(_0x15f7('0x14'));var licenseUtil=require(_0x15f7('0x15'));var db=require(_0x15f7('0x16'))['db'];config[_0x15f7('0x17')]=_[_0x15f7('0x18')](config['redis'],{'host':_0x15f7('0x19'),'port':0x18eb});var socket=require(_0x15f7('0x1a'))(new Redis(config[_0x15f7('0x17')]));require('./voicePrefix.socket')[_0x15f7('0x1b')](socket);function respondWithStatusCode(_0x40dcb1,_0x52c1be){_0x52c1be=_0x52c1be||0xcc;return function(_0x24b6f5){if(_0x24b6f5){return _0x40dcb1[_0x15f7('0x1c')](_0x52c1be);}return _0x40dcb1[_0x15f7('0x1d')](_0x52c1be)[_0x15f7('0x1e')]();};}function respondWithResult(_0x345892,_0x2c0e67){_0x2c0e67=_0x2c0e67||0xc8;return function(_0x42928d){if(_0x42928d){return _0x345892['status'](_0x2c0e67)[_0x15f7('0x1f')](_0x42928d);}};}function respondWithFilteredResult(_0x385844,_0x4e61c9){return function(_0x2c78ca){if(_0x2c78ca){var _0x333ff8=_0x2c78ca[_0x15f7('0x20')],_0x2d4bc3=_0x4e61c9[_0x15f7('0x21')],_0x40b752=_0x4e61c9['offset']+_0x4e61c9[_0x15f7('0x22')],_0x26627b;if(_0x40b752>=_0x333ff8){_0x40b752=_0x333ff8;_0x26627b=0xc8;}else{_0x26627b=0xce;}_0x385844[_0x15f7('0x1d')](_0x26627b);return _0x385844[_0x15f7('0x23')](_0x15f7('0x24'),_0x2d4bc3+'-'+_0x40b752+'/'+_0x333ff8)[_0x15f7('0x1f')](_0x2c78ca);}return null;};}function patchUpdates(_0x28a8a6){return function(_0x3bf068){try{jsonpatch['apply'](_0x3bf068,_0x28a8a6,!![]);}catch(_0x4de467){return BPromise[_0x15f7('0x25')](_0x4de467);}return _0x3bf068[_0x15f7('0x26')]();};}function saveUpdates(_0x370652,_0x35de93){return function(_0x220d8e){if(_0x220d8e){return _0x220d8e['update'](_0x370652)[_0x15f7('0x27')](function(_0x4fe2ca){return _0x4fe2ca;});}return null;};}function removeEntity(_0x292958,_0xe6ec62){return function(_0x49fc13){if(_0x49fc13){return _0x49fc13['destroy']()[_0x15f7('0x27')](function(){var _0x5a1e21=_0x49fc13['get']({'plain':!![]});var _0x2928fa='VoicePrefixes';return db[_0x15f7('0x28')][_0x15f7('0x29')]({'where':{'type':_0x2928fa,'resourceId':_0x5a1e21['id']}})[_0x15f7('0x27')](function(){return _0x49fc13;});})[_0x15f7('0x27')](function(){_0x292958[_0x15f7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3adf28,_0x361d96){return function(_0x1b50ed){if(!_0x1b50ed){_0x3adf28['sendStatus'](0x194);}return _0x1b50ed;};}function handleError(_0x4dd3d6,_0x5962e6){_0x5962e6=_0x5962e6||0x1f4;return function(_0x508237){logger[_0x15f7('0x2a')](_0x508237[_0x15f7('0x2b')]);if(_0x508237[_0x15f7('0x2c')]){delete _0x508237[_0x15f7('0x2c')];}_0x4dd3d6[_0x15f7('0x1d')](_0x5962e6)[_0x15f7('0x2d')](_0x508237);};}exports['index']=function(_0x521934,_0x31bf43){var _0xd240bb={},_0x350f8a={},_0x4965ba={'count':0x0,'rows':[]};var _0x294ea7=_['map'](db[_0x15f7('0x2e')]['rawAttributes'],function(_0x31f44f){return{'name':_0x31f44f[_0x15f7('0x2f')],'type':_0x31f44f[_0x15f7('0x30')][_0x15f7('0x31')]};});_0x350f8a['model']=_['map'](_0x294ea7,_0x15f7('0x2c'));_0x350f8a[_0x15f7('0x32')]=_[_0x15f7('0x33')](_0x521934[_0x15f7('0x32')]);_0x350f8a[_0x15f7('0x34')]=_[_0x15f7('0x35')](_0x350f8a[_0x15f7('0x36')],_0x350f8a[_0x15f7('0x32')]);_0xd240bb[_0x15f7('0x37')]=_[_0x15f7('0x35')](_0x350f8a[_0x15f7('0x36')],qs['fields'](_0x521934[_0x15f7('0x32')]['fields']));_0xd240bb[_0x15f7('0x37')]=_0xd240bb[_0x15f7('0x37')][_0x15f7('0x38')]?_0xd240bb[_0x15f7('0x37')]:_0x350f8a[_0x15f7('0x36')];if(!_0x521934[_0x15f7('0x32')]['hasOwnProperty'](_0x15f7('0x39'))){_0xd240bb['limit']=qs[_0x15f7('0x22')](_0x521934[_0x15f7('0x32')][_0x15f7('0x22')]);_0xd240bb[_0x15f7('0x21')]=qs[_0x15f7('0x21')](_0x521934['query'][_0x15f7('0x21')]);}_0xd240bb['order']=qs['sort'](_0x521934[_0x15f7('0x32')]['sort']);_0xd240bb[_0x15f7('0x3a')]=qs[_0x15f7('0x34')](_[_0x15f7('0x3b')](_0x521934[_0x15f7('0x32')],_0x350f8a[_0x15f7('0x34')]),_0x294ea7);if(_0x521934[_0x15f7('0x32')][_0x15f7('0x3c')]){_0xd240bb['where']=_[_0x15f7('0x3d')](_0xd240bb['where'],{'$or':_[_0x15f7('0x3e')](_0x294ea7,function(_0x4d409f){if(_0x4d409f['type']!=='VIRTUAL'){var _0x2054cf={};_0x2054cf[_0x4d409f[_0x15f7('0x2c')]]={'$like':'%'+_0x521934[_0x15f7('0x32')][_0x15f7('0x3c')]+'%'};return _0x2054cf;}})});}_0xd240bb=_[_0x15f7('0x3d')]({},_0xd240bb,_0x521934[_0x15f7('0x3f')]);var _0x180345={'where':_0xd240bb[_0x15f7('0x3a')]};return db[_0x15f7('0x2e')][_0x15f7('0x20')](_0x180345)[_0x15f7('0x27')](function(_0x2fc31e){_0x4965ba['count']=_0x2fc31e;if(_0x521934[_0x15f7('0x32')][_0x15f7('0x40')]){_0xd240bb['include']=[{'all':!![]}];}return db[_0x15f7('0x2e')][_0x15f7('0x41')](_0xd240bb);})['then'](function(_0x225dcb){_0x4965ba[_0x15f7('0x42')]=_0x225dcb;return _0x4965ba;})[_0x15f7('0x27')](respondWithFilteredResult(_0x31bf43,_0xd240bb))['catch'](handleError(_0x31bf43,null));};exports[_0x15f7('0x43')]=function(_0x3a49e3,_0x2d4fdc){var _0x565e54={'raw':![],'where':{'id':_0x3a49e3['params']['id']}},_0xc31ca7={};_0xc31ca7[_0x15f7('0x36')]=_[_0x15f7('0x33')](db[_0x15f7('0x2e')][_0x15f7('0x44')]);_0xc31ca7[_0x15f7('0x32')]=_[_0x15f7('0x33')](_0x3a49e3[_0x15f7('0x32')]);_0xc31ca7[_0x15f7('0x34')]=_[_0x15f7('0x35')](_0xc31ca7[_0x15f7('0x36')],_0xc31ca7[_0x15f7('0x32')]);_0x565e54[_0x15f7('0x37')]=_['intersection'](_0xc31ca7[_0x15f7('0x36')],qs['fields'](_0x3a49e3[_0x15f7('0x32')][_0x15f7('0x45')]));_0x565e54['attributes']=_0x565e54['attributes'][_0x15f7('0x38')]?_0x565e54[_0x15f7('0x37')]:_0xc31ca7[_0x15f7('0x36')];if(_0x3a49e3['query'][_0x15f7('0x40')]){_0x565e54[_0x15f7('0x46')]=[{'all':!![]}];}_0x565e54=_[_0x15f7('0x3d')]({},_0x565e54,_0x3a49e3[_0x15f7('0x3f')]);return db[_0x15f7('0x2e')][_0x15f7('0x47')](_0x565e54)['then'](handleEntityNotFound(_0x2d4fdc,null))['then'](respondWithResult(_0x2d4fdc,null))[_0x15f7('0x48')](handleError(_0x2d4fdc,null));};exports['destroy']=function(_0x31717c,_0x3f26fc){return db['VoicePrefix'][_0x15f7('0x47')]({'where':{'id':_0x31717c[_0x15f7('0x49')]['id']}})[_0x15f7('0x27')](handleEntityNotFound(_0x3f26fc,null))[_0x15f7('0x27')](removeEntity(_0x3f26fc,null))[_0x15f7('0x48')](handleError(_0x3f26fc,null));};exports[_0x15f7('0x4a')]=function(_0x703ec3,_0x50e427){return db[_0x15f7('0x2e')][_0x15f7('0x4a')]()[_0x15f7('0x27')](respondWithResult(_0x50e427,null))[_0x15f7('0x48')](handleError(_0x50e427,null));};exports[_0x15f7('0x4b')]=function(_0x129806,_0x27e5a8){var _0x587f7f;return db[_0x15f7('0x4c')][_0x15f7('0x4d')](function(_0x486994){return db[_0x15f7('0x2e')][_0x15f7('0x4b')](_0x129806[_0x15f7('0x4e')],{'transaction':_0x486994})['then'](function(_0x46b89c){_0x587f7f=_0x46b89c['get']({'plain':!![]});return db[_0x15f7('0x4f')][_0x15f7('0x47')]({'where':{'id':_0x587f7f[_0x15f7('0x50')]},'raw':!![]})['then'](function(_0x45468f){return createVoicePrefixExtensions(_0x587f7f,_0x45468f,_0x486994);});});})[_0x15f7('0x27')](function(){var _0x35ad5c=_0x129806['user'][_0x15f7('0x51')]({'plain':!![]});if(!_0x35ad5c)throw new Error(_0x15f7('0x52'));if(_0x35ad5c[_0x15f7('0x53')]===_0x15f7('0x54')){var _0xc6d585=_0x587f7f;return db['UserProfileSection'][_0x15f7('0x47')]({'where':{'name':_0x15f7('0x55'),'userProfileId':_0x35ad5c['userProfileId']},'raw':!![]})['then'](function(_0x5a4ead){if(_0x5a4ead&&_0x5a4ead[_0x15f7('0x56')]===0x0){return db[_0x15f7('0x28')][_0x15f7('0x4b')]({'name':_0xc6d585['name'],'resourceId':_0xc6d585['id'],'type':_0x5a4ead[_0x15f7('0x2c')],'sectionId':_0x5a4ead['id']},{})[_0x15f7('0x27')](function(){return _0x587f7f;});}else{return _0x587f7f;}})['catch'](function(_0x15ce9e){logger[_0x15f7('0x2a')](_0x15f7('0x57'),_0x15ce9e);throw _0x15ce9e;});}return _0x587f7f;})[_0x15f7('0x27')](respondWithResult(_0x27e5a8,null))['catch'](handleError(_0x27e5a8,null));};function Extension(_0x30f6a0,_0x363f8c,_0x3fc6d8,_0x46e9de){this['context']=_0x15f7('0x58');this[_0x15f7('0x59')]=_0x30f6a0;this[_0x15f7('0x5a')]=_0x3fc6d8;this[_0x15f7('0x30')]='system';this['description']=_0x15f7('0x5b');this[_0x15f7('0x5c')]=_0x363f8c;this[_0x15f7('0x5d')]=_0x46e9de;}function createVoicePrefixExtensions(_0x4d4b11,_0x4c85ae,_0x184030){return new BPromise(function(_0x31208b,_0x9cedc1){var _0x952456=new Extension(formatPrefixName(_0x4d4b11[_0x15f7('0x5e')]),0x1,_0x15f7('0x5f'),_0x15f7('0x60'));_0x952456[_0x15f7('0x61')]=_0x4d4b11['id'];return db[_0x15f7('0x4f')]['create'](_0x952456,{'transaction':_0x184030})['then'](function(_0x54199c){var _0x1d7f80=_0x54199c[_0x15f7('0x51')]({'plain':!![]});var _0x33e73b=_[_0x15f7('0x3e')](addVoicePrefixExtensions(_0x4d4b11,_0x4c85ae),function(_0x3c8616){_0x3c8616['VoiceExtensionId']=_0x1d7f80['id'];_0x3c8616[_0x15f7('0x61')]=_0x4d4b11['id'];return _0x3c8616;});return db[_0x15f7('0x4f')][_0x15f7('0x62')](_0x33e73b,{'transaction':_0x184030})[_0x15f7('0x27')](function(_0x43445b){if(!_0x43445b){return _0x9cedc1(_0x15f7('0x63'));}else{return _0x31208b(_0x43445b);}})[_0x15f7('0x48')](function(_0x49ce52){return _0x9cedc1(_0x49ce52);});});;});};function addVoicePrefixExtensions(_0x405103,_0x5f5764){var _0x42d1c9=[];var _0x18e25e=formatPrefixName(_0x405103[_0x15f7('0x5e')]);_0x42d1c9[_0x15f7('0x64')](new Extension(_0x18e25e,0x2,_0x15f7('0x65'),_0x15f7('0x66')+_0x405103[_0x15f7('0x2c')]));if(_0x405103[_0x15f7('0x67')]){_0x42d1c9['push'](new Extension(_0x18e25e,0x3,_0x15f7('0x65'),_0x15f7('0x68')+_0x405103['callerIdAll']));}else{_0x42d1c9[_0x15f7('0x64')](new Extension(_0x18e25e,0x3,'NoOp',_0x15f7('0x69')));}_0x42d1c9[_0x15f7('0x64')](new Extension(_0x18e25e,0x4,_0x15f7('0x6a'),_0x5f5764[_0x15f7('0x6b')]+','+'${EXTEN:'+(0x8+_0x405103['name']['length'])+'}'+','+0x1));return _0x42d1c9;}function formatPrefixName(_0x21e727){var _0x343b44='_';for(var _0x249087=0x0;_0x249087<_0x21e727[_0x15f7('0x38')];_0x249087++){if(_0x21e727[_0x15f7('0x6c')](_0x249087)=='-'){_0x343b44+=_0x21e727[_0x15f7('0x6c')](_0x249087);}else{_0x343b44+='['+_0x21e727['charAt'](_0x249087)+']';}}_0x343b44+='.';return _0x343b44;}exports['update']=function(_0x525bbe,_0x1ee691,_0x3504dd){var _0x518c0a=_0x525bbe[_0x15f7('0x4e')];_0x518c0a[_0x15f7('0x5e')]=_0x15f7('0x6d')+_0x518c0a[_0x15f7('0x2c')]+'-';return db[_0x15f7('0x4c')][_0x15f7('0x4d')](function(_0x580579){return db[_0x15f7('0x2e')][_0x15f7('0x6e')](_0x518c0a,{'where':{'id':_0x518c0a['id']},'transaction':_0x580579})['then'](function(){return db[_0x15f7('0x4f')][_0x15f7('0x29')]({'where':{'VoicePrefixId':_0x518c0a['id']},'transaction':_0x580579})[_0x15f7('0x27')](function(){return db[_0x15f7('0x4f')]['find']({'where':{'id':_0x518c0a[_0x15f7('0x50')]},'raw':!![]})[_0x15f7('0x27')](function(_0x29d280){return createVoicePrefixExtensions(_0x518c0a,_0x29d280,_0x580579);});});});})[_0x15f7('0x27')](function(){return db['VoicePrefix'][_0x15f7('0x6f')](_0x518c0a['id']);})[_0x15f7('0x27')](respondWithResult(_0x1ee691,null))[_0x15f7('0x48')](handleError(_0x1ee691,null));};exports[_0x15f7('0x70')]=function(_0x1e7fc7,_0x447b8d,_0x4133a5){return db['VoicePrefix'][_0x15f7('0x47')]({'where':{'id':_0x1e7fc7[_0x15f7('0x49')]['id']}})[_0x15f7('0x27')](handleEntityNotFound(_0x447b8d,null))['then'](function(_0x3895d8){if(_0x3895d8){return _0x3895d8['addAgents'](_0x1e7fc7['body'][_0x15f7('0x71')],_[_0x15f7('0x72')](_0x1e7fc7['body'],['ids','id'])||{})['spread'](function(_0x24204b){for(var _0x36d3af=0x0;_0x36d3af<_0x1e7fc7[_0x15f7('0x4e')][_0x15f7('0x71')][_0x15f7('0x38')];_0x36d3af+=0x1){socket['emit'](_0x15f7('0x73'),{'UserId':_0x1e7fc7['body'][_0x15f7('0x71')][_0x36d3af],'VoicePrefixId':_0x1e7fc7[_0x15f7('0x49')]['id']});}return _0x24204b;});}})['then'](respondWithResult(_0x447b8d,null))[_0x15f7('0x48')](handleError(_0x447b8d,null));};exports[_0x15f7('0x74')]=function(_0x8c0a2a,_0x59d10f,_0x126cba){return db[_0x15f7('0x2e')]['find']({'where':{'id':_0x8c0a2a['params']['id']}})[_0x15f7('0x27')](handleEntityNotFound(_0x59d10f,null))['then'](function(_0x7716dd){if(_0x7716dd){return _0x7716dd[_0x15f7('0x74')](_0x8c0a2a[_0x15f7('0x32')][_0x15f7('0x71')])[_0x15f7('0x27')](function(){if(_[_0x15f7('0x75')](_0x8c0a2a[_0x15f7('0x32')][_0x15f7('0x71')])){for(var _0x3d064f=0x0;_0x3d064f<_0x8c0a2a[_0x15f7('0x32')][_0x15f7('0x71')][_0x15f7('0x38')];_0x3d064f+=0x1){socket[_0x15f7('0x76')](_0x15f7('0x77'),{'UserId':Number(_0x8c0a2a[_0x15f7('0x32')][_0x15f7('0x71')][_0x3d064f]),'VoicePrefixId':Number(_0x8c0a2a[_0x15f7('0x49')]['id'])});}}else{socket[_0x15f7('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x8c0a2a[_0x15f7('0x32')]['ids']),'VoicePrefixId':Number(_0x8c0a2a['params']['id'])});}});}})[_0x15f7('0x27')](respondWithStatusCode(_0x59d10f,null))['catch'](handleError(_0x59d10f,null));};exports[_0x15f7('0x78')]=function(_0x5476f2,_0x3027ad,_0x8a4ee9){var _0x4225c0={};var _0x343f50={};var _0x547b77;var _0x184af9;return db[_0x15f7('0x2e')][_0x15f7('0x79')]({'where':{'id':_0x5476f2[_0x15f7('0x49')]['id']}})[_0x15f7('0x27')](handleEntityNotFound(_0x3027ad,null))[_0x15f7('0x27')](function(_0x200924){if(_0x200924){_0x547b77=_0x200924;_0x343f50[_0x15f7('0x36')]=_[_0x15f7('0x33')](db['User'][_0x15f7('0x44')]);_0x343f50['query']=_[_0x15f7('0x33')](_0x5476f2['query']);_0x343f50[_0x15f7('0x34')]=_['intersection'](_0x343f50[_0x15f7('0x36')],_0x343f50[_0x15f7('0x32')]);_0x4225c0[_0x15f7('0x37')]=_['intersection'](_0x343f50['model'],qs[_0x15f7('0x45')](_0x5476f2[_0x15f7('0x32')][_0x15f7('0x45')]));_0x4225c0[_0x15f7('0x37')]=_0x4225c0[_0x15f7('0x37')][_0x15f7('0x38')]?_0x4225c0[_0x15f7('0x37')]:_0x343f50['model'];_0x4225c0['order']=qs[_0x15f7('0x7a')](_0x5476f2[_0x15f7('0x32')][_0x15f7('0x7a')]);_0x4225c0[_0x15f7('0x3a')]=qs[_0x15f7('0x34')](_[_0x15f7('0x3b')](_0x5476f2[_0x15f7('0x32')],_0x343f50['filters']));if(_0x5476f2[_0x15f7('0x32')][_0x15f7('0x3c')]){_0x4225c0['where']=_['merge'](_0x4225c0['where'],{'$or':_[_0x15f7('0x3e')](_0x4225c0[_0x15f7('0x37')],function(_0x3d770e){var _0x22923b={};_0x22923b[_0x3d770e]={'$like':'%'+_0x5476f2[_0x15f7('0x32')][_0x15f7('0x3c')]+'%'};return _0x22923b;})});}_0x4225c0=_[_0x15f7('0x3d')]({},_0x4225c0,_0x5476f2[_0x15f7('0x3f')]);return _0x547b77[_0x15f7('0x78')](_0x4225c0);}})[_0x15f7('0x27')](function(_0x1c53d7){if(_0x1c53d7){_0x184af9=_0x1c53d7['length'];if(!_0x5476f2[_0x15f7('0x32')][_0x15f7('0x7b')](_0x15f7('0x39'))){_0x4225c0['limit']=qs['limit'](_0x5476f2[_0x15f7('0x32')][_0x15f7('0x22')]);_0x4225c0[_0x15f7('0x21')]=qs[_0x15f7('0x21')](_0x5476f2[_0x15f7('0x32')][_0x15f7('0x21')]);}return _0x547b77[_0x15f7('0x78')](_0x4225c0);}})['then'](function(_0x20856a){if(_0x20856a){return _0x20856a?{'count':_0x184af9,'rows':_0x20856a}:null;}})['then'](respondWithResult(_0x3027ad,null))['catch'](handleError(_0x3027ad,null));};
\ No newline at end of file