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