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