Built motion from commit (unavailable).|2.5.1
[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 _0x81a8=['getCustomerAvatar','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','/:id/customer_avatar','addCustomerAvatar','/:id/system_avatar','notify','/:id/offline','/:id/interactions','addInteraction','/:id/proactive_actions','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAgents','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x81a8,0x1cf));var _0x881a=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0x81a8[_0x3eff21];return _0x1945bb;};'use strict';var multer=require('multer');var util=require(_0x881a('0x0'));var path=require(_0x881a('0x1'));var timeout=require('connect-timeout');var express=require(_0x881a('0x2'));var router=express['Router']();var auth=require(_0x881a('0x3'));var interaction=require(_0x881a('0x4'));var config=require(_0x881a('0x5'));var controller=require('./chatWebsite.controller');router[_0x881a('0x6')]('/',auth[_0x881a('0x7')](),controller[_0x881a('0x8')]);router[_0x881a('0x6')](_0x881a('0x9'),auth[_0x881a('0x7')](),controller['describe']);router[_0x881a('0x6')]('/:id',auth[_0x881a('0x7')](),controller[_0x881a('0xa')]);router[_0x881a('0x6')](_0x881a('0xb'),auth['isAuthenticated'](),controller[_0x881a('0xc')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x881a('0xd')]);router[_0x881a('0x6')](_0x881a('0xe'),controller[_0x881a('0xf')]);router['get'](_0x881a('0x10'),controller['getAvatar']);router[_0x881a('0x6')]('/:id/customer_avatar',controller[_0x881a('0x11')]);router[_0x881a('0x6')]('/:id/system_avatar',controller['getSystemAvatar']);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x881a('0x6')]('/:id/snippet',controller[_0x881a('0x12')]);router['get'](_0x881a('0x13'),auth[_0x881a('0x7')](),controller[_0x881a('0x14')]);router[_0x881a('0x6')]('/:id/proactive_actions',auth[_0x881a('0x7')](),controller[_0x881a('0x15')]);router[_0x881a('0x6')](_0x881a('0x16'),controller[_0x881a('0x17')]);router['get'](_0x881a('0x18'),auth[_0x881a('0x7')](),controller[_0x881a('0x19')]);router[_0x881a('0x6')]('/:id/users',auth[_0x881a('0x7')](),controller[_0x881a('0x1a')]);router['post']('/',auth[_0x881a('0x7')](),controller['create']);router[_0x881a('0x1b')](_0x881a('0xb'),auth[_0x881a('0x7')](),controller['addDisposition']);router[_0x881a('0x1b')](_0x881a('0x1c'),auth[_0x881a('0x7')](),controller[_0x881a('0x1d')]);var upload=multer({'storage':multer[_0x881a('0x1e')]({'destination':function(_0x3d89e6,_0x3a8661,_0x195ffa){_0x195ffa(null,path[_0x881a('0x1f')](config[_0x881a('0x20')],_0x881a('0x21')));},'filename':function(_0x460c20,_0x42f75c,_0x111fa8){_0x111fa8(null,util[_0x881a('0x22')](_0x881a('0x23'),Date[_0x881a('0x24')](),_0x42f75c[_0x881a('0x25')]));}})});router['post'](_0x881a('0xe'),upload[_0x881a('0x26')](_0x881a('0x27')),controller[_0x881a('0x28')]);var upload=multer({'storage':multer[_0x881a('0x1e')]({'destination':function(_0xa19f86,_0x3b4ce7,_0xca305d){_0xca305d(null,path[_0x881a('0x1f')](config[_0x881a('0x20')],_0x881a('0x29')));},'filename':function(_0x3d6c61,_0x3d0709,_0x127f80){_0x127f80(null,util[_0x881a('0x22')](_0x881a('0x23'),Date['now'](),_0x3d0709['originalname']));}})});router[_0x881a('0x1b')](_0x881a('0x10'),upload[_0x881a('0x26')]('file'),controller[_0x881a('0x2a')]);var upload=multer({'storage':multer[_0x881a('0x1e')]({'destination':function(_0x37e704,_0x396680,_0x242a47){_0x242a47(null,path[_0x881a('0x1f')](config[_0x881a('0x20')],_0x881a('0x29')));},'filename':function(_0x371f77,_0x4d8369,_0x31f4c1){_0x31f4c1(null,util['format'](_0x881a('0x23'),Date[_0x881a('0x24')](),_0x4d8369[_0x881a('0x25')]));}})});router[_0x881a('0x1b')](_0x881a('0x2b'),upload[_0x881a('0x26')]('file'),controller[_0x881a('0x2c')]);var upload=multer({'storage':multer[_0x881a('0x1e')]({'destination':function(_0x5b39ea,_0x161d9a,_0x4d6e0d){_0x4d6e0d(null,path[_0x881a('0x1f')](config[_0x881a('0x20')],_0x881a('0x29')));},'filename':function(_0x21663e,_0x586144,_0x45cf89){_0x45cf89(null,util[_0x881a('0x22')](_0x881a('0x23'),Date['now'](),_0x586144[_0x881a('0x25')]));}})});router[_0x881a('0x1b')](_0x881a('0x2d'),upload[_0x881a('0x26')](_0x881a('0x27')),controller['addSystemAvatar']);router[_0x881a('0x1b')]('/:id/notify',controller[_0x881a('0x2e')]);router['post'](_0x881a('0x2f'),controller['offline']);router[_0x881a('0x1b')](_0x881a('0x30'),auth['isAuthenticated'](),controller[_0x881a('0x31')]);router[_0x881a('0x1b')]('/:id/applications',auth[_0x881a('0x7')](),controller['addApplications']);router[_0x881a('0x1b')](_0x881a('0x32'),auth[_0x881a('0x7')](),controller['addProactiveActions']);router[_0x881a('0x1b')](_0x881a('0x33'),auth[_0x881a('0x7')](),controller[_0x881a('0x34')]);router[_0x881a('0x35')](_0x881a('0x36'),auth[_0x881a('0x7')](),controller[_0x881a('0x37')]);router[_0x881a('0x38')](_0x881a('0x36'),auth['isAuthenticated'](),controller[_0x881a('0x39')]);router[_0x881a('0x38')](_0x881a('0xb'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x881a('0x38')]('/:id/canned_answers',auth[_0x881a('0x7')](),controller['removeAnswers']);router[_0x881a('0x38')](_0x881a('0x33'),auth[_0x881a('0x7')](),controller[_0x881a('0x3a')]);module[_0x881a('0x3b')]=router;