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