Built motion from commit (unavailable).|2.5.18
[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 _0xdbe3=['getSnippet','/:id/applications','getApplications','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','file','addLogo','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','destroy','delete','removeAnswers','exports','multer','util','path','express','Router','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/:id','/:id/dispositions','getAnswers','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdbe3,0xe0));var _0x3dbe=function(_0x4846f3,_0x27faaa){_0x4846f3=_0x4846f3-0x0;var _0x5477e5=_0xdbe3[_0x4846f3];return _0x5477e5;};'use strict';var multer=require(_0x3dbe('0x0'));var util=require(_0x3dbe('0x1'));var path=require(_0x3dbe('0x2'));var timeout=require('connect-timeout');var express=require(_0x3dbe('0x3'));var router=express[_0x3dbe('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3dbe('0x5'));var controller=require(_0x3dbe('0x6'));router[_0x3dbe('0x7')]('/',auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x9')]);router[_0x3dbe('0x7')]('/describe',auth[_0x3dbe('0x8')](),controller['describe']);router['get'](_0x3dbe('0xa'),auth[_0x3dbe('0x8')](),controller['show']);router[_0x3dbe('0x7')](_0x3dbe('0xb'),auth[_0x3dbe('0x8')](),controller['getDispositions']);router[_0x3dbe('0x7')]('/:id/canned_answers',auth[_0x3dbe('0x8')](),controller[_0x3dbe('0xc')]);router[_0x3dbe('0x7')]('/:id/logo',controller['getLogo']);router['get']('/:id/avatar',controller['getAvatar']);router[_0x3dbe('0x7')](_0x3dbe('0xd'),controller[_0x3dbe('0xe')]);router[_0x3dbe('0x7')](_0x3dbe('0xf'),controller[_0x3dbe('0x10')]);router[_0x3dbe('0x7')](_0x3dbe('0x11'),auth['isAuthenticated'](),controller[_0x3dbe('0x12')]);router[_0x3dbe('0x7')](_0x3dbe('0x13'),controller[_0x3dbe('0x14')]);router['get'](_0x3dbe('0x15'),auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x16')]);router[_0x3dbe('0x7')]('/:id/proactive_actions',auth[_0x3dbe('0x8')](),controller['getProactiveActions']);router[_0x3dbe('0x7')](_0x3dbe('0x17'),controller[_0x3dbe('0x18')]);router[_0x3dbe('0x7')](_0x3dbe('0x19'),auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x1a')]);router[_0x3dbe('0x7')](_0x3dbe('0x1b'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3dbe('0x1c')]('/',auth[_0x3dbe('0x8')](),controller['create']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3dbe('0x1d')]);router['post'](_0x3dbe('0x1e'),auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x1f')]);var upload=multer({'storage':multer[_0x3dbe('0x20')]({'destination':function(_0x2fe391,_0x83483d,_0x21b4d5){_0x21b4d5(null,path[_0x3dbe('0x21')](config[_0x3dbe('0x22')],_0x3dbe('0x23')));},'filename':function(_0x5d9c54,_0x557be1,_0x254499){_0x254499(null,util[_0x3dbe('0x24')](_0x3dbe('0x25'),Date[_0x3dbe('0x26')](),_0x557be1['originalname']));}})});router[_0x3dbe('0x1c')](_0x3dbe('0x27'),upload['single'](_0x3dbe('0x28')),controller[_0x3dbe('0x29')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e2815,_0x2499fc,_0x55fba2){_0x55fba2(null,path[_0x3dbe('0x21')](config[_0x3dbe('0x22')],_0x3dbe('0x2a')));},'filename':function(_0x486024,_0x5c8ff4,_0x287ce9){_0x287ce9(null,util['format'](_0x3dbe('0x25'),Date['now'](),_0x5c8ff4[_0x3dbe('0x2b')]));}})});router[_0x3dbe('0x1c')](_0x3dbe('0x2c'),upload[_0x3dbe('0x2d')]('file'),controller[_0x3dbe('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x476339,_0x7de9bd,_0x3df625){_0x3df625(null,path[_0x3dbe('0x21')](config[_0x3dbe('0x22')],_0x3dbe('0x2a')));},'filename':function(_0x16529e,_0x1498c6,_0x15a95e){_0x15a95e(null,util[_0x3dbe('0x24')]('%s-%s',Date[_0x3dbe('0x26')](),_0x1498c6[_0x3dbe('0x2b')]));}})});router[_0x3dbe('0x1c')]('/:id/customer_avatar',upload[_0x3dbe('0x2d')](_0x3dbe('0x28')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3dbe('0x20')]({'destination':function(_0x1c6e53,_0x2be8e6,_0x1dc9f5){_0x1dc9f5(null,path[_0x3dbe('0x21')](config[_0x3dbe('0x22')],_0x3dbe('0x2a')));},'filename':function(_0x9d7dd1,_0x21c244,_0x86edb5){_0x86edb5(null,util['format'](_0x3dbe('0x25'),Date['now'](),_0x21c244[_0x3dbe('0x2b')]));}})});router[_0x3dbe('0x1c')](_0x3dbe('0xf'),upload['single'](_0x3dbe('0x28')),controller[_0x3dbe('0x2f')]);router[_0x3dbe('0x1c')](_0x3dbe('0x30'),controller[_0x3dbe('0x31')]);router[_0x3dbe('0x1c')](_0x3dbe('0x32'),controller[_0x3dbe('0x33')]);router[_0x3dbe('0x1c')](_0x3dbe('0x11'),auth[_0x3dbe('0x8')](),controller['addInteraction']);router[_0x3dbe('0x1c')](_0x3dbe('0x15'),auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x34')]);router['post'](_0x3dbe('0x35'),auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x36')]);router[_0x3dbe('0x1c')]('/:id/users',auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x37')]);router[_0x3dbe('0x38')](_0x3dbe('0xa'),auth[_0x3dbe('0x8')](),controller['update']);router['delete']('/:id',auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x39')]);router['delete'](_0x3dbe('0xb'),auth[_0x3dbe('0x8')](),controller['removeDispositions']);router[_0x3dbe('0x3a')](_0x3dbe('0x1e'),auth[_0x3dbe('0x8')](),controller[_0x3dbe('0x3b')]);router[_0x3dbe('0x3a')](_0x3dbe('0x1b'),auth[_0x3dbe('0x8')](),controller['removeAgents']);module[_0x3dbe('0x3c')]=router;