Built motion from commit d9028345.|2.5.43
[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 _0x3228=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmContact.controller','get','index','/describe','isAuthenticated','describe','show','/:id/tags','getTags','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/jscripty_sessions','/:id/journey','getJourney','/merge','merge','post','/create_many','bulkCreate','diskStorage','join','root','originalname','replace','format','extname','now','/csv','uploadCsv','%s-%s%s','basename','/upload','single','file','upload','/upload/:id','put','/:id','delete','destroy','exports','multer','util'];(function(_0x34c0b7,_0x67d9b){var _0x3b62e8=function(_0x3acc10){while(--_0x3acc10){_0x34c0b7['push'](_0x34c0b7['shift']());}};_0x3b62e8(++_0x67d9b);}(_0x3228,0x163));var _0x8322=function(_0xf5b01b,_0x3fc979){_0xf5b01b=_0xf5b01b-0x0;var _0x41021a=_0x3228[_0xf5b01b];return _0x41021a;};'use strict';var multer=require(_0x8322('0x0'));var util=require(_0x8322('0x1'));var path=require(_0x8322('0x2'));var timeout=require(_0x8322('0x3'));var express=require(_0x8322('0x4'));var router=express[_0x8322('0x5')]();var fs_extra=require(_0x8322('0x6'));var auth=require(_0x8322('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8322('0x8'));var controller=require(_0x8322('0x9'));router[_0x8322('0xa')]('/',auth['isAuthenticated'](),controller[_0x8322('0xb')]);router[_0x8322('0xa')](_0x8322('0xc'),auth[_0x8322('0xd')](),controller[_0x8322('0xe')]);router[_0x8322('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x8322('0xf')]);router[_0x8322('0xa')](_0x8322('0x10'),auth[_0x8322('0xd')](),controller[_0x8322('0x11')]);router[_0x8322('0xa')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x8322('0x12')]);router[_0x8322('0xa')](_0x8322('0x13'),auth[_0x8322('0xd')](),controller['getHopperHistories']);router['get'](_0x8322('0x14'),auth[_0x8322('0xd')](),controller['getHopperFinals']);router[_0x8322('0xa')](_0x8322('0x15'),auth[_0x8322('0xd')](),controller['getJscriptySessions']);router[_0x8322('0xa')](_0x8322('0x16'),auth['isAuthenticated'](),controller[_0x8322('0x17')]);router['post'](_0x8322('0x18'),auth[_0x8322('0xd')](),controller[_0x8322('0x19')]);router['post']('/',auth[_0x8322('0xd')](),controller['create']);router[_0x8322('0x1a')](_0x8322('0x1b'),auth[_0x8322('0xd')](),controller[_0x8322('0x1c')]);router[_0x8322('0x1a')]('/:id/tags',auth[_0x8322('0xd')](),controller['setTags']);var upload=multer({'storage':multer[_0x8322('0x1d')]({'destination':function(_0x224ba0,_0x21fbaf,_0x50fe0a){_0x50fe0a(null,path[_0x8322('0x1e')](config[_0x8322('0x1f')],'server/files/tmp'));},'filename':function(_0x3c5526,_0x5c4514,_0x592064){_0x5c4514['originalname']=_0x5c4514[_0x8322('0x20')][_0x8322('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x592064(null,util[_0x8322('0x22')]('%s-%s%s',path['basename'](_0x5c4514['originalname'],path[_0x8322('0x23')](_0x5c4514[_0x8322('0x20')])),Date[_0x8322('0x24')](),path[_0x8322('0x23')](_0x5c4514['originalname'])));}})});router[_0x8322('0x1a')](_0x8322('0x25'),upload['single']('file'),controller[_0x8322('0x26')]);var upload=multer({'storage':multer[_0x8322('0x1d')]({'destination':function(_0x4c2e24,_0x43ba31,_0x3aaa47){_0x3aaa47(null,path[_0x8322('0x1e')](config[_0x8322('0x1f')],'server/files/tmp'));},'filename':function(_0x4fee0e,_0x5df969,_0x43c538){_0x5df969['originalname']=_0x5df969[_0x8322('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x43c538(null,util[_0x8322('0x22')](_0x8322('0x27'),path[_0x8322('0x28')](_0x5df969[_0x8322('0x20')],path['extname'](_0x5df969[_0x8322('0x20')])),Date[_0x8322('0x24')](),path[_0x8322('0x23')](_0x5df969[_0x8322('0x20')])));}})});router['post'](_0x8322('0x29'),upload[_0x8322('0x2a')](_0x8322('0x2b')),controller[_0x8322('0x2c')]);router[_0x8322('0x1a')](_0x8322('0x2d'),auth[_0x8322('0xd')](),controller['import']);router[_0x8322('0x2e')](_0x8322('0x2f'),auth['isAuthenticated'](),controller['update']);router[_0x8322('0x30')](_0x8322('0x2f'),auth[_0x8322('0xd')](),controller[_0x8322('0x31')]);module[_0x8322('0x32')]=router;