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