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