Built motion from commit 753c950e.|2.5.42
[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 _0x43f7=['defaultFavicon','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','existsSync','default_loginLogo.svg','default','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','status','end','json','offset','undefined','limit','count','apply','update','destroy','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','body','find','params','addLogo','file','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred'];(function(_0x5713af,_0x2fb312){var _0x31ef76=function(_0x2c9378){while(--_0x2c9378){_0x5713af['push'](_0x5713af['shift']());}};_0x31ef76(++_0x2fb312);}(_0x43f7,0x8e));var _0x743f=function(_0x3fcedd,_0xc3c004){_0x3fcedd=_0x3fcedd-0x0;var _0x2af2f3=_0x43f7[_0x3fcedd];return _0x2af2f3;};'use strict';var emlformat=require(_0x743f('0x0'));var rimraf=require(_0x743f('0x1'));var zipdir=require(_0x743f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x743f('0x3'));var Mustache=require(_0x743f('0x4'));var util=require(_0x743f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x743f('0x6'));var ejs=require(_0x743f('0x7'));var fs=require('fs');var fs_extra=require(_0x743f('0x8'));var _=require('lodash');var squel=require(_0x743f('0x9'));var crypto=require(_0x743f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x743f('0xb'));var toCsv=require(_0x743f('0x6'));var querystring=require(_0x743f('0xc'));var Papa=require(_0x743f('0xd'));var Redis=require(_0x743f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x743f('0xf'));var as=require(_0x743f('0x10'));var hardwareService=require(_0x743f('0x11'));var logger=require('../../config/logger')(_0x743f('0x12'));var utils=require(_0x743f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x743f('0x14'));var db=require(_0x743f('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x743f('0x16')][_0x743f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x42fa59,_0xf37fc7,_0x3b9197,_0x9f3e98){return new BPromise(function(_0x2393d1,_0x57016d){var _0x1574f3=_0x9f3e98||client;return _0x1574f3[_0x743f('0x18')](_0x42fa59,_0x3b9197)[_0x743f('0x19')](function(_0x2db8a6){logger[_0x743f('0x1a')](_0x743f('0x1b'),_0xf37fc7,_0x743f('0x1c'));logger[_0x743f('0x1d')](_0x743f('0x1e'),_0xf37fc7,_0x743f('0x1c'),JSON['stringify'](_0x2db8a6));if(_0x2db8a6['error']){if(_0x2db8a6[_0x743f('0x1f')][_0x743f('0x20')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0xf37fc7,_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);return _0x57016d(_0x2db8a6['error']['message']);}logger[_0x743f('0x1f')](_0x743f('0x1b'),_0xf37fc7,_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);return _0x2393d1(_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);}else{logger['info'](_0x743f('0x1b'),_0xf37fc7,_0x743f('0x1c'));_0x2393d1(_0x2db8a6['result'][_0x743f('0x21')]);}})['catch'](function(_0x40332b){logger[_0x743f('0x1f')](_0x743f('0x1b'),_0xf37fc7,_0x40332b);_0x57016d(_0x40332b);});});}function respondWithStatusCode(_0x506a31,_0x1c033c){_0x1c033c=_0x1c033c||0xcc;return function(_0x540f6b){if(_0x540f6b){return _0x506a31['sendStatus'](_0x1c033c);}return _0x506a31[_0x743f('0x22')](_0x1c033c)[_0x743f('0x23')]();};}function respondWithResult(_0x1e5baa,_0x342b65){_0x342b65=_0x342b65||0xc8;return function(_0x4849d7){if(_0x4849d7){return _0x1e5baa[_0x743f('0x22')](_0x342b65)[_0x743f('0x24')](_0x4849d7);}};}function respondWithFilteredResult(_0x187e93,_0x2e9215){return function(_0x5c6313){if(_0x5c6313){var _0xf93c45=typeof _0x2e9215[_0x743f('0x25')]===_0x743f('0x26')&&typeof _0x2e9215[_0x743f('0x27')]===_0x743f('0x26');var _0x305fc2=_0x5c6313['count'];var _0x5dee6d=_0xf93c45?0x0:_0x2e9215['offset'];var _0x16bbb5=_0xf93c45?_0x5c6313[_0x743f('0x28')]:_0x2e9215[_0x743f('0x25')]+_0x2e9215['limit'];var _0x5e39a2;if(_0x16bbb5>=_0x305fc2){_0x16bbb5=_0x305fc2;_0x5e39a2=0xc8;}else{_0x5e39a2=0xce;}_0x187e93[_0x743f('0x22')](_0x5e39a2);return _0x187e93['set']('Content-Range',_0x5dee6d+'-'+_0x16bbb5+'/'+_0x305fc2)[_0x743f('0x24')](_0x5c6313);}return null;};}function patchUpdates(_0x448899){return function(_0x202f9f){try{jsonpatch[_0x743f('0x29')](_0x202f9f,_0x448899,!![]);}catch(_0x17e185){return BPromise['reject'](_0x17e185);}return _0x202f9f['save']();};}function saveUpdates(_0x52cfb1,_0x25160c){return function(_0x2db3f9){if(_0x2db3f9){return _0x2db3f9[_0x743f('0x2a')](_0x52cfb1)['then'](function(_0x463268){return _0x463268;});}return null;};}function removeEntity(_0x59dd3d,_0x328834){return function(_0x48ce5c){if(_0x48ce5c){return _0x48ce5c[_0x743f('0x2b')]()['then'](function(){_0x59dd3d[_0x743f('0x22')](0xcc)[_0x743f('0x23')]();});}};}function handleEntityNotFound(_0x5dfb14,_0x54eb48){return function(_0x33d4ab){if(!_0x33d4ab){_0x5dfb14[_0x743f('0x2c')](0x194);}return _0x33d4ab;};}function handleError(_0x401eea,_0x42eee2){_0x42eee2=_0x42eee2||0x1f4;return function(_0x279318){logger[_0x743f('0x1f')](_0x279318[_0x743f('0x2d')]);if(_0x279318[_0x743f('0x2e')]){delete _0x279318[_0x743f('0x2e')];}_0x401eea[_0x743f('0x22')](_0x42eee2)[_0x743f('0x2f')](_0x279318);};}exports[_0x743f('0x30')]=function(_0xf4cd45,_0x2f59d3){var _0x169074={},_0x54633b={},_0x54c0f1={'count':0x0,'rows':[]};var _0x692233=_[_0x743f('0x31')](db[_0x743f('0x32')][_0x743f('0x33')],function(_0x592738){return{'name':_0x592738[_0x743f('0x34')],'type':_0x592738['type']['key']};});_0x54633b['model']=_[_0x743f('0x31')](_0x692233,_0x743f('0x2e'));_0x54633b[_0x743f('0x35')]=_[_0x743f('0x36')](_0xf4cd45[_0x743f('0x35')]);_0x54633b[_0x743f('0x37')]=_[_0x743f('0x38')](_0x54633b[_0x743f('0x39')],_0x54633b[_0x743f('0x35')]);_0x169074[_0x743f('0x3a')]=_['intersection'](_0x54633b[_0x743f('0x39')],qs[_0x743f('0x3b')](_0xf4cd45['query'][_0x743f('0x3b')]));_0x169074['attributes']=_0x169074['attributes'][_0x743f('0x3c')]?_0x169074['attributes']:_0x54633b[_0x743f('0x39')];if(!_0xf4cd45[_0x743f('0x35')]['hasOwnProperty'](_0x743f('0x3d'))){_0x169074['limit']=qs[_0x743f('0x27')](_0xf4cd45[_0x743f('0x35')][_0x743f('0x27')]);_0x169074['offset']=qs[_0x743f('0x25')](_0xf4cd45[_0x743f('0x35')][_0x743f('0x25')]);}_0x169074['order']=qs[_0x743f('0x3e')](_0xf4cd45['query'][_0x743f('0x3e')]);_0x169074[_0x743f('0x3f')]=qs['filters'](_[_0x743f('0x40')](_0xf4cd45['query'],_0x54633b['filters']),_0x692233);if(_0xf4cd45[_0x743f('0x35')]['filter']){_0x169074[_0x743f('0x3f')]=_[_0x743f('0x41')](_0x169074[_0x743f('0x3f')],{'$or':_[_0x743f('0x31')](_0x692233,function(_0x141b35){if(_0x141b35[_0x743f('0x42')]!==_0x743f('0x43')){var _0x33e453={};_0x33e453[_0x141b35['name']]={'$like':'%'+_0xf4cd45[_0x743f('0x35')][_0x743f('0x44')]+'%'};return _0x33e453;}})});}_0x169074=_['merge']({},_0x169074,_0xf4cd45[_0x743f('0x45')]);var _0x381fe0={'where':_0x169074['where']};return db['Setting'][_0x743f('0x28')](_0x381fe0)[_0x743f('0x19')](function(_0xb09d1a){_0x54c0f1[_0x743f('0x28')]=_0xb09d1a;if(_0xf4cd45[_0x743f('0x35')][_0x743f('0x46')]){_0x169074[_0x743f('0x47')]=[{'all':!![]}];}return db[_0x743f('0x32')][_0x743f('0x48')](_0x169074);})[_0x743f('0x19')](function(_0x3c6678){_0x54c0f1[_0x743f('0x49')]=_0x3c6678;return _0x54c0f1;})['then'](respondWithFilteredResult(_0x2f59d3,_0x169074))[_0x743f('0x4a')](handleError(_0x2f59d3,null));};exports[_0x743f('0x4b')]=function(_0x1916b4,_0x1b5a7f){var _0x944cfc={'raw':![],'where':{'id':_0x1916b4['params']['id']}},_0x59d3bf={};_0x59d3bf[_0x743f('0x39')]=_[_0x743f('0x36')](db['Setting'][_0x743f('0x33')]);_0x59d3bf[_0x743f('0x35')]=_[_0x743f('0x36')](_0x1916b4[_0x743f('0x35')]);_0x59d3bf[_0x743f('0x37')]=_[_0x743f('0x38')](_0x59d3bf[_0x743f('0x39')],_0x59d3bf[_0x743f('0x35')]);_0x944cfc[_0x743f('0x3a')]=_[_0x743f('0x38')](_0x59d3bf['model'],qs[_0x743f('0x3b')](_0x1916b4[_0x743f('0x35')][_0x743f('0x3b')]));_0x944cfc[_0x743f('0x3a')]=_0x944cfc[_0x743f('0x3a')][_0x743f('0x3c')]?_0x944cfc[_0x743f('0x3a')]:_0x59d3bf[_0x743f('0x39')];if(_0x1916b4[_0x743f('0x35')][_0x743f('0x46')]){_0x944cfc[_0x743f('0x47')]=[{'all':!![]}];}_0x944cfc=_[_0x743f('0x41')]({},_0x944cfc,_0x1916b4[_0x743f('0x45')]);return db['Setting']['find'](_0x944cfc)['then'](handleEntityNotFound(_0x1b5a7f,null))[_0x743f('0x19')](respondWithResult(_0x1b5a7f,null))[_0x743f('0x4a')](handleError(_0x1b5a7f,null));};exports[_0x743f('0x2a')]=function(_0x247ef5,_0x303c76){if(_0x247ef5[_0x743f('0x4c')]['id']){delete _0x247ef5[_0x743f('0x4c')]['id'];}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x247ef5[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x303c76,null))[_0x743f('0x19')](saveUpdates(_0x247ef5[_0x743f('0x4c')],null))['then'](respondWithResult(_0x303c76,null))['catch'](handleError(_0x303c76,null));};exports[_0x743f('0x4f')]=function(_0x37e868,_0x13af22,_0xd3addb){if(_0x37e868[_0x743f('0x50')]&&_0x37e868[_0x743f('0x50')][_0x743f('0x51')]){_0x37e868['body']['logo']=_0x37e868[_0x743f('0x50')][_0x743f('0x51')];}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x37e868[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x13af22,null))[_0x743f('0x19')](saveUpdates(_0x37e868['body'],null))['then'](respondWithResult(_0x13af22,null))[_0x743f('0x4a')](handleError(_0x13af22,null));};exports[_0x743f('0x52')]=function(_0x4e336e,_0x4e9ffd,_0x175f08){if(_0x4e336e[_0x743f('0x50')]&&_0x4e336e[_0x743f('0x50')][_0x743f('0x51')]){_0x4e336e[_0x743f('0x4c')][_0x743f('0x53')]=_0x4e336e[_0x743f('0x50')][_0x743f('0x51')];}return db['Setting'][_0x743f('0x4d')]({'where':{'id':_0x4e336e[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x4e9ffd,null))[_0x743f('0x19')](saveUpdates(_0x4e336e[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x4e9ffd,null))[_0x743f('0x4a')](handleError(_0x4e9ffd,null));};var utilLicense=require(_0x743f('0x14'));exports['getLogo']=function(_0x14f576,_0xb8f178,_0x5a3dfb){var _0x48b3ae=_0x743f('0x54');var _0x31d83a={'custom':![]};return utilLicense[_0x743f('0x55')]()['then'](function(_0x376d52){if(_0x376d52){_0x31d83a=_0x376d52;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x14f576[_0x743f('0x4e')]['id']},'attributes':[_0x743f('0x56'),_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),_0x743f('0x5b'),_0x743f('0x5c')],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0xb8f178,null))[_0x743f('0x19')](function(_0x3f3f53){if(_0x3f3f53){var _0x4bd9d5=_0x3f3f53['logo']&&fs['existsSync'](path['join'](config[_0x743f('0x5d')],_0x48b3ae,_[_0x743f('0x5e')](_0x3f3f53[_0x743f('0x56')])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x48b3ae,_['toLower'](_0x3f3f53[_0x743f('0x56')])):path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x48b3ae,_[_0x743f('0x5e')](_0x743f('0x60')));var _0x258935='default'+_[_0x743f('0x61')](_0x743f('0x56'));if(_0x3f3f53[_0x258935]||!_0x31d83a[_0x743f('0x62')]){_0x4bd9d5=path['join'](config['root'],_0x48b3ae,_['toLower'](_0x743f('0x60')));}if(!fs['existsSync'](_0x4bd9d5)){throw new db[(_0x743f('0x63'))]['ValidationError'](_[_0x743f('0x61')](_0x743f('0x56'))+_0x743f('0x64'));}return _0xb8f178[_0x743f('0x65')](_0x4bd9d5);}})[_0x743f('0x4a')](handleError(_0xb8f178,null));};var utilLicense=require(_0x743f('0x14'));exports['getLogoLogin']=function(_0x3d19b6,_0x54de45,_0x58effc){var _0x287b62=_0x743f('0x54');var _0xcdd72e={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x29f6e3){if(_0x29f6e3){_0xcdd72e=_0x29f6e3;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x3d19b6['params']['id']},'attributes':['logo',_0x743f('0x53'),'preferred',_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),'defaultPreferred',_0x743f('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x54de45,null))[_0x743f('0x19')](function(_0xdf82a9){if(_0xdf82a9){var _0x4d08ac=_0xdf82a9['loginLogo']&&fs[_0x743f('0x66')](path['join'](config[_0x743f('0x5d')],_0x287b62,_[_0x743f('0x5e')](_0xdf82a9[_0x743f('0x53')])))?path[_0x743f('0x5f')](config['root'],_0x287b62,_['toLower'](_0xdf82a9['loginLogo'])):path['join'](config[_0x743f('0x5d')],_0x287b62,_[_0x743f('0x5e')](_0x743f('0x67')));var _0x1fe676=_0x743f('0x68')+_['upperFirst'](_0x743f('0x53'));if(_0xdf82a9[_0x1fe676]||!_0xcdd72e[_0x743f('0x62')]){_0x4d08ac=path[_0x743f('0x5f')](config['root'],_0x287b62,_[_0x743f('0x5e')](_0x743f('0x67')));}if(!fs[_0x743f('0x66')](_0x4d08ac)){throw new db['Sequelize'][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x53'))+_0x743f('0x64'));}return _0x54de45['download'](_0x4d08ac);}})['catch'](handleError(_0x54de45,null));};exports[_0x743f('0x6a')]=function(_0x416a0f,_0x511392){return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x416a0f[_0x743f('0x4e')]['id']},'attributes':[_0x743f('0x6b')]})[_0x743f('0x19')](respondWithResult(_0x511392,null))['catch'](handleError(_0x511392,null));};exports[_0x743f('0x6c')]=function(_0x157e6f,_0x2e5598,_0x554d80){if(_0x157e6f['file']&&_0x157e6f['file'][_0x743f('0x51')]){_0x157e6f[_0x743f('0x4c')]['preferred']=_0x157e6f['file'][_0x743f('0x51')];}return db[_0x743f('0x32')]['find']({'where':{'id':_0x157e6f[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x2e5598,null))['then'](saveUpdates(_0x157e6f[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x2e5598,null))[_0x743f('0x4a')](handleError(_0x2e5598,null));};var utilLicense=require(_0x743f('0x14'));exports[_0x743f('0x6d')]=function(_0x4fa0ce,_0x2545a8,_0x2e702c){var _0x5fb5c2=_0x743f('0x54');var _0x156c04={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x488a86){if(_0x488a86){_0x156c04=_0x488a86;}return db[_0x743f('0x32')]['find']({'where':{'id':_0x4fa0ce['params']['id']},'attributes':['logo',_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),'defaultLogo',_0x743f('0x5a'),_0x743f('0x5b'),_0x743f('0x5c')],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0x2545a8,null))[_0x743f('0x19')](function(_0x2e0cd0){if(_0x2e0cd0){var _0x238eee=_0x2e0cd0['preferred']&&fs['existsSync'](path[_0x743f('0x5f')](config['root'],_0x5fb5c2,_[_0x743f('0x5e')](_0x2e0cd0['preferred'])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x5fb5c2,_[_0x743f('0x5e')](_0x2e0cd0[_0x743f('0x57')])):path[_0x743f('0x5f')](config['root'],_0x5fb5c2,_[_0x743f('0x5e')]('default_preferred.png'));var _0x20c8f7='default'+_[_0x743f('0x61')](_0x743f('0x57'));if(_0x2e0cd0[_0x20c8f7]||!_0x156c04[_0x743f('0x62')]||!_0x156c04['preferred']){_0x238eee=path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x5fb5c2,_[_0x743f('0x5e')](_0x743f('0x6e')));}if(!fs[_0x743f('0x66')](_0x238eee)){throw new db[(_0x743f('0x63'))][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x57'))+_0x743f('0x64'));}return _0x2545a8[_0x743f('0x65')](_0x238eee);}})[_0x743f('0x4a')](handleError(_0x2545a8,null));};exports['addFavicon']=function(_0x2d67f7,_0x27166f,_0x5075b0){if(_0x2d67f7[_0x743f('0x50')]&&_0x2d67f7[_0x743f('0x50')]['filename']){_0x2d67f7[_0x743f('0x4c')][_0x743f('0x58')]=_0x2d67f7['file'][_0x743f('0x51')];}return db['Setting']['find']({'where':{'id':_0x2d67f7['params']['id']}})['then'](handleEntityNotFound(_0x27166f,null))[_0x743f('0x19')](saveUpdates(_0x2d67f7[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x27166f,null))[_0x743f('0x4a')](handleError(_0x27166f,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x50a9f5,_0x22baf5,_0x29e2b4){var _0x4114b6=_0x743f('0x54');var _0x3aa114={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x5b1f8c){if(_0x5b1f8c){_0x3aa114=_0x5b1f8c;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x50a9f5['params']['id']},'attributes':['logo',_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),_0x743f('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0x22baf5,null))[_0x743f('0x19')](function(_0x1f8dcc){if(_0x1f8dcc){var _0x59675c=_0x1f8dcc[_0x743f('0x58')]&&fs[_0x743f('0x66')](path[_0x743f('0x5f')](config['root'],_0x4114b6,_[_0x743f('0x5e')](_0x1f8dcc[_0x743f('0x58')])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x4114b6,_[_0x743f('0x5e')](_0x1f8dcc[_0x743f('0x58')])):path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x4114b6,_[_0x743f('0x5e')](_0x743f('0x6f')));var _0x5a7832=_0x743f('0x68')+_['upperFirst']('favicon');if(_0x1f8dcc[_0x5a7832]||!_0x3aa114[_0x743f('0x62')]){_0x59675c=path[_0x743f('0x5f')](config['root'],_0x4114b6,_[_0x743f('0x5e')](_0x743f('0x6f')));}if(!fs[_0x743f('0x66')](_0x59675c)){throw new db['Sequelize'][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x58'))+_0x743f('0x64'));}return _0x22baf5[_0x743f('0x65')](_0x59675c);}})[_0x743f('0x4a')](handleError(_0x22baf5,null));};exports[_0x743f('0x70')]=function(_0x4ccb93,_0x5bc760){var _0x509aec={'offset':moment()[_0x743f('0x71')]()};_0x509aec[_0x743f('0x72')]=moment()[_0x743f('0x71')](_0x509aec[_0x743f('0x25')])[_0x743f('0x73')](_0x743f('0x74'));return _0x5bc760[_0x743f('0x22')](0xc8)['send'](_0x509aec);};