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