Files
zeekay 40d120dbf7 refactor(api): say /v1/ in the Python callers
Every first-party Python caller and test now names the mount the API actually
answers on. Mechanical: URL literals only, and only where the /api/ was ours --
a preceding word character means it was a module path like insights/api/ or a
third-party host like slack.com/api/, and those are untouched.

Left saying /api/, each for a reason rather than for safety:
- products/warehouse_sources/.../sources/** is a catalogue of vendor endpoints
- services/llm-gateway deploys separately and is under a code freeze, so moving
  its two calls would break it during the skew
- the mcp_store and Slack/Teams redirect_uris are registered with third parties
  and must byte-match what was registered
- the Wizard and Raycast client-metadata paths are OAuth client_ids
- /api/surveys and /api/feature_flag/local_evaluation are SDK aliases the
  ingress routes to the Rust fleets, held by released SDK versions

Test URLconfs moved with the requests that call them, and the Datastore
user-selection fixtures now carry the leading slash that request.path has.
2026-08-08 18:38:44 -07:00

23 lines
1.1 KiB
Python

from insights.api.routing import RouterRegistry
from products.messaging.backend.api.message_categories import MessageCategoryViewSet
from products.messaging.backend.api.message_preferences import MessagePreferencesViewSet
from products.messaging.backend.api.message_suppression import MessageSuppressionViewSet
from products.messaging.backend.api.message_templates import MessageTemplatesViewSet
def register_routes(routers: RouterRegistry) -> None:
routers.projects.register(
r"messaging_templates", MessageTemplatesViewSet, "project_messaging_templates", ["team_id"]
)
routers.projects.register(
r"messaging_categories", MessageCategoryViewSet, "project_messaging_categories", ["team_id"]
)
routers.projects.register(
r"messaging_preferences", MessagePreferencesViewSet, "project_messaging_preferences", ["team_id"]
)
# New endpoint — register under /v1/projects/ only, not the dual-route legacy shim.
routers.projects.register(
r"messaging_suppressions", MessageSuppressionViewSet, "project_messaging_suppressions", ["team_id"]
)