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