Built motion from commit (unavailable).|2.5.2
[motion2.git] / server / api / intZohoConfiguration / intZohoConfiguration.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 _0x2836=['create','body','find','getFields','ZohoField','map','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','status','end','offset','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','rows','show','params','include'];(function(_0x325681,_0x27bd21){var _0x3054e8=function(_0x50758e){while(--_0x50758e){_0x325681['push'](_0x325681['shift']());}};_0x3054e8(++_0x27bd21);}(_0x2836,0x1d5));var _0x6283=function(_0xd7b111,_0x3829bb){_0xd7b111=_0xd7b111-0x0;var _0x5b3c26=_0x2836[_0xd7b111];return _0x5b3c26;};'use strict';var pdf=require(_0x6283('0x0'));var emlformat=require(_0x6283('0x1'));var rimraf=require(_0x6283('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6283('0x3'));var rp=require(_0x6283('0x4'));var moment=require(_0x6283('0x5'));var BPromise=require(_0x6283('0x6'));var Mustache=require('mustache');var util=require(_0x6283('0x7'));var path=require('path');var sox=require(_0x6283('0x8'));var csv=require('to-csv');var ejs=require(_0x6283('0x9'));var fs=require('fs');var _=require(_0x6283('0xa'));var squel=require('squel');var crypto=require(_0x6283('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6283('0xc'));var toCsv=require(_0x6283('0xd'));var querystring=require(_0x6283('0xe'));var Papa=require(_0x6283('0xf'));var Redis=require('ioredis');var authService=require(_0x6283('0x10'));var qs=require(_0x6283('0x11'));var as=require(_0x6283('0x12'));var hardwareService=require(_0x6283('0x13'));var logger=require('../../config/logger')(_0x6283('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6283('0x15'))['db'];var jayson=require(_0x6283('0x16'));var client=jayson[_0x6283('0x17')][_0x6283('0x18')]({'port':0x232a});function checkPasswordPattern(_0x17ff40,_0x4b3be6,_0x12af84){if(_0x12af84){var _0x12fae7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12fae7[_0x6283('0x19')](_0x4b3be6)){return _0x17ff40;}else{throw new db[(_0x6283('0x1a'))][(_0x6283('0x1b'))](_0x6283('0x1c'));}}else{return _0x17ff40;}}function respondWithRpcPromise(_0x749d1a,_0x1133ac,_0x2dcec1,_0x4ac8d2){return new BPromise(function(_0xbe8016,_0x3e23f0){var _0x444cf5=_0x4ac8d2||client;return _0x444cf5[_0x6283('0x1d')](_0x749d1a,_0x2dcec1)[_0x6283('0x1e')](function(_0x1ef8de){logger[_0x6283('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x1133ac,_0x6283('0x20'));logger['debug'](_0x6283('0x21'),_0x1133ac,'request\x20sent',JSON['stringify'](_0x1ef8de));if(_0x1ef8de[_0x6283('0x22')]){if(_0x1ef8de[_0x6283('0x22')][_0x6283('0x23')]===0x1f4){logger[_0x6283('0x22')](_0x6283('0x24'),_0x1133ac,_0x1ef8de[_0x6283('0x22')][_0x6283('0x25')]);return _0x3e23f0(_0x1ef8de[_0x6283('0x22')][_0x6283('0x25')]);}logger[_0x6283('0x22')](_0x6283('0x24'),_0x1133ac,_0x1ef8de[_0x6283('0x22')][_0x6283('0x25')]);return _0xbe8016(_0x1ef8de[_0x6283('0x22')][_0x6283('0x25')]);}else{logger[_0x6283('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x1133ac,'request\x20sent');_0xbe8016(_0x1ef8de[_0x6283('0x26')]['message']);}})[_0x6283('0x27')](function(_0x5d17f7){logger['error'](_0x6283('0x24'),_0x1133ac,_0x5d17f7);_0x3e23f0(_0x5d17f7);});});}function respondWithStatusCode(_0x5617c1,_0x2316df){_0x2316df=_0x2316df||0xcc;return function(_0x1bb538){if(_0x1bb538){return _0x5617c1['sendStatus'](_0x2316df);}return _0x5617c1[_0x6283('0x28')](_0x2316df)[_0x6283('0x29')]();};}function respondWithResult(_0x17ecb8,_0x1a14db){_0x1a14db=_0x1a14db||0xc8;return function(_0x1d8a21){if(_0x1d8a21){return _0x17ecb8[_0x6283('0x28')](_0x1a14db)['json'](_0x1d8a21);}};}function respondWithFilteredResult(_0x5032a2,_0x599a6b){return function(_0xdf3fd9){if(_0xdf3fd9){var _0x11e6bc=_0xdf3fd9['count'],_0x38c766=_0x599a6b[_0x6283('0x2a')],_0x31ed47=_0x599a6b[_0x6283('0x2a')]+_0x599a6b['limit'],_0x317da9;if(_0x31ed47>=_0x11e6bc){_0x31ed47=_0x11e6bc;_0x317da9=0xc8;}else{_0x317da9=0xce;}_0x5032a2['status'](_0x317da9);return _0x5032a2[_0x6283('0x2b')](_0x6283('0x2c'),_0x38c766+'-'+_0x31ed47+'/'+_0x11e6bc)[_0x6283('0x2d')](_0xdf3fd9);}return null;};}function patchUpdates(_0x3a8836){return function(_0x4193c0){try{jsonpatch[_0x6283('0x2e')](_0x4193c0,_0x3a8836,!![]);}catch(_0x2088b6){return BPromise[_0x6283('0x2f')](_0x2088b6);}return _0x4193c0[_0x6283('0x30')]();};}function saveUpdates(_0x2f00b3,_0x1937e1){return function(_0x104dca){if(_0x104dca){return _0x104dca[_0x6283('0x31')](_0x2f00b3)['then'](function(_0x275d6b){return _0x275d6b;});}return null;};}function removeEntity(_0x31224b,_0x470baf){return function(_0x49d502){if(_0x49d502){return _0x49d502[_0x6283('0x32')]()[_0x6283('0x1e')](function(){_0x31224b[_0x6283('0x28')](0xcc)[_0x6283('0x29')]();});}};}function handleEntityNotFound(_0x20e726,_0x3f58c7){return function(_0x26aa39){if(!_0x26aa39){_0x20e726[_0x6283('0x33')](0x194);}return _0x26aa39;};}function handleError(_0x1ceadf,_0x2545fd){_0x2545fd=_0x2545fd||0x1f4;return function(_0x51e5ce){logger[_0x6283('0x22')](_0x51e5ce[_0x6283('0x34')]);if(_0x51e5ce[_0x6283('0x35')]){delete _0x51e5ce[_0x6283('0x35')];}_0x1ceadf[_0x6283('0x28')](_0x2545fd)['send'](_0x51e5ce);};}exports['index']=function(_0x4ec0c8,_0x2a3fd2){var _0x28510c={},_0x25bc06={},_0x5d94dc={'count':0x0,'rows':[]};var _0x238864=_['map'](db[_0x6283('0x36')][_0x6283('0x37')],function(_0x2a5b8e){return{'name':_0x2a5b8e[_0x6283('0x38')],'type':_0x2a5b8e[_0x6283('0x39')][_0x6283('0x3a')]};});_0x25bc06[_0x6283('0x3b')]=_['map'](_0x238864,_0x6283('0x35'));_0x25bc06[_0x6283('0x3c')]=_[_0x6283('0x3d')](_0x4ec0c8[_0x6283('0x3c')]);_0x25bc06[_0x6283('0x3e')]=_[_0x6283('0x3f')](_0x25bc06[_0x6283('0x3b')],_0x25bc06['query']);_0x28510c['attributes']=_['intersection'](_0x25bc06[_0x6283('0x3b')],qs[_0x6283('0x40')](_0x4ec0c8[_0x6283('0x3c')][_0x6283('0x40')]));_0x28510c[_0x6283('0x41')]=_0x28510c[_0x6283('0x41')][_0x6283('0x42')]?_0x28510c[_0x6283('0x41')]:_0x25bc06['model'];if(!_0x4ec0c8[_0x6283('0x3c')][_0x6283('0x43')]('nolimit')){_0x28510c[_0x6283('0x44')]=qs[_0x6283('0x44')](_0x4ec0c8[_0x6283('0x3c')][_0x6283('0x44')]);_0x28510c[_0x6283('0x2a')]=qs[_0x6283('0x2a')](_0x4ec0c8[_0x6283('0x3c')][_0x6283('0x2a')]);}_0x28510c[_0x6283('0x45')]=qs['sort'](_0x4ec0c8['query'][_0x6283('0x46')]);_0x28510c['where']=qs[_0x6283('0x3e')](_[_0x6283('0x47')](_0x4ec0c8[_0x6283('0x3c')],_0x25bc06[_0x6283('0x3e')]),_0x238864);if(_0x4ec0c8['query'][_0x6283('0x48')]){_0x28510c[_0x6283('0x49')]=_['merge'](_0x28510c[_0x6283('0x49')],{'$or':_['map'](_0x238864,function(_0x2c8055){if(_0x2c8055[_0x6283('0x39')]!==_0x6283('0x4a')){var _0x6a3fa8={};_0x6a3fa8[_0x2c8055[_0x6283('0x35')]]={'$like':'%'+_0x4ec0c8[_0x6283('0x3c')][_0x6283('0x48')]+'%'};return _0x6a3fa8;}})});}_0x28510c=_[_0x6283('0x4b')]({},_0x28510c,_0x4ec0c8[_0x6283('0x4c')]);var _0x381ce0={'where':_0x28510c['where']};return db['ZohoConfiguration'][_0x6283('0x4d')](_0x381ce0)[_0x6283('0x1e')](function(_0x119236){_0x5d94dc[_0x6283('0x4d')]=_0x119236;if(_0x4ec0c8[_0x6283('0x3c')][_0x6283('0x4e')]){_0x28510c['include']=[{'all':!![]}];}return db[_0x6283('0x36')]['findAll'](_0x28510c);})[_0x6283('0x1e')](function(_0x363d75){_0x5d94dc[_0x6283('0x4f')]=_0x363d75;return _0x5d94dc;})['then'](respondWithFilteredResult(_0x2a3fd2,_0x28510c))[_0x6283('0x27')](handleError(_0x2a3fd2,null));};exports[_0x6283('0x50')]=function(_0x44f371,_0xa5e16e){var _0x5857f7={'raw':![],'where':{'id':_0x44f371[_0x6283('0x51')]['id']}},_0x3f3904={};_0x3f3904[_0x6283('0x3b')]=_[_0x6283('0x3d')](db['ZohoConfiguration']['rawAttributes']);_0x3f3904[_0x6283('0x3c')]=_[_0x6283('0x3d')](_0x44f371[_0x6283('0x3c')]);_0x3f3904[_0x6283('0x3e')]=_['intersection'](_0x3f3904[_0x6283('0x3b')],_0x3f3904['query']);_0x5857f7[_0x6283('0x41')]=_[_0x6283('0x3f')](_0x3f3904[_0x6283('0x3b')],qs[_0x6283('0x40')](_0x44f371[_0x6283('0x3c')][_0x6283('0x40')]));_0x5857f7[_0x6283('0x41')]=_0x5857f7[_0x6283('0x41')][_0x6283('0x42')]?_0x5857f7[_0x6283('0x41')]:_0x3f3904[_0x6283('0x3b')];if(_0x44f371[_0x6283('0x3c')][_0x6283('0x4e')]){_0x5857f7[_0x6283('0x52')]=[{'all':!![]}];}_0x5857f7=_[_0x6283('0x4b')]({},_0x5857f7,_0x44f371['options']);return db[_0x6283('0x36')]['find'](_0x5857f7)[_0x6283('0x1e')](handleEntityNotFound(_0xa5e16e,null))[_0x6283('0x1e')](respondWithResult(_0xa5e16e,null))[_0x6283('0x27')](handleError(_0xa5e16e,null));};exports[_0x6283('0x53')]=function(_0x59bfd8,_0x317943){return db[_0x6283('0x36')][_0x6283('0x53')](_0x59bfd8[_0x6283('0x54')],{})[_0x6283('0x1e')](respondWithResult(_0x317943,0xc9))[_0x6283('0x27')](handleError(_0x317943,null));};exports[_0x6283('0x31')]=function(_0x1fb360,_0x1b5ac9){if(_0x1fb360['body']['id']){delete _0x1fb360[_0x6283('0x54')]['id'];}return db[_0x6283('0x36')][_0x6283('0x55')]({'where':{'id':_0x1fb360['params']['id']}})[_0x6283('0x1e')](handleEntityNotFound(_0x1b5ac9,null))[_0x6283('0x1e')](saveUpdates(_0x1fb360[_0x6283('0x54')],null))[_0x6283('0x1e')](respondWithResult(_0x1b5ac9,null))['catch'](handleError(_0x1b5ac9,null));};exports[_0x6283('0x32')]=function(_0x518922,_0x1da41d){return db[_0x6283('0x36')][_0x6283('0x55')]({'where':{'id':_0x518922[_0x6283('0x51')]['id']}})[_0x6283('0x1e')](handleEntityNotFound(_0x1da41d,null))['then'](removeEntity(_0x1da41d,null))[_0x6283('0x27')](handleError(_0x1da41d,null));};exports[_0x6283('0x56')]=function(_0x16e0da,_0x304309,_0x1b7342){var _0x1468a6={};var _0x5f1066={};var _0x575ef6;var _0x6f8627;return db[_0x6283('0x36')]['findOne']({'where':{'id':_0x16e0da[_0x6283('0x51')]['id']}})[_0x6283('0x1e')](handleEntityNotFound(_0x304309,null))[_0x6283('0x1e')](function(_0x2e7799){if(_0x2e7799){_0x575ef6=_0x2e7799;_0x5f1066[_0x6283('0x3b')]=_[_0x6283('0x3d')](db[_0x6283('0x57')][_0x6283('0x37')]);_0x5f1066[_0x6283('0x3c')]=_[_0x6283('0x3d')](_0x16e0da['query']);_0x5f1066[_0x6283('0x3e')]=_['intersection'](_0x5f1066[_0x6283('0x3b')],_0x5f1066['query']);_0x1468a6['attributes']=_['intersection'](_0x5f1066[_0x6283('0x3b')],qs[_0x6283('0x40')](_0x16e0da[_0x6283('0x3c')][_0x6283('0x40')]));_0x1468a6[_0x6283('0x41')]=_0x1468a6[_0x6283('0x41')][_0x6283('0x42')]?_0x1468a6[_0x6283('0x41')]:_0x5f1066[_0x6283('0x3b')];_0x1468a6['order']=qs['sort'](_0x16e0da[_0x6283('0x3c')][_0x6283('0x46')]);_0x1468a6[_0x6283('0x49')]=qs[_0x6283('0x3e')](_[_0x6283('0x47')](_0x16e0da[_0x6283('0x3c')],_0x5f1066[_0x6283('0x3e')]));if(_0x16e0da[_0x6283('0x3c')][_0x6283('0x48')]){_0x1468a6[_0x6283('0x49')]=_[_0x6283('0x4b')](_0x1468a6[_0x6283('0x49')],{'$or':_[_0x6283('0x58')](_0x1468a6['attributes'],function(_0x4aaebe){var _0x1a7173={};_0x1a7173[_0x4aaebe]={'$like':'%'+_0x16e0da[_0x6283('0x3c')][_0x6283('0x48')]+'%'};return _0x1a7173;})});}_0x1468a6=_['merge']({},_0x1468a6,_0x16e0da[_0x6283('0x4c')]);return _0x575ef6[_0x6283('0x56')](_0x1468a6);}})['then'](function(_0x23965e){if(_0x23965e){_0x6f8627=_0x23965e[_0x6283('0x42')];if(!_0x16e0da[_0x6283('0x3c')][_0x6283('0x43')](_0x6283('0x59'))){_0x1468a6[_0x6283('0x44')]=qs['limit'](_0x16e0da[_0x6283('0x3c')][_0x6283('0x44')]);_0x1468a6[_0x6283('0x2a')]=qs['offset'](_0x16e0da[_0x6283('0x3c')][_0x6283('0x2a')]);}return _0x575ef6[_0x6283('0x56')](_0x1468a6);}})[_0x6283('0x1e')](function(_0x241d64){if(_0x241d64){return _0x241d64?{'count':_0x6f8627,'rows':_0x241d64}:null;}})['then'](respondWithResult(_0x304309,null))[_0x6283('0x27')](handleError(_0x304309,null));};exports['getSubjects']=function(_0x5681ea,_0x5a53db,_0x5d5ce6){var _0x1cca5b={};var _0x5f3913={};var _0x456172;var _0x3f7fc9;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x5681ea['params']['id']}})[_0x6283('0x1e')](handleEntityNotFound(_0x5a53db,null))[_0x6283('0x1e')](function(_0x475b52){if(_0x475b52){_0x456172=_0x475b52;_0x5f3913[_0x6283('0x3b')]=_[_0x6283('0x3d')](db[_0x6283('0x57')][_0x6283('0x37')]);_0x5f3913[_0x6283('0x3c')]=_[_0x6283('0x3d')](_0x5681ea['query']);_0x5f3913[_0x6283('0x3e')]=_['intersection'](_0x5f3913[_0x6283('0x3b')],_0x5f3913['query']);_0x1cca5b[_0x6283('0x41')]=_[_0x6283('0x3f')](_0x5f3913['model'],qs[_0x6283('0x40')](_0x5681ea[_0x6283('0x3c')][_0x6283('0x40')]));_0x1cca5b['attributes']=_0x1cca5b[_0x6283('0x41')][_0x6283('0x42')]?_0x1cca5b[_0x6283('0x41')]:_0x5f3913['model'];_0x1cca5b[_0x6283('0x45')]=qs[_0x6283('0x46')](_0x5681ea['query'][_0x6283('0x46')]);_0x1cca5b[_0x6283('0x49')]=qs[_0x6283('0x3e')](_['pick'](_0x5681ea[_0x6283('0x3c')],_0x5f3913['filters']));if(_0x5681ea[_0x6283('0x3c')][_0x6283('0x48')]){_0x1cca5b[_0x6283('0x49')]=_[_0x6283('0x4b')](_0x1cca5b[_0x6283('0x49')],{'$or':_[_0x6283('0x58')](_0x1cca5b[_0x6283('0x41')],function(_0x1ebb77){var _0x12d6d8={};_0x12d6d8[_0x1ebb77]={'$like':'%'+_0x5681ea['query'][_0x6283('0x48')]+'%'};return _0x12d6d8;})});}_0x1cca5b=_[_0x6283('0x4b')]({},_0x1cca5b,_0x5681ea['options']);return _0x456172['getSubjects'](_0x1cca5b);}})['then'](function(_0x4f548a){if(_0x4f548a){_0x3f7fc9=_0x4f548a[_0x6283('0x42')];if(!_0x5681ea[_0x6283('0x3c')][_0x6283('0x43')](_0x6283('0x59'))){_0x1cca5b[_0x6283('0x44')]=qs['limit'](_0x5681ea['query'][_0x6283('0x44')]);_0x1cca5b['offset']=qs[_0x6283('0x2a')](_0x5681ea['query']['offset']);}return _0x456172[_0x6283('0x5a')](_0x1cca5b);}})[_0x6283('0x1e')](function(_0x19e8ab){if(_0x19e8ab){return _0x19e8ab?{'count':_0x3f7fc9,'rows':_0x19e8ab}:null;}})[_0x6283('0x1e')](respondWithResult(_0x5a53db,null))[_0x6283('0x27')](handleError(_0x5a53db,null));};exports[_0x6283('0x5b')]=function(_0x2c6fc2,_0xb718f7,_0x113d10){var _0x31d77f={};var _0x3508fb={};var _0x33b053;var _0x4869f3;return db[_0x6283('0x36')]['findOne']({'where':{'id':_0x2c6fc2[_0x6283('0x51')]['id']}})[_0x6283('0x1e')](handleEntityNotFound(_0xb718f7,null))[_0x6283('0x1e')](function(_0x2039a3){if(_0x2039a3){_0x33b053=_0x2039a3;_0x3508fb['model']=_['keys'](db['ZohoField'][_0x6283('0x37')]);_0x3508fb[_0x6283('0x3c')]=_[_0x6283('0x3d')](_0x2c6fc2[_0x6283('0x3c')]);_0x3508fb[_0x6283('0x3e')]=_[_0x6283('0x3f')](_0x3508fb[_0x6283('0x3b')],_0x3508fb[_0x6283('0x3c')]);_0x31d77f[_0x6283('0x41')]=_[_0x6283('0x3f')](_0x3508fb['model'],qs['fields'](_0x2c6fc2[_0x6283('0x3c')][_0x6283('0x40')]));_0x31d77f['attributes']=_0x31d77f[_0x6283('0x41')][_0x6283('0x42')]?_0x31d77f[_0x6283('0x41')]:_0x3508fb[_0x6283('0x3b')];_0x31d77f[_0x6283('0x45')]=qs['sort'](_0x2c6fc2[_0x6283('0x3c')][_0x6283('0x46')]);_0x31d77f['where']=qs[_0x6283('0x3e')](_['pick'](_0x2c6fc2[_0x6283('0x3c')],_0x3508fb[_0x6283('0x3e')]));if(_0x2c6fc2[_0x6283('0x3c')]['filter']){_0x31d77f['where']=_['merge'](_0x31d77f[_0x6283('0x49')],{'$or':_[_0x6283('0x58')](_0x31d77f[_0x6283('0x41')],function(_0x2029a2){var _0x71c944={};_0x71c944[_0x2029a2]={'$like':'%'+_0x2c6fc2[_0x6283('0x3c')]['filter']+'%'};return _0x71c944;})});}_0x31d77f=_[_0x6283('0x4b')]({},_0x31d77f,_0x2c6fc2['options']);return _0x33b053[_0x6283('0x5b')](_0x31d77f);}})[_0x6283('0x1e')](function(_0x4efd8d){if(_0x4efd8d){_0x4869f3=_0x4efd8d[_0x6283('0x42')];if(!_0x2c6fc2[_0x6283('0x3c')][_0x6283('0x43')](_0x6283('0x59'))){_0x31d77f[_0x6283('0x44')]=qs['limit'](_0x2c6fc2['query'][_0x6283('0x44')]);_0x31d77f['offset']=qs['offset'](_0x2c6fc2[_0x6283('0x3c')]['offset']);}return _0x33b053[_0x6283('0x5b')](_0x31d77f);}})[_0x6283('0x1e')](function(_0x2cf9b9){if(_0x2cf9b9){return _0x2cf9b9?{'count':_0x4869f3,'rows':_0x2cf9b9}:null;}})['then'](respondWithResult(_0xb718f7,null))['catch'](handleError(_0xb718f7,null));};