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