819bcd59dbd67b28559b582059d4c401fa8b3a9f
[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 _0xeb5c=['create','post','/create_many','bulkCreate','setTags','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','uploadCsv','diskStorage','server/files/tmp','/upload','file','/upload/:id','import','put','update','exports','util','connect-timeout','fs-extra','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/:id','show','/:id/tags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getJourney'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0xeb5c,0x116));var _0xceb5=function(_0x5a17d1,_0x225a5c){_0x5a17d1=_0x5a17d1-0x0;var _0x2c7900=_0xeb5c[_0x5a17d1];return _0x2c7900;};'use strict';var multer=require('multer');var util=require(_0xceb5('0x0'));var path=require('path');var timeout=require(_0xceb5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xceb5('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xceb5('0x3'));var controller=require(_0xceb5('0x4'));router[_0xceb5('0x5')]('/',auth[_0xceb5('0x6')](),controller[_0xceb5('0x7')]);router['get']('/describe',auth[_0xceb5('0x6')](),controller['describe']);router[_0xceb5('0x5')](_0xceb5('0x8'),auth['isAuthenticated'](),controller[_0xceb5('0x9')]);router['get'](_0xceb5('0xa'),auth[_0xceb5('0x6')](),controller['getTags']);router[_0xceb5('0x5')](_0xceb5('0xb'),auth[_0xceb5('0x6')](),controller['getHoppers']);router['get'](_0xceb5('0xc'),auth[_0xceb5('0x6')](),controller[_0xceb5('0xd')]);router[_0xceb5('0x5')](_0xceb5('0xe'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xceb5('0x5')]('/:id/jscripty_sessions',auth[_0xceb5('0x6')](),controller['getJscriptySessions']);router[_0xceb5('0x5')]('/:id/journey',auth[_0xceb5('0x6')](),controller[_0xceb5('0xf')]);router['post']('/merge',auth[_0xceb5('0x6')](),controller['merge']);router['post']('/',auth['isAuthenticated'](),controller[_0xceb5('0x10')]);router[_0xceb5('0x11')](_0xceb5('0x12'),auth[_0xceb5('0x6')](),controller[_0xceb5('0x13')]);router[_0xceb5('0x11')](_0xceb5('0xa'),auth[_0xceb5('0x6')](),controller[_0xceb5('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x742750,_0x260ffe,_0x3872ba){_0x3872ba(null,path[_0xceb5('0x15')](config[_0xceb5('0x16')],'server/files/tmp'));},'filename':function(_0x3bfb6c,_0x1288c7,_0x2550ec){_0x1288c7['originalname']=_0x1288c7[_0xceb5('0x17')][_0xceb5('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2550ec(null,util[_0xceb5('0x19')](_0xceb5('0x1a'),path[_0xceb5('0x1b')](_0x1288c7[_0xceb5('0x17')],path[_0xceb5('0x1c')](_0x1288c7['originalname'])),Date[_0xceb5('0x1d')](),path['extname'](_0x1288c7['originalname'])));}})});router[_0xceb5('0x11')](_0xceb5('0x1e'),upload[_0xceb5('0x1f')]('file'),controller[_0xceb5('0x20')]);var upload=multer({'storage':multer[_0xceb5('0x21')]({'destination':function(_0x5244be,_0x2ae75c,_0x44e1c9){_0x44e1c9(null,path['join'](config[_0xceb5('0x16')],_0xceb5('0x22')));},'filename':function(_0xfd62b5,_0x54a9bd,_0x41be89){_0x54a9bd[_0xceb5('0x17')]=_0x54a9bd[_0xceb5('0x17')][_0xceb5('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41be89(null,util[_0xceb5('0x19')](_0xceb5('0x1a'),path[_0xceb5('0x1b')](_0x54a9bd[_0xceb5('0x17')],path['extname'](_0x54a9bd[_0xceb5('0x17')])),Date['now'](),path[_0xceb5('0x1c')](_0x54a9bd['originalname'])));}})});router[_0xceb5('0x11')](_0xceb5('0x23'),upload['single'](_0xceb5('0x24')),controller['upload']);router[_0xceb5('0x11')](_0xceb5('0x25'),auth['isAuthenticated'](),controller[_0xceb5('0x26')]);router[_0xceb5('0x27')](_0xceb5('0x8'),auth['isAuthenticated'](),controller[_0xceb5('0x28')]);router['delete'](_0xceb5('0x8'),auth[_0xceb5('0x6')](),controller['destroy']);module[_0xceb5('0x29')]=router;