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