Built motion from commit b0a9a629.|2.6.33
[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 _0x4784=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','send','index','map','Setting','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','count','includeAll','include','findAll','params','rawAttributes','options','find','body','addLogo','filename','logo','addLogoLogin','file','loginLogo','getLicense','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','server/files/images/logos','defaultLogo','gdpr','securePassword','addPreferred','defaultPreferred','ValidationError','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse'];(function(_0xd618c8,_0x474cc5){var _0x4815e7=function(_0x29343b){while(--_0x29343b){_0xd618c8['push'](_0xd618c8['shift']());}};_0x4815e7(++_0x474cc5);}(_0x4784,0xe4));var _0x4478=function(_0x888ce1,_0x17f5b6){_0x888ce1=_0x888ce1-0x0;var _0x9e0a30=_0x4784[_0x888ce1];return _0x9e0a30;};'use strict';var emlformat=require(_0x4478('0x0'));var rimraf=require(_0x4478('0x1'));var zipdir=require(_0x4478('0x2'));var jsonpatch=require(_0x4478('0x3'));var rp=require(_0x4478('0x4'));var moment=require(_0x4478('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4478('0x6'));var util=require(_0x4478('0x7'));var path=require(_0x4478('0x8'));var sox=require('sox');var csv=require(_0x4478('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4478('0xa'));var _=require('lodash');var squel=require(_0x4478('0xb'));var crypto=require(_0x4478('0xc'));var jsforce=require(_0x4478('0xd'));var deskjs=require(_0x4478('0xe'));var toCsv=require(_0x4478('0x9'));var querystring=require('querystring');var Papa=require(_0x4478('0xf'));var Redis=require(_0x4478('0x10'));var authService=require(_0x4478('0x11'));var qs=require(_0x4478('0x12'));var as=require(_0x4478('0x13'));var hardwareService=require(_0x4478('0x14'));var logger=require(_0x4478('0x15'))('api');var utils=require(_0x4478('0x16'));var config=require(_0x4478('0x17'));var licenseUtil=require(_0x4478('0x18'));var db=require(_0x4478('0x19'))['db'];var jayson=require(_0x4478('0x1a'));var client=jayson[_0x4478('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a4a7f,_0x26b881,_0x4286ce,_0x36dacc){return new BPromise(function(_0x38bcfc,_0x4d74ee){var _0x52cd71=_0x36dacc||client;return _0x52cd71[_0x4478('0x1c')](_0x3a4a7f,_0x4286ce)[_0x4478('0x1d')](function(_0x136574){logger[_0x4478('0x1e')](_0x4478('0x1f'),_0x26b881,_0x4478('0x20'));logger[_0x4478('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x26b881,_0x4478('0x20'),JSON[_0x4478('0x22')](_0x136574));if(_0x136574[_0x4478('0x23')]){if(_0x136574[_0x4478('0x23')][_0x4478('0x24')]===0x1f4){logger['error'](_0x4478('0x1f'),_0x26b881,_0x136574[_0x4478('0x23')]['message']);return _0x4d74ee(_0x136574[_0x4478('0x23')][_0x4478('0x25')]);}logger['error'](_0x4478('0x1f'),_0x26b881,_0x136574[_0x4478('0x23')][_0x4478('0x25')]);return _0x38bcfc(_0x136574[_0x4478('0x23')][_0x4478('0x25')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x26b881,_0x4478('0x20'));_0x38bcfc(_0x136574[_0x4478('0x26')]['message']);}})[_0x4478('0x27')](function(_0x2e99ad){logger[_0x4478('0x23')]('Setting,\x20%s,\x20%s',_0x26b881,_0x2e99ad);_0x4d74ee(_0x2e99ad);});});}function respondWithStatusCode(_0x44cfda,_0xc6717d){_0xc6717d=_0xc6717d||0xcc;return function(_0x12a4aa){if(_0x12a4aa){return _0x44cfda['sendStatus'](_0xc6717d);}return _0x44cfda[_0x4478('0x28')](_0xc6717d)[_0x4478('0x29')]();};}function respondWithResult(_0x573ed5,_0x5ce9f6){_0x5ce9f6=_0x5ce9f6||0xc8;return function(_0x25fcaa){if(_0x25fcaa){return _0x573ed5[_0x4478('0x28')](_0x5ce9f6)[_0x4478('0x2a')](_0x25fcaa);}};}function respondWithFilteredResult(_0x5326fb,_0x3d5405){return function(_0xcf0038){if(_0xcf0038){var _0x46055a=typeof _0x3d5405[_0x4478('0x2b')]===_0x4478('0x2c')&&typeof _0x3d5405[_0x4478('0x2d')]===_0x4478('0x2c');var _0x12104d=_0xcf0038['count'];var _0x88b0c8=_0x46055a?0x0:_0x3d5405[_0x4478('0x2b')];var _0x2ba88b=_0x46055a?_0xcf0038['count']:_0x3d5405['offset']+_0x3d5405[_0x4478('0x2d')];var _0x1b027f;if(_0x2ba88b>=_0x12104d){_0x2ba88b=_0x12104d;_0x1b027f=0xc8;}else{_0x1b027f=0xce;}_0x5326fb[_0x4478('0x28')](_0x1b027f);return _0x5326fb[_0x4478('0x2e')](_0x4478('0x2f'),_0x88b0c8+'-'+_0x2ba88b+'/'+_0x12104d)['json'](_0xcf0038);}return null;};}function patchUpdates(_0x2cbe43){return function(_0x400d50){try{jsonpatch[_0x4478('0x30')](_0x400d50,_0x2cbe43,!![]);}catch(_0x20ff66){return BPromise[_0x4478('0x31')](_0x20ff66);}return _0x400d50[_0x4478('0x32')]();};}function saveUpdates(_0x5dfbd3,_0x2f3514){return function(_0x330266){if(_0x330266){return _0x330266[_0x4478('0x33')](_0x5dfbd3)[_0x4478('0x1d')](function(_0x1635da){return _0x1635da;});}return null;};}function removeEntity(_0x5311e8,_0x3a1615){return function(_0x90e6c){if(_0x90e6c){return _0x90e6c[_0x4478('0x34')]()[_0x4478('0x1d')](function(){_0x5311e8[_0x4478('0x28')](0xcc)[_0x4478('0x29')]();});}};}function handleEntityNotFound(_0x4493e1,_0x4b783a){return function(_0x2e6797){if(!_0x2e6797){_0x4493e1[_0x4478('0x35')](0x194);}return _0x2e6797;};}function handleError(_0x426b08,_0x2ea746){_0x2ea746=_0x2ea746||0x1f4;return function(_0x3d1c9a){logger[_0x4478('0x23')](_0x3d1c9a['stack']);if(_0x3d1c9a[_0x4478('0x36')]){delete _0x3d1c9a['name'];}_0x426b08[_0x4478('0x28')](_0x2ea746)[_0x4478('0x37')](_0x3d1c9a);};}exports[_0x4478('0x38')]=function(_0x1f6dee,_0x270a59){var _0x44f4d1={},_0x2a6c1c={},_0x10119f={'count':0x0,'rows':[]};var _0x1d849f=_[_0x4478('0x39')](db[_0x4478('0x3a')]['rawAttributes'],function(_0x4d686a){return{'name':_0x4d686a[_0x4478('0x3b')],'type':_0x4d686a[_0x4478('0x3c')][_0x4478('0x3d')]};});_0x2a6c1c[_0x4478('0x3e')]=_[_0x4478('0x39')](_0x1d849f,_0x4478('0x36'));_0x2a6c1c['query']=_[_0x4478('0x3f')](_0x1f6dee['query']);_0x2a6c1c[_0x4478('0x40')]=_[_0x4478('0x41')](_0x2a6c1c['model'],_0x2a6c1c[_0x4478('0x42')]);_0x44f4d1['attributes']=_[_0x4478('0x41')](_0x2a6c1c[_0x4478('0x3e')],qs[_0x4478('0x43')](_0x1f6dee[_0x4478('0x42')][_0x4478('0x43')]));_0x44f4d1[_0x4478('0x44')]=_0x44f4d1[_0x4478('0x44')][_0x4478('0x45')]?_0x44f4d1['attributes']:_0x2a6c1c['model'];if(!_0x1f6dee[_0x4478('0x42')][_0x4478('0x46')]('nolimit')){_0x44f4d1['limit']=qs[_0x4478('0x2d')](_0x1f6dee[_0x4478('0x42')]['limit']);_0x44f4d1[_0x4478('0x2b')]=qs[_0x4478('0x2b')](_0x1f6dee['query'][_0x4478('0x2b')]);}_0x44f4d1[_0x4478('0x47')]=qs[_0x4478('0x48')](_0x1f6dee['query'][_0x4478('0x48')]);_0x44f4d1['where']=qs['filters'](_['pick'](_0x1f6dee[_0x4478('0x42')],_0x2a6c1c[_0x4478('0x40')]),_0x1d849f);if(_0x1f6dee['query'][_0x4478('0x49')]){_0x44f4d1[_0x4478('0x4a')]=_[_0x4478('0x4b')](_0x44f4d1['where'],{'$or':_[_0x4478('0x39')](_0x1d849f,function(_0x2379a6){if(_0x2379a6[_0x4478('0x3c')]!==_0x4478('0x4c')){var _0x262210={};_0x262210[_0x2379a6[_0x4478('0x36')]]={'$like':'%'+_0x1f6dee[_0x4478('0x42')]['filter']+'%'};return _0x262210;}})});}_0x44f4d1=_[_0x4478('0x4b')]({},_0x44f4d1,_0x1f6dee['options']);var _0x3db312={'where':_0x44f4d1[_0x4478('0x4a')]};return db[_0x4478('0x3a')][_0x4478('0x4d')](_0x3db312)[_0x4478('0x1d')](function(_0x3fd721){_0x10119f[_0x4478('0x4d')]=_0x3fd721;if(_0x1f6dee['query'][_0x4478('0x4e')]){_0x44f4d1[_0x4478('0x4f')]=[{'all':!![]}];}return db[_0x4478('0x3a')][_0x4478('0x50')](_0x44f4d1);})[_0x4478('0x1d')](function(_0x27ebbd){_0x10119f['rows']=_0x27ebbd;return _0x10119f;})['then'](respondWithFilteredResult(_0x270a59,_0x44f4d1))[_0x4478('0x27')](handleError(_0x270a59,null));};exports['show']=function(_0x80882,_0x482b17){var _0x44d2f3={'raw':![],'where':{'id':_0x80882[_0x4478('0x51')]['id']}},_0x58b475={};_0x58b475['model']=_[_0x4478('0x3f')](db[_0x4478('0x3a')][_0x4478('0x52')]);_0x58b475[_0x4478('0x42')]=_[_0x4478('0x3f')](_0x80882[_0x4478('0x42')]);_0x58b475[_0x4478('0x40')]=_[_0x4478('0x41')](_0x58b475['model'],_0x58b475['query']);_0x44d2f3[_0x4478('0x44')]=_['intersection'](_0x58b475[_0x4478('0x3e')],qs[_0x4478('0x43')](_0x80882[_0x4478('0x42')][_0x4478('0x43')]));_0x44d2f3['attributes']=_0x44d2f3[_0x4478('0x44')]['length']?_0x44d2f3[_0x4478('0x44')]:_0x58b475[_0x4478('0x3e')];if(_0x80882[_0x4478('0x42')]['includeAll']){_0x44d2f3[_0x4478('0x4f')]=[{'all':!![]}];}_0x44d2f3=_[_0x4478('0x4b')]({},_0x44d2f3,_0x80882[_0x4478('0x53')]);return db['Setting'][_0x4478('0x54')](_0x44d2f3)[_0x4478('0x1d')](handleEntityNotFound(_0x482b17,null))[_0x4478('0x1d')](respondWithResult(_0x482b17,null))['catch'](handleError(_0x482b17,null));};exports[_0x4478('0x33')]=function(_0x3764a3,_0x2fc501){if(_0x3764a3[_0x4478('0x55')]['id']){delete _0x3764a3[_0x4478('0x55')]['id'];}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x3764a3[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x2fc501,null))[_0x4478('0x1d')](saveUpdates(_0x3764a3['body'],null))[_0x4478('0x1d')](respondWithResult(_0x2fc501,null))[_0x4478('0x27')](handleError(_0x2fc501,null));};exports[_0x4478('0x56')]=function(_0x31430b,_0xed71b7,_0xecff17){if(_0x31430b['file']&&_0x31430b['file'][_0x4478('0x57')]){_0x31430b[_0x4478('0x55')][_0x4478('0x58')]=_0x31430b['file'][_0x4478('0x57')];}return db['Setting']['find']({'where':{'id':_0x31430b[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0xed71b7,null))['then'](saveUpdates(_0x31430b['body'],null))[_0x4478('0x1d')](respondWithResult(_0xed71b7,null))['catch'](handleError(_0xed71b7,null));};exports[_0x4478('0x59')]=function(_0x8bf4e0,_0x41c852,_0x1bbb58){if(_0x8bf4e0[_0x4478('0x5a')]&&_0x8bf4e0[_0x4478('0x5a')][_0x4478('0x57')]){_0x8bf4e0[_0x4478('0x55')][_0x4478('0x5b')]=_0x8bf4e0[_0x4478('0x5a')][_0x4478('0x57')];}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x8bf4e0[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x41c852,null))[_0x4478('0x1d')](saveUpdates(_0x8bf4e0[_0x4478('0x55')],null))['then'](respondWithResult(_0x41c852,null))[_0x4478('0x27')](handleError(_0x41c852,null));};var utilLicense=require(_0x4478('0x18'));exports['getLogo']=function(_0x39fb95,_0x18d245,_0x46bd0a){var _0x1b3a67='server/files/images/logos';var _0x14ff3d={'custom':![]};return utilLicense[_0x4478('0x5c')]()[_0x4478('0x1d')](function(_0x3281e0){if(_0x3281e0){_0x14ff3d=_0x3281e0;}return db['Setting'][_0x4478('0x54')]({'where':{'id':_0x39fb95[_0x4478('0x51')]['id']},'attributes':[_0x4478('0x58'),_0x4478('0x5b'),_0x4478('0x5d'),_0x4478('0x5e'),'defaultLogo',_0x4478('0x5f'),'defaultPreferred',_0x4478('0x60')],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x18d245,null))[_0x4478('0x1d')](function(_0x5eed02){if(_0x5eed02){var _0xc0055e=_0x5eed02['logo']&&fs[_0x4478('0x61')](path[_0x4478('0x62')](config[_0x4478('0x63')],_0x1b3a67,_[_0x4478('0x64')](_0x5eed02[_0x4478('0x58')])))?path[_0x4478('0x62')](config[_0x4478('0x63')],_0x1b3a67,_[_0x4478('0x64')](_0x5eed02[_0x4478('0x58')])):path['join'](config[_0x4478('0x63')],_0x1b3a67,_[_0x4478('0x64')](_0x4478('0x65')));var _0x2afddb=_0x4478('0x66')+_[_0x4478('0x67')]('logo');if(_0x5eed02[_0x2afddb]||!_0x14ff3d[_0x4478('0x68')]){_0xc0055e=path[_0x4478('0x62')](config[_0x4478('0x63')],_0x1b3a67,_['toLower'](_0x4478('0x65')));}if(!fs[_0x4478('0x61')](_0xc0055e)){throw new db[(_0x4478('0x69'))]['ValidationError'](_['upperFirst'](_0x4478('0x58'))+_0x4478('0x6a'));}return _0x18d245[_0x4478('0x6b')](_0xc0055e);}})[_0x4478('0x27')](handleError(_0x18d245,null));};var utilLicense=require(_0x4478('0x18'));exports['getLogoLogin']=function(_0x570c2e,_0x1c69e0,_0x122997){var _0x35397e=_0x4478('0x6c');var _0x422de5={'custom':![]};return utilLicense['getLicense']()[_0x4478('0x1d')](function(_0x598e88){if(_0x598e88){_0x422de5=_0x598e88;}return db['Setting'][_0x4478('0x54')]({'where':{'id':_0x570c2e['params']['id']},'attributes':[_0x4478('0x58'),_0x4478('0x5b'),_0x4478('0x5d'),_0x4478('0x5e'),_0x4478('0x6d'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x1c69e0,null))['then'](function(_0x4b67fd){if(_0x4b67fd){var _0x3c0ace=_0x4b67fd[_0x4478('0x5b')]&&fs[_0x4478('0x61')](path['join'](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')](_0x4b67fd['loginLogo'])))?path[_0x4478('0x62')](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')](_0x4b67fd[_0x4478('0x5b')])):path[_0x4478('0x62')](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')]('default_loginLogo.svg'));var _0x1b3664=_0x4478('0x66')+_['upperFirst']('loginLogo');if(_0x4b67fd[_0x1b3664]||!_0x422de5[_0x4478('0x68')]){_0x3c0ace=path['join'](config[_0x4478('0x63')],_0x35397e,_[_0x4478('0x64')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x3c0ace)){throw new db[(_0x4478('0x69'))]['ValidationError'](_[_0x4478('0x67')](_0x4478('0x5b'))+_0x4478('0x6a'));}return _0x1c69e0['download'](_0x3c0ace);}})[_0x4478('0x27')](handleError(_0x1c69e0,null));};exports[_0x4478('0x6e')]=function(_0x563f64,_0x5a426c){return db[_0x4478('0x3a')]['find']({'where':{'id':_0x563f64[_0x4478('0x51')]['id']},'attributes':[_0x4478('0x6f')]})[_0x4478('0x1d')](respondWithResult(_0x5a426c,null))[_0x4478('0x27')](handleError(_0x5a426c,null));};exports[_0x4478('0x70')]=function(_0x4bb953,_0x4946e4,_0x4dac0c){if(_0x4bb953[_0x4478('0x5a')]&&_0x4bb953[_0x4478('0x5a')][_0x4478('0x57')]){_0x4bb953['body'][_0x4478('0x5d')]=_0x4bb953['file'][_0x4478('0x57')];}return db['Setting']['find']({'where':{'id':_0x4bb953[_0x4478('0x51')]['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x4946e4,null))['then'](saveUpdates(_0x4bb953['body'],null))[_0x4478('0x1d')](respondWithResult(_0x4946e4,null))[_0x4478('0x27')](handleError(_0x4946e4,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x1eda7f,_0x5ca843,_0x4c8603){var _0x4766e9='server/files/images/logos';var _0x1a07aa={'custom':![]};return utilLicense[_0x4478('0x5c')]()[_0x4478('0x1d')](function(_0x1c719a){if(_0x1c719a){_0x1a07aa=_0x1c719a;}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x1eda7f[_0x4478('0x51')]['id']},'attributes':['logo',_0x4478('0x5b'),'preferred','favicon','defaultLogo',_0x4478('0x5f'),_0x4478('0x71'),_0x4478('0x60')],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x5ca843,null))[_0x4478('0x1d')](function(_0x4f6fb4){if(_0x4f6fb4){var _0x8e5ba8=_0x4f6fb4[_0x4478('0x5d')]&&fs[_0x4478('0x61')](path['join'](config[_0x4478('0x63')],_0x4766e9,_['toLower'](_0x4f6fb4['preferred'])))?path['join'](config[_0x4478('0x63')],_0x4766e9,_[_0x4478('0x64')](_0x4f6fb4['preferred'])):path[_0x4478('0x62')](config['root'],_0x4766e9,_[_0x4478('0x64')]('default_preferred.png'));var _0x41de56=_0x4478('0x66')+_[_0x4478('0x67')](_0x4478('0x5d'));if(_0x4f6fb4[_0x41de56]||!_0x1a07aa[_0x4478('0x68')]||!_0x1a07aa[_0x4478('0x5d')]){_0x8e5ba8=path[_0x4478('0x62')](config['root'],_0x4766e9,_[_0x4478('0x64')]('default_preferred.png'));}if(!fs[_0x4478('0x61')](_0x8e5ba8)){throw new db[(_0x4478('0x69'))][(_0x4478('0x72'))](_['upperFirst'](_0x4478('0x5d'))+'\x20not\x20found');}return _0x5ca843[_0x4478('0x6b')](_0x8e5ba8);}})[_0x4478('0x27')](handleError(_0x5ca843,null));};exports['addFavicon']=function(_0x447d5c,_0x175365,_0x4961e9){if(_0x447d5c[_0x4478('0x5a')]&&_0x447d5c[_0x4478('0x5a')][_0x4478('0x57')]){_0x447d5c[_0x4478('0x55')][_0x4478('0x5e')]=_0x447d5c['file'][_0x4478('0x57')];}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0x447d5c['params']['id']}})[_0x4478('0x1d')](handleEntityNotFound(_0x175365,null))[_0x4478('0x1d')](saveUpdates(_0x447d5c['body'],null))['then'](respondWithResult(_0x175365,null))[_0x4478('0x27')](handleError(_0x175365,null));};var utilLicense=require(_0x4478('0x18'));exports[_0x4478('0x73')]=function(_0xcad87c,_0x9554a2,_0x1c5b20){var _0xf2aa22='server/files/images/logos';var _0x3941e6={'custom':![]};return utilLicense[_0x4478('0x5c')]()[_0x4478('0x1d')](function(_0x160ef3){if(_0x160ef3){_0x3941e6=_0x160ef3;}return db[_0x4478('0x3a')][_0x4478('0x54')]({'where':{'id':_0xcad87c['params']['id']},'attributes':[_0x4478('0x58'),'loginLogo',_0x4478('0x5d'),_0x4478('0x5e'),_0x4478('0x6d'),'defaultLoginLogo',_0x4478('0x71'),_0x4478('0x60')],'raw':!![]});})[_0x4478('0x1d')](handleEntityNotFound(_0x9554a2,null))['then'](function(_0x53873b){if(_0x53873b){var _0x2fdb62=_0x53873b[_0x4478('0x5e')]&&fs['existsSync'](path[_0x4478('0x62')](config['root'],_0xf2aa22,_[_0x4478('0x64')](_0x53873b[_0x4478('0x5e')])))?path[_0x4478('0x62')](config['root'],_0xf2aa22,_[_0x4478('0x64')](_0x53873b[_0x4478('0x5e')])):path[_0x4478('0x62')](config[_0x4478('0x63')],_0xf2aa22,_[_0x4478('0x64')](_0x4478('0x74')));var _0x17d708=_0x4478('0x66')+_['upperFirst']('favicon');if(_0x53873b[_0x17d708]||!_0x3941e6[_0x4478('0x68')]){_0x2fdb62=path['join'](config[_0x4478('0x63')],_0xf2aa22,_[_0x4478('0x64')](_0x4478('0x74')));}if(!fs['existsSync'](_0x2fdb62)){throw new db['Sequelize'][(_0x4478('0x72'))](_[_0x4478('0x67')]('favicon')+_0x4478('0x6a'));}return _0x9554a2[_0x4478('0x6b')](_0x2fdb62);}})['catch'](handleError(_0x9554a2,null));};exports[_0x4478('0x75')]=function(_0x226986,_0x5177b5){var _0x152ddc={'offset':moment()[_0x4478('0x76')]()};_0x152ddc[_0x4478('0x77')]=moment()[_0x4478('0x76')](_0x152ddc[_0x4478('0x2b')])[_0x4478('0x78')](_0x4478('0x79'));return _0x5177b5[_0x4478('0x28')](0xc8)['send'](_0x152ddc);};