Built motion from commit 753c950e.|2.5.42
[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 _0xcd88=['getTags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','/upload','file','/upload/:id','import','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','/:id/tags'];(function(_0x1e382d,_0x256ce2){var _0x4527cd=function(_0xf6701b){while(--_0xf6701b){_0x1e382d['push'](_0x1e382d['shift']());}};_0x4527cd(++_0x256ce2);}(_0xcd88,0x147));var _0x8cd8=function(_0x1443eb,_0x203408){_0x1443eb=_0x1443eb-0x0;var _0x2b8810=_0xcd88[_0x1443eb];return _0x2b8810;};'use strict';var multer=require(_0x8cd8('0x0'));var util=require(_0x8cd8('0x1'));var path=require(_0x8cd8('0x2'));var timeout=require(_0x8cd8('0x3'));var express=require(_0x8cd8('0x4'));var router=express[_0x8cd8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8cd8('0x6'));var interaction=require(_0x8cd8('0x7'));var config=require(_0x8cd8('0x8'));var controller=require(_0x8cd8('0x9'));router[_0x8cd8('0xa')]('/',auth[_0x8cd8('0xb')](),controller[_0x8cd8('0xc')]);router[_0x8cd8('0xa')](_0x8cd8('0xd'),auth[_0x8cd8('0xb')](),controller['describe']);router[_0x8cd8('0xa')](_0x8cd8('0xe'),auth[_0x8cd8('0xb')](),controller['show']);router[_0x8cd8('0xa')](_0x8cd8('0xf'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x10')]);router['get'](_0x8cd8('0x11'),auth[_0x8cd8('0xb')](),controller['getHoppers']);router[_0x8cd8('0xa')](_0x8cd8('0x12'),auth['isAuthenticated'](),controller[_0x8cd8('0x13')]);router['get'](_0x8cd8('0x14'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x15')]);router['get']('/:id/jscripty_sessions',auth['isAuthenticated'](),controller['getJscriptySessions']);router[_0x8cd8('0xa')](_0x8cd8('0x16'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x17')]);router[_0x8cd8('0x18')]('/merge',auth['isAuthenticated'](),controller['merge']);router[_0x8cd8('0x18')]('/',auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x19')]);router[_0x8cd8('0x18')](_0x8cd8('0x1a'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x1b')]);router[_0x8cd8('0x18')](_0x8cd8('0xf'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x1c')]);var upload=multer({'storage':multer[_0x8cd8('0x1d')]({'destination':function(_0x1cd543,_0x288a8e,_0x238460){_0x238460(null,path['join'](config[_0x8cd8('0x1e')],_0x8cd8('0x1f')));},'filename':function(_0x192c71,_0x51f8db,_0x2efa34){_0x51f8db[_0x8cd8('0x20')]=_0x51f8db[_0x8cd8('0x20')][_0x8cd8('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2efa34(null,util[_0x8cd8('0x22')](_0x8cd8('0x23'),path[_0x8cd8('0x24')](_0x51f8db['originalname'],path[_0x8cd8('0x25')](_0x51f8db[_0x8cd8('0x20')])),Date[_0x8cd8('0x26')](),path[_0x8cd8('0x25')](_0x51f8db[_0x8cd8('0x20')])));}})});router['post'](_0x8cd8('0x27'),upload[_0x8cd8('0x28')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fa82b,_0x554dd9,_0x1a2e60){_0x1a2e60(null,path['join'](config[_0x8cd8('0x1e')],_0x8cd8('0x1f')));},'filename':function(_0x280420,_0x547287,_0x4d31fe){_0x547287[_0x8cd8('0x20')]=_0x547287[_0x8cd8('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d31fe(null,util[_0x8cd8('0x22')](_0x8cd8('0x23'),path[_0x8cd8('0x24')](_0x547287[_0x8cd8('0x20')],path[_0x8cd8('0x25')](_0x547287[_0x8cd8('0x20')])),Date[_0x8cd8('0x26')](),path['extname'](_0x547287[_0x8cd8('0x20')])));}})});router[_0x8cd8('0x18')](_0x8cd8('0x29'),upload[_0x8cd8('0x28')](_0x8cd8('0x2a')),controller['upload']);router[_0x8cd8('0x18')](_0x8cd8('0x2b'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x2c')]);router[_0x8cd8('0x2d')](_0x8cd8('0xe'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x2e')]);router[_0x8cd8('0x2f')](_0x8cd8('0xe'),auth[_0x8cd8('0xb')](),controller[_0x8cd8('0x30')]);module['exports']=router;