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