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