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