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