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