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