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