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