2021-08-27 16:20:49 +02:00
|
|
|
from typing import Any, List
|
|
|
|
|
|
|
|
from django.urls.conf import path
|
2020-11-24 23:26:28 +01:00
|
|
|
from rest_framework_extensions.routers import NestedRegistryItem
|
|
|
|
|
|
|
|
from posthog.api.routing import DefaultRouterPlusPlus
|
2020-08-14 11:23:55 +02:00
|
|
|
|
2022-02-08 17:22:09 +01:00
|
|
|
from .api import authentication, dashboard_collaborator, debug_ch_queries, explicit_team_member, hooks, license
|
2020-08-14 11:23:55 +02:00
|
|
|
|
|
|
|
|
2022-02-08 17:22:09 +01:00
|
|
|
def extend_api_router(
|
|
|
|
root_router: DefaultRouterPlusPlus,
|
|
|
|
*,
|
|
|
|
projects_router: NestedRegistryItem,
|
|
|
|
project_dashboards_router: NestedRegistryItem
|
|
|
|
) -> None:
|
2020-11-24 23:26:28 +01:00
|
|
|
root_router.register(r"license", license.LicenseViewSet)
|
2020-12-07 16:06:14 +01:00
|
|
|
root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries, "debug_ch_queries")
|
2020-11-24 23:26:28 +01:00
|
|
|
projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks", ["team_id"])
|
2021-09-22 18:29:59 +02:00
|
|
|
projects_router.register(
|
|
|
|
r"explicit_members", explicit_team_member.ExplicitTeamMemberViewSet, "project_explicit_members", ["team_id"]
|
|
|
|
)
|
2022-02-08 17:22:09 +01:00
|
|
|
project_dashboards_router.register(
|
|
|
|
r"collaborators",
|
|
|
|
dashboard_collaborator.DashboardCollaboratorViewSet,
|
|
|
|
"project_dashboard_collaborators",
|
|
|
|
["team_id", "dashboard_id"],
|
|
|
|
)
|
2021-08-27 16:20:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
urlpatterns: List[Any] = [
|
|
|
|
path("api/saml/metadata/", authentication.saml_metadata_view),
|
|
|
|
]
|