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