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