Repository navigation
Commit e7fc5dc
authored
Register the participants service and its routes (#145)
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.4 files changed
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
221 | 239 | | |
222 | 240 | | |
223 | 241 | | |
| |||
566 | 584 | | |
567 | 585 | | |
568 | 586 | | |
569 | | - | |
| 587 | + | |
570 | 588 | | |
571 | 589 | | |
572 | 590 | | |
| |||
575 | 593 | | |
576 | 594 | | |
577 | 595 | | |
578 | | - | |
| 596 | + | |
579 | 597 | | |
580 | 598 | | |
581 | 599 | | |
| |||
584 | 602 | | |
585 | 603 | | |
586 | 604 | | |
587 | | - | |
| 605 | + | |
588 | 606 | | |
589 | 607 | | |
590 | 608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
0 commit comments