Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / intDeskAccount / intDeskAccount.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 _0xfbfb=['request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','DeskConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','remoteUri','password','consumerSecret','token','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','username','toString','base64','_embedded','entries','active','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0xfbfb,0x178));var _0xbfbf=function(_0x6fbb97,_0x5aec63){_0x6fbb97=_0x6fbb97-0x0;var _0x46e3ae=_0xfbfb[_0x6fbb97];return _0x46e3ae;};'use strict';var pdf=require(_0xbfbf('0x0'));var emlformat=require(_0xbfbf('0x1'));var rimraf=require(_0xbfbf('0x2'));var zipdir=require(_0xbfbf('0x3'));var jsonpatch=require(_0xbfbf('0x4'));var rp=require(_0xbfbf('0x5'));var moment=require(_0xbfbf('0x6'));var BPromise=require(_0xbfbf('0x7'));var Mustache=require(_0xbfbf('0x8'));var util=require(_0xbfbf('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xbfbf('0xa'));var ejs=require(_0xbfbf('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbfbf('0xc'));var crypto=require(_0xbfbf('0xd'));var jsforce=require(_0xbfbf('0xe'));var deskjs=require(_0xbfbf('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbfbf('0x10'));var Papa=require(_0xbfbf('0x11'));var Redis=require(_0xbfbf('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbfbf('0x13'));var hardwareService=require(_0xbfbf('0x14'));var logger=require(_0xbfbf('0x15'))('api');var utils=require(_0xbfbf('0x16'));var config=require('../../config/environment');var db=require(_0xbfbf('0x17'))['db'];var integrations=require(_0xbfbf('0x18'));var jayson=require(_0xbfbf('0x19'));var client=jayson[_0xbfbf('0x1a')][_0xbfbf('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2ace52,_0x527017,_0x166735){if(_0x166735){var _0x4145d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4145d8['test'](_0x527017)){return _0x2ace52;}else{throw new db[(_0xbfbf('0x1c'))][(_0xbfbf('0x1d'))](_0xbfbf('0x1e'));}}else{return _0x2ace52;}}function respondWithRpcPromise(_0xd125c9,_0x504cab,_0x10be2a,_0xbae188){return new BPromise(function(_0x38dbb9,_0x4f2f4c){var _0xa01b3e=_0xbae188||client;return _0xa01b3e['request'](_0xd125c9,_0x10be2a)['then'](function(_0x51ffad){logger[_0xbfbf('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x504cab,_0xbfbf('0x20'));logger[_0xbfbf('0x21')](_0xbfbf('0x22'),_0x504cab,_0xbfbf('0x20'),JSON[_0xbfbf('0x23')](_0x51ffad));if(_0x51ffad['error']){if(_0x51ffad[_0xbfbf('0x24')][_0xbfbf('0x25')]===0x1f4){logger[_0xbfbf('0x24')](_0xbfbf('0x26'),_0x504cab,_0x51ffad['error'][_0xbfbf('0x27')]);return _0x4f2f4c(_0x51ffad[_0xbfbf('0x24')][_0xbfbf('0x27')]);}logger['error'](_0xbfbf('0x26'),_0x504cab,_0x51ffad[_0xbfbf('0x24')][_0xbfbf('0x27')]);return _0x38dbb9(_0x51ffad[_0xbfbf('0x24')][_0xbfbf('0x27')]);}else{logger[_0xbfbf('0x1f')]('DeskAccount,\x20%s,\x20%s',_0x504cab,_0xbfbf('0x20'));_0x38dbb9(_0x51ffad[_0xbfbf('0x28')][_0xbfbf('0x27')]);}})[_0xbfbf('0x29')](function(_0x1ee82d){logger[_0xbfbf('0x24')](_0xbfbf('0x26'),_0x504cab,_0x1ee82d);_0x4f2f4c(_0x1ee82d);});});}function respondWithStatusCode(_0x45868e,_0x35a930){_0x35a930=_0x35a930||0xcc;return function(_0xc8f6a1){if(_0xc8f6a1){return _0x45868e[_0xbfbf('0x2a')](_0x35a930);}return _0x45868e[_0xbfbf('0x2b')](_0x35a930)['end']();};}function respondWithResult(_0x138a48,_0xa62e6){_0xa62e6=_0xa62e6||0xc8;return function(_0x245fb0){if(_0x245fb0){return _0x138a48[_0xbfbf('0x2b')](_0xa62e6)[_0xbfbf('0x2c')](_0x245fb0);}};}function respondWithFilteredResult(_0x10717e,_0x583069){return function(_0x51d026){if(_0x51d026){var _0x22b12d=_0x51d026[_0xbfbf('0x2d')],_0x25ae0f=_0x583069['offset'],_0x2dbdc6=_0x583069[_0xbfbf('0x2e')]+_0x583069[_0xbfbf('0x2f')],_0x185b0f;if(_0x2dbdc6>=_0x22b12d){_0x2dbdc6=_0x22b12d;_0x185b0f=0xc8;}else{_0x185b0f=0xce;}_0x10717e[_0xbfbf('0x2b')](_0x185b0f);return _0x10717e[_0xbfbf('0x30')](_0xbfbf('0x31'),_0x25ae0f+'-'+_0x2dbdc6+'/'+_0x22b12d)[_0xbfbf('0x2c')](_0x51d026);}return null;};}function patchUpdates(_0x5a223f){return function(_0x100d41){try{jsonpatch[_0xbfbf('0x32')](_0x100d41,_0x5a223f,!![]);}catch(_0x3a2ed1){return BPromise[_0xbfbf('0x33')](_0x3a2ed1);}return _0x100d41[_0xbfbf('0x34')]();};}function saveUpdates(_0x1582b6,_0x1a99c7){return function(_0x4bf374){if(_0x4bf374){return _0x4bf374[_0xbfbf('0x35')](_0x1582b6)['then'](function(_0x53e67f){return _0x53e67f;});}return null;};}function removeEntity(_0xfa6130,_0x533304){return function(_0x3b2d46){if(_0x3b2d46){return _0x3b2d46['destroy']()[_0xbfbf('0x36')](function(){_0xfa6130[_0xbfbf('0x2b')](0xcc)[_0xbfbf('0x37')]();});}};}function handleEntityNotFound(_0x13260e,_0x39173c){return function(_0x4e6766){if(!_0x4e6766){_0x13260e[_0xbfbf('0x2a')](0x194);}return _0x4e6766;};}function handleError(_0x2ad502,_0xc67164){_0xc67164=_0xc67164||0x1f4;return function(_0x1d075a){logger['error'](_0x1d075a['stack']);if(_0x1d075a[_0xbfbf('0x38')]){delete _0x1d075a['name'];}_0x2ad502['status'](_0xc67164)['send'](_0x1d075a);};}exports[_0xbfbf('0x39')]=function(_0x582b3c,_0x295d36){var _0x4b8f34={},_0x255b2c={},_0x31888a={'count':0x0,'rows':[]};var _0x30eda5=_[_0xbfbf('0x3a')](db[_0xbfbf('0x3b')][_0xbfbf('0x3c')],function(_0x3d0134){return{'name':_0x3d0134[_0xbfbf('0x3d')],'type':_0x3d0134[_0xbfbf('0x3e')][_0xbfbf('0x3f')]};});_0x255b2c[_0xbfbf('0x40')]=_[_0xbfbf('0x3a')](_0x30eda5,_0xbfbf('0x38'));_0x255b2c[_0xbfbf('0x41')]=_[_0xbfbf('0x42')](_0x582b3c[_0xbfbf('0x41')]);_0x255b2c[_0xbfbf('0x43')]=_[_0xbfbf('0x44')](_0x255b2c[_0xbfbf('0x40')],_0x255b2c[_0xbfbf('0x41')]);_0x4b8f34[_0xbfbf('0x45')]=_[_0xbfbf('0x44')](_0x255b2c[_0xbfbf('0x40')],qs[_0xbfbf('0x46')](_0x582b3c[_0xbfbf('0x41')][_0xbfbf('0x46')]));_0x4b8f34[_0xbfbf('0x45')]=_0x4b8f34[_0xbfbf('0x45')][_0xbfbf('0x47')]?_0x4b8f34[_0xbfbf('0x45')]:_0x255b2c['model'];if(!_0x582b3c[_0xbfbf('0x41')]['hasOwnProperty']('nolimit')){_0x4b8f34['limit']=qs[_0xbfbf('0x2f')](_0x582b3c[_0xbfbf('0x41')][_0xbfbf('0x2f')]);_0x4b8f34[_0xbfbf('0x2e')]=qs[_0xbfbf('0x2e')](_0x582b3c['query'][_0xbfbf('0x2e')]);}_0x4b8f34[_0xbfbf('0x48')]=qs['sort'](_0x582b3c['query'][_0xbfbf('0x49')]);_0x4b8f34[_0xbfbf('0x4a')]=qs[_0xbfbf('0x43')](_[_0xbfbf('0x4b')](_0x582b3c[_0xbfbf('0x41')],_0x255b2c[_0xbfbf('0x43')]),_0x30eda5);if(_0x582b3c[_0xbfbf('0x41')][_0xbfbf('0x4c')]){_0x4b8f34['where']=_[_0xbfbf('0x4d')](_0x4b8f34['where'],{'$or':_[_0xbfbf('0x3a')](_0x30eda5,function(_0x1e6144){if(_0x1e6144[_0xbfbf('0x3e')]!=='VIRTUAL'){var _0x2f5fcf={};_0x2f5fcf[_0x1e6144[_0xbfbf('0x38')]]={'$like':'%'+_0x582b3c[_0xbfbf('0x41')][_0xbfbf('0x4c')]+'%'};return _0x2f5fcf;}})});}_0x4b8f34=_[_0xbfbf('0x4d')]({},_0x4b8f34,_0x582b3c[_0xbfbf('0x4e')]);var _0x108390={'where':_0x4b8f34[_0xbfbf('0x4a')]};return db[_0xbfbf('0x3b')][_0xbfbf('0x2d')](_0x108390)[_0xbfbf('0x36')](function(_0xf90c8a){_0x31888a[_0xbfbf('0x2d')]=_0xf90c8a;if(_0x582b3c['query'][_0xbfbf('0x4f')]){_0x4b8f34['include']=[{'all':!![]}];}return db['DeskAccount'][_0xbfbf('0x50')](_0x4b8f34);})[_0xbfbf('0x36')](function(_0x36bda6){_0x31888a[_0xbfbf('0x51')]=_0x36bda6;return _0x31888a;})[_0xbfbf('0x36')](respondWithFilteredResult(_0x295d36,_0x4b8f34))[_0xbfbf('0x29')](handleError(_0x295d36,null));};exports[_0xbfbf('0x52')]=function(_0x2e483c,_0x513ca6){var _0x822b9b={'raw':![],'where':{'id':_0x2e483c[_0xbfbf('0x53')]['id']}},_0x165084={};_0x165084[_0xbfbf('0x40')]=_['keys'](db[_0xbfbf('0x3b')]['rawAttributes']);_0x165084['query']=_[_0xbfbf('0x42')](_0x2e483c[_0xbfbf('0x41')]);_0x165084[_0xbfbf('0x43')]=_[_0xbfbf('0x44')](_0x165084[_0xbfbf('0x40')],_0x165084[_0xbfbf('0x41')]);_0x822b9b['attributes']=_[_0xbfbf('0x44')](_0x165084[_0xbfbf('0x40')],qs[_0xbfbf('0x46')](_0x2e483c['query'][_0xbfbf('0x46')]));_0x822b9b[_0xbfbf('0x45')]=_0x822b9b[_0xbfbf('0x45')][_0xbfbf('0x47')]?_0x822b9b[_0xbfbf('0x45')]:_0x165084[_0xbfbf('0x40')];if(_0x2e483c[_0xbfbf('0x41')][_0xbfbf('0x4f')]){_0x822b9b[_0xbfbf('0x54')]=[{'all':!![]}];}_0x822b9b=_[_0xbfbf('0x4d')]({},_0x822b9b,_0x2e483c[_0xbfbf('0x4e')]);return db[_0xbfbf('0x3b')][_0xbfbf('0x55')](_0x822b9b)[_0xbfbf('0x36')](handleEntityNotFound(_0x513ca6,null))['then'](respondWithResult(_0x513ca6,null))[_0xbfbf('0x29')](handleError(_0x513ca6,null));};exports[_0xbfbf('0x56')]=function(_0x4741b1,_0x581d8b){return db[_0xbfbf('0x3b')]['create'](_0x4741b1['body'],{})[_0xbfbf('0x36')](respondWithResult(_0x581d8b,0xc9))[_0xbfbf('0x29')](handleError(_0x581d8b,null));};exports[_0xbfbf('0x35')]=function(_0x35a2f2,_0x42ed4d){if(_0x35a2f2[_0xbfbf('0x57')]['id']){delete _0x35a2f2[_0xbfbf('0x57')]['id'];}return db[_0xbfbf('0x3b')]['find']({'where':{'id':_0x35a2f2[_0xbfbf('0x53')]['id']}})[_0xbfbf('0x36')](handleEntityNotFound(_0x42ed4d,null))['then'](saveUpdates(_0x35a2f2[_0xbfbf('0x57')],null))[_0xbfbf('0x36')](respondWithResult(_0x42ed4d,null))[_0xbfbf('0x29')](handleError(_0x42ed4d,null));};exports['destroy']=function(_0xc38079,_0x16ba3b){return db[_0xbfbf('0x3b')][_0xbfbf('0x55')]({'where':{'id':_0xc38079[_0xbfbf('0x53')]['id']}})['then'](handleEntityNotFound(_0x16ba3b,null))[_0xbfbf('0x36')](removeEntity(_0x16ba3b,null))[_0xbfbf('0x29')](handleError(_0x16ba3b,null));};exports['getConfigurations']=function(_0x4406a9,_0x1ec33f,_0x26fb75){var _0x580a39={};var _0x4708b3={};var _0x4531bb;var _0x48022c;return db[_0xbfbf('0x3b')]['findOne']({'where':{'id':_0x4406a9[_0xbfbf('0x53')]['id']}})[_0xbfbf('0x36')](handleEntityNotFound(_0x1ec33f,null))['then'](function(_0x3b0fc1){if(_0x3b0fc1){_0x4531bb=_0x3b0fc1;_0x4708b3['model']=_[_0xbfbf('0x42')](db[_0xbfbf('0x58')][_0xbfbf('0x3c')]);_0x4708b3['query']=_[_0xbfbf('0x42')](_0x4406a9[_0xbfbf('0x41')]);_0x4708b3[_0xbfbf('0x43')]=_['intersection'](_0x4708b3['model'],_0x4708b3['query']);_0x580a39[_0xbfbf('0x45')]=_[_0xbfbf('0x44')](_0x4708b3[_0xbfbf('0x40')],qs[_0xbfbf('0x46')](_0x4406a9[_0xbfbf('0x41')][_0xbfbf('0x46')]));_0x580a39[_0xbfbf('0x45')]=_0x580a39[_0xbfbf('0x45')][_0xbfbf('0x47')]?_0x580a39[_0xbfbf('0x45')]:_0x4708b3['model'];_0x580a39[_0xbfbf('0x48')]=qs['sort'](_0x4406a9[_0xbfbf('0x41')][_0xbfbf('0x49')]);_0x580a39[_0xbfbf('0x4a')]=qs[_0xbfbf('0x43')](_[_0xbfbf('0x4b')](_0x4406a9[_0xbfbf('0x41')],_0x4708b3[_0xbfbf('0x43')]));if(_0x4406a9[_0xbfbf('0x41')][_0xbfbf('0x4c')]){_0x580a39['where']=_[_0xbfbf('0x4d')](_0x580a39[_0xbfbf('0x4a')],{'$or':_[_0xbfbf('0x3a')](_0x580a39[_0xbfbf('0x45')],function(_0x36116d){var _0x495a98={};_0x495a98[_0x36116d]={'$like':'%'+_0x4406a9[_0xbfbf('0x41')][_0xbfbf('0x4c')]+'%'};return _0x495a98;})});}_0x580a39=_[_0xbfbf('0x4d')]({},_0x580a39,_0x4406a9[_0xbfbf('0x4e')]);return _0x4531bb['getConfigurations'](_0x580a39);}})['then'](function(_0x25bb27){if(_0x25bb27){_0x48022c=_0x25bb27[_0xbfbf('0x47')];if(!_0x4406a9[_0xbfbf('0x41')]['hasOwnProperty']('nolimit')){_0x580a39[_0xbfbf('0x2f')]=qs[_0xbfbf('0x2f')](_0x4406a9[_0xbfbf('0x41')][_0xbfbf('0x2f')]);_0x580a39[_0xbfbf('0x2e')]=qs['offset'](_0x4406a9[_0xbfbf('0x41')]['offset']);}return _0x4531bb[_0xbfbf('0x59')](_0x580a39);}})[_0xbfbf('0x36')](function(_0x5cbe00){if(_0x5cbe00){return _0x5cbe00?{'count':_0x48022c,'rows':_0x5cbe00}:null;}})[_0xbfbf('0x36')](respondWithResult(_0x1ec33f,null))[_0xbfbf('0x29')](handleError(_0x1ec33f,null));};exports[_0xbfbf('0x5a')]=function(_0x589f1d,_0x4ed0ee,_0x135f02){if(_0x589f1d['body']['id']){delete _0x589f1d['body']['id'];}return db[_0xbfbf('0x3b')][_0xbfbf('0x5b')]({'where':{'id':_0x589f1d['params']['id']}})[_0xbfbf('0x36')](handleEntityNotFound(_0x4ed0ee,null))[_0xbfbf('0x36')](function(_0x1b7425){if(_0x1b7425){_0x589f1d['body'][_0xbfbf('0x5c')]=_0x1b7425['id'];_0x589f1d[_0xbfbf('0x57')][_0xbfbf('0x5d')]=integrations[_0xbfbf('0x5e')](_0x589f1d['body']['channel'],_0x589f1d[_0xbfbf('0x57')][_0xbfbf('0x3e')]);_0x589f1d[_0xbfbf('0x57')][_0xbfbf('0x5f')]=integrations['getDescriptions'](_0x589f1d['body'][_0xbfbf('0x60')],_0x589f1d[_0xbfbf('0x57')][_0xbfbf('0x3e')]);return db[_0xbfbf('0x58')][_0xbfbf('0x56')](_0x589f1d[_0xbfbf('0x57')],{'include':[{'model':db[_0xbfbf('0x61')],'as':_0xbfbf('0x5d')},{'model':db[_0xbfbf('0x61')],'as':_0xbfbf('0x5f')}]});}return null;})[_0xbfbf('0x36')](respondWithResult(_0x4ed0ee,null))[_0xbfbf('0x29')](handleError(_0x4ed0ee,null));};exports[_0xbfbf('0x62')]=function(_0x135e61,_0x57e200,_0x1d4b12){var _0x5222ed=[{'name':'priority','label':_0xbfbf('0x63'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x437896='';return db[_0xbfbf('0x3b')]['findOne']({'where':{'id':_0x135e61[_0xbfbf('0x53')]['id']},'attributes':['id',_0xbfbf('0x64'),'authType','username',_0xbfbf('0x65'),'consumerKey',_0xbfbf('0x66'),_0xbfbf('0x67'),'tokenSecret']})[_0xbfbf('0x36')](handleEntityNotFound(_0x57e200,null))[_0xbfbf('0x36')](function(_0x507a44){if(_0x507a44){_0x437896=_0x507a44['remoteUri'];var _0x48f8ad=_0x437896['slice'](-0x1);if(_0x48f8ad==='/'){_0x437896=_0x437896[_0xbfbf('0x68')](0x0,_0x437896[_0xbfbf('0x69')](_0x48f8ad));}var _0x1b1fc6={'method':_0xbfbf('0x6a'),'uri':util[_0xbfbf('0x6b')](_0xbfbf('0x6c'),_0x437896),'headers':{'Content-Type':_0xbfbf('0x6d'),'Accept':_0xbfbf('0x6d')},'json':!![]};if(_0x507a44[_0xbfbf('0x6e')]===_0xbfbf('0x6f')){_0x1b1fc6[_0xbfbf('0x70')][_0xbfbf('0x71')]=util[_0xbfbf('0x6b')](_0xbfbf('0x72'),new Buffer(util[_0xbfbf('0x6b')](_0xbfbf('0x73'),_0x507a44[_0xbfbf('0x74')],_0x507a44['password']))[_0xbfbf('0x75')](_0xbfbf('0x76')));}return rp(_0x1b1fc6)[_0xbfbf('0x36')](function(_0x5f56a5){return _0x5222ed['concat'](_[_0xbfbf('0x3a')](_0x5f56a5[_0xbfbf('0x77')][_0xbfbf('0x78')],function(_0x31d8d7){return{'id':_0x31d8d7['name'],'name':_0x31d8d7[_0xbfbf('0x38')],'type':_0x31d8d7[_0xbfbf('0x3e')],'active':_0x31d8d7[_0xbfbf('0x79')],'label':_0x31d8d7['label'],'custom':!![]};}));});}})[_0xbfbf('0x36')](function(_0x50c9bf){return{'count':_0x50c9bf[_0xbfbf('0x47')],'rows':_0x50c9bf};})[_0xbfbf('0x36')](respondWithResult(_0x57e200,null))[_0xbfbf('0x29')](function(_0x1c135c){var _0x511177=_0x135e61['query']['test']?0x1f4:_0x1c135c[_0xbfbf('0x7a')]||0x1f4;logger['error'](_0xbfbf('0x7b'),_0xbfbf('0x62'),_0x511177,JSON[_0xbfbf('0x23')](_0x1c135c));delete _0x1c135c[_0xbfbf('0x38')];if(_0x511177===0x191){_0x511177=0x190;}_0x57e200[_0xbfbf('0x2b')](_0x511177)[_0xbfbf('0x7c')](_0x135e61[_0xbfbf('0x41')][_0xbfbf('0x7d')]?{'message':_0xbfbf('0x7e'),'statusCode':_0x1c135c[_0xbfbf('0x7a')]}:_0x1c135c);});};