from dmr.routing import Router, path from .views import ( PredictionCollectionController, PredictionListUserController, PredictionHistoryController, PredictionDetailController, PredictionDeleteController, SavedPointListController, SavedPointDetailController, PredictionTemplateListController, PredictionTemplateDetailController, TelemetryController, CsrfController, LoginController, LogoutController, SessionController, WhoAmIController, UserProfileController, ChangePasswordController, ObtainTokenController, TokenManagementController, DeleteUserDataController, DeleteAccountController, ) # A Router (prefix + routes) is required so build_schema() can generate the # OpenAPI document; see stratoflights/urls.py. router = Router( 'api/', [ path("csrf/", CsrfController.as_view(), name='api-csrf'), path('token', ObtainTokenController.as_view(), name='get_token'), path("login/", LoginController.as_view(), name='api-login'), path("logout/", LogoutController.as_view(), name='api-logout'), path("session/", SessionController.as_view(), name='api-session'), path("whoami/", WhoAmIController.as_view(), name='api-whoami'), path("/telemetry/", TelemetryController.as_view(), name="create_telemetry"), path("profile/", UserProfileController.as_view(), name='api-profile'), path("profile/change-password/", ChangePasswordController.as_view(), name='api-change-password'), path("profile/token/", TokenManagementController.as_view(), name='api-token'), path("profile/delete-data/", DeleteUserDataController.as_view(), name='api-delete-data'), path("profile/delete-account/", DeleteAccountController.as_view(), name='api-delete-account'), # Saved points (was SavedPointViewset via DefaultRouter). path("saved-points/", SavedPointListController.as_view(), name='saved-points-list'), path("saved-points//", SavedPointDetailController.as_view(), name='saved-points-detail'), # Prediction templates (was PreditctionTemplateViewset via DefaultRouter). path("saved-templates/", PredictionTemplateListController.as_view(), name='saved-templates-list'), path("saved-templates//", PredictionTemplateDetailController.as_view(), name='saved-templates-detail'), # Predictions (was PredictionViewSet via DefaultRouter). path("predictions/", PredictionCollectionController.as_view(), name='predictions-list'), path("predictions/list_user/", PredictionListUserController.as_view(), name='predictions-list-user'), path("predictions/history/", PredictionHistoryController.as_view(), name='predictions-history'), path("predictions//detail/", PredictionDetailController.as_view(), name='predictions-detail'), path("predictions//delete/", PredictionDeleteController.as_view(), name='predictions-delete'), ], ) urlpatterns = router.urls