gdc-common-utils-ts 1.23.0 → 1.24.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.
Files changed (46) hide show
  1. package/dist/claims/claims-helpers-related-person.js +8 -2
  2. package/dist/constants/actor-session.d.ts +35 -2
  3. package/dist/constants/actor-session.js +180 -2
  4. package/dist/constants/data-capabilities.d.ts +102 -0
  5. package/dist/constants/data-capabilities.js +126 -0
  6. package/dist/constants/index.d.ts +1 -0
  7. package/dist/constants/index.js +1 -0
  8. package/dist/constants/lifecycle.d.ts +3 -0
  9. package/dist/constants/lifecycle.js +3 -0
  10. package/dist/constants/service-capabilities.d.ts +20 -0
  11. package/dist/constants/service-capabilities.js +24 -1
  12. package/dist/examples/consent-access.d.ts +2 -2
  13. package/dist/examples/ica-activation-proof.d.ts +8 -0
  14. package/dist/examples/ica-activation-proof.js +10 -0
  15. package/dist/examples/individual-controller.d.ts +1 -1
  16. package/dist/examples/lifecycle.d.ts +3 -0
  17. package/dist/examples/lifecycle.js +4 -0
  18. package/dist/examples/professional.d.ts +1 -1
  19. package/dist/examples/related-person.d.ts +21 -21
  20. package/dist/examples/related-person.js +7 -7
  21. package/dist/examples/shared.d.ts +34 -10
  22. package/dist/examples/shared.js +55 -5
  23. package/dist/models/confidential-storage.d.ts +36 -1
  24. package/dist/models/interoperable-claims/invoice-claims.d.ts +1 -1
  25. package/dist/models/interoperable-claims/invoice-claims.js +6 -2
  26. package/dist/models/interoperable-claims/observation-claims.d.ts +2 -2
  27. package/dist/models/interoperable-claims/observation-claims.js +2 -2
  28. package/dist/models/interoperable-claims/related-person-claims.d.ts +2 -0
  29. package/dist/models/interoperable-claims/related-person-claims.js +4 -1
  30. package/dist/utils/activation-policy.d.ts +48 -0
  31. package/dist/utils/activation-policy.js +92 -0
  32. package/dist/utils/confidential-storage-persistence.d.ts +60 -0
  33. package/dist/utils/confidential-storage-persistence.js +64 -0
  34. package/dist/utils/confidential-storage-test-data.d.ts +19 -0
  35. package/dist/utils/confidential-storage-test-data.js +63 -0
  36. package/dist/utils/did-resolution.js +3 -3
  37. package/dist/utils/did.d.ts +81 -11
  38. package/dist/utils/did.js +111 -17
  39. package/dist/utils/family-registration-test-data.d.ts +48 -0
  40. package/dist/utils/family-registration-test-data.js +70 -0
  41. package/dist/utils/index.d.ts +4 -0
  42. package/dist/utils/index.js +4 -0
  43. package/dist/utils/object-sanitize.d.ts +18 -0
  44. package/dist/utils/object-sanitize.js +31 -0
  45. package/dist/utils/related-person-list.js +1 -1
  46. package/package.json +2 -2
@@ -0,0 +1,126 @@
1
+ // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
3
+ /**
4
+ * Canonical operation vocabulary for data authorization.
5
+ *
6
+ * This axis answers:
7
+ * - what the actor wants to do with the data
8
+ *
9
+ * Keep this separate from actor/workflow capabilities such as
10
+ * `HostingDisableHost` or `IndividualBootstrap`.
11
+ */
12
+ export const DataCapabilityActions = Object.freeze({
13
+ View: 'View',
14
+ Create: 'Create',
15
+ Update: 'Update',
16
+ Send: 'Send',
17
+ Search: 'Search',
18
+ Index: 'Index',
19
+ Purge: 'Purge',
20
+ });
21
+ /**
22
+ * Canonical semantic domains for data authorization.
23
+ *
24
+ * This axis answers:
25
+ * - which business or clinical domain the data belongs to
26
+ *
27
+ * Important modeling rule:
28
+ * - a `Bundle` of `Appointment` data is not equivalent to a `Bundle` of
29
+ * `Health`, `Veterinary`, `Research`, or `Insurance` data
30
+ * - the real authorization decision depends on the semantic domain carried by
31
+ * the payload, not just on the FHIR envelope or transport shape
32
+ */
33
+ export const DataCapabilityDomains = Object.freeze({
34
+ Appointment: 'Appointment',
35
+ Health: 'Health',
36
+ Veterinary: 'Veterinary',
37
+ Research: 'Research',
38
+ Insurance: 'Insurance',
39
+ Billing: 'Billing',
40
+ Identity: 'Identity',
41
+ Consent: 'Consent',
42
+ });
43
+ /**
44
+ * Canonical representation or transport vocabulary for data authorization.
45
+ *
46
+ * This axis answers:
47
+ * - how the data is represented or exchanged technically
48
+ *
49
+ * A `Bundle` is only the FHIR container or exchange envelope.
50
+ * Authorization must still look at the semantic domain of the contained data.
51
+ */
52
+ export const DataCapabilityRepresentations = Object.freeze({
53
+ Bundle: 'Bundle',
54
+ Resource: 'Resource',
55
+ DocumentReference: 'DocumentReference',
56
+ Attachment: 'Attachment',
57
+ Claims: 'Claims',
58
+ Invoice: 'Invoice',
59
+ Communication: 'Communication',
60
+ });
61
+ /**
62
+ * Builds the canonical string key for one data capability descriptor.
63
+ */
64
+ export function buildDataCapabilityKey(input) {
65
+ return `${input.action}.${input.representation}.${input.domain}`;
66
+ }
67
+ /**
68
+ * Parses one canonical string capability back into its structured form.
69
+ */
70
+ export function parseDataCapabilityKey(input) {
71
+ const [action, representation, domain, ...rest] = String(input || '').trim().split('.');
72
+ if (rest.length > 0)
73
+ return undefined;
74
+ if (!Object.values(DataCapabilityActions).includes(action))
75
+ return undefined;
76
+ if (!Object.values(DataCapabilityRepresentations).includes(representation))
77
+ return undefined;
78
+ if (!Object.values(DataCapabilityDomains).includes(domain))
79
+ return undefined;
80
+ return {
81
+ action: action,
82
+ representation: representation,
83
+ domain: domain,
84
+ };
85
+ }
86
+ /**
87
+ * Reference examples kept in code so authorization discussions do not get lost
88
+ * in docs or chat history.
89
+ */
90
+ export const ExampleDataCapabilities = Object.freeze({
91
+ CreateBundleAppointment: buildDataCapabilityKey({
92
+ action: DataCapabilityActions.Create,
93
+ representation: DataCapabilityRepresentations.Bundle,
94
+ domain: DataCapabilityDomains.Appointment,
95
+ }),
96
+ SendBundleAppointment: buildDataCapabilityKey({
97
+ action: DataCapabilityActions.Send,
98
+ representation: DataCapabilityRepresentations.Bundle,
99
+ domain: DataCapabilityDomains.Appointment,
100
+ }),
101
+ ViewResourceHealth: buildDataCapabilityKey({
102
+ action: DataCapabilityActions.View,
103
+ representation: DataCapabilityRepresentations.Resource,
104
+ domain: DataCapabilityDomains.Health,
105
+ }),
106
+ ViewBundleHealth: buildDataCapabilityKey({
107
+ action: DataCapabilityActions.View,
108
+ representation: DataCapabilityRepresentations.Bundle,
109
+ domain: DataCapabilityDomains.Health,
110
+ }),
111
+ SendDocumentReferenceInsurance: buildDataCapabilityKey({
112
+ action: DataCapabilityActions.Send,
113
+ representation: DataCapabilityRepresentations.DocumentReference,
114
+ domain: DataCapabilityDomains.Insurance,
115
+ }),
116
+ ViewInvoiceBilling: buildDataCapabilityKey({
117
+ action: DataCapabilityActions.View,
118
+ representation: DataCapabilityRepresentations.Invoice,
119
+ domain: DataCapabilityDomains.Billing,
120
+ }),
121
+ SearchBundleResearch: buildDataCapabilityKey({
122
+ action: DataCapabilityActions.Search,
123
+ representation: DataCapabilityRepresentations.Bundle,
124
+ domain: DataCapabilityDomains.Research,
125
+ }),
126
+ });
@@ -1,6 +1,7 @@
1
1
  export * from './actor-session';
2
2
  export * from './communication';
3
3
  export * from './cryptography';
4
+ export * from './data-capabilities';
4
5
  export * from './dataspace-discovery';
5
6
  export * from './dataspace-protocol';
6
7
  export * from './device';
@@ -1,6 +1,7 @@
1
1
  export * from './actor-session.js';
2
2
  export * from './communication.js';
3
3
  export * from './cryptography.js';
4
+ export * from './data-capabilities.js';
4
5
  export * from './dataspace-discovery.js';
5
6
  export * from './dataspace-protocol.js';
6
7
  export * from './device.js';
@@ -14,4 +14,7 @@ export declare const InteroperableContext: Readonly<{
14
14
  export declare const LifecycleRequestType: Readonly<{
15
15
  readonly RelatedPersonDisable: "RelatedPerson-disable-request-v1.0";
16
16
  readonly RelatedPersonPurge: "RelatedPerson-purge-request-v1.0";
17
+ readonly TenantEnable: "Organization-enable-request-v1.0";
18
+ readonly TenantDisable: "Organization-disable-request-v1.0";
19
+ readonly TenantPurge: "Organization-purge-request-v1.0";
17
20
  }>;
@@ -15,4 +15,7 @@ export const InteroperableContext = Object.freeze({
15
15
  export const LifecycleRequestType = Object.freeze({
16
16
  RelatedPersonDisable: 'RelatedPerson-disable-request-v1.0',
17
17
  RelatedPersonPurge: 'RelatedPerson-purge-request-v1.0',
18
+ TenantEnable: 'Organization-enable-request-v1.0',
19
+ TenantDisable: 'Organization-disable-request-v1.0',
20
+ TenantPurge: 'Organization-purge-request-v1.0',
18
21
  });
@@ -3,6 +3,13 @@
3
3
  * `org.schema.Service.serviceType`.
4
4
  */
5
5
  export declare const ServiceCapability: {
6
+ /**
7
+ * Hosting/operator capability to manage hosted tenant organizations.
8
+ *
9
+ * This is the canonical service authorization that allows a hosting operator
10
+ * to activate, disable, and purge hosted legal organizations.
11
+ */
12
+ readonly OrganizationRegistryProvider: "organization/Organization.cruds";
6
13
  readonly IndexReader: "organization/Composition.rs";
7
14
  readonly IndexProvider: "organization/Composition.cruds";
8
15
  readonly DigitalTwinReader: "organization/ResearchSubject.rs";
@@ -14,6 +21,7 @@ export type ServiceCapabilityValue = typeof ServiceCapability[keyof typeof Servi
14
21
  * values.
15
22
  */
16
23
  export declare const ServiceCapabilityKind: {
24
+ readonly OrganizationRegistry: "organization/organization";
17
25
  readonly Indexing: "organization/composition";
18
26
  readonly DigitalTwin: "organization/researchsubject";
19
27
  };
@@ -22,6 +30,7 @@ export type ServiceCapabilityKindValue = typeof ServiceCapabilityKind[keyof type
22
30
  * @deprecated Legacy serviceType values accepted for backward compatibility.
23
31
  */
24
32
  export declare const DeprecatedServiceCapabilityToken: {
33
+ readonly OrganizationRegistryProvider: "organization-registry.cruds";
25
34
  readonly IndexReader: "indexing.rs";
26
35
  readonly IndexProvider: "indexing.cruds";
27
36
  readonly DigitalTwinReader: "digitaltwin.rs";
@@ -35,10 +44,15 @@ export type DeprecatedServiceCapabilityTokenValue = typeof DeprecatedServiceCapa
35
44
  * `ServiceCapabilityToken`.
36
45
  */
37
46
  export declare const ServiceCapabilityToken: {
47
+ readonly OrganizationRegistryProvider: "organization/Organization.cruds";
38
48
  readonly IndexReader: "organization/Composition.rs";
39
49
  readonly IndexProvider: "organization/Composition.cruds";
40
50
  readonly DigitalTwinReader: "organization/ResearchSubject.rs";
41
51
  readonly DigitalTwinProvider: "organization/ResearchSubject.cruds";
52
+ /**
53
+ * @deprecated Prefer `OrganizationRegistryProvider`.
54
+ */
55
+ readonly OrganizationRegistryCruds: "organization/Organization.cruds";
42
56
  /**
43
57
  * @deprecated Prefer `IndexReader`.
44
58
  */
@@ -55,6 +69,12 @@ export declare const ServiceCapabilityToken: {
55
69
  * @deprecated Prefer `DigitalTwinProvider`.
56
70
  */
57
71
  readonly DigitalTwinCruds: "organization/ResearchSubject.cruds";
72
+ /**
73
+ * @deprecated Prefer `ServiceCapability.OrganizationRegistryProvider`.
74
+ * Legacy persisted value kept for compatibility while external payloads
75
+ * still emit `organization-registry.cruds`.
76
+ */
77
+ readonly LegacyOrganizationRegistryProvider: "organization-registry.cruds";
58
78
  /**
59
79
  * @deprecated Prefer `ServiceCapability.IndexReader`.
60
80
  * Legacy persisted value kept for compatibility while external payloads
@@ -5,6 +5,13 @@
5
5
  * `org.schema.Service.serviceType`.
6
6
  */
7
7
  export const ServiceCapability = {
8
+ /**
9
+ * Hosting/operator capability to manage hosted tenant organizations.
10
+ *
11
+ * This is the canonical service authorization that allows a hosting operator
12
+ * to activate, disable, and purge hosted legal organizations.
13
+ */
14
+ OrganizationRegistryProvider: 'organization/Organization.cruds',
8
15
  IndexReader: 'organization/Composition.rs',
9
16
  IndexProvider: 'organization/Composition.cruds',
10
17
  DigitalTwinReader: 'organization/ResearchSubject.rs',
@@ -15,6 +22,7 @@ export const ServiceCapability = {
15
22
  * values.
16
23
  */
17
24
  export const ServiceCapabilityKind = {
25
+ OrganizationRegistry: 'organization/organization',
18
26
  Indexing: 'organization/composition',
19
27
  DigitalTwin: 'organization/researchsubject',
20
28
  };
@@ -22,6 +30,7 @@ export const ServiceCapabilityKind = {
22
30
  * @deprecated Legacy serviceType values accepted for backward compatibility.
23
31
  */
24
32
  export const DeprecatedServiceCapabilityToken = {
33
+ OrganizationRegistryProvider: 'organization-registry.cruds',
25
34
  IndexReader: 'indexing.rs',
26
35
  IndexProvider: 'indexing.cruds',
27
36
  DigitalTwinReader: 'digitaltwin.rs',
@@ -34,10 +43,15 @@ export const DeprecatedServiceCapabilityToken = {
34
43
  * `ServiceCapabilityToken`.
35
44
  */
36
45
  export const ServiceCapabilityToken = {
46
+ OrganizationRegistryProvider: ServiceCapability.OrganizationRegistryProvider,
37
47
  IndexReader: ServiceCapability.IndexReader,
38
48
  IndexProvider: ServiceCapability.IndexProvider,
39
49
  DigitalTwinReader: ServiceCapability.DigitalTwinReader,
40
50
  DigitalTwinProvider: ServiceCapability.DigitalTwinProvider,
51
+ /**
52
+ * @deprecated Prefer `OrganizationRegistryProvider`.
53
+ */
54
+ OrganizationRegistryCruds: ServiceCapability.OrganizationRegistryProvider,
41
55
  /**
42
56
  * @deprecated Prefer `IndexReader`.
43
57
  */
@@ -54,6 +68,12 @@ export const ServiceCapabilityToken = {
54
68
  * @deprecated Prefer `DigitalTwinProvider`.
55
69
  */
56
70
  DigitalTwinCruds: ServiceCapability.DigitalTwinProvider,
71
+ /**
72
+ * @deprecated Prefer `ServiceCapability.OrganizationRegistryProvider`.
73
+ * Legacy persisted value kept for compatibility while external payloads
74
+ * still emit `organization-registry.cruds`.
75
+ */
76
+ LegacyOrganizationRegistryProvider: DeprecatedServiceCapabilityToken.OrganizationRegistryProvider,
57
77
  /**
58
78
  * @deprecated Prefer `ServiceCapability.IndexReader`.
59
79
  * Legacy persisted value kept for compatibility while external payloads
@@ -80,10 +100,12 @@ export const ServiceCapabilityToken = {
80
100
  LegacyDigitalTwinProvider: DeprecatedServiceCapabilityToken.DigitalTwinProvider,
81
101
  };
82
102
  const CANONICAL_SERVICE_CAPABILITY_BY_VALUE = new Map([
103
+ [String(ServiceCapability.OrganizationRegistryProvider).toLowerCase(), ServiceCapability.OrganizationRegistryProvider],
83
104
  [String(ServiceCapability.IndexReader).toLowerCase(), ServiceCapability.IndexReader],
84
105
  [String(ServiceCapability.IndexProvider).toLowerCase(), ServiceCapability.IndexProvider],
85
106
  [String(ServiceCapability.DigitalTwinReader).toLowerCase(), ServiceCapability.DigitalTwinReader],
86
107
  [String(ServiceCapability.DigitalTwinProvider).toLowerCase(), ServiceCapability.DigitalTwinProvider],
108
+ [String(DeprecatedServiceCapabilityToken.OrganizationRegistryProvider).toLowerCase(), ServiceCapability.OrganizationRegistryProvider],
87
109
  [String(DeprecatedServiceCapabilityToken.IndexReader).toLowerCase(), ServiceCapability.IndexReader],
88
110
  [String(DeprecatedServiceCapabilityToken.IndexProvider).toLowerCase(), ServiceCapability.IndexProvider],
89
111
  [String(DeprecatedServiceCapabilityToken.DigitalTwinReader).toLowerCase(), ServiceCapability.DigitalTwinReader],
@@ -167,6 +189,7 @@ export function hasServiceCapabilityKind(value, family) {
167
189
  */
168
190
  export function isProviderServiceCapability(value) {
169
191
  const normalized = normalizeServiceCapability(value);
170
- return normalized === ServiceCapability.IndexProvider
192
+ return normalized === ServiceCapability.OrganizationRegistryProvider
193
+ || normalized === ServiceCapability.IndexProvider
171
194
  || normalized === ServiceCapability.DigitalTwinProvider;
172
195
  }
@@ -1,6 +1,6 @@
1
1
  import { ClaimConsent, type ConsentRule } from '../models/consent-rule';
2
2
  import { EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_EMAIL_RELATED_PERSON } from './shared';
3
- export declare const EXAMPLE_INDIVIDUAL_DID_WEB: "did:web:api.acme.org:individual:123";
3
+ export declare const EXAMPLE_INDIVIDUAL_DID_WEB: string;
4
4
  export declare const EXAMPLE_PROVIDER_ORGANIZATION_DID_WEB: "did:web:hospital.acme.org";
5
5
  export { EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_EMAIL_RELATED_PERSON };
6
6
  export declare const EXAMPLE_CONSENT_ACCESS_JURISDICTION: "ES";
@@ -8,7 +8,7 @@ export declare const EXAMPLE_CONSENT_ACCESS_JURISDICTION: "ES";
8
8
  * Legacy compatibility aliases kept so older docs/tests/imports continue to work
9
9
  * while the canonical variable names converge.
10
10
  */
11
- export declare const EXAMPLE_CONSENT_ACCESS_SUBJECT: "did:web:api.acme.org:individual:123";
11
+ export declare const EXAMPLE_CONSENT_ACCESS_SUBJECT: string;
12
12
  export declare const EXAMPLE_CONSENT_ACCESS_PROVIDER_DID: "did:web:hospital.acme.org";
13
13
  export declare const EXAMPLE_CONSENT_ACCESS_PROVIDER_EMAIL: "doctor.oncall@example.org";
14
14
  export declare const EXAMPLE_CONSENT_ACCESS_RELATED_PERSON_EMAIL: "parent.guardian@example.org";
@@ -25,12 +25,20 @@ export declare const EXAMPLE_PRESENTATION_AUDIENCE_HOST_ID: "host:node-operator-
25
25
  export declare const EXAMPLE_ORGANIZATION_TAX_ID: "ESB00112233";
26
26
  export declare const EXAMPLE_REPRESENTATIVE_ROLE_CODE: "RESPRSN";
27
27
  export declare const EXAMPLE_ORGANIZATION_ID: "ESB00112233";
28
+ export declare const EXAMPLE_ACTIVATION_AUTHORIZED_CATEGORY: "health-care";
29
+ export declare const EXAMPLE_ACTIVATION_AUTHORIZED_SERVICE_TYPE: "organization/Composition.cruds";
30
+ export declare const EXAMPLE_HOST_ACTIVATION_AUTHORIZED_CATEGORY: "system";
31
+ export declare const EXAMPLE_HOST_ACTIVATION_AUTHORIZED_SERVICE_TYPE: "organization/Organization.cruds";
28
32
  export declare const EXAMPLE_ORG_ACTIVATION_ORGANIZATION_CREDENTIAL: Readonly<{
29
33
  '@context': string[];
30
34
  type: ("VerifiableCredential" | "OrganizationCredential")[];
31
35
  credentialSubject: {
32
36
  id: "ESB00112233";
33
37
  taxID: "ESB00112233";
38
+ makesOffer: {
39
+ category: "health-care";
40
+ serviceType: "organization/Composition.cruds";
41
+ };
34
42
  };
35
43
  }>;
36
44
  export declare const EXAMPLE_ORG_ACTIVATION_LEGAL_REPRESENTATIVE_CREDENTIAL: Readonly<{
@@ -2,6 +2,8 @@
2
2
  // Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
3
3
  import { ActivationCredentialTypes, W3cCredentialContexts, W3cCredentialTypes, } from '../constants/verifiable-credentials.js';
4
4
  import { UrnPrefixes } from '../constants/urn.js';
5
+ import { ServiceCapability } from '../constants/service-capabilities.js';
6
+ import { DataspaceSectors } from '../constants/sectors.js';
5
7
  /**
6
8
  * Shared synthetic ICA activation-proof fixtures reused by docs/tests.
7
9
  *
@@ -29,6 +31,10 @@ export const EXAMPLE_PRESENTATION_AUDIENCE_HOST_ID = 'host:node-operator-es';
29
31
  export const EXAMPLE_ORGANIZATION_TAX_ID = 'ESB00112233';
30
32
  export const EXAMPLE_REPRESENTATIVE_ROLE_CODE = 'RESPRSN';
31
33
  export const EXAMPLE_ORGANIZATION_ID = EXAMPLE_ORGANIZATION_TAX_ID;
34
+ export const EXAMPLE_ACTIVATION_AUTHORIZED_CATEGORY = DataspaceSectors.HealthCare;
35
+ export const EXAMPLE_ACTIVATION_AUTHORIZED_SERVICE_TYPE = ServiceCapability.IndexProvider;
36
+ export const EXAMPLE_HOST_ACTIVATION_AUTHORIZED_CATEGORY = 'system';
37
+ export const EXAMPLE_HOST_ACTIVATION_AUTHORIZED_SERVICE_TYPE = ServiceCapability.OrganizationRegistryProvider;
32
38
  export const EXAMPLE_ORG_ACTIVATION_ORGANIZATION_CREDENTIAL = Object.freeze({
33
39
  '@context': [W3cCredentialContexts.V2, 'https://schema.org'],
34
40
  type: [
@@ -38,6 +44,10 @@ export const EXAMPLE_ORG_ACTIVATION_ORGANIZATION_CREDENTIAL = Object.freeze({
38
44
  credentialSubject: {
39
45
  id: EXAMPLE_ORGANIZATION_ID,
40
46
  taxID: EXAMPLE_ORGANIZATION_TAX_ID,
47
+ makesOffer: {
48
+ category: EXAMPLE_ACTIVATION_AUTHORIZED_CATEGORY,
49
+ serviceType: EXAMPLE_ACTIVATION_AUTHORIZED_SERVICE_TYPE,
50
+ },
41
51
  },
42
52
  });
43
53
  export const EXAMPLE_ORG_ACTIVATION_LEGAL_REPRESENTATIVE_CREDENTIAL = Object.freeze({
@@ -60,7 +60,7 @@ export declare const EXAMPLE_CONSENT_GRANT_INPUT: {
60
60
  readonly subjectDid: "did:web:subject.example";
61
61
  };
62
62
  export declare const EXAMPLE_LIVE_CONSENT_GRANT_INPUT: {
63
- readonly subjectDid: "did:web:api.acme.org:individual:123";
63
+ readonly subjectDid: string;
64
64
  readonly actor: {
65
65
  readonly identifier: "did:web:api.acme.org";
66
66
  };
@@ -12,6 +12,9 @@ export declare const EXAMPLE_LIFECYCLE_OPERATIONS: {
12
12
  };
13
13
  export declare const EXAMPLE_INDIVIDUAL_ORGANIZATION_DISABLE_REQUEST_TYPE: "Family-disable-request-v1.0";
14
14
  export declare const EXAMPLE_INDIVIDUAL_ORGANIZATION_PURGE_REQUEST_TYPE: "Family-purge-request-v1.0";
15
+ export declare const EXAMPLE_TENANT_ENABLE_REQUEST_TYPE: "Organization-enable-request-v1.0";
16
+ export declare const EXAMPLE_TENANT_DISABLE_REQUEST_TYPE: "Organization-disable-request-v1.0";
17
+ export declare const EXAMPLE_TENANT_PURGE_REQUEST_TYPE: "Organization-purge-request-v1.0";
15
18
  /**
16
19
  * Shared placeholder values used by copy/paste examples.
17
20
  *
@@ -1,5 +1,6 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { ClaimsOrganizationSchemaorg, ClaimsPersonSchemaorg, } from '../constants/schemaorg.js';
3
+ import { LifecycleRequestType } from '../constants/lifecycle.js';
3
4
  import { ClaimConsent } from '../models/consent-rule.js';
4
5
  import { IndividualOrganizationLifecycleDraft, IndividualOrganizationLifecycleOperations, } from '../utils/individual-organization-lifecycle.js';
5
6
  import { EXAMPLE_EMAIL_CONTROLLER_INDIVIDUAL, EXAMPLE_EMAIL_CONTROLLER_ORG, EXAMPLE_CLINICAL_SECTION_ALLERGIES, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_JURISDICTION, EXAMPLE_SECTOR, EXAMPLE_TENANT_IDENTIFIER, } from './shared.js';
@@ -17,6 +18,9 @@ export const EXAMPLE_LIFECYCLE_OPERATIONS = {
17
18
  };
18
19
  export const EXAMPLE_INDIVIDUAL_ORGANIZATION_DISABLE_REQUEST_TYPE = 'Family-disable-request-v1.0';
19
20
  export const EXAMPLE_INDIVIDUAL_ORGANIZATION_PURGE_REQUEST_TYPE = 'Family-purge-request-v1.0';
21
+ export const EXAMPLE_TENANT_ENABLE_REQUEST_TYPE = LifecycleRequestType.TenantEnable;
22
+ export const EXAMPLE_TENANT_DISABLE_REQUEST_TYPE = LifecycleRequestType.TenantDisable;
23
+ export const EXAMPLE_TENANT_PURGE_REQUEST_TYPE = LifecycleRequestType.TenantPurge;
20
24
  /**
21
25
  * Shared placeholder values used by copy/paste examples.
22
26
  *
@@ -10,7 +10,7 @@ export declare const EXAMPLE_OPENID_SMART_TOKEN_INPUT: {
10
10
  readonly scopes: readonly [string];
11
11
  readonly smartTokenKind: "openid-smart";
12
12
  readonly clientId: "device-1";
13
- readonly subjectDid: "did:web:api.acme.org:individual:123";
13
+ readonly subjectDid: string;
14
14
  };
15
15
  export declare const EXAMPLE_SMART_PRESENTATION_SUBMISSION: {
16
16
  readonly id: "ps-001";
@@ -14,8 +14,8 @@ export declare const EXAMPLE_RELATED_PERSON_DISPLAY_NAME: "Jose Example";
14
14
  export declare const EXAMPLE_RELATED_PERSON_DISABLE_INPUT: {
15
15
  readonly memberClaims: {
16
16
  readonly '@context': "org.hl7.fhir.api";
17
- readonly "RelatedPerson.identifier": "rel-001";
18
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
17
+ readonly "RelatedPerson.identifier.value": "rel-001";
18
+ readonly "RelatedPerson.patient": string;
19
19
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
20
20
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
21
21
  };
@@ -50,8 +50,8 @@ export declare const EXAMPLE_RELATED_PERSON_DISABLE_BUNDLE_ENTRY: {
50
50
  readonly meta: {
51
51
  readonly claims: {
52
52
  readonly '@context': "org.hl7.fhir.api";
53
- readonly "RelatedPerson.identifier": "rel-001";
54
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
53
+ readonly "RelatedPerson.identifier.value": "rel-001";
54
+ readonly "RelatedPerson.patient": string;
55
55
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
56
56
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
57
57
  };
@@ -84,8 +84,8 @@ export declare const EXAMPLE_RELATED_PERSON_DISABLE_BUNDLE_PAYLOAD: {
84
84
  readonly meta: {
85
85
  readonly claims: {
86
86
  readonly '@context': "org.hl7.fhir.api";
87
- readonly "RelatedPerson.identifier": "rel-001";
88
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
87
+ readonly "RelatedPerson.identifier.value": "rel-001";
88
+ readonly "RelatedPerson.patient": string;
89
89
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
90
90
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
91
91
  };
@@ -125,8 +125,8 @@ export declare const EXAMPLE_RELATED_PERSON_PURGE_BUNDLE_ENTRY: {
125
125
  readonly meta: {
126
126
  readonly claims: {
127
127
  readonly '@context': "org.hl7.fhir.api";
128
- readonly "RelatedPerson.identifier": "rel-001";
129
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
128
+ readonly "RelatedPerson.identifier.value": "rel-001";
129
+ readonly "RelatedPerson.patient": string;
130
130
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
131
131
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
132
132
  };
@@ -157,8 +157,8 @@ export declare const EXAMPLE_RELATED_PERSON_PURGE_BUNDLE_PAYLOAD: {
157
157
  readonly meta: {
158
158
  readonly claims: {
159
159
  readonly '@context': "org.hl7.fhir.api";
160
- readonly "RelatedPerson.identifier": "rel-001";
161
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
160
+ readonly "RelatedPerson.identifier.value": "rel-001";
161
+ readonly "RelatedPerson.patient": string;
162
162
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
163
163
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
164
164
  };
@@ -195,7 +195,7 @@ export declare const EXAMPLE_RELATED_PERSON_UPSERT_BUNDLE_PAYLOAD: {
195
195
  readonly resourceType: "RelatedPerson";
196
196
  readonly id: "grandfather-001";
197
197
  readonly patient: {
198
- readonly reference: "did:web:api.acme.org:individual:123";
198
+ readonly reference: string;
199
199
  };
200
200
  readonly relationship: readonly [{
201
201
  readonly text: "Grandfather";
@@ -218,7 +218,7 @@ export declare const EXAMPLE_RELATED_PERSON_PAYLOAD: {
218
218
  readonly resourceType: "RelatedPerson";
219
219
  readonly id: "grandfather-001";
220
220
  readonly patient: {
221
- readonly reference: "did:web:api.acme.org:individual:123";
221
+ readonly reference: string;
222
222
  };
223
223
  readonly relationship: readonly [{
224
224
  readonly text: "Grandfather";
@@ -252,7 +252,7 @@ export declare const EXAMPLE_RELATED_PERSON_FHIR_RESOURCE: {
252
252
  }];
253
253
  readonly active: true;
254
254
  readonly patient: {
255
- readonly reference: "did:web:api.acme.org:individual:123";
255
+ readonly reference: string;
256
256
  };
257
257
  readonly relationship: readonly [{
258
258
  readonly coding: readonly [{
@@ -278,8 +278,8 @@ export declare const EXAMPLE_RELATED_PERSON_LIST_RECORD_ACTIVE: {
278
278
  readonly meta: {
279
279
  readonly claims: {
280
280
  readonly '@context': "org.hl7.fhir.api";
281
- readonly "RelatedPerson.identifier": "rel-001";
282
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
281
+ readonly "RelatedPerson.identifier.value": "rel-001";
282
+ readonly "RelatedPerson.patient": string;
283
283
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
284
284
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
285
285
  readonly "RelatedPerson.name": "Jose Example";
@@ -299,8 +299,8 @@ export declare const EXAMPLE_RELATED_PERSON_LIST_RECORD_INACTIVE: {
299
299
  readonly meta: {
300
300
  readonly claims: {
301
301
  readonly '@context': "org.hl7.fhir.api";
302
- readonly "RelatedPerson.identifier": "urn:uuid:related-person-002";
303
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
302
+ readonly "RelatedPerson.identifier.value": "urn:uuid:related-person-002";
303
+ readonly "RelatedPerson.patient": string;
304
304
  readonly "RelatedPerson.telecom": "mailto:caregiver.two@example.org";
305
305
  readonly "RelatedPerson.relationship": "http://terminology.hl7.org/CodeSystem/v3-RoleCode|NMTH";
306
306
  readonly "RelatedPerson.name": "Maria Example";
@@ -322,8 +322,8 @@ export declare const EXAMPLE_RELATED_PERSON_LIST_RESPONSE_BODY: {
322
322
  readonly meta: {
323
323
  readonly claims: {
324
324
  readonly '@context': "org.hl7.fhir.api";
325
- readonly "RelatedPerson.identifier": "rel-001";
326
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
325
+ readonly "RelatedPerson.identifier.value": "rel-001";
326
+ readonly "RelatedPerson.patient": string;
327
327
  readonly "RelatedPerson.telecom": "mailto:parent.guardian@example.org";
328
328
  readonly "RelatedPerson.relationship": "v3-RoleCode|RESPRSN";
329
329
  readonly "RelatedPerson.name": "Jose Example";
@@ -342,8 +342,8 @@ export declare const EXAMPLE_RELATED_PERSON_LIST_RESPONSE_BODY: {
342
342
  readonly meta: {
343
343
  readonly claims: {
344
344
  readonly '@context': "org.hl7.fhir.api";
345
- readonly "RelatedPerson.identifier": "urn:uuid:related-person-002";
346
- readonly "RelatedPerson.patient": "did:web:api.acme.org:individual:123";
345
+ readonly "RelatedPerson.identifier.value": "urn:uuid:related-person-002";
346
+ readonly "RelatedPerson.patient": string;
347
347
  readonly "RelatedPerson.telecom": "mailto:caregiver.two@example.org";
348
348
  readonly "RelatedPerson.relationship": "http://terminology.hl7.org/CodeSystem/v3-RoleCode|NMTH";
349
349
  readonly "RelatedPerson.name": "Maria Example";
@@ -21,7 +21,7 @@ export const EXAMPLE_RELATED_PERSON_DISPLAY_NAME = EXAMPLE_RELATED_PERSON_ACTIVE
21
21
  export const EXAMPLE_RELATED_PERSON_DISABLE_INPUT = {
22
22
  memberClaims: {
23
23
  '@context': EXAMPLE_INTEROPERABLE_CONTEXT_FHIR_API,
24
- [RelatedPersonClaim.Identifier]: EXAMPLE_RELATED_PERSON_IDENTIFIER,
24
+ [RelatedPersonClaim.IdentifierValue]: EXAMPLE_RELATED_PERSON_IDENTIFIER,
25
25
  [RelatedPersonClaim.Patient]: EXAMPLE_SUBJECT_DID,
26
26
  [RelatedPersonClaim.Telecom]: `mailto:${EXAMPLE_EMAIL_RELATED_PERSON}`,
27
27
  [RelatedPersonClaim.Relationship]: EXAMPLE_RELATED_PERSON_ROLE,
@@ -34,8 +34,8 @@ export const EXAMPLE_RELATED_PERSON_DISABLE_INPUT = {
34
34
  */
35
35
  export const EXAMPLE_RELATED_PERSON_DISABLE_LIFECYCLE_RESOURCE = createInteroperableResourceOperationEditor()
36
36
  .setResourceType(EXAMPLE_RELATED_PERSON_RESOURCE_TYPE)
37
- .setIdentifierClaimKey(RelatedPersonClaim.Identifier)
38
- .setBusinessIdentifier(EXAMPLE_RELATED_PERSON_DISABLE_INPUT.memberClaims[RelatedPersonClaim.Identifier])
37
+ .setIdentifierClaimKey(RelatedPersonClaim.IdentifierValue)
38
+ .setBusinessIdentifier(EXAMPLE_RELATED_PERSON_DISABLE_INPUT.memberClaims[RelatedPersonClaim.IdentifierValue])
39
39
  .setClaims({ ...EXAMPLE_RELATED_PERSON_DISABLE_INPUT.memberClaims })
40
40
  .setLifecycleStatus(InteroperableLifecycleStatuses.Inactive)
41
41
  .buildLifecycleResource();
@@ -66,8 +66,8 @@ export const EXAMPLE_RELATED_PERSON_DISABLE_BUNDLE_PAYLOAD = {
66
66
  };
67
67
  export const EXAMPLE_RELATED_PERSON_PURGE_LIFECYCLE_RESOURCE = createInteroperableResourceOperationEditor()
68
68
  .setResourceType(EXAMPLE_RELATED_PERSON_RESOURCE_TYPE)
69
- .setIdentifierClaimKey(RelatedPersonClaim.Identifier)
70
- .setBusinessIdentifier(EXAMPLE_RELATED_PERSON_DISABLE_INPUT.memberClaims[RelatedPersonClaim.Identifier])
69
+ .setIdentifierClaimKey(RelatedPersonClaim.IdentifierValue)
70
+ .setBusinessIdentifier(EXAMPLE_RELATED_PERSON_DISABLE_INPUT.memberClaims[RelatedPersonClaim.IdentifierValue])
71
71
  .setClaims({ ...EXAMPLE_RELATED_PERSON_DISABLE_INPUT.memberClaims })
72
72
  .setLifecycleStatus(InteroperableLifecycleStatuses.Purged)
73
73
  .buildLifecycleResource();
@@ -152,7 +152,7 @@ export const EXAMPLE_RELATED_PERSON_LIST_RECORD_ACTIVE = {
152
152
  meta: {
153
153
  claims: {
154
154
  '@context': EXAMPLE_INTEROPERABLE_CONTEXT_FHIR_API,
155
- [RelatedPersonClaim.Identifier]: EXAMPLE_RELATED_PERSON_IDENTIFIER,
155
+ [RelatedPersonClaim.IdentifierValue]: EXAMPLE_RELATED_PERSON_IDENTIFIER,
156
156
  [RelatedPersonClaim.Patient]: EXAMPLE_SUBJECT_DID,
157
157
  [RelatedPersonClaim.Telecom]: `mailto:${EXAMPLE_EMAIL_RELATED_PERSON}`,
158
158
  [RelatedPersonClaim.Relationship]: EXAMPLE_RELATED_PERSON_ROLE,
@@ -173,7 +173,7 @@ export const EXAMPLE_RELATED_PERSON_LIST_RECORD_INACTIVE = {
173
173
  meta: {
174
174
  claims: {
175
175
  '@context': EXAMPLE_INTEROPERABLE_CONTEXT_FHIR_API,
176
- [RelatedPersonClaim.Identifier]: EXAMPLE_RELATED_PERSON_INACTIVE_IDENTIFIER,
176
+ [RelatedPersonClaim.IdentifierValue]: EXAMPLE_RELATED_PERSON_INACTIVE_IDENTIFIER,
177
177
  [RelatedPersonClaim.Patient]: EXAMPLE_SUBJECT_DID,
178
178
  [RelatedPersonClaim.Telecom]: `mailto:${EXAMPLE_RELATED_PERSON_INACTIVE_EMAIL}`,
179
179
  [RelatedPersonClaim.Relationship]: EXAMPLE_RELATED_PERSON_INACTIVE_RELATIONSHIP,