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