@registrystack/client 0.32.0 → 0.33.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
@@ -34,7 +34,8 @@ const work = new casework.CaseworkClient({
34
34
  - `evidence`: Evidence Gateway, request and verify signed minimum-disclosure
35
35
  assertions.
36
36
  - `relay`: Registry Relay, scoped read-only APIs over existing sources.
37
- - `breg`: Base Registry Engine, records, contracts, writes, and lifecycle.
37
+ - `breg`: Base Registry Engine, records, contracts, writes, lifecycle, and typed
38
+ applied-request result navigation.
38
39
  - `casework`: Registry Casework, staff inbox, claims, drafts, decisions,
39
40
  recovery, history, holdings, and directory bootstrap.
40
41
 
package/breg/client.d.ts CHANGED
@@ -216,33 +216,54 @@ export interface RegistryRecord {
216
216
  readonly [member: string]: JsonValue | undefined
217
217
  }
218
218
 
219
- export type BRegRequestReviewStage = JsonObject & {
220
- readonly id: string
221
- readonly approvals: SafeInteger
222
- readonly excludeSubmitter: boolean
223
- readonly excludePreviousReviewers?: boolean
224
- }
225
- export type BRegRequestReviewState = JsonObject & {
226
- readonly stages: ReadonlyArray<BRegRequestReviewStage>
227
- readonly submittedAt: string
228
- readonly pendingStage: string | null
229
- readonly stageEnteredAt: string | null
230
- }
231
- export type BRegRequestReviewTiming = JsonObject & {
232
- readonly firstSubmittedAt: string
233
- readonly pausedMilliseconds: SafeInteger
234
- readonly pauseStartedAt: string | null
235
- readonly completedAt: string | null
236
- }
237
- export type BRegRequestDecision = JsonObject & {
238
- readonly stageId: string
239
- readonly kind: 'approve' | 'reject' | 'request_revision'
240
- readonly decidedAt: string
241
- readonly reasonPresent: boolean
242
- readonly reason?: string
243
- readonly actorReference?: string
244
- }
245
- export type BRegRequestState = 'draft' | 'submitted' | 'approved' | 'needs_changes' | 'rejected' | 'canceled' | 'applied'
219
+ export type BRegRequestResultReferenceData = JsonObject & {
220
+ readonly targetEntityId: string
221
+ readonly targetRecordId: string
222
+ /** Revision written by the application, not a current ETag or precondition. */
223
+ readonly targetRevision: SafeInteger
224
+ }
225
+ export type BRegRequestState = 'draft' | 'submitted' | 'cancelled' | 'applied' | 'superseded'
226
+ export type BRegRequestReviewRequirement =
227
+ | Readonly<{ mode: 'none' }>
228
+ | Readonly<{ authority: string; policyId: string }>
229
+ export type BRegExternalReviewStatus = Readonly<{
230
+ submission: Readonly<{
231
+ state: 'pending' | 'accepted' | 'uncertain' | 'cancelling' | 'cancelled' | 'failed'
232
+ authority: string
233
+ requestId?: string
234
+ submissionDigest?: string
235
+ /** Fixed recovery deadline for the durable submission. */
236
+ recoveryDeadline?: string
237
+ policy?: Readonly<{ id: string; version: string; digest: string }>
238
+ }>
239
+ result: Readonly<{
240
+ state: 'pending' | 'approved' | 'rejected' | 'changesRequested' | 'answered' | 'cancelled' | 'superseded'
241
+ resultId?: string
242
+ completedAt?: string
243
+ availableUntil?: string
244
+ }>
245
+ delivery: Readonly<{
246
+ state: 'polling' | 'received' | 'reconciled' | 'unmatched' | 'exhausted'
247
+ eventId?: string
248
+ receivedAt?: string
249
+ }>
250
+ application: Readonly<{
251
+ mode: 'manual' | 'automatic'
252
+ state: 'awaitingReview' | 'ready' | 'queued' | 'applying' | 'applied' | 'blocked'
253
+ executor?: string
254
+ applicationId?: string
255
+ /** Durable automatic-application attempts, from 0 through 1000. */
256
+ attempts?: SafeInteger
257
+ /** Present only while an automatic application is queued or applying. */
258
+ nextAttemptAt?: string
259
+ /** Present when the applied receipt was recovered from already-applied source state. */
260
+ receiptRecovered?: true
261
+ }>
262
+ recovery: Readonly<{
263
+ state: 'none' | 'operatorAttention'
264
+ code?: string
265
+ }>
266
+ }>
246
267
  export type BRegRetainedRequestProposal = JsonObject & {
247
268
  readonly requestEntityId: string
248
269
  readonly requestId: string
@@ -253,9 +274,9 @@ export type BRegRetainedRequestProposal = JsonObject & {
253
274
  readonly detailErased: boolean
254
275
  readonly applicationId: string | null
255
276
  readonly resultLinkCount: SafeInteger
256
- readonly resultLinks: ReadonlyArray<JsonObject>
277
+ readonly resultLinks: ReadonlyArray<BRegRequestResultReferenceData>
257
278
  readonly effectDigest?: string
258
- readonly decisions?: ReadonlyArray<BRegRequestDecision>
279
+ readonly proposal?: Readonly<{ review: BRegRequestReviewRequirement }>
259
280
  }
260
281
  export type BRegRetainedRequestHistory = JsonObject & {
261
282
  readonly proposals: ReadonlyArray<BRegRetainedRequestProposal>
@@ -265,17 +286,15 @@ export type BRegRequestMetadata = JsonObject & {
265
286
  readonly bregState: BRegRequestState
266
287
  readonly proposalVersion: SafeInteger
267
288
  readonly effectDigest?: string | null
268
- readonly proposal?: JsonObject | null
289
+ readonly proposal?: Readonly<{ review: BRegRequestReviewRequirement }> | null
269
290
  readonly editable: boolean
270
291
  readonly detailErased?: true
271
292
  readonly actions?: ReadonlyArray<JsonObject>
272
293
  readonly application?: JsonObject | null
273
- readonly history?: BRegRetainedRequestHistory
274
- readonly review?: BRegRequestReviewState
275
- readonly reviewTiming?: BRegRequestReviewTiming
294
+ readonly history?: BRegRetainedRequestHistory | null
295
+ readonly review?: BRegExternalReviewStatus
276
296
  readonly submitterReference?: string
277
297
  readonly applierReference?: string
278
- readonly decisions?: ReadonlyArray<BRegRequestDecision>
279
298
  }
280
299
 
281
300
  export interface RecordMetadata {
@@ -343,17 +362,6 @@ export interface RemovePatchOperation {
343
362
  field: string
344
363
  }
345
364
 
346
- export interface LifecycleReviewTarget {
347
- entityIdentifier: string
348
- recordIdentifier: string
349
- operation: 'create' | 'patch'
350
- baseRevision?: SafeInteger
351
- before?: Readonly<Record<string, JsonValue>>
352
- after: Readonly<Record<string, JsonValue>>
353
- }
354
-
355
- export interface LifecycleReview { targets: ReadonlyArray<LifecycleReviewTarget> }
356
-
357
365
  export type LifecycleReceipt = JsonObject & {
358
366
  readonly id: string
359
367
  readonly revision: SafeInteger
@@ -592,6 +600,132 @@ export interface BRegBatchReceipt {
592
600
  }>
593
601
  }
594
602
 
603
+ export type BRegIngestionOperation = 'create' | 'patch'
604
+ export type BRegIngestionRunStatus = 'open' | 'complete' | 'cancelled' | 'blocked'
605
+ export type BRegIngestionAttemptOutcome =
606
+ | 'committed'
607
+ | 'replayed'
608
+ | 'invalidItem'
609
+ | 'refused'
610
+ | 'bindingChanged'
611
+ | 'chunkMismatch'
612
+ | 'runNotOpen'
613
+ | 'unavailable'
614
+
615
+ /** The whole-input announcement that opens one durable ingestion run. */
616
+ export interface BRegIngestionRunInput {
617
+ operation: BRegIngestionOperation
618
+ profileId: string
619
+ packageRevision: string
620
+ schemaFingerprint: string
621
+ /** Lowercase SHA-256 of the complete raw source input. */
622
+ inputDigest: string
623
+ inputLength: SafeInteger
624
+ itemCount: SafeInteger
625
+ chunkCount: SafeInteger
626
+ /** The only accepted value is `greedy-canonical-http-batch-v1`. */
627
+ chunkAlgorithmVersion: string
628
+ }
629
+
630
+ export interface BRegIngestionRunListInput {
631
+ accessProfile?: string | null
632
+ limit?: SafeInteger | null
633
+ after?: string | null
634
+ status?: BRegIngestionRunStatus | null
635
+ inputDigest?: string | null
636
+ }
637
+
638
+ export interface BRegIngestionAttempt {
639
+ readonly outcome: BRegIngestionAttemptOutcome
640
+ readonly chunkIndex: SafeInteger | null
641
+ }
642
+
643
+ /** Value-free durable state of one ingestion run: no source rows, no record values. */
644
+ export interface BRegIngestionRun {
645
+ readonly runId: string
646
+ readonly status: BRegIngestionRunStatus
647
+ readonly blockedReason: string | null
648
+ readonly entityId: string
649
+ readonly operation: BRegIngestionOperation
650
+ readonly profileId: string
651
+ readonly packageRevision: string
652
+ readonly schemaFingerprint: string
653
+ readonly inputDigest: string
654
+ readonly inputLength: SafeInteger
655
+ readonly itemCount: SafeInteger
656
+ readonly chunkCount: SafeInteger
657
+ readonly chunkAlgorithmVersion: string
658
+ readonly maximumItems: SafeInteger
659
+ readonly maximumBytes: SafeInteger
660
+ readonly nextChunkIndex: SafeInteger
661
+ readonly committedItems: SafeInteger
662
+ readonly committedPrefixDigest: string
663
+ readonly lastAttempt: BRegIngestionAttempt | null
664
+ readonly createdAt: string
665
+ readonly updatedAt: string
666
+ readonly complete: boolean
667
+ }
668
+
669
+ export interface BRegIngestionRunPage {
670
+ readonly runs: ReadonlyArray<BRegIngestionRun>
671
+ readonly hasMore: boolean
672
+ readonly nextAfter: string | null
673
+ }
674
+
675
+ export interface BRegIngestionReceiptBatch {
676
+ readonly snapshot: string
677
+ readonly results: ReadonlyArray<JsonObject>
678
+ }
679
+
680
+ export interface BRegIngestionChunkReceipt {
681
+ readonly chunkIndex: SafeInteger
682
+ readonly digest: string
683
+ readonly replayed: boolean
684
+ readonly erased: boolean
685
+ readonly batch: BRegIngestionReceiptBatch
686
+ }
687
+
688
+ export interface BRegIngestionChunkSubmission {
689
+ readonly run: BRegIngestionRun
690
+ readonly receipt: BRegIngestionChunkReceipt
691
+ }
692
+
693
+ /**
694
+ * One bounded, digest-bound chunk of an ingestion run. The chunk digest is
695
+ * derived in Rust from the exact canonical batch body the items hash to.
696
+ */
697
+ export declare class BRegIngestionChunk {
698
+ private constructor()
699
+ private readonly __opaque: void
700
+ readonly chunkIndex: SafeInteger
701
+ readonly itemCount: SafeInteger
702
+ readonly digest: string
703
+ readonly prefixDigest: string
704
+ }
705
+
706
+ /**
707
+ * Accumulate the raw source bytes of one ingestion input and derive the
708
+ * rolling prefix digest the run binds: the lowercase SHA-256 of everything
709
+ * absorbed through the end of the current chunk. The digest of an empty
710
+ * accumulation is `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`.
711
+ */
712
+ export declare class BRegIngestionPrefixDigest {
713
+ constructor()
714
+ update(data: Buffer): void
715
+ digest(): string
716
+ }
717
+
718
+ /**
719
+ * Encode one ingestion chunk submission: derive its digest in Rust and bind
720
+ * the announced prefix digest into the exact wire body. `items` are the same
721
+ * batch items the entity's atomic batch route executes.
722
+ */
723
+ export declare function encodeIngestionChunk(
724
+ chunkIndex: SafeInteger,
725
+ items: ReadonlyArray<BRegBatchItem>,
726
+ prefixDigest: string,
727
+ ): BRegIngestionChunk
728
+
595
729
  export interface BRegChangeRequestCapability {
596
730
  readonly planner: {
597
731
  readonly kind: 'declarative' | 'rhai'
@@ -612,17 +746,13 @@ export interface BRegChangeRequestCapability {
612
746
  readonly possibleWriteCount: SafeInteger | null
613
747
  readonly possibleWriteOperations: ReadonlyArray<string>
614
748
  }
615
- readonly reviewMode: 'none' | 'staged'
616
- readonly stages: ReadonlyArray<{
617
- readonly id: string
618
- readonly approvals: SafeInteger
619
- readonly excludeSubmitter: boolean
620
- readonly excludePreviousReviewers: boolean
621
- }> | null
749
+ readonly review: BRegRequestReviewRequirement
750
+ readonly onApproved: {
751
+ readonly mode: 'manual' | 'automatic'
752
+ readonly executor: string | null
753
+ }
622
754
  readonly application: {
623
- readonly mode: 'manual' | 'automatic' | 'planner'
624
- readonly allowedDispositions: ReadonlyArray<'apply' | 'queue'>
625
- readonly queueReasons: ReadonlyArray<{ readonly code: string; readonly label: string }>
755
+ readonly preconditions: JsonValue | null
626
756
  }
627
757
  }
628
758
 
@@ -715,18 +845,54 @@ export declare class BRegLifecycleAuthority {
715
845
  private readonly __opaque: void
716
846
  }
717
847
 
848
+ /** Inert caller-visible target provenance. It grants no read authority. */
849
+ export declare class BRegRequestResultReference {
850
+ private constructor()
851
+ private readonly __opaque: void
852
+ readonly targetEntityIdentifier: string
853
+ readonly targetRecordIdentifier: string
854
+ /** Revision written by the application, not a current ETag or precondition. */
855
+ readonly targetRevision: SafeInteger
856
+ toString(): string
857
+ }
858
+
859
+ /** One exact retained proposal from an explicitly loaded history page. */
860
+ export declare class BRegRetainedRequestProposalView {
861
+ private constructor()
862
+ private readonly __opaque: void
863
+ readonly requestEntityIdentifier: string
864
+ readonly requestIdentifier: string
865
+ readonly proposalVersion: SafeInteger
866
+ readonly bregState: BRegRequestState
867
+ readonly current: boolean
868
+ readonly detailErased: boolean
869
+ readonly applicationIdentifier: string | null
870
+ /** Caller-visible count, never an undisclosed application total. */
871
+ readonly resultLinkCount: SafeInteger
872
+ readonly resultReferences: ReadonlyArray<BRegRequestResultReference>
873
+ toString(): string
874
+ }
875
+
876
+ /** One page only. Call getRecord with its cursor to load another page. */
877
+ export declare class BRegRetainedRequestHistoryPage {
878
+ private constructor()
879
+ private readonly __opaque: void
880
+ readonly proposals: ReadonlyArray<BRegRetainedRequestProposalView>
881
+ readonly nextAfterProposalVersion: SafeInteger | null
882
+ findProposal(requestEntityIdentifier: string, requestIdentifier: string, proposalVersion: SafeInteger): BRegRetainedRequestProposalView | null
883
+ findApplication(requestEntityIdentifier: string, requestIdentifier: string, proposalVersion: SafeInteger, applicationIdentifier: string): BRegRetainedRequestProposalView | null
884
+ toString(): string
885
+ }
886
+
718
887
  /** Opaque executable action promoted from a metadata authority and one record. */
719
888
  export declare class BRegLifecycleAction {
720
889
  withReason(reason: string): BRegLifecycleAction
721
890
  private constructor()
722
891
  private readonly __opaque: void
723
892
  readonly operation: string
724
- readonly stage: string | null
725
893
  readonly href: string
726
894
  readonly bodyJson: string
727
- readonly reviewJson: string | null
728
895
  readonly body: JsonObject
729
- readonly review: LifecycleReview | null
730
896
  }
731
897
 
732
898
  /** Inert bounded Create evidence. Persist these bytes with owner-only access. */
@@ -839,9 +1005,17 @@ export declare class BaseRegistryClient {
839
1005
  patchRecord(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operations: ReadonlyArray<PatchOperation | RemovePatchOperation>, idempotencyKey: string, format?: RecordFormat | null): Promise<CompleteOutcome<RecordEnvelope>>
840
1006
  batchRecords(binding: BRegBatchBinding, request: BRegBatchInput, idempotencyKey: string): Promise<CompleteOutcome<BRegBatchReceipt>>
841
1007
  batchRecordsJson(binding: BRegBatchBinding, requestJson: string, idempotencyKey: string): Promise<JsonOutcome>
1008
+ createIngestionRun(entityRoute: string, request: BRegIngestionRunInput): Promise<CompleteOutcome<BRegIngestionRun>>
1009
+ listIngestionRuns(entityRoute: string, query?: BRegIngestionRunListInput | null): Promise<CompleteOutcome<BRegIngestionRunPage>>
1010
+ readIngestionRun(entityRoute: string, runId: string, accessProfile?: string | null): Promise<CompleteOutcome<BRegIngestionRun>>
1011
+ submitIngestionChunk(entityRoute: string, runId: string, chunk: BRegIngestionChunk, profileId: string): Promise<CompleteOutcome<BRegIngestionChunkSubmission>>
1012
+ cancelIngestionRun(entityRoute: string, runId: string, accessProfile?: string | null): Promise<CompleteOutcome<BRegIngestionRun>>
1013
+ ingestionChunkReceipt(entityRoute: string, runId: string, chunkIndex: SafeInteger, profileId: string): Promise<CompleteOutcome<BRegIngestionChunkReceipt>>
842
1014
  tombstoneRecord(binding: BRegTombstoneBinding, recordIdentifier: string, etag: string, idempotencyKey: string, format?: RecordFormat | null): Promise<CompleteOutcome<RecordEnvelope>>
843
1015
  tombstoneRecordJson(binding: BRegTombstoneBinding, recordIdentifier: string, etag: string, idempotencyKey: string, format?: RecordFormat | null): Promise<JsonOutcome>
844
1016
  lifecycleActions(authority: BRegLifecycleAuthority, record: RecordEnvelope, format?: RecordFormat | null): ReadonlyArray<BRegLifecycleAction>
1017
+ /** Pure typed projection of one already loaded page. Performs no I/O. */
1018
+ requestHistory(record: RecordEnvelope, format?: RecordFormat | null): BRegRetainedRequestHistoryPage | null
845
1019
  prepareLifecycleAction(authority: BRegLifecycleAuthority, record: RecordEnvelope, action: BRegLifecycleAction, idempotencyKey: string, format?: RecordFormat | null): BRegPreparedLifecycle
846
1020
  prepareLifecycleActionJson(authority: BRegLifecycleAuthority, recordJson: string, action: BRegLifecycleAction, idempotencyKey: string, format?: RecordFormat | null): BRegPreparedLifecycle
847
1021
  recoverLifecycleAction(authority: BRegLifecycleAuthority, prepared: BRegPreparedLifecycle): BRegRecoveredLifecycle
package/breg/client.js CHANGED
@@ -222,6 +222,8 @@ for (const [method, jsonIndexes, requiredIndexes] of [
222
222
  ['actionTargetConditionsJson'], ['invokeActionJson'], ['batchRecordsJson'], ['tombstoneRecordJson'],
223
223
  ['executeRecoveredCreateJson'], ['executeRecoveredLifecycleActionJson'],
224
224
  ['uploadAttachmentJson'], ['deleteAttachmentJson'],
225
+ ['createIngestionRun', [1], [1]], ['listIngestionRuns', [1]],
226
+ ['readIngestionRun'], ['submitIngestionChunk'], ['cancelIngestionRun'],
225
227
  ]) wrapAsync(method, jsonIndexes, requiredIndexes);
226
228
 
227
229
  for (const [method, jsonIndexes, requiredIndexes] of [
@@ -302,6 +304,32 @@ native.BaseRegistryClient.prototype.lifecycleActions = function (...args) {
302
304
  }
303
305
  };
304
306
 
307
+ const requestHistory = native.BaseRegistryClient.prototype.requestHistory;
308
+ native.BaseRegistryClient.prototype.requestHistory = function (...args) {
309
+ try {
310
+ const sanitized = sanitizeArguments(args, new Set([0]), new Set([0]));
311
+ return requestHistory.apply(this, sanitized);
312
+ } catch (error) {
313
+ throw normalize(error, 'invalid_request');
314
+ }
315
+ };
316
+
317
+ for (const name of ['findProposal', 'findApplication']) {
318
+ const original = native.RetainedRequestHistoryPage.prototype[name];
319
+ native.RetainedRequestHistoryPage.prototype[name] = function (...args) {
320
+ try {
321
+ const proposalVersion = args[2];
322
+ if (!Number.isSafeInteger(proposalVersion)
323
+ || proposalVersion < 1 || proposalVersion > 0xffff_ffff) {
324
+ throw inputError('invalid_request');
325
+ }
326
+ return original.apply(this, args);
327
+ } catch (error) {
328
+ throw normalize(error, 'invalid_request');
329
+ }
330
+ };
331
+ }
332
+
305
333
  const valueIn = native.BRegAttachmentSlot.prototype.valueIn;
306
334
  native.BRegAttachmentSlot.prototype.valueIn = function (...args) {
307
335
  try {
@@ -336,6 +364,42 @@ for (const name of [
336
364
  };
337
365
  }
338
366
 
367
+ function encodeIngestionChunk(chunkIndex, items, prefixDigest) {
368
+ try {
369
+ if (!Number.isSafeInteger(chunkIndex)) throw inputError('invalid_request');
370
+ const sanitized = sanitizeArguments(
371
+ [chunkIndex, items, prefixDigest], new Set([1]), new Set([1]),
372
+ );
373
+ return native.encodeIngestionChunk(...sanitized);
374
+ } catch (error) {
375
+ throw normalize(error, 'invalid_request');
376
+ }
377
+ }
378
+
379
+ // napi truncates a fractional JavaScript number into the i64 chunk index, so
380
+ // the exact chunk-bound protocol checks integrality before it reaches Rust.
381
+ const ingestionChunkReceipt = native.BaseRegistryClient.prototype.ingestionChunkReceipt;
382
+ native.BaseRegistryClient.prototype.ingestionChunkReceipt = function (...args) {
383
+ try {
384
+ if (!Number.isSafeInteger(args[2])) throw inputError('invalid_request');
385
+ return ingestionChunkReceipt.apply(this, args).catch((error) => { throw normalize(error); });
386
+ } catch (error) {
387
+ throw normalize(error, 'invalid_request');
388
+ }
389
+ };
390
+
391
+ const ingestionPrefixDigestUpdate = native.BRegIngestionPrefixDigest.prototype.update;
392
+ native.BRegIngestionPrefixDigest.prototype.update = function (data) {
393
+ try {
394
+ if (!Buffer.isBuffer(data) || isSharedArrayBuffer(data.buffer)) {
395
+ throw inputError('invalid_request');
396
+ }
397
+ return ingestionPrefixDigestUpdate.call(this, data);
398
+ } catch (error) {
399
+ throw normalize(error, 'invalid_request');
400
+ }
401
+ };
402
+
339
403
  class BaseRegistryClient extends native.BaseRegistryClient {
340
404
  constructor(config) {
341
405
  try {
@@ -372,6 +436,9 @@ module.exports = {
372
436
  BRegPatchBinding: native.BRegPatchBinding,
373
437
  BRegLifecycleAuthority: native.BRegLifecycleAuthority,
374
438
  BRegLifecycleAction: native.BRegLifecycleAction,
439
+ BRegRequestResultReference: native.RequestResultReference,
440
+ BRegRetainedRequestProposalView: native.RetainedRequestProposal,
441
+ BRegRetainedRequestHistoryPage: native.RetainedRequestHistoryPage,
375
442
  BRegAttachmentSlot: native.BRegAttachmentSlot,
376
443
  BRegAttachmentUpload: native.BRegAttachmentUpload,
377
444
  BRegImmediateActionBinding: native.BRegImmediateActionBinding,
@@ -382,4 +449,7 @@ module.exports = {
382
449
  BRegPreparedLifecycle,
383
450
  BRegRecoveredCreate: native.BRegRecoveredCreate,
384
451
  BRegRecoveredLifecycle: native.BRegRecoveredLifecycle,
452
+ BRegIngestionChunk: native.BRegIngestionChunk,
453
+ BRegIngestionPrefixDigest: native.BRegIngestionPrefixDigest,
454
+ encodeIngestionChunk,
385
455
  };
package/breg/index.d.ts CHANGED
@@ -41,6 +41,30 @@ export declare class BaseRegistryClient {
41
41
  patchRecord(binding: BRegPatchBinding, recordIdentifier: string, etag: string, operations: any, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
42
42
  /** Execute one metadata-selected atomic batch without automatic retry. */
43
43
  batchRecords(binding: BRegBatchBinding, request: any, idempotencyKey: string): Promise<CompleteOutcome>
44
+ /**
45
+ * Announce one whole input and open a durable ingestion run for it. The
46
+ * run request names the access profile, which the client selects for the
47
+ * exchange.
48
+ */
49
+ createIngestionRun(entityRoute: string, request: any): Promise<CompleteOutcome>
50
+ /** Read one bounded page of ingestion runs for one entity route. */
51
+ listIngestionRuns(entityRoute: string, query?: any | undefined | null): Promise<CompleteOutcome>
52
+ /** Read the current durable state of one ingestion run. */
53
+ readIngestionRun(entityRoute: string, runId: string, accessProfile?: string | undefined | null): Promise<CompleteOutcome>
54
+ /**
55
+ * Submit one bounded chunk of an open ingestion run under the run's
56
+ * access profile. A resubmitted chunk replays its retained receipt
57
+ * instead of executing twice.
58
+ */
59
+ submitIngestionChunk(entityRoute: string, runId: string, chunk: BRegIngestionChunk, profileId: string): Promise<CompleteOutcome>
60
+ /** Cancel an open ingestion run. Committed chunks stay committed. */
61
+ cancelIngestionRun(entityRoute: string, runId: string, accessProfile?: string | undefined | null): Promise<CompleteOutcome>
62
+ /**
63
+ * Read the retained receipt of one committed chunk under the run's
64
+ * access profile. An erased receipt answers with the
65
+ * `ingestion.receipt_erased` problem instead.
66
+ */
67
+ ingestionChunkReceipt(entityRoute: string, runId: string, chunkIndex: number, profileId: string): Promise<CompleteOutcome>
44
68
  /** Tombstone one record against its current strong ETag. */
45
69
  tombstoneRecord(binding: BRegTombstoneBinding, recordIdentifier: string, etag: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
46
70
  /**
@@ -53,6 +77,11 @@ export declare class BaseRegistryClient {
53
77
  /** Empty one governed attachment slot. */
54
78
  deleteAttachment(slot: BRegAttachmentSlot, recordIdentifier: string, etag: string, idempotencyKey: string, formatValue?: string | undefined | null): Promise<CompleteOutcome>
55
79
  lifecycleActions(authority: BRegLifecycleAuthority, record: any, formatValue?: string | undefined | null): Array<BRegLifecycleAction>
80
+ /**
81
+ * Decode one already loaded record's retained request-history page.
82
+ * This performs no I/O and does not advance the returned continuation.
83
+ */
84
+ requestHistory(record: any, formatValue?: string | undefined | null): RetainedRequestHistoryPage | null
56
85
  executeLifecycleAction(action: BRegLifecycleAction, idempotencyKey: string): Promise<CompleteOutcome>
57
86
  /** Prepare inert lifecycle evidence before any token acquisition or I/O. */
58
87
  prepareLifecycleAction(authority: BRegLifecycleAuthority, record: any, action: BRegLifecycleAction, idempotencyKey: string, formatValue?: string | undefined | null): BRegPreparedLifecycle
@@ -151,15 +180,42 @@ export declare class BRegImmediateActionBinding {
151
180
  }
152
181
  export type ImmediateActionBinding = BRegImmediateActionBinding
153
182
 
183
+ /**
184
+ * One bounded, digest-bound chunk of an ingestion run. The chunk digest is
185
+ * derived in Rust from the exact canonical batch body the items hash to.
186
+ */
187
+ export declare class BRegIngestionChunk {
188
+ get chunkIndex(): number
189
+ get itemCount(): number
190
+ /** The derived lowercase SHA-256 of the chunk's canonical batch body. */
191
+ get digest(): string
192
+ get prefixDigest(): string
193
+ }
194
+ export type IngestionChunk = BRegIngestionChunk
195
+
196
+ /**
197
+ * Accumulate the raw source bytes of one ingestion input and derive the
198
+ * prefix digest the run binds: the lowercase SHA-256 of everything absorbed
199
+ * through the end of the current chunk. The digest of an empty accumulation
200
+ * is `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`.
201
+ * The digest is never a chain over chunk digests: the server stores it as an
202
+ * opaque value and cannot re-derive the raw bytes.
203
+ */
204
+ export declare class BRegIngestionPrefixDigest {
205
+ constructor()
206
+ /** Absorb the next raw source bytes, typically one chunk's source extent. */
207
+ update(data: Buffer): void
208
+ /** The lowercase SHA-256 of every raw source byte absorbed so far. */
209
+ digest(): string
210
+ }
211
+ export type IngestionPrefixDigest = BRegIngestionPrefixDigest
212
+
154
213
  export declare class BRegLifecycleAction {
155
214
  withReason(reason: string): BRegLifecycleAction
156
215
  get bodyJson(): string
157
- get reviewJson(): string | null
158
216
  get operation(): string
159
- get stage(): string | null
160
217
  get href(): string
161
218
  get body(): any
162
- get review(): any | null
163
219
  }
164
220
  export type LifecycleAction = BRegLifecycleAction
165
221
 
@@ -252,6 +308,37 @@ export declare class PrivateKeyJwt {
252
308
  }
253
309
  export type PrivateKeyJwtBinding = PrivateKeyJwt
254
310
 
311
+ /** One inert caller-visible target written by an applied request. */
312
+ export declare class RequestResultReference {
313
+ get targetEntityIdentifier(): string
314
+ get targetRecordIdentifier(): string
315
+ get targetRevision(): number
316
+ toString(): string
317
+ }
318
+
319
+ /** One explicitly loaded retained request-history page. */
320
+ export declare class RetainedRequestHistoryPage {
321
+ get proposals(): Array<RetainedRequestProposal>
322
+ get nextAfterProposalVersion(): number | null
323
+ findProposal(requestEntityIdentifier: string, requestIdentifier: string, proposalVersion: number): RetainedRequestProposal | null
324
+ findApplication(requestEntityIdentifier: string, requestIdentifier: string, proposalVersion: number, applicationIdentifier: string): RetainedRequestProposal | null
325
+ toString(): string
326
+ }
327
+
328
+ /** One exact retained proposal in an explicitly loaded history page. */
329
+ export declare class RetainedRequestProposal {
330
+ get requestEntityIdentifier(): string
331
+ get requestIdentifier(): string
332
+ get proposalVersion(): number
333
+ get bregState(): string
334
+ get current(): boolean
335
+ get detailErased(): boolean
336
+ get applicationIdentifier(): string | null
337
+ get resultLinkCount(): number
338
+ get resultReferences(): Array<RequestResultReference>
339
+ toString(): string
340
+ }
341
+
255
342
  export interface CompleteOutcome {
256
343
  kind: string
257
344
  value: any
@@ -260,6 +347,15 @@ export interface CompleteOutcome {
260
347
  location?: string
261
348
  }
262
349
 
350
+ /**
351
+ * Encode one ingestion chunk submission: derive its digest in Rust and bind
352
+ * the announced prefix digest into the exact wire body. `items` are the same
353
+ * batch items the entity's atomic batch route executes; `prefixDigest` is the
354
+ * lowercase SHA-256 of the complete raw source input through the end of this
355
+ * chunk, which `BRegIngestionPrefixDigest` accumulates.
356
+ */
357
+ export declare function encodeIngestionChunk(chunkIndex: number, items: any, prefixDigest: string): BRegIngestionChunk
358
+
263
359
  /** Validated product result serialized before the JavaScript number boundary. */
264
360
  export interface JsonOutcome {
265
361
  kind: string
@@ -1,4 +1,7 @@
1
+ /** An integer for which `Number.isSafeInteger` is true. */
1
2
  export type SafeInteger = number
3
+ /** A string validated as an RFC 9562 UUID by the native binding. */
4
+ export type Uuid = string
2
5
  export type JsonScalar = string | number | boolean | null
3
6
  export type JsonValue = JsonScalar | ReadonlyArray<JsonValue> | { readonly [key: string]: JsonValue }
4
7
  export type JsonObject = { readonly [key: string]: JsonValue }
@@ -13,7 +16,7 @@ export interface CaseworkClientConfig {
13
16
  }
14
17
 
15
18
  export type InboxView = 'mine' | 'my_teams' | 'team_holdings' | 'overdue' | 'completed_by_me'
16
- export type OccurrenceKind = 'review' | 'application' | 'hosted'
19
+ export type OccurrenceKind = 'review' | 'application'
17
20
  export type OccurrenceState = 'open' | 'claimed' | 'waiting_applicant' | 'waiting_application' | 'synchronizing' | 'completed' | 'superseded' | 'cancelled'
18
21
  export type OperationName = string
19
22
  export type AttemptState = 'pending' | 'uncertain' | 'completed' | 'refused'
@@ -21,8 +24,9 @@ export type PageStatus = 'complete' | 'budget_exhausted' | 'source_unavailable'
21
24
  export type HistoryKind = 'observed' | 'opened' | 'claimed' | 'assigned' | 'delegated' | 'caseload_moved' | 'clock_reminder' | 'clock_step_applied' | 'clock_recomputed' | 'released' | 'draft_saved' | 'attempt_reserved' | 'attempt_uncertain' | 'action_completed' | 'attempt_settled' | 'superseded' | 'completed'
22
25
 
23
26
  export interface IssuerPrincipal { issuer: string; subject: string }
24
- export type TaskGrantBounds = { type: 'evidence'; requirement: string } | { type: 'breg'; permissions: ReadonlyArray<TaskPermission> }
27
+ export type TaskGrantBounds = { type: 'evidence'; requirement: string } | { type: 'breg'; permissions: ReadonlyArray<TaskPermission> } | { type: 'scheduling'; permissions: ReadonlyArray<SchedulingTaskPermission> }
25
28
  export interface TaskPermission { collection: string; operations: ReadonlyArray<string> }
29
+ export interface SchedulingTaskPermission { service: string; location: string; actions: ReadonlyArray<string> }
26
30
  export interface EvidenceRequesterContext { requesterTags: ReadonlyArray<string>; audience: string }
27
31
  export interface TaskApprovalRequest { templateId: string; templateVersion: string }
28
32
  export interface TaskTemplatePreview {
@@ -84,7 +88,6 @@ export interface WorkItem {
84
88
  updatedAt: string
85
89
  actions: ReadonlyArray<CaseworkAction>
86
90
  routingCopy?: CorrectionRoutingCopy
87
- hosted?: HostedWorkItemContext
88
91
  routing?: WorkItemRouting
89
92
  clockOccurrences?: ReadonlyArray<ClockOccurrenceView>
90
93
  liveAttempt?: AttemptStatus
@@ -213,85 +216,6 @@ export interface SourcePolicy {
213
216
  description: string
214
217
  requests: ReadonlyArray<SourceRequestPolicy>
215
218
  }
216
- export interface HostedRetentionPolicy { terminalDays: SafeInteger; accountabilityDays: SafeInteger }
217
- export interface HostedOutcomePolicy { id: string; label: string; reasonRequired: boolean }
218
- export interface HostedKindPolicy {
219
- id: string
220
- version: string
221
- queue: string
222
- decidingProfiles: ReadonlyArray<string>
223
- retention: HostedRetentionPolicy
224
- displaySchema: JsonValue
225
- outcomes: ReadonlyArray<HostedOutcomePolicy>
226
- }
227
- export interface HostedWorkItemContext {
228
- requesterReference: string
229
- kind: string
230
- version: string
231
- display: JsonValue
232
- kindPolicyDigest: string
233
- outcomes: ReadonlyArray<HostedOutcomePolicy>
234
- }
235
- export interface HostedCreateRequest { kind: string; requesterReference: string; display: JsonValue }
236
- export interface HostedNoteRequest { note: string }
237
- export interface HostedCancelRequest { reason: string }
238
- export interface HostedDecisionRequest { outcome: string; reason?: string }
239
- export interface RequesterHostedItem {
240
- itemId: string
241
- requesterReference: string
242
- kind: string
243
- version: string
244
- display: JsonValue
245
- state: OccurrenceState
246
- revision: SafeInteger
247
- kindPolicyDigest: string
248
- createdAt: string
249
- updatedAt: string
250
- }
251
- export type HostedTerminalResult = {
252
- itemId: string
253
- eventId: string
254
- requesterReference: string
255
- kindPolicyDigest: string
256
- terminalAt: string
257
- } & (
258
- | { state: 'completed'; outcome: string; actorRef: string }
259
- | { state: 'cancelled'; cancellationReason: string }
260
- )
261
- export interface HostedTerminalQuery { cursor?: string; limit?: SafeInteger }
262
- export interface HostedPageQuery { cursor?: string; limit?: SafeInteger }
263
- export interface HostedNote {
264
- noteId: string
265
- itemId: string
266
- note: string
267
- itemRevision: SafeInteger
268
- recordedAt: string
269
- }
270
- export type HostedHistoryKind = 'created' | 'claimed' | 'assigned' | 'delegated' | 'caseload_moved' | 'released' | 'note_added' | 'completed' | 'cancelled'
271
- export interface HostedHistoryEntry {
272
- eventId: string
273
- itemId: string
274
- itemRevision: SafeInteger
275
- kind: HostedHistoryKind
276
- occurredAt: string
277
- actorRef?: string
278
- assignment?: AssignmentContext
279
- note?: string
280
- outcome?: string
281
- reason?: string
282
- cancellationReason?: string
283
- }
284
- export interface HostedAccountabilityRecord {
285
- itemId: string
286
- eventId: string
287
- actorRef: string
288
- actor: IssuerPrincipal
289
- profileId: string
290
- outcome: string
291
- reason?: string
292
- recordedAt: string
293
- retainedUntil: string
294
- }
295
219
  export interface Description {
296
220
  projectId: string
297
221
  policyVersion: string
@@ -299,7 +223,6 @@ export interface Description {
299
223
  sources: ReadonlyArray<SourcePolicy>
300
224
  calendars: ReadonlyArray<CalendarPolicy>
301
225
  clocks: ReadonlyArray<ClockPolicy>
302
- hostedKinds: ReadonlyArray<HostedKindPolicy>
303
226
  }
304
227
  export interface TeamRecord {
305
228
  id: string
@@ -354,6 +277,9 @@ export type KnownCaseworkProblemCode =
354
277
  | 'request.source-rejected'
355
278
  | 'request.unprocessable'
356
279
  | 'request.unsupported-media-type'
280
+ | 'review.result-expired'
281
+ | 'review.submission-conflict'
282
+ | 'review.task-not-held'
357
283
  | 'runtime.failure'
358
284
  | 'service.unavailable'
359
285
  | 'source-profile.not-applicable'
@@ -372,6 +298,7 @@ export type KnownCaseworkProblemCode =
372
298
  | 'work-item.source-unavailable'
373
299
  | 'work-item.superseded'
374
300
  export type CaseworkProblemCode = KnownCaseworkProblemCode | (string & {})
301
+ export type CaseworkProtocolFailure = 'header_bounds' | 'trace_context' | 'media_type' | 'body' | 'problem' | 'status' | 'protocol'
375
302
 
376
303
  export class CaseworkClientError extends Error {
377
304
  readonly kind: 'configuration' | 'invalid_request' | 'transport' | 'problem' | 'protocol'
@@ -382,10 +309,10 @@ export class CaseworkClientError extends Error {
382
309
  readonly originalAttemptId?: string
383
310
  readonly validation?: {
384
311
  readonly path: string
385
- readonly reason: 'kind_not_allowed' | 'reference_invalid' | 'object_required' | 'maximum_bytes_exceeded' | 'maximum_depth_exceeded' | 'schema_mismatch' | 'outcome_not_declared' | 'reason_required' | 'text_invalid'
312
+ readonly reason: 'kind_not_allowed' | 'reference_invalid' | 'object_required' | 'maximum_bytes_exceeded' | 'maximum_depth_exceeded' | 'schema_mismatch' | 'outcome_not_declared' | 'reason_required' | 'text_invalid' | 'result_not_declared' | 'result_required' | 'field_not_declared' | 'constraint_invalid' | 'constraint_violated'
386
313
  }
387
314
  readonly transportKind?: string
388
- readonly protocolFailure?: string
315
+ readonly protocolFailure?: CaseworkProtocolFailure
389
316
  }
390
317
 
391
318
  export type ClockRuntimeState = 'running' | 'paused' | 'completed' | 'cancelled' | 'verification_pending' | 'source_facts_missing'
@@ -416,22 +343,156 @@ export interface ClockRecomputePreview { previewId: string; clockId: string; hol
416
343
  export interface ClockRecomputeApplyRequest { previewId: string }
417
344
  export interface ClockRecomputeResult { previewId: string; appliedOccurrences: ReadonlyArray<string> }
418
345
 
346
+ export type ContentDigest = `sha256:${string}`
347
+ export interface ReviewSubjectBinding { source: string; type: string; id: string; version: string; digest: ContentDigest }
348
+ export interface ReviewPolicyBinding { id: string; version: string; digest: ContentDigest }
349
+ export interface HumanIdentity { issuer: string; subject: string }
350
+ export type ReviewContext =
351
+ | { strategy: 'submitted'; snapshot: Readonly<Record<string, JsonValue>> }
352
+ | { strategy: 'source'; binding: { reference: string } }
353
+ export interface ReviewCreateRequest {
354
+ kind: string
355
+ subject: ReviewSubjectBinding
356
+ requesterReference: string
357
+ initiator?: HumanIdentity
358
+ context: ReviewContext
359
+ resultConstraints?: JsonObject | null
360
+ }
361
+ export interface ReviewRequestAccepted {
362
+ requestId: Uuid
363
+ subject: ReviewSubjectBinding
364
+ policy: ReviewPolicyBinding
365
+ submissionDigest: ContentDigest
366
+ }
367
+ export type ReviewRequestLifecycle = 'reviewing' | 'approved' | 'rejected' | 'changes_requested' | 'answered' | 'cancelled' | 'superseded'
368
+ export interface ReviewRequestView extends ReviewRequestAccepted {
369
+ requesterReference: string
370
+ lifecycle: ReviewRequestLifecycle
371
+ activeStage?: string
372
+ createdAt: string
373
+ updatedAt: string
374
+ }
375
+ export type ReviewResultStatus = 'approved' | 'rejected' | 'changes_requested' | 'answered' | 'cancelled' | 'superseded'
376
+ export interface ReviewResult extends ReviewRequestAccepted {
377
+ resultId: Uuid
378
+ status: ReviewResultStatus
379
+ outcome?: string
380
+ result?: JsonObject
381
+ completedAt: string
382
+ availableUntil: string
383
+ }
384
+ export type ReviewResultOutcome =
385
+ | { kind: 'available'; value: ReviewResult; traceId: string }
386
+ | { kind: 'pending' | 'concealed_or_unknown' | 'expired'; value: null; traceId: string }
387
+ export interface ReviewResultFeedEntry { eventId: Uuid; requestId: Uuid; resultId: Uuid; completedAt: string }
388
+ export interface ReviewResultFeedPage { items: ReadonlyArray<ReviewResultFeedEntry>; nextCursor?: Uuid }
389
+ export interface ReviewCancelRequest { subject: ReviewSubjectBinding; reason: string }
390
+ export type ReviewCancelResponse =
391
+ | { outcome: 'cancelled'; result: ReviewResult }
392
+ | { outcome: 'already_terminal'; result: ReviewResult }
393
+ export interface ReviewPageQuery { cursor?: Uuid; limit?: SafeInteger }
394
+ export interface ReviewTaskQuery extends ReviewPageQuery { queue?: string }
395
+ export interface WorkItemHistoryQuery { cursor?: string; limit?: SafeInteger }
396
+ export type ReviewerTaskState = 'open' | { held: { holder: IssuerPrincipal } } | 'decided'
397
+ export interface ReviewerTask {
398
+ taskId: Uuid
399
+ requestId: Uuid
400
+ stageIndex: SafeInteger
401
+ stageId: string
402
+ queue: string
403
+ revision: SafeInteger
404
+ eligibleProfiles: ReadonlyArray<string>
405
+ state: ReviewerTaskState
406
+ }
407
+ export interface ReviewTaskPage { items: ReadonlyArray<ReviewerTask>; nextCursor?: Uuid }
408
+ export type ReviewSourceBindingStatus = 'current' | 'binding_changed'
409
+ export interface ReviewSourceProjection { binding: SourceBinding; displayReference?: string; display: Readonly<Record<string, JsonValue>> }
410
+ export type ReviewTaskContextData =
411
+ | { strategy: 'submitted'; snapshot: Readonly<Record<string, JsonValue>> }
412
+ | { strategy: 'source'; reference: string; bindingStatus: ReviewSourceBindingStatus; projection?: ReviewSourceProjection }
413
+ export interface ReviewTaskContext {
414
+ taskId: Uuid
415
+ requestId: Uuid
416
+ subject: ReviewSubjectBinding
417
+ requesterReference: string
418
+ policy: ReviewPolicyBinding
419
+ policySnapshot: ReviewKindPolicySnapshot
420
+ resultConstraints?: JsonObject
421
+ context: ReviewTaskContextData
422
+ }
423
+ export type ReviewClockCorrelation =
424
+ | { scope: 'subject'; source: string; subjectType: string; id: string }
425
+ | { scope: 'activity'; taskId: Uuid; stageId: string }
426
+ export interface ReviewClockOccurrence {
427
+ clockOccurrenceId: Uuid
428
+ clockId: string
429
+ requestId: Uuid
430
+ correlation: ReviewClockCorrelation
431
+ state: 'running' | 'paused' | 'completed' | 'cancelled' | 'source_facts_missing'
432
+ policyDigest: ContentDigest
433
+ anchorAt: string
434
+ dueAt?: string
435
+ atRiskAt?: string
436
+ completedAt?: string
437
+ }
438
+ export interface ReviewTaskDraftInput { body: JsonValue }
439
+ export interface ReviewTaskDraft { taskId: Uuid; author: IssuerPrincipal; body: JsonValue; revision: SafeInteger; updatedAt: string }
440
+ export type ReviewerDecision =
441
+ | { type: 'approve' }
442
+ | { type: 'reject' | 'changes_requested' | 'answer'; outcome: string; reason?: string | null; result?: JsonObject | null }
443
+ export interface ReviewTaskDecisionRequest { decision: ReviewerDecision }
444
+ export type ReviewHistoryAudience = 'reviewers' | 'requester'
445
+ export interface ReviewNoteRequest { audience: ReviewHistoryAudience; note: string }
446
+ export interface ReviewHistoryEntry { eventId: Uuid; requestId: Uuid; taskId?: Uuid; kind: string; actorRef?: string; detail: JsonValue; occurredAt: string }
447
+ export interface ReviewHistoryPage { items: ReadonlyArray<ReviewHistoryEntry>; nextCursor?: Uuid }
448
+ export interface ReviewAccountabilityRecord {
449
+ eventId: Uuid; requestId: Uuid; taskId: Uuid; actorRef: string; actor: IssuerPrincipal
450
+ profileId: string; decision: string; privateReason?: string; resultDigest?: string
451
+ occurredAt: string; retainedUntil: string
452
+ }
453
+ export interface ReviewStagePolicy { id: string; queue: string; decidingProfiles: ReadonlyArray<string>; requiredApprovals: SafeInteger; excludeInitiator?: boolean; excludePreviousStageReviewers?: boolean }
454
+ export interface ReviewRetentionPolicy { terminalDays: SafeInteger; accountabilityDays: SafeInteger }
455
+ export interface ReviewKindPolicySnapshot {
456
+ identity: ReviewPolicyBinding
457
+ purpose: 'approval' | 'answer'
458
+ contextStrategy: 'submitted' | 'source'
459
+ stages: ReadonlyArray<ReviewStagePolicy>
460
+ clocks?: ReadonlyArray<string>
461
+ retention: ReviewRetentionPolicy
462
+ displaySchema: JsonValue
463
+ resultSchema?: JsonValue
464
+ outcomes?: ReadonlyArray<{ id: string; label: string; settlement: 'rejected' | 'changes_requested' | 'answered'; reasonRequired: boolean; resultRequired?: boolean }>
465
+ }
466
+
419
467
  export class CaseworkClient {
420
468
  constructor(config: CaseworkClientConfig)
421
469
  description(token: string, profile: string): Promise<CaseworkOutcome<Description>>
422
- createHostedItem(token: string, profile: string, idempotencyKey: string, request: HostedCreateRequest): Promise<CaseworkOutcome<RequesterHostedItem>>
423
- getHostedItem(token: string, profile: string, itemId: string): Promise<CaseworkOutcome<RequesterHostedItem>>
424
- addHostedNote(token: string, profile: string, itemId: string, expectedRevision: SafeInteger, idempotencyKey: string, note: HostedNoteRequest): Promise<CaseworkOutcome<RequesterHostedItem>>
425
- requesterHostedNotes(token: string, profile: string, itemId: string, query?: HostedPageQuery | null): Promise<CaseworkOutcome<Page<HostedNote>>>
426
- cancelHostedItem(token: string, profile: string, itemId: string, expectedRevision: SafeInteger, idempotencyKey: string, cancellation: HostedCancelRequest): Promise<CaseworkOutcome<HostedTerminalResult>>
427
- hostedTerminalItems(token: string, profile: string, query?: HostedTerminalQuery | null): Promise<CaseworkOutcome<Page<HostedTerminalResult>>>
428
- listHostedWorkItems(token: string, profile: string, query: ListWorkItemsQuery): Promise<CaseworkOutcome<WorkItemPage>>
429
- getHostedWorkItem(token: string, profile: string, itemId: string): Promise<CaseworkOutcome<WorkItem>>
430
- hostedWorkItemHistory(token: string, profile: string, itemId: string, query?: HostedPageQuery | null): Promise<CaseworkOutcome<Page<HostedHistoryEntry>>>
431
- hostedAccountabilityRecord(token: string, profile: string, eventId: string): Promise<CaseworkOutcome<HostedAccountabilityRecord>>
432
- claimHostedWorkItem(token: string, profile: string, action: CaseworkAction, idempotencyKey: string): Promise<CaseworkOutcome<MutationResponse>>
433
- releaseHostedWorkItem(token: string, profile: string, action: CaseworkAction, idempotencyKey: string): Promise<CaseworkOutcome<MutationResponse>>
434
- decideHostedWorkItem(token: string, profile: string, action: CaseworkAction, idempotencyKey: string, decision: HostedDecisionRequest): Promise<CaseworkOutcome<HostedTerminalResult>>
470
+ createOrRecoverReviewRequest(token: string, profile: string, idempotencyKey: string, request: ReviewCreateRequest, expectedSubmissionDigest: ContentDigest): Promise<CaseworkOutcome<ReviewRequestAccepted>>
471
+ reviewRequest(token: string, profile: string, requestId: Uuid): Promise<CaseworkOutcome<ReviewRequestView>>
472
+ reviewResult(token: string, profile: string, accepted: ReviewRequestAccepted): Promise<ReviewResultOutcome>
473
+ reviewResults(token: string, profile: string, query?: ReviewPageQuery | null): Promise<CaseworkOutcome<ReviewResultFeedPage>>
474
+ cancelReviewRequest(token: string, profile: string, accepted: ReviewRequestAccepted, idempotencyKey: string, request: ReviewCancelRequest): Promise<CaseworkOutcome<ReviewCancelResponse>>
475
+ reviewKinds(token: string, profile: string): Promise<CaseworkOutcome<ReadonlyArray<ReviewKindPolicySnapshot>>>
476
+ reviewKind(token: string, profile: string, kindId: string): Promise<CaseworkOutcome<ReviewKindPolicySnapshot>>
477
+ reviewTasks(token: string, profile: string, query?: ReviewTaskQuery | null, sourceProfile?: string | null): Promise<CaseworkOutcome<ReviewTaskPage>>
478
+ reviewTask(token: string, profile: string, taskId: Uuid, sourceProfile?: string | null): Promise<CaseworkOutcome<ReviewerTask>>
479
+ reviewTaskContext(token: string, profile: string, taskId: Uuid, sourceProfile?: string | null): Promise<CaseworkOutcome<ReviewTaskContext>>
480
+ previewReviewTaskTemplates(token: string, profile: string, sourceProfile: string, taskId: Uuid): Promise<CaseworkOutcome<TaskTemplatePreviews>>
481
+ listReviewTaskGrants(token: string, profile: string, sourceProfile: string, taskId: Uuid): Promise<CaseworkOutcome<TaskGrantList>>
482
+ approveReviewTaskGrant(token: string, profile: string, sourceProfile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, approval: TaskApprovalRequest): Promise<CaseworkOutcome<TaskGrantView>>
483
+ revokeReviewTaskGrant(token: string, profile: string, taskId: Uuid, grantId: string): Promise<CaseworkOutcome<TaskGrantRevocation>>
484
+ claimReviewTask(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, sourceProfile?: string | null): Promise<CaseworkOutcome<ReviewerTask>>
485
+ releaseReviewTask(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string): Promise<CaseworkOutcome<ReviewerTask>>
486
+ assignReviewTask(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, request: AssignmentRequest, sourceProfile?: string): Promise<CaseworkOutcome<ReviewerTask>>
487
+ delegateReviewTask(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, request: DelegateRequest, sourceProfile?: string): Promise<CaseworkOutcome<ReviewerTask>>
488
+ reviewTaskDraft(token: string, profile: string, taskId: Uuid, sourceProfile?: string): Promise<CaseworkOutcome<ReviewTaskDraft | null>>
489
+ saveReviewTaskDraft(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, draft: ReviewTaskDraftInput, sourceProfile?: string): Promise<CaseworkOutcome<ReviewTaskDraft>>
490
+ deleteReviewTaskDraft(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, sourceProfile?: string): Promise<CaseworkOutcome<null>>
491
+ decideReviewTask(token: string, profile: string, taskId: Uuid, expectedRevision: SafeInteger, idempotencyKey: string, decision: ReviewTaskDecisionRequest, sourceProfile?: string | null): Promise<CaseworkOutcome<null>>
492
+ reviewHistory(token: string, profile: string, requestId: Uuid, query?: ReviewPageQuery | null, sourceProfile?: string | null): Promise<CaseworkOutcome<ReviewHistoryPage>>
493
+ addReviewNote(token: string, profile: string, requestId: Uuid, idempotencyKey: string, note: ReviewNoteRequest, sourceProfile?: string | null): Promise<CaseworkOutcome<ReviewHistoryEntry>>
494
+ reviewClocks(token: string, profile: string, requestId: Uuid, sourceProfile?: string | null): Promise<CaseworkOutcome<ReadonlyArray<ReviewClockOccurrence>>>
495
+ reviewAccountability(token: string, profile: string, eventId: Uuid): Promise<CaseworkOutcome<ReviewAccountabilityRecord>>
435
496
  listWorkItems(token: string, profile: string, sourceProfile: string, query: ListWorkItemsQuery): Promise<CaseworkOutcome<WorkItemPage>>
436
497
  nextWorkItem(token: string, profile: string, sourceProfile: string, query?: NextWorkItemQuery | null): Promise<CaseworkOutcome<WorkItemPage>>
437
498
  getWorkItem(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome<WorkItem>>
@@ -451,7 +512,7 @@ export class CaseworkClient {
451
512
  decideWorkItem(token: string, profile: string, sourceProfile: string, action: CaseworkAction, idempotencyKey: string, decision: DecideRequest): Promise<CaseworkOutcome<MutationResponse>>
452
513
  recoverDecision(token: string, profile: string, sourceProfile: string, itemId: string, attemptId: string, recovery: RecoverAttemptRequest): Promise<CaseworkOutcome<MutationResponse>>
453
514
  recoverDecisionByKey(token: string, profile: string, sourceProfile: string, itemId: string, idempotencyKey: string, recovery: RecoverAttemptRequest): Promise<CaseworkOutcome<MutationResponse>>
454
- workItemHistory(token: string, profile: string, sourceProfile: string, itemId: string, query?: HostedPageQuery | null): Promise<CaseworkOutcome<Page<HistoryEntry>>>
515
+ workItemHistory(token: string, profile: string, sourceProfile: string, itemId: string, query?: WorkItemHistoryQuery | null): Promise<CaseworkOutcome<Page<HistoryEntry>>>
455
516
  holdings(token: string, profile: string, sourceProfile: string, query?: HoldingsQuery | null): Promise<CaseworkOutcome<Page<HoldingSummary>>>
456
517
  directory(token: string, profile: string): Promise<CaseworkOutcome<DirectoryResponse>>
457
518
  directoryTargets(token: string, profile: string, query: DirectoryTargetsQuery): Promise<CaseworkOutcome<DirectoryTargetPage>>
@@ -104,19 +104,32 @@ class CaseworkClient {
104
104
 
105
105
  for (const [method, jsonIndexes] of [
106
106
  ['description', []],
107
- ['createHostedItem', [3]],
108
- ['getHostedItem', []],
109
- ['addHostedNote', [5]],
110
- ['requesterHostedNotes', [3]],
111
- ['cancelHostedItem', [5]],
112
- ['hostedTerminalItems', [2]],
113
- ['listHostedWorkItems', [2]],
114
- ['getHostedWorkItem', []],
115
- ['hostedWorkItemHistory', [3]],
116
- ['hostedAccountabilityRecord', []],
117
- ['claimHostedWorkItem', [2]],
118
- ['releaseHostedWorkItem', [2]],
119
- ['decideHostedWorkItem', [2, 4]],
107
+ ['createOrRecoverReviewRequest', [3]],
108
+ ['reviewRequest', []],
109
+ ['reviewResult', [2]],
110
+ ['reviewResults', [2]],
111
+ ['cancelReviewRequest', [2, 4]],
112
+ ['reviewKinds', []],
113
+ ['reviewKind', []],
114
+ ['reviewTasks', [2]],
115
+ ['reviewTask', []],
116
+ ['reviewTaskContext', []],
117
+ ['previewReviewTaskTemplates', []],
118
+ ['listReviewTaskGrants', []],
119
+ ['approveReviewTaskGrant', [6]],
120
+ ['revokeReviewTaskGrant', []],
121
+ ['claimReviewTask', []],
122
+ ['releaseReviewTask', []],
123
+ ['assignReviewTask', [5]],
124
+ ['delegateReviewTask', [5]],
125
+ ['reviewTaskDraft', []],
126
+ ['saveReviewTaskDraft', [5]],
127
+ ['deleteReviewTaskDraft', []],
128
+ ['decideReviewTask', [5]],
129
+ ['reviewHistory', [3]],
130
+ ['addReviewNote', [4]],
131
+ ['reviewClocks', []],
132
+ ['reviewAccountability', []],
120
133
  ['listWorkItems', [3]],
121
134
  ['nextWorkItem', [3]],
122
135
  ['getWorkItem', []],
@@ -3,19 +3,32 @@
3
3
  export declare class CaseworkClient {
4
4
  constructor(config: CaseworkClientConfig)
5
5
  description(token: string, profile: string): Promise<CaseworkOutcome>
6
- createHostedItem(token: string, profile: string, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
7
- getHostedItem(token: string, profile: string, itemId: string): Promise<CaseworkOutcome>
8
- addHostedNote(token: string, profile: string, itemId: string, expectedRevision: number, idempotencyKey: string, note: any): Promise<CaseworkOutcome>
9
- requesterHostedNotes(token: string, profile: string, itemId: string, query?: any | undefined | null): Promise<CaseworkOutcome>
10
- cancelHostedItem(token: string, profile: string, itemId: string, expectedRevision: number, idempotencyKey: string, cancellation: any): Promise<CaseworkOutcome>
11
- hostedTerminalItems(token: string, profile: string, query?: any | undefined | null): Promise<CaseworkOutcome>
12
- listHostedWorkItems(token: string, profile: string, query: any): Promise<CaseworkOutcome>
13
- getHostedWorkItem(token: string, profile: string, itemId: string): Promise<CaseworkOutcome>
14
- hostedWorkItemHistory(token: string, profile: string, itemId: string, query?: any | undefined | null): Promise<CaseworkOutcome>
15
- hostedAccountabilityRecord(token: string, profile: string, eventId: string): Promise<CaseworkOutcome>
16
- claimHostedWorkItem(token: string, profile: string, action: any, idempotencyKey: string): Promise<CaseworkOutcome>
17
- releaseHostedWorkItem(token: string, profile: string, action: any, idempotencyKey: string): Promise<CaseworkOutcome>
18
- decideHostedWorkItem(token: string, profile: string, action: any, idempotencyKey: string, decision: any): Promise<CaseworkOutcome>
6
+ createOrRecoverReviewRequest(token: string, profile: string, idempotencyKey: string, request: any, expectedSubmissionDigest: string): Promise<CaseworkOutcome>
7
+ reviewRequest(token: string, profile: string, requestId: string): Promise<CaseworkOutcome>
8
+ reviewResult(token: string, profile: string, accepted: any): Promise<CaseworkOutcome>
9
+ reviewResults(token: string, profile: string, query?: any | undefined | null): Promise<CaseworkOutcome>
10
+ cancelReviewRequest(token: string, profile: string, accepted: any, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
11
+ reviewKinds(token: string, profile: string): Promise<CaseworkOutcome>
12
+ reviewKind(token: string, profile: string, kindId: string): Promise<CaseworkOutcome>
13
+ reviewTasks(token: string, profile: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
14
+ reviewTask(token: string, profile: string, taskId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
15
+ reviewTaskContext(token: string, profile: string, taskId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
16
+ previewReviewTaskTemplates(token: string, profile: string, sourceProfile: string, taskId: string): Promise<CaseworkOutcome>
17
+ listReviewTaskGrants(token: string, profile: string, sourceProfile: string, taskId: string): Promise<CaseworkOutcome>
18
+ approveReviewTaskGrant(token: string, profile: string, sourceProfile: string, taskId: string, expectedRevision: number, idempotencyKey: string, approval: any): Promise<CaseworkOutcome>
19
+ revokeReviewTaskGrant(token: string, profile: string, taskId: string, grantId: string): Promise<CaseworkOutcome>
20
+ claimReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
21
+ releaseReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string): Promise<CaseworkOutcome>
22
+ assignReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, request: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
23
+ delegateReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, request: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
24
+ reviewTaskDraft(token: string, profile: string, taskId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
25
+ saveReviewTaskDraft(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, draft: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
26
+ deleteReviewTaskDraft(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
27
+ decideReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, decision: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
28
+ reviewHistory(token: string, profile: string, requestId: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
29
+ addReviewNote(token: string, profile: string, requestId: string, idempotencyKey: string, note: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
30
+ reviewClocks(token: string, profile: string, requestId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
31
+ reviewAccountability(token: string, profile: string, eventId: string): Promise<CaseworkOutcome>
19
32
  listWorkItems(token: string, profile: string, sourceProfile: string, query: any): Promise<CaseworkOutcome>
20
33
  nextWorkItem(token: string, profile: string, sourceProfile: string, query?: any | undefined | null): Promise<CaseworkOutcome>
21
34
  getWorkItem(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome>
@@ -265,8 +265,8 @@ export declare class SdJwtVcBatchResponse {
265
265
  * selector or disclosed value is copied into it here.
266
266
  */
267
267
  export type SubjectContinuity =
268
- | { status: 'firstUse', receipt: any }
269
- | { status: 'matched', receipt: any }
268
+ | { status: 'firstUse'; receipt: any }
269
+ | { status: 'matched'; receipt: any }
270
270
 
271
271
  /**
272
272
  * A response that satisfied every expectation.
@@ -306,7 +306,7 @@ export interface VerifiedEvidenceRequestBatch {
306
306
  * `{ status: "available", verified } | { status: "notAvailable" }`.
307
307
  */
308
308
  export type VerifiedEvidenceRequestBatchItem =
309
- | { status: 'available', verified: VerifiedEvidence }
309
+ | { status: 'available'; verified: VerifiedEvidence }
310
310
  | { status: 'notAvailable' }
311
311
 
312
312
  /**
package/native.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const PACKAGE_VERSION = '0.32.0';
3
+ const PACKAGE_VERSION = '0.33.0';
4
4
  const PRODUCTS = new Set(['discovery', 'evidence', 'relay', 'breg', 'casework']);
5
5
 
6
6
  function target() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@registrystack/client",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "description": "Unified Node.js client for Registry Stack products.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://docs.registrystack.org/reference/client-api/",
@@ -57,8 +57,8 @@
57
57
  "typescript": "6.0.3"
58
58
  },
59
59
  "optionalDependencies": {
60
- "@registrystack/client-darwin-arm64": "0.32.0",
61
- "@registrystack/client-linux-arm64-gnu": "0.32.0",
62
- "@registrystack/client-linux-x64-gnu": "0.32.0"
60
+ "@registrystack/client-darwin-arm64": "0.33.0",
61
+ "@registrystack/client-linux-arm64-gnu": "0.33.0",
62
+ "@registrystack/client-linux-x64-gnu": "0.33.0"
63
63
  }
64
64
  }