gdc-common-utils-ts 2.3.18 → 2.3.20
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.
|
@@ -38,6 +38,8 @@ export declare enum ClaimsSoftwareApplicationSchemaorg {
|
|
|
38
38
|
* based on Schema.org vocabulary.
|
|
39
39
|
*/
|
|
40
40
|
export declare enum ClaimsOrganizationSchemaorg {
|
|
41
|
+
/** Schema.org type discriminator for the indexed organization/member profile. */
|
|
42
|
+
additionalType = "org.schema.Organization.additionalType",
|
|
41
43
|
/** Public aliases used for exact organization or individual resolution. */
|
|
42
44
|
sameAs = "org.schema.Organization.sameAs",
|
|
43
45
|
/** ISO 3166-1 alpha-2 (two-letter country code). The jurisdiction could be the country or the region (county, province or state) */
|
|
@@ -88,6 +90,16 @@ export declare enum ClaimsOrganizationSchemaorg {
|
|
|
88
90
|
ownerIdentifierValue = "org.schema.Organization.owner.identifier.value",
|
|
89
91
|
/** Individual/family indexed member friendly name used by onboarding draft helpers. */
|
|
90
92
|
memberAlternateName = "org.schema.Organization.member.alternateName",
|
|
93
|
+
/** Public display name of the indexed member. */
|
|
94
|
+
memberName = "org.schema.Organization.member.name",
|
|
95
|
+
/**
|
|
96
|
+
* Semantic type of the indexed member.
|
|
97
|
+
*
|
|
98
|
+
* Animal onboarding uses the canonical NCBI Taxonomy OBO URI here. This
|
|
99
|
+
* distinguishes an animal without inferring species from a FHIR resource
|
|
100
|
+
* name or from an application-local flag.
|
|
101
|
+
*/
|
|
102
|
+
memberAdditionalType = "org.schema.Organization.member.additionalType",
|
|
91
103
|
memberGivenName = "org.schema.Organization.member.givenName",
|
|
92
104
|
memberFamilyName = "org.schema.Organization.member.familyName",
|
|
93
105
|
memberBirthDate = "org.schema.Organization.member.birthDate",
|
|
@@ -42,6 +42,8 @@ export var ClaimsSoftwareApplicationSchemaorg;
|
|
|
42
42
|
*/
|
|
43
43
|
export var ClaimsOrganizationSchemaorg;
|
|
44
44
|
(function (ClaimsOrganizationSchemaorg) {
|
|
45
|
+
/** Schema.org type discriminator for the indexed organization/member profile. */
|
|
46
|
+
ClaimsOrganizationSchemaorg["additionalType"] = "org.schema.Organization.additionalType";
|
|
45
47
|
/** Public aliases used for exact organization or individual resolution. */
|
|
46
48
|
ClaimsOrganizationSchemaorg["sameAs"] = "org.schema.Organization.sameAs";
|
|
47
49
|
/** ISO 3166-1 alpha-2 (two-letter country code). The jurisdiction could be the country or the region (county, province or state) */
|
|
@@ -92,6 +94,16 @@ export var ClaimsOrganizationSchemaorg;
|
|
|
92
94
|
ClaimsOrganizationSchemaorg["ownerIdentifierValue"] = "org.schema.Organization.owner.identifier.value";
|
|
93
95
|
/** Individual/family indexed member friendly name used by onboarding draft helpers. */
|
|
94
96
|
ClaimsOrganizationSchemaorg["memberAlternateName"] = "org.schema.Organization.member.alternateName";
|
|
97
|
+
/** Public display name of the indexed member. */
|
|
98
|
+
ClaimsOrganizationSchemaorg["memberName"] = "org.schema.Organization.member.name";
|
|
99
|
+
/**
|
|
100
|
+
* Semantic type of the indexed member.
|
|
101
|
+
*
|
|
102
|
+
* Animal onboarding uses the canonical NCBI Taxonomy OBO URI here. This
|
|
103
|
+
* distinguishes an animal without inferring species from a FHIR resource
|
|
104
|
+
* name or from an application-local flag.
|
|
105
|
+
*/
|
|
106
|
+
ClaimsOrganizationSchemaorg["memberAdditionalType"] = "org.schema.Organization.member.additionalType";
|
|
95
107
|
ClaimsOrganizationSchemaorg["memberGivenName"] = "org.schema.Organization.member.givenName";
|
|
96
108
|
ClaimsOrganizationSchemaorg["memberFamilyName"] = "org.schema.Organization.member.familyName";
|
|
97
109
|
ClaimsOrganizationSchemaorg["memberBirthDate"] = "org.schema.Organization.member.birthDate";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Animal-card vocabulary is owned by the consuming product SDK.
|
|
3
|
+
* Retained only so consumers of 2.3.x can migrate without a breaking removal.
|
|
4
|
+
*/
|
|
5
|
+
export declare const AnimalSubjectKinds: Readonly<{
|
|
6
|
+
readonly Animal: "animal";
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Use the species registry from the consuming product SDK.
|
|
10
|
+
* NCBI Taxonomy identifiers are external identifiers and are not a GDC model.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NcbiTaxonomy: Readonly<{
|
|
13
|
+
readonly Dog: "9615";
|
|
14
|
+
readonly Cat: "9685";
|
|
15
|
+
readonly Horse: "9796";
|
|
16
|
+
}>;
|
|
17
|
+
/** @deprecated Import the taxonomy identifier type from the product SDK. */
|
|
18
|
+
export type NcbiTaxonomyId = string;
|
|
19
|
+
/** @deprecated Import the animal onboarding input from the product SDK. */
|
|
20
|
+
export type AnimalOnboardingInput = Readonly<{
|
|
21
|
+
subjectId: string;
|
|
22
|
+
cardDidWeb: string;
|
|
23
|
+
alternateName: string;
|
|
24
|
+
legalName?: string;
|
|
25
|
+
birthDate?: string;
|
|
26
|
+
birthYear?: number;
|
|
27
|
+
gender?: 'female' | 'male' | 'other' | 'unknown';
|
|
28
|
+
ncbiTaxonomyId: NcbiTaxonomyId;
|
|
29
|
+
controllerEmail?: string;
|
|
30
|
+
controllerTelephone?: string;
|
|
31
|
+
sector?: string;
|
|
32
|
+
}>;
|
|
33
|
+
/** @deprecated Import the animal onboarding claims type from the product SDK. */
|
|
34
|
+
export type AnimalOnboardingClaims = Readonly<Record<string, string>>;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Use the taxonomy URI builder from the product SDK.
|
|
37
|
+
*
|
|
38
|
+
* Builds the canonical OBO URI for one NCBI Taxonomy numeric identifier.
|
|
39
|
+
*
|
|
40
|
+
* The URI is public taxonomy metadata, not an animal identifier. Callers must
|
|
41
|
+
* keep microchip, registry and controller identifiers in their separately
|
|
42
|
+
* typed confidential/index contracts.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buildNcbiTaxonomyUri(id: NcbiTaxonomyId): string;
|
|
45
|
+
/**
|
|
46
|
+
* @deprecated Use the animal onboarding builder from the product SDK. This
|
|
47
|
+
* compatibility implementation will be removed in the next major release.
|
|
48
|
+
*
|
|
49
|
+
* Projects one controller-authorized animal card request to the existing
|
|
50
|
+
* schema.org individual-organization claim envelope.
|
|
51
|
+
*
|
|
52
|
+
* The indexed subject is always an animal and its human actor is always a
|
|
53
|
+
* responsible controller. Login identity proves only the application session;
|
|
54
|
+
* GW must still verify the enrollment grant before accepting the request. A
|
|
55
|
+
* card must not be shown as active until the authoritative GW transaction
|
|
56
|
+
* returns success.
|
|
57
|
+
*/
|
|
58
|
+
export declare function buildAnimalOnboardingClaims(input: AnimalOnboardingInput): AnimalOnboardingClaims;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ClaimsOrganizationSchemaorg, ClaimsServiceSchemaorg } from '../constants/schemaorg.js';
|
|
2
|
+
import { DataspaceSectors } from '../constants/sectors.js';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Animal-card vocabulary is owned by the consuming product SDK.
|
|
5
|
+
* Retained only so consumers of 2.3.x can migrate without a breaking removal.
|
|
6
|
+
*/
|
|
7
|
+
export const AnimalSubjectKinds = Object.freeze({
|
|
8
|
+
Animal: 'animal',
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use the species registry from the consuming product SDK.
|
|
12
|
+
* NCBI Taxonomy identifiers are external identifiers and are not a GDC model.
|
|
13
|
+
*/
|
|
14
|
+
export const NcbiTaxonomy = Object.freeze({
|
|
15
|
+
Dog: '9615',
|
|
16
|
+
Cat: '9685',
|
|
17
|
+
Horse: '9796',
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use the taxonomy URI builder from the product SDK.
|
|
21
|
+
*
|
|
22
|
+
* Builds the canonical OBO URI for one NCBI Taxonomy numeric identifier.
|
|
23
|
+
*
|
|
24
|
+
* The URI is public taxonomy metadata, not an animal identifier. Callers must
|
|
25
|
+
* keep microchip, registry and controller identifiers in their separately
|
|
26
|
+
* typed confidential/index contracts.
|
|
27
|
+
*/
|
|
28
|
+
export function buildNcbiTaxonomyUri(id) {
|
|
29
|
+
const normalized = id.trim();
|
|
30
|
+
if (!/^[1-9]\d*$/.test(normalized)) {
|
|
31
|
+
throw new TypeError('ncbiTaxonomyId must be a positive numeric NCBI Taxonomy identifier.');
|
|
32
|
+
}
|
|
33
|
+
if (normalized === '9606') {
|
|
34
|
+
throw new TypeError('Human NCBI Taxonomy 9606 is not valid for animal onboarding.');
|
|
35
|
+
}
|
|
36
|
+
return `http://purl.obolibrary.org/obo/NCBITaxon_${normalized}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use the animal onboarding builder from the product SDK. This
|
|
40
|
+
* compatibility implementation will be removed in the next major release.
|
|
41
|
+
*
|
|
42
|
+
* Projects one controller-authorized animal card request to the existing
|
|
43
|
+
* schema.org individual-organization claim envelope.
|
|
44
|
+
*
|
|
45
|
+
* The indexed subject is always an animal and its human actor is always a
|
|
46
|
+
* responsible controller. Login identity proves only the application session;
|
|
47
|
+
* GW must still verify the enrollment grant before accepting the request. A
|
|
48
|
+
* card must not be shown as active until the authoritative GW transaction
|
|
49
|
+
* returns success.
|
|
50
|
+
*/
|
|
51
|
+
export function buildAnimalOnboardingClaims(input) {
|
|
52
|
+
const subjectId = input.subjectId.trim();
|
|
53
|
+
const cardDidWeb = input.cardDidWeb.trim();
|
|
54
|
+
const alternateName = input.alternateName.trim();
|
|
55
|
+
if (!subjectId || !cardDidWeb || !alternateName) {
|
|
56
|
+
throw new TypeError('subjectId, cardDidWeb and alternateName are required.');
|
|
57
|
+
}
|
|
58
|
+
const birthDate = input.birthDate?.trim()
|
|
59
|
+
|| (Number.isInteger(input.birthYear) ? String(input.birthYear) : '');
|
|
60
|
+
const legalName = input.legalName?.trim();
|
|
61
|
+
const gender = input.gender && input.gender !== 'unknown' ? input.gender : '';
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
'@context': 'org.schema',
|
|
64
|
+
[ClaimsOrganizationSchemaorg.identifierValue]: subjectId,
|
|
65
|
+
[ClaimsOrganizationSchemaorg.additionalType]: AnimalSubjectKinds.Animal,
|
|
66
|
+
[ClaimsOrganizationSchemaorg.alternateName]: alternateName,
|
|
67
|
+
...(legalName ? { [ClaimsOrganizationSchemaorg.legalName]: legalName } : {}),
|
|
68
|
+
[ClaimsOrganizationSchemaorg.sameAs]: cardDidWeb,
|
|
69
|
+
[ClaimsOrganizationSchemaorg.memberName]: alternateName,
|
|
70
|
+
[ClaimsOrganizationSchemaorg.memberAdditionalType]: buildNcbiTaxonomyUri(input.ncbiTaxonomyId),
|
|
71
|
+
[ClaimsOrganizationSchemaorg.memberRole]: 'RESPRSN',
|
|
72
|
+
...(birthDate ? { [ClaimsOrganizationSchemaorg.memberBirthDate]: birthDate } : {}),
|
|
73
|
+
...(gender ? { [ClaimsOrganizationSchemaorg.memberGender]: gender } : {}),
|
|
74
|
+
[ClaimsOrganizationSchemaorg.ownerEmail]: input.controllerEmail?.trim() || '',
|
|
75
|
+
[ClaimsOrganizationSchemaorg.ownerTelephone]: input.controllerTelephone?.trim() || '',
|
|
76
|
+
[ClaimsServiceSchemaorg.category]: input.sector?.trim() || DataspaceSectors.AnimalCare,
|
|
77
|
+
});
|
|
78
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export * from './interoperable-claims';
|
|
|
26
26
|
export * from './indexing';
|
|
27
27
|
export * from './identity-bootstrap';
|
|
28
28
|
export * from './individual-onboarding';
|
|
29
|
+
export * from './animal-onboarding';
|
|
29
30
|
export * from './inter-tenant-access-contract';
|
|
30
31
|
export * from './issue';
|
|
31
32
|
export * from './jsonapi';
|
package/dist/models/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export * from './interoperable-claims.js';
|
|
|
26
26
|
export * from './indexing.js';
|
|
27
27
|
export * from './identity-bootstrap.js';
|
|
28
28
|
export * from './individual-onboarding.js';
|
|
29
|
+
export * from './animal-onboarding.js';
|
|
29
30
|
export * from './inter-tenant-access-contract.js';
|
|
30
31
|
export * from './issue.js';
|
|
31
32
|
export * from './jsonapi.js';
|