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