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