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