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