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