Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / intFreshdeskConfiguration / intFreshdeskConfiguration.controller.js
index ee91064..99eceb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23f8=['keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','FreshdeskConfiguration','includeAll','findAll','rows','show','rawAttributes','length','include','create','catch','body','params','find','getFields','findOne','FreshdeskField','pick','nolimit','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query'];(function(_0x179738,_0x4d7001){var _0x317d99=function(_0x4c0ff4){while(--_0x4c0ff4){_0x179738['push'](_0x179738['shift']());}};_0x317d99(++_0x4d7001);}(_0x23f8,0x7c));var _0x823f=function(_0xfdac8,_0x4d06cf){_0xfdac8=_0xfdac8-0x0;var _0x3337cf=_0x23f8[_0xfdac8];return _0x3337cf;};'use strict';var emlformat=require(_0x823f('0x0'));var rimraf=require(_0x823f('0x1'));var zipdir=require(_0x823f('0x2'));var jsonpatch=require(_0x823f('0x3'));var rp=require(_0x823f('0x4'));var moment=require(_0x823f('0x5'));var BPromise=require(_0x823f('0x6'));var Mustache=require(_0x823f('0x7'));var util=require(_0x823f('0x8'));var path=require(_0x823f('0x9'));var sox=require(_0x823f('0xa'));var csv=require(_0x823f('0xb'));var ejs=require(_0x823f('0xc'));var fs=require('fs');var fs_extra=require(_0x823f('0xd'));var _=require(_0x823f('0xe'));var squel=require(_0x823f('0xf'));var crypto=require(_0x823f('0x10'));var jsforce=require(_0x823f('0x11'));var deskjs=require(_0x823f('0x12'));var toCsv=require(_0x823f('0xb'));var querystring=require(_0x823f('0x13'));var Papa=require(_0x823f('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x823f('0x15'));var as=require(_0x823f('0x16'));var hardwareService=require(_0x823f('0x17'));var logger=require('../../config/logger')(_0x823f('0x18'));var utils=require(_0x823f('0x19'));var config=require(_0x823f('0x1a'));var licenseUtil=require(_0x823f('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5682b2,_0x251bcb){_0x251bcb=_0x251bcb||0xcc;return function(_0x1fd75c){if(_0x1fd75c){return _0x5682b2[_0x823f('0x1c')](_0x251bcb);}return _0x5682b2[_0x823f('0x1d')](_0x251bcb)[_0x823f('0x1e')]();};}function respondWithResult(_0x4388de,_0xa9d0a5){_0xa9d0a5=_0xa9d0a5||0xc8;return function(_0x49a39a){if(_0x49a39a){return _0x4388de[_0x823f('0x1d')](_0xa9d0a5)[_0x823f('0x1f')](_0x49a39a);}};}function respondWithFilteredResult(_0x176022,_0xcec49e){return function(_0x2bf6a1){if(_0x2bf6a1){var _0x462c8e=typeof _0xcec49e[_0x823f('0x20')]==='undefined'&&typeof _0xcec49e[_0x823f('0x21')]==='undefined';var _0x3e176d=_0x2bf6a1[_0x823f('0x22')];var _0x20d7bf=_0x462c8e?0x0:_0xcec49e['offset'];var _0x1168e4=_0x462c8e?_0x2bf6a1[_0x823f('0x22')]:_0xcec49e['offset']+_0xcec49e[_0x823f('0x21')];var _0x304fc4;if(_0x1168e4>=_0x3e176d){_0x1168e4=_0x3e176d;_0x304fc4=0xc8;}else{_0x304fc4=0xce;}_0x176022['status'](_0x304fc4);return _0x176022[_0x823f('0x23')](_0x823f('0x24'),_0x20d7bf+'-'+_0x1168e4+'/'+_0x3e176d)['json'](_0x2bf6a1);}return null;};}function patchUpdates(_0x298bc3){return function(_0x13930){try{jsonpatch[_0x823f('0x25')](_0x13930,_0x298bc3,!![]);}catch(_0x1a4056){return BPromise[_0x823f('0x26')](_0x1a4056);}return _0x13930['save']();};}function saveUpdates(_0x196963,_0x39b427){return function(_0x375553){if(_0x375553){return _0x375553[_0x823f('0x27')](_0x196963)['then'](function(_0x336a7a){return _0x336a7a;});}return null;};}function removeEntity(_0x409d97,_0x5ebd20){return function(_0x27a1a6){if(_0x27a1a6){return _0x27a1a6['destroy']()[_0x823f('0x28')](function(){_0x409d97[_0x823f('0x1d')](0xcc)[_0x823f('0x1e')]();});}};}function handleEntityNotFound(_0x158d89,_0x5f0958){return function(_0x3f6683){if(!_0x3f6683){_0x158d89[_0x823f('0x1c')](0x194);}return _0x3f6683;};}function handleError(_0x23b4e0,_0x3976f4){_0x3976f4=_0x3976f4||0x1f4;return function(_0x4c5aab){logger[_0x823f('0x29')](_0x4c5aab[_0x823f('0x2a')]);if(_0x4c5aab[_0x823f('0x2b')]){delete _0x4c5aab[_0x823f('0x2b')];}_0x23b4e0[_0x823f('0x1d')](_0x3976f4)[_0x823f('0x2c')](_0x4c5aab);};}exports[_0x823f('0x2d')]=function(_0x4440cb,_0x3cba87){var _0x42fefb={},_0x4a67fb={},_0x3244be={'count':0x0,'rows':[]};var _0x93e956=_[_0x823f('0x2e')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x26f85e){return{'name':_0x26f85e[_0x823f('0x2f')],'type':_0x26f85e[_0x823f('0x30')][_0x823f('0x31')]};});_0x4a67fb[_0x823f('0x32')]=_[_0x823f('0x2e')](_0x93e956,_0x823f('0x2b'));_0x4a67fb[_0x823f('0x33')]=_[_0x823f('0x34')](_0x4440cb[_0x823f('0x33')]);_0x4a67fb[_0x823f('0x35')]=_['intersection'](_0x4a67fb[_0x823f('0x32')],_0x4a67fb['query']);_0x42fefb['attributes']=_[_0x823f('0x36')](_0x4a67fb['model'],qs[_0x823f('0x37')](_0x4440cb['query'][_0x823f('0x37')]));_0x42fefb[_0x823f('0x38')]=_0x42fefb[_0x823f('0x38')]['length']?_0x42fefb[_0x823f('0x38')]:_0x4a67fb[_0x823f('0x32')];if(!_0x4440cb[_0x823f('0x33')][_0x823f('0x39')]('nolimit')){_0x42fefb['limit']=qs['limit'](_0x4440cb[_0x823f('0x33')][_0x823f('0x21')]);_0x42fefb['offset']=qs[_0x823f('0x20')](_0x4440cb[_0x823f('0x33')][_0x823f('0x20')]);}_0x42fefb[_0x823f('0x3a')]=qs[_0x823f('0x3b')](_0x4440cb['query']['sort']);_0x42fefb[_0x823f('0x3c')]=qs[_0x823f('0x35')](_['pick'](_0x4440cb[_0x823f('0x33')],_0x4a67fb['filters']),_0x93e956);if(_0x4440cb[_0x823f('0x33')][_0x823f('0x3d')]){_0x42fefb[_0x823f('0x3c')]=_[_0x823f('0x3e')](_0x42fefb[_0x823f('0x3c')],{'$or':_['map'](_0x93e956,function(_0x320e0c){if(_0x320e0c[_0x823f('0x30')]!==_0x823f('0x3f')){var _0x309029={};_0x309029[_0x320e0c['name']]={'$like':'%'+_0x4440cb[_0x823f('0x33')][_0x823f('0x3d')]+'%'};return _0x309029;}})});}_0x42fefb=_['merge']({},_0x42fefb,_0x4440cb[_0x823f('0x40')]);var _0x5a2a67={'where':_0x42fefb['where']};return db[_0x823f('0x41')][_0x823f('0x22')](_0x5a2a67)[_0x823f('0x28')](function(_0x1a2613){_0x3244be[_0x823f('0x22')]=_0x1a2613;if(_0x4440cb[_0x823f('0x33')][_0x823f('0x42')]){_0x42fefb['include']=[{'all':!![]}];}return db[_0x823f('0x41')][_0x823f('0x43')](_0x42fefb);})[_0x823f('0x28')](function(_0x17d830){_0x3244be[_0x823f('0x44')]=_0x17d830;return _0x3244be;})['then'](respondWithFilteredResult(_0x3cba87,_0x42fefb))['catch'](handleError(_0x3cba87,null));};exports[_0x823f('0x45')]=function(_0x4eeeb5,_0x10380e){var _0x28b255={'raw':![],'where':{'id':_0x4eeeb5['params']['id']}},_0x41d6f7={};_0x41d6f7['model']=_[_0x823f('0x34')](db[_0x823f('0x41')][_0x823f('0x46')]);_0x41d6f7['query']=_[_0x823f('0x34')](_0x4eeeb5['query']);_0x41d6f7['filters']=_[_0x823f('0x36')](_0x41d6f7['model'],_0x41d6f7[_0x823f('0x33')]);_0x28b255['attributes']=_[_0x823f('0x36')](_0x41d6f7[_0x823f('0x32')],qs[_0x823f('0x37')](_0x4eeeb5[_0x823f('0x33')][_0x823f('0x37')]));_0x28b255[_0x823f('0x38')]=_0x28b255['attributes'][_0x823f('0x47')]?_0x28b255[_0x823f('0x38')]:_0x41d6f7[_0x823f('0x32')];if(_0x4eeeb5[_0x823f('0x33')][_0x823f('0x42')]){_0x28b255[_0x823f('0x48')]=[{'all':!![]}];}_0x28b255=_[_0x823f('0x3e')]({},_0x28b255,_0x4eeeb5[_0x823f('0x40')]);return db[_0x823f('0x41')]['find'](_0x28b255)[_0x823f('0x28')](handleEntityNotFound(_0x10380e,null))['then'](respondWithResult(_0x10380e,null))['catch'](handleError(_0x10380e,null));};exports[_0x823f('0x49')]=function(_0x2d554b,_0x17d7c2){return db[_0x823f('0x41')][_0x823f('0x49')](_0x2d554b['body'],{})[_0x823f('0x28')](respondWithResult(_0x17d7c2,0xc9))[_0x823f('0x4a')](handleError(_0x17d7c2,null));};exports[_0x823f('0x27')]=function(_0x1b6feb,_0xc80333){if(_0x1b6feb[_0x823f('0x4b')]['id']){delete _0x1b6feb[_0x823f('0x4b')]['id'];}return db[_0x823f('0x41')]['find']({'where':{'id':_0x1b6feb[_0x823f('0x4c')]['id']}})[_0x823f('0x28')](handleEntityNotFound(_0xc80333,null))[_0x823f('0x28')](saveUpdates(_0x1b6feb[_0x823f('0x4b')],null))[_0x823f('0x28')](respondWithResult(_0xc80333,null))['catch'](handleError(_0xc80333,null));};exports['destroy']=function(_0xa292ec,_0x969555){return db[_0x823f('0x41')][_0x823f('0x4d')]({'where':{'id':_0xa292ec[_0x823f('0x4c')]['id']}})[_0x823f('0x28')](handleEntityNotFound(_0x969555,null))[_0x823f('0x28')](removeEntity(_0x969555,null))[_0x823f('0x4a')](handleError(_0x969555,null));};exports[_0x823f('0x4e')]=function(_0x280f4d,_0x331aa9,_0x10f73c){var _0xffe36a={};var _0x27c568={};var _0x5e6358;var _0x491c28;return db[_0x823f('0x41')][_0x823f('0x4f')]({'where':{'id':_0x280f4d[_0x823f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x331aa9,null))[_0x823f('0x28')](function(_0x5c56d7){if(_0x5c56d7){_0x5e6358=_0x5c56d7;_0x27c568[_0x823f('0x32')]=_[_0x823f('0x34')](db[_0x823f('0x50')][_0x823f('0x46')]);_0x27c568[_0x823f('0x33')]=_[_0x823f('0x34')](_0x280f4d[_0x823f('0x33')]);_0x27c568[_0x823f('0x35')]=_[_0x823f('0x36')](_0x27c568[_0x823f('0x32')],_0x27c568[_0x823f('0x33')]);_0xffe36a[_0x823f('0x38')]=_[_0x823f('0x36')](_0x27c568[_0x823f('0x32')],qs['fields'](_0x280f4d[_0x823f('0x33')][_0x823f('0x37')]));_0xffe36a[_0x823f('0x38')]=_0xffe36a[_0x823f('0x38')][_0x823f('0x47')]?_0xffe36a['attributes']:_0x27c568[_0x823f('0x32')];_0xffe36a[_0x823f('0x3a')]=qs['sort'](_0x280f4d[_0x823f('0x33')][_0x823f('0x3b')]);_0xffe36a[_0x823f('0x3c')]=qs[_0x823f('0x35')](_[_0x823f('0x51')](_0x280f4d[_0x823f('0x33')],_0x27c568[_0x823f('0x35')]));if(_0x280f4d[_0x823f('0x33')][_0x823f('0x3d')]){_0xffe36a[_0x823f('0x3c')]=_[_0x823f('0x3e')](_0xffe36a['where'],{'$or':_['map'](_0xffe36a['attributes'],function(_0x25d886){var _0xa72633={};_0xa72633[_0x25d886]={'$like':'%'+_0x280f4d['query'][_0x823f('0x3d')]+'%'};return _0xa72633;})});}_0xffe36a=_[_0x823f('0x3e')]({},_0xffe36a,_0x280f4d[_0x823f('0x40')]);return _0x5e6358[_0x823f('0x4e')](_0xffe36a);}})['then'](function(_0x329669){if(_0x329669){_0x491c28=_0x329669['length'];if(!_0x280f4d[_0x823f('0x33')]['hasOwnProperty'](_0x823f('0x52'))){_0xffe36a['limit']=qs[_0x823f('0x21')](_0x280f4d[_0x823f('0x33')][_0x823f('0x21')]);_0xffe36a[_0x823f('0x20')]=qs[_0x823f('0x20')](_0x280f4d[_0x823f('0x33')]['offset']);}return _0x5e6358[_0x823f('0x4e')](_0xffe36a);}})[_0x823f('0x28')](function(_0x33022c){if(_0x33022c){return _0x33022c?{'count':_0x491c28,'rows':_0x33022c}:null;}})[_0x823f('0x28')](respondWithResult(_0x331aa9,null))[_0x823f('0x4a')](handleError(_0x331aa9,null));};exports[_0x823f('0x53')]=function(_0x93514c,_0x4177eb,_0x568696){var _0x4496fd={};var _0x497ec0={};var _0x388a7f;var _0x49c27d;return db['FreshdeskConfiguration'][_0x823f('0x4f')]({'where':{'id':_0x93514c['params']['id']}})[_0x823f('0x28')](handleEntityNotFound(_0x4177eb,null))[_0x823f('0x28')](function(_0x5dec41){if(_0x5dec41){_0x388a7f=_0x5dec41;_0x497ec0[_0x823f('0x32')]=_[_0x823f('0x34')](db[_0x823f('0x50')][_0x823f('0x46')]);_0x497ec0['query']=_['keys'](_0x93514c[_0x823f('0x33')]);_0x497ec0['filters']=_['intersection'](_0x497ec0['model'],_0x497ec0[_0x823f('0x33')]);_0x4496fd['attributes']=_['intersection'](_0x497ec0[_0x823f('0x32')],qs[_0x823f('0x37')](_0x93514c[_0x823f('0x33')][_0x823f('0x37')]));_0x4496fd[_0x823f('0x38')]=_0x4496fd[_0x823f('0x38')]['length']?_0x4496fd[_0x823f('0x38')]:_0x497ec0[_0x823f('0x32')];_0x4496fd[_0x823f('0x3a')]=qs[_0x823f('0x3b')](_0x93514c[_0x823f('0x33')][_0x823f('0x3b')]);_0x4496fd[_0x823f('0x3c')]=qs[_0x823f('0x35')](_[_0x823f('0x51')](_0x93514c[_0x823f('0x33')],_0x497ec0[_0x823f('0x35')]));if(_0x93514c[_0x823f('0x33')]['filter']){_0x4496fd[_0x823f('0x3c')]=_[_0x823f('0x3e')](_0x4496fd['where'],{'$or':_['map'](_0x4496fd['attributes'],function(_0xf945fb){var _0x458817={};_0x458817[_0xf945fb]={'$like':'%'+_0x93514c[_0x823f('0x33')][_0x823f('0x3d')]+'%'};return _0x458817;})});}_0x4496fd=_['merge']({},_0x4496fd,_0x93514c[_0x823f('0x40')]);return _0x388a7f[_0x823f('0x53')](_0x4496fd);}})[_0x823f('0x28')](function(_0x519af6){if(_0x519af6){_0x49c27d=_0x519af6[_0x823f('0x47')];if(!_0x93514c[_0x823f('0x33')][_0x823f('0x39')](_0x823f('0x52'))){_0x4496fd[_0x823f('0x21')]=qs['limit'](_0x93514c['query'][_0x823f('0x21')]);_0x4496fd[_0x823f('0x20')]=qs[_0x823f('0x20')](_0x93514c[_0x823f('0x33')][_0x823f('0x20')]);}return _0x388a7f[_0x823f('0x53')](_0x4496fd);}})['then'](function(_0x25302e){if(_0x25302e){return _0x25302e?{'count':_0x49c27d,'rows':_0x25302e}:null;}})[_0x823f('0x28')](respondWithResult(_0x4177eb,null))[_0x823f('0x4a')](handleError(_0x4177eb,null));};exports['getDescriptions']=function(_0x1ce57e,_0x3e46d9,_0x23bb28){var _0xabf9bc={};var _0x1fa2bb={};var _0x191715;var _0x285684;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x1ce57e[_0x823f('0x4c')]['id']}})[_0x823f('0x28')](handleEntityNotFound(_0x3e46d9,null))[_0x823f('0x28')](function(_0x40d4e5){if(_0x40d4e5){_0x191715=_0x40d4e5;_0x1fa2bb['model']=_['keys'](db[_0x823f('0x50')][_0x823f('0x46')]);_0x1fa2bb[_0x823f('0x33')]=_[_0x823f('0x34')](_0x1ce57e[_0x823f('0x33')]);_0x1fa2bb[_0x823f('0x35')]=_['intersection'](_0x1fa2bb[_0x823f('0x32')],_0x1fa2bb['query']);_0xabf9bc[_0x823f('0x38')]=_[_0x823f('0x36')](_0x1fa2bb[_0x823f('0x32')],qs[_0x823f('0x37')](_0x1ce57e['query'][_0x823f('0x37')]));_0xabf9bc[_0x823f('0x38')]=_0xabf9bc['attributes'][_0x823f('0x47')]?_0xabf9bc[_0x823f('0x38')]:_0x1fa2bb['model'];_0xabf9bc['order']=qs[_0x823f('0x3b')](_0x1ce57e['query'][_0x823f('0x3b')]);_0xabf9bc[_0x823f('0x3c')]=qs[_0x823f('0x35')](_[_0x823f('0x51')](_0x1ce57e['query'],_0x1fa2bb['filters']));if(_0x1ce57e[_0x823f('0x33')][_0x823f('0x3d')]){_0xabf9bc['where']=_[_0x823f('0x3e')](_0xabf9bc['where'],{'$or':_[_0x823f('0x2e')](_0xabf9bc['attributes'],function(_0x311942){var _0x61e1a3={};_0x61e1a3[_0x311942]={'$like':'%'+_0x1ce57e[_0x823f('0x33')][_0x823f('0x3d')]+'%'};return _0x61e1a3;})});}_0xabf9bc=_[_0x823f('0x3e')]({},_0xabf9bc,_0x1ce57e['options']);return _0x191715[_0x823f('0x54')](_0xabf9bc);}})[_0x823f('0x28')](function(_0x15922d){if(_0x15922d){_0x285684=_0x15922d['length'];if(!_0x1ce57e[_0x823f('0x33')][_0x823f('0x39')](_0x823f('0x52'))){_0xabf9bc[_0x823f('0x21')]=qs[_0x823f('0x21')](_0x1ce57e['query']['limit']);_0xabf9bc[_0x823f('0x20')]=qs['offset'](_0x1ce57e[_0x823f('0x33')][_0x823f('0x20')]);}return _0x191715[_0x823f('0x54')](_0xabf9bc);}})['then'](function(_0x336610){if(_0x336610){return _0x336610?{'count':_0x285684,'rows':_0x336610}:null;}})['then'](respondWithResult(_0x3e46d9,null))[_0x823f('0x4a')](handleError(_0x3e46d9,null));};exports[_0x823f('0x55')]=function(_0x92666b,_0x3499ea,_0x441310){var _0x2117cd={};var _0x256f9a={};var _0x53535a;var _0x6389a1;return db[_0x823f('0x41')][_0x823f('0x4f')]({'where':{'id':_0x92666b[_0x823f('0x4c')]['id']}})[_0x823f('0x28')](handleEntityNotFound(_0x3499ea,null))['then'](function(_0x51f34a){if(_0x51f34a){_0x53535a=_0x51f34a;_0x256f9a[_0x823f('0x32')]=_[_0x823f('0x34')](db['Tag'][_0x823f('0x46')]);_0x256f9a[_0x823f('0x33')]=_[_0x823f('0x34')](_0x92666b[_0x823f('0x33')]);_0x256f9a[_0x823f('0x35')]=_[_0x823f('0x36')](_0x256f9a[_0x823f('0x32')],_0x256f9a[_0x823f('0x33')]);_0x2117cd[_0x823f('0x38')]=_['intersection'](_0x256f9a['model'],qs[_0x823f('0x37')](_0x92666b[_0x823f('0x33')][_0x823f('0x37')]));_0x2117cd[_0x823f('0x38')]=_0x2117cd[_0x823f('0x38')][_0x823f('0x47')]?_0x2117cd[_0x823f('0x38')]:_0x256f9a[_0x823f('0x32')];_0x2117cd[_0x823f('0x3a')]=qs[_0x823f('0x3b')](_0x92666b[_0x823f('0x33')][_0x823f('0x3b')]);_0x2117cd[_0x823f('0x3c')]=qs[_0x823f('0x35')](_[_0x823f('0x51')](_0x92666b['query'],_0x256f9a[_0x823f('0x35')]));if(_0x92666b['query'][_0x823f('0x3d')]){_0x2117cd[_0x823f('0x3c')]=_[_0x823f('0x3e')](_0x2117cd[_0x823f('0x3c')],{'$or':_[_0x823f('0x2e')](_0x2117cd[_0x823f('0x38')],function(_0x4bb9e4){var _0xa9778a={};_0xa9778a[_0x4bb9e4]={'$like':'%'+_0x92666b[_0x823f('0x33')][_0x823f('0x3d')]+'%'};return _0xa9778a;})});}_0x2117cd=_['merge']({},_0x2117cd,_0x92666b['options']);return _0x53535a[_0x823f('0x55')](_0x2117cd);}})[_0x823f('0x28')](function(_0x1a552a){if(_0x1a552a){_0x6389a1=_0x1a552a['length'];if(!_0x92666b[_0x823f('0x33')][_0x823f('0x39')]('nolimit')){_0x2117cd['limit']=qs[_0x823f('0x21')](_0x92666b[_0x823f('0x33')][_0x823f('0x21')]);_0x2117cd['offset']=qs['offset'](_0x92666b[_0x823f('0x33')]['offset']);}return _0x53535a[_0x823f('0x55')](_0x2117cd);}})[_0x823f('0x28')](function(_0x4bf492){if(_0x4bf492){return _0x4bf492?{'count':_0x6389a1,'rows':_0x4bf492}:null;}})[_0x823f('0x28')](respondWithResult(_0x3499ea,null))[_0x823f('0x4a')](handleError(_0x3499ea,null));};exports['setTags']=function(_0x409298,_0x1afcc0,_0x47562a){if(_0x409298[_0x823f('0x4b')]['id']){delete _0x409298[_0x823f('0x4b')]['id'];}return db[_0x823f('0x41')][_0x823f('0x4f')]({'where':{'id':_0x409298[_0x823f('0x4c')]['id']}})[_0x823f('0x28')](handleEntityNotFound(_0x1afcc0,null))[_0x823f('0x28')](function(_0x3f2399){if(_0x3f2399){return _0x3f2399[_0x823f('0x56')](_0x409298['body'][_0x823f('0x57')]||[]);}return null;})[_0x823f('0x28')](respondWithResult(_0x1afcc0,null))[_0x823f('0x4a')](handleError(_0x1afcc0,null));};
\ No newline at end of file
+var _0x5a64=['Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getFields','findOne','FreshdeskField','getSubjects','hasOwnProperty','getDescriptions','getTags','Tag','setTags','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set'];(function(_0xdd79be,_0x3bd452){var _0x24a6a5=function(_0x423f5c){while(--_0x423f5c){_0xdd79be['push'](_0xdd79be['shift']());}};_0x24a6a5(++_0x3bd452);}(_0x5a64,0x8a));var _0x45a6=function(_0x575410,_0x316dc8){_0x575410=_0x575410-0x0;var _0x1aa3ae=_0x5a64[_0x575410];return _0x1aa3ae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x45a6('0x0'));var jsonpatch=require(_0x45a6('0x1'));var rp=require(_0x45a6('0x2'));var moment=require('moment');var BPromise=require(_0x45a6('0x3'));var Mustache=require(_0x45a6('0x4'));var util=require(_0x45a6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x45a6('0x6'));var ejs=require(_0x45a6('0x7'));var fs=require('fs');var fs_extra=require(_0x45a6('0x8'));var _=require(_0x45a6('0x9'));var squel=require(_0x45a6('0xa'));var crypto=require('crypto');var jsforce=require(_0x45a6('0xb'));var deskjs=require(_0x45a6('0xc'));var toCsv=require(_0x45a6('0x6'));var querystring=require(_0x45a6('0xd'));var Papa=require(_0x45a6('0xe'));var Redis=require(_0x45a6('0xf'));var authService=require(_0x45a6('0x10'));var qs=require(_0x45a6('0x11'));var as=require(_0x45a6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45a6('0x13'))(_0x45a6('0x14'));var utils=require(_0x45a6('0x15'));var config=require(_0x45a6('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2173d3,_0xbf5a36){_0xbf5a36=_0xbf5a36||0xcc;return function(_0x1ea2b3){if(_0x1ea2b3){return _0x2173d3[_0x45a6('0x17')](_0xbf5a36);}return _0x2173d3[_0x45a6('0x18')](_0xbf5a36)[_0x45a6('0x19')]();};}function respondWithResult(_0xd9700e,_0x283ef2){_0x283ef2=_0x283ef2||0xc8;return function(_0x40149f){if(_0x40149f){return _0xd9700e[_0x45a6('0x18')](_0x283ef2)[_0x45a6('0x1a')](_0x40149f);}};}function respondWithFilteredResult(_0x19c992,_0x53821b){return function(_0x3e70c4){if(_0x3e70c4){var _0x458eb1=typeof _0x53821b['offset']===_0x45a6('0x1b')&&typeof _0x53821b[_0x45a6('0x1c')]===_0x45a6('0x1b');var _0x51a04c=_0x3e70c4['count'];var _0x4b6eab=_0x458eb1?0x0:_0x53821b[_0x45a6('0x1d')];var _0x15c69d=_0x458eb1?_0x3e70c4[_0x45a6('0x1e')]:_0x53821b[_0x45a6('0x1d')]+_0x53821b[_0x45a6('0x1c')];var _0x321f94;if(_0x15c69d>=_0x51a04c){_0x15c69d=_0x51a04c;_0x321f94=0xc8;}else{_0x321f94=0xce;}_0x19c992['status'](_0x321f94);return _0x19c992[_0x45a6('0x1f')](_0x45a6('0x20'),_0x4b6eab+'-'+_0x15c69d+'/'+_0x51a04c)[_0x45a6('0x1a')](_0x3e70c4);}return null;};}function patchUpdates(_0x2888dd){return function(_0x137cf4){try{jsonpatch[_0x45a6('0x21')](_0x137cf4,_0x2888dd,!![]);}catch(_0x36a5c4){return BPromise['reject'](_0x36a5c4);}return _0x137cf4[_0x45a6('0x22')]();};}function saveUpdates(_0xe9ffc3,_0x171c3a){return function(_0xe05b13){if(_0xe05b13){return _0xe05b13[_0x45a6('0x23')](_0xe9ffc3)['then'](function(_0x4bf4b1){return _0x4bf4b1;});}return null;};}function removeEntity(_0x8f5ac4,_0x27a360){return function(_0x7283b0){if(_0x7283b0){return _0x7283b0[_0x45a6('0x24')]()[_0x45a6('0x25')](function(){_0x8f5ac4[_0x45a6('0x18')](0xcc)[_0x45a6('0x19')]();});}};}function handleEntityNotFound(_0x44ead2,_0x5d1107){return function(_0x4c33ca){if(!_0x4c33ca){_0x44ead2[_0x45a6('0x17')](0x194);}return _0x4c33ca;};}function handleError(_0x22b15f,_0x3430b4){_0x3430b4=_0x3430b4||0x1f4;return function(_0x260a03){logger[_0x45a6('0x26')](_0x260a03[_0x45a6('0x27')]);if(_0x260a03[_0x45a6('0x28')]){delete _0x260a03[_0x45a6('0x28')];}_0x22b15f[_0x45a6('0x18')](_0x3430b4)[_0x45a6('0x29')](_0x260a03);};}exports[_0x45a6('0x2a')]=function(_0x5c3f6e,_0xcd6524){var _0xe66b5e={},_0xd88283={},_0x12cd4e={'count':0x0,'rows':[]};var _0x38730e=_[_0x45a6('0x2b')](db[_0x45a6('0x2c')][_0x45a6('0x2d')],function(_0x166e4a){return{'name':_0x166e4a[_0x45a6('0x2e')],'type':_0x166e4a[_0x45a6('0x2f')][_0x45a6('0x30')]};});_0xd88283[_0x45a6('0x31')]=_[_0x45a6('0x2b')](_0x38730e,_0x45a6('0x28'));_0xd88283[_0x45a6('0x32')]=_[_0x45a6('0x33')](_0x5c3f6e[_0x45a6('0x32')]);_0xd88283['filters']=_['intersection'](_0xd88283['model'],_0xd88283[_0x45a6('0x32')]);_0xe66b5e[_0x45a6('0x34')]=_[_0x45a6('0x35')](_0xd88283[_0x45a6('0x31')],qs[_0x45a6('0x36')](_0x5c3f6e[_0x45a6('0x32')][_0x45a6('0x36')]));_0xe66b5e['attributes']=_0xe66b5e[_0x45a6('0x34')]['length']?_0xe66b5e[_0x45a6('0x34')]:_0xd88283['model'];if(!_0x5c3f6e['query']['hasOwnProperty'](_0x45a6('0x37'))){_0xe66b5e[_0x45a6('0x1c')]=qs[_0x45a6('0x1c')](_0x5c3f6e[_0x45a6('0x32')][_0x45a6('0x1c')]);_0xe66b5e[_0x45a6('0x1d')]=qs['offset'](_0x5c3f6e['query'][_0x45a6('0x1d')]);}_0xe66b5e[_0x45a6('0x38')]=qs['sort'](_0x5c3f6e['query'][_0x45a6('0x39')]);_0xe66b5e['where']=qs[_0x45a6('0x3a')](_[_0x45a6('0x3b')](_0x5c3f6e[_0x45a6('0x32')],_0xd88283['filters']),_0x38730e);if(_0x5c3f6e[_0x45a6('0x32')][_0x45a6('0x3c')]){_0xe66b5e[_0x45a6('0x3d')]=_['merge'](_0xe66b5e['where'],{'$or':_[_0x45a6('0x2b')](_0x38730e,function(_0xb4dcf0){if(_0xb4dcf0[_0x45a6('0x2f')]!==_0x45a6('0x3e')){var _0x3f2a85={};_0x3f2a85[_0xb4dcf0[_0x45a6('0x28')]]={'$like':'%'+_0x5c3f6e['query'][_0x45a6('0x3c')]+'%'};return _0x3f2a85;}})});}_0xe66b5e=_[_0x45a6('0x3f')]({},_0xe66b5e,_0x5c3f6e[_0x45a6('0x40')]);var _0x57a29f={'where':_0xe66b5e['where']};return db[_0x45a6('0x2c')][_0x45a6('0x1e')](_0x57a29f)[_0x45a6('0x25')](function(_0x1798e1){_0x12cd4e[_0x45a6('0x1e')]=_0x1798e1;if(_0x5c3f6e[_0x45a6('0x32')][_0x45a6('0x41')]){_0xe66b5e[_0x45a6('0x42')]=[{'all':!![]}];}return db[_0x45a6('0x2c')][_0x45a6('0x43')](_0xe66b5e);})[_0x45a6('0x25')](function(_0x111de5){_0x12cd4e[_0x45a6('0x44')]=_0x111de5;return _0x12cd4e;})[_0x45a6('0x25')](respondWithFilteredResult(_0xcd6524,_0xe66b5e))['catch'](handleError(_0xcd6524,null));};exports[_0x45a6('0x45')]=function(_0x5794e3,_0x3612a3){var _0x45f7f1={'raw':![],'where':{'id':_0x5794e3[_0x45a6('0x46')]['id']}},_0x442615={};_0x442615[_0x45a6('0x31')]=_[_0x45a6('0x33')](db[_0x45a6('0x2c')][_0x45a6('0x2d')]);_0x442615['query']=_[_0x45a6('0x33')](_0x5794e3['query']);_0x442615[_0x45a6('0x3a')]=_[_0x45a6('0x35')](_0x442615[_0x45a6('0x31')],_0x442615[_0x45a6('0x32')]);_0x45f7f1[_0x45a6('0x34')]=_[_0x45a6('0x35')](_0x442615[_0x45a6('0x31')],qs['fields'](_0x5794e3['query'][_0x45a6('0x36')]));_0x45f7f1[_0x45a6('0x34')]=_0x45f7f1[_0x45a6('0x34')][_0x45a6('0x47')]?_0x45f7f1['attributes']:_0x442615['model'];if(_0x5794e3[_0x45a6('0x32')][_0x45a6('0x41')]){_0x45f7f1['include']=[{'all':!![]}];}_0x45f7f1=_[_0x45a6('0x3f')]({},_0x45f7f1,_0x5794e3['options']);return db[_0x45a6('0x2c')][_0x45a6('0x48')](_0x45f7f1)[_0x45a6('0x25')](handleEntityNotFound(_0x3612a3,null))[_0x45a6('0x25')](respondWithResult(_0x3612a3,null))[_0x45a6('0x49')](handleError(_0x3612a3,null));};exports[_0x45a6('0x4a')]=function(_0x4760b6,_0x1b3de0){return db[_0x45a6('0x2c')][_0x45a6('0x4a')](_0x4760b6[_0x45a6('0x4b')],{})['then'](respondWithResult(_0x1b3de0,0xc9))[_0x45a6('0x49')](handleError(_0x1b3de0,null));};exports[_0x45a6('0x23')]=function(_0x4fac9c,_0xf54ddd){if(_0x4fac9c[_0x45a6('0x4b')]['id']){delete _0x4fac9c[_0x45a6('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0x45a6('0x48')]({'where':{'id':_0x4fac9c[_0x45a6('0x46')]['id']}})['then'](handleEntityNotFound(_0xf54ddd,null))['then'](saveUpdates(_0x4fac9c[_0x45a6('0x4b')],null))[_0x45a6('0x25')](respondWithResult(_0xf54ddd,null))[_0x45a6('0x49')](handleError(_0xf54ddd,null));};exports['destroy']=function(_0x568ca6,_0x328e42){return db['FreshdeskConfiguration'][_0x45a6('0x48')]({'where':{'id':_0x568ca6[_0x45a6('0x46')]['id']}})['then'](handleEntityNotFound(_0x328e42,null))['then'](removeEntity(_0x328e42,null))[_0x45a6('0x49')](handleError(_0x328e42,null));};exports[_0x45a6('0x4c')]=function(_0x119241,_0x52488b,_0x2b08a6){var _0x43c02a={};var _0x47c0f4={};var _0x47408a;var _0x5b5528;return db[_0x45a6('0x2c')][_0x45a6('0x4d')]({'where':{'id':_0x119241[_0x45a6('0x46')]['id']}})[_0x45a6('0x25')](handleEntityNotFound(_0x52488b,null))[_0x45a6('0x25')](function(_0x268345){if(_0x268345){_0x47408a=_0x268345;_0x47c0f4['model']=_[_0x45a6('0x33')](db[_0x45a6('0x4e')][_0x45a6('0x2d')]);_0x47c0f4[_0x45a6('0x32')]=_[_0x45a6('0x33')](_0x119241[_0x45a6('0x32')]);_0x47c0f4['filters']=_['intersection'](_0x47c0f4[_0x45a6('0x31')],_0x47c0f4[_0x45a6('0x32')]);_0x43c02a[_0x45a6('0x34')]=_[_0x45a6('0x35')](_0x47c0f4['model'],qs[_0x45a6('0x36')](_0x119241[_0x45a6('0x32')][_0x45a6('0x36')]));_0x43c02a[_0x45a6('0x34')]=_0x43c02a[_0x45a6('0x34')][_0x45a6('0x47')]?_0x43c02a[_0x45a6('0x34')]:_0x47c0f4[_0x45a6('0x31')];_0x43c02a[_0x45a6('0x38')]=qs[_0x45a6('0x39')](_0x119241[_0x45a6('0x32')][_0x45a6('0x39')]);_0x43c02a['where']=qs['filters'](_[_0x45a6('0x3b')](_0x119241[_0x45a6('0x32')],_0x47c0f4[_0x45a6('0x3a')]));if(_0x119241[_0x45a6('0x32')][_0x45a6('0x3c')]){_0x43c02a[_0x45a6('0x3d')]=_[_0x45a6('0x3f')](_0x43c02a[_0x45a6('0x3d')],{'$or':_[_0x45a6('0x2b')](_0x43c02a[_0x45a6('0x34')],function(_0x218465){var _0x35cb91={};_0x35cb91[_0x218465]={'$like':'%'+_0x119241[_0x45a6('0x32')][_0x45a6('0x3c')]+'%'};return _0x35cb91;})});}_0x43c02a=_['merge']({},_0x43c02a,_0x119241[_0x45a6('0x40')]);return _0x47408a[_0x45a6('0x4c')](_0x43c02a);}})[_0x45a6('0x25')](function(_0x5ddb58){if(_0x5ddb58){_0x5b5528=_0x5ddb58[_0x45a6('0x47')];if(!_0x119241[_0x45a6('0x32')]['hasOwnProperty'](_0x45a6('0x37'))){_0x43c02a['limit']=qs[_0x45a6('0x1c')](_0x119241[_0x45a6('0x32')][_0x45a6('0x1c')]);_0x43c02a[_0x45a6('0x1d')]=qs[_0x45a6('0x1d')](_0x119241[_0x45a6('0x32')][_0x45a6('0x1d')]);}return _0x47408a[_0x45a6('0x4c')](_0x43c02a);}})[_0x45a6('0x25')](function(_0x4707d2){if(_0x4707d2){return _0x4707d2?{'count':_0x5b5528,'rows':_0x4707d2}:null;}})[_0x45a6('0x25')](respondWithResult(_0x52488b,null))[_0x45a6('0x49')](handleError(_0x52488b,null));};exports[_0x45a6('0x4f')]=function(_0x316abe,_0x41f93d,_0x950c35){var _0x58ee73={};var _0x28543b={};var _0x463e36;var _0x3ba1db;return db['FreshdeskConfiguration'][_0x45a6('0x4d')]({'where':{'id':_0x316abe['params']['id']}})[_0x45a6('0x25')](handleEntityNotFound(_0x41f93d,null))[_0x45a6('0x25')](function(_0x851e7a){if(_0x851e7a){_0x463e36=_0x851e7a;_0x28543b[_0x45a6('0x31')]=_[_0x45a6('0x33')](db[_0x45a6('0x4e')][_0x45a6('0x2d')]);_0x28543b['query']=_['keys'](_0x316abe[_0x45a6('0x32')]);_0x28543b['filters']=_[_0x45a6('0x35')](_0x28543b[_0x45a6('0x31')],_0x28543b[_0x45a6('0x32')]);_0x58ee73[_0x45a6('0x34')]=_['intersection'](_0x28543b[_0x45a6('0x31')],qs[_0x45a6('0x36')](_0x316abe[_0x45a6('0x32')][_0x45a6('0x36')]));_0x58ee73['attributes']=_0x58ee73[_0x45a6('0x34')][_0x45a6('0x47')]?_0x58ee73[_0x45a6('0x34')]:_0x28543b[_0x45a6('0x31')];_0x58ee73[_0x45a6('0x38')]=qs[_0x45a6('0x39')](_0x316abe[_0x45a6('0x32')][_0x45a6('0x39')]);_0x58ee73[_0x45a6('0x3d')]=qs[_0x45a6('0x3a')](_[_0x45a6('0x3b')](_0x316abe['query'],_0x28543b[_0x45a6('0x3a')]));if(_0x316abe[_0x45a6('0x32')][_0x45a6('0x3c')]){_0x58ee73[_0x45a6('0x3d')]=_['merge'](_0x58ee73['where'],{'$or':_[_0x45a6('0x2b')](_0x58ee73[_0x45a6('0x34')],function(_0x496645){var _0x331ef8={};_0x331ef8[_0x496645]={'$like':'%'+_0x316abe['query'][_0x45a6('0x3c')]+'%'};return _0x331ef8;})});}_0x58ee73=_['merge']({},_0x58ee73,_0x316abe[_0x45a6('0x40')]);return _0x463e36['getSubjects'](_0x58ee73);}})[_0x45a6('0x25')](function(_0x1da1ed){if(_0x1da1ed){_0x3ba1db=_0x1da1ed[_0x45a6('0x47')];if(!_0x316abe['query'][_0x45a6('0x50')](_0x45a6('0x37'))){_0x58ee73[_0x45a6('0x1c')]=qs['limit'](_0x316abe[_0x45a6('0x32')][_0x45a6('0x1c')]);_0x58ee73[_0x45a6('0x1d')]=qs[_0x45a6('0x1d')](_0x316abe[_0x45a6('0x32')][_0x45a6('0x1d')]);}return _0x463e36[_0x45a6('0x4f')](_0x58ee73);}})[_0x45a6('0x25')](function(_0x3850ea){if(_0x3850ea){return _0x3850ea?{'count':_0x3ba1db,'rows':_0x3850ea}:null;}})[_0x45a6('0x25')](respondWithResult(_0x41f93d,null))[_0x45a6('0x49')](handleError(_0x41f93d,null));};exports[_0x45a6('0x51')]=function(_0x46e20c,_0x27a334,_0x43b4fa){var _0x19854a={};var _0x4f925d={};var _0x1ca689;var _0x54b736;return db[_0x45a6('0x2c')][_0x45a6('0x4d')]({'where':{'id':_0x46e20c[_0x45a6('0x46')]['id']}})['then'](handleEntityNotFound(_0x27a334,null))[_0x45a6('0x25')](function(_0x149b71){if(_0x149b71){_0x1ca689=_0x149b71;_0x4f925d[_0x45a6('0x31')]=_[_0x45a6('0x33')](db[_0x45a6('0x4e')][_0x45a6('0x2d')]);_0x4f925d[_0x45a6('0x32')]=_[_0x45a6('0x33')](_0x46e20c['query']);_0x4f925d['filters']=_['intersection'](_0x4f925d[_0x45a6('0x31')],_0x4f925d[_0x45a6('0x32')]);_0x19854a[_0x45a6('0x34')]=_[_0x45a6('0x35')](_0x4f925d[_0x45a6('0x31')],qs[_0x45a6('0x36')](_0x46e20c['query']['fields']));_0x19854a[_0x45a6('0x34')]=_0x19854a[_0x45a6('0x34')][_0x45a6('0x47')]?_0x19854a['attributes']:_0x4f925d[_0x45a6('0x31')];_0x19854a[_0x45a6('0x38')]=qs['sort'](_0x46e20c['query'][_0x45a6('0x39')]);_0x19854a['where']=qs[_0x45a6('0x3a')](_[_0x45a6('0x3b')](_0x46e20c[_0x45a6('0x32')],_0x4f925d['filters']));if(_0x46e20c[_0x45a6('0x32')][_0x45a6('0x3c')]){_0x19854a[_0x45a6('0x3d')]=_[_0x45a6('0x3f')](_0x19854a[_0x45a6('0x3d')],{'$or':_['map'](_0x19854a['attributes'],function(_0x88eebc){var _0xc45062={};_0xc45062[_0x88eebc]={'$like':'%'+_0x46e20c[_0x45a6('0x32')][_0x45a6('0x3c')]+'%'};return _0xc45062;})});}_0x19854a=_[_0x45a6('0x3f')]({},_0x19854a,_0x46e20c[_0x45a6('0x40')]);return _0x1ca689[_0x45a6('0x51')](_0x19854a);}})[_0x45a6('0x25')](function(_0x4c3c3e){if(_0x4c3c3e){_0x54b736=_0x4c3c3e[_0x45a6('0x47')];if(!_0x46e20c[_0x45a6('0x32')]['hasOwnProperty'](_0x45a6('0x37'))){_0x19854a[_0x45a6('0x1c')]=qs[_0x45a6('0x1c')](_0x46e20c[_0x45a6('0x32')]['limit']);_0x19854a[_0x45a6('0x1d')]=qs['offset'](_0x46e20c[_0x45a6('0x32')][_0x45a6('0x1d')]);}return _0x1ca689[_0x45a6('0x51')](_0x19854a);}})[_0x45a6('0x25')](function(_0x4efe86){if(_0x4efe86){return _0x4efe86?{'count':_0x54b736,'rows':_0x4efe86}:null;}})['then'](respondWithResult(_0x27a334,null))[_0x45a6('0x49')](handleError(_0x27a334,null));};exports[_0x45a6('0x52')]=function(_0x44a3e8,_0x249d4c,_0x2f9245){var _0x4eaa92={};var _0x5da9a0={};var _0xdbbd3f;var _0x1f13b8;return db[_0x45a6('0x2c')][_0x45a6('0x4d')]({'where':{'id':_0x44a3e8[_0x45a6('0x46')]['id']}})[_0x45a6('0x25')](handleEntityNotFound(_0x249d4c,null))['then'](function(_0x123c63){if(_0x123c63){_0xdbbd3f=_0x123c63;_0x5da9a0[_0x45a6('0x31')]=_[_0x45a6('0x33')](db[_0x45a6('0x53')][_0x45a6('0x2d')]);_0x5da9a0[_0x45a6('0x32')]=_[_0x45a6('0x33')](_0x44a3e8[_0x45a6('0x32')]);_0x5da9a0[_0x45a6('0x3a')]=_[_0x45a6('0x35')](_0x5da9a0[_0x45a6('0x31')],_0x5da9a0[_0x45a6('0x32')]);_0x4eaa92[_0x45a6('0x34')]=_['intersection'](_0x5da9a0[_0x45a6('0x31')],qs['fields'](_0x44a3e8[_0x45a6('0x32')][_0x45a6('0x36')]));_0x4eaa92[_0x45a6('0x34')]=_0x4eaa92['attributes'][_0x45a6('0x47')]?_0x4eaa92[_0x45a6('0x34')]:_0x5da9a0[_0x45a6('0x31')];_0x4eaa92[_0x45a6('0x38')]=qs[_0x45a6('0x39')](_0x44a3e8[_0x45a6('0x32')][_0x45a6('0x39')]);_0x4eaa92[_0x45a6('0x3d')]=qs[_0x45a6('0x3a')](_['pick'](_0x44a3e8[_0x45a6('0x32')],_0x5da9a0['filters']));if(_0x44a3e8[_0x45a6('0x32')][_0x45a6('0x3c')]){_0x4eaa92[_0x45a6('0x3d')]=_[_0x45a6('0x3f')](_0x4eaa92[_0x45a6('0x3d')],{'$or':_[_0x45a6('0x2b')](_0x4eaa92['attributes'],function(_0x690813){var _0x243548={};_0x243548[_0x690813]={'$like':'%'+_0x44a3e8['query'][_0x45a6('0x3c')]+'%'};return _0x243548;})});}_0x4eaa92=_[_0x45a6('0x3f')]({},_0x4eaa92,_0x44a3e8['options']);return _0xdbbd3f[_0x45a6('0x52')](_0x4eaa92);}})[_0x45a6('0x25')](function(_0x1c66f2){if(_0x1c66f2){_0x1f13b8=_0x1c66f2[_0x45a6('0x47')];if(!_0x44a3e8[_0x45a6('0x32')]['hasOwnProperty']('nolimit')){_0x4eaa92[_0x45a6('0x1c')]=qs[_0x45a6('0x1c')](_0x44a3e8['query']['limit']);_0x4eaa92[_0x45a6('0x1d')]=qs[_0x45a6('0x1d')](_0x44a3e8['query'][_0x45a6('0x1d')]);}return _0xdbbd3f['getTags'](_0x4eaa92);}})[_0x45a6('0x25')](function(_0x26642b){if(_0x26642b){return _0x26642b?{'count':_0x1f13b8,'rows':_0x26642b}:null;}})[_0x45a6('0x25')](respondWithResult(_0x249d4c,null))[_0x45a6('0x49')](handleError(_0x249d4c,null));};exports[_0x45a6('0x54')]=function(_0x1e4028,_0x22a1dc,_0x37649e){if(_0x1e4028[_0x45a6('0x4b')]['id']){delete _0x1e4028[_0x45a6('0x4b')]['id'];}return db[_0x45a6('0x2c')][_0x45a6('0x4d')]({'where':{'id':_0x1e4028[_0x45a6('0x46')]['id']}})['then'](handleEntityNotFound(_0x22a1dc,null))[_0x45a6('0x25')](function(_0x1f70ca){if(_0x1f70ca){return _0x1f70ca[_0x45a6('0x54')](_0x1e4028['body']['ids']||[]);}return null;})[_0x45a6('0x25')](respondWithResult(_0x22a1dc,null))[_0x45a6('0x49')](handleError(_0x22a1dc,null));};
\ No newline at end of file