Built motion from commit (unavailable).|2.5.30
[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 _0xb10b=['intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','create','body','getFields','ZohoField','nolimit','getSubjects','findOne','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','destroy','stack','name','index','map','ZohoConfiguration','fieldName','query','filters'];(function(_0x15f455,_0x1ec373){var _0x45f542=function(_0x2b29f7){while(--_0x2b29f7){_0x15f455['push'](_0x15f455['shift']());}};_0x45f542(++_0x1ec373);}(_0xb10b,0x12a));var _0xbb10=function(_0x1254a5,_0x2ba0be){_0x1254a5=_0x1254a5-0x0;var _0x2fbf81=_0xb10b[_0x1254a5];return _0x2fbf81;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];var jayson=require(_0xbb10('0x18'));var client=jayson[_0xbb10('0x19')][_0xbb10('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x442548,_0x147230,_0x58a612,_0x26e021){return new BPromise(function(_0x42d7e4,_0x45b9d6){var _0x17fd46=_0x26e021||client;return _0x17fd46[_0xbb10('0x1b')](_0x442548,_0x58a612)[_0xbb10('0x1c')](function(_0x24a57b){logger[_0xbb10('0x1d')](_0xbb10('0x1e'),_0x147230,_0xbb10('0x1f'));logger['debug'](_0xbb10('0x20'),_0x147230,_0xbb10('0x1f'),JSON[_0xbb10('0x21')](_0x24a57b));if(_0x24a57b[_0xbb10('0x22')]){if(_0x24a57b[_0xbb10('0x22')][_0xbb10('0x23')]===0x1f4){logger[_0xbb10('0x22')](_0xbb10('0x1e'),_0x147230,_0x24a57b[_0xbb10('0x22')][_0xbb10('0x24')]);return _0x45b9d6(_0x24a57b['error'][_0xbb10('0x24')]);}logger[_0xbb10('0x22')](_0xbb10('0x1e'),_0x147230,_0x24a57b[_0xbb10('0x22')][_0xbb10('0x24')]);return _0x42d7e4(_0x24a57b[_0xbb10('0x22')]['message']);}else{logger[_0xbb10('0x1d')](_0xbb10('0x1e'),_0x147230,'request\x20sent');_0x42d7e4(_0x24a57b['result'][_0xbb10('0x24')]);}})[_0xbb10('0x25')](function(_0x2e911d){logger[_0xbb10('0x22')](_0xbb10('0x1e'),_0x147230,_0x2e911d);_0x45b9d6(_0x2e911d);});});}function respondWithStatusCode(_0x1824b7,_0x407cb4){_0x407cb4=_0x407cb4||0xcc;return function(_0x436104){if(_0x436104){return _0x1824b7[_0xbb10('0x26')](_0x407cb4);}return _0x1824b7[_0xbb10('0x27')](_0x407cb4)[_0xbb10('0x28')]();};}function respondWithResult(_0x26ad93,_0x537898){_0x537898=_0x537898||0xc8;return function(_0x4fedac){if(_0x4fedac){return _0x26ad93['status'](_0x537898)[_0xbb10('0x29')](_0x4fedac);}};}function respondWithFilteredResult(_0x3c5ae7,_0x2c89b9){return function(_0x4e25ff){if(_0x4e25ff){var _0x2fdde9=typeof _0x2c89b9[_0xbb10('0x2a')]===_0xbb10('0x2b')&&typeof _0x2c89b9[_0xbb10('0x2c')]===_0xbb10('0x2b');var _0x20d946=_0x4e25ff[_0xbb10('0x2d')];var _0x4aabb9=_0x2fdde9?0x0:_0x2c89b9[_0xbb10('0x2a')];var _0x21ac54=_0x2fdde9?_0x4e25ff[_0xbb10('0x2d')]:_0x2c89b9[_0xbb10('0x2a')]+_0x2c89b9[_0xbb10('0x2c')];var _0x2ff4c1;if(_0x21ac54>=_0x20d946){_0x21ac54=_0x20d946;_0x2ff4c1=0xc8;}else{_0x2ff4c1=0xce;}_0x3c5ae7['status'](_0x2ff4c1);return _0x3c5ae7[_0xbb10('0x2e')]('Content-Range',_0x4aabb9+'-'+_0x21ac54+'/'+_0x20d946)[_0xbb10('0x29')](_0x4e25ff);}return null;};}function patchUpdates(_0x56f2da){return function(_0x16ad2a){try{jsonpatch[_0xbb10('0x2f')](_0x16ad2a,_0x56f2da,!![]);}catch(_0x1b59f9){return BPromise['reject'](_0x1b59f9);}return _0x16ad2a['save']();};}function saveUpdates(_0x4c3744,_0x34f65e){return function(_0x4f590d){if(_0x4f590d){return _0x4f590d[_0xbb10('0x30')](_0x4c3744)[_0xbb10('0x1c')](function(_0x2f653f){return _0x2f653f;});}return null;};}function removeEntity(_0x1c0b57,_0x37a83f){return function(_0x138bc6){if(_0x138bc6){return _0x138bc6[_0xbb10('0x31')]()['then'](function(){_0x1c0b57[_0xbb10('0x27')](0xcc)[_0xbb10('0x28')]();});}};}function handleEntityNotFound(_0x441d15,_0x8c1ce6){return function(_0xfb2c5e){if(!_0xfb2c5e){_0x441d15[_0xbb10('0x26')](0x194);}return _0xfb2c5e;};}function handleError(_0x188cbd,_0x10202c){_0x10202c=_0x10202c||0x1f4;return function(_0x3c8d7d){logger['error'](_0x3c8d7d[_0xbb10('0x32')]);if(_0x3c8d7d[_0xbb10('0x33')]){delete _0x3c8d7d[_0xbb10('0x33')];}_0x188cbd[_0xbb10('0x27')](_0x10202c)['send'](_0x3c8d7d);};}exports[_0xbb10('0x34')]=function(_0x5de37b,_0x4e2754){var _0x3eb3cc={},_0x40c164={},_0x26e76a={'count':0x0,'rows':[]};var _0x120d21=_[_0xbb10('0x35')](db[_0xbb10('0x36')]['rawAttributes'],function(_0x1e5bbd){return{'name':_0x1e5bbd[_0xbb10('0x37')],'type':_0x1e5bbd['type']['key']};});_0x40c164['model']=_[_0xbb10('0x35')](_0x120d21,_0xbb10('0x33'));_0x40c164[_0xbb10('0x38')]=_['keys'](_0x5de37b[_0xbb10('0x38')]);_0x40c164[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x40c164['model'],_0x40c164[_0xbb10('0x38')]);_0x3eb3cc[_0xbb10('0x3b')]=_[_0xbb10('0x3a')](_0x40c164[_0xbb10('0x3c')],qs['fields'](_0x5de37b[_0xbb10('0x38')][_0xbb10('0x3d')]));_0x3eb3cc['attributes']=_0x3eb3cc[_0xbb10('0x3b')][_0xbb10('0x3e')]?_0x3eb3cc[_0xbb10('0x3b')]:_0x40c164[_0xbb10('0x3c')];if(!_0x5de37b[_0xbb10('0x38')][_0xbb10('0x3f')]('nolimit')){_0x3eb3cc[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x5de37b[_0xbb10('0x38')][_0xbb10('0x2c')]);_0x3eb3cc['offset']=qs[_0xbb10('0x2a')](_0x5de37b[_0xbb10('0x38')][_0xbb10('0x2a')]);}_0x3eb3cc[_0xbb10('0x40')]=qs['sort'](_0x5de37b[_0xbb10('0x38')][_0xbb10('0x41')]);_0x3eb3cc['where']=qs['filters'](_[_0xbb10('0x42')](_0x5de37b['query'],_0x40c164[_0xbb10('0x39')]),_0x120d21);if(_0x5de37b[_0xbb10('0x38')]['filter']){_0x3eb3cc[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x3eb3cc[_0xbb10('0x43')],{'$or':_['map'](_0x120d21,function(_0x2dd02b){if(_0x2dd02b[_0xbb10('0x45')]!==_0xbb10('0x46')){var _0x32b729={};_0x32b729[_0x2dd02b[_0xbb10('0x33')]]={'$like':'%'+_0x5de37b[_0xbb10('0x38')][_0xbb10('0x47')]+'%'};return _0x32b729;}})});}_0x3eb3cc=_[_0xbb10('0x44')]({},_0x3eb3cc,_0x5de37b[_0xbb10('0x48')]);var _0x43b948={'where':_0x3eb3cc[_0xbb10('0x43')]};return db[_0xbb10('0x36')]['count'](_0x43b948)[_0xbb10('0x1c')](function(_0x41bbf8){_0x26e76a['count']=_0x41bbf8;if(_0x5de37b[_0xbb10('0x38')][_0xbb10('0x49')]){_0x3eb3cc[_0xbb10('0x4a')]=[{'all':!![]}];}return db[_0xbb10('0x36')][_0xbb10('0x4b')](_0x3eb3cc);})[_0xbb10('0x1c')](function(_0x3e06b0){_0x26e76a['rows']=_0x3e06b0;return _0x26e76a;})['then'](respondWithFilteredResult(_0x4e2754,_0x3eb3cc))[_0xbb10('0x25')](handleError(_0x4e2754,null));};exports[_0xbb10('0x4c')]=function(_0x2b12bd,_0x57d2c0){var _0x5f0c12={'raw':![],'where':{'id':_0x2b12bd[_0xbb10('0x4d')]['id']}},_0x3cd6f3={};_0x3cd6f3[_0xbb10('0x3c')]=_[_0xbb10('0x4e')](db[_0xbb10('0x36')][_0xbb10('0x4f')]);_0x3cd6f3[_0xbb10('0x38')]=_[_0xbb10('0x4e')](_0x2b12bd[_0xbb10('0x38')]);_0x3cd6f3[_0xbb10('0x39')]=_['intersection'](_0x3cd6f3['model'],_0x3cd6f3[_0xbb10('0x38')]);_0x5f0c12[_0xbb10('0x3b')]=_[_0xbb10('0x3a')](_0x3cd6f3[_0xbb10('0x3c')],qs[_0xbb10('0x3d')](_0x2b12bd[_0xbb10('0x38')][_0xbb10('0x3d')]));_0x5f0c12[_0xbb10('0x3b')]=_0x5f0c12[_0xbb10('0x3b')][_0xbb10('0x3e')]?_0x5f0c12[_0xbb10('0x3b')]:_0x3cd6f3[_0xbb10('0x3c')];if(_0x2b12bd[_0xbb10('0x38')][_0xbb10('0x49')]){_0x5f0c12[_0xbb10('0x4a')]=[{'all':!![]}];}_0x5f0c12=_['merge']({},_0x5f0c12,_0x2b12bd[_0xbb10('0x48')]);return db['ZohoConfiguration'][_0xbb10('0x50')](_0x5f0c12)[_0xbb10('0x1c')](handleEntityNotFound(_0x57d2c0,null))[_0xbb10('0x1c')](respondWithResult(_0x57d2c0,null))[_0xbb10('0x25')](handleError(_0x57d2c0,null));};exports[_0xbb10('0x51')]=function(_0x32d8e9,_0x2e3326){return db[_0xbb10('0x36')][_0xbb10('0x51')](_0x32d8e9[_0xbb10('0x52')],{})[_0xbb10('0x1c')](respondWithResult(_0x2e3326,0xc9))[_0xbb10('0x25')](handleError(_0x2e3326,null));};exports[_0xbb10('0x30')]=function(_0x3d7e17,_0x4475e1){if(_0x3d7e17['body']['id']){delete _0x3d7e17[_0xbb10('0x52')]['id'];}return db[_0xbb10('0x36')][_0xbb10('0x50')]({'where':{'id':_0x3d7e17[_0xbb10('0x4d')]['id']}})[_0xbb10('0x1c')](handleEntityNotFound(_0x4475e1,null))[_0xbb10('0x1c')](saveUpdates(_0x3d7e17['body'],null))[_0xbb10('0x1c')](respondWithResult(_0x4475e1,null))[_0xbb10('0x25')](handleError(_0x4475e1,null));};exports[_0xbb10('0x31')]=function(_0x14fed3,_0x432728){return db[_0xbb10('0x36')][_0xbb10('0x50')]({'where':{'id':_0x14fed3[_0xbb10('0x4d')]['id']}})[_0xbb10('0x1c')](handleEntityNotFound(_0x432728,null))[_0xbb10('0x1c')](removeEntity(_0x432728,null))[_0xbb10('0x25')](handleError(_0x432728,null));};exports[_0xbb10('0x53')]=function(_0x16932f,_0x4e7fac,_0x4ea1a6){var _0x16272d={};var _0x3e6338={};var _0x3d0cb7;var _0x8b0a7d;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x16932f[_0xbb10('0x4d')]['id']}})[_0xbb10('0x1c')](handleEntityNotFound(_0x4e7fac,null))[_0xbb10('0x1c')](function(_0x2dd150){if(_0x2dd150){_0x3d0cb7=_0x2dd150;_0x3e6338[_0xbb10('0x3c')]=_[_0xbb10('0x4e')](db[_0xbb10('0x54')]['rawAttributes']);_0x3e6338[_0xbb10('0x38')]=_[_0xbb10('0x4e')](_0x16932f['query']);_0x3e6338['filters']=_['intersection'](_0x3e6338[_0xbb10('0x3c')],_0x3e6338[_0xbb10('0x38')]);_0x16272d[_0xbb10('0x3b')]=_['intersection'](_0x3e6338['model'],qs['fields'](_0x16932f[_0xbb10('0x38')][_0xbb10('0x3d')]));_0x16272d[_0xbb10('0x3b')]=_0x16272d['attributes'][_0xbb10('0x3e')]?_0x16272d[_0xbb10('0x3b')]:_0x3e6338['model'];_0x16272d['order']=qs[_0xbb10('0x41')](_0x16932f[_0xbb10('0x38')][_0xbb10('0x41')]);_0x16272d[_0xbb10('0x43')]=qs['filters'](_[_0xbb10('0x42')](_0x16932f[_0xbb10('0x38')],_0x3e6338[_0xbb10('0x39')]));if(_0x16932f['query'][_0xbb10('0x47')]){_0x16272d[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x16272d['where'],{'$or':_[_0xbb10('0x35')](_0x16272d[_0xbb10('0x3b')],function(_0x3b0f08){var _0x37b65f={};_0x37b65f[_0x3b0f08]={'$like':'%'+_0x16932f['query'][_0xbb10('0x47')]+'%'};return _0x37b65f;})});}_0x16272d=_[_0xbb10('0x44')]({},_0x16272d,_0x16932f[_0xbb10('0x48')]);return _0x3d0cb7[_0xbb10('0x53')](_0x16272d);}})['then'](function(_0x354ea7){if(_0x354ea7){_0x8b0a7d=_0x354ea7[_0xbb10('0x3e')];if(!_0x16932f[_0xbb10('0x38')][_0xbb10('0x3f')](_0xbb10('0x55'))){_0x16272d[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x16932f['query']['limit']);_0x16272d['offset']=qs[_0xbb10('0x2a')](_0x16932f[_0xbb10('0x38')][_0xbb10('0x2a')]);}return _0x3d0cb7['getFields'](_0x16272d);}})['then'](function(_0x46f462){if(_0x46f462){return _0x46f462?{'count':_0x8b0a7d,'rows':_0x46f462}:null;}})[_0xbb10('0x1c')](respondWithResult(_0x4e7fac,null))[_0xbb10('0x25')](handleError(_0x4e7fac,null));};exports[_0xbb10('0x56')]=function(_0x260e06,_0x1ad2ed,_0x4cf2f3){var _0x1a5ca5={};var _0x15fae2={};var _0x270fdb;var _0x14f16b;return db[_0xbb10('0x36')]['findOne']({'where':{'id':_0x260e06['params']['id']}})['then'](handleEntityNotFound(_0x1ad2ed,null))[_0xbb10('0x1c')](function(_0x1e0569){if(_0x1e0569){_0x270fdb=_0x1e0569;_0x15fae2[_0xbb10('0x3c')]=_[_0xbb10('0x4e')](db[_0xbb10('0x54')][_0xbb10('0x4f')]);_0x15fae2['query']=_[_0xbb10('0x4e')](_0x260e06['query']);_0x15fae2['filters']=_['intersection'](_0x15fae2[_0xbb10('0x3c')],_0x15fae2[_0xbb10('0x38')]);_0x1a5ca5[_0xbb10('0x3b')]=_[_0xbb10('0x3a')](_0x15fae2['model'],qs[_0xbb10('0x3d')](_0x260e06['query']['fields']));_0x1a5ca5[_0xbb10('0x3b')]=_0x1a5ca5[_0xbb10('0x3b')][_0xbb10('0x3e')]?_0x1a5ca5[_0xbb10('0x3b')]:_0x15fae2[_0xbb10('0x3c')];_0x1a5ca5['order']=qs[_0xbb10('0x41')](_0x260e06[_0xbb10('0x38')][_0xbb10('0x41')]);_0x1a5ca5[_0xbb10('0x43')]=qs[_0xbb10('0x39')](_[_0xbb10('0x42')](_0x260e06[_0xbb10('0x38')],_0x15fae2['filters']));if(_0x260e06[_0xbb10('0x38')][_0xbb10('0x47')]){_0x1a5ca5[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x1a5ca5[_0xbb10('0x43')],{'$or':_[_0xbb10('0x35')](_0x1a5ca5[_0xbb10('0x3b')],function(_0x312a08){var _0x5a4429={};_0x5a4429[_0x312a08]={'$like':'%'+_0x260e06[_0xbb10('0x38')][_0xbb10('0x47')]+'%'};return _0x5a4429;})});}_0x1a5ca5=_[_0xbb10('0x44')]({},_0x1a5ca5,_0x260e06['options']);return _0x270fdb['getSubjects'](_0x1a5ca5);}})['then'](function(_0x23286d){if(_0x23286d){_0x14f16b=_0x23286d['length'];if(!_0x260e06['query'][_0xbb10('0x3f')](_0xbb10('0x55'))){_0x1a5ca5[_0xbb10('0x2c')]=qs[_0xbb10('0x2c')](_0x260e06[_0xbb10('0x38')][_0xbb10('0x2c')]);_0x1a5ca5[_0xbb10('0x2a')]=qs[_0xbb10('0x2a')](_0x260e06[_0xbb10('0x38')]['offset']);}return _0x270fdb[_0xbb10('0x56')](_0x1a5ca5);}})[_0xbb10('0x1c')](function(_0x46b6d2){if(_0x46b6d2){return _0x46b6d2?{'count':_0x14f16b,'rows':_0x46b6d2}:null;}})[_0xbb10('0x1c')](respondWithResult(_0x1ad2ed,null))['catch'](handleError(_0x1ad2ed,null));};exports['getDescriptions']=function(_0x3547a3,_0x2280bd,_0x30f0a4){var _0x32bb25={};var _0x5ee705={};var _0x17d596;var _0x275bce;return db[_0xbb10('0x36')][_0xbb10('0x57')]({'where':{'id':_0x3547a3[_0xbb10('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2280bd,null))['then'](function(_0x372636){if(_0x372636){_0x17d596=_0x372636;_0x5ee705[_0xbb10('0x3c')]=_[_0xbb10('0x4e')](db['ZohoField'][_0xbb10('0x4f')]);_0x5ee705[_0xbb10('0x38')]=_['keys'](_0x3547a3['query']);_0x5ee705[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x5ee705[_0xbb10('0x3c')],_0x5ee705['query']);_0x32bb25[_0xbb10('0x3b')]=_[_0xbb10('0x3a')](_0x5ee705[_0xbb10('0x3c')],qs[_0xbb10('0x3d')](_0x3547a3[_0xbb10('0x38')][_0xbb10('0x3d')]));_0x32bb25[_0xbb10('0x3b')]=_0x32bb25[_0xbb10('0x3b')][_0xbb10('0x3e')]?_0x32bb25['attributes']:_0x5ee705[_0xbb10('0x3c')];_0x32bb25[_0xbb10('0x40')]=qs[_0xbb10('0x41')](_0x3547a3[_0xbb10('0x38')][_0xbb10('0x41')]);_0x32bb25[_0xbb10('0x43')]=qs[_0xbb10('0x39')](_[_0xbb10('0x42')](_0x3547a3[_0xbb10('0x38')],_0x5ee705[_0xbb10('0x39')]));if(_0x3547a3[_0xbb10('0x38')][_0xbb10('0x47')]){_0x32bb25['where']=_['merge'](_0x32bb25[_0xbb10('0x43')],{'$or':_[_0xbb10('0x35')](_0x32bb25[_0xbb10('0x3b')],function(_0x3fd367){var _0x238c7a={};_0x238c7a[_0x3fd367]={'$like':'%'+_0x3547a3['query'][_0xbb10('0x47')]+'%'};return _0x238c7a;})});}_0x32bb25=_[_0xbb10('0x44')]({},_0x32bb25,_0x3547a3[_0xbb10('0x48')]);return _0x17d596[_0xbb10('0x58')](_0x32bb25);}})[_0xbb10('0x1c')](function(_0x379d49){if(_0x379d49){_0x275bce=_0x379d49['length'];if(!_0x3547a3[_0xbb10('0x38')][_0xbb10('0x3f')]('nolimit')){_0x32bb25[_0xbb10('0x2c')]=qs['limit'](_0x3547a3[_0xbb10('0x38')][_0xbb10('0x2c')]);_0x32bb25[_0xbb10('0x2a')]=qs[_0xbb10('0x2a')](_0x3547a3[_0xbb10('0x38')]['offset']);}return _0x17d596[_0xbb10('0x58')](_0x32bb25);}})['then'](function(_0x3fcc55){if(_0x3fcc55){return _0x3fcc55?{'count':_0x275bce,'rows':_0x3fcc55}:null;}})[_0xbb10('0x1c')](respondWithResult(_0x2280bd,null))['catch'](handleError(_0x2280bd,null));};