Built motion from commit (unavailable).|2.3.4
[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 _0x136f=['put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./cmContact.controller','index','get','/describe','isAuthenticated','describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','create','/create_many','bulkCreate','/:id/tags','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','single','file','uploadCsv','join','format','/upload','upload','/upload/:id'];(function(_0x383f90,_0x42edf5){var _0x101752=function(_0x2669c9){while(--_0x2669c9){_0x383f90['push'](_0x383f90['shift']());}};_0x101752(++_0x42edf5);}(_0x136f,0x174));var _0xf136=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x136f[_0x819464];return _0x49dcc0;};'use strict';var multer=require('multer');var util=require(_0xf136('0x0'));var path=require(_0xf136('0x1'));var timeout=require(_0xf136('0x2'));var express=require('express');var router=express[_0xf136('0x3')]();var auth=require(_0xf136('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf136('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xf136('0x6')]);router[_0xf136('0x7')](_0xf136('0x8'),auth[_0xf136('0x9')](),controller[_0xf136('0xa')]);router[_0xf136('0x7')](_0xf136('0xb'),auth[_0xf136('0x9')](),controller[_0xf136('0xc')]);router[_0xf136('0x7')]('/:id/tags',auth[_0xf136('0x9')](),controller[_0xf136('0xd')]);router[_0xf136('0x7')](_0xf136('0xe'),auth[_0xf136('0x9')](),controller[_0xf136('0xf')]);router[_0xf136('0x7')](_0xf136('0x10'),auth[_0xf136('0x9')](),controller['getHopperHistories']);router[_0xf136('0x7')](_0xf136('0x11'),auth[_0xf136('0x9')](),controller[_0xf136('0x12')]);router[_0xf136('0x7')](_0xf136('0x13'),auth[_0xf136('0x9')](),controller[_0xf136('0x14')]);router[_0xf136('0x15')]('/merge',auth[_0xf136('0x9')](),controller['merge']);router[_0xf136('0x15')]('/',auth[_0xf136('0x9')](),controller[_0xf136('0x16')]);router['post'](_0xf136('0x17'),auth[_0xf136('0x9')](),controller[_0xf136('0x18')]);router[_0xf136('0x15')](_0xf136('0x19'),auth[_0xf136('0x9')](),controller['setTags']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a1e53,_0x9c8bf0,_0x40ce92){_0x40ce92(null,path['join'](config[_0xf136('0x1a')],_0xf136('0x1b')));},'filename':function(_0x2e9403,_0x3d753c,_0x46d498){_0x3d753c[_0xf136('0x1c')]=_0x3d753c['originalname'][_0xf136('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x46d498(null,util['format'](_0xf136('0x1e'),path[_0xf136('0x1f')](_0x3d753c['originalname'],path[_0xf136('0x20')](_0x3d753c[_0xf136('0x1c')])),Date[_0xf136('0x21')](),path[_0xf136('0x20')](_0x3d753c[_0xf136('0x1c')])));}})});router[_0xf136('0x15')]('/csv',upload[_0xf136('0x22')](_0xf136('0x23')),controller[_0xf136('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2e4dec,_0x41ced7,_0x216dde){_0x216dde(null,path[_0xf136('0x25')](config[_0xf136('0x1a')],_0xf136('0x1b')));},'filename':function(_0x1cc041,_0x21fe41,_0x7e4e3f){_0x21fe41['originalname']=_0x21fe41[_0xf136('0x1c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7e4e3f(null,util[_0xf136('0x26')](_0xf136('0x1e'),path['basename'](_0x21fe41['originalname'],path[_0xf136('0x20')](_0x21fe41[_0xf136('0x1c')])),Date[_0xf136('0x21')](),path[_0xf136('0x20')](_0x21fe41[_0xf136('0x1c')])));}})});router[_0xf136('0x15')](_0xf136('0x27'),upload[_0xf136('0x22')](_0xf136('0x23')),controller[_0xf136('0x28')]);router[_0xf136('0x15')](_0xf136('0x29'),auth['isAuthenticated'](),controller['import']);router[_0xf136('0x2a')](_0xf136('0xb'),auth[_0xf136('0x9')](),controller[_0xf136('0x2b')]);router['delete'](_0xf136('0xb'),auth[_0xf136('0x9')](),controller[_0xf136('0x2c')]);module[_0xf136('0x2d')]=router;