@registrystack/client 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,20 +1,48 @@
1
- # `@registrystack/client`
1
+ # @registrystack/client
2
2
 
3
- One versioned Node.js package for the Discovery, Evidence, Relay, and Base
4
- Registry Engine client APIs in Registry Stack.
3
+ One versioned Node.js package for the Discovery, Evidence, Relay, Base Registry
4
+ Engine, and Casework client APIs in Registry Stack.
5
+
6
+ ## Install
5
7
 
6
8
  ```sh
7
9
  npm install "@registrystack/client@<version>"
8
10
  ```
9
11
 
12
+ Requires Node.js 22.12 or newer. Supported targets are macOS arm64, Linux
13
+ arm64 with glibc, and Linux x64 with glibc; installing the package pulls in
14
+ one platform-specific optional dependency containing all five native
15
+ bindings.
16
+
17
+ ## Usage
18
+
10
19
  ```js
11
- const { discovery, evidence, relay, breg } = require('@registrystack/client');
20
+ const { discovery, evidence, relay, breg, casework } = require('@registrystack/client');
12
21
 
13
22
  const registry = new breg.BaseRegistryClient({
14
23
  baseUrl: 'https://registry.example.invalid/',
15
24
  });
25
+ const work = new casework.CaseworkClient({
26
+ baseUrl: 'https://casework.example.invalid/',
27
+ });
16
28
  ```
17
29
 
30
+ ## Products
31
+
32
+ - `discovery`: Registry Discovery, bounded search and resolution over a
33
+ curated index.
34
+ - `evidence`: Evidence Gateway, request and verify signed minimum-disclosure
35
+ assertions.
36
+ - `relay`: Registry Relay, scoped read-only APIs over existing sources.
37
+ - `breg`: Base Registry Engine, records, contracts, writes, and lifecycle.
38
+ - `casework`: Registry Casework, staff inbox, claims, drafts, decisions,
39
+ recovery, history, holdings, and directory bootstrap.
40
+
41
+ Each product remains in its own namespace because its routing,
42
+ authentication, errors, and verification rules are different.
43
+
44
+ ## TypeScript
45
+
18
46
  A TypeScript consumer also needs the Node type definitions, and must name
19
47
  them. The published declarations use `Buffer`, a Node.js global, and
20
48
  TypeScript 6 does not load installed `@types` packages on its own, so a
@@ -37,29 +65,49 @@ npm install --save-dev "@types/node"
37
65
  The package does not declare that dependency itself, because a JavaScript
38
66
  consumer does not need it.
39
67
 
40
- Each product remains in its own namespace because its routing,
41
- authentication, errors, and verification rules are different. The package
42
- uses one platform-specific native dependency containing all four bindings.
43
- Supported targets are macOS arm64, Linux arm64 with glibc, and Linux x64 with
44
- glibc. Install the exact client version that matches the deployment.
45
-
46
- The unified package is published beginning with Registry Stack v0.26.1.
47
- Existing standalone client packages remain available for earlier versions,
48
- but the release process does not publish new standalone versions once this
49
- package is active.
50
-
51
- For server-side BReg applications, `breg.BaseRegistryClient.registryContract()`
52
- returns caller-filtered `operations` with typed field, request, and list-query
53
- descriptors. Descriptions do not grant authority: select opaque create, patch,
54
- and lifecycle authorities from that same contract before executing mutations.
55
-
56
- Use BReg methods ending in `Json` when values must cross Node without numeric
57
- coercion. They accept domain JSON text and return `valueJson` plus the usual
58
- trace, ETag, location, and opaque continuation. `lifecycleActionsJson` accepts a
59
- record envelope; opaque actions expose `bodyJson` and `reviewJson`. Decode these
60
- strings with a lossless JSON library when displaying wide numbers. Decimal
61
- fields remain fixed-scale strings, and null remains distinct from absence.
62
- Duplicate members and silently rounded literals are refused. Existing BReg
63
- integer restrictions still apply: `9007199254740992` is a supported write,
64
- whereas `9007199254740993` is refused before I/O. Do not round refused values.
65
- The client never retries a mutation automatically.
68
+ ## Base Registry Engine notes
69
+
70
+ `breg.BaseRegistryClient.registryContract()` returns caller-filtered
71
+ `operations` with typed field, readable request field, request, and list-query
72
+ descriptors; those
73
+ descriptions grant no authority, so select the opaque create, patch, and
74
+ lifecycle authorities from that same contract before executing a mutation.
75
+ Methods ending in `Json` keep values exact across the Node number boundary:
76
+ they accept domain JSON text and return `valueJson` alongside the usual
77
+ trace, ETag, location, and opaque continuation. The client never retries a
78
+ mutation automatically. See
79
+ [Exact JSON in Node](https://docs.registrystack.org/reference/client-api/#exact-json-in-node)
80
+ for the full rules.
81
+
82
+ ## Versioning
83
+
84
+ Install the exact client version that matches the deployment. The unified
85
+ package is published beginning with Registry Stack v0.26.1. Existing
86
+ standalone client packages remain available for earlier versions, but the
87
+ release process does not publish new standalone versions once this package
88
+ is active.
89
+
90
+ The `casework` namespace is part of the unified package beginning with
91
+ Registry Stack v0.30.0.
92
+
93
+ ## Casework notes
94
+
95
+ The Casework module is for a trusted server host. Each call takes that request's
96
+ bearer token and selected Casework profile; source-reading calls also take the
97
+ selected source profile. The client does not retain them. Browsers should send
98
+ only the host's session cookie. Claim, release, and decide consume the
99
+ caller-filtered action returned on the item, including its exact route and
100
+ `ifMatch` revision. Mutations require a caller-controlled idempotency key and
101
+ are never retried automatically. After a lost response, use
102
+ `recoverDecisionByKey` with the original key so recovery does not depend on the
103
+ attempt identifier being received.
104
+
105
+ ## Documentation
106
+
107
+ - [Client API reference](https://docs.registrystack.org/reference/client-api/)
108
+ - [Repository](https://github.com/registrystack/registry-stack)
109
+ - [Issue tracker](https://github.com/registrystack/registry-stack/issues)
110
+
111
+ ## License
112
+
113
+ Apache-2.0