Built motion from commit f7863d46.|2.5.41
[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 _0x8a37=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','getJourney','post','/merge','create','/create_many','bulkCreate','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','uploadCsv','root','server/files/tmp','/upload','upload','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path'];(function(_0x4013bf,_0x2deb48){var _0x2081b0=function(_0x48ff73){while(--_0x48ff73){_0x4013bf['push'](_0x4013bf['shift']());}};_0x2081b0(++_0x2deb48);}(_0x8a37,0xf2));var _0x78a3=function(_0x960043,_0x3d6b6b){_0x960043=_0x960043-0x0;var _0x283466=_0x8a37[_0x960043];return _0x283466;};'use strict';var multer=require(_0x78a3('0x0'));var util=require(_0x78a3('0x1'));var path=require(_0x78a3('0x2'));var timeout=require(_0x78a3('0x3'));var express=require(_0x78a3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x78a3('0x5'));var interaction=require(_0x78a3('0x6'));var config=require(_0x78a3('0x7'));var controller=require('./cmContact.controller');router[_0x78a3('0x8')]('/',auth['isAuthenticated'](),controller[_0x78a3('0x9')]);router[_0x78a3('0x8')](_0x78a3('0xa'),auth[_0x78a3('0xb')](),controller[_0x78a3('0xc')]);router['get']('/:id',auth[_0x78a3('0xb')](),controller['show']);router[_0x78a3('0x8')](_0x78a3('0xd'),auth[_0x78a3('0xb')](),controller['getTags']);router[_0x78a3('0x8')](_0x78a3('0xe'),auth[_0x78a3('0xb')](),controller[_0x78a3('0xf')]);router[_0x78a3('0x8')](_0x78a3('0x10'),auth['isAuthenticated'](),controller[_0x78a3('0x11')]);router[_0x78a3('0x8')]('/:id/hopper_finals',auth[_0x78a3('0xb')](),controller[_0x78a3('0x12')]);router[_0x78a3('0x8')](_0x78a3('0x13'),auth[_0x78a3('0xb')](),controller['getJscriptySessions']);router[_0x78a3('0x8')]('/:id/journey',auth[_0x78a3('0xb')](),controller[_0x78a3('0x14')]);router[_0x78a3('0x15')](_0x78a3('0x16'),auth[_0x78a3('0xb')](),controller['merge']);router['post']('/',auth['isAuthenticated'](),controller[_0x78a3('0x17')]);router[_0x78a3('0x15')](_0x78a3('0x18'),auth[_0x78a3('0xb')](),controller[_0x78a3('0x19')]);router[_0x78a3('0x15')](_0x78a3('0xd'),auth[_0x78a3('0xb')](),controller['setTags']);var upload=multer({'storage':multer[_0x78a3('0x1a')]({'destination':function(_0x192296,_0x34b776,_0x57116a){_0x57116a(null,path[_0x78a3('0x1b')](config['root'],'server/files/tmp'));},'filename':function(_0x273538,_0x46168d,_0x275d9a){_0x46168d[_0x78a3('0x1c')]=_0x46168d[_0x78a3('0x1c')][_0x78a3('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x275d9a(null,util[_0x78a3('0x1e')](_0x78a3('0x1f'),path[_0x78a3('0x20')](_0x46168d['originalname'],path[_0x78a3('0x21')](_0x46168d[_0x78a3('0x1c')])),Date[_0x78a3('0x22')](),path[_0x78a3('0x21')](_0x46168d[_0x78a3('0x1c')])));}})});router[_0x78a3('0x15')]('/csv',upload[_0x78a3('0x23')](_0x78a3('0x24')),controller[_0x78a3('0x25')]);var upload=multer({'storage':multer[_0x78a3('0x1a')]({'destination':function(_0x256542,_0x5d872a,_0x5e4646){_0x5e4646(null,path[_0x78a3('0x1b')](config[_0x78a3('0x26')],_0x78a3('0x27')));},'filename':function(_0x4144b7,_0x3e5833,_0x5c6c4b){_0x3e5833[_0x78a3('0x1c')]=_0x3e5833['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c6c4b(null,util['format'](_0x78a3('0x1f'),path['basename'](_0x3e5833[_0x78a3('0x1c')],path[_0x78a3('0x21')](_0x3e5833[_0x78a3('0x1c')])),Date[_0x78a3('0x22')](),path[_0x78a3('0x21')](_0x3e5833[_0x78a3('0x1c')])));}})});router[_0x78a3('0x15')](_0x78a3('0x28'),upload[_0x78a3('0x23')]('file'),controller[_0x78a3('0x29')]);router['post'](_0x78a3('0x2a'),auth[_0x78a3('0xb')](),controller[_0x78a3('0x2b')]);router[_0x78a3('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0x78a3('0x2d')]);router[_0x78a3('0x2e')]('/:id',auth[_0x78a3('0xb')](),controller[_0x78a3('0x2f')]);module[_0x78a3('0x30')]=router;