dbb73993a107fdbe1e463ceb1bacdcaa4d97394b
[motion2.git] / server / api / user / 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 _0xf270=['/:id/avatar','single','addAvatar','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeTeams','destroy','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','getAvatar','/:id/open_tabs','getOpenTabs','/:id/queues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/:id/contacts','create','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','now','originalname'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0xf270,0x182));var _0x0f27=function(_0x28d7b5,_0x1305a4){_0x28d7b5=_0x28d7b5-0x0;var _0x1ed035=_0xf270[_0x28d7b5];return _0x1ed035;};'use strict';var multer=require(_0x0f27('0x0'));var util=require(_0x0f27('0x1'));var path=require(_0x0f27('0x2'));var timeout=require(_0x0f27('0x3'));var express=require(_0x0f27('0x4'));var router=express[_0x0f27('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0f27('0x6'));var interaction=require(_0x0f27('0x7'));var config=require(_0x0f27('0x8'));var controller=require('./user.controller');router['get']('/',auth[_0x0f27('0x9')](),controller[_0x0f27('0xa')]);router[_0x0f27('0xb')](_0x0f27('0xc'),auth['isAuthenticated'](),controller[_0x0f27('0xd')]);router[_0x0f27('0xb')](_0x0f27('0xe'),auth[_0x0f27('0x9')](),controller[_0x0f27('0xf')]);router['get'](_0x0f27('0x10'),auth['isAuthenticated'](),controller[_0x0f27('0x11')]);router[_0x0f27('0xb')](_0x0f27('0x12'),auth[_0x0f27('0x9')](),controller['show']);router['get']('/:id/avatar',controller[_0x0f27('0x13')]);router[_0x0f27('0xb')](_0x0f27('0x14'),auth['isAuthenticated'](),controller[_0x0f27('0x15')]);router[_0x0f27('0xb')]('/:id/contacts',auth[_0x0f27('0x9')](),controller['getContacts']);router[_0x0f27('0xb')](_0x0f27('0x16'),auth[_0x0f27('0x9')](),controller['getQueues']);router[_0x0f27('0xb')](_0x0f27('0x17'),auth[_0x0f27('0x9')](),controller['getVoiceQueuesRt']);router['get'](_0x0f27('0x18'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x19')]);router['get'](_0x0f27('0x1a'),auth['isAuthenticated'](),controller[_0x0f27('0x1b')]);router[_0x0f27('0xb')](_0x0f27('0x1c'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x1d')]);router[_0x0f27('0xb')](_0x0f27('0x1e'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x1f')]);router[_0x0f27('0xb')]('/:id/openchannel/interactions',auth[_0x0f27('0x9')](),controller[_0x0f27('0x20')]);router[_0x0f27('0xb')](_0x0f27('0x21'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x0f27('0xb')](_0x0f27('0x22'),auth['isAuthenticated'](),controller[_0x0f27('0x23')]);router[_0x0f27('0xb')](_0x0f27('0x24'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x25')]);router['get'](_0x0f27('0x26'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x27')]);router[_0x0f27('0xb')](_0x0f27('0x28'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x29')]);router[_0x0f27('0xb')](_0x0f27('0x2a'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x2b')]);router[_0x0f27('0xb')](_0x0f27('0x2c'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x2d')]);router['get'](_0x0f27('0x2e'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x2f')]);router[_0x0f27('0xb')](_0x0f27('0x30'),auth[_0x0f27('0x9')](),controller['getFaxAccounts']);router[_0x0f27('0xb')](_0x0f27('0x31'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x32')]);router[_0x0f27('0xb')](_0x0f27('0x33'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x0f27('0x34'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x35')]);router['get'](_0x0f27('0x36'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x37')]);router[_0x0f27('0xb')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router[_0x0f27('0xb')](_0x0f27('0x38'),auth['isAuthenticated'](),controller[_0x0f27('0x39')]);router[_0x0f27('0xb')](_0x0f27('0x3a'),auth['isAuthenticated'](),controller[_0x0f27('0x3b')]);router[_0x0f27('0xb')](_0x0f27('0x3c'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x3d')]);router[_0x0f27('0x3e')](_0x0f27('0x3f'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0x0f27('0x9')](),controller[_0x0f27('0x40')]);router['post']('/create_many',auth[_0x0f27('0x9')](),controller[_0x0f27('0x41')]);router[_0x0f27('0x3e')]('/:id/queues',auth[_0x0f27('0x9')](),controller[_0x0f27('0x42')]);var upload=multer({'storage':multer[_0x0f27('0x43')]({'destination':function(_0x17d892,_0x6e556,_0x2586dc){_0x2586dc(null,path[_0x0f27('0x44')](config[_0x0f27('0x45')],'server/files/images/'));},'filename':function(_0xbb20bb,_0x2ea682,_0x117848){_0x117848(null,util[_0x0f27('0x46')](_0x0f27('0x47'),Date[_0x0f27('0x48')](),_0x2ea682[_0x0f27('0x49')]));}})});router[_0x0f27('0x3e')](_0x0f27('0x4a'),upload[_0x0f27('0x4b')]('file'),controller[_0x0f27('0x4c')]);router[_0x0f27('0x3e')](_0x0f27('0x4d'),auth['isAuthenticated'](),controller['login']);router[_0x0f27('0x3e')](_0x0f27('0x4e'),auth[_0x0f27('0x9')](),controller['logout']);router[_0x0f27('0x3e')](_0x0f27('0x4f'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x50')]);router[_0x0f27('0x3e')](_0x0f27('0x51'),auth[_0x0f27('0x9')](),controller['unpause']);router[_0x0f27('0x3e')](_0x0f27('0x28'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x52')]);router[_0x0f27('0x3e')]('/:id/chat_interactions',auth[_0x0f27('0x9')](),controller[_0x0f27('0x53')]);router[_0x0f27('0x3e')](_0x0f27('0x54'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x55')]);router[_0x0f27('0x3e')]('/:id/fax_interactions',auth[_0x0f27('0x9')](),controller[_0x0f27('0x56')]);router['post'](_0x0f27('0x57'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x58')]);router[_0x0f27('0x3e')](_0x0f27('0x59'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x5a')]);router['post'](_0x0f27('0x5b'),auth['isAuthenticated'](),controller[_0x0f27('0x5c')]);router[_0x0f27('0x3e')](_0x0f27('0x30'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x5d')]);router['post'](_0x0f27('0x31'),auth[_0x0f27('0x9')](),controller['addMailAccounts']);router[_0x0f27('0x3e')](_0x0f27('0x33'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x5e')]);router[_0x0f27('0x3e')]('/:id/sms_accounts',auth[_0x0f27('0x9')](),controller['addSmsAccounts']);router[_0x0f27('0x3e')](_0x0f27('0x36'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x5f')]);router[_0x0f27('0x3e')]('/:id/whatsapp_accounts',auth[_0x0f27('0x9')](),controller[_0x0f27('0x60')]);router[_0x0f27('0x3e')](_0x0f27('0x38'),auth[_0x0f27('0x9')](),controller['addSquareProjects']);router[_0x0f27('0x3e')](_0x0f27('0x3c'),auth['isAuthenticated'](),controller[_0x0f27('0x61')]);router[_0x0f27('0x62')](_0x0f27('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x0f27('0x62')](_0x0f27('0x63'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x64')]);router['delete'](_0x0f27('0x16'),auth[_0x0f27('0x9')](),controller['removeQueues']);router[_0x0f27('0x65')]('/:id/teams',auth[_0x0f27('0x9')](),controller[_0x0f27('0x66')]);router[_0x0f27('0x65')](_0x0f27('0x12'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x67')]);router['delete']('/:id/chat_interactions',auth[_0x0f27('0x9')](),controller['removeChatInteractions']);router[_0x0f27('0x65')]('/:id/mail_interactions',auth[_0x0f27('0x9')](),controller[_0x0f27('0x68')]);router[_0x0f27('0x65')](_0x0f27('0x69'),auth[_0x0f27('0x9')](),controller['removeFaxInteractions']);router[_0x0f27('0x65')](_0x0f27('0x57'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x6a')]);router[_0x0f27('0x65')](_0x0f27('0x59'),auth['isAuthenticated'](),controller[_0x0f27('0x6b')]);router['delete'](_0x0f27('0x5b'),auth[_0x0f27('0x9')](),controller['removeWhatsappInteractions']);router[_0x0f27('0x65')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0f27('0x6c')]);router['delete']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x0f27('0x6d')]);router['delete']('/:id/openchannel_accounts',auth[_0x0f27('0x9')](),controller[_0x0f27('0x6e')]);router[_0x0f27('0x65')]('/:id/sms_accounts',auth[_0x0f27('0x9')](),controller['removeSmsAccounts']);router[_0x0f27('0x65')]('/:id/chat_websites',auth[_0x0f27('0x9')](),controller[_0x0f27('0x6f')]);router[_0x0f27('0x65')](_0x0f27('0x70'),auth[_0x0f27('0x9')](),controller[_0x0f27('0x71')]);router[_0x0f27('0x65')](_0x0f27('0x38'),auth[_0x0f27('0x9')](),controller['removeSquareProjects']);router[_0x0f27('0x65')](_0x0f27('0x3c'),auth['isAuthenticated'](),controller[_0x0f27('0x72')]);module['exports']=router;