7f240532f06a35208598f4d2c9137e239d756798
[motion2.git] / server / api / client-side-logs.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 _0x04cc=['production','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','express','../config/environment','Router','env'];(function(_0x30eed8,_0x112840){var _0x410c92=function(_0x2eff26){while(--_0x2eff26){_0x30eed8['push'](_0x30eed8['shift']());}};_0x410c92(++_0x112840);}(_0x04cc,0x14b));var _0xc04c=function(_0x521378,_0x2f8004){_0x521378=_0x521378-0x0;var _0x4b2fc4=_0x04cc[_0x521378];return _0x4b2fc4;};var beaverLogger=require(_0xc04c('0x0'));var express=require(_0xc04c('0x1'));var auth=require('../components/auth/service');var config=require(_0xc04c('0x2'));var router=express[_0xc04c('0x3')]();var isProduction=config[_0xc04c('0x4')]===_0xc04c('0x5')||![];function clientSideLogs(_0x3ab21b,_0x22298b,_0x2a2622){var _0x38a3bf=_0x3ab21b['app'][_0xc04c('0x6')](_0xc04c('0x7'));if(!_0x38a3bf){throw new Error(_0xc04c('0x8'));}return beaverLogger[_0xc04c('0x9')]({'uri':_0xc04c('0xa'),'logger':_0x38a3bf,'enableCors':!isProduction})(_0x3ab21b,_0x22298b,_0x2a2622);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xc04c('0xb')]=router;