@registrystack/client 0.41.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.
- package/README.md +30 -18
- package/breg/client.d.ts +173 -336
- package/breg/client.js +32 -106
- package/breg/index.d.ts +72 -141
- package/casework/client.d.ts +111 -282
- package/casework/client.js +20 -28
- package/casework/index.d.ts +17 -26
- package/discovery/client.d.ts +0 -3
- package/discovery/client.js +0 -5
- package/discovery/index.d.ts +0 -2
- package/native.js +1 -1
- package/package.json +6 -6
package/casework/client.js
CHANGED
|
@@ -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', '
|
|
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
|
-
['
|
|
116
|
-
['
|
|
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', [
|
|
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
|
-
['
|
|
148
|
-
['
|
|
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
|
-
['
|
|
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
|
-
|
|
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 };
|
package/casework/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
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,
|
|
20
|
-
listReviewTaskGrants(token: string, profile: string,
|
|
21
|
-
approveReviewTaskGrant(token: string, profile: string,
|
|
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
|
-
|
|
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
|
package/discovery/client.d.ts
CHANGED
|
@@ -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;
|
package/discovery/client.js
CHANGED
|
@@ -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
|
};
|
package/discovery/index.d.ts
CHANGED
|
@@ -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
|
package/native.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@registrystack/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.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/",
|
|
@@ -51,16 +51,16 @@
|
|
|
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
|
|
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": "24.19.
|
|
58
|
+
"@types/node": "24.19.2",
|
|
59
59
|
"typescript": "6.0.3"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"@registrystack/client-darwin-arm64": "0.
|
|
63
|
-
"@registrystack/client-linux-arm64-gnu": "0.
|
|
64
|
-
"@registrystack/client-linux-x64-gnu": "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
|
}
|