41215daecabd4f3cd7d622f00ba2025edfd3c01d
[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 _0xa25c=['/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','uploadCsv','file','upload','/upload/:id','import','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x1eca9f,_0x17f40d){var _0x4579de=function(_0x429755){while(--_0x429755){_0x1eca9f['push'](_0x1eca9f['shift']());}};_0x4579de(++_0x17f40d);}(_0xa25c,0x13f));var _0xca25=function(_0x9fcb9d,_0x299aad){_0x9fcb9d=_0x9fcb9d-0x0;var _0x8ea66=_0xa25c[_0x9fcb9d];return _0x8ea66;};'use strict';var multer=require('multer');var util=require(_0xca25('0x0'));var path=require(_0xca25('0x1'));var timeout=require(_0xca25('0x2'));var express=require(_0xca25('0x3'));var router=express[_0xca25('0x4')]();var auth=require(_0xca25('0x5'));var interaction=require(_0xca25('0x6'));var config=require(_0xca25('0x7'));var controller=require('./cmContact.controller');router[_0xca25('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xca25('0x8')]('/describe',auth[_0xca25('0x9')](),controller[_0xca25('0xa')]);router[_0xca25('0x8')](_0xca25('0xb'),auth[_0xca25('0x9')](),controller['show']);router['get'](_0xca25('0xc'),auth['isAuthenticated'](),controller[_0xca25('0xd')]);router[_0xca25('0x8')](_0xca25('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0xca25('0xf'),auth[_0xca25('0x9')](),controller[_0xca25('0x10')]);router['get']('/:id/hopper_finals',auth[_0xca25('0x9')](),controller['getHopperFinals']);router[_0xca25('0x8')](_0xca25('0x11'),auth[_0xca25('0x9')](),controller[_0xca25('0x12')]);router[_0xca25('0x8')](_0xca25('0x13'),auth[_0xca25('0x9')](),controller[_0xca25('0x14')]);router[_0xca25('0x15')](_0xca25('0x16'),auth[_0xca25('0x9')](),controller['merge']);router[_0xca25('0x15')]('/',auth[_0xca25('0x9')](),controller['create']);router[_0xca25('0x15')](_0xca25('0x17'),auth[_0xca25('0x9')](),controller[_0xca25('0x18')]);router[_0xca25('0x15')]('/:id/tags',auth[_0xca25('0x9')](),controller[_0xca25('0x19')]);var upload=multer({'storage':multer[_0xca25('0x1a')]({'destination':function(_0x1cf09c,_0x1b0c3f,_0x5d375b){_0x5d375b(null,path[_0xca25('0x1b')](config[_0xca25('0x1c')],_0xca25('0x1d')));},'filename':function(_0x1f69c6,_0x327719,_0x38d6e6){_0x327719[_0xca25('0x1e')]=_0x327719['originalname'][_0xca25('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38d6e6(null,util[_0xca25('0x20')](_0xca25('0x21'),path[_0xca25('0x22')](_0x327719[_0xca25('0x1e')],path[_0xca25('0x23')](_0x327719[_0xca25('0x1e')])),Date[_0xca25('0x24')](),path[_0xca25('0x23')](_0x327719[_0xca25('0x1e')])));}})});router[_0xca25('0x15')](_0xca25('0x25'),upload[_0xca25('0x26')]('file'),controller[_0xca25('0x27')]);var upload=multer({'storage':multer[_0xca25('0x1a')]({'destination':function(_0x7ceacb,_0x374cde,_0x220546){_0x220546(null,path['join'](config[_0xca25('0x1c')],_0xca25('0x1d')));},'filename':function(_0x3d7414,_0xd61524,_0x2ae0e3){_0xd61524[_0xca25('0x1e')]=_0xd61524[_0xca25('0x1e')][_0xca25('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ae0e3(null,util[_0xca25('0x20')](_0xca25('0x21'),path[_0xca25('0x22')](_0xd61524[_0xca25('0x1e')],path[_0xca25('0x23')](_0xd61524[_0xca25('0x1e')])),Date[_0xca25('0x24')](),path[_0xca25('0x23')](_0xd61524[_0xca25('0x1e')])));}})});router[_0xca25('0x15')]('/upload',upload[_0xca25('0x26')](_0xca25('0x28')),controller[_0xca25('0x29')]);router['post'](_0xca25('0x2a'),auth[_0xca25('0x9')](),controller[_0xca25('0x2b')]);router[_0xca25('0x2c')](_0xca25('0xb'),auth[_0xca25('0x9')](),controller['update']);router[_0xca25('0x2d')]('/:id',auth[_0xca25('0x9')](),controller[_0xca25('0x2e')]);module[_0xca25('0x2f')]=router;