a71ee41a28c9dfa9b6c610a1133a1386f313d06d
[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 _0x7da7=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','getJscriptySessions','post','/merge','merge','create','/create_many','setTags','diskStorage','join','root','originalname','replace','format','now','extname','/csv','single','server/files/tmp','%s-%s%s','file','upload','/upload/:id','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../config/environment','./cmContact.controller'];(function(_0x190145,_0x563a56){var _0x35f024=function(_0x2de282){while(--_0x2de282){_0x190145['push'](_0x190145['shift']());}};_0x35f024(++_0x563a56);}(_0x7da7,0x10d));var _0x77da=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x7da7[_0x15fc3c];return _0x94c5c8;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0xd')]);router['get'](_0x77da('0xe'),auth[_0x77da('0x7')](),controller[_0x77da('0xf')]);router['get'](_0x77da('0x10'),auth[_0x77da('0x7')](),controller[_0x77da('0x11')]);router[_0x77da('0xb')]('/:id/hopper_histories',auth[_0x77da('0x7')](),controller[_0x77da('0x12')]);router[_0x77da('0xb')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x77da('0x13')]);router[_0x77da('0xb')]('/:id/jscripty_sessions',auth[_0x77da('0x7')](),controller[_0x77da('0x14')]);router[_0x77da('0x15')](_0x77da('0x16'),auth['isAuthenticated'](),controller[_0x77da('0x17')]);router['post']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x18')]);router[_0x77da('0x15')](_0x77da('0x19'),auth['isAuthenticated'](),controller['bulkCreate']);router['post']('/:id/tags',auth[_0x77da('0x7')](),controller[_0x77da('0x1a')]);var upload=multer({'storage':multer[_0x77da('0x1b')]({'destination':function(_0x335dcb,_0x19a00c,_0x12d2b1){_0x12d2b1(null,path[_0x77da('0x1c')](config[_0x77da('0x1d')],'server/files/tmp'));},'filename':function(_0x492063,_0xd5a809,_0x4d1512){_0xd5a809['originalname']=_0xd5a809[_0x77da('0x1e')][_0x77da('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d1512(null,util[_0x77da('0x20')]('%s-%s%s',path['basename'](_0xd5a809[_0x77da('0x1e')],path['extname'](_0xd5a809[_0x77da('0x1e')])),Date[_0x77da('0x21')](),path[_0x77da('0x22')](_0xd5a809[_0x77da('0x1e')])));}})});router[_0x77da('0x15')](_0x77da('0x23'),upload[_0x77da('0x24')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x77da('0x1b')]({'destination':function(_0x2d009f,_0x835167,_0xbd06b7){_0xbd06b7(null,path['join'](config[_0x77da('0x1d')],_0x77da('0x25')));},'filename':function(_0x470c9f,_0x36115b,_0x446ae7){_0x36115b['originalname']=_0x36115b[_0x77da('0x1e')][_0x77da('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x446ae7(null,util[_0x77da('0x20')](_0x77da('0x26'),path['basename'](_0x36115b['originalname'],path['extname'](_0x36115b[_0x77da('0x1e')])),Date[_0x77da('0x21')](),path[_0x77da('0x22')](_0x36115b[_0x77da('0x1e')])));}})});router[_0x77da('0x15')]('/upload',upload[_0x77da('0x24')](_0x77da('0x27')),controller[_0x77da('0x28')]);router[_0x77da('0x15')](_0x77da('0x29'),auth[_0x77da('0x7')](),controller['import']);router[_0x77da('0x2a')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0x2b')]);router[_0x77da('0x2c')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0x2d')]);module['exports']=router;