Built motion from commit (unavailable).|2.5.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 _0xe14b=['/upload/:id','import','put','/:id','update','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/tags','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','merge','create','/create_many','bulkCreate','setTags','join','root','server/files/tmp','originalname','replace','%s-%s%s','extname','/csv','file','diskStorage','format','basename','now','/upload','single','upload'];(function(_0x49776f,_0x24836b){var _0x2c48f4=function(_0x508cae){while(--_0x508cae){_0x49776f['push'](_0x49776f['shift']());}};_0x2c48f4(++_0x24836b);}(_0xe14b,0x93));var _0xbe14=function(_0x2115bd,_0x2d6047){_0x2115bd=_0x2115bd-0x0;var _0x3d36cd=_0xe14b[_0x2115bd];return _0x3d36cd;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./cmContact.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0x5')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller['getTags']);router['get'](_0xbe14('0xc'),auth[_0xbe14('0x6')](),controller['getHoppers']);router[_0xbe14('0x5')](_0xbe14('0xd'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0x5')](_0xbe14('0xf'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x10')]);router[_0xbe14('0x5')](_0xbe14('0x11'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x13')]('/merge',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x13')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x15')]);router['post'](_0xbe14('0x16'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x13')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x137ee5,_0x456ca8,_0x329588){_0x329588(null,path[_0xbe14('0x19')](config[_0xbe14('0x1a')],_0xbe14('0x1b')));},'filename':function(_0x59a9e3,_0x24f820,_0x4a1bbd){_0x24f820[_0xbe14('0x1c')]=_0x24f820[_0xbe14('0x1c')][_0xbe14('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4a1bbd(null,util['format'](_0xbe14('0x1e'),path['basename'](_0x24f820[_0xbe14('0x1c')],path['extname'](_0x24f820[_0xbe14('0x1c')])),Date['now'](),path[_0xbe14('0x1f')](_0x24f820[_0xbe14('0x1c')])));}})});router['post'](_0xbe14('0x20'),upload['single'](_0xbe14('0x21')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xbe14('0x22')]({'destination':function(_0x5fa043,_0x1ee9c1,_0x39cc81){_0x39cc81(null,path[_0xbe14('0x19')](config[_0xbe14('0x1a')],'server/files/tmp'));},'filename':function(_0x1822e0,_0x1ba46a,_0x391556){_0x1ba46a[_0xbe14('0x1c')]=_0x1ba46a['originalname'][_0xbe14('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x391556(null,util[_0xbe14('0x23')]('%s-%s%s',path[_0xbe14('0x24')](_0x1ba46a[_0xbe14('0x1c')],path[_0xbe14('0x1f')](_0x1ba46a[_0xbe14('0x1c')])),Date[_0xbe14('0x25')](),path[_0xbe14('0x1f')](_0x1ba46a[_0xbe14('0x1c')])));}})});router[_0xbe14('0x13')](_0xbe14('0x26'),upload[_0xbe14('0x27')](_0xbe14('0x21')),controller[_0xbe14('0x28')]);router[_0xbe14('0x13')](_0xbe14('0x29'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x2a')]);router[_0xbe14('0x2b')](_0xbe14('0x2c'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x2d')]);router['delete'](_0xbe14('0x2c'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0x2e')]=router;