3cfd6f90c5faf4791de350fc6efe60c2a0ab4cdb
[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 _0x4b84=['/:id/my_messages','getMyMessages','post','createVidaooSession','diskStorage','server/files/attachments/','%s-%s','now','replace','single','file','attachmentUpload','isChatInteractionAuthorized','addMessage','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','destroy','removeTags','multer','util','express','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages'];(function(_0x5d849f,_0x3494ab){var _0x17712a=function(_0x56bb98){while(--_0x56bb98){_0x5d849f['push'](_0x5d849f['shift']());}};_0x17712a(++_0x3494ab);}(_0x4b84,0x1cc));var _0x44b8=function(_0x82140,_0x3a9d87){_0x82140=_0x82140-0x0;var _0x2b15a6=_0x4b84[_0x82140];return _0x2b15a6;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x6')](_0x44b8('0x9'),auth['isChatInteractionAuthorized'](),controller[_0x44b8('0xa')]);router[_0x44b8('0x6')](_0x44b8('0xb'),auth[_0x44b8('0x7')](),controller[_0x44b8('0xc')]);router[_0x44b8('0x6')](_0x44b8('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x44b8('0xe')]);router[_0x44b8('0x6')]('/:id/download',auth[_0x44b8('0x7')](),controller['download']);router[_0x44b8('0xf')]('/',auth[_0x44b8('0x7')](),controller['create']);router[_0x44b8('0xf')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x44b8('0x10')]);var upload=multer({'storage':multer[_0x44b8('0x11')]({'destination':function(_0x1722da,_0x41ab46,_0x5e52f2){_0x5e52f2(null,path['join'](config['root'],_0x44b8('0x12')));},'filename':function(_0x5b7803,_0x28ef36,_0x31651b){_0x31651b(null,util['format'](_0x44b8('0x13'),Date[_0x44b8('0x14')](),_0x28ef36['originalname'][_0x44b8('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x44b8('0xf')]('/:id/attachment_upload',upload[_0x44b8('0x16')](_0x44b8('0x17')),controller[_0x44b8('0x18')]);router[_0x44b8('0xf')](_0x44b8('0xb'),auth[_0x44b8('0x19')](),controller[_0x44b8('0x1a')]);router[_0x44b8('0xf')](_0x44b8('0x1b'),auth[_0x44b8('0x7')](),interaction[_0x44b8('0x1c')](_0x44b8('0x1d'),'chatinteraction:addtags'),controller[_0x44b8('0x1e')]);router[_0x44b8('0x1f')](_0x44b8('0x20'),auth[_0x44b8('0x7')](),interaction[_0x44b8('0x1c')]('chat',_0x44b8('0x21')),controller['update']);router[_0x44b8('0x1f')](_0x44b8('0x22'),controller[_0x44b8('0x23')]);router[_0x44b8('0x1f')](_0x44b8('0x24'),auth['isChatInteractionAuthorized'](),controller[_0x44b8('0x25')]);router['put'](_0x44b8('0x26'),controller[_0x44b8('0x27')]);router['delete'](_0x44b8('0x20'),auth[_0x44b8('0x7')](),interaction[_0x44b8('0x1c')]('chat',_0x44b8('0x28')),controller[_0x44b8('0x29')]);router['delete'](_0x44b8('0x1b'),auth['isAuthenticated'](),controller[_0x44b8('0x2a')]);module['exports']=router;