01ef5268f9c8a051a0d16c7dd31852c7d20af13e
[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 _0x3398=['upload','/upload/:id','import','/:id','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','describe','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getJscriptySessions','/:id/journey','getJourney','merge','post','/create_many','bulkCreate','/:id/tags','setTags','diskStorage','root','originalname','replace','format','basename','extname','now','/csv','file','uploadCsv','server/files/tmp','/upload','single'];(function(_0x159544,_0x2bc3e4){var _0x36b85e=function(_0x3c5ebc){while(--_0x3c5ebc){_0x159544['push'](_0x159544['shift']());}};_0x36b85e(++_0x2bc3e4);}(_0x3398,0x1be));var _0x8339=function(_0x167862,_0x21bbb3){_0x167862=_0x167862-0x0;var _0x3ef1be=_0x3398[_0x167862];return _0x3ef1be;};'use strict';var multer=require(_0x8339('0x0'));var util=require(_0x8339('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8339('0x2'));var router=express[_0x8339('0x3')]();var fs_extra=require(_0x8339('0x4'));var auth=require(_0x8339('0x5'));var interaction=require(_0x8339('0x6'));var config=require(_0x8339('0x7'));var controller=require(_0x8339('0x8'));router['get']('/',auth[_0x8339('0x9')](),controller[_0x8339('0xa')]);router[_0x8339('0xb')](_0x8339('0xc'),auth[_0x8339('0x9')](),controller[_0x8339('0xd')]);router[_0x8339('0xb')]('/:id',auth[_0x8339('0x9')](),controller[_0x8339('0xe')]);router[_0x8339('0xb')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8339('0xf')]);router['get'](_0x8339('0x10'),auth[_0x8339('0x9')](),controller[_0x8339('0x11')]);router['get'](_0x8339('0x12'),auth[_0x8339('0x9')](),controller[_0x8339('0x13')]);router[_0x8339('0xb')](_0x8339('0x14'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/jscripty_sessions',auth[_0x8339('0x9')](),controller[_0x8339('0x15')]);router['get'](_0x8339('0x16'),auth['isAuthenticated'](),controller[_0x8339('0x17')]);router['post']('/merge',auth[_0x8339('0x9')](),controller[_0x8339('0x18')]);router[_0x8339('0x19')]('/',auth[_0x8339('0x9')](),controller['create']);router['post'](_0x8339('0x1a'),auth[_0x8339('0x9')](),controller[_0x8339('0x1b')]);router[_0x8339('0x19')](_0x8339('0x1c'),auth[_0x8339('0x9')](),controller[_0x8339('0x1d')]);var upload=multer({'storage':multer[_0x8339('0x1e')]({'destination':function(_0x1a4a4d,_0x3bf1ab,_0xa3940b){_0xa3940b(null,path['join'](config[_0x8339('0x1f')],'server/files/tmp'));},'filename':function(_0x27bfdc,_0x35dd73,_0x2ca15a){_0x35dd73['originalname']=_0x35dd73[_0x8339('0x20')][_0x8339('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ca15a(null,util[_0x8339('0x22')]('%s-%s%s',path[_0x8339('0x23')](_0x35dd73[_0x8339('0x20')],path[_0x8339('0x24')](_0x35dd73[_0x8339('0x20')])),Date[_0x8339('0x25')](),path[_0x8339('0x24')](_0x35dd73[_0x8339('0x20')])));}})});router[_0x8339('0x19')](_0x8339('0x26'),upload['single'](_0x8339('0x27')),controller[_0x8339('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x508b78,_0xbc64d9,_0x323035){_0x323035(null,path['join'](config[_0x8339('0x1f')],_0x8339('0x29')));},'filename':function(_0x159a94,_0x36c9f2,_0x45ee04){_0x36c9f2['originalname']=_0x36c9f2[_0x8339('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45ee04(null,util[_0x8339('0x22')]('%s-%s%s',path[_0x8339('0x23')](_0x36c9f2['originalname'],path[_0x8339('0x24')](_0x36c9f2['originalname'])),Date[_0x8339('0x25')](),path[_0x8339('0x24')](_0x36c9f2[_0x8339('0x20')])));}})});router[_0x8339('0x19')](_0x8339('0x2a'),upload[_0x8339('0x2b')](_0x8339('0x27')),controller[_0x8339('0x2c')]);router['post'](_0x8339('0x2d'),auth['isAuthenticated'](),controller[_0x8339('0x2e')]);router['put'](_0x8339('0x2f'),auth[_0x8339('0x9')](),controller['update']);router[_0x8339('0x30')]('/:id',auth[_0x8339('0x9')](),controller['destroy']);module['exports']=router;