Built motion from commit (unavailable).|2.4.4
[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 _0x3685=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','getFields','getOfflineMessages','/:id/users','post','create','addDisposition','/:id/canned_answers','diskStorage','join','root','server/files/images/logos/','%s-%s','now','originalname','/:id/logo','file','addLogo','server/files/images/avatars/','format','single','addAvatar','addSystemAvatar','notify','offline','addInteraction','/:id/applications','addProactiveActions','put','update','delete','destroy','removeDispositions','exports'];(function(_0x34b467,_0x263ce6){var _0x55e585=function(_0x19da0b){while(--_0x19da0b){_0x34b467['push'](_0x34b467['shift']());}};_0x55e585(++_0x263ce6);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x5368('0x0'));var util=require('util');var path=require(_0x5368('0x1'));var timeout=require(_0x5368('0x2'));var express=require(_0x5368('0x3'));var router=express[_0x5368('0x4')]();var auth=require(_0x5368('0x5'));var interaction=require(_0x5368('0x6'));var config=require(_0x5368('0x7'));var controller=require(_0x5368('0x8'));router[_0x5368('0x9')]('/',auth[_0x5368('0xa')](),controller['index']);router[_0x5368('0x9')](_0x5368('0xb'),auth[_0x5368('0xa')](),controller[_0x5368('0xc')]);router['get'](_0x5368('0xd'),auth[_0x5368('0xa')](),controller[_0x5368('0xe')]);router[_0x5368('0x9')](_0x5368('0xf'),auth[_0x5368('0xa')](),controller[_0x5368('0x10')]);router[_0x5368('0x9')]('/:id/canned_answers',auth[_0x5368('0xa')](),controller[_0x5368('0x11')]);router[_0x5368('0x9')]('/:id/logo',controller[_0x5368('0x12')]);router[_0x5368('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x5368('0x13'),controller[_0x5368('0x14')]);router[_0x5368('0x9')](_0x5368('0x15'),controller[_0x5368('0x16')]);router[_0x5368('0x9')](_0x5368('0x17'),auth[_0x5368('0xa')](),controller[_0x5368('0x18')]);router[_0x5368('0x9')]('/:id/snippet',controller[_0x5368('0x19')]);router[_0x5368('0x9')]('/:id/applications',auth[_0x5368('0xa')](),controller[_0x5368('0x1a')]);router[_0x5368('0x9')](_0x5368('0x1b'),auth['isAuthenticated'](),controller[_0x5368('0x1c')]);router['get']('/:id/fields',controller[_0x5368('0x1d')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x5368('0x1e')]);router[_0x5368('0x9')](_0x5368('0x1f'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5368('0x20')]('/',auth[_0x5368('0xa')](),controller[_0x5368('0x21')]);router[_0x5368('0x20')](_0x5368('0xf'),auth[_0x5368('0xa')](),controller[_0x5368('0x22')]);router[_0x5368('0x20')](_0x5368('0x23'),auth[_0x5368('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x5368('0x24')]({'destination':function(_0xb994f4,_0x3d40f7,_0x30d098){_0x30d098(null,path[_0x5368('0x25')](config[_0x5368('0x26')],_0x5368('0x27')));},'filename':function(_0x5d32ff,_0x47c30f,_0x569d81){_0x569d81(null,util['format'](_0x5368('0x28'),Date[_0x5368('0x29')](),_0x47c30f[_0x5368('0x2a')]));}})});router[_0x5368('0x20')](_0x5368('0x2b'),upload['single'](_0x5368('0x2c')),controller[_0x5368('0x2d')]);var upload=multer({'storage':multer[_0x5368('0x24')]({'destination':function(_0x2bcf41,_0x42d4b4,_0x3af128){_0x3af128(null,path[_0x5368('0x25')](config[_0x5368('0x26')],_0x5368('0x2e')));},'filename':function(_0x3c8ae1,_0x260eab,_0x46ea22){_0x46ea22(null,util[_0x5368('0x2f')]('%s-%s',Date[_0x5368('0x29')](),_0x260eab[_0x5368('0x2a')]));}})});router[_0x5368('0x20')]('/:id/avatar',upload[_0x5368('0x30')]('file'),controller[_0x5368('0x31')]);var upload=multer({'storage':multer[_0x5368('0x24')]({'destination':function(_0x5007b6,_0x233805,_0x1ce386){_0x1ce386(null,path['join'](config['root'],_0x5368('0x2e')));},'filename':function(_0x20e115,_0x5df0bc,_0x46169e){_0x46169e(null,util[_0x5368('0x2f')](_0x5368('0x28'),Date['now'](),_0x5df0bc[_0x5368('0x2a')]));}})});router['post'](_0x5368('0x13'),upload[_0x5368('0x30')](_0x5368('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x5368('0x24')]({'destination':function(_0x20c1f2,_0xce8b4,_0x2a3bed){_0x2a3bed(null,path['join'](config[_0x5368('0x26')],'server/files/images/avatars/'));},'filename':function(_0x295123,_0x69c6c7,_0x4cc366){_0x4cc366(null,util[_0x5368('0x2f')](_0x5368('0x28'),Date[_0x5368('0x29')](),_0x69c6c7[_0x5368('0x2a')]));}})});router['post'](_0x5368('0x15'),upload[_0x5368('0x30')](_0x5368('0x2c')),controller[_0x5368('0x32')]);router[_0x5368('0x20')]('/:id/notify',controller[_0x5368('0x33')]);router[_0x5368('0x20')]('/:id/offline',controller[_0x5368('0x34')]);router[_0x5368('0x20')](_0x5368('0x17'),auth['isAuthenticated'](),controller[_0x5368('0x35')]);router[_0x5368('0x20')](_0x5368('0x36'),auth[_0x5368('0xa')](),controller['addApplications']);router['post'](_0x5368('0x1b'),auth[_0x5368('0xa')](),controller[_0x5368('0x37')]);router['post']('/:id/users',auth[_0x5368('0xa')](),controller['addAgents']);router[_0x5368('0x38')](_0x5368('0xd'),auth['isAuthenticated'](),controller[_0x5368('0x39')]);router[_0x5368('0x3a')](_0x5368('0xd'),auth[_0x5368('0xa')](),controller[_0x5368('0x3b')]);router[_0x5368('0x3a')](_0x5368('0xf'),auth[_0x5368('0xa')](),controller[_0x5368('0x3c')]);router[_0x5368('0x3a')](_0x5368('0x23'),auth[_0x5368('0xa')](),controller['removeAnswers']);router[_0x5368('0x3a')](_0x5368('0x1f'),auth[_0x5368('0xa')](),controller['removeAgents']);module[_0x5368('0x3d')]=router;