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