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