vet-data-utils-ts 0.5.22 → 0.5.24
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 +26 -1
- package/dist/health-dcat.d.ts +116 -0
- package/dist/health-dcat.js +160 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/place-service-directory.d.ts +9 -2
- package/dist/place-service-directory.js +9 -2
- package/dist/sectors.d.ts +1 -0
- package/dist/sectors.js +1 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -172,7 +172,7 @@ It is not an implemented importer API.
|
|
|
172
172
|
|
|
173
173
|
`vet-data-utils-ts/sectors` extends the frozen CORE catalog without changing
|
|
174
174
|
`gdc-common-utils-ts` or GW CORE. It adds the product-neutral
|
|
175
|
-
`public-safety`
|
|
175
|
+
`public-health` and `public-safety` values used by explicitly governed portal allowlists. Sector
|
|
176
176
|
selection classifies an organization service; it does not grant membership,
|
|
177
177
|
an occupation, an index role or access to any person or animal.
|
|
178
178
|
|
|
@@ -182,11 +182,36 @@ import { ExtendedDataspaceSectors } from 'vet-data-utils-ts/sectors'
|
|
|
182
182
|
// The portal chooses its exact subset. Do not expose the complete catalog as
|
|
183
183
|
// an authorization decision or infer capabilities from this selection.
|
|
184
184
|
const allowedSectors = [
|
|
185
|
+
ExtendedDataspaceSectors.PublicHealth,
|
|
185
186
|
ExtendedDataspaceSectors.PublicSafety,
|
|
186
187
|
ExtendedDataspaceSectors.AnimalCare,
|
|
187
188
|
] as const
|
|
188
189
|
```
|
|
189
190
|
|
|
191
|
+
## Health dataset catalogues
|
|
192
|
+
|
|
193
|
+
`vet-data-utils-ts/health-dcat` provides product-local, claims-first
|
|
194
|
+
HealthDCAT metadata for public-health, care, insurance, lab and research
|
|
195
|
+
organizations. Only the organization's controller creates its marketplace
|
|
196
|
+
Catalogue or authorizes federation by a host service to another dataspace.
|
|
197
|
+
The tenant remains the publisher; the host does not become the data holder.
|
|
198
|
+
|
|
199
|
+
Dataset creation records the actual holder, access level, source and
|
|
200
|
+
provenance. Spreadsheet ingestion, an individual index, a digital-twin import,
|
|
201
|
+
and pseudonymization are data-processing facts, not publication authority.
|
|
202
|
+
An intermediary therefore needs an explicit authorization reference. A
|
|
203
|
+
non-public Dataset must reference its HDAB Distribution, and structured data
|
|
204
|
+
must reference its CSVW variable TableGroup. The flat keys are compact forms
|
|
205
|
+
of DCAT-AP, HealthDCAT-AP, DPV, PROV-O and GeoDCAT-AP properties; JSON-LD/DSP
|
|
206
|
+
serialization remains an explicit transport projection.
|
|
207
|
+
|
|
208
|
+
ICA advertisement exposes the host catalogue endpoint and supported discovery
|
|
209
|
+
profile, not a tenant list. Restricted catalogue discovery references OpenID
|
|
210
|
+
Federation 1.0 trust anchors and OpenID4VP 1.0 presentation definitions;
|
|
211
|
+
catalogue exchange remains Dataspace Protocol 2025-1. X.509/TLS chain
|
|
212
|
+
validation, federation trust resolution, VP verification and catalogue
|
|
213
|
+
authorization are separate checks performed by their owning adapters.
|
|
214
|
+
|
|
190
215
|
`vet-data-utils-ts/organization-application` is the product-neutral application
|
|
191
216
|
value used by UHC UNID, VetChain and SOSChain adapters. The host supplies the
|
|
192
217
|
allowed sector list and translated labels. The value contains one official
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/** Product sectors whose organization UI may expose HealthDCAT publication. */
|
|
2
|
+
export declare const HealthDcatPublisherSectors: readonly ["public-health", "animal-care", "health-care", "animal-insurance", "health-insurance", "onehealth-insurance", "animal-lab", "health-lab", "onehealth-lab", "animal-research", "health-research", "onehealth-research"];
|
|
3
|
+
export type HealthDcatPublisherSector = typeof HealthDcatPublisherSectors[number];
|
|
4
|
+
export type HealthDcatAccessRights = 'PUBLIC' | 'RESTRICTED' | 'NON_PUBLIC';
|
|
5
|
+
export type HealthDcatSourceKind = 'individual-index' | 'spreadsheet-import' | 'digital-twin-import' | 'curated-dataset';
|
|
6
|
+
export type HealthDcatAnonymizationStatus = 'anonymous' | 'pseudonymized' | 'personal';
|
|
7
|
+
export type HealthDcatPublisherRole = 'data-holder' | 'authorized-intermediary';
|
|
8
|
+
type ClaimValue = string | boolean | number | readonly string[];
|
|
9
|
+
/** Standards-derived flat Dataset claims for indexed product persistence. */
|
|
10
|
+
export declare enum ClaimsHealthDcatDataset {
|
|
11
|
+
identifier = "dct.identifier",
|
|
12
|
+
title = "dct.title",
|
|
13
|
+
description = "dct.description",
|
|
14
|
+
creator = "dct.creator",
|
|
15
|
+
publisher = "dct.publisher",
|
|
16
|
+
custodian = "geodcatap.custodian",
|
|
17
|
+
accessRights = "dct.accessRights",
|
|
18
|
+
applicableLegislation = "dcatap.applicableLegislation",
|
|
19
|
+
distribution = "dcat.distribution",
|
|
20
|
+
source = "dct.source",
|
|
21
|
+
provenance = "dct.provenance",
|
|
22
|
+
personalData = "dpv.hasPersonalData",
|
|
23
|
+
healthCategory = "healthdcatap.healthCategory",
|
|
24
|
+
healthDataAccessBody = "healthdcatap.hdab",
|
|
25
|
+
structuredData = "healthdcatap.hasStructuredData",
|
|
26
|
+
variables = "healthdcatap.hasVariables",
|
|
27
|
+
authorizationReference = "prov.qualifiedAttribution",
|
|
28
|
+
userSelected = "Dataset.user-selected"
|
|
29
|
+
}
|
|
30
|
+
/** Standards-derived flat Catalogue claims for indexed product persistence. */
|
|
31
|
+
export declare enum ClaimsHealthDcatCatalog {
|
|
32
|
+
identifier = "dct.identifier",
|
|
33
|
+
title = "dct.title",
|
|
34
|
+
description = "dct.description",
|
|
35
|
+
creator = "dct.creator",
|
|
36
|
+
publisher = "dct.publisher",
|
|
37
|
+
applicableLegislation = "dcatap.applicableLegislation",
|
|
38
|
+
dataset = "dcat.dataset",
|
|
39
|
+
userSelected = "Catalog.user-selected"
|
|
40
|
+
}
|
|
41
|
+
export type HealthDcatResource = Readonly<{
|
|
42
|
+
resourceType: 'Dataset' | 'Catalog';
|
|
43
|
+
id: string;
|
|
44
|
+
meta: Readonly<{
|
|
45
|
+
claims: Readonly<Record<string, ClaimValue>>;
|
|
46
|
+
}>;
|
|
47
|
+
}>;
|
|
48
|
+
type ControllerAuthority = Readonly<{
|
|
49
|
+
organizationIdentifier: string;
|
|
50
|
+
controllerIdentifier: string;
|
|
51
|
+
actingControllerIdentifier: string;
|
|
52
|
+
}>;
|
|
53
|
+
/** Builds a claims-first HealthDCAT Dataset description under explicit tenant authority. */
|
|
54
|
+
export declare function buildHealthDcatDataset(input: ControllerAuthority & Readonly<{
|
|
55
|
+
sector: HealthDcatPublisherSector;
|
|
56
|
+
id: string;
|
|
57
|
+
title: string;
|
|
58
|
+
description: string;
|
|
59
|
+
publisherRole: HealthDcatPublisherRole;
|
|
60
|
+
dataHolderIdentifier: string;
|
|
61
|
+
authorizationReference?: string;
|
|
62
|
+
sourceKind: HealthDcatSourceKind;
|
|
63
|
+
sourceReference: string;
|
|
64
|
+
accessRights: HealthDcatAccessRights;
|
|
65
|
+
anonymizationStatus: HealthDcatAnonymizationStatus;
|
|
66
|
+
healthCategory: readonly string[];
|
|
67
|
+
healthDataAccessBodyIdentifier: string;
|
|
68
|
+
structuredData: boolean;
|
|
69
|
+
variableTableGroupIdentifiers?: readonly string[];
|
|
70
|
+
distributionIdentifiers: readonly string[];
|
|
71
|
+
applicableLegislation: readonly string[];
|
|
72
|
+
}>): HealthDcatResource;
|
|
73
|
+
/** Builds the tenant-owned marketplace Catalogue; creation is controller-only. */
|
|
74
|
+
export declare function buildHealthDcatCatalog(input: ControllerAuthority & Readonly<{
|
|
75
|
+
id: string;
|
|
76
|
+
title: string;
|
|
77
|
+
description: string;
|
|
78
|
+
datasetIdentifiers: readonly string[];
|
|
79
|
+
applicableLegislation: readonly string[];
|
|
80
|
+
}>): HealthDcatResource;
|
|
81
|
+
/** Creates an auditable tenant authorization for host-provided catalogue federation. */
|
|
82
|
+
export declare function buildHealthDcatFederationRequest(input: ControllerAuthority & Readonly<{
|
|
83
|
+
catalogIdentifier: string;
|
|
84
|
+
hostServiceProviderIdentifier: string;
|
|
85
|
+
destinationDataspaceIdentifier: string;
|
|
86
|
+
}>): Readonly<{
|
|
87
|
+
catalogIdentifier: string;
|
|
88
|
+
publisherIdentifier: string;
|
|
89
|
+
hostServiceProviderIdentifier: string;
|
|
90
|
+
destinationDataspaceIdentifier: string;
|
|
91
|
+
authorizedBy: string;
|
|
92
|
+
}>;
|
|
93
|
+
/** Advertises a host catalogue endpoint in ICA without leaking tenant inventory. */
|
|
94
|
+
export declare function buildCatalogHostAdvertisement(input: Readonly<{
|
|
95
|
+
hostIdentifier: string;
|
|
96
|
+
catalogEndpoint: string;
|
|
97
|
+
tenantDiscovery: 'public' | 'openid4vp';
|
|
98
|
+
}>): Readonly<{
|
|
99
|
+
hostIdentifier: string;
|
|
100
|
+
catalogEndpoint: string;
|
|
101
|
+
catalogProtocol: 'dataspace-protocol-2025-1';
|
|
102
|
+
tenantDiscovery: 'public' | 'openid4vp';
|
|
103
|
+
}>;
|
|
104
|
+
/** References standard trust and presentation protocols for restricted catalogue discovery. */
|
|
105
|
+
export declare function buildCatalogDiscoveryPolicy(input: Readonly<{
|
|
106
|
+
visibility: 'public' | 'trusted-federation' | 'private';
|
|
107
|
+
trustAnchorIdentifiers?: readonly string[];
|
|
108
|
+
presentationDefinitionUri?: string;
|
|
109
|
+
}>): Readonly<{
|
|
110
|
+
visibility: 'public' | 'trusted-federation' | 'private';
|
|
111
|
+
trustResolution?: 'openid-federation-1.0';
|
|
112
|
+
presentationProtocol?: 'openid4vp-1.0';
|
|
113
|
+
trustAnchorIdentifiers?: readonly string[];
|
|
114
|
+
presentationDefinitionUri?: string;
|
|
115
|
+
}>;
|
|
116
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Copyright 2026 Connecting Solution & Applications Ltd under the Apache License, Version 2.0.
|
|
2
|
+
/** Product sectors whose organization UI may expose HealthDCAT publication. */
|
|
3
|
+
export const HealthDcatPublisherSectors = Object.freeze([
|
|
4
|
+
'public-health',
|
|
5
|
+
'animal-care', 'health-care',
|
|
6
|
+
'animal-insurance', 'health-insurance', 'onehealth-insurance',
|
|
7
|
+
'animal-lab', 'health-lab', 'onehealth-lab',
|
|
8
|
+
'animal-research', 'health-research', 'onehealth-research',
|
|
9
|
+
]);
|
|
10
|
+
/** Standards-derived flat Dataset claims for indexed product persistence. */
|
|
11
|
+
export var ClaimsHealthDcatDataset;
|
|
12
|
+
(function (ClaimsHealthDcatDataset) {
|
|
13
|
+
ClaimsHealthDcatDataset["identifier"] = "dct.identifier";
|
|
14
|
+
ClaimsHealthDcatDataset["title"] = "dct.title";
|
|
15
|
+
ClaimsHealthDcatDataset["description"] = "dct.description";
|
|
16
|
+
ClaimsHealthDcatDataset["creator"] = "dct.creator";
|
|
17
|
+
ClaimsHealthDcatDataset["publisher"] = "dct.publisher";
|
|
18
|
+
ClaimsHealthDcatDataset["custodian"] = "geodcatap.custodian";
|
|
19
|
+
ClaimsHealthDcatDataset["accessRights"] = "dct.accessRights";
|
|
20
|
+
ClaimsHealthDcatDataset["applicableLegislation"] = "dcatap.applicableLegislation";
|
|
21
|
+
ClaimsHealthDcatDataset["distribution"] = "dcat.distribution";
|
|
22
|
+
ClaimsHealthDcatDataset["source"] = "dct.source";
|
|
23
|
+
ClaimsHealthDcatDataset["provenance"] = "dct.provenance";
|
|
24
|
+
ClaimsHealthDcatDataset["personalData"] = "dpv.hasPersonalData";
|
|
25
|
+
ClaimsHealthDcatDataset["healthCategory"] = "healthdcatap.healthCategory";
|
|
26
|
+
ClaimsHealthDcatDataset["healthDataAccessBody"] = "healthdcatap.hdab";
|
|
27
|
+
ClaimsHealthDcatDataset["structuredData"] = "healthdcatap.hasStructuredData";
|
|
28
|
+
ClaimsHealthDcatDataset["variables"] = "healthdcatap.hasVariables";
|
|
29
|
+
ClaimsHealthDcatDataset["authorizationReference"] = "prov.qualifiedAttribution";
|
|
30
|
+
ClaimsHealthDcatDataset["userSelected"] = "Dataset.user-selected";
|
|
31
|
+
})(ClaimsHealthDcatDataset || (ClaimsHealthDcatDataset = {}));
|
|
32
|
+
/** Standards-derived flat Catalogue claims for indexed product persistence. */
|
|
33
|
+
export var ClaimsHealthDcatCatalog;
|
|
34
|
+
(function (ClaimsHealthDcatCatalog) {
|
|
35
|
+
ClaimsHealthDcatCatalog["identifier"] = "dct.identifier";
|
|
36
|
+
ClaimsHealthDcatCatalog["title"] = "dct.title";
|
|
37
|
+
ClaimsHealthDcatCatalog["description"] = "dct.description";
|
|
38
|
+
ClaimsHealthDcatCatalog["creator"] = "dct.creator";
|
|
39
|
+
ClaimsHealthDcatCatalog["publisher"] = "dct.publisher";
|
|
40
|
+
ClaimsHealthDcatCatalog["applicableLegislation"] = "dcatap.applicableLegislation";
|
|
41
|
+
ClaimsHealthDcatCatalog["dataset"] = "dcat.dataset";
|
|
42
|
+
ClaimsHealthDcatCatalog["userSelected"] = "Catalog.user-selected";
|
|
43
|
+
})(ClaimsHealthDcatCatalog || (ClaimsHealthDcatCatalog = {}));
|
|
44
|
+
function required(value, field) {
|
|
45
|
+
const normalized = value.trim();
|
|
46
|
+
if (!normalized)
|
|
47
|
+
throw new Error(`${field} is required`);
|
|
48
|
+
return normalized;
|
|
49
|
+
}
|
|
50
|
+
function assertController(input) {
|
|
51
|
+
if (required(input.actingControllerIdentifier, 'actingControllerIdentifier') !==
|
|
52
|
+
required(input.controllerIdentifier, 'controllerIdentifier')) {
|
|
53
|
+
throw new Error('Only the organization controller may perform this operation');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Builds a claims-first HealthDCAT Dataset description under explicit tenant authority. */
|
|
57
|
+
export function buildHealthDcatDataset(input) {
|
|
58
|
+
assertController(input);
|
|
59
|
+
if (!HealthDcatPublisherSectors.includes(input.sector)) {
|
|
60
|
+
throw new Error(`Sector ${input.sector} cannot publish HealthDCAT metadata`);
|
|
61
|
+
}
|
|
62
|
+
if (input.publisherRole === 'authorized-intermediary' && !input.authorizationReference?.trim()) {
|
|
63
|
+
throw new Error('authorizationReference is required for an authorized intermediary');
|
|
64
|
+
}
|
|
65
|
+
if (input.healthCategory.length === 0)
|
|
66
|
+
throw new Error('healthCategory is required');
|
|
67
|
+
if (input.applicableLegislation.length === 0)
|
|
68
|
+
throw new Error('applicableLegislation is required');
|
|
69
|
+
if (input.accessRights === 'NON_PUBLIC' && input.distributionIdentifiers.length === 0) {
|
|
70
|
+
throw new Error('A non-public Dataset requires an HDAB Distribution');
|
|
71
|
+
}
|
|
72
|
+
if (input.structuredData && !input.variableTableGroupIdentifiers?.length) {
|
|
73
|
+
throw new Error('Structured data requires variableTableGroupIdentifiers');
|
|
74
|
+
}
|
|
75
|
+
const organizationIdentifier = required(input.organizationIdentifier, 'organizationIdentifier');
|
|
76
|
+
const sourceReference = required(input.sourceReference, 'sourceReference');
|
|
77
|
+
const claims = {
|
|
78
|
+
[ClaimsHealthDcatDataset.identifier]: required(input.id, 'id'),
|
|
79
|
+
[ClaimsHealthDcatDataset.title]: required(input.title, 'title'),
|
|
80
|
+
[ClaimsHealthDcatDataset.description]: required(input.description, 'description'),
|
|
81
|
+
[ClaimsHealthDcatDataset.creator]: input.controllerIdentifier,
|
|
82
|
+
[ClaimsHealthDcatDataset.publisher]: organizationIdentifier,
|
|
83
|
+
[ClaimsHealthDcatDataset.custodian]: required(input.dataHolderIdentifier, 'dataHolderIdentifier'),
|
|
84
|
+
[ClaimsHealthDcatDataset.accessRights]: input.accessRights,
|
|
85
|
+
[ClaimsHealthDcatDataset.applicableLegislation]: Object.freeze([...input.applicableLegislation]),
|
|
86
|
+
[ClaimsHealthDcatDataset.distribution]: Object.freeze([...input.distributionIdentifiers]),
|
|
87
|
+
[ClaimsHealthDcatDataset.source]: sourceReference,
|
|
88
|
+
[ClaimsHealthDcatDataset.provenance]: `${input.sourceKind}:${sourceReference}`,
|
|
89
|
+
[ClaimsHealthDcatDataset.personalData]: input.anonymizationStatus !== 'anonymous',
|
|
90
|
+
[ClaimsHealthDcatDataset.healthCategory]: Object.freeze([...input.healthCategory]),
|
|
91
|
+
[ClaimsHealthDcatDataset.healthDataAccessBody]: required(input.healthDataAccessBodyIdentifier, 'healthDataAccessBodyIdentifier'),
|
|
92
|
+
[ClaimsHealthDcatDataset.structuredData]: input.structuredData,
|
|
93
|
+
[ClaimsHealthDcatDataset.userSelected]: true,
|
|
94
|
+
};
|
|
95
|
+
if (input.variableTableGroupIdentifiers?.length) {
|
|
96
|
+
claims[ClaimsHealthDcatDataset.variables] = Object.freeze([...input.variableTableGroupIdentifiers]);
|
|
97
|
+
}
|
|
98
|
+
if (input.authorizationReference) {
|
|
99
|
+
claims[ClaimsHealthDcatDataset.authorizationReference] = input.authorizationReference;
|
|
100
|
+
}
|
|
101
|
+
return Object.freeze({ resourceType: 'Dataset', id: input.id, meta: Object.freeze({ claims: Object.freeze(claims) }) });
|
|
102
|
+
}
|
|
103
|
+
/** Builds the tenant-owned marketplace Catalogue; creation is controller-only. */
|
|
104
|
+
export function buildHealthDcatCatalog(input) {
|
|
105
|
+
assertController(input);
|
|
106
|
+
if (input.applicableLegislation.length === 0)
|
|
107
|
+
throw new Error('applicableLegislation is required');
|
|
108
|
+
const claims = {
|
|
109
|
+
[ClaimsHealthDcatCatalog.identifier]: required(input.id, 'id'),
|
|
110
|
+
[ClaimsHealthDcatCatalog.title]: required(input.title, 'title'),
|
|
111
|
+
[ClaimsHealthDcatCatalog.description]: required(input.description, 'description'),
|
|
112
|
+
[ClaimsHealthDcatCatalog.creator]: input.controllerIdentifier,
|
|
113
|
+
[ClaimsHealthDcatCatalog.publisher]: required(input.organizationIdentifier, 'organizationIdentifier'),
|
|
114
|
+
[ClaimsHealthDcatCatalog.applicableLegislation]: Object.freeze([...input.applicableLegislation]),
|
|
115
|
+
[ClaimsHealthDcatCatalog.dataset]: Object.freeze([...input.datasetIdentifiers]),
|
|
116
|
+
[ClaimsHealthDcatCatalog.userSelected]: true,
|
|
117
|
+
};
|
|
118
|
+
return Object.freeze({ resourceType: 'Catalog', id: input.id, meta: Object.freeze({ claims: Object.freeze(claims) }) });
|
|
119
|
+
}
|
|
120
|
+
/** Creates an auditable tenant authorization for host-provided catalogue federation. */
|
|
121
|
+
export function buildHealthDcatFederationRequest(input) {
|
|
122
|
+
assertController(input);
|
|
123
|
+
return Object.freeze({
|
|
124
|
+
catalogIdentifier: required(input.catalogIdentifier, 'catalogIdentifier'),
|
|
125
|
+
publisherIdentifier: required(input.organizationIdentifier, 'organizationIdentifier'),
|
|
126
|
+
hostServiceProviderIdentifier: required(input.hostServiceProviderIdentifier, 'hostServiceProviderIdentifier'),
|
|
127
|
+
destinationDataspaceIdentifier: required(input.destinationDataspaceIdentifier, 'destinationDataspaceIdentifier'),
|
|
128
|
+
authorizedBy: input.controllerIdentifier,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/** Advertises a host catalogue endpoint in ICA without leaking tenant inventory. */
|
|
132
|
+
export function buildCatalogHostAdvertisement(input) {
|
|
133
|
+
const endpoint = required(input.catalogEndpoint, 'catalogEndpoint');
|
|
134
|
+
if (!endpoint.startsWith('https://'))
|
|
135
|
+
throw new Error('catalogEndpoint must use HTTPS');
|
|
136
|
+
return Object.freeze({
|
|
137
|
+
hostIdentifier: required(input.hostIdentifier, 'hostIdentifier'),
|
|
138
|
+
catalogEndpoint: endpoint,
|
|
139
|
+
catalogProtocol: 'dataspace-protocol-2025-1',
|
|
140
|
+
tenantDiscovery: input.tenantDiscovery,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** References standard trust and presentation protocols for restricted catalogue discovery. */
|
|
144
|
+
export function buildCatalogDiscoveryPolicy(input) {
|
|
145
|
+
if (input.visibility === 'trusted-federation') {
|
|
146
|
+
if (!input.trustAnchorIdentifiers?.length)
|
|
147
|
+
throw new Error('trustAnchorIdentifiers are required');
|
|
148
|
+
const presentationDefinitionUri = required(input.presentationDefinitionUri ?? '', 'presentationDefinitionUri');
|
|
149
|
+
if (!presentationDefinitionUri.startsWith('https://'))
|
|
150
|
+
throw new Error('presentationDefinitionUri must use HTTPS');
|
|
151
|
+
return Object.freeze({
|
|
152
|
+
visibility: input.visibility,
|
|
153
|
+
trustResolution: 'openid-federation-1.0',
|
|
154
|
+
presentationProtocol: 'openid4vp-1.0',
|
|
155
|
+
trustAnchorIdentifiers: Object.freeze([...input.trustAnchorIdentifiers]),
|
|
156
|
+
presentationDefinitionUri,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return Object.freeze({ visibility: input.visibility });
|
|
160
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './digital-twin.js';
|
|
|
7
7
|
export * from './emergency.js';
|
|
8
8
|
export * from './financial.js';
|
|
9
9
|
export * from './group.js';
|
|
10
|
+
export * from './health-dcat.js';
|
|
10
11
|
export * from './immunization.js';
|
|
11
12
|
export * from './international-health-card.js';
|
|
12
13
|
export * from './index-projection-tags.js';
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from './digital-twin.js';
|
|
|
7
7
|
export * from './emergency.js';
|
|
8
8
|
export * from './financial.js';
|
|
9
9
|
export * from './group.js';
|
|
10
|
+
export * from './health-dcat.js';
|
|
10
11
|
export * from './immunization.js';
|
|
11
12
|
export * from './international-health-card.js';
|
|
12
13
|
export * from './index-projection-tags.js';
|
|
@@ -152,6 +152,13 @@ export declare const OrganizationOfferingKinds: Readonly<{
|
|
|
152
152
|
readonly 'animal-care': "Service";
|
|
153
153
|
readonly 'animal-insurance': "Product";
|
|
154
154
|
}>;
|
|
155
|
+
/** Complete VetChain organization-sector presentation allowlist. */
|
|
156
|
+
export declare const OrganizationOfferingKindsBySector: Readonly<{
|
|
157
|
+
readonly 'animal-care': readonly ["Service"];
|
|
158
|
+
readonly 'animal-insurance': readonly ["Product"];
|
|
159
|
+
readonly 'animal-tech': readonly ["Service", "Product"];
|
|
160
|
+
readonly 'animal-research': readonly ["Service"];
|
|
161
|
+
}>;
|
|
155
162
|
/** Stable Eclipse Dataspace Protocol 2025-1 identifiers, including current editorial errata. */
|
|
156
163
|
export declare const DataspaceProtocol2025: Readonly<{
|
|
157
164
|
readonly release: "2025-1-err1";
|
|
@@ -318,7 +325,7 @@ export declare function buildOrganizationOfferCatalog(input: Readonly<{
|
|
|
318
325
|
id: string;
|
|
319
326
|
name: string;
|
|
320
327
|
organizationIdentifier: string;
|
|
321
|
-
sector: keyof typeof
|
|
328
|
+
sector: keyof typeof OrganizationOfferingKindsBySector;
|
|
322
329
|
offerings: readonly (DirectoryResource | DirectoryFlatClaimsResource)[];
|
|
323
330
|
}>): Readonly<{
|
|
324
331
|
'@context': "https://schema.org";
|
|
@@ -333,7 +340,7 @@ export declare function buildOrganizationOfferCatalog(input: Readonly<{
|
|
|
333
340
|
itemListElement: readonly Readonly<{
|
|
334
341
|
'@type': "Offer";
|
|
335
342
|
itemOffered: Readonly<{
|
|
336
|
-
'@type': "Service" | "Product";
|
|
343
|
+
'@type': "Place" | "Service" | "Product";
|
|
337
344
|
identifier: string;
|
|
338
345
|
name: string;
|
|
339
346
|
}>;
|
|
@@ -68,6 +68,13 @@ export const OrganizationOfferingKinds = Object.freeze({
|
|
|
68
68
|
'animal-care': 'Service',
|
|
69
69
|
'animal-insurance': 'Product',
|
|
70
70
|
});
|
|
71
|
+
/** Complete VetChain organization-sector presentation allowlist. */
|
|
72
|
+
export const OrganizationOfferingKindsBySector = Object.freeze({
|
|
73
|
+
'animal-care': Object.freeze(['Service']),
|
|
74
|
+
'animal-insurance': Object.freeze(['Product']),
|
|
75
|
+
'animal-tech': Object.freeze(['Service', 'Product']),
|
|
76
|
+
'animal-research': Object.freeze(['Service']),
|
|
77
|
+
});
|
|
71
78
|
/** Stable Eclipse Dataspace Protocol 2025-1 identifiers, including current editorial errata. */
|
|
72
79
|
export const DataspaceProtocol2025 = Object.freeze({
|
|
73
80
|
release: '2025-1-err1',
|
|
@@ -434,10 +441,10 @@ export function projectProductToFhirR5InsurancePlan(product) {
|
|
|
434
441
|
}
|
|
435
442
|
/** Builds the Schema.org JSON-LD OfferCatalog presented by one organization. */
|
|
436
443
|
export function buildOrganizationOfferCatalog(input) {
|
|
437
|
-
const
|
|
444
|
+
const allowedKinds = OrganizationOfferingKindsBySector[input.sector];
|
|
438
445
|
const organizationIdentifier = required(input.organizationIdentifier, 'organization_identifier_required');
|
|
439
446
|
const itemListElement = input.offerings.map(offering => {
|
|
440
|
-
if (offering.resourceType
|
|
447
|
+
if (!allowedKinds.includes(offering.resourceType))
|
|
441
448
|
throw new TypeError('organization_offering_kind_invalid');
|
|
442
449
|
const isService = offering.resourceType === 'Service';
|
|
443
450
|
const nameClaim = isService ? ClaimsDirectoryServiceSchemaorg.name : ClaimsProductSchemaorg.name;
|
package/dist/sectors.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* the value grants no organization role, membership or data capability.
|
|
7
7
|
*/
|
|
8
8
|
export declare const ExtendedDataspaceSectors: Readonly<{
|
|
9
|
+
readonly PublicHealth: "public-health";
|
|
9
10
|
readonly PublicSafety: "public-safety";
|
|
10
11
|
readonly HealthCare: "health-care";
|
|
11
12
|
readonly HealthLab: "health-lab";
|
package/dist/sectors.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vet-data-utils-ts",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.24",
|
|
4
4
|
"description": "Browser-safe governed VetChain data contracts",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Connecting Solution & Applications Ltd",
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"types": "./dist/group.d.ts",
|
|
45
45
|
"default": "./dist/group.js"
|
|
46
46
|
},
|
|
47
|
+
"./health-dcat": {
|
|
48
|
+
"types": "./dist/health-dcat.d.ts",
|
|
49
|
+
"default": "./dist/health-dcat.js"
|
|
50
|
+
},
|
|
47
51
|
"./immunization": {
|
|
48
52
|
"types": "./dist/immunization.d.ts",
|
|
49
53
|
"default": "./dist/immunization.js"
|