Built motion from commit (unavailable).|2.4.5
[motion2.git] / server / api / chatWebsite / index.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 _0x74b1=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','file','addLogo','diskStorage','originalname','/:id/avatar','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','/:id/notify','notify','/:id/offline','addApplications','put','/:id','update','delete','destroy','/:id/dispositions','removeDispositions','exports','multer','util'];(function(_0x5ad5ec,_0x4d3933){var _0x217b72=function(_0x415d8d){while(--_0x415d8d){_0x5ad5ec['push'](_0x5ad5ec['shift']());}};_0x217b72(++_0x4d3933);}(_0x74b1,0xb5));var _0x174b=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x74b1[_0x2b9e8a];return _0x520e67;};'use strict';var multer=require(_0x174b('0x0'));var util=require(_0x174b('0x1'));var path=require('path');var timeout=require(_0x174b('0x2'));var express=require(_0x174b('0x3'));var router=express['Router']();var auth=require(_0x174b('0x4'));var interaction=require(_0x174b('0x5'));var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x174b('0x6')](),controller[_0x174b('0x7')]);router[_0x174b('0x8')]('/describe',auth[_0x174b('0x6')](),controller[_0x174b('0x9')]);router['get']('/:id',auth[_0x174b('0x6')](),controller['show']);router[_0x174b('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x174b('0xa')]);router[_0x174b('0x8')](_0x174b('0xb'),auth[_0x174b('0x6')](),controller[_0x174b('0xc')]);router[_0x174b('0x8')](_0x174b('0xd'),controller[_0x174b('0xe')]);router[_0x174b('0x8')]('/:id/avatar',controller[_0x174b('0xf')]);router[_0x174b('0x8')](_0x174b('0x10'),controller[_0x174b('0x11')]);router[_0x174b('0x8')](_0x174b('0x12'),controller[_0x174b('0x13')]);router[_0x174b('0x8')](_0x174b('0x14'),auth['isAuthenticated'](),controller[_0x174b('0x15')]);router[_0x174b('0x8')](_0x174b('0x16'),controller['getSnippet']);router['get'](_0x174b('0x17'),auth[_0x174b('0x6')](),controller[_0x174b('0x18')]);router[_0x174b('0x8')](_0x174b('0x19'),auth[_0x174b('0x6')](),controller['getProactiveActions']);router[_0x174b('0x8')](_0x174b('0x1a'),controller[_0x174b('0x1b')]);router[_0x174b('0x8')](_0x174b('0x1c'),auth[_0x174b('0x6')](),controller[_0x174b('0x1d')]);router[_0x174b('0x8')](_0x174b('0x1e'),auth[_0x174b('0x6')](),controller['getAgents']);router[_0x174b('0x1f')]('/',auth['isAuthenticated'](),controller['create']);router[_0x174b('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x174b('0x20')]);router[_0x174b('0x1f')](_0x174b('0xb'),auth['isAuthenticated'](),controller[_0x174b('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b57c5,_0x25445b,_0x2f47d4){_0x2f47d4(null,path[_0x174b('0x22')](config[_0x174b('0x23')],_0x174b('0x24')));},'filename':function(_0x487929,_0x493561,_0x326836){_0x326836(null,util[_0x174b('0x25')](_0x174b('0x26'),Date[_0x174b('0x27')](),_0x493561['originalname']));}})});router[_0x174b('0x1f')](_0x174b('0xd'),upload['single'](_0x174b('0x28')),controller[_0x174b('0x29')]);var upload=multer({'storage':multer[_0x174b('0x2a')]({'destination':function(_0x50f947,_0x28ffef,_0x2aea81){_0x2aea81(null,path['join'](config[_0x174b('0x23')],'server/files/images/avatars/'));},'filename':function(_0x434626,_0x4e4c66,_0x220206){_0x220206(null,util[_0x174b('0x25')](_0x174b('0x26'),Date[_0x174b('0x27')](),_0x4e4c66[_0x174b('0x2b')]));}})});router[_0x174b('0x1f')](_0x174b('0x2c'),upload['single'](_0x174b('0x28')),controller[_0x174b('0x2d')]);var upload=multer({'storage':multer[_0x174b('0x2a')]({'destination':function(_0x57131c,_0x37da89,_0x4ba6e1){_0x4ba6e1(null,path['join'](config[_0x174b('0x23')],_0x174b('0x2e')));},'filename':function(_0x56be49,_0x42c6bd,_0x49e504){_0x49e504(null,util[_0x174b('0x25')](_0x174b('0x26'),Date[_0x174b('0x27')](),_0x42c6bd[_0x174b('0x2b')]));}})});router[_0x174b('0x1f')](_0x174b('0x10'),upload[_0x174b('0x2f')]('file'),controller[_0x174b('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4d53ce,_0x34cf75,_0xdc0f58){_0xdc0f58(null,path[_0x174b('0x22')](config[_0x174b('0x23')],_0x174b('0x2e')));},'filename':function(_0x564604,_0x2307b8,_0x3b995e){_0x3b995e(null,util[_0x174b('0x25')](_0x174b('0x26'),Date[_0x174b('0x27')](),_0x2307b8[_0x174b('0x2b')]));}})});router[_0x174b('0x1f')](_0x174b('0x12'),upload[_0x174b('0x2f')]('file'),controller['addSystemAvatar']);router[_0x174b('0x1f')](_0x174b('0x31'),controller[_0x174b('0x32')]);router[_0x174b('0x1f')](_0x174b('0x33'),controller['offline']);router['post'](_0x174b('0x14'),auth[_0x174b('0x6')](),controller['addInteraction']);router[_0x174b('0x1f')](_0x174b('0x17'),auth[_0x174b('0x6')](),controller[_0x174b('0x34')]);router[_0x174b('0x1f')](_0x174b('0x19'),auth['isAuthenticated'](),controller['addProactiveActions']);router[_0x174b('0x1f')](_0x174b('0x1e'),auth[_0x174b('0x6')](),controller['addAgents']);router[_0x174b('0x35')](_0x174b('0x36'),auth[_0x174b('0x6')](),controller[_0x174b('0x37')]);router[_0x174b('0x38')](_0x174b('0x36'),auth[_0x174b('0x6')](),controller[_0x174b('0x39')]);router[_0x174b('0x38')](_0x174b('0x3a'),auth['isAuthenticated'](),controller[_0x174b('0x3b')]);router[_0x174b('0x38')]('/:id/canned_answers',auth[_0x174b('0x6')](),controller['removeAnswers']);router[_0x174b('0x38')](_0x174b('0x1e'),auth[_0x174b('0x6')](),controller['removeAgents']);module[_0x174b('0x3c')]=router;