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