Built motion from commit (unavailable).|2.5.21
[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 _0xcbd2=['addLogo','join','server/files/images/avatars/','/:id/avatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','/:id/interactions','addInteraction','addApplications','addAgents','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','util','express','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','file'];(function(_0x45d9bb,_0x2c0350){var _0x1a36e9=function(_0x643803){while(--_0x643803){_0x45d9bb['push'](_0x45d9bb['shift']());}};_0x1a36e9(++_0x2c0350);}(_0xcbd2,0x1d7));var _0x2cbd=function(_0x85d5a8,_0x1977be){_0x85d5a8=_0x85d5a8-0x0;var _0x20479b=_0xcbd2[_0x85d5a8];return _0x20479b;};'use strict';var multer=require(_0x2cbd('0x0'));var util=require(_0x2cbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2cbd('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2cbd('0x3'));var config=require(_0x2cbd('0x4'));var controller=require(_0x2cbd('0x5'));router[_0x2cbd('0x6')]('/',auth['isAuthenticated'](),controller[_0x2cbd('0x7')]);router[_0x2cbd('0x6')](_0x2cbd('0x8'),auth[_0x2cbd('0x9')](),controller['describe']);router[_0x2cbd('0x6')](_0x2cbd('0xa'),auth['isAuthenticated'](),controller[_0x2cbd('0xb')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x2cbd('0x6')](_0x2cbd('0xc'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0xd')]);router[_0x2cbd('0x6')]('/:id/logo',controller[_0x2cbd('0xe')]);router[_0x2cbd('0x6')]('/:id/avatar',controller[_0x2cbd('0xf')]);router['get'](_0x2cbd('0x10'),controller['getCustomerAvatar']);router['get'](_0x2cbd('0x11'),controller[_0x2cbd('0x12')]);router['get']('/:id/interactions',auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x13')]);router[_0x2cbd('0x6')](_0x2cbd('0x14'),controller['getSnippet']);router[_0x2cbd('0x6')](_0x2cbd('0x15'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x16')]);router[_0x2cbd('0x6')](_0x2cbd('0x17'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0x2cbd('0x6')]('/:id/fields',controller[_0x2cbd('0x18')]);router['get']('/:id/offline_messages',auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x19')]);router[_0x2cbd('0x6')](_0x2cbd('0x1a'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x1b')]);router[_0x2cbd('0x1c')]('/',auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x1d')]);router['post']('/:id/dispositions',auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x1e')]);router[_0x2cbd('0x1c')](_0x2cbd('0xc'),auth['isAuthenticated'](),controller[_0x2cbd('0x1f')]);var upload=multer({'storage':multer[_0x2cbd('0x20')]({'destination':function(_0x4c73f3,_0x31ef70,_0x289cf0){_0x289cf0(null,path['join'](config[_0x2cbd('0x21')],_0x2cbd('0x22')));},'filename':function(_0x40dd99,_0x58c12c,_0x3645df){_0x3645df(null,util[_0x2cbd('0x23')](_0x2cbd('0x24'),Date[_0x2cbd('0x25')](),_0x58c12c[_0x2cbd('0x26')]));}})});router[_0x2cbd('0x1c')](_0x2cbd('0x27'),upload['single'](_0x2cbd('0x28')),controller[_0x2cbd('0x29')]);var upload=multer({'storage':multer[_0x2cbd('0x20')]({'destination':function(_0x4f521a,_0x1ba599,_0x16b965){_0x16b965(null,path[_0x2cbd('0x2a')](config[_0x2cbd('0x21')],_0x2cbd('0x2b')));},'filename':function(_0x90b493,_0xacea2a,_0x2f9fc6){_0x2f9fc6(null,util[_0x2cbd('0x23')](_0x2cbd('0x24'),Date[_0x2cbd('0x25')](),_0xacea2a['originalname']));}})});router[_0x2cbd('0x1c')](_0x2cbd('0x2c'),upload[_0x2cbd('0x2d')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0x2cbd('0x20')]({'destination':function(_0x10d5e7,_0x26cbd8,_0x4a0fff){_0x4a0fff(null,path['join'](config[_0x2cbd('0x21')],_0x2cbd('0x2b')));},'filename':function(_0x144021,_0x94f39c,_0x270d93){_0x270d93(null,util[_0x2cbd('0x23')](_0x2cbd('0x24'),Date['now'](),_0x94f39c[_0x2cbd('0x26')]));}})});router[_0x2cbd('0x1c')](_0x2cbd('0x10'),upload[_0x2cbd('0x2d')](_0x2cbd('0x28')),controller[_0x2cbd('0x2e')]);var upload=multer({'storage':multer[_0x2cbd('0x20')]({'destination':function(_0x38e9d3,_0x43268e,_0x4c8293){_0x4c8293(null,path[_0x2cbd('0x2a')](config[_0x2cbd('0x21')],_0x2cbd('0x2b')));},'filename':function(_0x23dfe0,_0x2c4cae,_0x59ed22){_0x59ed22(null,util[_0x2cbd('0x23')](_0x2cbd('0x24'),Date[_0x2cbd('0x25')](),_0x2c4cae['originalname']));}})});router[_0x2cbd('0x1c')]('/:id/system_avatar',upload[_0x2cbd('0x2d')](_0x2cbd('0x28')),controller[_0x2cbd('0x2f')]);router['post'](_0x2cbd('0x30'),controller[_0x2cbd('0x31')]);router['post'](_0x2cbd('0x32'),controller[_0x2cbd('0x33')]);router[_0x2cbd('0x1c')](_0x2cbd('0x34'),auth['isAuthenticated'](),controller[_0x2cbd('0x35')]);router[_0x2cbd('0x1c')](_0x2cbd('0x15'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x36')]);router[_0x2cbd('0x1c')](_0x2cbd('0x17'),auth[_0x2cbd('0x9')](),controller['addProactiveActions']);router[_0x2cbd('0x1c')](_0x2cbd('0x1a'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x37')]);router[_0x2cbd('0x38')](_0x2cbd('0xa'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x39')]);router[_0x2cbd('0x3a')](_0x2cbd('0xa'),auth['isAuthenticated'](),controller[_0x2cbd('0x3b')]);router[_0x2cbd('0x3a')](_0x2cbd('0x3c'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x3d')]);router['delete'](_0x2cbd('0xc'),auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x3e')]);router['delete']('/:id/users',auth[_0x2cbd('0x9')](),controller[_0x2cbd('0x3f')]);module['exports']=router;