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