899022843f25083268293bb40c3b2369120d9730
[motion2.git] / server / api / chatInteraction / 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 _0x60e1=['join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chatinteraction:update','/:id/abandon','abandon','/:id/close','close','delete','chat','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo'];(function(_0x4fd7ab,_0x1ae1f5){var _0x2ab5be=function(_0x145b14){while(--_0x145b14){_0x4fd7ab['push'](_0x4fd7ab['shift']());}};_0x2ab5be(++_0x1ae1f5);}(_0x60e1,0x14c));var _0x160e=function(_0x2bdf5,_0x36ed20){_0x2bdf5=_0x2bdf5-0x0;var _0x4e54b1=_0x60e1[_0x2bdf5];return _0x4e54b1;};'use strict';var multer=require(_0x160e('0x0'));var util=require('util');var path=require(_0x160e('0x1'));var timeout=require(_0x160e('0x2'));var express=require(_0x160e('0x3'));var router=express[_0x160e('0x4')]();var auth=require(_0x160e('0x5'));var interaction=require(_0x160e('0x6'));var config=require(_0x160e('0x7'));var controller=require(_0x160e('0x8'));router[_0x160e('0x9')]('/',auth[_0x160e('0xa')](),controller['index']);router[_0x160e('0x9')]('/describe',auth[_0x160e('0xa')](),controller[_0x160e('0xb')]);router[_0x160e('0x9')]('/:id',auth[_0x160e('0xc')](),controller[_0x160e('0xd')]);router[_0x160e('0x9')](_0x160e('0xe'),auth[_0x160e('0xc')](),controller[_0x160e('0xf')]);router['get'](_0x160e('0x10'),auth[_0x160e('0xa')](),controller[_0x160e('0x11')]);router[_0x160e('0x9')](_0x160e('0x12'),auth[_0x160e('0xc')](),controller[_0x160e('0x13')]);router['get'](_0x160e('0x14'),auth[_0x160e('0xa')](),controller[_0x160e('0x15')]);router[_0x160e('0x16')]('/',auth['isAuthenticated'](),controller[_0x160e('0x17')]);router[_0x160e('0x16')](_0x160e('0x18'),auth[_0x160e('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5d618d,_0x56a685,_0x302052){_0x302052(null,path[_0x160e('0x19')](config[_0x160e('0x1a')],_0x160e('0x1b')));},'filename':function(_0x1e5e85,_0x1ed6aa,_0x55e08b){_0x55e08b(null,util[_0x160e('0x1c')](_0x160e('0x1d'),Date['now'](),_0x1ed6aa[_0x160e('0x1e')][_0x160e('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x160e('0x16')](_0x160e('0x20'),upload[_0x160e('0x21')](_0x160e('0x22')),controller['attachmentUpload']);router[_0x160e('0x16')]('/:id/messages',auth[_0x160e('0xc')](),controller[_0x160e('0x23')]);router['post'](_0x160e('0x24'),auth['isAuthenticated'](),interaction[_0x160e('0x25')]('chat',_0x160e('0x26')),controller['addTags']);router[_0x160e('0x27')](_0x160e('0x28'),auth['isAuthenticated'](),interaction[_0x160e('0x25')]('chat',_0x160e('0x29')),controller['update']);router[_0x160e('0x27')]('/:id/custom_update',controller['customUpdate']);router[_0x160e('0x27')](_0x160e('0x2a'),auth[_0x160e('0xc')](),controller[_0x160e('0x2b')]);router[_0x160e('0x27')](_0x160e('0x2c'),controller[_0x160e('0x2d')]);router[_0x160e('0x2e')](_0x160e('0x28'),auth[_0x160e('0xa')](),interaction[_0x160e('0x25')](_0x160e('0x2f'),'chatinteraction:destroy'),controller[_0x160e('0x30')]);router['delete'](_0x160e('0x24'),auth[_0x160e('0xa')](),controller[_0x160e('0x31')]);module[_0x160e('0x32')]=router;