Skip to content

Commit e979fc5

Browse files
committed
docs: add batch-2 changeset; webhook redeliver doc follows the new envelope
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MaSQn77TT5fUgHK9CesaDK
1 parent 38e3526 commit e979fc5

2 files changed

Lines changed: 53 additions & 4 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
"@objectstack/spec": minor
3+
"@objectstack/rest": minor
4+
"@objectstack/runtime": minor
5+
"@objectstack/cloud-connection": minor
6+
"@objectstack/plugin-auth": minor
7+
"@objectstack/plugin-webhooks": minor
8+
"@objectstack/service-messaging": minor
9+
"@objectstack/service-automation": minor
10+
"@objectstack/metadata-protocol": minor
11+
"@objectstack/metadata-core": minor
12+
"@objectstack/hono": minor
13+
---
14+
15+
refactor!: ADR-0112 batch 2 — sweep the lowercase error-code emitters (#4003)
16+
17+
Continues #3841 per ADR-0112. Batch 1 (#3988) settled the vocabulary and closed
18+
the set; this batch moves the emitters that still spoke lowercase `snake_case`
19+
onto it.
20+
21+
**Wire-visible change.** Error codes on these surfaces change spelling. Generic
22+
conditions collapse onto the standard catalog rather than keeping a synonym:
23+
`unauthorized`/`unauthenticated` → `UNAUTHENTICATED`, `forbidden` →
24+
`PERMISSION_DENIED`, `not_found` → `RESOURCE_NOT_FOUND`, `internal` →
25+
`INTERNAL_ERROR`, `unavailable` → `SERVICE_UNAVAILABLE`, `not_supported` →
26+
`NOT_IMPLEMENTED`, `bad_request` → `INVALID_REQUEST`. Domain conditions get
27+
codes registered in `ERROR_CODE_LEDGER` (`MARKETPLACE_STORAGE_FAILED`,
28+
`PLUGIN_MANIFEST_INVALID`, `ITEM_LOCKED`, `DELIVERY_NOT_ELIGIBLE`, …). Swept:
29+
`cloud-connection`, `plugin-auth`, `hono`, `metadata-protocol`, `rest`,
30+
`service-messaging`, `service-automation`.
31+
32+
**Three routes stop putting a code in the message slot.** The webhook redeliver
33+
route and two `rest` routes answered `{ success: false, error: '<code>',
34+
message }` — the code occupying `error`, the declared object envelope nowhere.
35+
They now emit `error: { code, message }`. Clients reading `body.error` as a
36+
string on these routes must read `body.error.code`.
37+
38+
**`ConnectorErrorCategory` / `ConnectorRetryStrategy`** (ADR-0112 D9a):
39+
`@objectstack/spec` exported two mutually incompatible `ErrorCategory` types and
40+
two `RetryStrategy` types. The connector-side pair is renamed; importers of the
41+
`integration` subpath update the name. Side effect: the api-side `ErrorCategory`
42+
and `RetryStrategy` now appear in the generated API reference at all — the
43+
name collision had been silently dropping them.
44+
45+
**Not swept, deliberately.** `sys_metadata_audit.code` keeps its lowercase
46+
values (ADR-0112 D6b): it is persisted audit history, and the same column holds
47+
non-error outcomes (`ok`, `lock_override`). Field-level codes stay as they are
48+
(D6, #3977).

‎content/docs/automation/webhooks.mdx‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,11 @@ The plugin mounts exactly **one** custom endpoint:
399399
| POST | `/api/v1/webhooks/redeliver` | `{ deliveryId }` | Re-queue a previously failed/dead delivery. |
400400

401401
It delegates to `messaging.redeliverHttp(deliveryId)` and is guarded by the
402-
better-auth session (any authenticated user). Responses: `200` on success,
403-
`401` unauthenticated, `400` missing/invalid body, `404` `not_found`, `409`
404-
`not_eligible`. There are no `/webhooks/:id/test`, `/rotate`,
405-
`/deliveries`, or per-delivery redeliver routes.
402+
better-auth session (any authenticated user). Failures answer in the declared
403+
envelope — `{ success: false, error: { code, message } }` — with `401`
404+
`UNAUTHENTICATED`, `400` `INVALID_REQUEST` or `MISSING_REQUIRED_FIELD`, `404`
405+
`RESOURCE_NOT_FOUND`, `409` `DELIVERY_NOT_ELIGIBLE` (ADR-0112). There are no
406+
`/webhooks/:id/test`, `/rotate`, `/deliveries`, or per-delivery redeliver routes.
406407

407408
## 9. Concurrency & rate-limiting
408409

0 commit comments

Comments
 (0)