Built motion from commit (unavailable).|2.5.14
[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 _0xbfd9=['sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','name','send','index','VtigerConfiguration','rawAttributes','fieldName','key','model','map','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','intersection','create','body','find','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xbfd9,0x110));var _0x9bfd=function(_0x549449,_0x322df5){_0x549449=_0x549449-0x0;var _0x437444=_0xbfd9[_0x549449];return _0x437444;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bfd('0x0'));var rimraf=require(_0x9bfd('0x1'));var zipdir=require(_0x9bfd('0x2'));var jsonpatch=require(_0x9bfd('0x3'));var rp=require(_0x9bfd('0x4'));var moment=require(_0x9bfd('0x5'));var BPromise=require(_0x9bfd('0x6'));var Mustache=require(_0x9bfd('0x7'));var util=require(_0x9bfd('0x8'));var path=require(_0x9bfd('0x9'));var sox=require(_0x9bfd('0xa'));var csv=require('to-csv');var ejs=require(_0x9bfd('0xb'));var fs=require('fs');var _=require(_0x9bfd('0xc'));var squel=require(_0x9bfd('0xd'));var crypto=require(_0x9bfd('0xe'));var jsforce=require(_0x9bfd('0xf'));var deskjs=require(_0x9bfd('0x10'));var toCsv=require(_0x9bfd('0x11'));var querystring=require(_0x9bfd('0x12'));var Papa=require(_0x9bfd('0x13'));var Redis=require(_0x9bfd('0x14'));var authService=require(_0x9bfd('0x15'));var qs=require(_0x9bfd('0x16'));var as=require(_0x9bfd('0x17'));var hardwareService=require(_0x9bfd('0x18'));var logger=require(_0x9bfd('0x19'))('api');var utils=require(_0x9bfd('0x1a'));var config=require(_0x9bfd('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9bfd('0x1c'))['db'];var jayson=require(_0x9bfd('0x1d'));var client=jayson[_0x9bfd('0x1e')][_0x9bfd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2ec1a8,_0x3efc96,_0x52c4c5,_0x553b2f){return new BPromise(function(_0x52c2b1,_0x54bab1){var _0x13841a=_0x553b2f||client;return _0x13841a['request'](_0x2ec1a8,_0x52c4c5)[_0x9bfd('0x20')](function(_0x5cebb6){logger[_0x9bfd('0x21')](_0x9bfd('0x22'),_0x3efc96,_0x9bfd('0x23'));logger[_0x9bfd('0x24')](_0x9bfd('0x25'),_0x3efc96,_0x9bfd('0x23'),JSON[_0x9bfd('0x26')](_0x5cebb6));if(_0x5cebb6[_0x9bfd('0x27')]){if(_0x5cebb6['error'][_0x9bfd('0x28')]===0x1f4){logger['error'](_0x9bfd('0x22'),_0x3efc96,_0x5cebb6[_0x9bfd('0x27')][_0x9bfd('0x29')]);return _0x54bab1(_0x5cebb6[_0x9bfd('0x27')][_0x9bfd('0x29')]);}logger[_0x9bfd('0x27')](_0x9bfd('0x22'),_0x3efc96,_0x5cebb6[_0x9bfd('0x27')][_0x9bfd('0x29')]);return _0x52c2b1(_0x5cebb6['error']['message']);}else{logger[_0x9bfd('0x21')](_0x9bfd('0x22'),_0x3efc96,'request\x20sent');_0x52c2b1(_0x5cebb6['result'][_0x9bfd('0x29')]);}})[_0x9bfd('0x2a')](function(_0x5bb489){logger[_0x9bfd('0x27')](_0x9bfd('0x22'),_0x3efc96,_0x5bb489);_0x54bab1(_0x5bb489);});});}function respondWithStatusCode(_0xe3ad2e,_0x3da0fe){_0x3da0fe=_0x3da0fe||0xcc;return function(_0x27272c){if(_0x27272c){return _0xe3ad2e[_0x9bfd('0x2b')](_0x3da0fe);}return _0xe3ad2e[_0x9bfd('0x2c')](_0x3da0fe)[_0x9bfd('0x2d')]();};}function respondWithResult(_0x51dbf0,_0x26278c){_0x26278c=_0x26278c||0xc8;return function(_0x5304a6){if(_0x5304a6){return _0x51dbf0[_0x9bfd('0x2c')](_0x26278c)[_0x9bfd('0x2e')](_0x5304a6);}};}function respondWithFilteredResult(_0x5cb9ab,_0x4391e0){return function(_0x25b7b1){if(_0x25b7b1){var _0x4e64cf=_0x25b7b1[_0x9bfd('0x2f')],_0x560156=_0x4391e0[_0x9bfd('0x30')],_0x352bed=_0x4391e0[_0x9bfd('0x30')]+_0x4391e0[_0x9bfd('0x31')],_0x10c55c;if(_0x352bed>=_0x4e64cf){_0x352bed=_0x4e64cf;_0x10c55c=0xc8;}else{_0x10c55c=0xce;}_0x5cb9ab[_0x9bfd('0x2c')](_0x10c55c);return _0x5cb9ab['set'](_0x9bfd('0x32'),_0x560156+'-'+_0x352bed+'/'+_0x4e64cf)['json'](_0x25b7b1);}return null;};}function patchUpdates(_0x390a9c){return function(_0x2ff4aa){try{jsonpatch['apply'](_0x2ff4aa,_0x390a9c,!![]);}catch(_0x48a255){return BPromise[_0x9bfd('0x33')](_0x48a255);}return _0x2ff4aa[_0x9bfd('0x34')]();};}function saveUpdates(_0x553cbf,_0x2aff04){return function(_0x44b27f){if(_0x44b27f){return _0x44b27f[_0x9bfd('0x35')](_0x553cbf)['then'](function(_0x211cad){return _0x211cad;});}return null;};}function removeEntity(_0x3d6d50,_0x3dac29){return function(_0x5c386e){if(_0x5c386e){return _0x5c386e['destroy']()['then'](function(){_0x3d6d50[_0x9bfd('0x2c')](0xcc)[_0x9bfd('0x2d')]();});}};}function handleEntityNotFound(_0x3cecae,_0x22a73f){return function(_0xc12fdd){if(!_0xc12fdd){_0x3cecae[_0x9bfd('0x2b')](0x194);}return _0xc12fdd;};}function handleError(_0x2f762f,_0x159a33){_0x159a33=_0x159a33||0x1f4;return function(_0x58ba70){logger['error'](_0x58ba70['stack']);if(_0x58ba70[_0x9bfd('0x36')]){delete _0x58ba70['name'];}_0x2f762f[_0x9bfd('0x2c')](_0x159a33)[_0x9bfd('0x37')](_0x58ba70);};}exports[_0x9bfd('0x38')]=function(_0x43313f,_0x2a235d){var _0x20453a={},_0x5b0fb9={},_0x43f140={'count':0x0,'rows':[]};var _0x15dbcf=_['map'](db[_0x9bfd('0x39')][_0x9bfd('0x3a')],function(_0x18d998){return{'name':_0x18d998[_0x9bfd('0x3b')],'type':_0x18d998['type'][_0x9bfd('0x3c')]};});_0x5b0fb9[_0x9bfd('0x3d')]=_[_0x9bfd('0x3e')](_0x15dbcf,'name');_0x5b0fb9['query']=_[_0x9bfd('0x3f')](_0x43313f[_0x9bfd('0x40')]);_0x5b0fb9['filters']=_['intersection'](_0x5b0fb9[_0x9bfd('0x3d')],_0x5b0fb9['query']);_0x20453a[_0x9bfd('0x41')]=_['intersection'](_0x5b0fb9[_0x9bfd('0x3d')],qs[_0x9bfd('0x42')](_0x43313f[_0x9bfd('0x40')][_0x9bfd('0x42')]));_0x20453a['attributes']=_0x20453a[_0x9bfd('0x41')][_0x9bfd('0x43')]?_0x20453a[_0x9bfd('0x41')]:_0x5b0fb9[_0x9bfd('0x3d')];if(!_0x43313f['query'][_0x9bfd('0x44')](_0x9bfd('0x45'))){_0x20453a[_0x9bfd('0x31')]=qs[_0x9bfd('0x31')](_0x43313f[_0x9bfd('0x40')][_0x9bfd('0x31')]);_0x20453a[_0x9bfd('0x30')]=qs['offset'](_0x43313f[_0x9bfd('0x40')]['offset']);}_0x20453a[_0x9bfd('0x46')]=qs[_0x9bfd('0x47')](_0x43313f['query']['sort']);_0x20453a[_0x9bfd('0x48')]=qs['filters'](_[_0x9bfd('0x49')](_0x43313f[_0x9bfd('0x40')],_0x5b0fb9[_0x9bfd('0x4a')]),_0x15dbcf);if(_0x43313f['query'][_0x9bfd('0x4b')]){_0x20453a['where']=_['merge'](_0x20453a[_0x9bfd('0x48')],{'$or':_[_0x9bfd('0x3e')](_0x15dbcf,function(_0x194811){if(_0x194811['type']!==_0x9bfd('0x4c')){var _0x573566={};_0x573566[_0x194811['name']]={'$like':'%'+_0x43313f[_0x9bfd('0x40')][_0x9bfd('0x4b')]+'%'};return _0x573566;}})});}_0x20453a=_[_0x9bfd('0x4d')]({},_0x20453a,_0x43313f[_0x9bfd('0x4e')]);var _0x30f066={'where':_0x20453a[_0x9bfd('0x48')]};return db[_0x9bfd('0x39')]['count'](_0x30f066)[_0x9bfd('0x20')](function(_0x4a9075){_0x43f140['count']=_0x4a9075;if(_0x43313f['query'][_0x9bfd('0x4f')]){_0x20453a[_0x9bfd('0x50')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x9bfd('0x51')](_0x20453a);})[_0x9bfd('0x20')](function(_0x26e846){_0x43f140['rows']=_0x26e846;return _0x43f140;})[_0x9bfd('0x20')](respondWithFilteredResult(_0x2a235d,_0x20453a))['catch'](handleError(_0x2a235d,null));};exports[_0x9bfd('0x52')]=function(_0x220749,_0x689fdc){var _0x1e83d6={'raw':![],'where':{'id':_0x220749[_0x9bfd('0x53')]['id']}},_0x3811e8={};_0x3811e8[_0x9bfd('0x3d')]=_[_0x9bfd('0x3f')](db[_0x9bfd('0x39')]['rawAttributes']);_0x3811e8[_0x9bfd('0x40')]=_[_0x9bfd('0x3f')](_0x220749[_0x9bfd('0x40')]);_0x3811e8[_0x9bfd('0x4a')]=_[_0x9bfd('0x54')](_0x3811e8['model'],_0x3811e8[_0x9bfd('0x40')]);_0x1e83d6[_0x9bfd('0x41')]=_[_0x9bfd('0x54')](_0x3811e8[_0x9bfd('0x3d')],qs[_0x9bfd('0x42')](_0x220749['query'][_0x9bfd('0x42')]));_0x1e83d6[_0x9bfd('0x41')]=_0x1e83d6[_0x9bfd('0x41')]['length']?_0x1e83d6[_0x9bfd('0x41')]:_0x3811e8[_0x9bfd('0x3d')];if(_0x220749[_0x9bfd('0x40')][_0x9bfd('0x4f')]){_0x1e83d6[_0x9bfd('0x50')]=[{'all':!![]}];}_0x1e83d6=_[_0x9bfd('0x4d')]({},_0x1e83d6,_0x220749[_0x9bfd('0x4e')]);return db[_0x9bfd('0x39')]['find'](_0x1e83d6)['then'](handleEntityNotFound(_0x689fdc,null))[_0x9bfd('0x20')](respondWithResult(_0x689fdc,null))[_0x9bfd('0x2a')](handleError(_0x689fdc,null));};exports[_0x9bfd('0x55')]=function(_0x2f69bd,_0xc40b8f){return db[_0x9bfd('0x39')][_0x9bfd('0x55')](_0x2f69bd['body'],{})['then'](respondWithResult(_0xc40b8f,0xc9))[_0x9bfd('0x2a')](handleError(_0xc40b8f,null));};exports['update']=function(_0x3a6fb3,_0x3281be){if(_0x3a6fb3[_0x9bfd('0x56')]['id']){delete _0x3a6fb3[_0x9bfd('0x56')]['id'];}return db[_0x9bfd('0x39')][_0x9bfd('0x57')]({'where':{'id':_0x3a6fb3[_0x9bfd('0x53')]['id']}})[_0x9bfd('0x20')](handleEntityNotFound(_0x3281be,null))[_0x9bfd('0x20')](saveUpdates(_0x3a6fb3[_0x9bfd('0x56')],null))[_0x9bfd('0x20')](respondWithResult(_0x3281be,null))[_0x9bfd('0x2a')](handleError(_0x3281be,null));};exports[_0x9bfd('0x58')]=function(_0x573b52,_0x556b6f){return db['VtigerConfiguration'][_0x9bfd('0x57')]({'where':{'id':_0x573b52[_0x9bfd('0x53')]['id']}})[_0x9bfd('0x20')](handleEntityNotFound(_0x556b6f,null))[_0x9bfd('0x20')](removeEntity(_0x556b6f,null))[_0x9bfd('0x2a')](handleError(_0x556b6f,null));};exports[_0x9bfd('0x59')]=function(_0x52899a,_0x206168,_0x571d07){var _0x21b66d={};var _0x44c71c={};var _0x406f85;var _0x298103;return db[_0x9bfd('0x39')][_0x9bfd('0x5a')]({'where':{'id':_0x52899a[_0x9bfd('0x53')]['id']}})[_0x9bfd('0x20')](handleEntityNotFound(_0x206168,null))['then'](function(_0x4cbbf3){if(_0x4cbbf3){_0x406f85=_0x4cbbf3;_0x44c71c[_0x9bfd('0x3d')]=_['keys'](db['VtigerField'][_0x9bfd('0x3a')]);_0x44c71c['query']=_[_0x9bfd('0x3f')](_0x52899a[_0x9bfd('0x40')]);_0x44c71c[_0x9bfd('0x4a')]=_[_0x9bfd('0x54')](_0x44c71c[_0x9bfd('0x3d')],_0x44c71c['query']);_0x21b66d[_0x9bfd('0x41')]=_['intersection'](_0x44c71c[_0x9bfd('0x3d')],qs[_0x9bfd('0x42')](_0x52899a[_0x9bfd('0x40')][_0x9bfd('0x42')]));_0x21b66d[_0x9bfd('0x41')]=_0x21b66d['attributes'][_0x9bfd('0x43')]?_0x21b66d[_0x9bfd('0x41')]:_0x44c71c[_0x9bfd('0x3d')];_0x21b66d[_0x9bfd('0x46')]=qs[_0x9bfd('0x47')](_0x52899a[_0x9bfd('0x40')][_0x9bfd('0x47')]);_0x21b66d[_0x9bfd('0x48')]=qs['filters'](_[_0x9bfd('0x49')](_0x52899a[_0x9bfd('0x40')],_0x44c71c[_0x9bfd('0x4a')]));if(_0x52899a[_0x9bfd('0x40')][_0x9bfd('0x4b')]){_0x21b66d[_0x9bfd('0x48')]=_[_0x9bfd('0x4d')](_0x21b66d[_0x9bfd('0x48')],{'$or':_[_0x9bfd('0x3e')](_0x21b66d['attributes'],function(_0x13bb1f){var _0x2b8dc0={};_0x2b8dc0[_0x13bb1f]={'$like':'%'+_0x52899a['query'][_0x9bfd('0x4b')]+'%'};return _0x2b8dc0;})});}_0x21b66d=_[_0x9bfd('0x4d')]({},_0x21b66d,_0x52899a[_0x9bfd('0x4e')]);return _0x406f85[_0x9bfd('0x59')](_0x21b66d);}})[_0x9bfd('0x20')](function(_0x539cbd){if(_0x539cbd){_0x298103=_0x539cbd[_0x9bfd('0x43')];if(!_0x52899a[_0x9bfd('0x40')]['hasOwnProperty'](_0x9bfd('0x45'))){_0x21b66d['limit']=qs[_0x9bfd('0x31')](_0x52899a[_0x9bfd('0x40')]['limit']);_0x21b66d[_0x9bfd('0x30')]=qs['offset'](_0x52899a['query'][_0x9bfd('0x30')]);}return _0x406f85[_0x9bfd('0x59')](_0x21b66d);}})[_0x9bfd('0x20')](function(_0x498062){if(_0x498062){return _0x498062?{'count':_0x298103,'rows':_0x498062}:null;}})[_0x9bfd('0x20')](respondWithResult(_0x206168,null))['catch'](handleError(_0x206168,null));};exports['getSubjects']=function(_0x152b8f,_0x3d82e7,_0x20a36e){var _0x292ca2={};var _0x37b4af={};var _0x19b887;var _0x5dcfce;return db[_0x9bfd('0x39')][_0x9bfd('0x5a')]({'where':{'id':_0x152b8f[_0x9bfd('0x53')]['id']}})[_0x9bfd('0x20')](handleEntityNotFound(_0x3d82e7,null))[_0x9bfd('0x20')](function(_0x363d62){if(_0x363d62){_0x19b887=_0x363d62;_0x37b4af[_0x9bfd('0x3d')]=_[_0x9bfd('0x3f')](db[_0x9bfd('0x5b')]['rawAttributes']);_0x37b4af['query']=_[_0x9bfd('0x3f')](_0x152b8f[_0x9bfd('0x40')]);_0x37b4af[_0x9bfd('0x4a')]=_[_0x9bfd('0x54')](_0x37b4af[_0x9bfd('0x3d')],_0x37b4af['query']);_0x292ca2['attributes']=_[_0x9bfd('0x54')](_0x37b4af[_0x9bfd('0x3d')],qs[_0x9bfd('0x42')](_0x152b8f[_0x9bfd('0x40')][_0x9bfd('0x42')]));_0x292ca2[_0x9bfd('0x41')]=_0x292ca2[_0x9bfd('0x41')]['length']?_0x292ca2[_0x9bfd('0x41')]:_0x37b4af[_0x9bfd('0x3d')];_0x292ca2[_0x9bfd('0x46')]=qs[_0x9bfd('0x47')](_0x152b8f[_0x9bfd('0x40')][_0x9bfd('0x47')]);_0x292ca2['where']=qs['filters'](_[_0x9bfd('0x49')](_0x152b8f[_0x9bfd('0x40')],_0x37b4af[_0x9bfd('0x4a')]));if(_0x152b8f[_0x9bfd('0x40')][_0x9bfd('0x4b')]){_0x292ca2[_0x9bfd('0x48')]=_[_0x9bfd('0x4d')](_0x292ca2[_0x9bfd('0x48')],{'$or':_[_0x9bfd('0x3e')](_0x292ca2[_0x9bfd('0x41')],function(_0x50116d){var _0x1e7a63={};_0x1e7a63[_0x50116d]={'$like':'%'+_0x152b8f[_0x9bfd('0x40')]['filter']+'%'};return _0x1e7a63;})});}_0x292ca2=_[_0x9bfd('0x4d')]({},_0x292ca2,_0x152b8f['options']);return _0x19b887[_0x9bfd('0x5c')](_0x292ca2);}})['then'](function(_0x1d5519){if(_0x1d5519){_0x5dcfce=_0x1d5519[_0x9bfd('0x43')];if(!_0x152b8f[_0x9bfd('0x40')][_0x9bfd('0x44')](_0x9bfd('0x45'))){_0x292ca2[_0x9bfd('0x31')]=qs['limit'](_0x152b8f[_0x9bfd('0x40')][_0x9bfd('0x31')]);_0x292ca2['offset']=qs[_0x9bfd('0x30')](_0x152b8f[_0x9bfd('0x40')][_0x9bfd('0x30')]);}return _0x19b887['getSubjects'](_0x292ca2);}})[_0x9bfd('0x20')](function(_0x29291f){if(_0x29291f){return _0x29291f?{'count':_0x5dcfce,'rows':_0x29291f}:null;}})['then'](respondWithResult(_0x3d82e7,null))[_0x9bfd('0x2a')](handleError(_0x3d82e7,null));};exports['getDescriptions']=function(_0x285557,_0x40319f,_0x45bc69){var _0xe5c4bf={};var _0x4e66cb={};var _0xa34dca;var _0x5104f0;return db['VtigerConfiguration'][_0x9bfd('0x5a')]({'where':{'id':_0x285557['params']['id']}})[_0x9bfd('0x20')](handleEntityNotFound(_0x40319f,null))[_0x9bfd('0x20')](function(_0x148857){if(_0x148857){_0xa34dca=_0x148857;_0x4e66cb[_0x9bfd('0x3d')]=_['keys'](db[_0x9bfd('0x5b')]['rawAttributes']);_0x4e66cb[_0x9bfd('0x40')]=_[_0x9bfd('0x3f')](_0x285557[_0x9bfd('0x40')]);_0x4e66cb[_0x9bfd('0x4a')]=_[_0x9bfd('0x54')](_0x4e66cb['model'],_0x4e66cb['query']);_0xe5c4bf[_0x9bfd('0x41')]=_[_0x9bfd('0x54')](_0x4e66cb[_0x9bfd('0x3d')],qs['fields'](_0x285557[_0x9bfd('0x40')][_0x9bfd('0x42')]));_0xe5c4bf['attributes']=_0xe5c4bf['attributes'][_0x9bfd('0x43')]?_0xe5c4bf[_0x9bfd('0x41')]:_0x4e66cb[_0x9bfd('0x3d')];_0xe5c4bf[_0x9bfd('0x46')]=qs[_0x9bfd('0x47')](_0x285557[_0x9bfd('0x40')][_0x9bfd('0x47')]);_0xe5c4bf[_0x9bfd('0x48')]=qs[_0x9bfd('0x4a')](_['pick'](_0x285557[_0x9bfd('0x40')],_0x4e66cb[_0x9bfd('0x4a')]));if(_0x285557['query']['filter']){_0xe5c4bf['where']=_[_0x9bfd('0x4d')](_0xe5c4bf[_0x9bfd('0x48')],{'$or':_[_0x9bfd('0x3e')](_0xe5c4bf['attributes'],function(_0x3ac220){var _0x51add1={};_0x51add1[_0x3ac220]={'$like':'%'+_0x285557['query'][_0x9bfd('0x4b')]+'%'};return _0x51add1;})});}_0xe5c4bf=_[_0x9bfd('0x4d')]({},_0xe5c4bf,_0x285557[_0x9bfd('0x4e')]);return _0xa34dca[_0x9bfd('0x5d')](_0xe5c4bf);}})[_0x9bfd('0x20')](function(_0x42ad7b){if(_0x42ad7b){_0x5104f0=_0x42ad7b[_0x9bfd('0x43')];if(!_0x285557[_0x9bfd('0x40')][_0x9bfd('0x44')]('nolimit')){_0xe5c4bf[_0x9bfd('0x31')]=qs[_0x9bfd('0x31')](_0x285557['query'][_0x9bfd('0x31')]);_0xe5c4bf[_0x9bfd('0x30')]=qs['offset'](_0x285557[_0x9bfd('0x40')]['offset']);}return _0xa34dca['getDescriptions'](_0xe5c4bf);}})['then'](function(_0x2b51f6){if(_0x2b51f6){return _0x2b51f6?{'count':_0x5104f0,'rows':_0x2b51f6}:null;}})[_0x9bfd('0x20')](respondWithResult(_0x40319f,null))[_0x9bfd('0x2a')](handleError(_0x40319f,null));};