|
| 1 | +--- |
| 2 | +'@objectstack/rest': minor |
| 3 | +'@objectstack/runtime': patch |
| 4 | +--- |
| 5 | + |
| 6 | +fix(rest, runtime): the runtime dispatcher serves the layered view, `GET /meta/:type/:name/layers` and the deprecated `?layers=` flag, as `RestServer` serves it (#20478) |
| 7 | + |
| 8 | +Clause-②: yes (widening) — `@objectstack/rest`'s root entry gains three value exports (`createMetaLayeredAnswer`, `wantsMetaItemLayers`, `metaItemLayersDeprecationHeaders`) and two type exports (`MetaLayeredAnswer`, `MetaLayeredRequest`). Nothing any published version exported is removed, renamed or narrowed. `@objectstack/runtime` publishes no new surface and stays a `patch`. |
| 9 | + |
| 10 | +A host that mounts only the `${prefix}/*` catch-all (`createHonoApp`, and any |
| 11 | +adapter written on the public `HttpDispatcher` API) serves `/meta` through the |
| 12 | +runtime dispatcher. Until now, on such a host: |
| 13 | + |
| 14 | +- **`GET /meta/:type/:name?layers=true` answered the plain read.** The body was |
| 15 | + `{ type, name, item }` with a `200`, so a client reading `code`, `overlay` or |
| 16 | + `effective` read `undefined`. There was no `Deprecation` header and no `Link` |
| 17 | + to the successor. An author (a caller the item's save door admits) was served |
| 18 | + the app pruned, where the layered view serves them every layer whole. |
| 19 | +- **`GET /meta/:type/:name/layers` was no route.** It answered a located |
| 20 | + `404 ROUTE_NOT_FOUND`. |
| 21 | + |
| 22 | +Both spellings now answer what `RestServer` answers: the three layers, each |
| 23 | +judged by the per-caller read gate under the stored-version doors' policy |
| 24 | +(whole for a caller who may save the item, pruned as the plain read prunes it |
| 25 | +for everyone else), each projected through the object-schema field mask, and |
| 26 | +`private, no-store` when the caller's field visibility could not be determined. |
| 27 | +The read is scoped to the caller's vetted organization and to `?package=`. The |
| 28 | +flag's answers, refusals included, carry `Deprecation: true`, and a `Link` to |
| 29 | +`/layers` built from the request's own URL (every `createHonoApp` request |
| 30 | +carries one; a host that hands `dispatch()` no URL gets `Deprecation` alone). The route answers `501 NOT_IMPLEMENTED` where the protocol has no |
| 31 | +layered read, and the flag is then the plain read, on both transports. |
| 32 | + |
| 33 | +**What changed.** Everything `RestServer`'s layered helper does after the store |
| 34 | +read moved, unchanged, into `createMetaLayeredAnswer`, and the flag's parse and |
| 35 | +headers into `wantsMetaItemLayers` and `metaItemLayersDeprecationHeaders`. The |
| 36 | +dispatcher's `/meta` domain calls all three. `RestServer`'s own answers are |
| 37 | +unchanged: every existing REST test passes unedited. |
0 commit comments