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