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