@registrystack/client 0.40.0 → 0.42.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.
@@ -13,7 +13,7 @@ class CaseworkClientError extends Error {
13
13
  this.name = 'CaseworkClientError';
14
14
  this.kind = envelope.kind;
15
15
  this.outcomeUnknown = envelope.outcomeUnknown === true;
16
- for (const field of ['code', 'detail', 'status', 'traceId', 'originalAttemptId', 'validation', 'transportKind', 'protocolFailure']) {
16
+ for (const field of ['code', 'detail', 'status', 'traceId', 'validation', 'transportKind', 'protocolFailure']) {
17
17
  if (envelope[field] !== undefined && envelope[field] !== null) this[field] = envelope[field];
18
18
  }
19
19
  }
@@ -112,16 +112,16 @@ for (const [method, jsonIndexes] of [
112
112
  ['reviewResult', [2]],
113
113
  ['reviewResults', [2]],
114
114
  ['cancelReviewRequest', [2, 4]],
115
- ['reviewKinds', []],
116
- ['reviewKind', []],
115
+ ['reviewPolicies', []],
116
+ ['reviewPolicy', []],
117
117
  ['reviewTasks', [2]],
118
118
  ['ownReviewDecisions', [2]],
119
119
  ['supervisoryReviewTasks', [2]],
120
120
  ['reviewTask', []],
121
121
  ['reviewTaskContext', []],
122
- ['previewReviewTaskTemplates', []],
123
- ['listReviewTaskGrants', []],
124
- ['approveReviewTaskGrant', [6]],
122
+ ['previewReviewTaskTemplates', [2]],
123
+ ['listReviewTaskGrants', [2]],
124
+ ['approveReviewTaskGrant', [5]],
125
125
  ['revokeReviewTaskGrant', []],
126
126
  ['claimReviewTask', []],
127
127
  ['releaseReviewTask', []],
@@ -135,30 +135,14 @@ for (const [method, jsonIndexes] of [
135
135
  ['addReviewNote', [4]],
136
136
  ['reviewClocks', []],
137
137
  ['reviewAccountability', []],
138
- ['listWorkItems', [3]],
139
- ['nextWorkItem', [3]],
140
- ['getWorkItem', []],
141
- ['previewTaskTemplates', []],
142
- ['listTaskGrants', []],
143
- ['approveTaskGrant', [6]],
144
- ['revokeTaskGrant', []],
145
138
  ['taskAssertion', []],
146
139
  ['taskGrantStatus', []],
147
- ['claimWorkItem', [3]],
148
- ['releaseWorkItem', [3]],
149
- ['getDraft', []],
150
- ['saveDraft', [6]],
151
- ['deleteDraft', []],
152
- ['decideWorkItem', [3, 5]],
153
- ['recoverDecision', [5]],
154
- ['recoverDecisionByKey', [5]],
155
- ['workItemHistory', [4]],
156
- ['holdings', [3]],
140
+ ['nextReviewTask', [2]],
141
+ ['reviewTaskHoldings', [2]],
157
142
  ['directory', []],
158
143
  ['directoryTargets', [2]],
159
144
  ['bootstrapDirectory', [4]],
160
145
  ['updateDirectoryTeam', [5]],
161
- ['workItemClocks', []],
162
146
  ['holidayRevision', []],
163
147
  ['createHolidayRevision', [3]],
164
148
  ['previewClockRecompute', [2]],
@@ -167,9 +151,7 @@ for (const [method, jsonIndexes] of [
167
151
  ['createAbsence', [4]],
168
152
  ['updateAbsence', [5]],
169
153
  ['deleteAbsence', []],
170
- ['assignWorkItem', [5]],
171
- ['delegateWorkItem', [5]],
172
- ['previewCaseloadMove', [2, 3]],
154
+ ['previewCaseloadMove', [2]],
173
155
  ['applyCaseloadMove', [3]],
174
156
  ]) {
175
157
  CaseworkClient.prototype[method] = function (...args) {
@@ -184,4 +166,14 @@ for (const [method, jsonIndexes] of [
184
166
  };
185
167
  }
186
168
 
187
- module.exports = { CaseworkClient, CaseworkClientError };
169
+ // Hash the same sanitized request that admission sends. Rust owns canonical
170
+ // ordering, portable JSON validation, and the producer/namespace binding.
171
+ function submissionDigest(producer, sourceNamespace, request) {
172
+ try {
173
+ return native.submissionDigest(producer, sourceNamespace, sanitize(request, 'invalid-request'));
174
+ } catch (error) {
175
+ throw normalized(error, 'invalid-request');
176
+ }
177
+ }
178
+
179
+ module.exports = { CaseworkClient, CaseworkClientError, submissionDigest };
@@ -9,16 +9,18 @@ export declare class CaseworkClient {
9
9
  reviewResult(token: string, profile: string, accepted: any): Promise<CaseworkOutcome>
10
10
  reviewResults(token: string, profile: string, query?: any | undefined | null): Promise<CaseworkOutcome>
11
11
  cancelReviewRequest(token: string, profile: string, accepted: any, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
12
- reviewKinds(token: string, profile: string): Promise<CaseworkOutcome>
13
- reviewKind(token: string, profile: string, kindId: string): Promise<CaseworkOutcome>
12
+ reviewPolicies(token: string, profile: string): Promise<CaseworkOutcome>
13
+ reviewPolicy(token: string, profile: string, policyId: string): Promise<CaseworkOutcome>
14
14
  reviewTasks(token: string, profile: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
15
+ nextReviewTask(token: string, profile: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
16
+ reviewTaskHoldings(token: string, profile: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
15
17
  reviewTask(token: string, profile: string, taskId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
16
18
  ownReviewDecisions(token: string, profile: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
17
19
  supervisoryReviewTasks(token: string, profile: string, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
18
20
  reviewTaskContext(token: string, profile: string, taskId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
19
- previewReviewTaskTemplates(token: string, profile: string, sourceProfile: string, taskId: string): Promise<CaseworkOutcome>
20
- listReviewTaskGrants(token: string, profile: string, sourceProfile: string, taskId: string): Promise<CaseworkOutcome>
21
- approveReviewTaskGrant(token: string, profile: string, sourceProfile: string, taskId: string, expectedRevision: number, idempotencyKey: string, approval: any): Promise<CaseworkOutcome>
21
+ previewReviewTaskTemplates(token: string, profile: string, options: ReviewTaskGrantReadOptions): Promise<CaseworkOutcome>
22
+ listReviewTaskGrants(token: string, profile: string, options: ReviewTaskGrantReadOptions): Promise<CaseworkOutcome>
23
+ approveReviewTaskGrant(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, approval: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
22
24
  revokeReviewTaskGrant(token: string, profile: string, taskId: string, grantId: string): Promise<CaseworkOutcome>
23
25
  claimReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
24
26
  releaseReviewTask(token: string, profile: string, taskId: string, expectedRevision: number, idempotencyKey: string): Promise<CaseworkOutcome>
@@ -32,26 +34,9 @@ export declare class CaseworkClient {
32
34
  addReviewNote(token: string, profile: string, requestId: string, idempotencyKey: string, note: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
33
35
  reviewClocks(token: string, profile: string, requestId: string, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
34
36
  reviewAccountability(token: string, profile: string, eventId: string): Promise<CaseworkOutcome>
35
- listWorkItems(token: string, profile: string, sourceProfile: string, query: any): Promise<CaseworkOutcome>
36
- nextWorkItem(token: string, profile: string, sourceProfile: string, query?: any | undefined | null): Promise<CaseworkOutcome>
37
- getWorkItem(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome>
38
- previewTaskTemplates(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome>
39
- listTaskGrants(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome>
40
- approveTaskGrant(token: string, profile: string, sourceProfile: string, itemId: string, expectedRevision: number, idempotencyKey: string, approval: any): Promise<CaseworkOutcome>
41
- revokeTaskGrant(token: string, profile: string, sourceProfile: string, itemId: string, grantId: string): Promise<CaseworkOutcome>
42
37
  taskAssertion(token: string, grantId: string): Promise<CaseworkOutcome>
43
38
  taskAssertionEndpoint(grantId: string): string
44
39
  taskGrantStatus(token: string, grantId: string): Promise<CaseworkOutcome>
45
- claimWorkItem(token: string, profile: string, sourceProfile: string, action: any, idempotencyKey: string): Promise<CaseworkOutcome>
46
- releaseWorkItem(token: string, profile: string, sourceProfile: string, action: any, idempotencyKey: string): Promise<CaseworkOutcome>
47
- getDraft(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome>
48
- saveDraft(token: string, profile: string, sourceProfile: string, itemId: string, expectedRevision: number, idempotencyKey: string, draft: any): Promise<CaseworkOutcome>
49
- deleteDraft(token: string, profile: string, sourceProfile: string, itemId: string, expectedRevision: number, idempotencyKey: string): Promise<CaseworkOutcome>
50
- decideWorkItem(token: string, profile: string, sourceProfile: string, action: any, idempotencyKey: string, decision: any): Promise<CaseworkOutcome>
51
- recoverDecision(token: string, profile: string, sourceProfile: string, itemId: string, attemptId: string, recovery: any): Promise<CaseworkOutcome>
52
- recoverDecisionByKey(token: string, profile: string, sourceProfile: string, itemId: string, idempotencyKey: string, recovery: any): Promise<CaseworkOutcome>
53
- workItemHistory(token: string, profile: string, sourceProfile: string, itemId: string, query?: any | undefined | null): Promise<CaseworkOutcome>
54
- holdings(token: string, profile: string, sourceProfile: string, query?: any | undefined | null): Promise<CaseworkOutcome>
55
40
  directory(token: string, profile: string): Promise<CaseworkOutcome>
56
41
  directoryTargets(token: string, profile: string, query: any): Promise<CaseworkOutcome>
57
42
  bootstrapDirectory(token: string, profile: string, expectedRevision: number, idempotencyKey: string, bootstrap: any): Promise<CaseworkOutcome>
@@ -59,12 +44,9 @@ export declare class CaseworkClient {
59
44
  createAbsence(token: string, profile: string, expectedRevision: number, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
60
45
  updateAbsence(token: string, profile: string, absenceId: string, expectedRevision: number, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
61
46
  deleteAbsence(token: string, profile: string, absenceId: string, expectedRevision: number, idempotencyKey: string): Promise<CaseworkOutcome>
62
- assignWorkItem(token: string, profile: string, itemId: string, expectedRevision: number, idempotencyKey: string, request: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
63
- delegateWorkItem(token: string, profile: string, itemId: string, expectedRevision: number, idempotencyKey: string, request: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
64
- previewCaseloadMove(token: string, profile: string, movement: any, query?: any | undefined | null, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
47
+ previewCaseloadMove(token: string, profile: string, movement: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
65
48
  applyCaseloadMove(token: string, profile: string, idempotencyKey: string, request: any, sourceProfile?: string | undefined | null): Promise<CaseworkOutcome>
66
49
  updateDirectoryTeam(token: string, profile: string, teamId: string, expectedRevision: number, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
67
- workItemClocks(token: string, profile: string, sourceProfile: string, itemId: string): Promise<CaseworkOutcome>
68
50
  holidayRevision(token: string, profile: string, holidaySet: string, revision: number): Promise<CaseworkOutcome>
69
51
  createHolidayRevision(token: string, profile: string, idempotencyKey: string, request: any): Promise<CaseworkOutcome>
70
52
  previewClockRecompute(token: string, profile: string, request: any): Promise<CaseworkOutcome>
@@ -90,3 +72,12 @@ export interface CaseworkOutcome {
90
72
  value: any
91
73
  traceId: string
92
74
  }
75
+
76
+ /** Identify a human task grant read without positional string ambiguity. */
77
+ export interface ReviewTaskGrantReadOptions {
78
+ taskId: string
79
+ sourceProfile?: string
80
+ }
81
+
82
+ /** Compute the canonical producer submission digest locally, without I/O. */
83
+ export declare function submissionDigest(producer: string, sourceNamespace: string, request: any): string
@@ -169,9 +169,6 @@ export function selectEvidenceService(
169
169
  */
170
170
  export function validateSelectionStructure<T extends CommonServiceSelection>(selection: T): T;
171
171
 
172
- /** @deprecated Use validateSelectionStructure. This operation is structural, not trust. */
173
- export function validateSelection<T extends CommonServiceSelection>(selection: T): T;
174
-
175
172
  export class AcceptedServiceSelection<T extends CommonServiceSelection> {
176
173
  private constructor();
177
174
  private readonly __acceptedServiceSelectionBrand: void;
@@ -275,10 +275,6 @@ function validateSelectionStructure(selection) {
275
275
  }
276
276
  }
277
277
 
278
- function validateSelection(selection) {
279
- return validateSelectionStructure(selection);
280
- }
281
-
282
278
  function acceptSelection(selection, accepts) {
283
279
  const checked = validateSelectionStructure(selection);
284
280
  if (typeof accepts !== 'function') throw inputError('query');
@@ -304,6 +300,5 @@ module.exports = {
304
300
  selectEvidenceAlternative,
305
301
  selectEvidenceService,
306
302
  selectExact,
307
- validateSelection,
308
303
  validateSelectionStructure,
309
304
  };
@@ -27,6 +27,4 @@ export declare function selectEvidenceService(response: any, request: any): any
27
27
 
28
28
  export declare function selectExact(response: any, request: any): any
29
29
 
30
- export declare function validateSelection(selection: any): any
31
-
32
30
  export declare function validateSelectionStructure(selection: any): any
@@ -109,6 +109,7 @@ export type MessagingProblemCode =
109
109
  | 'profile.not-authorized'
110
110
  | 'quota.exceeded'
111
111
  | 'rate-limit.exceeded'
112
+ | 'receipt.unresolved'
112
113
  | 'request.body-too-large'
113
114
  | 'request.invalid'
114
115
  | 'request.method-not-allowed'
@@ -156,6 +157,8 @@ export class MessagingClient {
156
157
  health(): Promise<MessagingOutcome<null>>
157
158
  ready(): Promise<MessagingOutcome<null>>
158
159
  submit(token: string, idempotencyKey: string, request: SubmitMessageRequest): Promise<MessagingOutcome<MessageReceipt>>
160
+ /** Observe the original success using the same body/key and current token; never resend or mutate. */
161
+ messageReceipt(token: string, idempotencyKey: string, request: SubmitMessageRequest): Promise<MessagingOutcome<MessageReceipt>>
159
162
  message(token: string, messageId: MessageId): Promise<MessagingOutcome<MessageView>>
160
163
  cancel(token: string, messageId: MessageId): Promise<MessagingOutcome<MessageView>>
161
164
  preview(token: string, templateId: string, version: string, request: TemplatePreviewRequest): Promise<MessagingOutcome<TemplatePreview>>
@@ -113,6 +113,7 @@ for (const [method, jsonIndexes] of [
113
113
  ['health', []],
114
114
  ['ready', []],
115
115
  ['submit', [2]],
116
+ ['messageReceipt', [2]],
116
117
  ['message', []],
117
118
  ['cancel', []],
118
119
  ['preview', [3]],
@@ -6,6 +6,7 @@ export declare class MessagingClient {
6
6
  health(): Promise<MessagingOutcome>
7
7
  ready(): Promise<MessagingOutcome>
8
8
  submit(token: string, idempotencyKey: string, request: any): Promise<MessagingOutcome>
9
+ messageReceipt(token: string, idempotencyKey: string, request: any): Promise<MessagingOutcome>
9
10
  message(token: string, messageId: string): Promise<MessagingOutcome>
10
11
  cancel(token: string, messageId: string): Promise<MessagingOutcome>
11
12
  preview(token: string, templateId: string, version: string, request: any): Promise<MessagingOutcome>
package/native.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const PACKAGE_VERSION = '0.40.0';
3
+ const PACKAGE_VERSION = '0.42.0';
4
4
  const PRODUCTS = new Set(['discovery', 'evidence', 'breg', 'casework', 'messaging', 'scheduling']);
5
5
 
6
6
  function target() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@registrystack/client",
3
- "version": "0.40.0",
3
+ "version": "0.42.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/",
@@ -46,21 +46,21 @@
46
46
  "scheduling"
47
47
  ],
48
48
  "engines": {
49
- "node": ">=22.12.0"
49
+ "node": ">=24.11.0"
50
50
  },
51
51
  "scripts": {
52
52
  "sync": "python3 ../../release/scripts/sync-registry-client-node.py",
53
53
  "sync:check": "python3 ../../release/scripts/sync-registry-client-node.py --check",
54
- "test": "npm run sync:check && node --test __test__/*.test.js",
54
+ "test": "npm run sync:check && node ../../scripts/run-node-tests.mjs __test__/*.test.js",
55
55
  "check:types": "tsc --noEmit --strict --skipLibCheck false --types node --moduleResolution node16 --module node16 --target es2022 index.d.ts __test__/facade.test-d.ts"
56
56
  },
57
57
  "devDependencies": {
58
- "@types/node": "22.20.5",
58
+ "@types/node": "24.19.2",
59
59
  "typescript": "6.0.3"
60
60
  },
61
61
  "optionalDependencies": {
62
- "@registrystack/client-darwin-arm64": "0.40.0",
63
- "@registrystack/client-linux-arm64-gnu": "0.40.0",
64
- "@registrystack/client-linux-x64-gnu": "0.40.0"
62
+ "@registrystack/client-darwin-arm64": "0.42.0",
63
+ "@registrystack/client-linux-arm64-gnu": "0.42.0",
64
+ "@registrystack/client-linux-x64-gnu": "0.42.0"
65
65
  }
66
66
  }
@@ -170,6 +170,7 @@ export type SchedulingProblemCode =
170
170
  | 'precondition.required'
171
171
  | 'prerequisite.missing'
172
172
  | 'profile.not-authorized'
173
+ | 'receipt.unresolved'
173
174
  | 'request.body-too-large'
174
175
  | 'request.invalid'
175
176
  | 'request.method-not-allowed'
@@ -216,6 +217,8 @@ export class SchedulingClient {
216
217
  createHold(token: string, idempotencyKey: string, request: AdmissionRequest): Promise<SchedulingOutcome<HoldDocument>>
217
218
  releaseHold(token: string, holdId: string): Promise<SchedulingOutcome<null>>
218
219
  createAppointment(token: string, idempotencyKey: string, request: CreateAppointmentRequest): Promise<SchedulingOutcome<AppointmentDocument>>
220
+ /** Observe the original success using the same body/key and current token; never resend or mutate. */
221
+ appointmentReceipt(token: string, idempotencyKey: string, request: CreateAppointmentRequest): Promise<SchedulingOutcome<AppointmentDocument>>
219
222
  getAppointment(token: string, appointmentId: string): Promise<SchedulingOutcome<AppointmentDocument>>
220
223
  listAppointments(token: string, reference: ExternalReference, page?: PageQuery | null): Promise<SchedulingOutcome<PageDocument<AppointmentDocument>>>
221
224
  rescheduleAppointment(token: string, appointmentId: string, idempotencyKey: string, request: RescheduleAppointmentRequest): Promise<SchedulingOutcome<AppointmentDocument>>
@@ -118,6 +118,7 @@ for (const [method, jsonIndexes] of [
118
118
  ['createHold', [2]],
119
119
  ['releaseHold', []],
120
120
  ['createAppointment', [2]],
121
+ ['appointmentReceipt', [2]],
121
122
  ['getAppointment', []],
122
123
  ['listAppointments', [1, 2]],
123
124
  ['rescheduleAppointment', [3]],
@@ -11,6 +11,7 @@ export declare class SchedulingClient {
11
11
  createHold(token: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
12
12
  releaseHold(token: string, holdId: string): Promise<SchedulingOutcome>
13
13
  createAppointment(token: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
14
+ appointmentReceipt(token: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
14
15
  getAppointment(token: string, appointmentId: string): Promise<SchedulingOutcome>
15
16
  listAppointments(token: string, reference: any, page?: any | undefined | null): Promise<SchedulingOutcome>
16
17
  rescheduleAppointment(token: string, appointmentId: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>