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