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