e102b4f5186f995e2ed2a8210d0a275f9330ad05
[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 _0xf3cd=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','now','single','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xf3cd[_0x148c09];return _0x18e613;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var controller=require(_0xdf3c('0x8'));router['get']('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xa')]);router[_0xdf3c('0xb')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xd')]);router['get'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdf3c('0xb')](_0xdf3c('0xf'),auth['isAuthenticated'](),controller[_0xdf3c('0x10')]);router[_0xdf3c('0xb')](_0xdf3c('0x11'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x12')]);router[_0xdf3c('0xb')](_0xdf3c('0x13'),controller[_0xdf3c('0x14')]);router['get'](_0xdf3c('0x15'),controller[_0xdf3c('0x16')]);router[_0xdf3c('0xb')](_0xdf3c('0x17'),controller['getCustomerAvatar']);router[_0xdf3c('0xb')](_0xdf3c('0x18'),controller[_0xdf3c('0x19')]);router['get'](_0xdf3c('0x1a'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1b')]);router[_0xdf3c('0xb')](_0xdf3c('0x1c'),controller[_0xdf3c('0x1d')]);router[_0xdf3c('0xb')](_0xdf3c('0x1e'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1f')]);router['get'](_0xdf3c('0x20'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x21')]);router[_0xdf3c('0xb')](_0xdf3c('0x22'),controller[_0xdf3c('0x23')]);router[_0xdf3c('0xb')](_0xdf3c('0x24'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x25')]);router[_0xdf3c('0xb')](_0xdf3c('0x26'),auth[_0xdf3c('0x9')](),controller['getAgents']);router['post']('/',auth[_0xdf3c('0x9')](),controller['create']);router[_0xdf3c('0x27')](_0xdf3c('0xf'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x28')]);router[_0xdf3c('0x27')](_0xdf3c('0x11'),auth['isAuthenticated'](),controller[_0xdf3c('0x29')]);var upload=multer({'storage':multer[_0xdf3c('0x2a')]({'destination':function(_0x13e3ca,_0x24754a,_0x40032a){_0x40032a(null,path[_0xdf3c('0x2b')](config[_0xdf3c('0x2c')],_0xdf3c('0x2d')));},'filename':function(_0x18cb46,_0x1adee4,_0x4c076c){_0x4c076c(null,util[_0xdf3c('0x2e')](_0xdf3c('0x2f'),Date['now'](),_0x1adee4[_0xdf3c('0x30')]));}})});router['post']('/:id/logo',upload['single'](_0xdf3c('0x31')),controller[_0xdf3c('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c3b5a,_0x37ecfd,_0x1f2ce4){_0x1f2ce4(null,path[_0xdf3c('0x2b')](config[_0xdf3c('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x43ce06,_0x2a2d94,_0x5386bf){_0x5386bf(null,util['format'](_0xdf3c('0x2f'),Date[_0xdf3c('0x33')](),_0x2a2d94[_0xdf3c('0x30')]));}})});router['post'](_0xdf3c('0x15'),upload[_0xdf3c('0x34')](_0xdf3c('0x31')),controller[_0xdf3c('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xda0de0,_0x46b445,_0x522e5f){_0x522e5f(null,path[_0xdf3c('0x2b')](config[_0xdf3c('0x2c')],_0xdf3c('0x36')));},'filename':function(_0x2287f,_0x5d705d,_0x33632f){_0x33632f(null,util[_0xdf3c('0x2e')](_0xdf3c('0x2f'),Date[_0xdf3c('0x33')](),_0x5d705d['originalname']));}})});router[_0xdf3c('0x27')](_0xdf3c('0x17'),upload['single']('file'),controller[_0xdf3c('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x216115,_0x5e8130,_0x57faba){_0x57faba(null,path['join'](config[_0xdf3c('0x2c')],_0xdf3c('0x36')));},'filename':function(_0x1d0b8a,_0x29b5b7,_0x54c25f){_0x54c25f(null,util['format'](_0xdf3c('0x2f'),Date['now'](),_0x29b5b7[_0xdf3c('0x30')]));}})});router[_0xdf3c('0x27')](_0xdf3c('0x18'),upload[_0xdf3c('0x34')](_0xdf3c('0x31')),controller[_0xdf3c('0x38')]);router[_0xdf3c('0x27')](_0xdf3c('0x39'),controller[_0xdf3c('0x3a')]);router['post'](_0xdf3c('0x3b'),controller['offline']);router['post'](_0xdf3c('0x1a'),auth['isAuthenticated'](),controller[_0xdf3c('0x3c')]);router['post'](_0xdf3c('0x1e'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x3d')]);router[_0xdf3c('0x27')](_0xdf3c('0x20'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x3e')]);router[_0xdf3c('0x27')](_0xdf3c('0x26'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x3f')]);router[_0xdf3c('0x40')]('/:id',auth['isAuthenticated'](),controller[_0xdf3c('0x41')]);router['delete'](_0xdf3c('0xe'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x42')]);router[_0xdf3c('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdf3c('0x44')]);router[_0xdf3c('0x43')](_0xdf3c('0x11'),auth['isAuthenticated'](),controller[_0xdf3c('0x45')]);router[_0xdf3c('0x43')](_0xdf3c('0x26'),auth[_0xdf3c('0x9')](),controller['removeAgents']);module[_0xdf3c('0x46')]=router;