Built motion from commit c738b9ac.|2.6.25
[motion2.git] / server / api / intZendeskConfiguration / intZendeskConfiguration.controller.js
index 6f3cef1..7ff2558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8806=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','findAll','rows','catch','keys','includeAll','include','find','create','body','update','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf'];(function(_0x44b827,_0x1bb1aa){var _0x527342=function(_0x481338){while(--_0x481338){_0x44b827['push'](_0x44b827['shift']());}};_0x527342(++_0x1bb1aa);}(_0x8806,0x1ad));var _0x6880=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x8806[_0x616290];return _0x453879;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6880('0x0'));var zipdir=require(_0x6880('0x1'));var jsonpatch=require(_0x6880('0x2'));var rp=require(_0x6880('0x3'));var moment=require('moment');var BPromise=require(_0x6880('0x4'));var Mustache=require('mustache');var util=require(_0x6880('0x5'));var path=require(_0x6880('0x6'));var sox=require(_0x6880('0x7'));var csv=require(_0x6880('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6880('0x9'));var _=require(_0x6880('0xa'));var squel=require(_0x6880('0xb'));var crypto=require(_0x6880('0xc'));var jsforce=require(_0x6880('0xd'));var deskjs=require(_0x6880('0xe'));var toCsv=require(_0x6880('0x8'));var querystring=require(_0x6880('0xf'));var Papa=require(_0x6880('0x10'));var Redis=require(_0x6880('0x11'));var authService=require(_0x6880('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6880('0x13'));var logger=require(_0x6880('0x14'))(_0x6880('0x15'));var utils=require(_0x6880('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6880('0x17'));var db=require(_0x6880('0x18'))['db'];function respondWithStatusCode(_0x70f953,_0x582908){_0x582908=_0x582908||0xcc;return function(_0x1a54df){if(_0x1a54df){return _0x70f953[_0x6880('0x19')](_0x582908);}return _0x70f953[_0x6880('0x1a')](_0x582908)[_0x6880('0x1b')]();};}function respondWithResult(_0x53b088,_0x14eca7){_0x14eca7=_0x14eca7||0xc8;return function(_0x48ed06){if(_0x48ed06){return _0x53b088[_0x6880('0x1a')](_0x14eca7)[_0x6880('0x1c')](_0x48ed06);}};}function respondWithFilteredResult(_0x1af544,_0x194314){return function(_0xb9d792){if(_0xb9d792){var _0x2b6fee=typeof _0x194314[_0x6880('0x1d')]===_0x6880('0x1e')&&typeof _0x194314[_0x6880('0x1f')]===_0x6880('0x1e');var _0x857118=_0xb9d792[_0x6880('0x20')];var _0x5cfd07=_0x2b6fee?0x0:_0x194314[_0x6880('0x1d')];var _0x47d64a=_0x2b6fee?_0xb9d792['count']:_0x194314[_0x6880('0x1d')]+_0x194314['limit'];var _0x456bc5;if(_0x47d64a>=_0x857118){_0x47d64a=_0x857118;_0x456bc5=0xc8;}else{_0x456bc5=0xce;}_0x1af544['status'](_0x456bc5);return _0x1af544[_0x6880('0x21')](_0x6880('0x22'),_0x5cfd07+'-'+_0x47d64a+'/'+_0x857118)[_0x6880('0x1c')](_0xb9d792);}return null;};}function patchUpdates(_0x225c57){return function(_0x29ba9b){try{jsonpatch[_0x6880('0x23')](_0x29ba9b,_0x225c57,!![]);}catch(_0x4e6bf8){return BPromise[_0x6880('0x24')](_0x4e6bf8);}return _0x29ba9b['save']();};}function saveUpdates(_0x83a67d,_0x1584b1){return function(_0x7c58ac){if(_0x7c58ac){return _0x7c58ac['update'](_0x83a67d)['then'](function(_0x2119e4){return _0x2119e4;});}return null;};}function removeEntity(_0x103c5b,_0x2f7724){return function(_0x282e3e){if(_0x282e3e){return _0x282e3e[_0x6880('0x25')]()[_0x6880('0x26')](function(){_0x103c5b['status'](0xcc)[_0x6880('0x1b')]();});}};}function handleEntityNotFound(_0x461293,_0x38dc59){return function(_0xc19178){if(!_0xc19178){_0x461293[_0x6880('0x19')](0x194);}return _0xc19178;};}function handleError(_0x380f0c,_0x599adb){_0x599adb=_0x599adb||0x1f4;return function(_0x59db7c){logger[_0x6880('0x27')](_0x59db7c[_0x6880('0x28')]);if(_0x59db7c[_0x6880('0x29')]){delete _0x59db7c[_0x6880('0x29')];}_0x380f0c[_0x6880('0x1a')](_0x599adb)[_0x6880('0x2a')](_0x59db7c);};}exports[_0x6880('0x2b')]=function(_0x3cf5d6,_0x1789e3){var _0x228cc5={},_0x126357={},_0x1b53e0={'count':0x0,'rows':[]};var _0x5b6632=_[_0x6880('0x2c')](db[_0x6880('0x2d')][_0x6880('0x2e')],function(_0x4efe1f){return{'name':_0x4efe1f[_0x6880('0x2f')],'type':_0x4efe1f['type'][_0x6880('0x30')]};});_0x126357[_0x6880('0x31')]=_[_0x6880('0x2c')](_0x5b6632,_0x6880('0x29'));_0x126357[_0x6880('0x32')]=_['keys'](_0x3cf5d6[_0x6880('0x32')]);_0x126357[_0x6880('0x33')]=_[_0x6880('0x34')](_0x126357[_0x6880('0x31')],_0x126357['query']);_0x228cc5[_0x6880('0x35')]=_[_0x6880('0x34')](_0x126357[_0x6880('0x31')],qs[_0x6880('0x36')](_0x3cf5d6['query'][_0x6880('0x36')]));_0x228cc5['attributes']=_0x228cc5[_0x6880('0x35')][_0x6880('0x37')]?_0x228cc5[_0x6880('0x35')]:_0x126357[_0x6880('0x31')];if(!_0x3cf5d6['query'][_0x6880('0x38')](_0x6880('0x39'))){_0x228cc5[_0x6880('0x1f')]=qs[_0x6880('0x1f')](_0x3cf5d6[_0x6880('0x32')]['limit']);_0x228cc5[_0x6880('0x1d')]=qs[_0x6880('0x1d')](_0x3cf5d6[_0x6880('0x32')][_0x6880('0x1d')]);}_0x228cc5[_0x6880('0x3a')]=qs[_0x6880('0x3b')](_0x3cf5d6[_0x6880('0x32')][_0x6880('0x3b')]);_0x228cc5[_0x6880('0x3c')]=qs[_0x6880('0x33')](_[_0x6880('0x3d')](_0x3cf5d6[_0x6880('0x32')],_0x126357[_0x6880('0x33')]),_0x5b6632);if(_0x3cf5d6[_0x6880('0x32')]['filter']){_0x228cc5[_0x6880('0x3c')]=_[_0x6880('0x3e')](_0x228cc5['where'],{'$or':_[_0x6880('0x2c')](_0x5b6632,function(_0x2eff1b){if(_0x2eff1b[_0x6880('0x3f')]!=='VIRTUAL'){var _0x3af56b={};_0x3af56b[_0x2eff1b[_0x6880('0x29')]]={'$like':'%'+_0x3cf5d6['query'][_0x6880('0x40')]+'%'};return _0x3af56b;}})});}_0x228cc5=_[_0x6880('0x3e')]({},_0x228cc5,_0x3cf5d6[_0x6880('0x41')]);var _0x46e448={'where':_0x228cc5['where']};return db[_0x6880('0x2d')][_0x6880('0x20')](_0x46e448)[_0x6880('0x26')](function(_0x3a36b4){_0x1b53e0[_0x6880('0x20')]=_0x3a36b4;if(_0x3cf5d6[_0x6880('0x32')]['includeAll']){_0x228cc5['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x6880('0x42')](_0x228cc5);})[_0x6880('0x26')](function(_0x26af89){_0x1b53e0[_0x6880('0x43')]=_0x26af89;return _0x1b53e0;})[_0x6880('0x26')](respondWithFilteredResult(_0x1789e3,_0x228cc5))[_0x6880('0x44')](handleError(_0x1789e3,null));};exports['show']=function(_0x163a4b,_0x1f49c9){var _0x17e10f={'raw':![],'where':{'id':_0x163a4b['params']['id']}},_0x38c387={};_0x38c387[_0x6880('0x31')]=_[_0x6880('0x45')](db[_0x6880('0x2d')][_0x6880('0x2e')]);_0x38c387[_0x6880('0x32')]=_[_0x6880('0x45')](_0x163a4b[_0x6880('0x32')]);_0x38c387[_0x6880('0x33')]=_[_0x6880('0x34')](_0x38c387[_0x6880('0x31')],_0x38c387['query']);_0x17e10f[_0x6880('0x35')]=_['intersection'](_0x38c387[_0x6880('0x31')],qs['fields'](_0x163a4b[_0x6880('0x32')][_0x6880('0x36')]));_0x17e10f[_0x6880('0x35')]=_0x17e10f[_0x6880('0x35')][_0x6880('0x37')]?_0x17e10f[_0x6880('0x35')]:_0x38c387[_0x6880('0x31')];if(_0x163a4b['query'][_0x6880('0x46')]){_0x17e10f[_0x6880('0x47')]=[{'all':!![]}];}_0x17e10f=_[_0x6880('0x3e')]({},_0x17e10f,_0x163a4b[_0x6880('0x41')]);return db[_0x6880('0x2d')][_0x6880('0x48')](_0x17e10f)[_0x6880('0x26')](handleEntityNotFound(_0x1f49c9,null))[_0x6880('0x26')](respondWithResult(_0x1f49c9,null))['catch'](handleError(_0x1f49c9,null));};exports['create']=function(_0x194489,_0xb6d49a){return db[_0x6880('0x2d')][_0x6880('0x49')](_0x194489[_0x6880('0x4a')],{})[_0x6880('0x26')](respondWithResult(_0xb6d49a,0xc9))[_0x6880('0x44')](handleError(_0xb6d49a,null));};exports[_0x6880('0x4b')]=function(_0x3faa73,_0xbceb0d){if(_0x3faa73[_0x6880('0x4a')]['id']){delete _0x3faa73[_0x6880('0x4a')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x3faa73['params']['id']}})[_0x6880('0x26')](handleEntityNotFound(_0xbceb0d,null))['then'](saveUpdates(_0x3faa73[_0x6880('0x4a')],null))[_0x6880('0x26')](respondWithResult(_0xbceb0d,null))['catch'](handleError(_0xbceb0d,null));};exports[_0x6880('0x25')]=function(_0x4dc78f,_0x47499c){return db[_0x6880('0x2d')][_0x6880('0x48')]({'where':{'id':_0x4dc78f[_0x6880('0x4c')]['id']}})[_0x6880('0x26')](handleEntityNotFound(_0x47499c,null))[_0x6880('0x26')](removeEntity(_0x47499c,null))['catch'](handleError(_0x47499c,null));};exports[_0x6880('0x4d')]=function(_0x4912c2,_0x2cdc2c,_0x13acef){var _0x4cf88e={};var _0x2d1fc8={};var _0x4392d5;var _0x151c30;return db[_0x6880('0x2d')][_0x6880('0x4e')]({'where':{'id':_0x4912c2[_0x6880('0x4c')]['id']}})[_0x6880('0x26')](handleEntityNotFound(_0x2cdc2c,null))[_0x6880('0x26')](function(_0xd40059){if(_0xd40059){_0x4392d5=_0xd40059;_0x2d1fc8[_0x6880('0x31')]=_[_0x6880('0x45')](db[_0x6880('0x4f')]['rawAttributes']);_0x2d1fc8[_0x6880('0x32')]=_['keys'](_0x4912c2['query']);_0x2d1fc8[_0x6880('0x33')]=_[_0x6880('0x34')](_0x2d1fc8['model'],_0x2d1fc8[_0x6880('0x32')]);_0x4cf88e[_0x6880('0x35')]=_[_0x6880('0x34')](_0x2d1fc8[_0x6880('0x31')],qs['fields'](_0x4912c2[_0x6880('0x32')][_0x6880('0x36')]));_0x4cf88e[_0x6880('0x35')]=_0x4cf88e[_0x6880('0x35')][_0x6880('0x37')]?_0x4cf88e[_0x6880('0x35')]:_0x2d1fc8[_0x6880('0x31')];_0x4cf88e['order']=qs[_0x6880('0x3b')](_0x4912c2[_0x6880('0x32')][_0x6880('0x3b')]);_0x4cf88e[_0x6880('0x3c')]=qs['filters'](_[_0x6880('0x3d')](_0x4912c2[_0x6880('0x32')],_0x2d1fc8['filters']));if(_0x4912c2[_0x6880('0x32')][_0x6880('0x40')]){_0x4cf88e[_0x6880('0x3c')]=_[_0x6880('0x3e')](_0x4cf88e[_0x6880('0x3c')],{'$or':_[_0x6880('0x2c')](_0x4cf88e['attributes'],function(_0x45584d){var _0x5836d0={};_0x5836d0[_0x45584d]={'$like':'%'+_0x4912c2[_0x6880('0x32')][_0x6880('0x40')]+'%'};return _0x5836d0;})});}_0x4cf88e=_[_0x6880('0x3e')]({},_0x4cf88e,_0x4912c2['options']);return _0x4392d5[_0x6880('0x4d')](_0x4cf88e);}})[_0x6880('0x26')](function(_0x357143){if(_0x357143){_0x151c30=_0x357143['length'];if(!_0x4912c2['query'][_0x6880('0x38')](_0x6880('0x39'))){_0x4cf88e[_0x6880('0x1f')]=qs['limit'](_0x4912c2[_0x6880('0x32')][_0x6880('0x1f')]);_0x4cf88e[_0x6880('0x1d')]=qs[_0x6880('0x1d')](_0x4912c2[_0x6880('0x32')][_0x6880('0x1d')]);}return _0x4392d5[_0x6880('0x4d')](_0x4cf88e);}})[_0x6880('0x26')](function(_0x463f10){if(_0x463f10){return _0x463f10?{'count':_0x151c30,'rows':_0x463f10}:null;}})[_0x6880('0x26')](respondWithResult(_0x2cdc2c,null))[_0x6880('0x44')](handleError(_0x2cdc2c,null));};exports[_0x6880('0x50')]=function(_0x5e55ad,_0x4876af,_0x23e424){var _0x36b71c={};var _0x472862={};var _0x34c3be;var _0x562999;return db[_0x6880('0x2d')]['findOne']({'where':{'id':_0x5e55ad[_0x6880('0x4c')]['id']}})[_0x6880('0x26')](handleEntityNotFound(_0x4876af,null))['then'](function(_0xdd5d6f){if(_0xdd5d6f){_0x34c3be=_0xdd5d6f;_0x472862['model']=_['keys'](db[_0x6880('0x4f')][_0x6880('0x2e')]);_0x472862[_0x6880('0x32')]=_[_0x6880('0x45')](_0x5e55ad[_0x6880('0x32')]);_0x472862[_0x6880('0x33')]=_[_0x6880('0x34')](_0x472862[_0x6880('0x31')],_0x472862[_0x6880('0x32')]);_0x36b71c[_0x6880('0x35')]=_[_0x6880('0x34')](_0x472862[_0x6880('0x31')],qs['fields'](_0x5e55ad['query'][_0x6880('0x36')]));_0x36b71c[_0x6880('0x35')]=_0x36b71c['attributes'][_0x6880('0x37')]?_0x36b71c[_0x6880('0x35')]:_0x472862[_0x6880('0x31')];_0x36b71c['order']=qs[_0x6880('0x3b')](_0x5e55ad['query']['sort']);_0x36b71c[_0x6880('0x3c')]=qs['filters'](_[_0x6880('0x3d')](_0x5e55ad[_0x6880('0x32')],_0x472862['filters']));if(_0x5e55ad[_0x6880('0x32')][_0x6880('0x40')]){_0x36b71c['where']=_[_0x6880('0x3e')](_0x36b71c[_0x6880('0x3c')],{'$or':_[_0x6880('0x2c')](_0x36b71c['attributes'],function(_0x5ab417){var _0x3c81d4={};_0x3c81d4[_0x5ab417]={'$like':'%'+_0x5e55ad[_0x6880('0x32')]['filter']+'%'};return _0x3c81d4;})});}_0x36b71c=_['merge']({},_0x36b71c,_0x5e55ad[_0x6880('0x41')]);return _0x34c3be[_0x6880('0x50')](_0x36b71c);}})['then'](function(_0x5494a0){if(_0x5494a0){_0x562999=_0x5494a0[_0x6880('0x37')];if(!_0x5e55ad[_0x6880('0x32')][_0x6880('0x38')](_0x6880('0x39'))){_0x36b71c[_0x6880('0x1f')]=qs[_0x6880('0x1f')](_0x5e55ad[_0x6880('0x32')]['limit']);_0x36b71c[_0x6880('0x1d')]=qs[_0x6880('0x1d')](_0x5e55ad[_0x6880('0x32')][_0x6880('0x1d')]);}return _0x34c3be[_0x6880('0x50')](_0x36b71c);}})[_0x6880('0x26')](function(_0x4a86c4){if(_0x4a86c4){return _0x4a86c4?{'count':_0x562999,'rows':_0x4a86c4}:null;}})['then'](respondWithResult(_0x4876af,null))['catch'](handleError(_0x4876af,null));};exports[_0x6880('0x51')]=function(_0x4472f5,_0x59f13e,_0x2ce2cb){var _0x2ccb23={};var _0xfc5fd={};var _0x1bc0ea;var _0x42effb;return db[_0x6880('0x2d')][_0x6880('0x4e')]({'where':{'id':_0x4472f5[_0x6880('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59f13e,null))[_0x6880('0x26')](function(_0x196e62){if(_0x196e62){_0x1bc0ea=_0x196e62;_0xfc5fd['model']=_['keys'](db['ZendeskField']['rawAttributes']);_0xfc5fd[_0x6880('0x32')]=_[_0x6880('0x45')](_0x4472f5[_0x6880('0x32')]);_0xfc5fd[_0x6880('0x33')]=_[_0x6880('0x34')](_0xfc5fd[_0x6880('0x31')],_0xfc5fd['query']);_0x2ccb23['attributes']=_[_0x6880('0x34')](_0xfc5fd[_0x6880('0x31')],qs[_0x6880('0x36')](_0x4472f5['query'][_0x6880('0x36')]));_0x2ccb23[_0x6880('0x35')]=_0x2ccb23[_0x6880('0x35')]['length']?_0x2ccb23[_0x6880('0x35')]:_0xfc5fd[_0x6880('0x31')];_0x2ccb23[_0x6880('0x3a')]=qs[_0x6880('0x3b')](_0x4472f5[_0x6880('0x32')][_0x6880('0x3b')]);_0x2ccb23[_0x6880('0x3c')]=qs[_0x6880('0x33')](_[_0x6880('0x3d')](_0x4472f5['query'],_0xfc5fd['filters']));if(_0x4472f5['query'][_0x6880('0x40')]){_0x2ccb23[_0x6880('0x3c')]=_[_0x6880('0x3e')](_0x2ccb23['where'],{'$or':_[_0x6880('0x2c')](_0x2ccb23[_0x6880('0x35')],function(_0x86faf9){var _0x3f9a47={};_0x3f9a47[_0x86faf9]={'$like':'%'+_0x4472f5['query'][_0x6880('0x40')]+'%'};return _0x3f9a47;})});}_0x2ccb23=_['merge']({},_0x2ccb23,_0x4472f5[_0x6880('0x41')]);return _0x1bc0ea[_0x6880('0x51')](_0x2ccb23);}})[_0x6880('0x26')](function(_0x2e623a){if(_0x2e623a){_0x42effb=_0x2e623a['length'];if(!_0x4472f5[_0x6880('0x32')][_0x6880('0x38')](_0x6880('0x39'))){_0x2ccb23['limit']=qs[_0x6880('0x1f')](_0x4472f5[_0x6880('0x32')][_0x6880('0x1f')]);_0x2ccb23['offset']=qs[_0x6880('0x1d')](_0x4472f5['query'][_0x6880('0x1d')]);}return _0x1bc0ea[_0x6880('0x51')](_0x2ccb23);}})['then'](function(_0x1dc1bc){if(_0x1dc1bc){return _0x1dc1bc?{'count':_0x42effb,'rows':_0x1dc1bc}:null;}})[_0x6880('0x26')](respondWithResult(_0x59f13e,null))[_0x6880('0x44')](handleError(_0x59f13e,null));};exports[_0x6880('0x52')]=function(_0x5461ea,_0x2f8a9e,_0x122318){var _0x52bbd3={};var _0x9fade9={};var _0x5d6df2;var _0x191033;return db['ZendeskConfiguration'][_0x6880('0x4e')]({'where':{'id':_0x5461ea[_0x6880('0x4c')]['id']}})[_0x6880('0x26')](handleEntityNotFound(_0x2f8a9e,null))[_0x6880('0x26')](function(_0x29e240){if(_0x29e240){_0x5d6df2=_0x29e240;_0x9fade9['model']=_['keys'](db[_0x6880('0x53')][_0x6880('0x2e')]);_0x9fade9['query']=_['keys'](_0x5461ea[_0x6880('0x32')]);_0x9fade9[_0x6880('0x33')]=_[_0x6880('0x34')](_0x9fade9['model'],_0x9fade9[_0x6880('0x32')]);_0x52bbd3[_0x6880('0x35')]=_[_0x6880('0x34')](_0x9fade9[_0x6880('0x31')],qs['fields'](_0x5461ea[_0x6880('0x32')][_0x6880('0x36')]));_0x52bbd3[_0x6880('0x35')]=_0x52bbd3['attributes'][_0x6880('0x37')]?_0x52bbd3[_0x6880('0x35')]:_0x9fade9[_0x6880('0x31')];_0x52bbd3['order']=qs[_0x6880('0x3b')](_0x5461ea[_0x6880('0x32')][_0x6880('0x3b')]);_0x52bbd3[_0x6880('0x3c')]=qs[_0x6880('0x33')](_[_0x6880('0x3d')](_0x5461ea[_0x6880('0x32')],_0x9fade9[_0x6880('0x33')]));if(_0x5461ea[_0x6880('0x32')][_0x6880('0x40')]){_0x52bbd3[_0x6880('0x3c')]=_['merge'](_0x52bbd3['where'],{'$or':_['map'](_0x52bbd3[_0x6880('0x35')],function(_0x4886f4){var _0x3b0107={};_0x3b0107[_0x4886f4]={'$like':'%'+_0x5461ea['query']['filter']+'%'};return _0x3b0107;})});}_0x52bbd3=_[_0x6880('0x3e')]({},_0x52bbd3,_0x5461ea['options']);return _0x5d6df2[_0x6880('0x52')](_0x52bbd3);}})[_0x6880('0x26')](function(_0x5dda1e){if(_0x5dda1e){_0x191033=_0x5dda1e[_0x6880('0x37')];if(!_0x5461ea[_0x6880('0x32')][_0x6880('0x38')](_0x6880('0x39'))){_0x52bbd3[_0x6880('0x1f')]=qs[_0x6880('0x1f')](_0x5461ea[_0x6880('0x32')][_0x6880('0x1f')]);_0x52bbd3[_0x6880('0x1d')]=qs[_0x6880('0x1d')](_0x5461ea[_0x6880('0x32')][_0x6880('0x1d')]);}return _0x5d6df2[_0x6880('0x52')](_0x52bbd3);}})[_0x6880('0x26')](function(_0x2b9ecf){if(_0x2b9ecf){return _0x2b9ecf?{'count':_0x191033,'rows':_0x2b9ecf}:null;}})['then'](respondWithResult(_0x2f8a9e,null))[_0x6880('0x44')](handleError(_0x2f8a9e,null));};exports[_0x6880('0x54')]=function(_0x5eaf31,_0x3dd45e,_0x3f58d0){if(_0x5eaf31[_0x6880('0x4a')]['id']){delete _0x5eaf31[_0x6880('0x4a')]['id'];}return db['ZendeskConfiguration'][_0x6880('0x4e')]({'where':{'id':_0x5eaf31[_0x6880('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3dd45e,null))[_0x6880('0x26')](function(_0x4a8e97){if(_0x4a8e97){return _0x4a8e97[_0x6880('0x54')](_0x5eaf31[_0x6880('0x4a')][_0x6880('0x55')]||[]);}return null;})[_0x6880('0x26')](respondWithResult(_0x3dd45e,null))[_0x6880('0x44')](handleError(_0x3dd45e,null));};
\ No newline at end of file
+var _0x19f3=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','ZendeskConfiguration','rawAttributes','type','key','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0xbb4964,_0x2424c0){var _0x31b07c=function(_0x28ca61){while(--_0x28ca61){_0xbb4964['push'](_0xbb4964['shift']());}};_0x31b07c(++_0x2424c0);}(_0x19f3,0xf5));var _0x319f=function(_0x1ad07b,_0x551d55){_0x1ad07b=_0x1ad07b-0x0;var _0x2c447f=_0x19f3[_0x1ad07b];return _0x2c447f;};'use strict';var emlformat=require(_0x319f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x319f('0x1'));var jsonpatch=require(_0x319f('0x2'));var rp=require(_0x319f('0x3'));var moment=require(_0x319f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x319f('0x5'));var util=require('util');var path=require(_0x319f('0x6'));var sox=require(_0x319f('0x7'));var csv=require(_0x319f('0x8'));var ejs=require(_0x319f('0x9'));var fs=require('fs');var fs_extra=require(_0x319f('0xa'));var _=require('lodash');var squel=require(_0x319f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x319f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x319f('0xd'));var Papa=require(_0x319f('0xe'));var Redis=require(_0x319f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x319f('0x10'));var as=require(_0x319f('0x11'));var hardwareService=require(_0x319f('0x12'));var logger=require(_0x319f('0x13'))(_0x319f('0x14'));var utils=require('../../config/utils');var config=require(_0x319f('0x15'));var licenseUtil=require(_0x319f('0x16'));var db=require(_0x319f('0x17'))['db'];function respondWithStatusCode(_0x5cf16e,_0x1e617d){_0x1e617d=_0x1e617d||0xcc;return function(_0x39c599){if(_0x39c599){return _0x5cf16e['sendStatus'](_0x1e617d);}return _0x5cf16e[_0x319f('0x18')](_0x1e617d)['end']();};}function respondWithResult(_0x107412,_0x257ac8){_0x257ac8=_0x257ac8||0xc8;return function(_0x1f3f09){if(_0x1f3f09){return _0x107412[_0x319f('0x18')](_0x257ac8)[_0x319f('0x19')](_0x1f3f09);}};}function respondWithFilteredResult(_0x1b0767,_0x314789){return function(_0x3bc5f9){if(_0x3bc5f9){var _0x10702f=typeof _0x314789['offset']===_0x319f('0x1a')&&typeof _0x314789[_0x319f('0x1b')]===_0x319f('0x1a');var _0xcb7ede=_0x3bc5f9[_0x319f('0x1c')];var _0x512c07=_0x10702f?0x0:_0x314789['offset'];var _0x23eeab=_0x10702f?_0x3bc5f9[_0x319f('0x1c')]:_0x314789[_0x319f('0x1d')]+_0x314789['limit'];var _0x2a3466;if(_0x23eeab>=_0xcb7ede){_0x23eeab=_0xcb7ede;_0x2a3466=0xc8;}else{_0x2a3466=0xce;}_0x1b0767['status'](_0x2a3466);return _0x1b0767[_0x319f('0x1e')]('Content-Range',_0x512c07+'-'+_0x23eeab+'/'+_0xcb7ede)['json'](_0x3bc5f9);}return null;};}function patchUpdates(_0x1427fe){return function(_0x1e960d){try{jsonpatch[_0x319f('0x1f')](_0x1e960d,_0x1427fe,!![]);}catch(_0x255e3d){return BPromise[_0x319f('0x20')](_0x255e3d);}return _0x1e960d[_0x319f('0x21')]();};}function saveUpdates(_0x549720,_0xb6bb9){return function(_0x2de9cf){if(_0x2de9cf){return _0x2de9cf[_0x319f('0x22')](_0x549720)[_0x319f('0x23')](function(_0x2befd4){return _0x2befd4;});}return null;};}function removeEntity(_0x501eff,_0x3b9c95){return function(_0xe0e864){if(_0xe0e864){return _0xe0e864[_0x319f('0x24')]()[_0x319f('0x23')](function(){_0x501eff[_0x319f('0x18')](0xcc)[_0x319f('0x25')]();});}};}function handleEntityNotFound(_0x56aec7,_0x2689e1){return function(_0x2f70de){if(!_0x2f70de){_0x56aec7[_0x319f('0x26')](0x194);}return _0x2f70de;};}function handleError(_0x27634d,_0x472c90){_0x472c90=_0x472c90||0x1f4;return function(_0x55c92f){logger['error'](_0x55c92f[_0x319f('0x27')]);if(_0x55c92f['name']){delete _0x55c92f[_0x319f('0x28')];}_0x27634d[_0x319f('0x18')](_0x472c90)[_0x319f('0x29')](_0x55c92f);};}exports['index']=function(_0x2642c8,_0x1a7979){var _0x1963c2={},_0x62b21a={},_0x78e6cb={'count':0x0,'rows':[]};var _0x1a77a0=_['map'](db[_0x319f('0x2a')][_0x319f('0x2b')],function(_0x3b12bd){return{'name':_0x3b12bd['fieldName'],'type':_0x3b12bd[_0x319f('0x2c')][_0x319f('0x2d')]};});_0x62b21a[_0x319f('0x2e')]=_['map'](_0x1a77a0,_0x319f('0x28'));_0x62b21a['query']=_['keys'](_0x2642c8['query']);_0x62b21a[_0x319f('0x2f')]=_[_0x319f('0x30')](_0x62b21a['model'],_0x62b21a['query']);_0x1963c2[_0x319f('0x31')]=_[_0x319f('0x30')](_0x62b21a[_0x319f('0x2e')],qs[_0x319f('0x32')](_0x2642c8[_0x319f('0x33')]['fields']));_0x1963c2[_0x319f('0x31')]=_0x1963c2[_0x319f('0x31')][_0x319f('0x34')]?_0x1963c2[_0x319f('0x31')]:_0x62b21a[_0x319f('0x2e')];if(!_0x2642c8[_0x319f('0x33')][_0x319f('0x35')](_0x319f('0x36'))){_0x1963c2[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x2642c8[_0x319f('0x33')]['limit']);_0x1963c2[_0x319f('0x1d')]=qs[_0x319f('0x1d')](_0x2642c8[_0x319f('0x33')][_0x319f('0x1d')]);}_0x1963c2[_0x319f('0x37')]=qs[_0x319f('0x38')](_0x2642c8['query'][_0x319f('0x38')]);_0x1963c2[_0x319f('0x39')]=qs['filters'](_[_0x319f('0x3a')](_0x2642c8['query'],_0x62b21a[_0x319f('0x2f')]),_0x1a77a0);if(_0x2642c8['query'][_0x319f('0x3b')]){_0x1963c2[_0x319f('0x39')]=_[_0x319f('0x3c')](_0x1963c2[_0x319f('0x39')],{'$or':_[_0x319f('0x3d')](_0x1a77a0,function(_0x1ab568){if(_0x1ab568['type']!=='VIRTUAL'){var _0x1617dc={};_0x1617dc[_0x1ab568[_0x319f('0x28')]]={'$like':'%'+_0x2642c8[_0x319f('0x33')][_0x319f('0x3b')]+'%'};return _0x1617dc;}})});}_0x1963c2=_['merge']({},_0x1963c2,_0x2642c8[_0x319f('0x3e')]);var _0x2a083d={'where':_0x1963c2[_0x319f('0x39')]};return db[_0x319f('0x2a')][_0x319f('0x1c')](_0x2a083d)[_0x319f('0x23')](function(_0x58ec07){_0x78e6cb[_0x319f('0x1c')]=_0x58ec07;if(_0x2642c8['query'][_0x319f('0x3f')]){_0x1963c2[_0x319f('0x40')]=[{'all':!![]}];}return db[_0x319f('0x2a')][_0x319f('0x41')](_0x1963c2);})[_0x319f('0x23')](function(_0x526f52){_0x78e6cb['rows']=_0x526f52;return _0x78e6cb;})[_0x319f('0x23')](respondWithFilteredResult(_0x1a7979,_0x1963c2))[_0x319f('0x42')](handleError(_0x1a7979,null));};exports[_0x319f('0x43')]=function(_0x4660b2,_0x2bf38e){var _0x35afc8={'raw':![],'where':{'id':_0x4660b2[_0x319f('0x44')]['id']}},_0x3b92ca={};_0x3b92ca[_0x319f('0x2e')]=_['keys'](db[_0x319f('0x2a')][_0x319f('0x2b')]);_0x3b92ca[_0x319f('0x33')]=_[_0x319f('0x45')](_0x4660b2[_0x319f('0x33')]);_0x3b92ca[_0x319f('0x2f')]=_[_0x319f('0x30')](_0x3b92ca[_0x319f('0x2e')],_0x3b92ca[_0x319f('0x33')]);_0x35afc8[_0x319f('0x31')]=_[_0x319f('0x30')](_0x3b92ca[_0x319f('0x2e')],qs[_0x319f('0x32')](_0x4660b2[_0x319f('0x33')][_0x319f('0x32')]));_0x35afc8[_0x319f('0x31')]=_0x35afc8['attributes'][_0x319f('0x34')]?_0x35afc8[_0x319f('0x31')]:_0x3b92ca['model'];if(_0x4660b2[_0x319f('0x33')][_0x319f('0x3f')]){_0x35afc8[_0x319f('0x40')]=[{'all':!![]}];}_0x35afc8=_[_0x319f('0x3c')]({},_0x35afc8,_0x4660b2['options']);return db[_0x319f('0x2a')][_0x319f('0x46')](_0x35afc8)[_0x319f('0x23')](handleEntityNotFound(_0x2bf38e,null))['then'](respondWithResult(_0x2bf38e,null))['catch'](handleError(_0x2bf38e,null));};exports[_0x319f('0x47')]=function(_0x4ccf9d,_0x33142a){return db[_0x319f('0x2a')][_0x319f('0x47')](_0x4ccf9d[_0x319f('0x48')],{})[_0x319f('0x23')](respondWithResult(_0x33142a,0xc9))[_0x319f('0x42')](handleError(_0x33142a,null));};exports['update']=function(_0x17dca9,_0x4480d2){if(_0x17dca9[_0x319f('0x48')]['id']){delete _0x17dca9[_0x319f('0x48')]['id'];}return db[_0x319f('0x2a')][_0x319f('0x46')]({'where':{'id':_0x17dca9[_0x319f('0x44')]['id']}})[_0x319f('0x23')](handleEntityNotFound(_0x4480d2,null))[_0x319f('0x23')](saveUpdates(_0x17dca9[_0x319f('0x48')],null))[_0x319f('0x23')](respondWithResult(_0x4480d2,null))[_0x319f('0x42')](handleError(_0x4480d2,null));};exports['destroy']=function(_0x2f818c,_0x442d0f){return db[_0x319f('0x2a')]['find']({'where':{'id':_0x2f818c['params']['id']}})['then'](handleEntityNotFound(_0x442d0f,null))[_0x319f('0x23')](removeEntity(_0x442d0f,null))[_0x319f('0x42')](handleError(_0x442d0f,null));};exports[_0x319f('0x49')]=function(_0x1fb299,_0x3f327d,_0x2bf785){var _0x5edc2e={};var _0x1a94f8={};var _0x527dd7;var _0x572244;return db[_0x319f('0x2a')][_0x319f('0x4a')]({'where':{'id':_0x1fb299[_0x319f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f327d,null))[_0x319f('0x23')](function(_0xc95a10){if(_0xc95a10){_0x527dd7=_0xc95a10;_0x1a94f8['model']=_['keys'](db[_0x319f('0x4b')][_0x319f('0x2b')]);_0x1a94f8[_0x319f('0x33')]=_[_0x319f('0x45')](_0x1fb299[_0x319f('0x33')]);_0x1a94f8[_0x319f('0x2f')]=_['intersection'](_0x1a94f8[_0x319f('0x2e')],_0x1a94f8[_0x319f('0x33')]);_0x5edc2e[_0x319f('0x31')]=_[_0x319f('0x30')](_0x1a94f8[_0x319f('0x2e')],qs[_0x319f('0x32')](_0x1fb299['query'][_0x319f('0x32')]));_0x5edc2e[_0x319f('0x31')]=_0x5edc2e[_0x319f('0x31')][_0x319f('0x34')]?_0x5edc2e['attributes']:_0x1a94f8[_0x319f('0x2e')];_0x5edc2e[_0x319f('0x37')]=qs[_0x319f('0x38')](_0x1fb299[_0x319f('0x33')]['sort']);_0x5edc2e[_0x319f('0x39')]=qs[_0x319f('0x2f')](_[_0x319f('0x3a')](_0x1fb299[_0x319f('0x33')],_0x1a94f8['filters']));if(_0x1fb299[_0x319f('0x33')][_0x319f('0x3b')]){_0x5edc2e[_0x319f('0x39')]=_['merge'](_0x5edc2e[_0x319f('0x39')],{'$or':_['map'](_0x5edc2e[_0x319f('0x31')],function(_0x58537c){var _0x44aff2={};_0x44aff2[_0x58537c]={'$like':'%'+_0x1fb299[_0x319f('0x33')][_0x319f('0x3b')]+'%'};return _0x44aff2;})});}_0x5edc2e=_['merge']({},_0x5edc2e,_0x1fb299[_0x319f('0x3e')]);return _0x527dd7['getFields'](_0x5edc2e);}})[_0x319f('0x23')](function(_0x393fb9){if(_0x393fb9){_0x572244=_0x393fb9[_0x319f('0x34')];if(!_0x1fb299['query'][_0x319f('0x35')](_0x319f('0x36'))){_0x5edc2e[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x1fb299[_0x319f('0x33')][_0x319f('0x1b')]);_0x5edc2e[_0x319f('0x1d')]=qs[_0x319f('0x1d')](_0x1fb299[_0x319f('0x33')][_0x319f('0x1d')]);}return _0x527dd7[_0x319f('0x49')](_0x5edc2e);}})[_0x319f('0x23')](function(_0xcc1c4f){if(_0xcc1c4f){return _0xcc1c4f?{'count':_0x572244,'rows':_0xcc1c4f}:null;}})[_0x319f('0x23')](respondWithResult(_0x3f327d,null))[_0x319f('0x42')](handleError(_0x3f327d,null));};exports[_0x319f('0x4c')]=function(_0x3c3ba2,_0x2ee1ea,_0x1a1157){var _0x39fd99={};var _0x589fa2={};var _0x39314f;var _0x84797;return db['ZendeskConfiguration'][_0x319f('0x4a')]({'where':{'id':_0x3c3ba2[_0x319f('0x44')]['id']}})[_0x319f('0x23')](handleEntityNotFound(_0x2ee1ea,null))[_0x319f('0x23')](function(_0x17a8fb){if(_0x17a8fb){_0x39314f=_0x17a8fb;_0x589fa2[_0x319f('0x2e')]=_[_0x319f('0x45')](db['ZendeskField']['rawAttributes']);_0x589fa2[_0x319f('0x33')]=_[_0x319f('0x45')](_0x3c3ba2[_0x319f('0x33')]);_0x589fa2['filters']=_['intersection'](_0x589fa2[_0x319f('0x2e')],_0x589fa2['query']);_0x39fd99[_0x319f('0x31')]=_[_0x319f('0x30')](_0x589fa2['model'],qs[_0x319f('0x32')](_0x3c3ba2[_0x319f('0x33')][_0x319f('0x32')]));_0x39fd99[_0x319f('0x31')]=_0x39fd99[_0x319f('0x31')]['length']?_0x39fd99['attributes']:_0x589fa2[_0x319f('0x2e')];_0x39fd99[_0x319f('0x37')]=qs[_0x319f('0x38')](_0x3c3ba2[_0x319f('0x33')][_0x319f('0x38')]);_0x39fd99['where']=qs['filters'](_[_0x319f('0x3a')](_0x3c3ba2[_0x319f('0x33')],_0x589fa2['filters']));if(_0x3c3ba2[_0x319f('0x33')][_0x319f('0x3b')]){_0x39fd99[_0x319f('0x39')]=_[_0x319f('0x3c')](_0x39fd99[_0x319f('0x39')],{'$or':_[_0x319f('0x3d')](_0x39fd99['attributes'],function(_0x42f51a){var _0x2cfaef={};_0x2cfaef[_0x42f51a]={'$like':'%'+_0x3c3ba2[_0x319f('0x33')][_0x319f('0x3b')]+'%'};return _0x2cfaef;})});}_0x39fd99=_[_0x319f('0x3c')]({},_0x39fd99,_0x3c3ba2['options']);return _0x39314f[_0x319f('0x4c')](_0x39fd99);}})[_0x319f('0x23')](function(_0x5704a0){if(_0x5704a0){_0x84797=_0x5704a0['length'];if(!_0x3c3ba2[_0x319f('0x33')]['hasOwnProperty'](_0x319f('0x36'))){_0x39fd99[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x3c3ba2[_0x319f('0x33')][_0x319f('0x1b')]);_0x39fd99[_0x319f('0x1d')]=qs['offset'](_0x3c3ba2[_0x319f('0x33')]['offset']);}return _0x39314f[_0x319f('0x4c')](_0x39fd99);}})['then'](function(_0x344e8c){if(_0x344e8c){return _0x344e8c?{'count':_0x84797,'rows':_0x344e8c}:null;}})[_0x319f('0x23')](respondWithResult(_0x2ee1ea,null))[_0x319f('0x42')](handleError(_0x2ee1ea,null));};exports[_0x319f('0x4d')]=function(_0x349f12,_0x1afa65,_0x4a05a3){var _0x223087={};var _0x4b0ecd={};var _0x1e743e;var _0x492039;return db['ZendeskConfiguration'][_0x319f('0x4a')]({'where':{'id':_0x349f12[_0x319f('0x44')]['id']}})['then'](handleEntityNotFound(_0x1afa65,null))[_0x319f('0x23')](function(_0x56ae0a){if(_0x56ae0a){_0x1e743e=_0x56ae0a;_0x4b0ecd['model']=_[_0x319f('0x45')](db[_0x319f('0x4b')]['rawAttributes']);_0x4b0ecd['query']=_[_0x319f('0x45')](_0x349f12[_0x319f('0x33')]);_0x4b0ecd['filters']=_[_0x319f('0x30')](_0x4b0ecd[_0x319f('0x2e')],_0x4b0ecd[_0x319f('0x33')]);_0x223087[_0x319f('0x31')]=_['intersection'](_0x4b0ecd[_0x319f('0x2e')],qs[_0x319f('0x32')](_0x349f12[_0x319f('0x33')]['fields']));_0x223087[_0x319f('0x31')]=_0x223087[_0x319f('0x31')][_0x319f('0x34')]?_0x223087[_0x319f('0x31')]:_0x4b0ecd['model'];_0x223087[_0x319f('0x37')]=qs[_0x319f('0x38')](_0x349f12[_0x319f('0x33')][_0x319f('0x38')]);_0x223087[_0x319f('0x39')]=qs[_0x319f('0x2f')](_[_0x319f('0x3a')](_0x349f12[_0x319f('0x33')],_0x4b0ecd[_0x319f('0x2f')]));if(_0x349f12[_0x319f('0x33')]['filter']){_0x223087[_0x319f('0x39')]=_['merge'](_0x223087[_0x319f('0x39')],{'$or':_[_0x319f('0x3d')](_0x223087[_0x319f('0x31')],function(_0x337a37){var _0xbeb942={};_0xbeb942[_0x337a37]={'$like':'%'+_0x349f12['query'][_0x319f('0x3b')]+'%'};return _0xbeb942;})});}_0x223087=_[_0x319f('0x3c')]({},_0x223087,_0x349f12['options']);return _0x1e743e[_0x319f('0x4d')](_0x223087);}})[_0x319f('0x23')](function(_0x159a2f){if(_0x159a2f){_0x492039=_0x159a2f[_0x319f('0x34')];if(!_0x349f12[_0x319f('0x33')]['hasOwnProperty'](_0x319f('0x36'))){_0x223087[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x349f12['query'][_0x319f('0x1b')]);_0x223087[_0x319f('0x1d')]=qs[_0x319f('0x1d')](_0x349f12[_0x319f('0x33')]['offset']);}return _0x1e743e[_0x319f('0x4d')](_0x223087);}})[_0x319f('0x23')](function(_0x2953ea){if(_0x2953ea){return _0x2953ea?{'count':_0x492039,'rows':_0x2953ea}:null;}})[_0x319f('0x23')](respondWithResult(_0x1afa65,null))[_0x319f('0x42')](handleError(_0x1afa65,null));};exports[_0x319f('0x4e')]=function(_0x2a73c7,_0x41d43b,_0x1856bd){var _0x282bfd={};var _0x45afcb={};var _0xd8447d;var _0x485ffa;return db['ZendeskConfiguration'][_0x319f('0x4a')]({'where':{'id':_0x2a73c7[_0x319f('0x44')]['id']}})[_0x319f('0x23')](handleEntityNotFound(_0x41d43b,null))['then'](function(_0x333fd0){if(_0x333fd0){_0xd8447d=_0x333fd0;_0x45afcb[_0x319f('0x2e')]=_[_0x319f('0x45')](db[_0x319f('0x4f')][_0x319f('0x2b')]);_0x45afcb['query']=_[_0x319f('0x45')](_0x2a73c7[_0x319f('0x33')]);_0x45afcb[_0x319f('0x2f')]=_[_0x319f('0x30')](_0x45afcb['model'],_0x45afcb[_0x319f('0x33')]);_0x282bfd['attributes']=_[_0x319f('0x30')](_0x45afcb[_0x319f('0x2e')],qs[_0x319f('0x32')](_0x2a73c7[_0x319f('0x33')][_0x319f('0x32')]));_0x282bfd[_0x319f('0x31')]=_0x282bfd[_0x319f('0x31')][_0x319f('0x34')]?_0x282bfd[_0x319f('0x31')]:_0x45afcb[_0x319f('0x2e')];_0x282bfd[_0x319f('0x37')]=qs[_0x319f('0x38')](_0x2a73c7['query'][_0x319f('0x38')]);_0x282bfd['where']=qs[_0x319f('0x2f')](_[_0x319f('0x3a')](_0x2a73c7[_0x319f('0x33')],_0x45afcb[_0x319f('0x2f')]));if(_0x2a73c7[_0x319f('0x33')][_0x319f('0x3b')]){_0x282bfd['where']=_[_0x319f('0x3c')](_0x282bfd[_0x319f('0x39')],{'$or':_[_0x319f('0x3d')](_0x282bfd[_0x319f('0x31')],function(_0x49ea98){var _0x3f1cfe={};_0x3f1cfe[_0x49ea98]={'$like':'%'+_0x2a73c7[_0x319f('0x33')][_0x319f('0x3b')]+'%'};return _0x3f1cfe;})});}_0x282bfd=_[_0x319f('0x3c')]({},_0x282bfd,_0x2a73c7[_0x319f('0x3e')]);return _0xd8447d[_0x319f('0x4e')](_0x282bfd);}})[_0x319f('0x23')](function(_0x956e8){if(_0x956e8){_0x485ffa=_0x956e8[_0x319f('0x34')];if(!_0x2a73c7[_0x319f('0x33')][_0x319f('0x35')](_0x319f('0x36'))){_0x282bfd[_0x319f('0x1b')]=qs[_0x319f('0x1b')](_0x2a73c7[_0x319f('0x33')][_0x319f('0x1b')]);_0x282bfd[_0x319f('0x1d')]=qs['offset'](_0x2a73c7[_0x319f('0x33')][_0x319f('0x1d')]);}return _0xd8447d['getTags'](_0x282bfd);}})[_0x319f('0x23')](function(_0x5b758e){if(_0x5b758e){return _0x5b758e?{'count':_0x485ffa,'rows':_0x5b758e}:null;}})[_0x319f('0x23')](respondWithResult(_0x41d43b,null))['catch'](handleError(_0x41d43b,null));};exports[_0x319f('0x50')]=function(_0x10a776,_0x577ac3,_0x13ade8){if(_0x10a776[_0x319f('0x48')]['id']){delete _0x10a776[_0x319f('0x48')]['id'];}return db['ZendeskConfiguration'][_0x319f('0x4a')]({'where':{'id':_0x10a776[_0x319f('0x44')]['id']}})[_0x319f('0x23')](handleEntityNotFound(_0x577ac3,null))[_0x319f('0x23')](function(_0x23198c){if(_0x23198c){return _0x23198c['setTags'](_0x10a776['body'][_0x319f('0x51')]||[]);}return null;})[_0x319f('0x23')](respondWithResult(_0x577ac3,null))['catch'](handleError(_0x577ac3,null));};
\ No newline at end of file