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