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