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