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