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