You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(client): actions surface — the SDK path to server-registered actions (#3563 PR-2)
Closes the largest gap in the #3563 route audit: the whole /actions domain —
the documented way to expose custom server-side operations
(engine.registerAction) — had no SDK expression at all, so every console
hand-rolled fetch for it.
- client.actions.invoke(object, action, { recordId, params }) — POST
/api/v1/actions/:object/:action. recordId travels in the body, which both
server URL shapes honor. The path is fixed (not discovery-routed): actions
is not in ApiRoutesSchema, same precedent as projects' /api/v1/cloud.
- client.actions.invokeGlobal(action, opts) — the wildcard
/actions/global/:action shape.
- The handler's own business failure surfaces as { success:false, error }
(the dispatcher's inner envelope), deliberately not thrown, so callers can
toast it. Unit tests cover URL shape, encoding, body defaults, the global
variant, and the inner-failure path.
Ledger: all three /actions rows flip to sdk; the gap ratchet drops 27 → 24 —
first real exercise of the PR-1 guard.
Documentation stops lying (audit findings):
- client README: the six phantom methods are gone (meta.getObject,
views.share, views.setDefault, workflow.approve/reject, ai.chat — replaced
with the real calls where one exists), and the hand-written "all 13
namespaces / FULLY COMPLIANT" claims now defer to the CI-enforced ledger.
- CLIENT_SPEC_COMPLIANCE.md: retired to a tombstone. Its verdict was measured
against DEFAULT_DISPATCHER_ROUTES — a table nothing in runtime consumes,
missing five of the domains it should have been measuring.
- content/docs/api/client-sdk.mdx: documents the new actions surface;
the automation row now reflects the real method count.
Pre-existing, untouched: the bare `tsc -p` TS2741 (routeMap missing graphql)
reproduces identically on main — its root is the stale graphql entry in
ApiRoutesSchema, tracked as audit follow-up #7 (spec-major territory).
Verified: client 122 passed (5 new), runtime 653 passed, both ledger guard
halves green, eslint clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LX9ut3MK3KykE11S9bJmv5
**Protocol compliance & verification**: See [`CLIENT_SPEC_COMPLIANCE.md`](https://github.com/objectstack-ai/objectstack/blob/main/packages/client/CLIENT_SPEC_COMPLIANCE.md) for detailed method-by-method verification and [`CLIENT_SERVER_INTEGRATION_TESTS.md`](https://github.com/objectstack-ai/objectstack/blob/main/packages/client/CLIENT_SERVER_INTEGRATION_TESTS.md) for comprehensive integration test specifications.
129
+
**Coverage is CI-enforced, not hand-asserted**: the #3563 route ledger
Copy file name to clipboardExpand all lines: packages/client/README.md
+28-38Lines changed: 28 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,8 @@ The official TypeScript client for ObjectStack.
11
11
-**Batch Operations**: Efficient bulk create/update/delete with transaction support.
12
12
-**View Storage**: Save, load, and share custom UI view configurations.
13
13
-**Standardized Errors**: Machine-readable error codes with retry guidance.
14
-
-**Full Protocol Coverage**: Implements all 13 API namespaces defined in `@objectstack/spec`
15
-
-**95+ Methods**: Complete implementation of discovery, metadata, data, auth, workflow, realtime, AI, and more.
14
+
-**Broad Protocol Coverage**: 20 top-level surfaces (~170 methods) over the ObjectStack HTTP API.
15
+
-**Audited Surface**: coverage against the server's routes is tracked by the #3563 route ledger (`@objectstack/runtime``route-ledger.ts`), enforced in CI.
{route: 'GET /openapi.json',domain: '/openapi.json',disposition: 'server-only',note: 'docs tooling; falls through when metadata service lacks a generator'},
0 commit comments