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