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