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