c92f2109b1514924d005f49917c55ea15770dbd6
[motion2.git] / server / api / setting / setting.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 _0x1930=['set','Content-Range','apply','reject','save','update','stack','name','index','map','Setting','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','include','rows','show','params','includeAll','body','find','filename','file','loginLogo','../../config/license/util','getLogo','getLicense','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','logo','existsSync','join','root','toLower','default_logo.png','default','upperFirst','\x20not\x20found','preferred','default_loginLogo.png','custom','Sequelize','ValidationError','gdpr','addPreferred','getPreferred','favicon','default_preferred.png','download','getFavicon','server/files/images/logos','default_favicon.ico','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset'];(function(_0x1df369,_0x548e39){var _0x3d4239=function(_0x4d4f4c){while(--_0x4d4f4c){_0x1df369['push'](_0x1df369['shift']());}};_0x3d4239(++_0x548e39);}(_0x1930,0x133));var _0x0193=function(_0x2b3d1f,_0x40c8b6){_0x2b3d1f=_0x2b3d1f-0x0;var _0x187469=_0x1930[_0x2b3d1f];return _0x187469;};'use strict';var pdf=require(_0x0193('0x0'));var emlformat=require(_0x0193('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0193('0x2'));var moment=require(_0x0193('0x3'));var BPromise=require(_0x0193('0x4'));var Mustache=require(_0x0193('0x5'));var util=require(_0x0193('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0193('0x7'));var fs=require('fs');var _=require(_0x0193('0x8'));var squel=require(_0x0193('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0193('0xa'));var toCsv=require(_0x0193('0xb'));var querystring=require(_0x0193('0xc'));var Papa=require(_0x0193('0xd'));var Redis=require(_0x0193('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0193('0xf'));var as=require(_0x0193('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0193('0x11'))(_0x0193('0x12'));var utils=require(_0x0193('0x13'));var config=require(_0x0193('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x0193('0x15'));var client=jayson[_0x0193('0x16')][_0x0193('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5dd674,_0x520df2,_0x5729d4){if(_0x5729d4){var _0x55abf2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55abf2[_0x0193('0x18')](_0x520df2)){return _0x5dd674;}else{throw new db['Sequelize']['ValidationError'](_0x0193('0x19'));}}else{return _0x5dd674;}}function respondWithRpcPromise(_0x47fefb,_0x425199,_0x4e1e16,_0x186d8b){return new BPromise(function(_0xe8776a,_0x728f20){var _0x161588=_0x186d8b||client;return _0x161588['request'](_0x47fefb,_0x4e1e16)[_0x0193('0x1a')](function(_0x12bc7c){logger[_0x0193('0x1b')](_0x0193('0x1c'),_0x425199,_0x0193('0x1d'));logger[_0x0193('0x1e')](_0x0193('0x1f'),_0x425199,_0x0193('0x1d'),JSON[_0x0193('0x20')](_0x12bc7c));if(_0x12bc7c['error']){if(_0x12bc7c[_0x0193('0x21')][_0x0193('0x22')]===0x1f4){logger[_0x0193('0x21')](_0x0193('0x1c'),_0x425199,_0x12bc7c[_0x0193('0x21')]['message']);return _0x728f20(_0x12bc7c[_0x0193('0x21')][_0x0193('0x23')]);}logger[_0x0193('0x21')](_0x0193('0x1c'),_0x425199,_0x12bc7c['error']['message']);return _0xe8776a(_0x12bc7c[_0x0193('0x21')][_0x0193('0x23')]);}else{logger[_0x0193('0x1b')]('Setting,\x20%s,\x20%s',_0x425199,_0x0193('0x1d'));_0xe8776a(_0x12bc7c[_0x0193('0x24')][_0x0193('0x23')]);}})[_0x0193('0x25')](function(_0x4d895c){logger['error'](_0x0193('0x1c'),_0x425199,_0x4d895c);_0x728f20(_0x4d895c);});});}function respondWithStatusCode(_0xf30d4,_0x32a251){_0x32a251=_0x32a251||0xcc;return function(_0x2c77c3){if(_0x2c77c3){return _0xf30d4[_0x0193('0x26')](_0x32a251);}return _0xf30d4[_0x0193('0x27')](_0x32a251)[_0x0193('0x28')]();};}function respondWithResult(_0x177816,_0x1aca5b){_0x1aca5b=_0x1aca5b||0xc8;return function(_0x28ca18){if(_0x28ca18){return _0x177816[_0x0193('0x27')](_0x1aca5b)[_0x0193('0x29')](_0x28ca18);}};}function respondWithFilteredResult(_0x4c0d4e,_0x56a261){return function(_0x182d10){if(_0x182d10){var _0x5d7a17=_0x182d10[_0x0193('0x2a')],_0x4fa21a=_0x56a261[_0x0193('0x2b')],_0x11dd37=_0x56a261['offset']+_0x56a261['limit'],_0x32a1ce;if(_0x11dd37>=_0x5d7a17){_0x11dd37=_0x5d7a17;_0x32a1ce=0xc8;}else{_0x32a1ce=0xce;}_0x4c0d4e[_0x0193('0x27')](_0x32a1ce);return _0x4c0d4e[_0x0193('0x2c')](_0x0193('0x2d'),_0x4fa21a+'-'+_0x11dd37+'/'+_0x5d7a17)[_0x0193('0x29')](_0x182d10);}return null;};}function patchUpdates(_0x3489e3){return function(_0x15f5da){try{jsonpatch[_0x0193('0x2e')](_0x15f5da,_0x3489e3,!![]);}catch(_0x4d09cc){return BPromise[_0x0193('0x2f')](_0x4d09cc);}return _0x15f5da[_0x0193('0x30')]();};}function saveUpdates(_0x553c95,_0x1aa776){return function(_0x484030){if(_0x484030){return _0x484030[_0x0193('0x31')](_0x553c95)['then'](function(_0x154f8f){return _0x154f8f;});}return null;};}function removeEntity(_0xf61ed1,_0x3e3073){return function(_0x9b30ab){if(_0x9b30ab){return _0x9b30ab['destroy']()[_0x0193('0x1a')](function(){_0xf61ed1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4db4f4,_0x1076d7){return function(_0x438f06){if(!_0x438f06){_0x4db4f4[_0x0193('0x26')](0x194);}return _0x438f06;};}function handleError(_0x3b9a60,_0x4b1218){_0x4b1218=_0x4b1218||0x1f4;return function(_0x348f94){logger[_0x0193('0x21')](_0x348f94[_0x0193('0x32')]);if(_0x348f94['name']){delete _0x348f94[_0x0193('0x33')];}_0x3b9a60['status'](_0x4b1218)['send'](_0x348f94);};}exports[_0x0193('0x34')]=function(_0x1ab688,_0xf5ba7c){var _0x3a36e8={},_0x558a4a={},_0x240a4d={'count':0x0,'rows':[]};var _0x5407da=_[_0x0193('0x35')](db[_0x0193('0x36')][_0x0193('0x37')],function(_0x50364b){return{'name':_0x50364b[_0x0193('0x38')],'type':_0x50364b['type'][_0x0193('0x39')]};});_0x558a4a[_0x0193('0x3a')]=_[_0x0193('0x35')](_0x5407da,_0x0193('0x33'));_0x558a4a['query']=_[_0x0193('0x3b')](_0x1ab688[_0x0193('0x3c')]);_0x558a4a['filters']=_[_0x0193('0x3d')](_0x558a4a[_0x0193('0x3a')],_0x558a4a['query']);_0x3a36e8['attributes']=_[_0x0193('0x3d')](_0x558a4a['model'],qs[_0x0193('0x3e')](_0x1ab688['query'][_0x0193('0x3e')]));_0x3a36e8[_0x0193('0x3f')]=_0x3a36e8[_0x0193('0x3f')][_0x0193('0x40')]?_0x3a36e8[_0x0193('0x3f')]:_0x558a4a[_0x0193('0x3a')];if(!_0x1ab688[_0x0193('0x3c')][_0x0193('0x41')](_0x0193('0x42'))){_0x3a36e8['limit']=qs[_0x0193('0x43')](_0x1ab688[_0x0193('0x3c')][_0x0193('0x43')]);_0x3a36e8[_0x0193('0x2b')]=qs[_0x0193('0x2b')](_0x1ab688[_0x0193('0x3c')][_0x0193('0x2b')]);}_0x3a36e8[_0x0193('0x44')]=qs[_0x0193('0x45')](_0x1ab688[_0x0193('0x3c')][_0x0193('0x45')]);_0x3a36e8['where']=qs['filters'](_[_0x0193('0x46')](_0x1ab688[_0x0193('0x3c')],_0x558a4a[_0x0193('0x47')]),_0x5407da);if(_0x1ab688['query'][_0x0193('0x48')]){_0x3a36e8[_0x0193('0x49')]=_['merge'](_0x3a36e8['where'],{'$or':_[_0x0193('0x35')](_0x5407da,function(_0x51e7dd){if(_0x51e7dd['type']!==_0x0193('0x4a')){var _0x24df2f={};_0x24df2f[_0x51e7dd[_0x0193('0x33')]]={'$like':'%'+_0x1ab688[_0x0193('0x3c')]['filter']+'%'};return _0x24df2f;}})});}_0x3a36e8=_[_0x0193('0x4b')]({},_0x3a36e8,_0x1ab688[_0x0193('0x4c')]);var _0x369388={'where':_0x3a36e8['where']};return db[_0x0193('0x36')][_0x0193('0x2a')](_0x369388)['then'](function(_0x2350ce){_0x240a4d['count']=_0x2350ce;if(_0x1ab688[_0x0193('0x3c')]['includeAll']){_0x3a36e8[_0x0193('0x4d')]=[{'all':!![]}];}return db[_0x0193('0x36')]['findAll'](_0x3a36e8);})[_0x0193('0x1a')](function(_0x954990){_0x240a4d[_0x0193('0x4e')]=_0x954990;return _0x240a4d;})['then'](respondWithFilteredResult(_0xf5ba7c,_0x3a36e8))[_0x0193('0x25')](handleError(_0xf5ba7c,null));};exports[_0x0193('0x4f')]=function(_0x2f86d3,_0x41525a){var _0x574579={'raw':![],'where':{'id':_0x2f86d3[_0x0193('0x50')]['id']}},_0x481486={};_0x481486[_0x0193('0x3a')]=_[_0x0193('0x3b')](db[_0x0193('0x36')][_0x0193('0x37')]);_0x481486[_0x0193('0x3c')]=_[_0x0193('0x3b')](_0x2f86d3['query']);_0x481486[_0x0193('0x47')]=_[_0x0193('0x3d')](_0x481486['model'],_0x481486[_0x0193('0x3c')]);_0x574579[_0x0193('0x3f')]=_['intersection'](_0x481486['model'],qs['fields'](_0x2f86d3['query'][_0x0193('0x3e')]));_0x574579[_0x0193('0x3f')]=_0x574579[_0x0193('0x3f')][_0x0193('0x40')]?_0x574579[_0x0193('0x3f')]:_0x481486[_0x0193('0x3a')];if(_0x2f86d3[_0x0193('0x3c')][_0x0193('0x51')]){_0x574579['include']=[{'all':!![]}];}_0x574579=_[_0x0193('0x4b')]({},_0x574579,_0x2f86d3[_0x0193('0x4c')]);return db[_0x0193('0x36')]['find'](_0x574579)[_0x0193('0x1a')](handleEntityNotFound(_0x41525a,null))['then'](respondWithResult(_0x41525a,null))[_0x0193('0x25')](handleError(_0x41525a,null));};exports[_0x0193('0x31')]=function(_0x40d00e,_0x28d3bb){if(_0x40d00e[_0x0193('0x52')]['id']){delete _0x40d00e[_0x0193('0x52')]['id'];}return db['Setting'][_0x0193('0x53')]({'where':{'id':_0x40d00e[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x28d3bb,null))['then'](saveUpdates(_0x40d00e[_0x0193('0x52')],null))[_0x0193('0x1a')](respondWithResult(_0x28d3bb,null))['catch'](handleError(_0x28d3bb,null));};exports['addLogo']=function(_0x564ad9,_0x1cf364,_0x12f630){if(_0x564ad9['file']&&_0x564ad9['file'][_0x0193('0x54')]){_0x564ad9['body']['logo']=_0x564ad9[_0x0193('0x55')][_0x0193('0x54')];}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x564ad9[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x1cf364,null))['then'](saveUpdates(_0x564ad9[_0x0193('0x52')],null))[_0x0193('0x1a')](respondWithResult(_0x1cf364,null))[_0x0193('0x25')](handleError(_0x1cf364,null));};exports['addLogoLogin']=function(_0x28db46,_0x298107,_0x20ae37){if(_0x28db46['file']&&_0x28db46[_0x0193('0x55')][_0x0193('0x54')]){_0x28db46[_0x0193('0x52')][_0x0193('0x56')]=_0x28db46[_0x0193('0x55')][_0x0193('0x54')];}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x28db46[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x298107,null))['then'](saveUpdates(_0x28db46[_0x0193('0x52')],null))[_0x0193('0x1a')](respondWithResult(_0x298107,null))[_0x0193('0x25')](handleError(_0x298107,null));};var utilLicense=require(_0x0193('0x57'));exports[_0x0193('0x58')]=function(_0x41806a,_0x3de32d,_0x221537){var _0x972571='server/files/images/logos';var _0x2ab52d={'custom':![]};return utilLicense[_0x0193('0x59')]()[_0x0193('0x1a')](function(_0x519e42){if(_0x519e42){_0x2ab52d=_0x519e42;}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x41806a[_0x0193('0x50')]['id']},'attributes':['logo',_0x0193('0x56'),'preferred','favicon',_0x0193('0x5a'),_0x0193('0x5b'),_0x0193('0x5c'),_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0x3de32d,null))[_0x0193('0x1a')](function(_0xbcb1c8){if(_0xbcb1c8){var _0x2d3026=_0xbcb1c8[_0x0193('0x5e')]&&fs[_0x0193('0x5f')](path[_0x0193('0x60')](config[_0x0193('0x61')],_0x972571,_[_0x0193('0x62')](_0xbcb1c8[_0x0193('0x5e')])))?path['join'](config['root'],_0x972571,_[_0x0193('0x62')](_0xbcb1c8[_0x0193('0x5e')])):path['join'](config[_0x0193('0x61')],_0x972571,_[_0x0193('0x62')](_0x0193('0x63')));var _0x15d021=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x5e'));if(_0xbcb1c8[_0x15d021]||!_0x2ab52d['custom']){_0x2d3026=path['join'](config[_0x0193('0x61')],_0x972571,_['toLower'](_0x0193('0x63')));}if(!fs[_0x0193('0x5f')](_0x2d3026)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x0193('0x5e'))+_0x0193('0x66'));}return _0x3de32d['download'](_0x2d3026);}})[_0x0193('0x25')](handleError(_0x3de32d,null));};var utilLicense=require(_0x0193('0x57'));exports['getLogoLogin']=function(_0x237c65,_0xc91613,_0x21353a){var _0x2eb88f='server/files/images/logos';var _0x79fce6={'custom':![]};return utilLicense['getLicense']()[_0x0193('0x1a')](function(_0xe861eb){if(_0xe861eb){_0x79fce6=_0xe861eb;}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x237c65[_0x0193('0x50')]['id']},'attributes':[_0x0193('0x5e'),_0x0193('0x56'),_0x0193('0x67'),'favicon',_0x0193('0x5a'),_0x0193('0x5b'),_0x0193('0x5c'),_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0xc91613,null))[_0x0193('0x1a')](function(_0x57f203){if(_0x57f203){var _0x27d4e6=_0x57f203['loginLogo']&&fs[_0x0193('0x5f')](path['join'](config['root'],_0x2eb88f,_['toLower'](_0x57f203['loginLogo'])))?path['join'](config[_0x0193('0x61')],_0x2eb88f,_[_0x0193('0x62')](_0x57f203[_0x0193('0x56')])):path[_0x0193('0x60')](config[_0x0193('0x61')],_0x2eb88f,_['toLower'](_0x0193('0x68')));var _0x4b72a3=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x56'));if(_0x57f203[_0x4b72a3]||!_0x79fce6[_0x0193('0x69')]){_0x27d4e6=path[_0x0193('0x60')](config[_0x0193('0x61')],_0x2eb88f,_[_0x0193('0x62')](_0x0193('0x68')));}if(!fs[_0x0193('0x5f')](_0x27d4e6)){throw new db[(_0x0193('0x6a'))][(_0x0193('0x6b'))](_[_0x0193('0x65')]('loginLogo')+_0x0193('0x66'));}return _0xc91613['download'](_0x27d4e6);}})[_0x0193('0x25')](handleError(_0xc91613,null));};exports[_0x0193('0x6c')]=function(_0x3e5c33,_0x56901d){return db['Setting'][_0x0193('0x53')]({'where':{'id':_0x3e5c33[_0x0193('0x50')]['id']},'attributes':['securePassword']})[_0x0193('0x1a')](respondWithResult(_0x56901d,null))[_0x0193('0x25')](handleError(_0x56901d,null));};exports[_0x0193('0x6d')]=function(_0x47e7bb,_0x2509f5,_0x14efaa){if(_0x47e7bb[_0x0193('0x55')]&&_0x47e7bb[_0x0193('0x55')][_0x0193('0x54')]){_0x47e7bb[_0x0193('0x52')][_0x0193('0x67')]=_0x47e7bb[_0x0193('0x55')]['filename'];}return db[_0x0193('0x36')][_0x0193('0x53')]({'where':{'id':_0x47e7bb[_0x0193('0x50')]['id']}})['then'](handleEntityNotFound(_0x2509f5,null))['then'](saveUpdates(_0x47e7bb['body'],null))[_0x0193('0x1a')](respondWithResult(_0x2509f5,null))[_0x0193('0x25')](handleError(_0x2509f5,null));};var utilLicense=require('../../config/license/util');exports[_0x0193('0x6e')]=function(_0x3758c7,_0x415aa3,_0x5c7228){var _0x24efab='server/files/images/logos';var _0x402e76={'custom':![]};return utilLicense[_0x0193('0x59')]()[_0x0193('0x1a')](function(_0x495870){if(_0x495870){_0x402e76=_0x495870;}return db['Setting'][_0x0193('0x53')]({'where':{'id':_0x3758c7[_0x0193('0x50')]['id']},'attributes':[_0x0193('0x5e'),_0x0193('0x56'),_0x0193('0x67'),_0x0193('0x6f'),_0x0193('0x5a'),_0x0193('0x5b'),'defaultPreferred',_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0x415aa3,null))[_0x0193('0x1a')](function(_0x299a84){if(_0x299a84){var _0xe8a254=_0x299a84[_0x0193('0x67')]&&fs[_0x0193('0x5f')](path[_0x0193('0x60')](config[_0x0193('0x61')],_0x24efab,_[_0x0193('0x62')](_0x299a84['preferred'])))?path[_0x0193('0x60')](config['root'],_0x24efab,_[_0x0193('0x62')](_0x299a84[_0x0193('0x67')])):path[_0x0193('0x60')](config[_0x0193('0x61')],_0x24efab,_[_0x0193('0x62')]('default_preferred.png'));var _0x3da01a=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x67'));if(_0x299a84[_0x3da01a]||!_0x402e76[_0x0193('0x69')]||!_0x402e76[_0x0193('0x67')]){_0xe8a254=path['join'](config[_0x0193('0x61')],_0x24efab,_['toLower'](_0x0193('0x70')));}if(!fs[_0x0193('0x5f')](_0xe8a254)){throw new db[(_0x0193('0x6a'))]['ValidationError'](_[_0x0193('0x65')](_0x0193('0x67'))+_0x0193('0x66'));}return _0x415aa3[_0x0193('0x71')](_0xe8a254);}})[_0x0193('0x25')](handleError(_0x415aa3,null));};exports['addFavicon']=function(_0xf0e74,_0x387634,_0x2bb84c){if(_0xf0e74[_0x0193('0x55')]&&_0xf0e74[_0x0193('0x55')]['filename']){_0xf0e74[_0x0193('0x52')]['favicon']=_0xf0e74[_0x0193('0x55')][_0x0193('0x54')];}return db['Setting'][_0x0193('0x53')]({'where':{'id':_0xf0e74[_0x0193('0x50')]['id']}})[_0x0193('0x1a')](handleEntityNotFound(_0x387634,null))[_0x0193('0x1a')](saveUpdates(_0xf0e74[_0x0193('0x52')],null))['then'](respondWithResult(_0x387634,null))[_0x0193('0x25')](handleError(_0x387634,null));};var utilLicense=require('../../config/license/util');exports[_0x0193('0x72')]=function(_0x347290,_0x3de641,_0x1fde56){var _0xdc0fa0=_0x0193('0x73');var _0x56b5fb={'custom':![]};return utilLicense['getLicense']()[_0x0193('0x1a')](function(_0xb5875d){if(_0xb5875d){_0x56b5fb=_0xb5875d;}return db['Setting']['find']({'where':{'id':_0x347290[_0x0193('0x50')]['id']},'attributes':[_0x0193('0x5e'),'loginLogo',_0x0193('0x67'),'favicon','defaultLogo',_0x0193('0x5b'),'defaultPreferred',_0x0193('0x5d')],'raw':!![]});})[_0x0193('0x1a')](handleEntityNotFound(_0x3de641,null))['then'](function(_0x5da18a){if(_0x5da18a){var _0x4a1b5c=_0x5da18a[_0x0193('0x6f')]&&fs[_0x0193('0x5f')](path['join'](config[_0x0193('0x61')],_0xdc0fa0,_[_0x0193('0x62')](_0x5da18a['favicon'])))?path[_0x0193('0x60')](config[_0x0193('0x61')],_0xdc0fa0,_['toLower'](_0x5da18a[_0x0193('0x6f')])):path[_0x0193('0x60')](config['root'],_0xdc0fa0,_[_0x0193('0x62')](_0x0193('0x74')));var _0x34b1fc=_0x0193('0x64')+_[_0x0193('0x65')](_0x0193('0x6f'));if(_0x5da18a[_0x34b1fc]||!_0x56b5fb[_0x0193('0x69')]){_0x4a1b5c=path[_0x0193('0x60')](config['root'],_0xdc0fa0,_[_0x0193('0x62')](_0x0193('0x74')));}if(!fs[_0x0193('0x5f')](_0x4a1b5c)){throw new db['Sequelize'][(_0x0193('0x6b'))](_[_0x0193('0x65')](_0x0193('0x6f'))+_0x0193('0x66'));}return _0x3de641[_0x0193('0x71')](_0x4a1b5c);}})['catch'](handleError(_0x3de641,null));};