Built motion from commit (unavailable).|2.5.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 _0x77f1=['now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','join','root','server/files/attachments/','format'];(function(_0x29ffa2,_0x333c9a){var _0x1156de=function(_0x5da8a6){while(--_0x5da8a6){_0x29ffa2['push'](_0x29ffa2['shift']());}};_0x1156de(++_0x333c9a);}(_0x77f1,0x1dd));var _0x177f=function(_0x5c2887,_0x1c220b){_0x5c2887=_0x5c2887-0x0;var _0x37b728=_0x77f1[_0x5c2887];return _0x37b728;};'use strict';var multer=require('multer');var util=require(_0x177f('0x0'));var path=require(_0x177f('0x1'));var timeout=require(_0x177f('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x177f('0x3'));var config=require(_0x177f('0x4'));var controller=require('./chatInteraction.controller');router[_0x177f('0x5')]('/',auth[_0x177f('0x6')](),controller[_0x177f('0x7')]);router[_0x177f('0x5')](_0x177f('0x8'),auth['isAuthenticated'](),controller[_0x177f('0x9')]);router[_0x177f('0x5')]('/:id',auth[_0x177f('0xa')](),controller['show']);router[_0x177f('0x5')]('/:id/attachment_download',auth[_0x177f('0xa')](),controller[_0x177f('0xb')]);router['get'](_0x177f('0xc'),auth[_0x177f('0x6')](),controller[_0x177f('0xd')]);router[_0x177f('0x5')](_0x177f('0xe'),auth[_0x177f('0xa')](),controller[_0x177f('0xf')]);router[_0x177f('0x5')]('/:id/download',auth[_0x177f('0x6')](),controller[_0x177f('0x10')]);router[_0x177f('0x11')]('/',auth[_0x177f('0x6')](),controller['create']);router[_0x177f('0x11')](_0x177f('0x12'),auth[_0x177f('0x6')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2366ba,_0x2f9446,_0x457d8b){_0x457d8b(null,path[_0x177f('0x13')](config[_0x177f('0x14')],_0x177f('0x15')));},'filename':function(_0x2900de,_0x2f0db5,_0x2389d5){_0x2389d5(null,util[_0x177f('0x16')]('%s-%s',Date[_0x177f('0x17')](),_0x2f0db5[_0x177f('0x18')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x177f('0x11')](_0x177f('0x19'),upload[_0x177f('0x1a')](_0x177f('0x1b')),controller[_0x177f('0x1c')]);router[_0x177f('0x11')](_0x177f('0xc'),auth[_0x177f('0xa')](),controller[_0x177f('0x1d')]);router[_0x177f('0x11')]('/:id/tags',auth[_0x177f('0x6')](),interaction[_0x177f('0x1e')](_0x177f('0x1f'),_0x177f('0x20')),controller[_0x177f('0x21')]);router[_0x177f('0x22')](_0x177f('0x23'),auth['isAuthenticated'](),interaction['tracked'](_0x177f('0x1f'),_0x177f('0x24')),controller[_0x177f('0x25')]);router[_0x177f('0x22')](_0x177f('0x26'),controller[_0x177f('0x27')]);router['put'](_0x177f('0x28'),auth[_0x177f('0xa')](),controller[_0x177f('0x29')]);router[_0x177f('0x22')](_0x177f('0x2a'),controller[_0x177f('0x2b')]);router[_0x177f('0x2c')](_0x177f('0x23'),auth[_0x177f('0x6')](),interaction[_0x177f('0x1e')](_0x177f('0x1f'),_0x177f('0x2d')),controller[_0x177f('0x2e')]);router[_0x177f('0x2c')](_0x177f('0x2f'),auth['isAuthenticated'](),controller[_0x177f('0x30')]);module[_0x177f('0x31')]=router;