ae12132e5361dc2286f3eb6c5b3588e1afe8686b
[motion2.git] / server / api / cmContact / 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 _0x5eb1=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','post','setTags','diskStorage','join','root','server/files/tmp','originalname','format','basename','extname','now','/csv','single','uploadCsv','file','upload','import','update','exports','util','path'];(function(_0x36ee10,_0x3e4e4b){var _0x1ae7e8=function(_0x138916){while(--_0x138916){_0x36ee10['push'](_0x36ee10['shift']());}};_0x1ae7e8(++_0x3e4e4b);}(_0x5eb1,0x7c));var _0x15eb=function(_0x52d4ad,_0x25e611){_0x52d4ad=_0x52d4ad-0x0;var _0x34a767=_0x5eb1[_0x52d4ad];return _0x34a767;};'use strict';var multer=require('multer');var util=require(_0x15eb('0x0'));var path=require(_0x15eb('0x1'));var timeout=require(_0x15eb('0x2'));var express=require(_0x15eb('0x3'));var router=express[_0x15eb('0x4')]();var auth=require(_0x15eb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x15eb('0x6'));var controller=require(_0x15eb('0x7'));router[_0x15eb('0x8')]('/',auth[_0x15eb('0x9')](),controller['index']);router[_0x15eb('0x8')](_0x15eb('0xa'),auth['isAuthenticated'](),controller[_0x15eb('0xb')]);router[_0x15eb('0x8')](_0x15eb('0xc'),auth[_0x15eb('0x9')](),controller[_0x15eb('0xd')]);router[_0x15eb('0x8')](_0x15eb('0xe'),auth[_0x15eb('0x9')](),controller[_0x15eb('0xf')]);router[_0x15eb('0x8')](_0x15eb('0x10'),auth[_0x15eb('0x9')](),controller[_0x15eb('0x11')]);router['get'](_0x15eb('0x12'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x15eb('0x13'),auth[_0x15eb('0x9')](),controller[_0x15eb('0x14')]);router[_0x15eb('0x8')]('/:id/jscripty_sessions',auth[_0x15eb('0x9')](),controller[_0x15eb('0x15')]);router[_0x15eb('0x8')](_0x15eb('0x16'),auth['isAuthenticated'](),controller['getJourney']);router['post']('/merge',auth[_0x15eb('0x9')](),controller['merge']);router['post']('/',auth[_0x15eb('0x9')](),controller['create']);router[_0x15eb('0x17')]('/create_many',auth[_0x15eb('0x9')](),controller['bulkCreate']);router[_0x15eb('0x17')](_0x15eb('0xe'),auth['isAuthenticated'](),controller[_0x15eb('0x18')]);var upload=multer({'storage':multer[_0x15eb('0x19')]({'destination':function(_0x4b9a96,_0x12f52d,_0x42c659){_0x42c659(null,path[_0x15eb('0x1a')](config[_0x15eb('0x1b')],_0x15eb('0x1c')));},'filename':function(_0x148b93,_0x56f51d,_0x222cf1){_0x56f51d['originalname']=_0x56f51d[_0x15eb('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x222cf1(null,util[_0x15eb('0x1e')]('%s-%s%s',path[_0x15eb('0x1f')](_0x56f51d[_0x15eb('0x1d')],path[_0x15eb('0x20')](_0x56f51d[_0x15eb('0x1d')])),Date[_0x15eb('0x21')](),path[_0x15eb('0x20')](_0x56f51d[_0x15eb('0x1d')])));}})});router[_0x15eb('0x17')](_0x15eb('0x22'),upload[_0x15eb('0x23')]('file'),controller[_0x15eb('0x24')]);var upload=multer({'storage':multer[_0x15eb('0x19')]({'destination':function(_0x394c25,_0x3f655b,_0x1fcb1a){_0x1fcb1a(null,path[_0x15eb('0x1a')](config[_0x15eb('0x1b')],'server/files/tmp'));},'filename':function(_0x4da36d,_0x1706ed,_0x1def52){_0x1706ed[_0x15eb('0x1d')]=_0x1706ed[_0x15eb('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1def52(null,util[_0x15eb('0x1e')]('%s-%s%s',path[_0x15eb('0x1f')](_0x1706ed['originalname'],path[_0x15eb('0x20')](_0x1706ed[_0x15eb('0x1d')])),Date[_0x15eb('0x21')](),path[_0x15eb('0x20')](_0x1706ed[_0x15eb('0x1d')])));}})});router[_0x15eb('0x17')]('/upload',upload[_0x15eb('0x23')](_0x15eb('0x25')),controller[_0x15eb('0x26')]);router['post']('/upload/:id',auth[_0x15eb('0x9')](),controller[_0x15eb('0x27')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x15eb('0x28')]);router['delete'](_0x15eb('0xc'),auth[_0x15eb('0x9')](),controller['destroy']);module[_0x15eb('0x29')]=router;