Skip to content

Commit 1c8b320

Browse files
fix(client): publishItem JSDoc names NO_DRAFT, not the retired [no_draft] opener (#20187)
Fixes #19704 Clause-②: no `publishItem`'s JSDoc in `packages/client/src/index.ts` (ships into `dist/index.d.ts`) documented the publish-refusal spelling as `404 [no_draft]` — the bracketed lowercase message opener the 2026-08-29 maintainer ruling retired from every `@objectstack/metadata-protocol` producer via #16245 / PR #19683 (`7a25a3ee9c`). The runtime has answered `status: 404, code: 'NO_DRAFT'` with no bracketed opener since that PR landed. This corrects the docstring to name `NO_DRAFT` on the `code` axis, following the same 404 `NO_DRAFT` convention already used in `packages/spec/src/api/plugin-rest-api.zod.ts`. No behaviour change. The card's own `Blocked-by: #16245` is satisfied — that PR merged on 2026-09-22 (`7a25a3ee9c`). Triage originally planned to fold this card into #19705's round; per the claim's serial-constraints note, that round closed via a PR touching only QA files and never picked this line up, so this card proceeded on its own. ## Measured - **Site confirmed**: `packages/client/src/index.ts:2152` read `404 [no_draft] when there is nothing to publish.` on `origin/main` `455dcc06`. - **Tree-wide sweep**: `git grep -n --fixed-strings "[no_draft]"` over the tracked tree (excluding `content/docs/releases/` and `CHANGELOG.md`s) found no other present-tense claim of this spelling inside `packages/client/src/`. Control words in the same file — `NO_DRAFT` and `[item_locked]` are zero there while `publish` hits 55 times — show the grep discriminates rather than being silently broken. - **Published-surface question (triage's UNMEASURED item)**: built `@objectstack/client` and grepped the emitted `dist/index.d.ts` — the docstring **does ship** (with positive controls, two neighbouring JSDoc lines, confirmed present too). This is a published-surface correction, so it carries `.changeset/19704-client-no-draft-jsdoc.md` (`patch`), not the `skip-changeset` route. - **Runtime producer**: `SysMetadataRepository.promoteDraft` (`packages/metadata-protocol/src/sys-metadata-repository.ts:946`) throws `status: 404`, `code: 'NO_DRAFT'`, message `"No pending draft exists for {type}/{name} — nothing to publish."` — no bracketed opener. The new docstring names exactly that. - No test pins the old `[no_draft]` text (zero `git grep` hits across `packages/client/`'s test files). ## Acceptance notes Two more present-tense claims of the same *retired bracketed-opener* shape turned up while measuring the above, both outside this card's file surface (packages/client/src/ + the [no_draft] spelling specifically) — reported rather than fixed here: - `packages/rest/src/rest-server.ts:8427` — a source comment (`404 [no_draft] when nothing to publish.`) on the same `POST /meta/:type/:name/publish` route this card's producer serves. Same defect family as #19704 and #16245, different file. - `packages/client/src/index.ts:6297` — a sibling docstring (`Get a sharing rule by id or name. 404 [RULE_NOT_FOUND] when absent.`) for a *different* code. Its producer (`packages/plugins/plugin-sharing/src/sharing-rule-service.ts:818`, bare `throw new Error('RULE_NOT_FOUND')`) and REST mapping (`packages/rest/src/rest-server.ts:12807-12808`, `:12920`) never emit a bracketed message either — the #16245 shape recurring on a code that ruling never touched. Neither is the `[no_draft]` spelling this card claims, and the second isn't in scope by spelling; both are named in the round report for the dispatching seat to route. --- _Generated by [Claude Code](https://claude.ai/code/session_01UYBdGBzWSrAMzpW8ah3GbP)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6cc8dcd commit 1c8b320

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@objectstack/client': patch
3+
---
4+
5+
`publishItem`'s JSDoc, which ships into `dist/index.d.ts`, is corrected to the refusal spelling the runtime has emitted since PR #19683 (#16245): 404 `NO_DRAFT` on the `code` axis, instead of the retired bracketed lowercase opener `[no_draft]` that PR removed from the message. No behaviour change — the SDK method, its request and its return type are untouched; only the doc comment's stale prose is corrected (#19704).

‎packages/client/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ export class ObjectStackClient {
21492149
/**
21502150
* ADR-0033: promote a single item's pending draft overlay to live —
21512151
* the per-item flow beside `packages.publishDrafts`' package-scoped one.
2152-
* 404 [no_draft] when there is nothing to publish. [#12195] The name is
2152+
* 404 `NO_DRAFT` when there is nothing to publish. The name is
21532153
* percent-encoded, like `getItem` — this line used to promise unencoded
21542154
* pass-through for compound names, whose arity is now retired.
21552155
*

0 commit comments

Comments
 (0)