9a26b508005ffec8d1da3ca675ce5491520a6930
[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 _0x1119=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post','/merge','merge','create','/create_many','bulkCreate','/:id/tags','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','uploadCsv','/upload','/upload/:id','import','put','destroy','multer','util'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x1119,0x18e));var _0x9111=function(_0x40d719,_0x4ed66c){_0x40d719=_0x40d719-0x0;var _0x29812b=_0x1119[_0x40d719];return _0x29812b;};'use strict';var multer=require(_0x9111('0x0'));var util=require(_0x9111('0x1'));var path=require('path');var timeout=require(_0x9111('0x2'));var express=require(_0x9111('0x3'));var router=express[_0x9111('0x4')]();var fs_extra=require(_0x9111('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9111('0x6'));var config=require(_0x9111('0x7'));var controller=require(_0x9111('0x8'));router['get']('/',auth[_0x9111('0x9')](),controller[_0x9111('0xa')]);router[_0x9111('0xb')](_0x9111('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9111('0xb')](_0x9111('0xd'),auth[_0x9111('0x9')](),controller[_0x9111('0xe')]);router['get']('/:id/tags',auth[_0x9111('0x9')](),controller['getTags']);router['get'](_0x9111('0xf'),auth['isAuthenticated'](),controller[_0x9111('0x10')]);router[_0x9111('0xb')]('/:id/hopper_histories',auth[_0x9111('0x9')](),controller[_0x9111('0x11')]);router[_0x9111('0xb')](_0x9111('0x12'),auth['isAuthenticated'](),controller[_0x9111('0x13')]);router[_0x9111('0xb')](_0x9111('0x14'),auth['isAuthenticated'](),controller[_0x9111('0x15')]);router['get'](_0x9111('0x16'),auth[_0x9111('0x9')](),controller['getJourney']);router[_0x9111('0x17')](_0x9111('0x18'),auth[_0x9111('0x9')](),controller[_0x9111('0x19')]);router[_0x9111('0x17')]('/',auth['isAuthenticated'](),controller[_0x9111('0x1a')]);router[_0x9111('0x17')](_0x9111('0x1b'),auth[_0x9111('0x9')](),controller[_0x9111('0x1c')]);router['post'](_0x9111('0x1d'),auth['isAuthenticated'](),controller[_0x9111('0x1e')]);var upload=multer({'storage':multer[_0x9111('0x1f')]({'destination':function(_0x2e466c,_0x4721c3,_0xdb9a79){_0xdb9a79(null,path[_0x9111('0x20')](config[_0x9111('0x21')],_0x9111('0x22')));},'filename':function(_0x3250f7,_0x20b4ca,_0x206d04){_0x20b4ca[_0x9111('0x23')]=_0x20b4ca[_0x9111('0x23')][_0x9111('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x206d04(null,util[_0x9111('0x25')](_0x9111('0x26'),path[_0x9111('0x27')](_0x20b4ca[_0x9111('0x23')],path[_0x9111('0x28')](_0x20b4ca[_0x9111('0x23')])),Date[_0x9111('0x29')](),path['extname'](_0x20b4ca['originalname'])));}})});router[_0x9111('0x17')]('/csv',upload[_0x9111('0x2a')](_0x9111('0x2b')),controller[_0x9111('0x2c')]);var upload=multer({'storage':multer[_0x9111('0x1f')]({'destination':function(_0x5d4270,_0x6263d5,_0xcb8cd2){_0xcb8cd2(null,path[_0x9111('0x20')](config['root'],'server/files/tmp'));},'filename':function(_0x28b8e9,_0x1f0aa4,_0x1df54a){_0x1f0aa4['originalname']=_0x1f0aa4[_0x9111('0x23')][_0x9111('0x24')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1df54a(null,util[_0x9111('0x25')](_0x9111('0x26'),path[_0x9111('0x27')](_0x1f0aa4[_0x9111('0x23')],path[_0x9111('0x28')](_0x1f0aa4[_0x9111('0x23')])),Date[_0x9111('0x29')](),path[_0x9111('0x28')](_0x1f0aa4[_0x9111('0x23')])));}})});router[_0x9111('0x17')](_0x9111('0x2d'),upload['single'](_0x9111('0x2b')),controller['upload']);router[_0x9111('0x17')](_0x9111('0x2e'),auth[_0x9111('0x9')](),controller[_0x9111('0x2f')]);router[_0x9111('0x30')]('/:id',auth[_0x9111('0x9')](),controller['update']);router['delete'](_0x9111('0xd'),auth[_0x9111('0x9')](),controller[_0x9111('0x31')]);module['exports']=router;