gdc-common-utils-ts 2.0.18 → 2.1.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 (57) hide show
  1. package/README.md +0 -1
  2. package/dist/examples/bundle-didcomm-payload.d.ts +11 -0
  3. package/dist/examples/bundle-didcomm-payload.js +13 -0
  4. package/dist/examples/communication-attached-bundle-session.js +2 -1
  5. package/dist/examples/communication-didcomm-payload.d.ts +35 -0
  6. package/dist/examples/communication-didcomm-payload.js +38 -0
  7. package/dist/examples/index.d.ts +4 -0
  8. package/dist/examples/index.js +4 -0
  9. package/dist/examples/profile-manager-mem.d.ts +45 -0
  10. package/dist/examples/profile-manager-mem.js +29 -0
  11. package/dist/examples/shared.d.ts +1 -0
  12. package/dist/examples/shared.js +1 -0
  13. package/dist/examples/wallet-mem.d.ts +38 -0
  14. package/dist/examples/wallet-mem.js +40 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.js +1 -0
  17. package/dist/interfaces/IProfileOutboxRepository.d.ts +36 -0
  18. package/dist/interfaces/IProfileOutboxRepository.js +2 -0
  19. package/dist/interfaces/IWallet.d.ts +74 -0
  20. package/dist/interfaces/IWallet.js +2 -0
  21. package/dist/interfaces/IWalletQueue.d.ts +30 -0
  22. package/dist/interfaces/IWalletQueue.js +2 -0
  23. package/dist/interfaces/index.d.ts +8 -0
  24. package/dist/interfaces/index.js +8 -0
  25. package/dist/models/communication-attached-bundle-session.d.ts +193 -0
  26. package/dist/models/communication-attached-bundle-session.js +34 -0
  27. package/dist/models/index.d.ts +3 -0
  28. package/dist/models/index.js +3 -0
  29. package/dist/models/interoperable-claims/diagnostic-report-claims.d.ts +1 -2
  30. package/dist/models/interoperable-claims/diagnostic-report-claims.js +1 -2
  31. package/dist/models/profile-manager.d.ts +85 -0
  32. package/dist/models/profile-manager.js +2 -0
  33. package/dist/models/wallet.d.ts +59 -0
  34. package/dist/models/wallet.js +22 -0
  35. package/dist/utils/backend-message-manager-mem.d.ts +67 -0
  36. package/dist/utils/backend-message-manager-mem.js +227 -0
  37. package/dist/utils/bundle-didcomm-payload.d.ts +29 -0
  38. package/dist/utils/bundle-didcomm-payload.js +48 -0
  39. package/dist/utils/communication-attached-bundle-session-helpers.d.ts +54 -0
  40. package/dist/utils/communication-attached-bundle-session-helpers.js +517 -0
  41. package/dist/utils/communication-attached-bundle-session.d.ts +59 -302
  42. package/dist/utils/communication-attached-bundle-session.js +114 -839
  43. package/dist/utils/communication-consent-access-editor.d.ts +85 -0
  44. package/dist/utils/communication-consent-access-editor.js +244 -0
  45. package/dist/utils/communication-didcomm-payload.d.ts +33 -0
  46. package/dist/utils/communication-didcomm-payload.js +75 -0
  47. package/dist/utils/index.d.ts +8 -0
  48. package/dist/utils/index.js +8 -0
  49. package/dist/utils/profile-manager-mem.d.ts +69 -0
  50. package/dist/utils/profile-manager-mem.js +79 -0
  51. package/dist/utils/profile-outbox-memory-repository.d.ts +34 -0
  52. package/dist/utils/profile-outbox-memory-repository.js +57 -0
  53. package/dist/utils/wallet-mem.d.ts +93 -0
  54. package/dist/utils/wallet-mem.js +277 -0
  55. package/dist/utils/wallet-memory-queue.d.ts +32 -0
  56. package/dist/utils/wallet-memory-queue.js +82 -0
  57. package/package.json +1 -1
package/README.md CHANGED
@@ -655,4 +655,3 @@ When integrating the converged SDKs:
655
655
 
656
656
  ## Roadmap and Briefing
657
657
  - `docs/BRIEFING_DATASPACE_EN.md`
658
- - `TODO_ROADMAP.md`
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared synthetic DIDComm fixtures for direct Bundle payload tests.
3
+ */
4
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_ISS: "did:web:portal.example.org";
5
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_AUD: "https://gateway.example.com/bundle";
6
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_JTI: "didcomm-bundle-jti-001";
7
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_THID: "didcomm-bundle-thread-001";
8
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_ENTRY_TYPE: "Bundle-batch-request-v1.0";
9
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_REPLY_AUD: "https://gateway.example.com/bundle-reply";
10
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_REPLY_JTI: "didcomm-bundle-reply-jti-001";
11
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_ACK_TYPE: "Bundle-ack-v1.0";
@@ -0,0 +1,13 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ import { EXAMPLE_GATEWAY_PUBLIC_ORIGIN, } from './shared.js';
3
+ /**
4
+ * Shared synthetic DIDComm fixtures for direct Bundle payload tests.
5
+ */
6
+ export const EXAMPLE_DIDCOMM_BUNDLE_ISS = 'did:web:portal.example.org';
7
+ export const EXAMPLE_DIDCOMM_BUNDLE_AUD = `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/bundle`;
8
+ export const EXAMPLE_DIDCOMM_BUNDLE_JTI = 'didcomm-bundle-jti-001';
9
+ export const EXAMPLE_DIDCOMM_BUNDLE_THID = 'didcomm-bundle-thread-001';
10
+ export const EXAMPLE_DIDCOMM_BUNDLE_ENTRY_TYPE = 'Bundle-batch-request-v1.0';
11
+ export const EXAMPLE_DIDCOMM_BUNDLE_REPLY_AUD = `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/bundle-reply`;
12
+ export const EXAMPLE_DIDCOMM_BUNDLE_REPLY_JTI = 'didcomm-bundle-reply-jti-001';
13
+ export const EXAMPLE_DIDCOMM_BUNDLE_ACK_TYPE = 'Bundle-ack-v1.0';
@@ -6,7 +6,8 @@ import { CommunicationCategoryCodes } from '../constants/communication.js';
6
6
  import { DataspaceSectors } from '../constants/sectors.js';
7
7
  import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
8
8
  import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_CONSENT_DATE, EXAMPLE_CONSENT_IDENTIFIER, EXAMPLE_CONSENT_PERIOD_END, EXAMPLE_CONSENT_PERIOD_START, EXAMPLE_CONSENT_PURPOSE_TREATMENT, EXAMPLE_CONSENT_PURPOSE_EMERGENCY_TREATMENT, EXAMPLE_EMAIL_PROFESSIONAL, EXAMPLE_HEALTHCARE_ACTOR_ROLE_GENERALIST_MEDICAL_PRACTITIONER, EXAMPLE_HEALTHCARE_ACTOR_ROLE_PHYSICIAN, EXAMPLE_HEALTHCARE_JURISDICTION, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_MEDICATION_STATEMENT_IDENTIFIER, EXAMPLE_MEDICATION_STATEMENT_STATUS, EXAMPLE_MEDICATION_STATEMENT_TEXT, EXAMPLE_PROVIDER_ORGANIZATION_DID, EXAMPLE_SECONDARY_HEALTHCARE_JURISDICTION, EXAMPLE_SUBJECT_DID, } from './shared.js';
9
- import { CommunicationAttachedBundleSession, createConsentAccessEditor, } from '../utils/communication-attached-bundle-session.js';
9
+ import { CommunicationAttachedBundleSession, } from '../utils/communication-attached-bundle-session.js';
10
+ import { createConsentAccessEditor, } from '../utils/communication-consent-access-editor.js';
10
11
  import { setCommunicationCategory, setCommunicationIdentifier, setCommunicationSubject, setCommunicationText, setCommunicationTopic, } from '../claims/claims-helpers-communication.js';
11
12
  import { setActorIdentifierList, setActorRoleList, setConsentDate, setConsentDecision, setConsentIdentifier, setConsentPeriodEnd, setConsentPeriodStart, setConsentSubject, setPurposeList, setSectionList, } from '../claims/claims-helpers-consent.js';
12
13
  import { setClaimValues } from '../claims/claim-list-helpers.js';
@@ -0,0 +1,35 @@
1
+ import { AppointmentStatus } from '../models/interoperable-claims/appointment-claims';
2
+ /**
3
+ * Shared synthetic DIDComm fixtures for Communication-attached bundle tests.
4
+ */
5
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ISS: "did:web:portal.example.org";
6
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_AUD: "https://gateway.example.com/request";
7
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_JTI: "didcomm-communication-jti-001";
8
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_THID: "didcomm-communication-thread-001";
9
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ENTRY_TYPE: "Communication-attached-bundle-v1.0";
10
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_TEXT: "IPS ingestion request";
11
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ID: "urn:uuid:communication-example-001";
12
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_SUBJECT: string;
13
+ export declare const EXAMPLE_DIDCOMM_COMMUNICATION_ATTACHMENT_CONTEXT: "org.hl7.fhir.r4";
14
+ export declare const EXAMPLE_DIDCOMM_BUNDLE_ENTRY_CONTEXT: "org.hl7.fhir.api";
15
+ export declare const EXAMPLE_DIDCOMM_REPLY_AUD: "https://gateway.example.com/reply";
16
+ export declare const EXAMPLE_DIDCOMM_REPLY_JTI: "didcomm-communication-reply-jti-001";
17
+ export declare const EXAMPLE_DIDCOMM_ACK_TYPE: "Communication-ack-v1.0";
18
+ export declare const EXAMPLE_DIDCOMM_ACK_BODY_OK_KEY: "ok";
19
+ export declare const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY: "receivedMedicationIdentifier";
20
+ export declare const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY: "receivedDocumentIdentifier";
21
+ export declare const EXAMPLE_APPOINTMENT_IDENTIFIER: "appointment-001";
22
+ export declare const EXAMPLE_APPOINTMENT_START: "2026-07-01T09:00:00Z";
23
+ export declare const EXAMPLE_APPOINTMENT_END: "2026-07-01T09:30:00Z";
24
+ export declare const EXAMPLE_APPOINTMENT_DESCRIPTION: "Medication follow-up visit.";
25
+ export declare const EXAMPLE_APPOINTMENT_PARTICIPANT_STATUS: "accepted";
26
+ export declare const EXAMPLE_APPOINTMENT_CLAIMS: {
27
+ readonly '@context': "org.hl7.fhir.api";
28
+ readonly "Appointment.identifier": "appointment-001";
29
+ readonly "Appointment.status": AppointmentStatus.Booked;
30
+ readonly "Appointment.description": "Medication follow-up visit.";
31
+ readonly "Appointment.start": "2026-07-01T09:00:00Z";
32
+ readonly "Appointment.end": "2026-07-01T09:30:00Z";
33
+ readonly "Appointment.participant.actor": `${string},${string}`;
34
+ readonly "Appointment.participant.status": "accepted";
35
+ };
@@ -0,0 +1,38 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ import { Format } from '../constants/Schemas.js';
3
+ import { EXAMPLE_COMMUNICATION_IDENTIFIER, EXAMPLE_GATEWAY_PUBLIC_ORIGIN, EXAMPLE_IPS_BUNDLE_NOTE_TEXT, EXAMPLE_PROFESSIONAL_DID, EXAMPLE_SUBJECT_DID, } from './shared.js';
4
+ import { AppointmentClaim, AppointmentStatus, } from '../models/interoperable-claims/appointment-claims.js';
5
+ /**
6
+ * Shared synthetic DIDComm fixtures for Communication-attached bundle tests.
7
+ */
8
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ISS = 'did:web:portal.example.org';
9
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_AUD = `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/request`;
10
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_JTI = 'didcomm-communication-jti-001';
11
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_THID = 'didcomm-communication-thread-001';
12
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ENTRY_TYPE = 'Communication-attached-bundle-v1.0';
13
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_TEXT = EXAMPLE_IPS_BUNDLE_NOTE_TEXT;
14
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ID = EXAMPLE_COMMUNICATION_IDENTIFIER;
15
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_SUBJECT = EXAMPLE_SUBJECT_DID;
16
+ export const EXAMPLE_DIDCOMM_COMMUNICATION_ATTACHMENT_CONTEXT = Format.FHIR_R4;
17
+ export const EXAMPLE_DIDCOMM_BUNDLE_ENTRY_CONTEXT = Format.FHIR_API;
18
+ export const EXAMPLE_DIDCOMM_REPLY_AUD = `${EXAMPLE_GATEWAY_PUBLIC_ORIGIN}/reply`;
19
+ export const EXAMPLE_DIDCOMM_REPLY_JTI = 'didcomm-communication-reply-jti-001';
20
+ export const EXAMPLE_DIDCOMM_ACK_TYPE = 'Communication-ack-v1.0';
21
+ export const EXAMPLE_DIDCOMM_ACK_BODY_OK_KEY = 'ok';
22
+ export const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_MEDICATION_IDENTIFIER_KEY = 'receivedMedicationIdentifier';
23
+ export const EXAMPLE_DIDCOMM_ACK_BODY_RECEIVED_DOCUMENT_IDENTIFIER_KEY = 'receivedDocumentIdentifier';
24
+ export const EXAMPLE_APPOINTMENT_IDENTIFIER = 'appointment-001';
25
+ export const EXAMPLE_APPOINTMENT_START = '2026-07-01T09:00:00Z';
26
+ export const EXAMPLE_APPOINTMENT_END = '2026-07-01T09:30:00Z';
27
+ export const EXAMPLE_APPOINTMENT_DESCRIPTION = 'Medication follow-up visit.';
28
+ export const EXAMPLE_APPOINTMENT_PARTICIPANT_STATUS = 'accepted';
29
+ export const EXAMPLE_APPOINTMENT_CLAIMS = {
30
+ '@context': EXAMPLE_DIDCOMM_BUNDLE_ENTRY_CONTEXT,
31
+ [AppointmentClaim.Identifier]: EXAMPLE_APPOINTMENT_IDENTIFIER,
32
+ [AppointmentClaim.Status]: AppointmentStatus.Booked,
33
+ [AppointmentClaim.Description]: EXAMPLE_APPOINTMENT_DESCRIPTION,
34
+ [AppointmentClaim.Start]: EXAMPLE_APPOINTMENT_START,
35
+ [AppointmentClaim.End]: EXAMPLE_APPOINTMENT_END,
36
+ [AppointmentClaim.ParticipantActor]: `${EXAMPLE_SUBJECT_DID},${EXAMPLE_PROFESSIONAL_DID}`,
37
+ [AppointmentClaim.ParticipantStatus]: EXAMPLE_APPOINTMENT_PARTICIPANT_STATUS,
38
+ };
@@ -20,6 +20,10 @@ export * from './lifecycle';
20
20
  export * from './api-flow-examples';
21
21
  export * from './contract-examples';
22
22
  export * from './communication-attached-bundle-session';
23
+ export * from './bundle-didcomm-payload';
23
24
  export * from './communication-bundle-document-request';
25
+ export * from './communication-didcomm-payload';
24
26
  export * from './ips-bundle';
25
27
  export * from './vital-signs';
28
+ export * from './wallet-mem';
29
+ export * from './profile-manager-mem';
@@ -20,6 +20,10 @@ export * from './lifecycle.js';
20
20
  export * from './api-flow-examples.js';
21
21
  export * from './contract-examples.js';
22
22
  export * from './communication-attached-bundle-session.js';
23
+ export * from './bundle-didcomm-payload.js';
23
24
  export * from './communication-bundle-document-request.js';
25
+ export * from './communication-didcomm-payload.js';
24
26
  export * from './ips-bundle.js';
25
27
  export * from './vital-signs.js';
28
+ export * from './wallet-mem.js';
29
+ export * from './profile-manager-mem.js';
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Shared synthetic fixtures for low-level profile/message-manager tests.
3
+ */
4
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_PROFILE_ID: "wallet-entity-sender-001";
5
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_PROFILE_ID: "wallet-entity-recipient-001";
6
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_DID: "did:web:portal.example.org";
7
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID: "did:web:gw.example.org";
8
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_DISPLAY_NAME: "Portal BFF Profile";
9
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DISPLAY_NAME: "GW Proxy Profile";
10
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE: "Communication-response-v1.0";
11
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE: "Gateway acknowledged the queued communication.";
12
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_REPLY_AUD: "https://portal.example.org/reply";
13
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD: "https://portal.example.org/inbox";
14
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_NORMAL: "normal";
15
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_EMERGENCY: "emergency";
16
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_PAYLOAD: {
17
+ readonly iss: "did:web:gw.example.org";
18
+ readonly aud: "https://portal.example.org/inbox";
19
+ readonly jti: "gateway-response-jti-001";
20
+ readonly thid: "wallet-thread-001";
21
+ readonly type: "Communication-response-v1.0";
22
+ readonly body: {
23
+ readonly ok: true;
24
+ readonly note: "Gateway acknowledged the queued communication.";
25
+ };
26
+ };
27
+ export declare const EXAMPLE_PROFILE_MANAGER_MEM_REQUEST_PAYLOAD: {
28
+ readonly iss: "did:web:sender.example.org";
29
+ readonly aud: "https://gw.example.org/submit";
30
+ readonly jti: "wallet-jti-001";
31
+ readonly thid: "wallet-thread-001";
32
+ readonly type: "Communication-bundle-submit-v1.0";
33
+ readonly body: {
34
+ readonly data: readonly [{
35
+ readonly id: "wallet-entry-001";
36
+ readonly type: "Communication-bundle-submit-v1.0";
37
+ readonly resource: {
38
+ readonly resourceType: "Communication";
39
+ readonly note: readonly [{
40
+ readonly text: "Medication bundle ready for DIDComm transport.";
41
+ }];
42
+ };
43
+ }];
44
+ };
45
+ };
@@ -0,0 +1,29 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ import { EXAMPLE_WALLET_ENTITY_ID_RECIPIENT, EXAMPLE_WALLET_ENTITY_ID_SENDER, EXAMPLE_WALLET_MESSAGE_PAYLOAD, EXAMPLE_WALLET_PRIORITY_EMERGENCY, EXAMPLE_WALLET_PRIORITY_NORMAL, EXAMPLE_WALLET_THREAD_ID, } from './wallet-mem.js';
3
+ /**
4
+ * Shared synthetic fixtures for low-level profile/message-manager tests.
5
+ */
6
+ export const EXAMPLE_PROFILE_MANAGER_MEM_PROFILE_ID = EXAMPLE_WALLET_ENTITY_ID_SENDER;
7
+ export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_PROFILE_ID = EXAMPLE_WALLET_ENTITY_ID_RECIPIENT;
8
+ export const EXAMPLE_PROFILE_MANAGER_MEM_DID = 'did:web:portal.example.org';
9
+ export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID = 'did:web:gw.example.org';
10
+ export const EXAMPLE_PROFILE_MANAGER_MEM_DISPLAY_NAME = 'Portal BFF Profile';
11
+ export const EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DISPLAY_NAME = 'GW Proxy Profile';
12
+ export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE = 'Communication-response-v1.0';
13
+ export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE = 'Gateway acknowledged the queued communication.';
14
+ export const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_REPLY_AUD = 'https://portal.example.org/reply';
15
+ export const EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD = 'https://portal.example.org/inbox';
16
+ export const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_NORMAL = EXAMPLE_WALLET_PRIORITY_NORMAL;
17
+ export const EXAMPLE_PROFILE_MANAGER_MEM_PRIORITY_EMERGENCY = EXAMPLE_WALLET_PRIORITY_EMERGENCY;
18
+ export const EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_PAYLOAD = {
19
+ iss: EXAMPLE_PROFILE_MANAGER_MEM_GATEWAY_DID,
20
+ aud: EXAMPLE_PROFILE_MANAGER_MEM_PORTAL_INBOX_AUD,
21
+ jti: 'gateway-response-jti-001',
22
+ thid: EXAMPLE_WALLET_THREAD_ID,
23
+ type: EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_TYPE,
24
+ body: {
25
+ ok: true,
26
+ note: EXAMPLE_PROFILE_MANAGER_MEM_RESPONSE_NOTE,
27
+ },
28
+ };
29
+ export const EXAMPLE_PROFILE_MANAGER_MEM_REQUEST_PAYLOAD = EXAMPLE_WALLET_MESSAGE_PAYLOAD;
@@ -292,6 +292,7 @@ export declare const EXAMPLE_OBSERVATION_PANEL_IDENTIFIER: "urn:uuid:observation
292
292
  export declare const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER: "urn:uuid:observation-component-example-001";
293
293
  export declare const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER_SECONDARY: "urn:uuid:observation-component-example-002";
294
294
  export declare const EXAMPLE_IPS_COMPOSITION_IDENTIFIER: "ips-composition";
295
+ export declare const EXAMPLE_APPOINTMENT_RESPONSE_IDENTIFIER: "appointment-response-example-001";
295
296
  export declare const EXAMPLE_CONDITION_IDENTIFIER: "condition-example-001";
296
297
  export declare const EXAMPLE_VITAL_SIGNS_NOTE: "Measured after rest.";
297
298
  export declare const EXAMPLE_FHIR_STATUS_FINAL: "final";
@@ -335,6 +335,7 @@ export const EXAMPLE_OBSERVATION_PANEL_IDENTIFIER = 'urn:uuid:observation-panel-
335
335
  export const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER = 'urn:uuid:observation-component-example-001';
336
336
  export const EXAMPLE_OBSERVATION_COMPONENT_IDENTIFIER_SECONDARY = 'urn:uuid:observation-component-example-002';
337
337
  export const EXAMPLE_IPS_COMPOSITION_IDENTIFIER = 'ips-composition';
338
+ export const EXAMPLE_APPOINTMENT_RESPONSE_IDENTIFIER = 'appointment-response-example-001';
338
339
  export const EXAMPLE_CONDITION_IDENTIFIER = 'condition-example-001';
339
340
  export const EXAMPLE_VITAL_SIGNS_NOTE = 'Measured after rest.';
340
341
  export const EXAMPLE_FHIR_STATUS_FINAL = 'final';
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Reusable synthetic wallet fixtures for docs and tests.
3
+ *
4
+ * Rule:
5
+ * - wallet-related tests must import these values instead of re-hardcoding
6
+ * queue ids, entity ids, thread ids, or payload strings inline
7
+ */
8
+ export declare const EXAMPLE_WALLET_ENTITY_ID_SENDER: "wallet-entity-sender-001";
9
+ export declare const EXAMPLE_WALLET_ENTITY_ID_RECIPIENT: "wallet-entity-recipient-001";
10
+ export declare const EXAMPLE_WALLET_MESSAGE_ID_EMERGENCY: "wallet-message-emergency-001";
11
+ export declare const EXAMPLE_WALLET_MESSAGE_ID_NORMAL: "wallet-message-normal-001";
12
+ export declare const EXAMPLE_WALLET_THREAD_ID: "wallet-thread-001";
13
+ export declare const EXAMPLE_WALLET_PAYLOAD_TYPE: "Communication-bundle-submit-v1.0";
14
+ export declare const EXAMPLE_WALLET_CREATED_AT: "2026-06-30T10:00:00.000Z";
15
+ export declare const EXAMPLE_WALLET_CONTENT_NOTE: "Medication bundle ready for DIDComm transport.";
16
+ export declare const EXAMPLE_WALLET_FAILURE_MESSAGE: "Gateway temporary failure.";
17
+ export declare const EXAMPLE_WALLET_PROTECTED_DOC_ID: "wallet-doc-001";
18
+ export declare const EXAMPLE_WALLET_PRIORITY_EMERGENCY: "emergency";
19
+ export declare const EXAMPLE_WALLET_PRIORITY_NORMAL: "normal";
20
+ export declare const EXAMPLE_WALLET_MESSAGE_PAYLOAD: {
21
+ readonly iss: "did:web:sender.example.org";
22
+ readonly aud: "https://gw.example.org/submit";
23
+ readonly jti: "wallet-jti-001";
24
+ readonly thid: "wallet-thread-001";
25
+ readonly type: "Communication-bundle-submit-v1.0";
26
+ readonly body: {
27
+ readonly data: readonly [{
28
+ readonly id: "wallet-entry-001";
29
+ readonly type: "Communication-bundle-submit-v1.0";
30
+ readonly resource: {
31
+ readonly resourceType: "Communication";
32
+ readonly note: readonly [{
33
+ readonly text: "Medication bundle ready for DIDComm transport.";
34
+ }];
35
+ };
36
+ }];
37
+ };
38
+ };
@@ -0,0 +1,40 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ import { WalletMessagePriorities } from '../models/wallet.js';
3
+ /**
4
+ * Reusable synthetic wallet fixtures for docs and tests.
5
+ *
6
+ * Rule:
7
+ * - wallet-related tests must import these values instead of re-hardcoding
8
+ * queue ids, entity ids, thread ids, or payload strings inline
9
+ */
10
+ export const EXAMPLE_WALLET_ENTITY_ID_SENDER = 'wallet-entity-sender-001';
11
+ export const EXAMPLE_WALLET_ENTITY_ID_RECIPIENT = 'wallet-entity-recipient-001';
12
+ export const EXAMPLE_WALLET_MESSAGE_ID_EMERGENCY = 'wallet-message-emergency-001';
13
+ export const EXAMPLE_WALLET_MESSAGE_ID_NORMAL = 'wallet-message-normal-001';
14
+ export const EXAMPLE_WALLET_THREAD_ID = 'wallet-thread-001';
15
+ export const EXAMPLE_WALLET_PAYLOAD_TYPE = 'Communication-bundle-submit-v1.0';
16
+ export const EXAMPLE_WALLET_CREATED_AT = '2026-06-30T10:00:00.000Z';
17
+ export const EXAMPLE_WALLET_CONTENT_NOTE = 'Medication bundle ready for DIDComm transport.';
18
+ export const EXAMPLE_WALLET_FAILURE_MESSAGE = 'Gateway temporary failure.';
19
+ export const EXAMPLE_WALLET_PROTECTED_DOC_ID = 'wallet-doc-001';
20
+ export const EXAMPLE_WALLET_PRIORITY_EMERGENCY = WalletMessagePriorities.Emergency;
21
+ export const EXAMPLE_WALLET_PRIORITY_NORMAL = WalletMessagePriorities.Normal;
22
+ export const EXAMPLE_WALLET_MESSAGE_PAYLOAD = {
23
+ iss: 'did:web:sender.example.org',
24
+ aud: 'https://gw.example.org/submit',
25
+ jti: 'wallet-jti-001',
26
+ thid: EXAMPLE_WALLET_THREAD_ID,
27
+ type: EXAMPLE_WALLET_PAYLOAD_TYPE,
28
+ body: {
29
+ data: [
30
+ {
31
+ id: 'wallet-entry-001',
32
+ type: EXAMPLE_WALLET_PAYLOAD_TYPE,
33
+ resource: {
34
+ resourceType: 'Communication',
35
+ note: [{ text: EXAMPLE_WALLET_CONTENT_NOTE }],
36
+ },
37
+ },
38
+ ],
39
+ },
40
+ };
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './examples';
7
7
  export * from './hmac';
8
8
  export * from './i18n/clinical-sections.i18n';
9
9
  export * from './i18n/role-codes.i18n';
10
+ export * from './interfaces';
10
11
  export * from './models';
11
12
  export * from './storage';
12
13
  export * from './utils';
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from './examples/index.js';
7
7
  export * from './hmac.js';
8
8
  export * from './i18n/clinical-sections.i18n.js';
9
9
  export * from './i18n/role-codes.i18n.js';
10
+ export * from './interfaces/index.js';
10
11
  export * from './models/index.js';
11
12
  export * from './storage/index.js';
12
13
  export * from './utils/index.js';
@@ -0,0 +1,36 @@
1
+ import type { BackendMessageResponseRecord, ProfileOutboxMessageRecord } from '../models/profile-manager';
2
+ /**
3
+ * Runtime-neutral repository for profile-scoped outbox history and decoded
4
+ * responses.
5
+ *
6
+ * Separation rule:
7
+ * - `IWalletQueue` controls ordering and mutable pending state
8
+ * - `IProfileOutboxRepository` preserves historical records and decoded
9
+ * responses that the profile/runtime may want to inspect later
10
+ */
11
+ export interface IProfileOutboxRepository {
12
+ /**
13
+ * Stores one immutable message history record.
14
+ */
15
+ putMessage(record: ProfileOutboxMessageRecord): Promise<ProfileOutboxMessageRecord>;
16
+ /**
17
+ * Returns one historical message record by id.
18
+ */
19
+ getMessage(messageId: string): Promise<ProfileOutboxMessageRecord | undefined>;
20
+ /**
21
+ * Lists all historical message records.
22
+ */
23
+ listMessages(): Promise<ProfileOutboxMessageRecord[]>;
24
+ /**
25
+ * Stores one decoded response record.
26
+ */
27
+ putResponse(record: BackendMessageResponseRecord): Promise<BackendMessageResponseRecord>;
28
+ /**
29
+ * Returns the latest decoded response for one thread id.
30
+ */
31
+ getLatestResponseByThreadId(thid: string): Promise<BackendMessageResponseRecord | undefined>;
32
+ /**
33
+ * Lists all decoded responses.
34
+ */
35
+ listResponses(): Promise<BackendMessageResponseRecord[]>;
36
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ export {};
@@ -0,0 +1,74 @@
1
+ import type { WalletEnqueueMessageInput, WalletManagedEntityDescriptor, WalletQueuedMessage } from '../models/wallet';
2
+ import type { JWK, JwkSet } from '../models/jwk';
3
+ /**
4
+ * Shared wallet contract reused by tests, apps, frontend adapters, and simple
5
+ * backend or BFF flows.
6
+ *
7
+ * Backward-compatibility rule:
8
+ * - the legacy methods (`provisionKeys`, `digest`,
9
+ * `protectConfidentialData`, `unprotectConfidentialData`, `unpack`) remain
10
+ * the stable minimum contract expected by older consumers
11
+ * - richer transport and queue helpers are optional so older platform-specific
12
+ * adapters do not need to implement them immediately
13
+ */
14
+ export interface IWallet {
15
+ /**
16
+ * Provisions or retrieves the wallet key set for one logical entity.
17
+ */
18
+ provisionKeys(entityId: string): Promise<JwkSet>;
19
+ /**
20
+ * Computes one digest string using the provided algorithm name.
21
+ */
22
+ digest(data: string, algorithm: string): Promise<string>;
23
+ /**
24
+ * Protects one local document for confidential at-rest storage.
25
+ */
26
+ protectConfidentialData(doc: unknown, entityId?: string): Promise<unknown>;
27
+ /**
28
+ * Unprotects one local confidential document.
29
+ */
30
+ unprotectConfidentialData(doc: unknown, entityId?: string): Promise<unknown>;
31
+ /**
32
+ * Unpacks one transport message into business content plus JOSE metadata.
33
+ */
34
+ unpack?(packedMessage: string, entityId?: string): Promise<{
35
+ content: unknown;
36
+ meta: Record<string, unknown>;
37
+ }>;
38
+ /**
39
+ * Packs one business payload for one recipient public key.
40
+ */
41
+ pack?(content: Record<string, unknown>, recipientJwk: JWK, entityId: string): Promise<string>;
42
+ /**
43
+ * Returns the public keys currently provisioned for one entity.
44
+ */
45
+ getPublicKeys?(entityId: string): Promise<WalletManagedEntityDescriptor>;
46
+ /**
47
+ * Signs one JSON payload into a compact JWS.
48
+ */
49
+ signCompactJws?(entityId: string, claims: Record<string, unknown>): Promise<string>;
50
+ /**
51
+ * Builds one compact JWE for the provided recipient.
52
+ */
53
+ buildCompactJwe?(entityId: string, plaintext: string | Uint8Array, recipientJwk: JWK, contentType?: string): Promise<string>;
54
+ /**
55
+ * Enqueues one local outbound message with an optional priority.
56
+ */
57
+ enqueueMessage?(input: WalletEnqueueMessageInput): Promise<WalletQueuedMessage>;
58
+ /**
59
+ * Returns the next pending message without mutating queue state.
60
+ */
61
+ peekNextMessage?(): Promise<WalletQueuedMessage | undefined>;
62
+ /**
63
+ * Marks one message as delivered.
64
+ */
65
+ markMessageDelivered?(messageId: string): Promise<WalletQueuedMessage>;
66
+ /**
67
+ * Marks one message as failed.
68
+ */
69
+ markMessageFailed?(messageId: string, errorMessage: string): Promise<WalletQueuedMessage>;
70
+ /**
71
+ * Lists all locally tracked queued messages.
72
+ */
73
+ listMessages?(): Promise<WalletQueuedMessage[]>;
74
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { WalletEnqueueMessageInput, WalletQueuedMessage } from '../models/wallet';
2
+ /**
3
+ * Runtime-neutral queue/outbox contract for low-level wallet-backed message
4
+ * scheduling.
5
+ *
6
+ * Design intent:
7
+ * - `common-utils` provides the contract plus one in-memory implementation
8
+ * - BFF/server runtimes may later plug Redis, Google, filesystem, or database
9
+ * adapters without changing `WalletMem`
10
+ * - mobile/native runtimes may plug SQLite-backed outbox adapters
11
+ */
12
+ export interface IWalletQueue {
13
+ /**
14
+ * Enqueues one outbound message and returns the stored queued record.
15
+ */
16
+ enqueue(input: WalletEnqueueMessageInput): Promise<WalletQueuedMessage>;
17
+ /**
18
+ * Returns the next pending message according to queue ordering rules without
19
+ * mutating queue state.
20
+ */
21
+ peekNextPending(): Promise<WalletQueuedMessage | undefined>;
22
+ /**
23
+ * Updates one queued message by identifier and returns the stored result.
24
+ */
25
+ update(messageId: string, patch: Partial<WalletQueuedMessage>): Promise<WalletQueuedMessage>;
26
+ /**
27
+ * Lists all queued messages in current processing order.
28
+ */
29
+ list(): Promise<WalletQueuedMessage[]>;
30
+ }
@@ -0,0 +1,2 @@
1
+ // Copyright 2026 Conectate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
2
+ export {};
@@ -0,0 +1,8 @@
1
+ export * from './ICryptoHelper';
2
+ export * from './ICryptography';
3
+ export * from './IWallet';
4
+ export * from './IProfileOutboxRepository';
5
+ export * from './IWalletQueue';
6
+ export * from './MlDsa';
7
+ export * from './MlKem';
8
+ export * from './Cryptography.types';
@@ -0,0 +1,8 @@
1
+ export * from './ICryptoHelper.js';
2
+ export * from './ICryptography.js';
3
+ export * from './IWallet.js';
4
+ export * from './IProfileOutboxRepository.js';
5
+ export * from './IWalletQueue.js';
6
+ export * from './MlDsa.js';
7
+ export * from './MlKem.js';
8
+ export * from './Cryptography.types.js';