Built motion from commit eddce310.|2.6.12
[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 _0x34aa=['Router','env','production','get','Client-Side\x20logger\x20not\x20found!','use','isAuthenticated','exports','beaver-logger/server','express'];(function(_0x42b534,_0x3b1ece){var _0x2ab1a3=function(_0x3d10b9){while(--_0x3d10b9){_0x42b534['push'](_0x42b534['shift']());}};_0x2ab1a3(++_0x3b1ece);}(_0x34aa,0xee));var _0xa34a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x34aa[_0xaa1b3e];return _0x454d7d;};var beaverLogger=require(_0xa34a('0x0'));var express=require(_0xa34a('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0xa34a('0x2')]();var isProduction=config[_0xa34a('0x3')]===_0xa34a('0x4')||![];function clientSideLogs(_0x55cd2c,_0x3b806a,_0x1e1264){var _0x37f719=_0x55cd2c['app'][_0xa34a('0x5')]('client-side-logger');if(!_0x37f719){throw new Error(_0xa34a('0x6'));}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x37f719,'enableCors':!isProduction})(_0x55cd2c,_0x3b806a,_0x1e1264);}router[_0xa34a('0x7')](auth[_0xa34a('0x8')](),clientSideLogs);module[_0xa34a('0x9')]=router;