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