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