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