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