51347a1a63fbab00679c338bc676c00d8d6e81cc
[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 _0x4740=['connect-timeout','Router','fs-extra','../../components/interaction/service','./chatInteraction.controller','isAuthenticated','index','/describe','get','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','getMyMessages','/:id/download','download','create','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','post','/:id/attachment_upload','file','attachmentUpload','addMessage','chat','chatinteraction:addtags','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','abandon','/:id/close','destroy','delete','/:id/tags','removeTags','exports','util','path'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x4740,0xee));var _0x0474=function(_0x4a35f6,_0x2bcff3){_0x4a35f6=_0x4a35f6-0x0;var _0x57b1f9=_0x4740[_0x4a35f6];return _0x57b1f9;};'use strict';var multer=require('multer');var util=require(_0x0474('0x0'));var path=require(_0x0474('0x1'));var timeout=require(_0x0474('0x2'));var express=require('express');var router=express[_0x0474('0x3')]();var fs_extra=require(_0x0474('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0474('0x5'));var config=require('../../config/environment');var controller=require(_0x0474('0x6'));router['get']('/',auth[_0x0474('0x7')](),controller[_0x0474('0x8')]);router['get'](_0x0474('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x0474('0xa')](_0x0474('0xb'),auth[_0x0474('0xc')](),controller['show']);router[_0x0474('0xa')](_0x0474('0xd'),auth[_0x0474('0xc')](),controller['attachmentDownload']);router['get'](_0x0474('0xe'),auth['isAuthenticated'](),controller[_0x0474('0xf')]);router[_0x0474('0xa')]('/:id/my_messages',auth[_0x0474('0xc')](),controller[_0x0474('0x10')]);router['get'](_0x0474('0x11'),auth['isAuthenticated'](),controller[_0x0474('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0474('0x13')]);router['post'](_0x0474('0x14'),auth[_0x0474('0x7')](),controller[_0x0474('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1bcd26,_0x5d8a1f,_0x2a6ffe){_0x2a6ffe(null,path[_0x0474('0x16')](config[_0x0474('0x17')],'server/files/attachments/'));},'filename':function(_0x508b1d,_0x1bf913,_0xceed2c){_0xceed2c(null,util[_0x0474('0x18')](_0x0474('0x19'),Date[_0x0474('0x1a')](),_0x1bf913[_0x0474('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0474('0x1c')](_0x0474('0x1d'),upload['single'](_0x0474('0x1e')),controller[_0x0474('0x1f')]);router[_0x0474('0x1c')](_0x0474('0xe'),auth[_0x0474('0xc')](),controller[_0x0474('0x20')]);router[_0x0474('0x1c')]('/:id/tags',auth[_0x0474('0x7')](),interaction['tracked'](_0x0474('0x21'),_0x0474('0x22')),controller['addTags']);router['put'](_0x0474('0xb'),auth[_0x0474('0x7')](),interaction[_0x0474('0x23')]('chat',_0x0474('0x24')),controller[_0x0474('0x25')]);router[_0x0474('0x26')](_0x0474('0x27'),controller[_0x0474('0x28')]);router['put']('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x0474('0x29')]);router[_0x0474('0x26')](_0x0474('0x2a'),controller['close']);router['delete'](_0x0474('0xb'),auth[_0x0474('0x7')](),interaction['tracked'](_0x0474('0x21'),'chatinteraction:destroy'),controller[_0x0474('0x2b')]);router[_0x0474('0x2c')](_0x0474('0x2d'),auth[_0x0474('0x7')](),controller[_0x0474('0x2e')]);module[_0x0474('0x2f')]=router;