@registrystack/client 0.38.0 → 0.40.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 -7
- package/breg/client.d.ts +120 -10
- package/breg/client.js +53 -35
- package/breg/index.d.ts +64 -2
- package/casework/client.d.ts +84 -30
- package/casework/client.js +22 -17
- package/casework/index.d.ts +7 -0
- package/discovery/client.d.ts +9 -52
- package/discovery/client.js +1 -21
- package/discovery/index.d.ts +0 -4
- package/evidence/client.d.ts +1 -1
- package/evidence/index.d.ts +3 -6
- package/index.d.ts +2 -2
- package/index.js +1 -1
- package/messaging/client.d.ts +23 -4
- package/messaging/client.js +32 -21
- package/messaging/index.d.ts +1 -10
- package/native.js +2 -2
- package/package.json +9 -9
- package/scheduling/client.d.ts +226 -0
- package/scheduling/client.js +141 -0
- package/scheduling/index.d.ts +27 -0
- package/scheduling/index.js +3 -0
- package/relay/client.d.ts +0 -460
- package/relay/client.js +0 -172
- package/relay/index.d.ts +0 -59
- package/relay/index.js +0 -3
|
@@ -0,0 +1,141 @@
|
|
|
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 SchedulingClientError extends Error {
|
|
11
|
+
constructor(envelope) {
|
|
12
|
+
super(envelope.message);
|
|
13
|
+
this.name = 'SchedulingClientError';
|
|
14
|
+
this.kind = envelope.kind;
|
|
15
|
+
this.outcomeUnknown = envelope.outcomeUnknown === true;
|
|
16
|
+
for (const field of ['code', 'title', 'detail', 'status', 'traceId', 'transportKind', 'protocolFailure']) {
|
|
17
|
+
if (envelope[field] !== undefined && envelope[field] !== null) this[field] = envelope[field];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const FALLBACK_MESSAGES = {
|
|
23
|
+
configuration: 'Scheduling client configuration is invalid',
|
|
24
|
+
'invalid-request': 'Scheduling client arguments are invalid',
|
|
25
|
+
protocol: 'Registry Scheduling client failed',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function normalized(error, fallbackKind) {
|
|
29
|
+
if (error instanceof SchedulingClientError) 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 SchedulingClientError(envelope);
|
|
34
|
+
} catch {
|
|
35
|
+
// napi argument conversion errors have no mapped envelope.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (fallbackKind) {
|
|
39
|
+
return new SchedulingClientError({
|
|
40
|
+
kind: fallbackKind,
|
|
41
|
+
message: FALLBACK_MESSAGES[fallbackKind],
|
|
42
|
+
// A rejection after the native client took the call may follow an
|
|
43
|
+
// exchange, so it leaves the outcome unknown as a native protocol
|
|
44
|
+
// failure does.
|
|
45
|
+
outcomeUnknown: fallbackKind === 'protocol',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return error;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function cloneJson(value, budget, depth, kind) {
|
|
52
|
+
if (depth > MAX_JSON_DEPTH || ++budget.nodes > MAX_JSON_NODES) throw normalized({}, kind);
|
|
53
|
+
if (value === null || typeof value === 'boolean') return value;
|
|
54
|
+
if (typeof value === 'string') {
|
|
55
|
+
budget.bytes += Buffer.byteLength(value, 'utf8');
|
|
56
|
+
if (budget.bytes > MAX_JSON_STRING_BYTES) throw normalized({}, kind);
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
if (typeof value === 'number') {
|
|
60
|
+
if (!Number.isFinite(value) || (Number.isInteger(value) && !Number.isSafeInteger(value))) {
|
|
61
|
+
throw normalized({}, kind);
|
|
62
|
+
}
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
if (value === undefined || typeof value !== 'object' || isProxy(value)) {
|
|
66
|
+
throw normalized({}, kind);
|
|
67
|
+
}
|
|
68
|
+
const array = Array.isArray(value);
|
|
69
|
+
const prototype = Object.getPrototypeOf(value);
|
|
70
|
+
if (array ? prototype !== Array.prototype : prototype !== Object.prototype && prototype !== null) {
|
|
71
|
+
throw normalized({}, kind);
|
|
72
|
+
}
|
|
73
|
+
if (budget.active.has(value)) throw normalized({}, kind);
|
|
74
|
+
budget.active.add(value);
|
|
75
|
+
try {
|
|
76
|
+
if (array) return value.map((member) => cloneJson(member, budget, depth + 1, kind));
|
|
77
|
+
const result = Object.create(null);
|
|
78
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
79
|
+
if (typeof key !== 'string') throw normalized({}, kind);
|
|
80
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
81
|
+
if (!descriptor || !Object.hasOwn(descriptor, 'value')) throw normalized({}, kind);
|
|
82
|
+
if (descriptor.enumerable) {
|
|
83
|
+
budget.bytes += Buffer.byteLength(key, 'utf8');
|
|
84
|
+
if (budget.bytes > MAX_JSON_STRING_BYTES) throw normalized({}, kind);
|
|
85
|
+
result[key] = cloneJson(descriptor.value, budget, depth + 1, kind);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return result;
|
|
89
|
+
} finally {
|
|
90
|
+
budget.active.delete(value);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// A refusal is reported as `kind`: `configuration` for the constructor's
|
|
95
|
+
// settings, `invalid-request` for a method's arguments.
|
|
96
|
+
function sanitize(value, kind) {
|
|
97
|
+
return cloneJson(value, { nodes: 0, bytes: 0, active: new WeakSet() }, 0, kind);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const NativeSchedulingClient = native.SchedulingClient;
|
|
101
|
+
|
|
102
|
+
class SchedulingClient {
|
|
103
|
+
constructor(config) {
|
|
104
|
+
try {
|
|
105
|
+
this.native = new NativeSchedulingClient(sanitize(config, 'configuration'));
|
|
106
|
+
} catch (error) {
|
|
107
|
+
throw normalized(error, 'configuration');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
for (const [method, jsonIndexes] of [
|
|
113
|
+
['getScheduling', []],
|
|
114
|
+
['listServices', []],
|
|
115
|
+
['listOfferings', []],
|
|
116
|
+
['availability', [2]],
|
|
117
|
+
['explain', []],
|
|
118
|
+
['createHold', [2]],
|
|
119
|
+
['releaseHold', []],
|
|
120
|
+
['createAppointment', [2]],
|
|
121
|
+
['getAppointment', []],
|
|
122
|
+
['listAppointments', [1, 2]],
|
|
123
|
+
['rescheduleAppointment', [3]],
|
|
124
|
+
['cancelAppointment', [3]],
|
|
125
|
+
['appointmentHistory', []],
|
|
126
|
+
['listResources', []],
|
|
127
|
+
['listLocations', []],
|
|
128
|
+
]) {
|
|
129
|
+
SchedulingClient.prototype[method] = function (...args) {
|
|
130
|
+
try {
|
|
131
|
+
for (const index of jsonIndexes) {
|
|
132
|
+
if (args[index] !== undefined && args[index] !== null) args[index] = sanitize(args[index], 'invalid-request');
|
|
133
|
+
}
|
|
134
|
+
return this.native[method](...args).catch((error) => { throw normalized(error, 'protocol'); });
|
|
135
|
+
} catch (error) {
|
|
136
|
+
throw normalized(error, 'invalid-request');
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
module.exports = { SchedulingClient, SchedulingClientError };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export declare class SchedulingClient {
|
|
5
|
+
constructor(config: any)
|
|
6
|
+
getScheduling(token: string): Promise<SchedulingOutcome>
|
|
7
|
+
listServices(token: string, cursor?: string | undefined | null): Promise<SchedulingOutcome>
|
|
8
|
+
listOfferings(token: string, cursor?: string | undefined | null): Promise<SchedulingOutcome>
|
|
9
|
+
availability(token: string, offering: string, query?: any | undefined | null): Promise<SchedulingOutcome>
|
|
10
|
+
explain(token: string, offering: string, start: string): Promise<SchedulingOutcome>
|
|
11
|
+
createHold(token: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
|
|
12
|
+
releaseHold(token: string, holdId: string): Promise<SchedulingOutcome>
|
|
13
|
+
createAppointment(token: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
|
|
14
|
+
getAppointment(token: string, appointmentId: string): Promise<SchedulingOutcome>
|
|
15
|
+
listAppointments(token: string, reference: any, page?: any | undefined | null): Promise<SchedulingOutcome>
|
|
16
|
+
rescheduleAppointment(token: string, appointmentId: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
|
|
17
|
+
cancelAppointment(token: string, appointmentId: string, idempotencyKey: string, request: any): Promise<SchedulingOutcome>
|
|
18
|
+
appointmentHistory(token: string, appointmentId: string, cursor?: string | undefined | null): Promise<SchedulingOutcome>
|
|
19
|
+
listResources(token: string, cursor?: string | undefined | null): Promise<SchedulingOutcome>
|
|
20
|
+
listLocations(token: string, cursor?: string | undefined | null): Promise<SchedulingOutcome>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface SchedulingOutcome {
|
|
24
|
+
kind: string
|
|
25
|
+
value: any
|
|
26
|
+
traceId: string
|
|
27
|
+
}
|
package/relay/client.d.ts
DELETED
|
@@ -1,460 +0,0 @@
|
|
|
1
|
-
export type JsonScalar = string | number | boolean | null
|
|
2
|
-
export type JsonValue = JsonScalar | ReadonlyArray<JsonValue> | { readonly [key: string]: JsonValue }
|
|
3
|
-
/** An integer that satisfies `Number.isSafeInteger` and the option's documented bounds. */
|
|
4
|
-
export type SafeInteger = number
|
|
5
|
-
|
|
6
|
-
export interface PrivateJwk {
|
|
7
|
-
readonly kty: string
|
|
8
|
-
readonly kid: string
|
|
9
|
-
readonly alg: string
|
|
10
|
-
readonly [member: string]: JsonValue
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PrivateKeyJwtConfig {
|
|
14
|
-
tokenEndpoint: string
|
|
15
|
-
clientId: string
|
|
16
|
-
clientKey: PrivateJwk
|
|
17
|
-
/**
|
|
18
|
-
* The audience of the client assertion (who checks the client's
|
|
19
|
-
* authentication). Defaults to the token endpoint URL. This is not the
|
|
20
|
-
* `resource` of the token request.
|
|
21
|
-
*/
|
|
22
|
-
audience?: string | null
|
|
23
|
-
/**
|
|
24
|
-
* The RFC 8707 resource indicator the token is requested for: the resource
|
|
25
|
-
* server's registered identifier, not a URL to fetch.
|
|
26
|
-
*/
|
|
27
|
-
resource?: string | null
|
|
28
|
-
/**
|
|
29
|
-
* The scopes requested for the token, sent as one space-delimited `scope`
|
|
30
|
-
* parameter. A requested scope may narrow the client's registered
|
|
31
|
-
* permission set; it can never widen it.
|
|
32
|
-
*/
|
|
33
|
-
scopes?: ReadonlyArray<string> | null
|
|
34
|
-
assertionLifetimeSeconds?: SafeInteger | null
|
|
35
|
-
refreshMarginSeconds?: SafeInteger | null
|
|
36
|
-
requestTimeoutMilliseconds?: SafeInteger | null
|
|
37
|
-
connectTimeoutMilliseconds?: SafeInteger | null
|
|
38
|
-
userAgent?: string | null
|
|
39
|
-
trustedRootCertificates?: string | null
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** One immutable verified person or grant context. Reconstruct after host source facts change. */
|
|
43
|
-
export interface ExchangeContext {
|
|
44
|
-
issuer: string
|
|
45
|
-
subject: string
|
|
46
|
-
audience: string
|
|
47
|
-
generation: string
|
|
48
|
-
deadlineSeconds: SafeInteger
|
|
49
|
-
grantId?: string | null
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export type ExchangePrivateKeyJwtConfig = PrivateKeyJwtConfig & {
|
|
53
|
-
resource: string
|
|
54
|
-
scopes: ReadonlyArray<string>
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface FirstPartyExchangeSource {
|
|
58
|
-
key: PrivateJwk
|
|
59
|
-
attributes: Readonly<Record<string, JsonValue>>
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface RemoteExchangeSource {
|
|
63
|
-
endpoint: string
|
|
64
|
-
bootstrap: ExchangePrivateKeyJwtConfig
|
|
65
|
-
bootstrapResource: string
|
|
66
|
-
bootstrapScope: string
|
|
67
|
-
requestTimeoutMilliseconds?: SafeInteger | null
|
|
68
|
-
connectTimeoutMilliseconds?: SafeInteger | null
|
|
69
|
-
userAgent?: string | null
|
|
70
|
-
trustedRootCertificates?: string | null
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export type ExchangeAuthorizationConfig =
|
|
74
|
-
| { client: ExchangePrivateKeyJwtConfig; context: ExchangeContext; firstParty: FirstPartyExchangeSource }
|
|
75
|
-
| { client: ExchangePrivateKeyJwtConfig; context: ExchangeContext; remote: RemoteExchangeSource }
|
|
76
|
-
|
|
77
|
-
export type RelayAuthorization =
|
|
78
|
-
| { static: string }
|
|
79
|
-
| { privateKeyJwt: PrivateKeyJwtConfig }
|
|
80
|
-
| { exchange: ExchangeAuthorizationConfig }
|
|
81
|
-
|
|
82
|
-
export interface RelayClientConfig {
|
|
83
|
-
baseUrl: string
|
|
84
|
-
authorization?: RelayAuthorization | null
|
|
85
|
-
requestTimeoutMilliseconds?: SafeInteger | null
|
|
86
|
-
connectTimeoutMilliseconds?: SafeInteger | null
|
|
87
|
-
userAgent?: string | null
|
|
88
|
-
maxResponseBytes?: SafeInteger | null
|
|
89
|
-
trustedRootCertificates?: string | null
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export type RecordFormat = 'json' | 'json-ld' | 'geojson' | 'json-fg'
|
|
93
|
-
|
|
94
|
-
export interface ResourceListOptions {
|
|
95
|
-
pageSize?: SafeInteger | null
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface ResourceContinuation {
|
|
99
|
-
cursor: string
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export interface RecordOptions {
|
|
103
|
-
fields?: ReadonlyArray<string> | null
|
|
104
|
-
accessProfile?: string | null
|
|
105
|
-
format?: RecordFormat | null
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface ListOptions extends RecordOptions {
|
|
109
|
-
pageSize?: SafeInteger | null
|
|
110
|
-
filters?: Readonly<Record<string, string>> | null
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export interface SearchOptions extends RecordOptions {
|
|
114
|
-
pageSize?: SafeInteger | null
|
|
115
|
-
/** `[west, south, east, north]` in WGS84 longitude/latitude degrees. */
|
|
116
|
-
bbox: readonly [number, number, number, number]
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export type LookupSelector = string | SafeInteger | boolean
|
|
120
|
-
export type LookupSelectors = Readonly<Record<string, LookupSelector>>
|
|
121
|
-
|
|
122
|
-
export interface RecordsRoute {
|
|
123
|
-
kind: 'records'
|
|
124
|
-
resource: string
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface SearchRoute {
|
|
128
|
-
kind: 'search'
|
|
129
|
-
resource: string
|
|
130
|
-
search: string
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface CollectionContinuation<Route extends RecordsRoute | SearchRoute = RecordsRoute | SearchRoute> {
|
|
134
|
-
route: Route
|
|
135
|
-
cursor: string
|
|
136
|
-
format: 'json' | 'json-ld' | 'geojson-rfc7946' | 'json-fg'
|
|
137
|
-
accessProfile?: string
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export interface SdmxDataRequest {
|
|
141
|
-
agency: string
|
|
142
|
-
resource: string
|
|
143
|
-
/** A three-part `x.y.z` SDMX version. */
|
|
144
|
-
version: string
|
|
145
|
-
key?: string | null
|
|
146
|
-
constraints?: Readonly<Record<string, string>> | null
|
|
147
|
-
offset?: SafeInteger | null
|
|
148
|
-
limit?: SafeInteger | null
|
|
149
|
-
dimensionAtObservation?: string | null
|
|
150
|
-
format?: 'json' | 'csv' | null
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export interface SdmxStructureRequest {
|
|
154
|
-
kind: 'dataflow' | 'datastructure'
|
|
155
|
-
agency: string
|
|
156
|
-
resource: string
|
|
157
|
-
/** A three-part `x.y.z` SDMX version. */
|
|
158
|
-
version: string
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface ProbeStatus {
|
|
162
|
-
status: string
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export interface Institution {
|
|
166
|
-
identifier: string
|
|
167
|
-
name: string
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface Product {
|
|
171
|
-
name: string
|
|
172
|
-
version: string
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface ApiBinding {
|
|
176
|
-
name: string
|
|
177
|
-
version: string
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface AlignmentTarget {
|
|
181
|
-
name: string
|
|
182
|
-
version: string
|
|
183
|
-
status: string
|
|
184
|
-
cfrTarget?: string
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export interface FormatProfileCapability {
|
|
188
|
-
id: string
|
|
189
|
-
uri: string
|
|
190
|
-
crs: string
|
|
191
|
-
conformsTo: ReadonlyArray<string>
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export interface WireFormatCapability {
|
|
195
|
-
id: string
|
|
196
|
-
mediaType: string
|
|
197
|
-
formatProfiles: ReadonlyArray<FormatProfileCapability>
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export interface BboxCapability {
|
|
201
|
-
crs: string
|
|
202
|
-
predicate: string
|
|
203
|
-
maximumLongitudeSpanDegrees: number
|
|
204
|
-
maximumLatitudeSpanDegrees: number
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export interface SpatialQueryCapability {
|
|
208
|
-
bbox: BboxCapability
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export interface ConsultationCapability {
|
|
212
|
-
family: 'consultation'
|
|
213
|
-
pattern: string
|
|
214
|
-
resourceIdentifier: string
|
|
215
|
-
operationIdentifier: string
|
|
216
|
-
accessProfileIdentifier: string
|
|
217
|
-
isDefault: boolean
|
|
218
|
-
disclosureProfile: string
|
|
219
|
-
schemaReference: string
|
|
220
|
-
semanticModelReference: string
|
|
221
|
-
contextReference: string
|
|
222
|
-
href: string
|
|
223
|
-
wireFormats: ReadonlyArray<WireFormatCapability>
|
|
224
|
-
spatialQuery?: SpatialQueryCapability
|
|
225
|
-
classificationReference?: string
|
|
226
|
-
processingReference?: string
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export interface SdmxProfile {
|
|
230
|
-
sdmxRestVersion: string
|
|
231
|
-
sdmxDataJsonVersion: string
|
|
232
|
-
sdmxDataCsvVersion: string
|
|
233
|
-
sdmxStructureJsonVersion: string
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface SdmxWireFormat {
|
|
237
|
-
id: string
|
|
238
|
-
mediaType: string
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export interface SdmxStructureLinks {
|
|
242
|
-
dataflow: string
|
|
243
|
-
datastructure: string
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export interface AggregateDataCapability {
|
|
247
|
-
family: 'aggregate-data'
|
|
248
|
-
pattern: string
|
|
249
|
-
statisticalDatasetIdentifier: string
|
|
250
|
-
operationIdentifier: string
|
|
251
|
-
profile: SdmxProfile
|
|
252
|
-
wireFormats: ReadonlyArray<SdmxWireFormat>
|
|
253
|
-
href: string
|
|
254
|
-
structureLinks: SdmxStructureLinks
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export type Capability = ConsultationCapability | AggregateDataCapability
|
|
258
|
-
|
|
259
|
-
export interface ServiceMetadata {
|
|
260
|
-
registryIdentifier: string
|
|
261
|
-
name: string
|
|
262
|
-
authority: Institution
|
|
263
|
-
operator: Institution | null
|
|
264
|
-
authoritativeScope: string
|
|
265
|
-
product: Product
|
|
266
|
-
apiBinding: ApiBinding
|
|
267
|
-
alignmentTargets: ReadonlyArray<AlignmentTarget>
|
|
268
|
-
capabilities: ReadonlyArray<Capability>
|
|
269
|
-
links: { self: string; resources: string; openapi: string }
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export interface ResourceDocument {
|
|
273
|
-
resourceIdentifier: string
|
|
274
|
-
title: string
|
|
275
|
-
description: string
|
|
276
|
-
semanticClass: string
|
|
277
|
-
enumerationPosture: string
|
|
278
|
-
capabilities: ReadonlyArray<Capability>
|
|
279
|
-
links: { self: string }
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export interface CursorPageInfo {
|
|
283
|
-
nextCursor: string | null
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
export interface RegistryMetadata {
|
|
287
|
-
registryIdentifier: string
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export interface ResourceCollection {
|
|
291
|
-
items: ReadonlyArray<ResourceDocument>
|
|
292
|
-
pageInfo: CursorPageInfo
|
|
293
|
-
meta: RegistryMetadata
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export interface ResourceEnvelope {
|
|
297
|
-
data: ResourceDocument
|
|
298
|
-
meta: RegistryMetadata
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
export interface RegistryRecord {
|
|
302
|
-
registryIdentifier: string
|
|
303
|
-
recordIdentifier: string
|
|
304
|
-
revisionIdentifier: string
|
|
305
|
-
lifecycleState: string
|
|
306
|
-
schemaReference: string
|
|
307
|
-
semanticModelReference: string
|
|
308
|
-
authorityIdentifier: string
|
|
309
|
-
recordedAt: string
|
|
310
|
-
domainData: Readonly<Record<string, JsonValue>>
|
|
311
|
-
'@id'?: string
|
|
312
|
-
'@type'?: string
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
export interface SourceRevision {
|
|
316
|
-
profile: string
|
|
317
|
-
status: string
|
|
318
|
-
value: string | null
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export interface RecordLinks {
|
|
322
|
-
self: string
|
|
323
|
-
context: string
|
|
324
|
-
schema: string
|
|
325
|
-
semanticModel: string
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export interface RecordMetadata {
|
|
329
|
-
operationIdentifier: string
|
|
330
|
-
accessProfile: string
|
|
331
|
-
family: string
|
|
332
|
-
pattern: string
|
|
333
|
-
disclosureProfile: string
|
|
334
|
-
contractRevision: string
|
|
335
|
-
sourceRevision: SourceRevision
|
|
336
|
-
selectedFields: ReadonlyArray<string>
|
|
337
|
-
links: RecordLinks
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
export interface RecordEnvelope {
|
|
341
|
-
data: RegistryRecord
|
|
342
|
-
meta: RecordMetadata
|
|
343
|
-
'@context'?: string
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
export interface RecordCollection {
|
|
347
|
-
items: ReadonlyArray<RegistryRecord>
|
|
348
|
-
pageInfo: CursorPageInfo
|
|
349
|
-
meta: RecordMetadata
|
|
350
|
-
'@context'?: string
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
export interface GeoJsonFeature {
|
|
354
|
-
type: string
|
|
355
|
-
id: string
|
|
356
|
-
geometry: JsonValue
|
|
357
|
-
properties: RegistryRecord
|
|
358
|
-
meta?: RecordMetadata
|
|
359
|
-
conformsTo?: ReadonlyArray<string>
|
|
360
|
-
featureType?: string
|
|
361
|
-
coordRefSys?: string
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
export interface GeoJsonFeatureCollection {
|
|
365
|
-
type: string
|
|
366
|
-
features: ReadonlyArray<GeoJsonFeature>
|
|
367
|
-
pageInfo: CursorPageInfo
|
|
368
|
-
meta: RecordMetadata
|
|
369
|
-
conformsTo?: ReadonlyArray<string>
|
|
370
|
-
featureType?: string
|
|
371
|
-
coordRefSys?: string
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
export type RecordResponse = RecordEnvelope | GeoJsonFeature
|
|
375
|
-
export type RecordCollectionResponse = RecordCollection | GeoJsonFeatureCollection
|
|
376
|
-
|
|
377
|
-
export interface CompleteOutcome<T> {
|
|
378
|
-
kind: 'complete'
|
|
379
|
-
value: T
|
|
380
|
-
traceId: string
|
|
381
|
-
etag?: string
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
export interface NotModifiedOutcome {
|
|
385
|
-
kind: 'notModified'
|
|
386
|
-
etag: string
|
|
387
|
-
traceId: string
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
export type Outcome<T> = CompleteOutcome<T> | NotModifiedOutcome
|
|
391
|
-
|
|
392
|
-
export interface ResourcePageCompleteOutcome {
|
|
393
|
-
kind: 'complete'
|
|
394
|
-
value: ResourceCollection
|
|
395
|
-
continuation?: ResourceContinuation
|
|
396
|
-
traceId: string
|
|
397
|
-
etag?: string
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export type ResourcePageOutcome = ResourcePageCompleteOutcome | NotModifiedOutcome
|
|
401
|
-
|
|
402
|
-
export interface CollectionPageCompleteOutcome {
|
|
403
|
-
kind: 'complete'
|
|
404
|
-
value: RecordCollectionResponse
|
|
405
|
-
continuation?: CollectionContinuation
|
|
406
|
-
traceId: string
|
|
407
|
-
etag?: string
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export type CollectionPageOutcome = CollectionPageCompleteOutcome | NotModifiedOutcome
|
|
411
|
-
|
|
412
|
-
export interface RawCompleteOutcome {
|
|
413
|
-
kind: 'complete'
|
|
414
|
-
body: Buffer
|
|
415
|
-
mediaType: string
|
|
416
|
-
traceId: string
|
|
417
|
-
etag?: string
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
export type RawOutcome = RawCompleteOutcome | NotModifiedOutcome
|
|
421
|
-
|
|
422
|
-
export interface RelayClientFailure extends Error {
|
|
423
|
-
readonly kind: string
|
|
424
|
-
readonly code?: string
|
|
425
|
-
readonly status?: number
|
|
426
|
-
readonly traceId?: string
|
|
427
|
-
readonly retryAfterSeconds?: number
|
|
428
|
-
readonly transportKind?: string
|
|
429
|
-
readonly tokenKind?: string
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export declare class RelayClientError extends Error implements RelayClientFailure {
|
|
433
|
-
readonly kind: string
|
|
434
|
-
readonly code?: string
|
|
435
|
-
readonly status?: number
|
|
436
|
-
readonly traceId?: string
|
|
437
|
-
readonly retryAfterSeconds?: number
|
|
438
|
-
readonly transportKind?: string
|
|
439
|
-
readonly tokenKind?: string
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
export declare class RelayClient {
|
|
443
|
-
constructor(config: RelayClientConfig)
|
|
444
|
-
health(): Promise<CompleteOutcome<ProbeStatus>>
|
|
445
|
-
ready(): Promise<CompleteOutcome<ProbeStatus>>
|
|
446
|
-
openapi(etag?: string | null): Promise<RawOutcome>
|
|
447
|
-
serviceMetadata(etag?: string | null): Promise<Outcome<ServiceMetadata>>
|
|
448
|
-
resources(options?: ResourceListOptions | null, etag?: string | null): Promise<ResourcePageOutcome>
|
|
449
|
-
continueResources(continuation: ResourceContinuation, etag?: string | null): Promise<ResourcePageOutcome>
|
|
450
|
-
resource(resource: string, etag?: string | null): Promise<Outcome<ResourceEnvelope>>
|
|
451
|
-
listRecords(resource: string, options?: ListOptions | null, etag?: string | null): Promise<CollectionPageOutcome>
|
|
452
|
-
continueListRecords(continuation: CollectionContinuation<RecordsRoute>, etag?: string | null): Promise<CollectionPageOutcome>
|
|
453
|
-
readRecord(resource: string, recordIdentifier: string, options?: RecordOptions | null, etag?: string | null): Promise<Outcome<RecordResponse>>
|
|
454
|
-
lookup(resource: string, lookup: string, selectors: LookupSelectors, options?: RecordOptions | null, etag?: string | null): Promise<Outcome<RecordResponse>>
|
|
455
|
-
search(resource: string, search: string, options: SearchOptions, etag?: string | null): Promise<CollectionPageOutcome>
|
|
456
|
-
continueSearch(continuation: CollectionContinuation<SearchRoute>, etag?: string | null): Promise<CollectionPageOutcome>
|
|
457
|
-
artifact(artifactIdentifier: string, etag?: string | null): Promise<RawOutcome>
|
|
458
|
-
sdmxData(request: SdmxDataRequest, etag?: string | null): Promise<RawOutcome>
|
|
459
|
-
sdmxStructure(request: SdmxStructureRequest, etag?: string | null): Promise<RawOutcome>
|
|
460
|
-
}
|