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