Built motion from commit (unavailable).|2.5.0
[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 _0x8f86=['addMessage','tracked','chat','update','put','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','isChatInteractionAuthorized','download','create','join','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','post'];(function(_0x3a7e01,_0x51204c){var _0x5b8398=function(_0x4dcfab){while(--_0x4dcfab){_0x3a7e01['push'](_0x3a7e01['shift']());}};_0x5b8398(++_0x51204c);}(_0x8f86,0x65));var _0x68f8=function(_0x214b9f,_0x166185){_0x214b9f=_0x214b9f-0x0;var _0x23ec2b=_0x8f86[_0x214b9f];return _0x23ec2b;};'use strict';var multer=require(_0x68f8('0x0'));var util=require(_0x68f8('0x1'));var path=require(_0x68f8('0x2'));var timeout=require(_0x68f8('0x3'));var express=require('express');var router=express[_0x68f8('0x4')]();var auth=require(_0x68f8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x68f8('0x6'));router[_0x68f8('0x7')]('/',auth[_0x68f8('0x8')](),controller[_0x68f8('0x9')]);router[_0x68f8('0x7')](_0x68f8('0xa'),auth[_0x68f8('0x8')](),controller[_0x68f8('0xb')]);router['get'](_0x68f8('0xc'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x68f8('0x7')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x68f8('0xd')]);router[_0x68f8('0x7')](_0x68f8('0xe'),auth[_0x68f8('0x8')](),controller[_0x68f8('0xf')]);router['get'](_0x68f8('0x10'),auth[_0x68f8('0x11')](),controller['getMyMessages']);router[_0x68f8('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x68f8('0x12')]);router['post']('/',auth[_0x68f8('0x8')](),controller[_0x68f8('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3508fd,_0x145c63,_0x2a4487){_0x2a4487(null,path[_0x68f8('0x14')](config['root'],_0x68f8('0x15')));},'filename':function(_0x59d62a,_0x3334ca,_0x3697fb){_0x3697fb(null,util[_0x68f8('0x16')](_0x68f8('0x17'),Date['now'](),_0x3334ca[_0x68f8('0x18')][_0x68f8('0x19')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x68f8('0x1a'),upload[_0x68f8('0x1b')](_0x68f8('0x1c')),controller[_0x68f8('0x1d')]);router[_0x68f8('0x1e')](_0x68f8('0xe'),auth[_0x68f8('0x11')](),controller[_0x68f8('0x1f')]);router[_0x68f8('0x1e')]('/:id/tags',auth[_0x68f8('0x8')](),interaction[_0x68f8('0x20')]('chat','chatinteraction:addtags'),controller['addTags']);router['put'](_0x68f8('0xc'),auth['isAuthenticated'](),interaction[_0x68f8('0x20')](_0x68f8('0x21'),'chatinteraction:update'),controller[_0x68f8('0x22')]);router[_0x68f8('0x23')]('/:id/custom_update',controller[_0x68f8('0x24')]);router[_0x68f8('0x23')](_0x68f8('0x25'),auth[_0x68f8('0x11')](),controller[_0x68f8('0x26')]);router[_0x68f8('0x23')]('/:id/close',controller[_0x68f8('0x27')]);router[_0x68f8('0x28')]('/:id',auth['isAuthenticated'](),interaction[_0x68f8('0x20')](_0x68f8('0x21'),_0x68f8('0x29')),controller[_0x68f8('0x2a')]);router['delete']('/:id/tags',auth[_0x68f8('0x8')](),controller['removeTags']);module[_0x68f8('0x2b')]=router;