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