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