@registrystack/client 0.27.0 → 0.28.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 +16 -0
- package/breg/client.d.ts +84 -0
- package/breg/client.js +8 -0
- package/breg/index.d.ts +22 -0
- package/native.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -47,3 +47,19 @@ The unified package is published beginning with Registry Stack v0.26.1.
|
|
|
47
47
|
Existing standalone client packages remain available for earlier versions,
|
|
48
48
|
but the release process does not publish new standalone versions once this
|
|
49
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.
|
package/breg/client.d.ts
CHANGED
|
@@ -151,6 +151,79 @@ export interface LifecycleReceipt extends JsonObject {
|
|
|
151
151
|
request: JsonObject
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
/** Exact validated JSON text, serialized before conversion to JavaScript numbers.
|
|
155
|
+
* Decode with a lossless JSON library if inspecting values outside the safe integer range.
|
|
156
|
+
* Decimal fields remain fixed-scale JSON strings. */
|
|
157
|
+
export interface JsonOutcome {
|
|
158
|
+
kind: 'complete'
|
|
159
|
+
valueJson: string
|
|
160
|
+
continuation?: ListContinuation
|
|
161
|
+
traceId: string
|
|
162
|
+
etag?: string
|
|
163
|
+
location?: string
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface BRegFieldDescriptor {
|
|
167
|
+
readonly id: string
|
|
168
|
+
readonly apiName: string
|
|
169
|
+
readonly label: string
|
|
170
|
+
readonly schemaJson: string
|
|
171
|
+
readonly required: boolean
|
|
172
|
+
readonly nullable: boolean
|
|
173
|
+
readonly readOnly: boolean
|
|
174
|
+
readonly removable: boolean
|
|
175
|
+
readonly referenceTargetEntity: string | null
|
|
176
|
+
}
|
|
177
|
+
export interface BRegQueryField {
|
|
178
|
+
readonly id: string
|
|
179
|
+
readonly apiName: string
|
|
180
|
+
readonly operators?: ReadonlyArray<string>
|
|
181
|
+
readonly directions?: ReadonlyArray<string>
|
|
182
|
+
}
|
|
183
|
+
export interface BRegQueryDescriptor {
|
|
184
|
+
readonly kind: string
|
|
185
|
+
readonly selectableFields: ReadonlyArray<BRegQueryField>
|
|
186
|
+
readonly filterableFields: ReadonlyArray<BRegQueryField>
|
|
187
|
+
readonly sortableFields: ReadonlyArray<BRegQueryField>
|
|
188
|
+
readonly allowCount: boolean
|
|
189
|
+
readonly defaultPageSize: number
|
|
190
|
+
readonly maxPageSize: number
|
|
191
|
+
readonly maxFilterClauses: number
|
|
192
|
+
readonly maxInValues: number
|
|
193
|
+
readonly pagination: { readonly parameter: string; readonly responsePath: string; readonly exclusive: boolean }
|
|
194
|
+
readonly temporal: JsonObject | null
|
|
195
|
+
}
|
|
196
|
+
export interface BRegOperationDescriptor {
|
|
197
|
+
readonly id: string
|
|
198
|
+
readonly method: string
|
|
199
|
+
readonly path: string
|
|
200
|
+
readonly kind: string
|
|
201
|
+
readonly sourceEntity: string
|
|
202
|
+
readonly responseEntity: string
|
|
203
|
+
readonly accessProfile: string
|
|
204
|
+
readonly entityLabel: string
|
|
205
|
+
readonly titleFields: ReadonlyArray<string>
|
|
206
|
+
readonly requiredCapabilities: ReadonlyArray<string>
|
|
207
|
+
readonly fields: ReadonlyArray<BRegFieldDescriptor>
|
|
208
|
+
readonly readableFields: ReadonlyArray<string>
|
|
209
|
+
readonly createWritableFields: ReadonlyArray<string>
|
|
210
|
+
readonly patchWritableFields: ReadonlyArray<string>
|
|
211
|
+
readonly query: BRegQueryDescriptor | null
|
|
212
|
+
readonly request: {
|
|
213
|
+
readonly fieldNames: string | null
|
|
214
|
+
readonly queryParameters: ReadonlyArray<string>
|
|
215
|
+
readonly body: string | null
|
|
216
|
+
readonly contentType: string | null
|
|
217
|
+
readonly schemaJson: string | null
|
|
218
|
+
readonly idempotencyKeyRequired: boolean | null
|
|
219
|
+
readonly ifMatchRequired: boolean | null
|
|
220
|
+
readonly mutationSemantics: string | null
|
|
221
|
+
readonly patchPathPrefix: string | null
|
|
222
|
+
readonly patchOperations: ReadonlyArray<string>
|
|
223
|
+
readonly removeSemantics: string | null
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
154
227
|
/** Opaque write authority selected from metadata fetched by this client source. */
|
|
155
228
|
export declare class BRegCreateBinding {
|
|
156
229
|
private constructor()
|
|
@@ -174,6 +247,8 @@ export declare class BRegLifecycleAction {
|
|
|
174
247
|
readonly operation: string
|
|
175
248
|
readonly stage: string | null
|
|
176
249
|
readonly href: string
|
|
250
|
+
readonly bodyJson: string
|
|
251
|
+
readonly reviewJson: string | null
|
|
177
252
|
readonly body: JsonObject
|
|
178
253
|
readonly review: LifecycleReview | null
|
|
179
254
|
}
|
|
@@ -182,6 +257,7 @@ export declare class BRegLifecycleAction {
|
|
|
182
257
|
export declare class BRegMetadata {
|
|
183
258
|
private constructor()
|
|
184
259
|
private readonly __opaque: void
|
|
260
|
+
readonly operations: ReadonlyArray<BRegOperationDescriptor>
|
|
185
261
|
readonly registryIdentifier: string
|
|
186
262
|
readonly registryVersion: string
|
|
187
263
|
readonly registryRevision: string
|
|
@@ -227,5 +303,13 @@ export declare class BaseRegistryClient {
|
|
|
227
303
|
createRecord(binding: BRegCreateBinding, data: JsonObject, idempotencyKey: string, format?: RecordFormat | null): Promise<CompleteOutcome<RecordEnvelope>>
|
|
228
304
|
patchRecord(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operations: ReadonlyArray<PatchOperation | RemovePatchOperation>, idempotencyKey: string, format?: RecordFormat | null): Promise<CompleteOutcome<RecordEnvelope>>
|
|
229
305
|
lifecycleActions(authority: BRegLifecycleAuthority, record: RecordEnvelope, format?: RecordFormat | null): ReadonlyArray<BRegLifecycleAction>
|
|
306
|
+
getRecordJson(entityRoute: string, recordIdentifier: string, options?: RecordOptions | null): Promise<JsonOutcome>
|
|
307
|
+
listRecordsJson(entityRoute: string, options?: ListOptions | null): Promise<JsonOutcome>
|
|
308
|
+
continueListJson(continuation: ListContinuation): Promise<JsonOutcome>
|
|
309
|
+
lookupRecordJson(entityRoute: string, selector: string, valuesJson?: string | null, options?: RecordOptions | null): Promise<JsonOutcome>
|
|
310
|
+
createRecordJson(binding: BRegCreateBinding, dataJson: string, idempotencyKey: string, format?: RecordFormat | null): Promise<JsonOutcome>
|
|
311
|
+
patchRecordJson(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operationsJson: string, idempotencyKey: string, format?: RecordFormat | null): Promise<JsonOutcome>
|
|
312
|
+
lifecycleActionsJson(authority: BRegLifecycleAuthority, recordJson: string, format?: RecordFormat | null): ReadonlyArray<BRegLifecycleAction>
|
|
313
|
+
executeLifecycleActionJson(action: BRegLifecycleAction, idempotencyKey: string): Promise<JsonOutcome>
|
|
230
314
|
executeLifecycleAction(action: BRegLifecycleAction, idempotencyKey: string): Promise<CompleteOutcome<LifecycleReceipt>>
|
|
231
315
|
}
|
package/breg/client.js
CHANGED
|
@@ -141,8 +141,16 @@ for (const [method, jsonIndexes, requiredIndexes] of [
|
|
|
141
141
|
['getRecord', [2]], ['listRecords', [1]], ['continueList', [0], [0]],
|
|
142
142
|
['lookupRecord', [2, 3]], ['createRecord', [1], [1]],
|
|
143
143
|
['patchRecord', [3], [3]], ['executeLifecycleAction'],
|
|
144
|
+
['getRecordJson', [2]], ['listRecordsJson', [1]], ['continueListJson', [0], [0]],
|
|
145
|
+
['lookupRecordJson', [3]], ['createRecordJson'], ['patchRecordJson'], ['executeLifecycleActionJson'],
|
|
144
146
|
]) wrapAsync(method, jsonIndexes, requiredIndexes);
|
|
145
147
|
|
|
148
|
+
const lifecycleActionsJson = native.BaseRegistryClient.prototype.lifecycleActionsJson;
|
|
149
|
+
native.BaseRegistryClient.prototype.lifecycleActionsJson = function (...args) {
|
|
150
|
+
try { return lifecycleActionsJson.apply(this, args); }
|
|
151
|
+
catch (error) { throw normalize(error, 'invalid_request'); }
|
|
152
|
+
};
|
|
153
|
+
|
|
146
154
|
const lifecycleActions = native.BaseRegistryClient.prototype.lifecycleActions;
|
|
147
155
|
native.BaseRegistryClient.prototype.lifecycleActions = function (...args) {
|
|
148
156
|
try {
|
package/breg/index.d.ts
CHANGED
|
@@ -16,6 +16,14 @@ export declare class BaseRegistryClient {
|
|
|
16
16
|
patchRecord(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operations: any, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
|
|
17
17
|
lifecycleActions(authority: BRegLifecycleAuthority, record: any, formatValue?: string | undefined | null): Array<BRegLifecycleAction>
|
|
18
18
|
executeLifecycleAction(action: BRegLifecycleAction, idempotencyKey: string): Promise<CompleteOutcome>
|
|
19
|
+
getRecordJson(entityRoute: string, recordIdentifier: string, options?: any | undefined | null): Promise<JsonOutcome>
|
|
20
|
+
listRecordsJson(entityRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
|
|
21
|
+
continueListJson(value: any): Promise<JsonOutcome>
|
|
22
|
+
lookupRecordJson(entityRoute: string, selector: string, valuesJson?: string | undefined | null, options?: any | undefined | null): Promise<JsonOutcome>
|
|
23
|
+
createRecordJson(binding: BRegCreateBinding, dataJson: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
|
|
24
|
+
patchRecordJson(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operationsJson: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
|
|
25
|
+
lifecycleActionsJson(authority: BRegLifecycleAuthority, recordJson: string, formatValue?: string | undefined | null): Array<BRegLifecycleAction>
|
|
26
|
+
executeLifecycleActionJson(action: BRegLifecycleAction, idempotencyKey: string): Promise<JsonOutcome>
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
export declare class BRegCreateBinding {
|
|
@@ -24,6 +32,8 @@ export declare class BRegCreateBinding {
|
|
|
24
32
|
export type CreateBinding = BRegCreateBinding
|
|
25
33
|
|
|
26
34
|
export declare class BRegLifecycleAction {
|
|
35
|
+
get bodyJson(): string
|
|
36
|
+
get reviewJson(): string | null
|
|
27
37
|
get operation(): string
|
|
28
38
|
get stage(): string | null
|
|
29
39
|
get href(): string
|
|
@@ -38,6 +48,8 @@ export declare class BRegLifecycleAuthority {
|
|
|
38
48
|
export type LifecycleAuthority = BRegLifecycleAuthority
|
|
39
49
|
|
|
40
50
|
export declare class BRegMetadata {
|
|
51
|
+
/** Caller-filtered inert descriptors. Selectors below remain the only authority constructors. */
|
|
52
|
+
get operations(): any
|
|
41
53
|
get registryIdentifier(): string
|
|
42
54
|
get registryVersion(): string
|
|
43
55
|
get registryRevision(): string
|
|
@@ -62,6 +74,16 @@ export interface CompleteOutcome {
|
|
|
62
74
|
location?: string
|
|
63
75
|
}
|
|
64
76
|
|
|
77
|
+
/** Validated product result serialized before the JavaScript number boundary. */
|
|
78
|
+
export interface JsonOutcome {
|
|
79
|
+
kind: string
|
|
80
|
+
valueJson: string
|
|
81
|
+
continuation?: any
|
|
82
|
+
traceId: string
|
|
83
|
+
etag?: string
|
|
84
|
+
location?: string
|
|
85
|
+
}
|
|
86
|
+
|
|
65
87
|
export interface PageOutcome {
|
|
66
88
|
kind: string
|
|
67
89
|
value: any
|
package/native.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@registrystack/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Unified Node.js client for Registry Stack products.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"typescript": "6.0.3"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
|
-
"@registrystack/client-darwin-arm64": "0.
|
|
46
|
-
"@registrystack/client-linux-arm64-gnu": "0.
|
|
47
|
-
"@registrystack/client-linux-x64-gnu": "0.
|
|
45
|
+
"@registrystack/client-darwin-arm64": "0.28.0",
|
|
46
|
+
"@registrystack/client-linux-arm64-gnu": "0.28.0",
|
|
47
|
+
"@registrystack/client-linux-x64-gnu": "0.28.0"
|
|
48
48
|
}
|
|
49
49
|
}
|