@registrystack/client 0.29.0 → 0.31.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/breg/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const { types: { isProxy } } = require('node:util');
3
+ const { types: { isProxy, isSharedArrayBuffer } } = require('node:util');
4
4
  const native = require('./index');
5
5
 
6
6
  const MAX_JSON_DEPTH = 128;
@@ -12,7 +12,7 @@ class BaseRegistryClientError extends Error {
12
12
  super(envelope.message);
13
13
  this.name = 'BaseRegistryClientError';
14
14
  this.kind = envelope.kind;
15
- for (const field of ['code', 'planRefusal', 'status', 'traceId', 'transportKind', 'tokenKind']) {
15
+ for (const field of ['code', 'planRefusal', 'refusalCode', 'status', 'traceId', 'transportKind', 'tokenKind']) {
16
16
  if (envelope[field] !== undefined && envelope[field] !== null) this[field] = envelope[field];
17
17
  }
18
18
  }
@@ -50,6 +50,64 @@ function inputError(kind) {
50
50
  });
51
51
  }
52
52
 
53
+ function plainDataObject(value, expectedFields) {
54
+ if (value === null || typeof value !== 'object' || Array.isArray(value) || isProxy(value)) {
55
+ throw inputError('invalid_request');
56
+ }
57
+ const prototype = Object.getPrototypeOf(value);
58
+ if (prototype !== Object.prototype && prototype !== null) throw inputError('invalid_request');
59
+ const keys = Reflect.ownKeys(value);
60
+ if (keys.some((key) => typeof key !== 'string')
61
+ || keys.length !== expectedFields.length
62
+ || keys.some((key) => !expectedFields.includes(key))) throw inputError('invalid_request');
63
+ const result = Object.create(null);
64
+ for (const field of expectedFields) {
65
+ const descriptor = Object.getOwnPropertyDescriptor(value, field);
66
+ if (!descriptor || !descriptor.enumerable || !Object.hasOwn(descriptor, 'value')) {
67
+ throw inputError('invalid_request');
68
+ }
69
+ result[field] = descriptor.value;
70
+ }
71
+ return result;
72
+ }
73
+
74
+ function webhookHeaders(value) {
75
+ if (value === null || typeof value !== 'object' || Array.isArray(value) || isProxy(value)) {
76
+ throw inputError('invalid_request');
77
+ }
78
+ const prototype = Object.getPrototypeOf(value);
79
+ if (prototype !== Object.prototype && prototype !== null) throw inputError('invalid_request');
80
+ const keys = Reflect.ownKeys(value);
81
+ if (keys.some((key) => typeof key !== 'string')) {
82
+ throw inputError('invalid_request');
83
+ }
84
+ const result = Object.create(null);
85
+ for (const name of keys) {
86
+ const descriptor = Object.getOwnPropertyDescriptor(value, name);
87
+ if (!descriptor || !descriptor.enumerable || !Object.hasOwn(descriptor, 'value')
88
+ || typeof descriptor.value !== 'string') throw inputError('invalid_request');
89
+ result[name] = descriptor.value;
90
+ }
91
+ return result;
92
+ }
93
+
94
+ function verifyWebhookDelivery(value) {
95
+ try {
96
+ const input = plainDataObject(value, ['method', 'path', 'headers', 'body', 'key']);
97
+ if (typeof input.method !== 'string' || typeof input.path !== 'string'
98
+ || !Buffer.isBuffer(input.body) || !Buffer.isBuffer(input.key)
99
+ || isSharedArrayBuffer(input.body.buffer) || isSharedArrayBuffer(input.key.buffer)) {
100
+ throw inputError('invalid_request');
101
+ }
102
+ input.headers = webhookHeaders(input.headers);
103
+ input.body = Buffer.from(input.body);
104
+ input.key = Buffer.from(input.key);
105
+ return native.verifyWebhookDelivery(input);
106
+ } catch (error) {
107
+ throw normalize(error, 'invalid_request');
108
+ }
109
+ }
110
+
53
111
  function chargeString(value, budget, kind) {
54
112
  budget.stringBytes += Buffer.byteLength(value, 'utf8');
55
113
  if (budget.stringBytes > MAX_JSON_STRING_BYTES) throw inputError(kind);
@@ -65,7 +123,8 @@ function cloneJson(value, budget, depth, kind) {
65
123
  return value;
66
124
  }
67
125
  if (typeof value === 'number') {
68
- if (!Number.isFinite(value)) throw inputError(kind);
126
+ if (!Number.isFinite(value)
127
+ || (Number.isInteger(value) && !Number.isSafeInteger(value))) throw inputError(kind);
69
128
  return value;
70
129
  }
71
130
  if (value === undefined || typeof value !== 'object' || isProxy(value)) throw inputError(kind);
@@ -138,15 +197,85 @@ function wrapAsync(name, jsonIndexes = [], requiredIndexes = []) {
138
197
 
139
198
  for (const [method, jsonIndexes, requiredIndexes] of [
140
199
  ['health'], ['ready'], ['openapi'], ['registryMetadata'], ['registryContract'], ['entitySchema'],
200
+ ['recordRevisions'], ['getRecordRevision', [3]],
141
201
  ['getRecord', [2]], ['listRecords', [1]], ['continueList', [0], [0]],
202
+ ['getGeoJsonRecord', [2]], ['listGeoJsonRecords', [1]], ['continueGeoJsonList', [0], [0]],
203
+ ['listCurrentRecords', [1]], ['continueCurrentList', [0], [0]],
204
+ ['listRecordsAsOf', [1], [1]], ['continueAsOfList', [0], [0]],
205
+ ['listSnapshotRecords', [1]], ['continueSnapshotList', [0], [0]],
206
+ ['listRelationshipRecords', [3]], ['continueRelationshipList', [0], [0]],
142
207
  ['lookupRecord', [2, 3]], ['createRecord', [1], [1]],
143
- ['patchRecord', [3], [3]], ['executeLifecycleAction'],
208
+ ['actionTargetConditions', [1], [1]], ['invokeAction', [1], [1]],
209
+ ['executeRecoveredCreate'],
210
+ ['patchRecord', [3], [3]], ['batchRecords', [1], [1]], ['tombstoneRecord'],
211
+ ['executeLifecycleAction'],
212
+ ['executeRecoveredLifecycleAction'],
144
213
  ['uploadAttachment'], ['downloadAttachment'], ['deleteAttachment'],
145
214
  ['getRecordJson', [2]], ['listRecordsJson', [1]], ['continueListJson', [0], [0]],
215
+ ['getGeoJsonRecordJson', [2]], ['listGeoJsonRecordsJson', [1]],
216
+ ['continueGeoJsonListJson', [0], [0]],
217
+ ['listCurrentRecordsJson', [1]], ['continueCurrentListJson', [0], [0]],
218
+ ['listRecordsAsOfJson', [1], [1]], ['continueAsOfListJson', [0], [0]],
219
+ ['listSnapshotRecordsJson', [1]], ['continueSnapshotListJson', [0], [0]],
220
+ ['listRelationshipRecordsJson', [3]], ['continueRelationshipListJson', [0], [0]],
146
221
  ['lookupRecordJson', [3]], ['createRecordJson'], ['patchRecordJson'], ['executeLifecycleActionJson'],
222
+ ['actionTargetConditionsJson'], ['invokeActionJson'], ['batchRecordsJson'], ['tombstoneRecordJson'],
223
+ ['executeRecoveredCreateJson'], ['executeRecoveredLifecycleActionJson'],
147
224
  ['uploadAttachmentJson'], ['deleteAttachmentJson'],
148
225
  ]) wrapAsync(method, jsonIndexes, requiredIndexes);
149
226
 
227
+ for (const [method, jsonIndexes, requiredIndexes] of [
228
+ ['prepareCreate', [1], [1]], ['prepareCreateJson'], ['recoverCreate'],
229
+ ['prepareLifecycleAction', [1], [1]], ['prepareLifecycleActionJson'],
230
+ ['recoverLifecycleAction'],
231
+ ]) {
232
+ const original = native.BaseRegistryClient.prototype[method];
233
+ native.BaseRegistryClient.prototype[method] = function (...args) {
234
+ try {
235
+ return original.apply(this, sanitizeArguments(
236
+ args, new Set(jsonIndexes), new Set(requiredIndexes),
237
+ ));
238
+ } catch (error) {
239
+ throw normalize(error, 'invalid_request');
240
+ }
241
+ };
242
+ }
243
+
244
+ function preparedClass(Class, label) {
245
+ Object.defineProperty(Class.prototype, Symbol.for('nodejs.util.inspect.custom'), {
246
+ value() { return `${label}(<redacted>)`; },
247
+ });
248
+ Object.defineProperty(Class.prototype, 'toString', {
249
+ value() { return `${label}(<redacted>)`; },
250
+ });
251
+ const Facade = function () {
252
+ throw new TypeError(`${label} has no public constructor`);
253
+ };
254
+ Object.defineProperties(Facade, {
255
+ name: { value: label },
256
+ fromBytes: {
257
+ value(bytes) {
258
+ try {
259
+ if (!Buffer.isBuffer(bytes)) throw inputError('invalid_request');
260
+ return Class.fromBytes(bytes);
261
+ } catch (error) {
262
+ throw normalize(error, 'invalid_request');
263
+ }
264
+ },
265
+ },
266
+ [Symbol.hasInstance]: {
267
+ value(value) { return value instanceof Class; },
268
+ },
269
+ });
270
+ Facade.prototype = Class.prototype;
271
+ return Facade;
272
+ }
273
+
274
+ const BRegPreparedCreate = preparedClass(native.BRegPreparedCreate, 'BRegPreparedCreate');
275
+ const BRegPreparedLifecycle = preparedClass(
276
+ native.BRegPreparedLifecycle, 'BRegPreparedLifecycle',
277
+ );
278
+
150
279
  const withReason = native.BRegLifecycleAction.prototype.withReason;
151
280
  native.BRegLifecycleAction.prototype.withReason = function (reason) {
152
281
  try {
@@ -193,7 +322,10 @@ for (const name of ['prepareUpload', 'acceptsContentType']) {
193
322
  };
194
323
  }
195
324
 
196
- for (const name of ['selectCreate', 'selectPatch', 'selectLifecycle', 'selectAttachments']) {
325
+ for (const name of [
326
+ 'selectCreate', 'selectPatch', 'selectLifecycle', 'selectAttachments',
327
+ 'selectImmediateAction', 'selectTombstone', 'selectBatch', 'changeRequestCapability',
328
+ ]) {
197
329
  const original = native.BRegMetadata.prototype[name];
198
330
  native.BRegMetadata.prototype[name] = function (...args) {
199
331
  try {
@@ -214,7 +346,25 @@ class BaseRegistryClient extends native.BaseRegistryClient {
214
346
  }
215
347
  }
216
348
 
349
+ class PrivateKeyJwt {
350
+ #native;
351
+ constructor(config) {
352
+ try { this.#native = new native.PrivateKeyJwt(cloneJson(config, { nodes: 0, stringBytes: 0, active: new WeakSet() }, 0, 'configuration')); }
353
+ catch (error) { throw normalize(error, 'configuration'); }
354
+ }
355
+ async exchange(subjectToken) {
356
+ try { return await this.#native.exchange(subjectToken); }
357
+ catch (error) { throw normalize(error, 'token'); }
358
+ }
359
+ async bearerToken() {
360
+ try { return await this.#native.bearerToken(); }
361
+ catch (error) { throw normalize(error, 'token'); }
362
+ }
363
+ }
364
+
217
365
  module.exports = {
366
+ verifyWebhookDelivery,
367
+ PrivateKeyJwt,
218
368
  BaseRegistryClient,
219
369
  BaseRegistryClientError,
220
370
  BRegMetadata: native.BRegMetadata,
@@ -224,4 +374,12 @@ module.exports = {
224
374
  BRegLifecycleAction: native.BRegLifecycleAction,
225
375
  BRegAttachmentSlot: native.BRegAttachmentSlot,
226
376
  BRegAttachmentUpload: native.BRegAttachmentUpload,
377
+ BRegImmediateActionBinding: native.BRegImmediateActionBinding,
378
+ BRegActionTargetConditions: native.BRegActionTargetConditions,
379
+ BRegTombstoneBinding: native.BRegTombstoneBinding,
380
+ BRegBatchBinding: native.BRegBatchBinding,
381
+ BRegPreparedCreate,
382
+ BRegPreparedLifecycle,
383
+ BRegRecoveredCreate: native.BRegRecoveredCreate,
384
+ BRegRecoveredLifecycle: native.BRegRecoveredLifecycle,
227
385
  };
package/breg/index.d.ts CHANGED
@@ -8,12 +8,41 @@ export declare class BaseRegistryClient {
8
8
  registryMetadata(accessProfile?: string | undefined | null): Promise<RawOutcome>
9
9
  registryContract(accessProfile?: string | undefined | null): Promise<BRegMetadata>
10
10
  entitySchema(entityIdentifier: string, accessProfile?: string | undefined | null): Promise<RawOutcome>
11
+ /** Retrieve one bounded first page of record revisions as inert JSON. */
12
+ recordRevisions(entityRoute: string, recordIdentifier: string, accessProfile?: string | undefined | null): Promise<RawOutcome>
13
+ /** Retrieve one exact retained revision as validated inert record JSON. */
14
+ getRecordRevision(entityRoute: string, recordIdentifier: string, revision: number, options?: any | undefined | null): Promise<RawOutcome>
11
15
  getRecord(entityRoute: string, recordIdentifier: string, options?: any | undefined | null): Promise<CompleteOutcome>
12
16
  listRecords(entityRoute: string, options?: any | undefined | null): Promise<PageOutcome>
13
17
  continueList(value: any): Promise<PageOutcome>
18
+ getGeoJsonRecord(entityRoute: string, recordIdentifier: string, options?: any | undefined | null): Promise<CompleteOutcome>
19
+ listGeoJsonRecords(entityRoute: string, options?: any | undefined | null): Promise<PageOutcome>
20
+ continueGeoJsonList(value: any): Promise<PageOutcome>
21
+ listCurrentRecords(entityRoute: string, options?: any | undefined | null): Promise<PageOutcome>
22
+ continueCurrentList(value: any): Promise<PageOutcome>
23
+ listRecordsAsOf(entityRoute: string, options?: any | undefined | null): Promise<PageOutcome>
24
+ continueAsOfList(value: any): Promise<PageOutcome>
25
+ listSnapshotRecords(entityRoute: string, options?: any | undefined | null): Promise<PageOutcome>
26
+ continueSnapshotList(value: any): Promise<PageOutcome>
27
+ listRelationshipRecords(entityRoute: string, recordIdentifier: string, pathRoute: string, options?: any | undefined | null): Promise<PageOutcome>
28
+ continueRelationshipList(value: any): Promise<PageOutcome>
14
29
  lookupRecord(entityRoute: string, selector: string, values?: any | undefined | null, options?: any | undefined | null): Promise<CompleteOutcome>
30
+ /** Fetch opaque target conditions for one metadata-selected action. */
31
+ actionTargetConditions(binding: BRegImmediateActionBinding, inputs: any): Promise<BRegActionTargetConditions>
32
+ /** Invoke one metadata-selected immediate action without automatic retry. */
33
+ invokeAction(binding: BRegImmediateActionBinding, inputs: any, idempotencyKey: string, conditions?: BRegActionTargetConditions | undefined | null): Promise<CompleteOutcome>
15
34
  createRecord(binding: BRegCreateBinding, data: any, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
35
+ /** Prepare inert Create evidence before any token acquisition or I/O. */
36
+ prepareCreate(binding: BRegCreateBinding, data: any, idempotencyKey: string, formatValue?: string | undefined | null): BRegPreparedCreate
37
+ /** Revalidate saved Create evidence against freshly selected authority. */
38
+ recoverCreate(binding: BRegCreateBinding, prepared: BRegPreparedCreate): BRegRecoveredCreate
39
+ /** Explicitly send a recovered Create request with fresh authority. */
40
+ executeRecoveredCreate(binding: BRegCreateBinding, recovered: BRegRecoveredCreate): Promise<CompleteOutcome>
16
41
  patchRecord(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operations: any, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
42
+ /** Execute one metadata-selected atomic batch without automatic retry. */
43
+ batchRecords(binding: BRegBatchBinding, request: any, idempotencyKey: string): Promise<CompleteOutcome>
44
+ /** Tombstone one record against its current strong ETag. */
45
+ tombstoneRecord(binding: BRegTombstoneBinding, recordIdentifier: string, etag: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
17
46
  /**
18
47
  * Replace one governed attachment slot with exact bytes. The prepared
19
48
  * upload already satisfies the slot's served size and content-type policy.
@@ -25,18 +54,59 @@ export declare class BaseRegistryClient {
25
54
  deleteAttachment(slot: BRegAttachmentSlot, recordIdentifier: string, etag: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
26
55
  lifecycleActions(authority: BRegLifecycleAuthority, record: any, formatValue?: string | undefined | null): Array<BRegLifecycleAction>
27
56
  executeLifecycleAction(action: BRegLifecycleAction, idempotencyKey: string): Promise<CompleteOutcome>
57
+ /** Prepare inert lifecycle evidence before any token acquisition or I/O. */
58
+ prepareLifecycleAction(authority: BRegLifecycleAuthority, record: any, action: BRegLifecycleAction, idempotencyKey: string, formatValue?: string | undefined | null): BRegPreparedLifecycle
59
+ /** Revalidate saved lifecycle evidence against freshly selected authority. */
60
+ recoverLifecycleAction(authority: BRegLifecycleAuthority, prepared: BRegPreparedLifecycle): BRegRecoveredLifecycle
61
+ /** Explicitly send a recovered lifecycle action. */
62
+ executeRecoveredLifecycleAction(recovered: BRegRecoveredLifecycle): Promise<CompleteOutcome>
28
63
  getRecordJson(entityRoute: string, recordIdentifier: string, options?: any | undefined | null): Promise<JsonOutcome>
29
64
  listRecordsJson(entityRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
30
65
  continueListJson(value: any): Promise<JsonOutcome>
66
+ getGeoJsonRecordJson(entityRoute: string, recordIdentifier: string, options?: any | undefined | null): Promise<JsonOutcome>
67
+ listGeoJsonRecordsJson(entityRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
68
+ continueGeoJsonListJson(value: any): Promise<JsonOutcome>
69
+ listCurrentRecordsJson(entityRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
70
+ continueCurrentListJson(value: any): Promise<JsonOutcome>
71
+ listRecordsAsOfJson(entityRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
72
+ continueAsOfListJson(value: any): Promise<JsonOutcome>
73
+ listSnapshotRecordsJson(entityRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
74
+ continueSnapshotListJson(value: any): Promise<JsonOutcome>
75
+ listRelationshipRecordsJson(entityRoute: string, recordIdentifier: string, pathRoute: string, options?: any | undefined | null): Promise<JsonOutcome>
76
+ continueRelationshipListJson(value: any): Promise<JsonOutcome>
31
77
  lookupRecordJson(entityRoute: string, selector: string, valuesJson?: string | undefined | null, options?: any | undefined | null): Promise<JsonOutcome>
78
+ /** Fetch opaque target conditions from exact action-input JSON. */
79
+ actionTargetConditionsJson(binding: BRegImmediateActionBinding, inputsJson: string): Promise<BRegActionTargetConditions>
80
+ /** Invoke an action from exact JSON and preserve exact receipt values. */
81
+ invokeActionJson(binding: BRegImmediateActionBinding, inputsJson: string, idempotencyKey: string, conditions?: BRegActionTargetConditions | undefined | null): Promise<JsonOutcome>
32
82
  createRecordJson(binding: BRegCreateBinding, dataJson: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
83
+ /** Prepare inert Create evidence from exact JSON text. */
84
+ prepareCreateJson(binding: BRegCreateBinding, dataJson: string, idempotencyKey: string, formatValue?: string | undefined | null): BRegPreparedCreate
85
+ /** Explicitly send a recovered Create request and preserve exact values. */
86
+ executeRecoveredCreateJson(binding: BRegCreateBinding, recovered: BRegRecoveredCreate): Promise<JsonOutcome>
33
87
  patchRecordJson(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operationsJson: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
88
+ /** Execute one metadata-selected atomic batch from exact JSON. */
89
+ batchRecordsJson(binding: BRegBatchBinding, requestJson: string, idempotencyKey: string): Promise<JsonOutcome>
90
+ /** Tombstone one record and preserve exact response values. */
91
+ tombstoneRecordJson(binding: BRegTombstoneBinding, recordIdentifier: string, etag: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
34
92
  uploadAttachmentJson(slot: BRegAttachmentSlot, recordIdentifier: string, etag: string, upload: BRegAttachmentUpload, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
35
93
  deleteAttachmentJson(slot: BRegAttachmentSlot, recordIdentifier: string, etag: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<JsonOutcome>
36
94
  lifecycleActionsJson(authority: BRegLifecycleAuthority, recordJson: string, formatValue?: string | undefined | null): Array<BRegLifecycleAction>
95
+ /** Prepare inert lifecycle evidence from an exact Registry Record response. */
96
+ prepareLifecycleActionJson(authority: BRegLifecycleAuthority, recordJson: string, action: BRegLifecycleAction, idempotencyKey: string, formatValue?: string | undefined | null): BRegPreparedLifecycle
37
97
  executeLifecycleActionJson(action: BRegLifecycleAction, idempotencyKey: string): Promise<JsonOutcome>
98
+ /** Explicitly send a recovered lifecycle action and preserve exact values. */
99
+ executeRecoveredLifecycleActionJson(recovered: BRegRecoveredLifecycle): Promise<JsonOutcome>
38
100
  }
39
101
 
102
+ /** Opaque server-validated target conditions for one immediate action. */
103
+ export declare class BRegActionTargetConditions {
104
+ get preconditionKeys(): Array<string>
105
+ get valueJson(): string
106
+ get traceId(): string
107
+ }
108
+ export type ActionTargetConditions = BRegActionTargetConditions
109
+
40
110
  /** Opaque governed attachment slot selected from metadata fetched by this client source. */
41
111
  export declare class BRegAttachmentSlot {
42
112
  get slotIdentifier(): string
@@ -66,11 +136,21 @@ export declare class BRegAttachmentUpload {
66
136
  }
67
137
  export type AttachmentUpload = BRegAttachmentUpload
68
138
 
139
+ export declare class BRegBatchBinding {
140
+
141
+ }
142
+ export type BatchBinding = BRegBatchBinding
143
+
69
144
  export declare class BRegCreateBinding {
70
145
 
71
146
  }
72
147
  export type CreateBinding = BRegCreateBinding
73
148
 
149
+ export declare class BRegImmediateActionBinding {
150
+
151
+ }
152
+ export type ImmediateActionBinding = BRegImmediateActionBinding
153
+
74
154
  export declare class BRegLifecycleAction {
75
155
  withReason(reason: string): BRegLifecycleAction
76
156
  get bodyJson(): string
@@ -91,6 +171,12 @@ export type LifecycleAuthority = BRegLifecycleAuthority
91
171
  export declare class BRegMetadata {
92
172
  /** Caller-filtered inert descriptors. Selectors below remain the only authority constructors. */
93
173
  get operations(): any
174
+ /** Complete typed caller-filtered immediate-action descriptors. */
175
+ get immediateActions(): any
176
+ /** Original caller-filtered action metadata as exact JSON text. */
177
+ get actionsJson(): string | null
178
+ /** Descriptive change-request capability for one entity, when advertised. */
179
+ changeRequestCapability(entityIdentifier: string): any | null
94
180
  get registryIdentifier(): string
95
181
  get registryVersion(): string
96
182
  get registryRevision(): string
@@ -100,6 +186,9 @@ export declare class BRegMetadata {
100
186
  selectPatch(operationIdentifier: string, expectedProfile: string): BRegPatchBinding
101
187
  selectLifecycle(entityIdentifier: string, expectedProfile: string): BRegLifecycleAuthority
102
188
  selectAttachments(entityIdentifier: string, expectedProfile: string): Array<BRegAttachmentSlot>
189
+ selectImmediateAction(actionIdentifier: string, expectedProfile: string): BRegImmediateActionBinding
190
+ selectTombstone(entityIdentifier: string, expectedProfile: string): BRegTombstoneBinding
191
+ selectBatch(entityIdentifier: string, expectedProfile: string): BRegBatchBinding
103
192
  }
104
193
  export type Metadata = BRegMetadata
105
194
 
@@ -108,6 +197,61 @@ export declare class BRegPatchBinding {
108
197
  }
109
198
  export type PatchBinding = BRegPatchBinding
110
199
 
200
+ /**
201
+ * Inert original Create request evidence. The bytes carry values and an
202
+ * idempotency key, but no token or executable metadata authority.
203
+ */
204
+ export declare class BRegPreparedCreate {
205
+ /** Restore bounded inert evidence previously returned by `toBytes`. */
206
+ static fromBytes(bytes: Buffer): BRegPreparedCreate
207
+ /** Copy the exact evidence bytes for owner-protected persistence. */
208
+ toBytes(): Buffer
209
+ }
210
+ export type PreparedCreate = BRegPreparedCreate
211
+
212
+ /**
213
+ * Inert original lifecycle request evidence. The bytes carry record values
214
+ * and an idempotency key, but no token or executable metadata authority.
215
+ */
216
+ export declare class BRegPreparedLifecycle {
217
+ /** Restore bounded inert evidence previously returned by `toBytes`. */
218
+ static fromBytes(bytes: Buffer): BRegPreparedLifecycle
219
+ /** Copy the exact evidence bytes for owner-protected persistence. */
220
+ toBytes(): Buffer
221
+ }
222
+ export type PreparedLifecycle = BRegPreparedLifecycle
223
+
224
+ /**
225
+ * A recovered Create request, key, and representation. This remains inert
226
+ * until `executeRecoveredCreate` is explicitly called with fresh authority.
227
+ */
228
+ export declare class BRegRecoveredCreate {
229
+
230
+ }
231
+ export type RecoveredCreate = BRegRecoveredCreate
232
+
233
+ /**
234
+ * A recovered lifecycle action and key. This remains inert until
235
+ * `executeRecoveredLifecycleAction` is explicitly called.
236
+ */
237
+ export declare class BRegRecoveredLifecycle {
238
+
239
+ }
240
+ export type RecoveredLifecycle = BRegRecoveredLifecycle
241
+
242
+ export declare class BRegTombstoneBinding {
243
+
244
+ }
245
+ export type TombstoneBinding = BRegTombstoneBinding
246
+
247
+ /** Shared OAuth client authentication and uncached task-token exchange. */
248
+ export declare class PrivateKeyJwt {
249
+ constructor(config: any)
250
+ exchange(subjectToken: string): Promise<string>
251
+ bearerToken(): Promise<string>
252
+ }
253
+ export type PrivateKeyJwtBinding = PrivateKeyJwt
254
+
111
255
  export interface CompleteOutcome {
112
256
  kind: string
113
257
  value: any
@@ -124,6 +268,8 @@ export interface JsonOutcome {
124
268
  traceId: string
125
269
  etag?: string
126
270
  location?: string
271
+ snapshot?: string
272
+ validAt?: string
127
273
  }
128
274
 
129
275
  export interface PageOutcome {
@@ -132,6 +278,8 @@ export interface PageOutcome {
132
278
  continuation?: any
133
279
  traceId: string
134
280
  etag?: string
281
+ snapshot?: string
282
+ validAt?: string
135
283
  }
136
284
 
137
285
  export interface RawOutcome {
@@ -141,3 +289,29 @@ export interface RawOutcome {
141
289
  traceId: string
142
290
  etag?: string
143
291
  }
292
+
293
+ /** Authenticated BReg webhook metadata and exact body. */
294
+ export interface VerifiedWebhookDelivery {
295
+ id: string
296
+ source: string
297
+ type: string
298
+ time: string
299
+ dataschema: string
300
+ generation: string
301
+ attempt: string
302
+ deliveryTime: string
303
+ idempotencyKey: string
304
+ body: Buffer
305
+ }
306
+
307
+ /** Verify a BReg Version 1 webhook signature without applying receiver policy. */
308
+ export declare function verifyWebhookDelivery(input: WebhookDeliveryInput): VerifiedWebhookDelivery
309
+
310
+ /** Exact BReg webhook request supplied by a receiver. */
311
+ export interface WebhookDeliveryInput {
312
+ method: string
313
+ path: string
314
+ headers: Record<string, string>
315
+ body: Buffer
316
+ key: Buffer
317
+ }