Built motion from commit (unavailable).|2.3.4
[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 _0xb9a7=['/:id/attachment_upload','single','file','attachmentUpload','addMessage','chat','addTags','put','tracked','update','/:id/custom_update','customUpdate','abandon','/:id/close','delete','removeTags','util','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace'];(function(_0x157aaf,_0xae90c8){var _0x3efcdc=function(_0x2fec1b){while(--_0x2fec1b){_0x157aaf['push'](_0x157aaf['shift']());}};_0x3efcdc(++_0xae90c8);}(_0xb9a7,0x112));var _0x7b9a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xb9a7[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x7b9a('0x2'));var config=require(_0x7b9a('0x3'));var controller=require(_0x7b9a('0x4'));router[_0x7b9a('0x5')]('/',auth[_0x7b9a('0x6')](),controller[_0x7b9a('0x7')]);router[_0x7b9a('0x5')](_0x7b9a('0x8'),auth[_0x7b9a('0x6')](),controller[_0x7b9a('0x9')]);router['get'](_0x7b9a('0xa'),auth[_0x7b9a('0xb')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x7b9a('0xb')](),controller[_0x7b9a('0xc')]);router['get'](_0x7b9a('0xd'),auth['isAuthenticated'](),controller[_0x7b9a('0xe')]);router['get'](_0x7b9a('0xf'),auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x10')]);router['get'](_0x7b9a('0x11'),auth[_0x7b9a('0x6')](),controller['download']);router[_0x7b9a('0x12')]('/',auth[_0x7b9a('0x6')](),controller['create']);var upload=multer({'storage':multer[_0x7b9a('0x13')]({'destination':function(_0xde180d,_0x6fa16a,_0x2853f2){_0x2853f2(null,path[_0x7b9a('0x14')](config[_0x7b9a('0x15')],_0x7b9a('0x16')));},'filename':function(_0x35e602,_0x2f1899,_0x4996f1){_0x4996f1(null,util[_0x7b9a('0x17')]('%s-%s',Date[_0x7b9a('0x18')](),_0x2f1899[_0x7b9a('0x19')][_0x7b9a('0x1a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7b9a('0x12')](_0x7b9a('0x1b'),upload[_0x7b9a('0x1c')](_0x7b9a('0x1d')),controller[_0x7b9a('0x1e')]);router[_0x7b9a('0x12')](_0x7b9a('0xd'),auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x1f')]);router[_0x7b9a('0x12')]('/:id/tags',auth[_0x7b9a('0x6')](),interaction['tracked'](_0x7b9a('0x20'),'chatinteraction:addtags'),controller[_0x7b9a('0x21')]);router[_0x7b9a('0x22')](_0x7b9a('0xa'),auth['isAuthenticated'](),interaction[_0x7b9a('0x23')](_0x7b9a('0x20'),'chatinteraction:update'),controller[_0x7b9a('0x24')]);router[_0x7b9a('0x22')](_0x7b9a('0x25'),controller[_0x7b9a('0x26')]);router[_0x7b9a('0x22')]('/:id/abandon',auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x27')]);router['put'](_0x7b9a('0x28'),controller['close']);router[_0x7b9a('0x29')](_0x7b9a('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x7b9a('0x20'),'chatinteraction:destroy'),controller['destroy']);router[_0x7b9a('0x29')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7b9a('0x2a')]);module['exports']=router;