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