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