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