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