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