Built motion from commit (unavailable).|2.3.1
[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 _0x3a25=['/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','upload','import','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/tags','getTags'];(function(_0xa78dfb,_0x46d3cf){var _0x5442ec=function(_0x570b80){while(--_0x570b80){_0xa78dfb['push'](_0xa78dfb['shift']());}};_0x5442ec(++_0x46d3cf);}(_0x3a25,0xe1));var _0x53a2=function(_0x3b7775,_0x3117c6){_0x3b7775=_0x3b7775-0x0;var _0x287e66=_0x3a25[_0x3b7775];return _0x287e66;};'use strict';var multer=require('multer');var util=require(_0x53a2('0x0'));var path=require(_0x53a2('0x1'));var timeout=require(_0x53a2('0x2'));var express=require(_0x53a2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x53a2('0x4'));var config=require(_0x53a2('0x5'));var controller=require(_0x53a2('0x6'));router[_0x53a2('0x7')]('/',auth[_0x53a2('0x8')](),controller['index']);router[_0x53a2('0x7')](_0x53a2('0x9'),auth[_0x53a2('0x8')](),controller[_0x53a2('0xa')]);router[_0x53a2('0x7')](_0x53a2('0xb'),auth[_0x53a2('0x8')](),controller[_0x53a2('0xc')]);router['get'](_0x53a2('0xd'),auth[_0x53a2('0x8')](),controller[_0x53a2('0xe')]);router[_0x53a2('0x7')](_0x53a2('0xf'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x10')]);router['get'](_0x53a2('0x11'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x12')]);router[_0x53a2('0x7')](_0x53a2('0x13'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x53a2('0x7')](_0x53a2('0x14'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x15')]);router[_0x53a2('0x16')](_0x53a2('0x17'),auth['isAuthenticated'](),controller[_0x53a2('0x18')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x53a2('0x16')](_0x53a2('0x19'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x1a')]);router[_0x53a2('0x16')]('/:id/tags',auth[_0x53a2('0x8')](),controller[_0x53a2('0x1b')]);var upload=multer({'storage':multer[_0x53a2('0x1c')]({'destination':function(_0x341016,_0x332a6a,_0x1aa090){_0x1aa090(null,path['join'](config[_0x53a2('0x1d')],_0x53a2('0x1e')));},'filename':function(_0xd333e6,_0x307263,_0x3bf882){_0x307263[_0x53a2('0x1f')]=_0x307263[_0x53a2('0x1f')][_0x53a2('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3bf882(null,util[_0x53a2('0x21')](_0x53a2('0x22'),path[_0x53a2('0x23')](_0x307263['originalname'],path[_0x53a2('0x24')](_0x307263['originalname'])),Date[_0x53a2('0x25')](),path[_0x53a2('0x24')](_0x307263[_0x53a2('0x1f')])));}})});router[_0x53a2('0x16')](_0x53a2('0x26'),upload[_0x53a2('0x27')](_0x53a2('0x28')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x53a2('0x1c')]({'destination':function(_0x112335,_0x4aa2d7,_0x5c5508){_0x5c5508(null,path['join'](config[_0x53a2('0x1d')],_0x53a2('0x1e')));},'filename':function(_0x2873e4,_0x57d93e,_0x491bba){_0x57d93e[_0x53a2('0x1f')]=_0x57d93e[_0x53a2('0x1f')][_0x53a2('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x491bba(null,util[_0x53a2('0x21')](_0x53a2('0x22'),path['basename'](_0x57d93e[_0x53a2('0x1f')],path[_0x53a2('0x24')](_0x57d93e['originalname'])),Date[_0x53a2('0x25')](),path[_0x53a2('0x24')](_0x57d93e['originalname'])));}})});router[_0x53a2('0x16')]('/upload',upload[_0x53a2('0x27')]('file'),controller[_0x53a2('0x29')]);router[_0x53a2('0x16')]('/upload/:id',auth[_0x53a2('0x8')](),controller[_0x53a2('0x2a')]);router[_0x53a2('0x2b')](_0x53a2('0xb'),auth[_0x53a2('0x8')](),controller[_0x53a2('0x2c')]);router[_0x53a2('0x2d')](_0x53a2('0xb'),auth['isAuthenticated'](),controller[_0x53a2('0x2e')]);module[_0x53a2('0x2f')]=router;