f5fc5745fd807eb2452e9ceab29373a8474cb3b5
[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 _0x179e=['/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages'];(function(_0x11afd1,_0x4d62ff){var _0x5e8b34=function(_0x77b8b7){while(--_0x77b8b7){_0x11afd1['push'](_0x11afd1['shift']());}};_0x5e8b34(++_0x4d62ff);}(_0x179e,0xcf));var _0xe179=function(_0x460d4e,_0x1e02de){_0x460d4e=_0x460d4e-0x0;var _0x37d484=_0x179e[_0x460d4e];return _0x37d484;};'use strict';var multer=require(_0xe179('0x0'));var util=require(_0xe179('0x1'));var path=require(_0xe179('0x2'));var timeout=require(_0xe179('0x3'));var express=require(_0xe179('0x4'));var router=express[_0xe179('0x5')]();var fs_extra=require(_0xe179('0x6'));var auth=require(_0xe179('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe179('0x8'));var controller=require(_0xe179('0x9'));router[_0xe179('0xa')]('/',auth[_0xe179('0xb')](),controller[_0xe179('0xc')]);router['get'](_0xe179('0xd'),auth[_0xe179('0xb')](),controller['describe']);router[_0xe179('0xa')]('/:id',auth[_0xe179('0xe')](),controller[_0xe179('0xf')]);router[_0xe179('0xa')](_0xe179('0x10'),auth[_0xe179('0xe')](),controller[_0xe179('0x11')]);router['get'](_0xe179('0x12'),auth[_0xe179('0xb')](),controller[_0xe179('0x13')]);router[_0xe179('0xa')]('/:id/my_messages',auth[_0xe179('0xe')](),controller[_0xe179('0x14')]);router[_0xe179('0xa')](_0xe179('0x15'),auth['isAuthenticated'](),controller[_0xe179('0x16')]);router['post']('/',auth[_0xe179('0xb')](),controller[_0xe179('0x17')]);router[_0xe179('0x18')](_0xe179('0x19'),auth[_0xe179('0xb')](),controller[_0xe179('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xa0d58a,_0x22c8a7,_0x501627){_0x501627(null,path[_0xe179('0x1b')](config[_0xe179('0x1c')],'server/files/attachments/'));},'filename':function(_0x1d6f20,_0x2b5231,_0x59fd4f){_0x59fd4f(null,util[_0xe179('0x1d')](_0xe179('0x1e'),Date[_0xe179('0x1f')](),_0x2b5231[_0xe179('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe179('0x18')](_0xe179('0x21'),upload[_0xe179('0x22')](_0xe179('0x23')),controller[_0xe179('0x24')]);router[_0xe179('0x18')](_0xe179('0x12'),auth[_0xe179('0xe')](),controller[_0xe179('0x25')]);router[_0xe179('0x18')](_0xe179('0x26'),auth[_0xe179('0xb')](),interaction[_0xe179('0x27')](_0xe179('0x28'),'chatinteraction:addtags'),controller[_0xe179('0x29')]);router['put']('/:id',auth[_0xe179('0xb')](),interaction['tracked'](_0xe179('0x28'),_0xe179('0x2a')),controller[_0xe179('0x2b')]);router[_0xe179('0x2c')](_0xe179('0x2d'),controller[_0xe179('0x2e')]);router[_0xe179('0x2c')](_0xe179('0x2f'),auth[_0xe179('0xe')](),controller[_0xe179('0x30')]);router[_0xe179('0x2c')](_0xe179('0x31'),controller[_0xe179('0x32')]);router[_0xe179('0x33')](_0xe179('0x34'),auth[_0xe179('0xb')](),interaction[_0xe179('0x27')](_0xe179('0x28'),_0xe179('0x35')),controller[_0xe179('0x36')]);router[_0xe179('0x33')](_0xe179('0x26'),auth['isAuthenticated'](),controller[_0xe179('0x37')]);module[_0xe179('0x38')]=router;