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