コード例 #1
0
ファイル: urls.py プロジェクト: GalDayan/posthog
def extend_api_router(root_router: DefaultRouterPlusPlus, *,
                      projects_router: NestedRegistryItem):
    root_router.register(r"license", license.LicenseViewSet)
    root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries,
                         "debug_ch_queries")
    projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks",
                             ["team_id"])
    projects_router.register(r"explicit_members",
                             explicit_team_member.ExplicitTeamMemberViewSet,
                             "project_explicit_members", ["team_id"])
コード例 #2
0
ファイル: urls.py プロジェクト: akbansa/posthog
def extend_api_router(root_router: DefaultRouterPlusPlus, *,
                      projects_router: NestedRegistryItem,
                      project_dashboards_router: NestedRegistryItem) -> None:
    root_router.register(r"license", license.LicenseViewSet)
    root_router.register(r"debug_ch_queries", debug_ch_queries.DebugCHQueries,
                         "debug_ch_queries")
    projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks",
                             ["team_id"])
    projects_router.register(r"explicit_members",
                             explicit_team_member.ExplicitTeamMemberViewSet,
                             "project_explicit_members", ["team_id"])
    project_dashboards_router.register(
        r"collaborators",
        dashboard_collaborator.DashboardCollaboratorViewSet,
        "project_dashboard_collaborators",
        ["team_id", "dashboard_id"],
    )
コード例 #3
0
ファイル: __init__.py プロジェクト: karambir/posthog-unlocked
    plugin_log_entry,
    property_definition,
    sessions_filter,
    team,
    user,
)


@decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"])
@decorators.authentication_classes([])
@decorators.permission_classes([])
def api_not_found(request):
    raise exceptions.NotFound(detail="Endpoint not found.")


router = DefaultRouterPlusPlus()

# Legacy endpoints (to be removed eventually)
router.register(r"annotation", annotation.AnnotationsViewSet)
router.register(r"feature_flag", feature_flag.FeatureFlagViewSet)
router.register(r"dashboard", dashboard.DashboardsViewSet)
router.register(r"dashboard_item", dashboard.DashboardItemsViewSet)
router.register(r"plugin_config", plugin.PluginConfigViewSet)
router.register(r"personal_api_keys", personal_api_key.PersonalAPIKeyViewSet, "personal_api_keys")
router.register(r"sessions_filter", sessions_filter.SessionsFilterViewSet)

# Nested endpoints
projects_router = router.register(r"projects", team.TeamViewSet)
project_plugins_configs_router = projects_router.register(
    r"plugin-configs", plugin.PluginConfigViewSet, "project_plugins_configs", ["team_id", "plugin_config_id"]
)
コード例 #4
0
ファイル: __init__.py プロジェクト: PostHog/posthog
    plugin,
    plugin_log_entry,
    property_definition,
    team,
    user,
)


@decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"])
@decorators.authentication_classes([])
@decorators.permission_classes([])
def api_not_found(request):
    raise exceptions.NotFound(detail="Endpoint not found.")


router = DefaultRouterPlusPlus()

# Legacy endpoints shared (to be removed eventually)
router.register(r"annotation", annotation.LegacyAnnotationsViewSet)  # Should be completely unused now
router.register(r"feature_flag", feature_flag.LegacyFeatureFlagViewSet)  # Should be completely unused now
router.register(r"dashboard", dashboard.LegacyDashboardsViewSet)  # Should be completely unused now
router.register(r"dashboard_item", dashboard.LegacyInsightViewSet)  # To be deleted - unified into insight viewset
router.register(r"plugin_config", plugin.LegacyPluginConfigViewSet)

# Nested endpoints shared
projects_router = router.register(r"projects", team.TeamViewSet)
project_plugins_configs_router = projects_router.register(
    r"plugin_configs", plugin.PluginConfigViewSet, "project_plugin_configs", ["team_id"]
)
project_plugins_configs_router.register(
    r"logs", plugin_log_entry.PluginLogEntryViewSet, "project_plugins_config_logs", ["team_id", "plugin_config_id"]
コード例 #5
0
    paths,
    person,
    personal_api_key,
    plugin,
    team,
)


@decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"])
@decorators.authentication_classes([])
@decorators.permission_classes([])
def api_not_found(request):
    raise exceptions.NotFound(detail="Endpoint not found.")


router = DefaultRouterPlusPlus()
# legacy endpoints (to be removed eventually)
router.register(r"annotation", annotation.AnnotationsViewSet)
router.register(r"feature_flag", feature_flag.FeatureFlagViewSet)
router.register(r"funnel", funnel.FunnelViewSet)
router.register(r"dashboard", dashboard.DashboardsViewSet)
router.register(r"dashboard_item", dashboard.DashboardItemsViewSet)
router.register(r"cohort", cohort.CohortViewSet)
router.register(r"plugin", plugin.PluginViewSet)
router.register(r"plugin_config", plugin.PluginConfigViewSet)
router.register(r"personal_api_keys", personal_api_key.PersonalAPIKeyViewSet,
                "personal_api_keys")
projects_router = router.register(r"projects", team.TeamViewSet)
organizations_router = router.register(r"organizations",
                                       organization.OrganizationViewSet)
organizations_router.register(
コード例 #6
0
def extend_api_router(root_router: DefaultRouterPlusPlus, *,
                      projects_router: NestedRegistryItem):
    root_router.register(r"license", license.LicenseViewSet)
    projects_router.register(r"hooks", hooks.HookViewSet, "project_hooks",
                             ["team_id"])
コード例 #7
0
ファイル: __init__.py プロジェクト: GalDayan/posthog
    property_definition,
    session_recording,
    sessions_filter,
    team,
    user,
)


@decorators.api_view(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"])
@decorators.authentication_classes([])
@decorators.permission_classes([])
def api_not_found(request):
    raise exceptions.NotFound(detail="Endpoint not found.")


router = DefaultRouterPlusPlus()

# Legacy endpoints shared (to be removed eventually)
router.register(
    r"annotation",
    annotation.LegacyAnnotationsViewSet)  # Should be completely unused now
router.register(
    r"feature_flag",
    feature_flag.LegacyFeatureFlagViewSet)  # Should be completely unused now
router.register(
    r"dashboard",
    dashboard.LegacyDashboardsViewSet)  # Should be completely unused now
router.register(r"dashboard_item", dashboard.LegacyDashboardItemViewSet
                )  # To be deleted - unified into insight viewset
router.register(r"plugin_config", plugin.LegacyPluginConfigViewSet)
router.register(r"sessions_filter",