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