ac3bde0ad79b36fe09788691676d3d67ee960bb7
[motion2.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xfbc4=['end','json','count','offset','limit','status','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','keys','filtears','find','create','body','getFields','findOne','options','getSubjects','VtigerField','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x2d29a4,_0x439251){var _0x3c8620=function(_0x50dc28){while(--_0x50dc28){_0x2d29a4['push'](_0x2d29a4['shift']());}};_0x3c8620(++_0x439251);}(_0xfbc4,0x96));var _0x4fbc=function(_0x321013,_0x5ec9f9){_0x321013=_0x321013-0x0;var _0x29ac89=_0xfbc4[_0x321013];return _0x29ac89;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4fbc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4fbc('0x1'));var rp=require(_0x4fbc('0x2'));var moment=require(_0x4fbc('0x3'));var BPromise=require(_0x4fbc('0x4'));var Mustache=require(_0x4fbc('0x5'));var util=require('util');var path=require(_0x4fbc('0x6'));var sox=require(_0x4fbc('0x7'));var csv=require('to-csv');var ejs=require(_0x4fbc('0x8'));var fs=require('fs');var _=require(_0x4fbc('0x9'));var squel=require(_0x4fbc('0xa'));var crypto=require(_0x4fbc('0xb'));var jsforce=require(_0x4fbc('0xc'));var deskjs=require(_0x4fbc('0xd'));var toCsv=require(_0x4fbc('0xe'));var querystring=require(_0x4fbc('0xf'));var Papa=require('papaparse');var Redis=require(_0x4fbc('0x10'));var authService=require(_0x4fbc('0x11'));var qs=require(_0x4fbc('0x12'));var as=require(_0x4fbc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4fbc('0x14'))(_0x4fbc('0x15'));var utils=require(_0x4fbc('0x16'));var config=require(_0x4fbc('0x17'));var licenseUtil=require(_0x4fbc('0x18'));var db=require(_0x4fbc('0x19'))['db'];var jayson=require(_0x4fbc('0x1a'));var client=jayson[_0x4fbc('0x1b')][_0x4fbc('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x337221,_0x3e17ea,_0x289b,_0x2fb9b0){return new BPromise(function(_0x536863,_0x38767e){var _0x1a29ad=_0x2fb9b0||client;return _0x1a29ad[_0x4fbc('0x1d')](_0x337221,_0x289b)['then'](function(_0x44f7b8){logger[_0x4fbc('0x1e')]('VtigerConfiguration,\x20%s,\x20%s',_0x3e17ea,'request\x20sent');logger['debug'](_0x4fbc('0x1f'),_0x3e17ea,_0x4fbc('0x20'),JSON[_0x4fbc('0x21')](_0x44f7b8));if(_0x44f7b8[_0x4fbc('0x22')]){if(_0x44f7b8[_0x4fbc('0x22')]['code']===0x1f4){logger[_0x4fbc('0x22')](_0x4fbc('0x23'),_0x3e17ea,_0x44f7b8['error'][_0x4fbc('0x24')]);return _0x38767e(_0x44f7b8[_0x4fbc('0x22')][_0x4fbc('0x24')]);}logger['error'](_0x4fbc('0x23'),_0x3e17ea,_0x44f7b8['error'][_0x4fbc('0x24')]);return _0x536863(_0x44f7b8['error'][_0x4fbc('0x24')]);}else{logger['info'](_0x4fbc('0x23'),_0x3e17ea,_0x4fbc('0x20'));_0x536863(_0x44f7b8[_0x4fbc('0x25')][_0x4fbc('0x24')]);}})[_0x4fbc('0x26')](function(_0x465ac7){logger['error'](_0x4fbc('0x23'),_0x3e17ea,_0x465ac7);_0x38767e(_0x465ac7);});});}function respondWithStatusCode(_0x597174,_0x355d18){_0x355d18=_0x355d18||0xcc;return function(_0x5d81a6){if(_0x5d81a6){return _0x597174[_0x4fbc('0x27')](_0x355d18);}return _0x597174['status'](_0x355d18)[_0x4fbc('0x28')]();};}function respondWithResult(_0x5f02f6,_0x2441f9){_0x2441f9=_0x2441f9||0xc8;return function(_0x384655){if(_0x384655){return _0x5f02f6['status'](_0x2441f9)[_0x4fbc('0x29')](_0x384655);}};}function respondWithFilteredResult(_0x584728,_0x54f7f2){return function(_0x204ba4){if(_0x204ba4){var _0x505224=_0x204ba4[_0x4fbc('0x2a')],_0x7aa7b8=_0x54f7f2[_0x4fbc('0x2b')],_0x366f66=_0x54f7f2[_0x4fbc('0x2b')]+_0x54f7f2[_0x4fbc('0x2c')],_0x58773e;if(_0x366f66>=_0x505224){_0x366f66=_0x505224;_0x58773e=0xc8;}else{_0x58773e=0xce;}_0x584728[_0x4fbc('0x2d')](_0x58773e);return _0x584728[_0x4fbc('0x2e')](_0x4fbc('0x2f'),_0x7aa7b8+'-'+_0x366f66+'/'+_0x505224)[_0x4fbc('0x29')](_0x204ba4);}return null;};}function patchUpdates(_0x49eb8e){return function(_0x5b6ab7){try{jsonpatch['apply'](_0x5b6ab7,_0x49eb8e,!![]);}catch(_0x21cda1){return BPromise[_0x4fbc('0x30')](_0x21cda1);}return _0x5b6ab7[_0x4fbc('0x31')]();};}function saveUpdates(_0x4f97d7,_0x232e18){return function(_0x5a49c9){if(_0x5a49c9){return _0x5a49c9[_0x4fbc('0x32')](_0x4f97d7)['then'](function(_0x1fb977){return _0x1fb977;});}return null;};}function removeEntity(_0x387b5d,_0x462b25){return function(_0x189e4c){if(_0x189e4c){return _0x189e4c[_0x4fbc('0x33')]()[_0x4fbc('0x34')](function(){_0x387b5d[_0x4fbc('0x2d')](0xcc)[_0x4fbc('0x28')]();});}};}function handleEntityNotFound(_0x30303c,_0x36f155){return function(_0x4e69b1){if(!_0x4e69b1){_0x30303c[_0x4fbc('0x27')](0x194);}return _0x4e69b1;};}function handleError(_0x3efef8,_0x401cf0){_0x401cf0=_0x401cf0||0x1f4;return function(_0x30c99e){logger[_0x4fbc('0x22')](_0x30c99e[_0x4fbc('0x35')]);if(_0x30c99e[_0x4fbc('0x36')]){delete _0x30c99e['name'];}_0x3efef8[_0x4fbc('0x2d')](_0x401cf0)[_0x4fbc('0x37')](_0x30c99e);};}exports[_0x4fbc('0x38')]=function(_0x2a955d,_0x188a1e){var _0x1ecaa6={},_0x205202={},_0x29b8ab={'count':0x0,'rows':[]};var _0x1d0169=_[_0x4fbc('0x39')](db[_0x4fbc('0x3a')][_0x4fbc('0x3b')],function(_0x3b87d9){return{'name':_0x3b87d9['fieldName'],'type':_0x3b87d9[_0x4fbc('0x3c')][_0x4fbc('0x3d')]};});_0x205202['model']=_[_0x4fbc('0x39')](_0x1d0169,'name');_0x205202[_0x4fbc('0x3e')]=_['keys'](_0x2a955d['query']);_0x205202[_0x4fbc('0x3f')]=_[_0x4fbc('0x40')](_0x205202[_0x4fbc('0x41')],_0x205202['query']);_0x1ecaa6[_0x4fbc('0x42')]=_[_0x4fbc('0x40')](_0x205202['model'],qs[_0x4fbc('0x43')](_0x2a955d[_0x4fbc('0x3e')]['fields']));_0x1ecaa6[_0x4fbc('0x42')]=_0x1ecaa6[_0x4fbc('0x42')][_0x4fbc('0x44')]?_0x1ecaa6[_0x4fbc('0x42')]:_0x205202['model'];if(!_0x2a955d['query'][_0x4fbc('0x45')](_0x4fbc('0x46'))){_0x1ecaa6[_0x4fbc('0x2c')]=qs[_0x4fbc('0x2c')](_0x2a955d[_0x4fbc('0x3e')][_0x4fbc('0x2c')]);_0x1ecaa6['offset']=qs[_0x4fbc('0x2b')](_0x2a955d['query'][_0x4fbc('0x2b')]);}_0x1ecaa6[_0x4fbc('0x47')]=qs[_0x4fbc('0x48')](_0x2a955d['query'][_0x4fbc('0x48')]);_0x1ecaa6['where']=qs[_0x4fbc('0x3f')](_[_0x4fbc('0x49')](_0x2a955d['query'],_0x205202[_0x4fbc('0x3f')]),_0x1d0169);if(_0x2a955d[_0x4fbc('0x3e')][_0x4fbc('0x4a')]){_0x1ecaa6[_0x4fbc('0x4b')]=_['merge'](_0x1ecaa6[_0x4fbc('0x4b')],{'$or':_[_0x4fbc('0x39')](_0x1d0169,function(_0x4166ae){if(_0x4166ae[_0x4fbc('0x3c')]!==_0x4fbc('0x4c')){var _0x53aa3f={};_0x53aa3f[_0x4166ae[_0x4fbc('0x36')]]={'$like':'%'+_0x2a955d[_0x4fbc('0x3e')][_0x4fbc('0x4a')]+'%'};return _0x53aa3f;}})});}_0x1ecaa6=_[_0x4fbc('0x4d')]({},_0x1ecaa6,_0x2a955d['options']);var _0x392669={'where':_0x1ecaa6[_0x4fbc('0x4b')]};return db[_0x4fbc('0x3a')][_0x4fbc('0x2a')](_0x392669)[_0x4fbc('0x34')](function(_0x97b744){_0x29b8ab[_0x4fbc('0x2a')]=_0x97b744;if(_0x2a955d[_0x4fbc('0x3e')][_0x4fbc('0x4e')]){_0x1ecaa6[_0x4fbc('0x4f')]=[{'all':!![]}];}return db[_0x4fbc('0x3a')][_0x4fbc('0x50')](_0x1ecaa6);})[_0x4fbc('0x34')](function(_0x34c438){_0x29b8ab[_0x4fbc('0x51')]=_0x34c438;return _0x29b8ab;})[_0x4fbc('0x34')](respondWithFilteredResult(_0x188a1e,_0x1ecaa6))[_0x4fbc('0x26')](handleError(_0x188a1e,null));};exports[_0x4fbc('0x52')]=function(_0x5dda7c,_0x31f923){var _0x38b092={'raw':![],'where':{'id':_0x5dda7c[_0x4fbc('0x53')]['id']}},_0x35ccc0={};_0x35ccc0['model']=_[_0x4fbc('0x54')](db['VtigerConfiguration'][_0x4fbc('0x3b')]);_0x35ccc0[_0x4fbc('0x3e')]=_[_0x4fbc('0x54')](_0x5dda7c[_0x4fbc('0x3e')]);_0x35ccc0[_0x4fbc('0x55')]=_['intersection'](_0x35ccc0['model'],_0x35ccc0[_0x4fbc('0x3e')]);_0x38b092[_0x4fbc('0x42')]=_['intersection'](_0x35ccc0['model'],qs[_0x4fbc('0x43')](_0x5dda7c[_0x4fbc('0x3e')][_0x4fbc('0x43')]));_0x38b092[_0x4fbc('0x42')]=_0x38b092[_0x4fbc('0x42')][_0x4fbc('0x44')]?_0x38b092['attributes']:_0x35ccc0[_0x4fbc('0x41')];if(_0x5dda7c[_0x4fbc('0x3e')][_0x4fbc('0x4e')]){_0x38b092['include']=[{'all':!![]}];}_0x38b092=_[_0x4fbc('0x4d')]({},_0x38b092,_0x5dda7c['options']);return db[_0x4fbc('0x3a')][_0x4fbc('0x56')](_0x38b092)[_0x4fbc('0x34')](handleEntityNotFound(_0x31f923,null))['then'](respondWithResult(_0x31f923,null))['catch'](handleError(_0x31f923,null));};exports[_0x4fbc('0x57')]=function(_0x59d0b6,_0x8df69f){return db[_0x4fbc('0x3a')][_0x4fbc('0x57')](_0x59d0b6[_0x4fbc('0x58')],{})[_0x4fbc('0x34')](respondWithResult(_0x8df69f,0xc9))[_0x4fbc('0x26')](handleError(_0x8df69f,null));};exports[_0x4fbc('0x32')]=function(_0x321d72,_0x51e57e){if(_0x321d72[_0x4fbc('0x58')]['id']){delete _0x321d72['body']['id'];}return db[_0x4fbc('0x3a')][_0x4fbc('0x56')]({'where':{'id':_0x321d72[_0x4fbc('0x53')]['id']}})[_0x4fbc('0x34')](handleEntityNotFound(_0x51e57e,null))[_0x4fbc('0x34')](saveUpdates(_0x321d72[_0x4fbc('0x58')],null))['then'](respondWithResult(_0x51e57e,null))[_0x4fbc('0x26')](handleError(_0x51e57e,null));};exports[_0x4fbc('0x33')]=function(_0x3de674,_0x19f4b5){return db[_0x4fbc('0x3a')][_0x4fbc('0x56')]({'where':{'id':_0x3de674[_0x4fbc('0x53')]['id']}})[_0x4fbc('0x34')](handleEntityNotFound(_0x19f4b5,null))[_0x4fbc('0x34')](removeEntity(_0x19f4b5,null))[_0x4fbc('0x26')](handleError(_0x19f4b5,null));};exports[_0x4fbc('0x59')]=function(_0x43980d,_0x1478c2,_0x61f3d4){var _0x5bb2f1={};var _0x5aeca5={};var _0x2b2615;var _0x54bb23;return db['VtigerConfiguration'][_0x4fbc('0x5a')]({'where':{'id':_0x43980d[_0x4fbc('0x53')]['id']}})[_0x4fbc('0x34')](handleEntityNotFound(_0x1478c2,null))[_0x4fbc('0x34')](function(_0x54f344){if(_0x54f344){_0x2b2615=_0x54f344;_0x5aeca5[_0x4fbc('0x41')]=_[_0x4fbc('0x54')](db['VtigerField'][_0x4fbc('0x3b')]);_0x5aeca5[_0x4fbc('0x3e')]=_['keys'](_0x43980d[_0x4fbc('0x3e')]);_0x5aeca5['filters']=_[_0x4fbc('0x40')](_0x5aeca5['model'],_0x5aeca5['query']);_0x5bb2f1[_0x4fbc('0x42')]=_[_0x4fbc('0x40')](_0x5aeca5[_0x4fbc('0x41')],qs['fields'](_0x43980d['query'][_0x4fbc('0x43')]));_0x5bb2f1[_0x4fbc('0x42')]=_0x5bb2f1[_0x4fbc('0x42')][_0x4fbc('0x44')]?_0x5bb2f1[_0x4fbc('0x42')]:_0x5aeca5[_0x4fbc('0x41')];_0x5bb2f1[_0x4fbc('0x47')]=qs['sort'](_0x43980d['query']['sort']);_0x5bb2f1[_0x4fbc('0x4b')]=qs['filters'](_['pick'](_0x43980d[_0x4fbc('0x3e')],_0x5aeca5[_0x4fbc('0x3f')]));if(_0x43980d[_0x4fbc('0x3e')][_0x4fbc('0x4a')]){_0x5bb2f1[_0x4fbc('0x4b')]=_[_0x4fbc('0x4d')](_0x5bb2f1[_0x4fbc('0x4b')],{'$or':_[_0x4fbc('0x39')](_0x5bb2f1[_0x4fbc('0x42')],function(_0x631737){var _0x528bd1={};_0x528bd1[_0x631737]={'$like':'%'+_0x43980d[_0x4fbc('0x3e')][_0x4fbc('0x4a')]+'%'};return _0x528bd1;})});}_0x5bb2f1=_[_0x4fbc('0x4d')]({},_0x5bb2f1,_0x43980d[_0x4fbc('0x5b')]);return _0x2b2615[_0x4fbc('0x59')](_0x5bb2f1);}})[_0x4fbc('0x34')](function(_0x7e06d5){if(_0x7e06d5){_0x54bb23=_0x7e06d5[_0x4fbc('0x44')];if(!_0x43980d[_0x4fbc('0x3e')][_0x4fbc('0x45')](_0x4fbc('0x46'))){_0x5bb2f1[_0x4fbc('0x2c')]=qs[_0x4fbc('0x2c')](_0x43980d[_0x4fbc('0x3e')][_0x4fbc('0x2c')]);_0x5bb2f1[_0x4fbc('0x2b')]=qs[_0x4fbc('0x2b')](_0x43980d['query'][_0x4fbc('0x2b')]);}return _0x2b2615[_0x4fbc('0x59')](_0x5bb2f1);}})[_0x4fbc('0x34')](function(_0x588e18){if(_0x588e18){return _0x588e18?{'count':_0x54bb23,'rows':_0x588e18}:null;}})['then'](respondWithResult(_0x1478c2,null))[_0x4fbc('0x26')](handleError(_0x1478c2,null));};exports[_0x4fbc('0x5c')]=function(_0x40c1f5,_0x807461,_0x211b4c){var _0x65314={};var _0x2ac878={};var _0x9e9a7;var _0xb4ad8;return db[_0x4fbc('0x3a')][_0x4fbc('0x5a')]({'where':{'id':_0x40c1f5['params']['id']}})[_0x4fbc('0x34')](handleEntityNotFound(_0x807461,null))[_0x4fbc('0x34')](function(_0x255e67){if(_0x255e67){_0x9e9a7=_0x255e67;_0x2ac878['model']=_[_0x4fbc('0x54')](db[_0x4fbc('0x5d')][_0x4fbc('0x3b')]);_0x2ac878[_0x4fbc('0x3e')]=_[_0x4fbc('0x54')](_0x40c1f5[_0x4fbc('0x3e')]);_0x2ac878['filters']=_['intersection'](_0x2ac878[_0x4fbc('0x41')],_0x2ac878['query']);_0x65314[_0x4fbc('0x42')]=_['intersection'](_0x2ac878[_0x4fbc('0x41')],qs[_0x4fbc('0x43')](_0x40c1f5[_0x4fbc('0x3e')][_0x4fbc('0x43')]));_0x65314[_0x4fbc('0x42')]=_0x65314[_0x4fbc('0x42')][_0x4fbc('0x44')]?_0x65314['attributes']:_0x2ac878[_0x4fbc('0x41')];_0x65314[_0x4fbc('0x47')]=qs[_0x4fbc('0x48')](_0x40c1f5['query'][_0x4fbc('0x48')]);_0x65314[_0x4fbc('0x4b')]=qs[_0x4fbc('0x3f')](_[_0x4fbc('0x49')](_0x40c1f5['query'],_0x2ac878[_0x4fbc('0x3f')]));if(_0x40c1f5[_0x4fbc('0x3e')][_0x4fbc('0x4a')]){_0x65314[_0x4fbc('0x4b')]=_[_0x4fbc('0x4d')](_0x65314['where'],{'$or':_['map'](_0x65314[_0x4fbc('0x42')],function(_0x39e7af){var _0x22d1eb={};_0x22d1eb[_0x39e7af]={'$like':'%'+_0x40c1f5['query'][_0x4fbc('0x4a')]+'%'};return _0x22d1eb;})});}_0x65314=_[_0x4fbc('0x4d')]({},_0x65314,_0x40c1f5['options']);return _0x9e9a7[_0x4fbc('0x5c')](_0x65314);}})[_0x4fbc('0x34')](function(_0x218d02){if(_0x218d02){_0xb4ad8=_0x218d02[_0x4fbc('0x44')];if(!_0x40c1f5[_0x4fbc('0x3e')][_0x4fbc('0x45')](_0x4fbc('0x46'))){_0x65314['limit']=qs['limit'](_0x40c1f5[_0x4fbc('0x3e')][_0x4fbc('0x2c')]);_0x65314[_0x4fbc('0x2b')]=qs[_0x4fbc('0x2b')](_0x40c1f5[_0x4fbc('0x3e')]['offset']);}return _0x9e9a7[_0x4fbc('0x5c')](_0x65314);}})[_0x4fbc('0x34')](function(_0xc4eb33){if(_0xc4eb33){return _0xc4eb33?{'count':_0xb4ad8,'rows':_0xc4eb33}:null;}})[_0x4fbc('0x34')](respondWithResult(_0x807461,null))[_0x4fbc('0x26')](handleError(_0x807461,null));};exports[_0x4fbc('0x5e')]=function(_0x437fd2,_0x3b2317,_0x2d63c9){var _0x15c684={};var _0x5867b4={};var _0x330862;var _0x7d420e;return db[_0x4fbc('0x3a')][_0x4fbc('0x5a')]({'where':{'id':_0x437fd2['params']['id']}})[_0x4fbc('0x34')](handleEntityNotFound(_0x3b2317,null))[_0x4fbc('0x34')](function(_0x3c5817){if(_0x3c5817){_0x330862=_0x3c5817;_0x5867b4['model']=_['keys'](db[_0x4fbc('0x5d')][_0x4fbc('0x3b')]);_0x5867b4[_0x4fbc('0x3e')]=_[_0x4fbc('0x54')](_0x437fd2['query']);_0x5867b4[_0x4fbc('0x3f')]=_['intersection'](_0x5867b4['model'],_0x5867b4['query']);_0x15c684[_0x4fbc('0x42')]=_[_0x4fbc('0x40')](_0x5867b4['model'],qs[_0x4fbc('0x43')](_0x437fd2[_0x4fbc('0x3e')][_0x4fbc('0x43')]));_0x15c684[_0x4fbc('0x42')]=_0x15c684[_0x4fbc('0x42')][_0x4fbc('0x44')]?_0x15c684[_0x4fbc('0x42')]:_0x5867b4[_0x4fbc('0x41')];_0x15c684[_0x4fbc('0x47')]=qs['sort'](_0x437fd2[_0x4fbc('0x3e')]['sort']);_0x15c684[_0x4fbc('0x4b')]=qs[_0x4fbc('0x3f')](_[_0x4fbc('0x49')](_0x437fd2[_0x4fbc('0x3e')],_0x5867b4['filters']));if(_0x437fd2[_0x4fbc('0x3e')][_0x4fbc('0x4a')]){_0x15c684[_0x4fbc('0x4b')]=_[_0x4fbc('0x4d')](_0x15c684[_0x4fbc('0x4b')],{'$or':_[_0x4fbc('0x39')](_0x15c684[_0x4fbc('0x42')],function(_0x23eb65){var _0x25d1de={};_0x25d1de[_0x23eb65]={'$like':'%'+_0x437fd2[_0x4fbc('0x3e')][_0x4fbc('0x4a')]+'%'};return _0x25d1de;})});}_0x15c684=_[_0x4fbc('0x4d')]({},_0x15c684,_0x437fd2['options']);return _0x330862['getDescriptions'](_0x15c684);}})[_0x4fbc('0x34')](function(_0x5cfa5e){if(_0x5cfa5e){_0x7d420e=_0x5cfa5e[_0x4fbc('0x44')];if(!_0x437fd2[_0x4fbc('0x3e')][_0x4fbc('0x45')]('nolimit')){_0x15c684['limit']=qs[_0x4fbc('0x2c')](_0x437fd2[_0x4fbc('0x3e')][_0x4fbc('0x2c')]);_0x15c684[_0x4fbc('0x2b')]=qs[_0x4fbc('0x2b')](_0x437fd2[_0x4fbc('0x3e')]['offset']);}return _0x330862[_0x4fbc('0x5e')](_0x15c684);}})['then'](function(_0x8f3675){if(_0x8f3675){return _0x8f3675?{'count':_0x7d420e,'rows':_0x8f3675}:null;}})[_0x4fbc('0x34')](respondWithResult(_0x3b2317,null))[_0x4fbc('0x26')](handleError(_0x3b2317,null));};