42b0396c4933450fc2d1b31afc75247a144a9b60
[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 _0xc914=['getOfflineMessages','addDisposition','post','diskStorage','join','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','root','/:id/notify','notify','offline','/:id/interactions','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','/describe','describe','get','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages'];(function(_0x26a3fe,_0x3b513e){var _0x33571a=function(_0x39d677){while(--_0x39d677){_0x26a3fe['push'](_0x26a3fe['shift']());}};_0x33571a(++_0x3b513e);}(_0xc914,0x19c));var _0x4c91=function(_0x38767b,_0x21f688){_0x38767b=_0x38767b-0x0;var _0x2ba35b=_0xc914[_0x38767b];return _0x2ba35b;};'use strict';var multer=require('multer');var util=require(_0x4c91('0x0'));var path=require('path');var timeout=require(_0x4c91('0x1'));var express=require('express');var router=express[_0x4c91('0x2')]();var auth=require(_0x4c91('0x3'));var interaction=require(_0x4c91('0x4'));var config=require(_0x4c91('0x5'));var controller=require(_0x4c91('0x6'));router['get']('/',auth[_0x4c91('0x7')](),controller[_0x4c91('0x8')]);router['get'](_0x4c91('0x9'),auth[_0x4c91('0x7')](),controller[_0x4c91('0xa')]);router['get']('/:id',auth[_0x4c91('0x7')](),controller['show']);router[_0x4c91('0xb')](_0x4c91('0xc'),auth['isAuthenticated'](),controller[_0x4c91('0xd')]);router[_0x4c91('0xb')](_0x4c91('0xe'),auth[_0x4c91('0x7')](),controller[_0x4c91('0xf')]);router['get'](_0x4c91('0x10'),controller['getLogo']);router['get'](_0x4c91('0x11'),controller['getAvatar']);router[_0x4c91('0xb')](_0x4c91('0x12'),controller[_0x4c91('0x13')]);router[_0x4c91('0xb')](_0x4c91('0x14'),controller['getSystemAvatar']);router[_0x4c91('0xb')]('/:id/interactions',auth[_0x4c91('0x7')](),controller[_0x4c91('0x15')]);router[_0x4c91('0xb')](_0x4c91('0x16'),controller[_0x4c91('0x17')]);router[_0x4c91('0xb')]('/:id/applications',auth['isAuthenticated'](),controller[_0x4c91('0x18')]);router[_0x4c91('0xb')](_0x4c91('0x19'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x1a')]);router[_0x4c91('0xb')](_0x4c91('0x1b'),controller['getFields']);router['get'](_0x4c91('0x1c'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x1d')]);router[_0x4c91('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x4c91('0xc'),auth['isAuthenticated'](),controller[_0x4c91('0x1e')]);router[_0x4c91('0x1f')](_0x4c91('0xe'),auth[_0x4c91('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x4c91('0x20')]({'destination':function(_0x17a509,_0x133d9c,_0x31a852){_0x31a852(null,path[_0x4c91('0x21')](config['root'],'server/files/images/logos/'));},'filename':function(_0x34674d,_0x2036dd,_0x5a2e58){_0x5a2e58(null,util['format'](_0x4c91('0x22'),Date[_0x4c91('0x23')](),_0x2036dd[_0x4c91('0x24')]));}})});router[_0x4c91('0x1f')](_0x4c91('0x10'),upload[_0x4c91('0x25')](_0x4c91('0x26')),controller[_0x4c91('0x27')]);var upload=multer({'storage':multer[_0x4c91('0x20')]({'destination':function(_0x1bf408,_0x2b7643,_0xc7baea){_0xc7baea(null,path[_0x4c91('0x21')](config['root'],_0x4c91('0x28')));},'filename':function(_0xa7d9f3,_0x15ba8d,_0x4bfcdb){_0x4bfcdb(null,util[_0x4c91('0x29')](_0x4c91('0x22'),Date[_0x4c91('0x23')](),_0x15ba8d[_0x4c91('0x24')]));}})});router['post'](_0x4c91('0x11'),upload[_0x4c91('0x25')](_0x4c91('0x26')),controller[_0x4c91('0x2a')]);var upload=multer({'storage':multer[_0x4c91('0x20')]({'destination':function(_0x3957d0,_0x5b6361,_0x1fdfbb){_0x1fdfbb(null,path[_0x4c91('0x21')](config['root'],_0x4c91('0x28')));},'filename':function(_0xe1b85b,_0x175a42,_0x564f66){_0x564f66(null,util[_0x4c91('0x29')]('%s-%s',Date[_0x4c91('0x23')](),_0x175a42['originalname']));}})});router['post']('/:id/customer_avatar',upload[_0x4c91('0x25')]('file'),controller[_0x4c91('0x2b')]);var upload=multer({'storage':multer[_0x4c91('0x20')]({'destination':function(_0x57c3ad,_0x6b5231,_0x1eb05e){_0x1eb05e(null,path[_0x4c91('0x21')](config[_0x4c91('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x3ee50a,_0x1c0d99,_0x1f9b0e){_0x1f9b0e(null,util[_0x4c91('0x29')]('%s-%s',Date[_0x4c91('0x23')](),_0x1c0d99[_0x4c91('0x24')]));}})});router[_0x4c91('0x1f')](_0x4c91('0x14'),upload[_0x4c91('0x25')](_0x4c91('0x26')),controller['addSystemAvatar']);router[_0x4c91('0x1f')](_0x4c91('0x2d'),controller[_0x4c91('0x2e')]);router[_0x4c91('0x1f')]('/:id/offline',controller[_0x4c91('0x2f')]);router[_0x4c91('0x1f')](_0x4c91('0x30'),auth['isAuthenticated'](),controller[_0x4c91('0x31')]);router[_0x4c91('0x1f')](_0x4c91('0x32'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x33')]);router[_0x4c91('0x1f')](_0x4c91('0x19'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x34')]);router[_0x4c91('0x1f')](_0x4c91('0x35'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x36')]);router[_0x4c91('0x37')](_0x4c91('0x38'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x39')]);router['delete'](_0x4c91('0x38'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x3a')]);router[_0x4c91('0x3b')](_0x4c91('0xc'),auth['isAuthenticated'](),controller[_0x4c91('0x3c')]);router[_0x4c91('0x3b')](_0x4c91('0xe'),auth[_0x4c91('0x7')](),controller[_0x4c91('0x3d')]);router[_0x4c91('0x3b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x4c91('0x3e')]=router;