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