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