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