Built motion from commit a61a4a20.|2.5.46
[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 _0xce7e=['getJscriptySessions','/:id/journey','getJourney','/merge','merge','post','create','/create_many','setTags','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','/csv','single','uploadCsv','root','server/files/tmp','now','/upload','file','/upload/:id','import','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xce7e,0x137));var _0xece7=function(_0x3dba4a,_0x5d6d75){_0x3dba4a=_0x3dba4a-0x0;var _0x355fe1=_0xce7e[_0x3dba4a];return _0x355fe1;};'use strict';var multer=require(_0xece7('0x0'));var util=require(_0xece7('0x1'));var path=require(_0xece7('0x2'));var timeout=require(_0xece7('0x3'));var express=require(_0xece7('0x4'));var router=express['Router']();var fs_extra=require(_0xece7('0x5'));var auth=require(_0xece7('0x6'));var interaction=require(_0xece7('0x7'));var config=require(_0xece7('0x8'));var controller=require('./cmContact.controller');router[_0xece7('0x9')]('/',auth[_0xece7('0xa')](),controller[_0xece7('0xb')]);router[_0xece7('0x9')](_0xece7('0xc'),auth[_0xece7('0xa')](),controller[_0xece7('0xd')]);router['get'](_0xece7('0xe'),auth[_0xece7('0xa')](),controller[_0xece7('0xf')]);router[_0xece7('0x9')](_0xece7('0x10'),auth[_0xece7('0xa')](),controller[_0xece7('0x11')]);router['get'](_0xece7('0x12'),auth[_0xece7('0xa')](),controller[_0xece7('0x13')]);router[_0xece7('0x9')](_0xece7('0x14'),auth[_0xece7('0xa')](),controller[_0xece7('0x15')]);router[_0xece7('0x9')](_0xece7('0x16'),auth['isAuthenticated'](),controller[_0xece7('0x17')]);router[_0xece7('0x9')](_0xece7('0x18'),auth[_0xece7('0xa')](),controller[_0xece7('0x19')]);router[_0xece7('0x9')](_0xece7('0x1a'),auth[_0xece7('0xa')](),controller[_0xece7('0x1b')]);router['post'](_0xece7('0x1c'),auth[_0xece7('0xa')](),controller[_0xece7('0x1d')]);router[_0xece7('0x1e')]('/',auth[_0xece7('0xa')](),controller[_0xece7('0x1f')]);router[_0xece7('0x1e')](_0xece7('0x20'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0xece7('0x1e')]('/:id/tags',auth['isAuthenticated'](),controller[_0xece7('0x21')]);var upload=multer({'storage':multer[_0xece7('0x22')]({'destination':function(_0x637f39,_0x5d1bc9,_0x4dd937){_0x4dd937(null,path[_0xece7('0x23')](config['root'],'server/files/tmp'));},'filename':function(_0xc7c9c5,_0x278a4f,_0x4d24fd){_0x278a4f[_0xece7('0x24')]=_0x278a4f['originalname'][_0xece7('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d24fd(null,util[_0xece7('0x26')](_0xece7('0x27'),path[_0xece7('0x28')](_0x278a4f[_0xece7('0x24')],path[_0xece7('0x29')](_0x278a4f[_0xece7('0x24')])),Date['now'](),path['extname'](_0x278a4f[_0xece7('0x24')])));}})});router['post'](_0xece7('0x2a'),upload[_0xece7('0x2b')]('file'),controller[_0xece7('0x2c')]);var upload=multer({'storage':multer[_0xece7('0x22')]({'destination':function(_0x3e5bc2,_0x454934,_0x983a1f){_0x983a1f(null,path['join'](config[_0xece7('0x2d')],_0xece7('0x2e')));},'filename':function(_0x16f048,_0x100afc,_0x16e73b){_0x100afc[_0xece7('0x24')]=_0x100afc[_0xece7('0x24')][_0xece7('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x16e73b(null,util[_0xece7('0x26')](_0xece7('0x27'),path[_0xece7('0x28')](_0x100afc[_0xece7('0x24')],path['extname'](_0x100afc[_0xece7('0x24')])),Date[_0xece7('0x2f')](),path['extname'](_0x100afc[_0xece7('0x24')])));}})});router[_0xece7('0x1e')](_0xece7('0x30'),upload[_0xece7('0x2b')](_0xece7('0x31')),controller['upload']);router[_0xece7('0x1e')](_0xece7('0x32'),auth[_0xece7('0xa')](),controller[_0xece7('0x33')]);router[_0xece7('0x34')]('/:id',auth[_0xece7('0xa')](),controller[_0xece7('0x35')]);router[_0xece7('0x36')](_0xece7('0xe'),auth[_0xece7('0xa')](),controller['destroy']);module[_0xece7('0x37')]=router;