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