cc79a022cbb0f9709d1ce530b8468a207d1aeaeb
[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 _0x1b0e=['/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getOfflineMessages','getAgents','create','post','addAnswer','root','server/files/images/logos/','format','%s-%s','now','single','file','addLogo','diskStorage','join','originalname','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','notify','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo'];(function(_0x53d983,_0x291d42){var _0x34920d=function(_0x49dd17){while(--_0x49dd17){_0x53d983['push'](_0x53d983['shift']());}};_0x34920d(++_0x291d42);}(_0x1b0e,0x132));var _0xe1b0=function(_0x425921,_0x2ab856){_0x425921=_0x425921-0x0;var _0x46e0ba=_0x1b0e[_0x425921];return _0x46e0ba;};'use strict';var multer=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var path=require(_0xe1b0('0x2'));var timeout=require(_0xe1b0('0x3'));var express=require(_0xe1b0('0x4'));var router=express[_0xe1b0('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe1b0('0x6'));var controller=require(_0xe1b0('0x7'));router['get']('/',auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x9')]);router[_0xe1b0('0xa')]('/describe',auth[_0xe1b0('0x8')](),controller[_0xe1b0('0xb')]);router['get'](_0xe1b0('0xc'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0xd')]);router[_0xe1b0('0xa')](_0xe1b0('0xe'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0xf')]);router[_0xe1b0('0xa')](_0xe1b0('0x10'),auth[_0xe1b0('0x8')](),controller['getAnswers']);router[_0xe1b0('0xa')](_0xe1b0('0x11'),controller[_0xe1b0('0x12')]);router[_0xe1b0('0xa')](_0xe1b0('0x13'),controller[_0xe1b0('0x14')]);router[_0xe1b0('0xa')](_0xe1b0('0x15'),controller[_0xe1b0('0x16')]);router['get'](_0xe1b0('0x17'),controller[_0xe1b0('0x18')]);router[_0xe1b0('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xe1b0('0x19')]);router[_0xe1b0('0xa')](_0xe1b0('0x1a'),controller[_0xe1b0('0x1b')]);router[_0xe1b0('0xa')](_0xe1b0('0x1c'),auth['isAuthenticated'](),controller[_0xe1b0('0x1d')]);router[_0xe1b0('0xa')](_0xe1b0('0x1e'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x1f')]);router['get']('/:id/fields',controller['getFields']);router[_0xe1b0('0xa')]('/:id/offline_messages',auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x20')]);router[_0xe1b0('0xa')]('/:id/users',auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x21')]);router['post']('/',auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x22')]);router[_0xe1b0('0x23')]('/:id/dispositions',auth[_0xe1b0('0x8')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe1b0('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x289ed3,_0x28e39a,_0x37d006){_0x37d006(null,path['join'](config[_0xe1b0('0x25')],_0xe1b0('0x26')));},'filename':function(_0x578de8,_0x1ab8ef,_0xb541ea){_0xb541ea(null,util[_0xe1b0('0x27')](_0xe1b0('0x28'),Date[_0xe1b0('0x29')](),_0x1ab8ef['originalname']));}})});router[_0xe1b0('0x23')](_0xe1b0('0x11'),upload[_0xe1b0('0x2a')](_0xe1b0('0x2b')),controller[_0xe1b0('0x2c')]);var upload=multer({'storage':multer[_0xe1b0('0x2d')]({'destination':function(_0x13dc9d,_0x1c19cd,_0x5ea3fe){_0x5ea3fe(null,path[_0xe1b0('0x2e')](config[_0xe1b0('0x25')],'server/files/images/avatars/'));},'filename':function(_0x3f303f,_0x807796,_0x4a01d8){_0x4a01d8(null,util['format'](_0xe1b0('0x28'),Date[_0xe1b0('0x29')](),_0x807796[_0xe1b0('0x2f')]));}})});router[_0xe1b0('0x23')](_0xe1b0('0x13'),upload[_0xe1b0('0x2a')](_0xe1b0('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x218716,_0x2113b7,_0xaf1d7a){_0xaf1d7a(null,path[_0xe1b0('0x2e')](config[_0xe1b0('0x25')],_0xe1b0('0x30')));},'filename':function(_0x368210,_0x33cddd,_0x736dd7){_0x736dd7(null,util[_0xe1b0('0x27')]('%s-%s',Date['now'](),_0x33cddd['originalname']));}})});router[_0xe1b0('0x23')]('/:id/customer_avatar',upload[_0xe1b0('0x2a')](_0xe1b0('0x2b')),controller[_0xe1b0('0x31')]);var upload=multer({'storage':multer[_0xe1b0('0x2d')]({'destination':function(_0x3160c9,_0x1b80e2,_0x31d3df){_0x31d3df(null,path['join'](config['root'],'server/files/images/avatars/'));},'filename':function(_0x261002,_0x504523,_0x12c2be){_0x12c2be(null,util['format']('%s-%s',Date['now'](),_0x504523[_0xe1b0('0x2f')]));}})});router[_0xe1b0('0x23')](_0xe1b0('0x17'),upload[_0xe1b0('0x2a')](_0xe1b0('0x2b')),controller[_0xe1b0('0x32')]);router['post']('/:id/notify',controller[_0xe1b0('0x33')]);router[_0xe1b0('0x23')]('/:id/offline',controller[_0xe1b0('0x34')]);router[_0xe1b0('0x23')](_0xe1b0('0x35'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x36')]);router[_0xe1b0('0x23')](_0xe1b0('0x1c'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x37')]);router[_0xe1b0('0x23')](_0xe1b0('0x1e'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x38')]);router[_0xe1b0('0x23')](_0xe1b0('0x39'),auth['isAuthenticated'](),controller[_0xe1b0('0x3a')]);router[_0xe1b0('0x3b')](_0xe1b0('0xc'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x3c')]);router[_0xe1b0('0x3d')](_0xe1b0('0xc'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x3e')]);router[_0xe1b0('0x3d')](_0xe1b0('0xe'),auth[_0xe1b0('0x8')](),controller['removeDispositions']);router[_0xe1b0('0x3d')]('/:id/canned_answers',auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x3f')]);router[_0xe1b0('0x3d')](_0xe1b0('0x39'),auth[_0xe1b0('0x8')](),controller[_0xe1b0('0x40')]);module['exports']=router;