39298c89ca12533fc717eba360106ad9436f5722
[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 _0x038b=['/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','/:id/tags','join','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','/csv','file','uploadCsv','diskStorage','/upload','single','upload','/upload/:id','import','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals'];(function(_0xcb19e1,_0x465489){var _0x121872=function(_0x5c9cd1){while(--_0x5c9cd1){_0xcb19e1['push'](_0xcb19e1['shift']());}};_0x121872(++_0x465489);}(_0x038b,0x114));var _0xb038=function(_0x15b717,_0x3de5c5){_0x15b717=_0x15b717-0x0;var _0x190d7c=_0x038b[_0x15b717];return _0x190d7c;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./cmContact.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['get']('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xa')]);router['get']('/:id/tags',auth[_0xb038('0x7')](),controller[_0xb038('0xb')]);router['get'](_0xb038('0xc'),auth[_0xb038('0x7')](),controller[_0xb038('0xd')]);router[_0xb038('0x6')](_0xb038('0xe'),auth[_0xb038('0x7')](),controller[_0xb038('0xf')]);router[_0xb038('0x6')](_0xb038('0x10'),auth[_0xb038('0x7')](),controller[_0xb038('0x11')]);router[_0xb038('0x6')](_0xb038('0x12'),auth[_0xb038('0x7')](),controller[_0xb038('0x13')]);router[_0xb038('0x14')](_0xb038('0x15'),auth['isAuthenticated'](),controller[_0xb038('0x16')]);router[_0xb038('0x14')]('/',auth[_0xb038('0x7')](),controller[_0xb038('0x17')]);router[_0xb038('0x14')](_0xb038('0x18'),auth['isAuthenticated'](),controller[_0xb038('0x19')]);router[_0xb038('0x14')](_0xb038('0x1a'),auth[_0xb038('0x7')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x20cea2,_0x3f48e6,_0x3e06ef){_0x3e06ef(null,path[_0xb038('0x1b')](config['root'],_0xb038('0x1c')));},'filename':function(_0x42c8ee,_0x3e0ea0,_0x33a377){_0x3e0ea0[_0xb038('0x1d')]=_0x3e0ea0['originalname'][_0xb038('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x33a377(null,util[_0xb038('0x1f')](_0xb038('0x20'),path[_0xb038('0x21')](_0x3e0ea0['originalname'],path[_0xb038('0x22')](_0x3e0ea0[_0xb038('0x1d')])),Date['now'](),path[_0xb038('0x22')](_0x3e0ea0[_0xb038('0x1d')])));}})});router['post'](_0xb038('0x23'),upload['single'](_0xb038('0x24')),controller[_0xb038('0x25')]);var upload=multer({'storage':multer[_0xb038('0x26')]({'destination':function(_0x1df7c4,_0x5d4343,_0xe4ceda){_0xe4ceda(null,path[_0xb038('0x1b')](config['root'],_0xb038('0x1c')));},'filename':function(_0x33cf3c,_0x226631,_0x5d18c8){_0x226631[_0xb038('0x1d')]=_0x226631[_0xb038('0x1d')][_0xb038('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5d18c8(null,util['format'](_0xb038('0x20'),path[_0xb038('0x21')](_0x226631[_0xb038('0x1d')],path[_0xb038('0x22')](_0x226631[_0xb038('0x1d')])),Date['now'](),path[_0xb038('0x22')](_0x226631[_0xb038('0x1d')])));}})});router[_0xb038('0x14')](_0xb038('0x27'),upload[_0xb038('0x28')](_0xb038('0x24')),controller[_0xb038('0x29')]);router[_0xb038('0x14')](_0xb038('0x2a'),auth[_0xb038('0x7')](),controller[_0xb038('0x2b')]);router[_0xb038('0x2c')](_0xb038('0x2d'),auth['isAuthenticated'](),controller[_0xb038('0x2e')]);router['delete'](_0xb038('0x2d'),auth[_0xb038('0x7')](),controller[_0xb038('0x2f')]);module[_0xb038('0x30')]=router;