@registrystack/client 0.42.0 → 0.44.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 +37 -7
- package/breg/client.d.ts +49 -27
- package/breg/client.js +18 -8
- package/breg/index.d.ts +31 -16
- package/casework/client.d.ts +11 -10
- package/casework/client.js +39 -1
- package/casework/index.d.ts +3 -3
- package/compatibility.json +18 -0
- package/coordinator/client.d.ts +218 -0
- package/coordinator/client.js +140 -0
- package/coordinator/index.d.ts +19 -0
- package/coordinator/index.js +3 -0
- package/discovery/client.d.ts +2 -2
- package/discovery/client.js +3 -3
- package/discovery/index.d.ts +2 -2
- package/evidence/client.d.ts +9 -16
- package/evidence/index.d.ts +1 -1
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/messaging/client.d.ts +7 -6
- package/native.js +2 -2
- package/package.json +15 -6
- package/scheduling/client.d.ts +177 -11
- package/scheduling/client.js +6 -1
- package/scheduling/index.d.ts +6 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/** An integer for which `Number.isSafeInteger` is true. */
|
|
2
|
+
export type SafeInteger = number
|
|
3
|
+
/** A lowercase hyphenated UUID, checked before any request is sent. */
|
|
4
|
+
export type RunId = string
|
|
5
|
+
/** An RFC 3339 instant returned by Coordinator. */
|
|
6
|
+
export type Instant = string
|
|
7
|
+
export type JsonScalar = string | number | boolean | null
|
|
8
|
+
export type JsonValue = JsonScalar | ReadonlyArray<JsonValue> | { readonly [key: string]: JsonValue }
|
|
9
|
+
|
|
10
|
+
export interface CoordinatorClientConfig {
|
|
11
|
+
baseUrl: string
|
|
12
|
+
attemptTimeoutMilliseconds?: SafeInteger
|
|
13
|
+
connectTimeoutMilliseconds?: SafeInteger
|
|
14
|
+
maximumResponseBytes?: SafeInteger
|
|
15
|
+
userAgent?: string
|
|
16
|
+
/** Additional trust roots for the deployment, as PEM text. */
|
|
17
|
+
trustedRootCertificates?: string
|
|
18
|
+
/**
|
|
19
|
+
* How many times an admission whose outcome is unknown is resent,
|
|
20
|
+
* identically and under the same idempotency key, before its error is
|
|
21
|
+
* returned: a whole number from 0 to 2, default 2; 0 sends it once. Any
|
|
22
|
+
* other value is a `configuration` error.
|
|
23
|
+
*/
|
|
24
|
+
maximumMutationRetries?: SafeInteger
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface StartRunRequest { workflow: string; workflowRevision: string; input: JsonValue }
|
|
28
|
+
|
|
29
|
+
/** The active compiled contract under current start authority. */
|
|
30
|
+
export interface WorkflowContract {
|
|
31
|
+
workflow: string
|
|
32
|
+
workflowRevision: string
|
|
33
|
+
input: JsonValue
|
|
34
|
+
outcomes: { readonly [name: string]: JsonValue }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface RunStatus {
|
|
38
|
+
runId: RunId
|
|
39
|
+
workflow: string
|
|
40
|
+
workflowRevision: string
|
|
41
|
+
|
|
42
|
+
bindingDigest: string
|
|
43
|
+
step: string
|
|
44
|
+
state: string
|
|
45
|
+
outcome?: string | null
|
|
46
|
+
output?: JsonValue | null
|
|
47
|
+
failureCode?: string | null
|
|
48
|
+
/** Where a refused call input left its operation contract, as an RFC 6901 pointer that names no value. */
|
|
49
|
+
failurePath?: string | null
|
|
50
|
+
admittedAt: Instant
|
|
51
|
+
deadlineAt: Instant
|
|
52
|
+
nextDueAt?: Instant | null
|
|
53
|
+
uncertain: boolean
|
|
54
|
+
restoreReviewRequired: boolean
|
|
55
|
+
cancelRequested: boolean
|
|
56
|
+
authoredCancelRequested: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface StepStatus {
|
|
60
|
+
step: string
|
|
61
|
+
state: string
|
|
62
|
+
generation: SafeInteger
|
|
63
|
+
attempt: SafeInteger
|
|
64
|
+
nextDueAt?: Instant | null
|
|
65
|
+
leaseExpiresAt?: Instant | null
|
|
66
|
+
commandPrepared: boolean
|
|
67
|
+
uncertain: boolean
|
|
68
|
+
receiptExpired: boolean
|
|
69
|
+
failureCode?: string | null
|
|
70
|
+
/** Where a refused call input left its operation contract, as an RFC 6901 pointer that names no value. */
|
|
71
|
+
failurePath?: string | null
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type RetryBlockReason =
|
|
75
|
+
| 'not-recoverable'
|
|
76
|
+
| 'deadline-reached'
|
|
77
|
+
| 'receipt-expired'
|
|
78
|
+
| 'binding-changed'
|
|
79
|
+
| 'other-binding-live'
|
|
80
|
+
| 'snapshot-incompatible'
|
|
81
|
+
| 'cancelled'
|
|
82
|
+
| 'restore-hold'
|
|
83
|
+
| 'restore-review-required'
|
|
84
|
+
| 'payload-erased'
|
|
85
|
+
| 'evaluation-uncertain'
|
|
86
|
+
|
|
87
|
+
/** Coordinator-authored operation identifier. */
|
|
88
|
+
export type OperationId = string
|
|
89
|
+
export type OperationEffect = 'read' | 'mutation' | 'evaluation'
|
|
90
|
+
export type OperationKeyRequirement = 'none' | 'required'
|
|
91
|
+
export type OperationRecovery = 'read-again' | 'same-command-and-receipt' | 'same-command' | 'hold-after-dispatch'
|
|
92
|
+
|
|
93
|
+
/** Pinned public contract metadata. It does not establish current authority. */
|
|
94
|
+
export interface OperationIdentity {
|
|
95
|
+
id: OperationId
|
|
96
|
+
version: SafeInteger
|
|
97
|
+
product: string
|
|
98
|
+
effect: OperationEffect
|
|
99
|
+
keyRequirement: OperationKeyRequirement
|
|
100
|
+
requiresPreparation: boolean
|
|
101
|
+
recovery: OperationRecovery
|
|
102
|
+
readReceipt: boolean
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface RecoveryStatus {
|
|
106
|
+
retryAllowed: boolean
|
|
107
|
+
reason?: RetryBlockReason | null
|
|
108
|
+
operation?: OperationIdentity
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type EffectState = 'accepted' | 'unknown'
|
|
112
|
+
export interface EffectStatus {
|
|
113
|
+
step: string
|
|
114
|
+
operation: OperationIdentity
|
|
115
|
+
operationRevision: string
|
|
116
|
+
state: EffectState
|
|
117
|
+
}
|
|
118
|
+
export interface WaitStatus {
|
|
119
|
+
step: string
|
|
120
|
+
acceptedStep: string
|
|
121
|
+
completion: string
|
|
122
|
+
completionRevision: string
|
|
123
|
+
timeoutAt: Instant
|
|
124
|
+
nextObservationAt: Instant | null
|
|
125
|
+
notBefore: Instant
|
|
126
|
+
minimumIntervalSeconds: SafeInteger
|
|
127
|
+
observations: SafeInteger
|
|
128
|
+
observationLimit: SafeInteger
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface RunInspection {
|
|
132
|
+
run: RunStatus
|
|
133
|
+
steps: ReadonlyArray<StepStatus>
|
|
134
|
+
effects: ReadonlyArray<EffectStatus>
|
|
135
|
+
waits: ReadonlyArray<WaitStatus>
|
|
136
|
+
recovery: RecoveryStatus
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type RunListState =
|
|
140
|
+
| 'running'
|
|
141
|
+
| 'finished'
|
|
142
|
+
| 'failed'
|
|
143
|
+
| 'cancelled'
|
|
144
|
+
| 'cancelled-after-effect'
|
|
145
|
+
| 'expired'
|
|
146
|
+
| 'attention'
|
|
147
|
+
| 'cancel-requested'
|
|
148
|
+
|
|
149
|
+
/** One stable page of runs the caller may read, newest admission first. */
|
|
150
|
+
export interface RunList { runs: ReadonlyArray<RunStatus>; nextCursor?: string }
|
|
151
|
+
|
|
152
|
+
/** The runtime accepted a same-command retry; the worker has not run it yet. */
|
|
153
|
+
export interface RetryScheduled { runId: RunId; status: 'retry-scheduled' }
|
|
154
|
+
|
|
155
|
+
export interface CoordinatorOutcome<T> { kind: 'complete'; value: T }
|
|
156
|
+
export type CoordinatorProtocolFailure = 'header-bounds' | 'media-type' | 'body' | 'problem' | 'status' | 'protocol'
|
|
157
|
+
|
|
158
|
+
export class CoordinatorClientError extends Error {
|
|
159
|
+
readonly kind: 'configuration' | 'invalid-request' | 'transport' | 'problem' | 'protocol'
|
|
160
|
+
/**
|
|
161
|
+
* Whether the call may have taken effect although this error was raised:
|
|
162
|
+
* a timeout or broken exchange after sending, an unusable answer, or a
|
|
163
|
+
* 5xx. When true for `start`, recover by sending the same workflow, revision, and input
|
|
164
|
+
* again under the same idempotency key; a new key could admit a second
|
|
165
|
+
* run. When true for `retrySame` or `cancel`, which take no key and are
|
|
166
|
+
* never resent, read the run before asking again. False for a
|
|
167
|
+
* configuration or request defect, a connection never established, and
|
|
168
|
+
* every 4xx refusal.
|
|
169
|
+
*/
|
|
170
|
+
readonly outcomeUnknown: boolean
|
|
171
|
+
/**
|
|
172
|
+
* The `family.reason` code of the RFC 9457 problem document the service
|
|
173
|
+
* answered, such as `run.not-visible`, present only when `kind` is
|
|
174
|
+
* `'problem'`. The service's title and detail are never copied.
|
|
175
|
+
*/
|
|
176
|
+
readonly code?: string
|
|
177
|
+
readonly status?: SafeInteger
|
|
178
|
+
readonly transportKind?: string
|
|
179
|
+
readonly protocolFailure?: CoordinatorProtocolFailure
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export class CoordinatorClient {
|
|
183
|
+
constructor(config: CoordinatorClientConfig)
|
|
184
|
+
/**
|
|
185
|
+
* Admit `{workflow, workflowRevision, input}` under the caller's key. Fresh
|
|
186
|
+
* starts must match the active revision. Recover unknown admissions with the
|
|
187
|
+
* original revision even after activation changes. An unknown outcome is resent with
|
|
188
|
+
* the same key and body at most `maximumMutationRetries` times; a 4xx is never
|
|
189
|
+
* resent. The key is scoped to the caller and the workflow, so the same key
|
|
190
|
+
* under two workflows starts two runs, and an allowed workflow the deployment does
|
|
191
|
+
* not serve is refused with 404 `workflow.not-served`, a known outcome never resent.
|
|
192
|
+
*/
|
|
193
|
+
start(token: string, idempotencyKey: string, request: StartRunRequest): Promise<CoordinatorOutcome<RunStatus>>
|
|
194
|
+
/** Discover the active typed contract under current start authority; starts no run. */
|
|
195
|
+
workflow(token: string, workflow: string): Promise<CoordinatorOutcome<WorkflowContract>>
|
|
196
|
+
status(token: string, runId: RunId): Promise<CoordinatorOutcome<RunStatus>>
|
|
197
|
+
inspect(token: string, runId: RunId): Promise<CoordinatorOutcome<RunInspection>>
|
|
198
|
+
/** Read the original operation's receipt and update recovery state. Never resubmits the operation. */
|
|
199
|
+
reconcile(token: string, runId: RunId, reason: string): Promise<CoordinatorOutcome<RunInspection>>
|
|
200
|
+
/**
|
|
201
|
+
* Read one stable page of caller-visible runs. Pass `nextCursor` unchanged
|
|
202
|
+
* with the same caller, `state`, and `attention` values. `attention: true`
|
|
203
|
+
* selects the effective states `attention` and `failed`.
|
|
204
|
+
*/
|
|
205
|
+
list(token: string, limit: SafeInteger, cursor?: string | null, state?: RunListState | null, attention?: boolean | null): Promise<CoordinatorOutcome<RunList>>
|
|
206
|
+
/**
|
|
207
|
+
* Schedule the run's saved command again, unchanged, when its inspection
|
|
208
|
+
* allows a retry. Takes no idempotency key, so it is sent exactly once. `reason` is
|
|
209
|
+
* 1 to 256 bytes without control characters, checked before sending.
|
|
210
|
+
*/
|
|
211
|
+
retrySame(token: string, runId: RunId, reason: string): Promise<CoordinatorOutcome<RetryScheduled>>
|
|
212
|
+
/**
|
|
213
|
+
* Stop further progression. Never undoes a product effect. Takes no
|
|
214
|
+
* idempotency key, so it is sent exactly once. `reason` is 1 to 256 bytes
|
|
215
|
+
* without control characters, checked before sending.
|
|
216
|
+
*/
|
|
217
|
+
cancel(token: string, runId: RunId, reason: string): Promise<CoordinatorOutcome<RunStatus>>
|
|
218
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { types: { isProxy } } = require('node:util');
|
|
4
|
+
const native = require('./index');
|
|
5
|
+
|
|
6
|
+
const MAX_JSON_DEPTH = 64;
|
|
7
|
+
const MAX_JSON_NODES = 20_000;
|
|
8
|
+
const MAX_JSON_STRING_BYTES = 1024 * 1024;
|
|
9
|
+
|
|
10
|
+
class CoordinatorClientError extends Error {
|
|
11
|
+
constructor(envelope) {
|
|
12
|
+
super(envelope.message);
|
|
13
|
+
this.name = 'CoordinatorClientError';
|
|
14
|
+
this.kind = envelope.kind;
|
|
15
|
+
this.outcomeUnknown = envelope.outcomeUnknown === true;
|
|
16
|
+
for (const field of ['code', 'status', 'transportKind', 'protocolFailure']) {
|
|
17
|
+
if (envelope[field] !== undefined && envelope[field] !== null) this[field] = envelope[field];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const FALLBACK_MESSAGES = {
|
|
23
|
+
configuration: 'Coordinator client configuration is invalid',
|
|
24
|
+
'invalid-request': 'Coordinator client arguments are invalid',
|
|
25
|
+
protocol: 'Registry Coordinator client failed',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function normalized(error, fallbackKind) {
|
|
29
|
+
if (error instanceof CoordinatorClientError) return error;
|
|
30
|
+
if (error instanceof Error && typeof error.message === 'string') {
|
|
31
|
+
try {
|
|
32
|
+
const envelope = JSON.parse(error.message);
|
|
33
|
+
if (envelope && typeof envelope.kind === 'string') return new CoordinatorClientError(envelope);
|
|
34
|
+
} catch {
|
|
35
|
+
// napi argument conversion errors have no mapped envelope.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (fallbackKind) {
|
|
39
|
+
return new CoordinatorClientError({
|
|
40
|
+
kind: fallbackKind,
|
|
41
|
+
message: FALLBACK_MESSAGES[fallbackKind],
|
|
42
|
+
outcomeUnknown: fallbackKind === 'protocol',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return error;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function cloneJson(value, budget, depth, kind) {
|
|
49
|
+
if (depth > MAX_JSON_DEPTH || ++budget.nodes > MAX_JSON_NODES) throw normalized({}, kind);
|
|
50
|
+
if (value === null || typeof value === 'boolean') return value;
|
|
51
|
+
if (typeof value === 'string') {
|
|
52
|
+
budget.bytes += Buffer.byteLength(value, 'utf8');
|
|
53
|
+
if (budget.bytes > MAX_JSON_STRING_BYTES) throw normalized({}, kind);
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
if (typeof value === 'number') {
|
|
57
|
+
if (!Number.isFinite(value) || (Number.isInteger(value) && !Number.isSafeInteger(value))) {
|
|
58
|
+
throw normalized({}, kind);
|
|
59
|
+
}
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
if (value === undefined || typeof value !== 'object' || isProxy(value)) throw normalized({}, kind);
|
|
63
|
+
const array = Array.isArray(value);
|
|
64
|
+
const prototype = Object.getPrototypeOf(value);
|
|
65
|
+
if (array ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null) {
|
|
66
|
+
throw normalized({}, kind);
|
|
67
|
+
}
|
|
68
|
+
if (budget.active.has(value)) throw normalized({}, kind);
|
|
69
|
+
budget.active.add(value);
|
|
70
|
+
try {
|
|
71
|
+
if (array) {
|
|
72
|
+
if (value.length > MAX_JSON_NODES - budget.nodes) throw normalized({}, kind);
|
|
73
|
+
const keys = Reflect.ownKeys(value);
|
|
74
|
+
if (keys.length !== value.length + 1) throw normalized({}, kind);
|
|
75
|
+
const result = new Array(value.length);
|
|
76
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
77
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
|
|
78
|
+
if (!descriptor || !Object.hasOwn(descriptor, 'value')) throw normalized({}, kind);
|
|
79
|
+
result[index] = cloneJson(descriptor.value, budget, depth + 1, kind);
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
const result = Object.create(null);
|
|
84
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
85
|
+
if (typeof key !== 'string') throw normalized({}, kind);
|
|
86
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
87
|
+
if (!descriptor || !Object.hasOwn(descriptor, 'value')) throw normalized({}, kind);
|
|
88
|
+
if (descriptor.enumerable) {
|
|
89
|
+
budget.bytes += Buffer.byteLength(key, 'utf8');
|
|
90
|
+
if (budget.bytes > MAX_JSON_STRING_BYTES) throw normalized({}, kind);
|
|
91
|
+
result[key] = cloneJson(descriptor.value, budget, depth + 1, kind);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
} finally {
|
|
96
|
+
budget.active.delete(value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function sanitize(value, kind) {
|
|
101
|
+
return cloneJson(value, { nodes: 0, bytes: 0, active: new WeakSet() }, 0, kind);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const NativeCoordinatorClient = native.CoordinatorClient;
|
|
105
|
+
|
|
106
|
+
class CoordinatorClient {
|
|
107
|
+
constructor(config) {
|
|
108
|
+
try {
|
|
109
|
+
this.native = new NativeCoordinatorClient(sanitize(config, 'configuration'));
|
|
110
|
+
} catch (error) {
|
|
111
|
+
throw normalized(error, 'configuration');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
for (const [method, jsonIndexes] of [
|
|
117
|
+
['start', [2]],
|
|
118
|
+
['workflow', []],
|
|
119
|
+
['status', []],
|
|
120
|
+
['inspect', []],
|
|
121
|
+
['reconcile', []],
|
|
122
|
+
['list', []],
|
|
123
|
+
['retrySame', []],
|
|
124
|
+
['cancel', []],
|
|
125
|
+
]) {
|
|
126
|
+
CoordinatorClient.prototype[method] = function (...args) {
|
|
127
|
+
try {
|
|
128
|
+
for (const index of jsonIndexes) {
|
|
129
|
+
if (args[index] !== undefined && args[index] !== null) {
|
|
130
|
+
args[index] = sanitize(args[index], 'invalid-request');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return this.native[method](...args).catch((error) => { throw normalized(error, 'protocol'); });
|
|
134
|
+
} catch (error) {
|
|
135
|
+
throw normalized(error, 'invalid-request');
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
module.exports = { CoordinatorClient, CoordinatorClientError };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export declare class CoordinatorClient {
|
|
5
|
+
constructor(config: import('./client').CoordinatorClientConfig)
|
|
6
|
+
start(token: string, idempotencyKey: string, request: import('./client').StartRunRequest): Promise<import('./client').CoordinatorOutcome<import('./client').RunStatus>>
|
|
7
|
+
workflow(token: string, workflow: string): Promise<import('./client').CoordinatorOutcome<import('./client').WorkflowContract>>
|
|
8
|
+
status(token: string, runId: import('./client').RunId): Promise<import('./client').CoordinatorOutcome<import('./client').RunStatus>>
|
|
9
|
+
inspect(token: string, runId: import('./client').RunId): Promise<import('./client').CoordinatorOutcome<import('./client').RunInspection>>
|
|
10
|
+
reconcile(token: string, runId: import('./client').RunId, reason: string): Promise<import('./client').CoordinatorOutcome<import('./client').RunInspection>>
|
|
11
|
+
list(token: string, limit: number, cursor?: string | null, state?: import('./client').RunListState | null, attention?: boolean | null): Promise<import('./client').CoordinatorOutcome<import('./client').RunList>>
|
|
12
|
+
retrySame(token: string, runId: import('./client').RunId, reason: string): Promise<import('./client').CoordinatorOutcome<import('./client').RetryScheduled>>
|
|
13
|
+
cancel(token: string, runId: import('./client').RunId, reason: string): Promise<import('./client').CoordinatorOutcome<import('./client').RunStatus>>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CoordinatorOutcome {
|
|
17
|
+
kind: 'complete'
|
|
18
|
+
value: unknown
|
|
19
|
+
}
|
package/discovery/client.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export type ServiceKind = 'evidence';
|
|
|
2
2
|
|
|
3
3
|
export interface DiscoveryClientOptions {
|
|
4
4
|
baseUrl: string;
|
|
5
|
-
|
|
5
|
+
attemptTimeoutMilliseconds?: number;
|
|
6
6
|
connectTimeoutMilliseconds?: number;
|
|
7
7
|
maximumResponseBytes?: number;
|
|
8
|
-
trustedRootCertificates?:
|
|
8
|
+
trustedRootCertificates?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface EvidenceTypeResolveRequest {
|
package/discovery/client.js
CHANGED
|
@@ -158,7 +158,7 @@ function configurationValue(options) {
|
|
|
158
158
|
}
|
|
159
159
|
const allowed = new Set([
|
|
160
160
|
'baseUrl',
|
|
161
|
-
'
|
|
161
|
+
'attemptTimeoutMilliseconds',
|
|
162
162
|
'connectTimeoutMilliseconds',
|
|
163
163
|
'maximumResponseBytes',
|
|
164
164
|
'trustedRootCertificates',
|
|
@@ -172,10 +172,10 @@ function configurationValue(options) {
|
|
|
172
172
|
}
|
|
173
173
|
const value = descriptor.value;
|
|
174
174
|
if (key === 'trustedRootCertificates') {
|
|
175
|
-
if (
|
|
175
|
+
if (typeof value !== 'string' || Buffer.byteLength(value, 'utf8') > 4 * 1024 * 1024) {
|
|
176
176
|
throw inputError('configuration');
|
|
177
177
|
}
|
|
178
|
-
copy[key] =
|
|
178
|
+
copy[key] = value;
|
|
179
179
|
} else if (key === 'baseUrl') {
|
|
180
180
|
if (typeof value !== 'string') throw inputError('configuration');
|
|
181
181
|
copy[key] = value;
|
package/discovery/index.d.ts
CHANGED
|
@@ -13,10 +13,10 @@ export declare class DiscoveryClient {
|
|
|
13
13
|
|
|
14
14
|
export interface DiscoveryClientOptions {
|
|
15
15
|
baseUrl: string
|
|
16
|
-
|
|
16
|
+
attemptTimeoutMilliseconds?: number
|
|
17
17
|
connectTimeoutMilliseconds?: number
|
|
18
18
|
maximumResponseBytes?: number
|
|
19
|
-
trustedRootCertificates?:
|
|
19
|
+
trustedRootCertificates?: string
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export declare function renewUnchangedSelection(previous: any, current: any): any
|
package/evidence/client.d.ts
CHANGED
|
@@ -120,8 +120,8 @@ export interface PrivateKeyJwtConfig {
|
|
|
120
120
|
scopes?: ReadonlyArray<string>
|
|
121
121
|
assertionLifetimeSeconds?: number
|
|
122
122
|
refreshMarginSeconds?: number
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
attemptTimeoutMilliseconds?: number
|
|
124
|
+
connectTimeoutMilliseconds?: number
|
|
125
125
|
userAgent?: string
|
|
126
126
|
/** Additional trust roots for the token endpoint, as a PEM bundle. */
|
|
127
127
|
trustedRootCertificates?: string
|
|
@@ -151,11 +151,8 @@ export interface EvidenceExchangeContext {
|
|
|
151
151
|
* This is not a `PrivateKeyJwtConfig`, even though the two describe the same
|
|
152
152
|
* kind of client: an exchange is pinned to one resource and scope set, so both
|
|
153
153
|
* are required here, and the object is read by the shared exchange
|
|
154
|
-
* configuration parser rather than by the binding's own reader
|
|
155
|
-
*
|
|
156
|
-
* `requestTimeoutMilliseconds` and `requestTimeoutSeconds`, and at most one of
|
|
157
|
-
* `connectTimeoutMilliseconds` and `connectTimeoutSeconds`; naming both of a
|
|
158
|
-
* pair is refused.
|
|
154
|
+
* configuration parser rather than by the binding's own reader. Node exposes
|
|
155
|
+
* both timeout controls in milliseconds.
|
|
159
156
|
*/
|
|
160
157
|
export interface EvidenceExchangeClientConfig {
|
|
161
158
|
tokenEndpoint: string
|
|
@@ -180,10 +177,8 @@ export interface EvidenceExchangeClientConfig {
|
|
|
180
177
|
scopes: ReadonlyArray<string>
|
|
181
178
|
assertionLifetimeSeconds?: number
|
|
182
179
|
refreshMarginSeconds?: number
|
|
183
|
-
|
|
184
|
-
requestTimeoutSeconds?: number
|
|
180
|
+
attemptTimeoutMilliseconds?: number
|
|
185
181
|
connectTimeoutMilliseconds?: number
|
|
186
|
-
connectTimeoutSeconds?: number
|
|
187
182
|
userAgent?: string
|
|
188
183
|
/** Additional trust roots for the token endpoint, as a PEM bundle. */
|
|
189
184
|
trustedRootCertificates?: string
|
|
@@ -195,10 +190,8 @@ export interface EvidenceExchangeRemoteSourceConfig {
|
|
|
195
190
|
bootstrap: EvidenceExchangeClientConfig
|
|
196
191
|
bootstrapResource: string
|
|
197
192
|
bootstrapScope: string
|
|
198
|
-
|
|
199
|
-
requestTimeoutSeconds?: number
|
|
193
|
+
attemptTimeoutMilliseconds?: number
|
|
200
194
|
connectTimeoutMilliseconds?: number
|
|
201
|
-
connectTimeoutSeconds?: number
|
|
202
195
|
userAgent?: string
|
|
203
196
|
/** Additional trust roots for the authority, as a PEM bundle. */
|
|
204
197
|
trustedRootCertificates?: string
|
|
@@ -220,12 +213,12 @@ export interface EvidenceClientConfig {
|
|
|
220
213
|
/** Configure exactly one of `token` or `authorization`. */
|
|
221
214
|
token?: EvidenceTokenConfig
|
|
222
215
|
authorization?: { exchange: EvidenceExchangeAuthorizationConfig }
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
attemptTimeoutMilliseconds?: number
|
|
217
|
+
connectTimeoutMilliseconds?: number
|
|
225
218
|
userAgent?: string
|
|
226
219
|
/** Additional trust roots for the deployment, as a PEM bundle. */
|
|
227
220
|
trustedRootCertificates?: string
|
|
228
|
-
|
|
221
|
+
maximumResponseBytes?: number
|
|
229
222
|
maxMetadataBytes?: number
|
|
230
223
|
}
|
|
231
224
|
|
package/evidence/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare class EvidenceClient {
|
|
|
26
26
|
* mandatory trust inputs. A key set or revoked-key list the verifier could
|
|
27
27
|
* never use is refused, exactly as the Rust configuration refuses it.
|
|
28
28
|
*
|
|
29
|
-
* `
|
|
29
|
+
* `maximumResponseBytes` bounds the signed response `send` reads.
|
|
30
30
|
* `maxMetadataBytes` bounds the documents `discover` and `fetchJwks` read,
|
|
31
31
|
* which are neither signed nor verified, and is a separate decision.
|
|
32
32
|
*/
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as coordinator from './coordinator/client'
|
|
1
2
|
import * as discovery from './discovery/client'
|
|
2
3
|
import * as evidence from './evidence/client'
|
|
3
4
|
import * as breg from './breg/client'
|
|
@@ -5,4 +6,4 @@ import * as casework from './casework/client'
|
|
|
5
6
|
import * as messaging from './messaging/client'
|
|
6
7
|
import * as scheduling from './scheduling/client'
|
|
7
8
|
|
|
8
|
-
export { discovery, evidence, breg, casework, messaging, scheduling }
|
|
9
|
+
export { discovery, evidence, breg, casework, messaging, scheduling, coordinator }
|
package/index.js
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
// One assignment per namespace, never a `module.exports` object literal: Node
|
|
4
4
|
// scans this file for these statements to synthesise the named exports an ESM
|
|
5
|
-
// consumer imports, and `require()` sees the same
|
|
5
|
+
// consumer imports, and `require()` sees the same product properties either way.
|
|
6
6
|
exports.discovery = require('./discovery/client');
|
|
7
7
|
exports.evidence = require('./evidence/client');
|
|
8
8
|
exports.breg = require('./breg/client');
|
|
9
9
|
exports.casework = require('./casework/client');
|
|
10
10
|
exports.messaging = require('./messaging/client');
|
|
11
11
|
exports.scheduling = require('./scheduling/client');
|
|
12
|
+
exports.coordinator = require('./coordinator/client');
|
package/messaging/client.d.ts
CHANGED
|
@@ -9,18 +9,19 @@ export type JsonValue = JsonScalar | ReadonlyArray<JsonValue> | { readonly [key:
|
|
|
9
9
|
|
|
10
10
|
export interface MessagingClientConfig {
|
|
11
11
|
baseUrl: string
|
|
12
|
-
|
|
13
|
-
connectTimeoutMilliseconds?: SafeInteger
|
|
14
|
-
|
|
15
|
-
userAgent?: string
|
|
16
|
-
|
|
12
|
+
attemptTimeoutMilliseconds?: SafeInteger
|
|
13
|
+
connectTimeoutMilliseconds?: SafeInteger
|
|
14
|
+
maximumResponseBytes?: SafeInteger
|
|
15
|
+
userAgent?: string
|
|
16
|
+
/** Additional trust roots for the deployment, as PEM text. */
|
|
17
|
+
trustedRootCertificates?: string
|
|
17
18
|
/**
|
|
18
19
|
* How many times a submission whose outcome is unknown is resent,
|
|
19
20
|
* identically and under the same idempotency key, before its error is
|
|
20
21
|
* returned: a whole number from 0 to 2, default 2; 0 sends it once. Any
|
|
21
22
|
* other value is a `configuration` error.
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
maximumMutationRetries?: SafeInteger
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export type Channel = 'email' | 'sms'
|
package/native.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const PACKAGE_VERSION = '0.
|
|
4
|
-
const PRODUCTS = new Set([
|
|
3
|
+
const PACKAGE_VERSION = '0.44.0';
|
|
4
|
+
const PRODUCTS = new Set(["breg", "casework", "coordinator", "discovery", "evidence", "messaging", "scheduling"]);
|
|
5
5
|
|
|
6
6
|
function target() {
|
|
7
7
|
if (process.platform === 'darwin' && process.arch === 'arm64') return 'darwin-arm64';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@registrystack/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.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/",
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"breg",
|
|
16
16
|
"casework",
|
|
17
17
|
"messaging",
|
|
18
|
-
"scheduling"
|
|
18
|
+
"scheduling",
|
|
19
|
+
"render",
|
|
20
|
+
"coordinator"
|
|
19
21
|
],
|
|
20
22
|
"publishConfig": {
|
|
21
23
|
"access": "public",
|
|
@@ -32,18 +34,25 @@
|
|
|
32
34
|
".": {
|
|
33
35
|
"types": "./index.d.ts",
|
|
34
36
|
"default": "./index.js"
|
|
37
|
+
},
|
|
38
|
+
"./compatibility.json": "./compatibility.json",
|
|
39
|
+
"./coordinator": {
|
|
40
|
+
"types": "./coordinator/client.d.ts",
|
|
41
|
+
"default": "./coordinator/client.js"
|
|
35
42
|
}
|
|
36
43
|
},
|
|
37
44
|
"files": [
|
|
38
45
|
"index.js",
|
|
39
46
|
"index.d.ts",
|
|
40
47
|
"native.js",
|
|
48
|
+
"compatibility.json",
|
|
41
49
|
"discovery",
|
|
42
50
|
"evidence",
|
|
43
51
|
"breg",
|
|
44
52
|
"casework",
|
|
45
53
|
"messaging",
|
|
46
|
-
"scheduling"
|
|
54
|
+
"scheduling",
|
|
55
|
+
"coordinator"
|
|
47
56
|
],
|
|
48
57
|
"engines": {
|
|
49
58
|
"node": ">=24.11.0"
|
|
@@ -59,8 +68,8 @@
|
|
|
59
68
|
"typescript": "6.0.3"
|
|
60
69
|
},
|
|
61
70
|
"optionalDependencies": {
|
|
62
|
-
"@registrystack/client-darwin-arm64": "0.
|
|
63
|
-
"@registrystack/client-linux-arm64-gnu": "0.
|
|
64
|
-
"@registrystack/client-linux-x64-gnu": "0.
|
|
71
|
+
"@registrystack/client-darwin-arm64": "0.44.0",
|
|
72
|
+
"@registrystack/client-linux-arm64-gnu": "0.44.0",
|
|
73
|
+
"@registrystack/client-linux-x64-gnu": "0.44.0"
|
|
65
74
|
}
|
|
66
75
|
}
|