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