Skip to content

Register the participants service and its routes - #145

Merged
yurkimus merged 1 commit into
mainfrom
participants
Oct 26, 2026
Merged

yurkimus merged 1 commit into
mainfrom
participants

Conversation

@yurkimus

Copy link
Copy Markdown
Member

The participants service of shaker-quiz/services#510 is not known to the package yet, so url() cannot address it and its routes cannot be named through routePathname. Participants joins Service and ServiceRuntime (a Bun service, like the other backend ones), the participant and participants segments are added, and the four routes of the service are declared:

route pathname
participant participant/:participant
participant/channel participant/:participant/channel/:channel
participant/mailing participant/:participant/mailing/:mailing
participants/channel/mailing/message participants/channel/:channel/mailing/:mailing/message/:message

These pathnames are the ones the service serves today from its own route-pathname.js, which it can drop once it depends on this version. Here channel is the kind of the channel (vkontakte, telegram or email), and mailing and message are ids.

To build them the channel, mailing and message segments take a parameter: mailing and message a uuid, channel a word. They had none, and a segment gets its :param in the pathname only when it has a pattern, so seven routes that already contain them change their pathname:

  • registration/channel: registration/:registration/channel becomes registration/:registration/channel/:channel
  • chatapp/registration/channel: the same with the chatapp/ prefix
  • chatapp/registrations/channel: chatapp/registrations/channel becomes chatapp/registrations/channel/:channel
  • telegram/registration/mailing: …/:registration/mailing becomes …/:registration/mailing/:mailing
  • chatapp/registration/mailing: the same with the chatapp/ prefix
  • telegram/registrations/mailing and chatapp/registrations/mailing: …/mailing becomes …/mailing/:mailing

Nothing breaks until a consumer bumps the package, as the services and the frontends pin it exactly, but the registrations, updates, hub and landing code that names these routes will need to follow when it does.

The generated source/codegen/autogenerated.js is left to the publish workflow, as in the other changes. The url package gets its source/participants from this version through the same cascade.

Participants joins the Service and ServiceRuntime registries as a Bun service, the participant and participants segments are added, and the four routes of the service are declared: participant, participant/channel, participant/mailing and participants/channel/mailing/message. The channel, mailing and message segments take a parameter to serve them, so seven routes that already carried them (registration/channel, the chatapp and telegram registration channel and mailing routes) now carry that parameter in their pathname as well.
@yurkimus yurkimus self-assigned this Oct 26, 2026
@yurkimus
yurkimus merged commit e7fc5dc into main Oct 26, 2026
3 checks passed
@yurkimus
yurkimus deleted the participants branch October 26, 2026 01:19
yurkimus added a commit that referenced this pull request Oct 27, 2026
The `participants` service now has a standalone channel, `POST
channel/:channel` creates one and `QUERY channel/:channel` looks one up
by its value, where `channel` is the kind of the platform (`vkontakte`,
`telegram` or `email`) and the value travels in the body. The route is
not known to the package yet.

The `channel` route is added, and its pathname is `channel/:channel`,
which the `channel` segment already produces since it took a pattern in
#145. The segment itself had no service, as it served only the
properties of registrations (`registration/channel` and its siblings),
and the service of a route is the one of its first segment, so
`routeService('channel')` would throw. It now belongs to the
participants service. No other route changes: the first segment decides
the service, and no other route starts with `channel`. I compared the
pathname and the service of all the 128 existing routes against `main`
and none differs.

The generated `source/codegen/autogenerated.js` is left to the publish
workflow, as in the other changes. The `url` package takes the route
from the version this one publishes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant