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