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