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