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