| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +defined('ABSPATH') or die; | |
| 4 | + | |
| 3 | 5 | /** |
| 4 | 6 | * @var $router FluentSupport\Framework\Http\Router |
| 5 | 7 | */ |
| 6 | 8 | |
| @@ -11,29 +13,36 @@ | ||
| 11 | 13 | $router->put('/{id}', 'MailBoxController@update')->int('id'); |
| 12 | 14 | $router->delete('/{id}', 'MailBoxController@delete')->int('id'); |
| 13 | 15 | $router->put('/{id}/move_tickets', 'MailBoxController@moveTickets')->int('id'); |
| 14 | 16 | |
| 15 | - /* | |
| 16 | - * @todo: Needs to refactor | |
| 17 | - */ | |
| 18 | 17 | $router->get('/{id}/tickets', 'MailBoxController@getTickets')->int('id'); |
| 19 | 18 | |
| 20 | 19 | $router->get('/{id}/email_settings', 'MailBoxController@getEmailSettings')->int('id'); |
| 21 | 20 | $router->get('/{id}/email_configs', 'MailBoxController@getEmailsSetups'); |
| 22 | 21 | $router->put('/{id}/email_settings', 'MailBoxController@saveEmailSettings')->int('id'); |
| 22 | + $router->put('/{id}/set_default', 'MailBoxController@setAsDefault')->int('id'); | |
| 23 | 23 | }); |
| 24 | 24 | |
| 25 | 25 | $router->prefix('tickets')->withPolicy('AgentTicketPolicy')->group(function ($router) { |
| 26 | 26 | |
| 27 | 27 | $router->get('my_stats', 'AgentController@myStats'); |
| 28 | + $router->get('agent_performance', 'AgentController@agentPerformance'); | |
| 28 | 29 | $router->get('/', 'TicketController@index'); |
| 29 | 30 | $router->post('/', 'TicketController@createTicket'); |
| 31 | + $router->get('/label-search', 'TicketController@fetchLabelSearch'); | |
| 32 | + $router->post('/label-search', 'TicketController@storeOrUpdateLabelSearch'); | |
| 33 | + $router->delete('/{label_search_id}/label-search', 'TicketController@deleteLabelSearch')->int('label_search_id'); | |
| 30 | 34 | |
| 35 | + $router->get('/{ticket_id}/mentionable-agents', 'TicketController@getMentionableAgents')->int('ticket_id'); | |
| 31 | 36 | $router->get('/{ticket_id}', 'TicketController@getTicket')->int('ticket_id'); |
| 32 | 37 | |
| 33 | 38 | $router->get('/{ticket_id}/widgets', 'TicketController@getTicketWidgets')->int('ticket_id'); |
| 34 | 39 | $router->post('/{ticket_id}/responses', 'TicketController@createResponse')->int('ticket_id'); |
| 35 | 40 | |
| 41 | + $router->post('/{ticket_id}/draft', 'TicketController@createOrUpdatDraft')->int('ticket_id'); | |
| 42 | + $router->get('/{ticket_id}/draft', 'TicketController@getDraft')->int('ticket_id'); | |
| 43 | + $router->delete('/{draft_id}/draft', 'TicketController@deleteDraft')->int('draft_id'); | |
| 44 | + | |
| 36 | 45 | $router->get('/{ticket_id}/live_activity', 'TicketController@getLiveActivity')->int('ticket_id'); |
| 37 | 46 | $router->delete('/{ticket_id}/live_activity', 'TicketController@removeLiveActivity')->int('ticket_id'); |
| 38 | 47 | |
| 39 | 48 | $router->put('/{ticket_id}/responses/{response_id}', 'TicketController@updateResponse') |
| @@ -39,15 +48,16 @@ | ||
| 39 | 48 | $router->put('/{ticket_id}/responses/{response_id}', 'TicketController@updateResponse') |
| 40 | 49 | ->int('ticket_id') |
| 41 | 50 | ->int('response_id'); |
| 42 | 51 | |
| 52 | + $router->put('/{ticket_id}/approve_draft_response/{response_id}', 'TicketController@approveDraftResponse') | |
| 53 | + ->int('ticket_id') | |
| 54 | + ->int('response_id'); | |
| 55 | + | |
| 43 | 56 | $router->delete('/{ticket_id}/responses/{response_id}', 'TicketController@deleteResponse') |
| 44 | 57 | ->int('ticket_id') |
| 45 | 58 | ->int('response_id'); |
| 46 | 59 | |
| 47 | - $router->post('/{ticket_id}/customer-responses', 'ConversationController@createCustomerReply') | |
| 48 | - ->int('ticket_id'); | |
| 49 | - | |
| 50 | 60 | $router->put('/{ticket_id}/property', 'TicketController@updateTicketProperty')->int('ticket_id'); |
| 51 | 61 | |
| 52 | 62 | $router->post('/{ticket_id}/tags', 'TicketController@addTag')->int('ticket_id'); |
| 53 | 63 | $router->delete('/{ticket_id}/tags/{tag_id}', 'TicketController@detachTag')->int('ticket_id')->int('tag_id'); |
| @@ -52,19 +62,45 @@ | ||
| 52 | 62 | $router->post('/{ticket_id}/tags', 'TicketController@addTag')->int('ticket_id'); |
| 53 | 63 | $router->delete('/{ticket_id}/tags/{tag_id}', 'TicketController@detachTag')->int('ticket_id')->int('tag_id'); |
| 54 | 64 | |
| 55 | 65 | $router->post('/{ticket_id}/close', 'TicketController@closeTicket')->int('ticket_id'); |
| 66 | + $router->delete('/{ticket_id}/delete', 'TicketController@deleteTicket')->int('ticket_id'); | |
| 56 | 67 | $router->post('/{ticket_id}/re-open', 'TicketController@reOpenTicket')->int('ticket_id'); |
| 57 | 68 | $router->put('/{ticket_id}/change-customer', 'TicketController@changeTicketCustomer')->int('ticket_id'); |
| 58 | 69 | $router->get('/{ticket_id}/custom-data', 'TicketController@getTicketCustomData')->int('ticket_id'); |
| 59 | 70 | |
| 71 | + $router->get('fluent-booking/event-types', 'TicketController@getFluentBookingEventTypes'); | |
| 72 | + $router->get('/{ticket_id}/fluent-booking/availability', 'TicketController@getFluentBookingAvailability')->int('ticket_id'); | |
| 73 | + $router->post('/{ticket_id}/fluent-booking/booking-link', 'TicketController@createFluentBookingLink')->int('ticket_id'); | |
| 74 | + $router->get('/{ticket_id}/fluent-booking/meetings', 'TicketController@getFluentBookingMeetings')->int('ticket_id'); | |
| 75 | + | |
| 60 | 76 | $router->post('bulk-actions', 'TicketController@doBulkActions'); // close_tickets | delete_tickets | assign_agent | assign_tags |
| 61 | 77 | $router->post('bulk-reply', 'TicketController@doBulkReplies'); |
| 62 | 78 | |
| 63 | 79 | $router->post('sync-fluentcrm-tags', 'TicketController@syncFluentCrmTags'); |
| 80 | + $router->post('sync-fluentcrm-lists', 'TicketController@syncFluentCrmLists'); | |
| 64 | 81 | |
| 82 | + $router->get('fluent-boards/boards', 'FluentBoardsController@getBoards'); | |
| 83 | + $router->get('fluent-boards/stages/{board_id}', 'FluentBoardsController@getStages')->int('board_id'); | |
| 84 | + $router->post('fluent-boards/stages', 'FluentBoardsController@createTask'); | |
| 85 | + | |
| 86 | + $router->get('search-contact', 'CustomerController@searchContact'); | |
| 87 | + | |
| 88 | + $router->get('ping', 'AgentController@ping'); | |
| 89 | + $router->get('ticket-essentials', 'TicketController@getTicketEssentials'); | |
| 90 | + $router->get('agent-insights', 'AgentController@getAgentInsights'); | |
| 65 | 91 | }); |
| 66 | 92 | |
| 93 | +$router->get('widgets', 'WidgetsController')->withPolicy('AgentTicketPolicy'); | |
| 94 | + | |
| 95 | +$router->prefix('notifications')->withPolicy('AgentTicketPolicy')->group(function ($router) { | |
| 96 | + $router->get('/', 'NotificationController@index'); | |
| 97 | + $router->get('/unread', 'NotificationController@unread'); | |
| 98 | + $router->get('/unread-count', 'NotificationController@unreadCount'); | |
| 99 | + $router->post('/mark-all-read', 'NotificationController@markAllRead'); | |
| 100 | + $router->post('/{notification_id}/mark-read', 'NotificationController@markRead')->int('notification_id'); | |
| 101 | +}); | |
| 102 | + | |
| 67 | 103 | $router->prefix('products')->withPolicy('AdminSettingsPolicy')->group(function ($router) { |
| 68 | 104 | $router->get('/', 'ProductController@index'); |
| 69 | 105 | $router->post('/', 'ProductController@create'); |
| 70 | 106 | $router->get('/{product_id}', 'ProductController@get')->int('product_id'); |
| @@ -90,27 +126,53 @@ | ||
| 90 | 126 | $router->post('/slack-integration', 'SlackController@saveSettings'); |
| 91 | 127 | $router->get('/pages', 'SettingsController@getPages'); |
| 92 | 128 | $router->post('/setup', 'SettingsController@setupPortal'); |
| 93 | 129 | $router->post('/setup-installation', 'SettingsController@setupInstallation'); |
| 130 | + $router->post('/recaptcha-settings', 'SettingsController@saveReCaptchaSettings'); | |
| 131 | + $router->get('/recaptcha-settings', 'SettingsController@getReCaptchaSettings'); | |
| 132 | + $router->get('/integration-statuses', 'SettingsController@integrationStatuses'); | |
| 94 | 133 | |
| 95 | 134 | $router->get('/fluentcrm-settings', 'SettingsController@getFluentCRMSettings'); |
| 96 | - $router->post('/intsall-fluentcrm', 'SettingsController@installFluentCRM'); | |
| 135 | + $router->post('/install-fluentcrm', 'SettingsController@installFluentCRM'); | |
| 136 | + | |
| 137 | + // Upload Settings | |
| 138 | + $router->get('/remote-upload-settings', 'SettingsController@getRemoteUploadSettings'); | |
| 139 | + $router->post('/update-remote-upload-driver', 'SettingsController@updateRemoteUploadDriver'); | |
| 140 | + | |
| 141 | + $router->get('/ai-integration', 'SettingsController@getAIProviderSettings'); | |
| 142 | + $router->post('/ai-integration', 'SettingsController@saveAIProviderSettings'); | |
| 143 | + $router->post('/ai-integration/disconnect', 'SettingsController@disconnectAIProvider'); | |
| 144 | + $router->get('/settings-menu', 'SettingsController@getSettingsMenu'); | |
| 145 | + $router->get('/fluent-bot-integration', 'SettingsController@getFluentBotSettings'); | |
| 146 | + $router->post('/fluent-bot-integration', 'SettingsController@saveFluentBotSettings'); | |
| 147 | + $router->get('/fluent-bot-presets', 'SettingsController@getFluentBotPresets'); | |
| 148 | + $router->post('/fluent-bot-presets', 'SettingsController@saveFluentBotPresets'); | |
| 149 | + | |
| 150 | + $router->get('/mcp', 'McpSettingsController@getStatus'); | |
| 151 | + $router->post('/mcp/toggle', 'McpSettingsController@toggle'); | |
| 152 | + $router->post('/mcp/install-adapter', 'McpSettingsController@installAdapter'); | |
| 153 | + $router->get('/mcp/config-snippets', 'McpSettingsController@getConfigSnippets'); | |
| 97 | 154 | }); |
| 98 | 155 | |
| 99 | -$router->prefix('agents')->withPolicy('AdminSensitivePolicy')->group(function ($router) { | |
| 156 | +$router->prefix('agents')->withPolicy('AgentPolicy')->group(function ($router) { | |
| 100 | 157 | $router->get('/', 'AgentController@index'); |
| 101 | 158 | $router->post('/', 'AgentController@addAgent'); |
| 102 | 159 | $router->put('/{agent_id}', 'AgentController@updateAgent')->int('agent_id'); |
| 103 | 160 | $router->delete('/{agent_id}', 'AgentController@deleteAgent')->int('agent_id'); |
| 104 | - $router->post('/{agent_id}/avatar', 'AgentController@addOrUpdateProfileImage')->int('agent_id'); | |
| 161 | + $router->post('/avatar/{agent_id}', 'AgentController@addOrUpdateProfileImage')->int('agent_id'); | |
| 162 | + $router->post('/reset_avatar/{agent}', 'AgentController@resetAvatar')->int('agent'); | |
| 105 | 163 | }); |
| 106 | 164 | |
| 165 | +$router->prefix('agent-groups')->withPolicy('AdminSensitivePolicy')->group(function ($router) { | |
| 166 | + $router->get('/', 'AgentGroupController@index'); | |
| 167 | + $router->post('/', 'AgentGroupController@create'); | |
| 168 | + $router->get('/{group_id}', 'AgentGroupController@get')->int('group_id'); | |
| 169 | + $router->put('/{group_id}', 'AgentGroupController@update')->int('group_id'); | |
| 170 | + $router->delete('/{group_id}', 'AgentGroupController@delete')->int('group_id'); | |
| 171 | +}); | |
| 172 | + | |
| 107 | 173 | $router->prefix('reports')->withPolicy('ReportPolicy')->group(function ($router) { |
| 108 | - $router->get('/', 'ReportingController@getOverallReports'); | |
| 109 | - $router->get('/tickets-growth', 'ReportingController@getTicketsChart'); | |
| 110 | - $router->get('/tickets-resolve-growth', 'ReportingController@getResolveChart'); | |
| 111 | - $router->get('/response-growth', 'ReportingController@getResponseChart'); | |
| 112 | - $router->get('/agents-summary', 'ReportingController@getAgentsSummary'); | |
| 174 | + $router->get('/stats', 'ReportingController@getStats'); | |
| 113 | 175 | }); |
| 114 | 176 | |
| 115 | 177 | $router->prefix('my-reports')->withPolicy('AgentTicketPolicy')->group(function ($router) { |
| 116 | 178 | $router->get('/', 'ReportingController@getAgentOverallReports'); |
| @@ -118,17 +180,22 @@ | ||
| 118 | 180 | $router->get('/response-growth', 'ReportingController@getAgentResponseChart'); |
| 119 | 181 | $router->get('/my-summary', 'ReportingController@getPersonalSummary'); |
| 120 | 182 | }); |
| 121 | 183 | |
| 122 | -$router->prefix('customers')->withPolicy('AdminSensitivePolicy')->group(function ($router) { | |
| 184 | +$router->prefix('customers')->withPolicy('CustomerPolicy')->group(function ($router) { | |
| 123 | 185 | $router->get('/', 'CustomerController@index'); |
| 124 | 186 | $router->post('/', 'CustomerController@create'); |
| 187 | + $router->get('/customerField/{customer_id}', 'CustomerController@customerField')->int('customer_id'); | |
| 125 | 188 | |
| 126 | 189 | $router->get('/{customer_id}', 'CustomerController@getCustomer')->int('customer_id'); |
| 127 | 190 | $router->put('/{customer_id}', 'CustomerController@update')->int('customer_id'); |
| 191 | + | |
| 192 | + //We will remove this method. | |
| 128 | 193 | $router->delete('/{customer_id}', 'CustomerController@delete')->int('customer_id'); |
| 194 | + $router->delete('/bulk-delete', 'CustomerController@bulkDelete'); | |
| 129 | 195 | |
| 130 | 196 | $router->post('/profile_image/{customer_id}', 'CustomerController@addOrUpdateProfileImage')->int('customer_id'); |
| 197 | + $router->post('/reset_avatar/{customer}', 'CustomerController@resetAvatar')->int('customer'); | |
| 131 | 198 | }); |
| 132 | 199 | |
| 133 | 200 | $router->prefix('customer-portal')->withPolicy('PortalPolicy')->group(function ($router) { |
| 134 | 201 | |
| @@ -143,18 +210,43 @@ | ||
| 143 | 210 | |
| 144 | 211 | $router->post('/tickets/{ticket_id}/close', 'CustomerPortalController@closeTicket')->int('ticket_id'); |
| 145 | 212 | $router->post('/tickets/{ticket_id}/re-open', 'CustomerPortalController@reOpenTicket')->int('ticket_id'); |
| 146 | 213 | |
| 147 | - $router->post('ticket_file_upload','UploaderController@uploadTicketFiles'); | |
| 214 | + $router->post('ticket_file_upload', 'UploaderController@uploadTicketFiles'); | |
| 148 | 215 | |
| 149 | 216 | $router->get('me', 'TicketController@me'); |
| 217 | + | |
| 218 | + $router->post('/tickets/{ticket_id}/agent-feedback', 'CustomerPortalController@agentFeedbackRating')->int('ticket_id'); | |
| 219 | + | |
| 220 | + $router->post('logout', 'CustomerPortalController@logout'); | |
| 150 | 221 | }); |
| 151 | 222 | |
| 152 | -$router->prefix('public')->withPolicy('PublicPolicy')->group(function($router) { | |
| 223 | +$router->prefix('public')->withPolicy('PublicPolicy')->group(function ($router) { | |
| 153 | 224 | $router->post('telegram_bot_response/{token}', 'ChatMessageParserController@handleTelegramWebhook')->alphaNumDash('token'); |
| 154 | 225 | $router->post('slack_response/{token}', 'ChatMessageParserController@handleSlackEvent')->alphaNumDash('token'); |
| 226 | + $router->get('/authorize', 'AuthorizeController@handleHelpScoutAuthorization'); | |
| 155 | 227 | }); |
| 156 | 228 | |
| 229 | +$router->prefix('fluent-bot')->withPolicy('AgentTicketPolicy')->group(function ($router) { | |
| 230 | + $router->get('/preset-prompts', 'FluentBotController@getPresetPrompts'); | |
| 231 | + $router->get('/runtime-config', 'FluentBotController@getRuntimeConfig'); | |
| 232 | + $router->post('/{id}/feedback', 'FluentBotController@createFeedback')->int('id'); | |
| 233 | + $router->delete('/{id}/feedback/{feedback_id}', 'FluentBotController@deleteFeedback')->int('id')->int('feedback_id'); | |
| 234 | + $router->post('/{id}/generate-response', 'FluentBotController@generateResponse')->int('id'); | |
| 235 | + $router->post('/{id}/generate-stream-response', 'FluentBotController@generateStreamResponse')->int('id'); | |
| 236 | + $router->post('/{id}/get-ticket-summary', 'FluentBotController@getTicketSummary')->int('id'); | |
| 237 | + $router->post('/{id}/get-ticket-tone', 'FluentBotController@getTicketTone')->int('id'); | |
| 238 | + $router->get('/{id}/chat-id', 'FluentBotController@getChatId')->int('id'); | |
| 239 | + $router->post('/{id}/chat-id', 'FluentBotController@saveChatId')->int('id'); | |
| 240 | + $router->delete('/{id}/chat-id', 'FluentBotController@deleteChatId')->int('id'); | |
| 241 | + $router->get('/{id}/chat-messages', 'FluentBotController@getChatMessages')->int('id'); | |
| 242 | + $router->get('/{id}/chat-stream', 'FluentBotController@resumeChatStream')->int('id'); | |
| 243 | + $router->get('/{id}/conversations', 'FluentBotController@getConversations')->int('id'); | |
| 244 | + $router->post('/{id}/conversations/switch', 'FluentBotController@switchConversation')->int('id'); | |
| 245 | + $router->get('/{id}/context-selection', 'FluentBotController@getContextSelection')->int('id'); | |
| 246 | + $router->post('/{id}/context-selection', 'FluentBotController@saveContextSelection')->int('id'); | |
| 247 | +}); | |
| 248 | + | |
| 157 | 249 | $router->prefix('activity-logger')->withPolicy('ActivityLoggerPolicy')->group(function ($router) { |
| 158 | 250 | $router->get('/', 'ActivityLoggerController@getActivities'); |
| 159 | 251 | $router->get('/settings', 'ActivityLoggerController@getSettings'); |
| 160 | 252 | $router->post('/settings', 'ActivityLoggerController@updateSettings'); |
| @@ -159,7 +251,29 @@ | ||
| 159 | 251 | $router->get('/settings', 'ActivityLoggerController@getSettings'); |
| 160 | 252 | $router->post('/settings', 'ActivityLoggerController@updateSettings'); |
| 161 | 253 | }); |
| 162 | 254 | |
| 255 | +$router->prefix('ai-activity-logger')->withPolicy('ActivityLoggerPolicy')->group(function ($router) { | |
| 256 | + $router->get('/', 'AIActivityLoggerController@getAIActivities'); | |
| 257 | + $router->post('/settings', 'AIActivityLoggerController@updateSettings'); | |
| 258 | + $router->get('/settings', 'AIActivityLoggerController@getSettings'); | |
| 259 | +}); | |
| 260 | + | |
| 163 | 261 | $router->post('signup', 'AuthController@signup')->withPolicy('PublicPolicy'); |
| 164 | 262 | |
| 165 | 263 | $router->post('login', 'AuthController@handleLogin')->withPolicy('PublicPolicy'); |
| 264 | + | |
| 265 | +$router->prefix('two_fa')->withPolicy('PublicPolicy')->group(function ($router) { | |
| 266 | + $router->post('/', 'TwofaController@verify2fa'); | |
| 267 | +}); | |
| 268 | + | |
| 269 | + | |
| 270 | +$router->post('reset_pass', 'AuthController@resetPassword')->withPolicy('PublicPolicy'); | |
| 271 | + | |
| 272 | +$router->prefix('ticket_importer')->withPolicy('AdminSettingsPolicy')->group(function ($router) { | |
| 273 | + $router->get('/', 'TicketImportController@getStats'); | |
| 274 | + $router->post('/import', 'TicketImportController@importTickets'); | |
| 275 | + $router->delete('/delete', 'TicketImportController@deleteTickets'); | |
| 276 | +}); | |
| 277 | + | |
| 278 | +$router->post('ticket_image_upload', 'UploaderController@uploadImage') | |
| 279 | + ->withPolicy('AgentTicketPolicy'); | |