gdc-common-utils-ts 1.16.0 → 1.18.1

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 (57) hide show
  1. package/README.md +27 -3
  2. package/dist/claims/claims-helpers-communication.d.ts +2 -0
  3. package/dist/claims/claims-helpers-communication.js +6 -0
  4. package/dist/constants/healthcare.d.ts +614 -19
  5. package/dist/constants/healthcare.js +167 -29
  6. package/dist/constants/index.d.ts +2 -0
  7. package/dist/constants/index.js +2 -0
  8. package/dist/constants/permission-templates.d.ts +4 -0
  9. package/dist/constants/permission-templates.js +4 -0
  10. package/dist/constants/service-capabilities.d.ts +66 -36
  11. package/dist/constants/service-capabilities.js +94 -43
  12. package/dist/examples/communication-attached-bundle-session.d.ts +35 -0
  13. package/dist/examples/communication-attached-bundle-session.js +196 -5
  14. package/dist/examples/communication-bundle-document-request.d.ts +4 -0
  15. package/dist/examples/communication-bundle-document-request.js +11 -1
  16. package/dist/examples/dataspace-discovery.js +9 -9
  17. package/dist/examples/organization-controller.js +3 -3
  18. package/dist/examples/shared.d.ts +8 -3
  19. package/dist/examples/shared.js +7 -2
  20. package/dist/models/identity-bootstrap.d.ts +2 -1
  21. package/dist/models/index.d.ts +2 -0
  22. package/dist/models/index.js +2 -0
  23. package/dist/models/interoperable-claims/communication-claims.d.ts +2 -0
  24. package/dist/models/interoperable-claims/communication-claims.js +2 -0
  25. package/dist/models/issue.d.ts +49 -37
  26. package/dist/models/issue.js +82 -44
  27. package/dist/models/operation-outcome.d.ts +2 -2
  28. package/dist/models/permission-templates.d.ts +8 -0
  29. package/dist/models/permission-templates.js +7 -0
  30. package/dist/utils/activation-request.js +8 -7
  31. package/dist/utils/bundle-editor.d.ts +34 -4
  32. package/dist/utils/bundle-editor.js +60 -7
  33. package/dist/utils/bundle-reader.d.ts +53 -1
  34. package/dist/utils/bundle-reader.js +142 -7
  35. package/dist/utils/communication-attached-bundle-session.d.ts +197 -0
  36. package/dist/utils/communication-attached-bundle-session.js +565 -0
  37. package/dist/utils/communication-bundle-document-request.d.ts +26 -7
  38. package/dist/utils/communication-bundle-document-request.js +50 -9
  39. package/dist/utils/communication-claim-helpers.d.ts +1 -17
  40. package/dist/utils/communication-claim-helpers.js +1 -57
  41. package/dist/utils/communication-fhir-r4.d.ts +2 -9
  42. package/dist/utils/consent-permission-templates.d.ts +110 -0
  43. package/dist/utils/consent-permission-templates.js +273 -0
  44. package/dist/utils/dataspace-discovery-defaults.d.ts +1 -0
  45. package/dist/utils/dataspace-discovery-defaults.js +3 -2
  46. package/dist/utils/dataspace-discovery.d.ts +4 -4
  47. package/dist/utils/dataspace-discovery.js +11 -8
  48. package/dist/utils/dataspace-protocol.d.ts +9 -4
  49. package/dist/utils/dataspace-protocol.js +18 -5
  50. package/dist/utils/fhir-validator.d.ts +3 -2
  51. package/dist/utils/fhir-validator.js +10 -9
  52. package/dist/utils/format-converter.js +3 -2
  53. package/dist/utils/index.d.ts +2 -0
  54. package/dist/utils/index.js +2 -0
  55. package/dist/utils/permission-templates.d.ts +5 -0
  56. package/dist/utils/permission-templates.js +5 -0
  57. package/package.json +1 -1
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  Employee shared examples live in `src/examples/employee.ts`.
4
4
  Employee pure helper functions live in `src/utils/employee.ts`.
5
5
 
6
- The canonical employee contract note lives in
7
- `gdc-sdk-core-ts/docs/EMPLOYEES_101.md`.
6
+ The canonical employee editor note lives in
7
+ [`docs/101-EMPLOYEE_ENTRY_EDITOR.md`](docs/101-EMPLOYEE_ENTRY_EDITOR.md).
8
8
 
9
9
  Shared TypeScript utilities for GDC client and connector code. This package provides low-level primitives for cryptography, DID/DIDComm-related helpers, and the shared models and interfaces used across SDKs.
10
10
 
@@ -30,12 +30,31 @@ boundaries used in `gdc-common-utils-ts`.
30
30
  - `resource.meta.claims` is the canonical project-specific claims container and must be preserved across conversions/transports.
31
31
  - `resource.meta.claims` is not part of base FHIR; it is a claims-first extension carried by FHIR-like resources in GDC contracts.
32
32
 
33
+ ## 101 Test Convention
34
+
35
+ Every `101` test in this repo is expected to be a didactic executable tutorial,
36
+ not only a behavior check.
37
+
38
+ Required shape for `101` tests:
39
+
40
+ - start with a short `Teaching goal` comment block
41
+ - explain the main app/business flow, not only internal plumbing
42
+ - use explicit `Step 1.`, `Step 2.`, ... comments for the happy path
43
+ - make clear what the user/app already has, what is shown, what is edited,
44
+ what is saved, and what is reloaded
45
+ - if a low-level helper path is shown, mark it explicitly as an escape hatch
46
+ and not the primary `101` path
47
+
48
+ The goal is that a developer can read the test top-to-bottom as tutorial
49
+ material without needing chat history or private repo context.
50
+
33
51
  If you need the canonical explanation of how DIDComm envelope, batch body,
34
52
  entry types, FHIR-like resources, and `resource.meta.claims` fit together,
35
53
  read first:
36
54
 
37
55
  - [`docs/101-COMMUNICATION_LAYERING.md`](docs/101-COMMUNICATION_LAYERING.md)
38
56
  - [`docs/101-BUNDLE_EDITOR_READER.md`](docs/101-BUNDLE_EDITOR_READER.md)
57
+ - [`docs/101-CONSENT_PERMISSION_TEMPLATES.md`](docs/101-CONSENT_PERMISSION_TEMPLATES.md)
39
58
 
40
59
  ## Install
41
60
 
@@ -161,6 +180,10 @@ import { JweObject, JwtCompactParts } from 'gdc-common-utils-ts/models';
161
180
  `internet-first` discovery seeding by `jurisdiction + version + networkType`
162
181
  - [docs/consent-access-matrix-task.md](docs/consent-access-matrix-task.md)
163
182
  - next-step design/task document for active consent aggregation, explicit deny precedence, controller views, permission-request communications, and SMART access evaluation
183
+ - [docs/101-CONSENT_PERMISSION_TEMPLATES.md](docs/101-CONSENT_PERMISSION_TEMPLATES.md)
184
+ - canonical design note for role/relationship permission templates, front
185
+ pickers, actor/target/purpose classification, and consent import/export
186
+ planning
164
187
  - [docs/101-IPS_BUNDLE.md](docs/101-IPS_BUNDLE.md)
165
188
  - canonical 101 for requesting IPS, editing IPS-style bundles in `Communication.content-attachment-data`, and reading resources by section
166
189
 
@@ -208,13 +231,14 @@ import { HostNetworkTypes } from 'gdc-common-utils-ts/constants/network';
208
231
 
209
232
  const hostContext = {
210
233
  participantId: 'host',
234
+ hostCoverageScope: 'EU',
211
235
  jurisdiction: 'ES',
212
236
  version: 'v1',
213
237
  hostNetwork: HostNetworkTypes.Test,
214
238
  };
215
239
 
216
240
  const discoveryPath = buildGwDspaceVersionWellKnownPath(hostContext);
217
- const metadata = buildDspaceVersionMetadata('/host/cds-ES/v1/test/dsp');
241
+ const metadata = buildDspaceVersionMetadata('/host/cds-EU/v1/test/dsp');
218
242
  const catalogPath = buildGwCatalogArtifactPath(hostContext);
219
243
  const catalogUrl = deriveGwCatalogArtifactUrlFromDspaceVersion(
220
244
  `https://host.example.org${discoveryPath}`,
@@ -9,6 +9,8 @@ export declare function getCommunicationCategoryList(claims: CommunicationIntero
9
9
  export declare function setCommunicationCategory(claims: CommunicationInteroperableClaims, value: string | readonly string[]): CommunicationInteroperableClaims;
10
10
  export declare function addCommunicationCategoryList(claims: CommunicationInteroperableClaims, value: string | readonly string[]): CommunicationInteroperableClaims;
11
11
  export declare function removeCommunicationCategoryList(claims: CommunicationInteroperableClaims, value: string | readonly string[]): CommunicationInteroperableClaims;
12
+ export declare function getCommunicationTopic(claims: CommunicationInteroperableClaims): string;
13
+ export declare function setCommunicationTopic(claims: CommunicationInteroperableClaims, value: unknown): CommunicationInteroperableClaims;
12
14
  export declare function getCommunicationText(claims: CommunicationInteroperableClaims): string;
13
15
  export declare function setCommunicationText(claims: CommunicationInteroperableClaims, value: unknown): CommunicationInteroperableClaims;
14
16
  export declare function getCommunicationContentAttachmentData(claims: CommunicationInteroperableClaims): string;
@@ -37,6 +37,12 @@ export function addCommunicationCategoryList(claims, value) {
37
37
  export function removeCommunicationCategoryList(claims, value) {
38
38
  return removeClaimValues(claims, CommunicationClaim.Category, value);
39
39
  }
40
+ export function getCommunicationTopic(claims) {
41
+ return getCommunicationScalar(claims, CommunicationClaim.Topic);
42
+ }
43
+ export function setCommunicationTopic(claims, value) {
44
+ return setCommunicationScalar(claims, CommunicationClaim.Topic, value);
45
+ }
40
46
  export function getCommunicationText(claims) {
41
47
  return getCommunicationScalar(claims, CommunicationClaim.Text);
42
48
  }