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