dataspace-client-sdk-node 0.2.3 → 0.2.4

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 CHANGED
@@ -4,16 +4,17 @@ Node.js SDK to consume GW/UNID async DIDComm endpoints.
4
4
 
5
5
  ## Documentation Index
6
6
 
7
- 1. [Full API Reference](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/API.md)
8
- 2. [Data Model Alignment (GW + Chat + SDK)](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/DATA_MODEL_ALIGNMENT.md)
9
- 3. [Developer Use-Case Cookbook (UC5 + additional patterns)](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/DEVELOPER_USE_CASES.md)
10
- 4. [Live Local GW UC5 E2E (no mocks)](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/E2E_LOCAL_GW_UC5.md)
11
- 5. [React Web Integration Guide](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/REACT_WEB_INTEGRATION.md)
7
+ 1. [Legal Organization Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/LEGAL_ORGANIZATION_FLOW_STEP_BY_STEP.md)
8
+ 2. [Practitioner Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/PRACTITIONER_FLOW_STEP_BY_STEP.md)
9
+ 3. [Personal Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/PERSONAL_FLOW_STEP_BY_STEP.md)
10
+ 4. [Controller Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/CONTROLLER_FLOW_STEP_BY_STEP.md)
11
+ 5. [Live Local GW UC5 E2E (no mocks)](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/E2E_LOCAL_GW_UC5.md)
12
12
  6. [Backend Node Integration Guide](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/BACKEND_NODE_INTEGRATION.md)
13
- 7. [Controller Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/CONTROLLER_FLOW_STEP_BY_STEP.md)
14
- 8. [Legal Organization Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/LEGAL_ORGANIZATION_FLOW_STEP_BY_STEP.md)
15
- 9. [Practitioner Flow Step by Step](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/PRACTITIONER_FLOW_STEP_BY_STEP.md)
16
- 10. [Portal Backend Integration Handover](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/PORTAL_BACKEND_INTEGRATION_HANDOVER.md)
13
+ 7. [Full API Reference](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/API.md)
14
+ 8. [Developer Use-Case Cookbook (secondary examples)](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/DEVELOPER_USE_CASES.md)
15
+ 9. [Data Model Alignment (GW + Chat + SDK)](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/DATA_MODEL_ALIGNMENT.md)
16
+ 10. [React Web Integration Guide](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/REACT_WEB_INTEGRATION.md)
17
+ 11. [Portal Backend Integration Handover](https://github.com/Global-DataCare/dataspace-client-sdk-node/blob/main/docs/PORTAL_BACKEND_INTEGRATION_HANDOVER.md)
17
18
 
18
19
  ## TODO and Roadmap
19
20
 
package/docs/API.md CHANGED
@@ -139,10 +139,10 @@ type CreatePhoneReminderTasksInput = {
139
139
  windows: Array<{ offsetMinutes: number; remindAt: string }>; // remindAt = ISO-8601
140
140
  locale?: string;
141
141
  callSid?: string;
142
- notificationPhone?: string;
143
- controllerPhone?: string;
144
- subjectRef: string; // e.g. 'Person/+34600000001'
145
- ownerRef: string; // e.g. 'RelatedPerson/+34699999999'
142
+ notificationPhone?: string; // optional legacy/fallback only
143
+ controllerPhone?: string; // optional legacy/fallback only
144
+ subjectRef: string; // e.g. 'Person/subject-uuid' or 'Person/mailto:subject@example.com'
145
+ ownerRef: string; // e.g. 'RelatedPerson/controller-uuid' or 'RelatedPerson/mailto:controller@example.com'
146
146
  focusRef: string; // e.g. 'Appointment/2026-05-10T10:00:00.000Z'
147
147
  reminderSummary?: string;
148
148
  description?: string;
@@ -252,7 +252,7 @@ const ctx: RouteContext = { tenantId: 'acme', jurisdiction: 'ES', sector: 'healt
252
252
 
253
253
  // Register or resume a family organization
254
254
  const payload = createDidcommPlainMessage({
255
- iss: '+34600000001',
255
+ iss: 'mailto:controller@example.com',
256
256
  aud: 'did:web:api.acme.org',
257
257
  body: {
258
258
  data: [{
@@ -260,9 +260,9 @@ const payload = createDidcommPlainMessage({
260
260
  meta: {
261
261
  claims: {
262
262
  '@context': 'org.schema',
263
- 'org.schema.Organization.telephone': '+34611111111', // notification phone (subject)
264
- 'org.schema.Organization.creator': '+34600000001', // controller phone
265
- 'org.schema.Organization.owner.telephone': '+34600000001', // controller (indexed)
263
+ 'org.schema.Organization.email': 'subject@example.com', // subject contact (primary)
264
+ 'org.schema.Organization.creator': 'mailto:controller@example.com', // controller (primary)
265
+ 'org.schema.Organization.owner.email': 'controller@example.com', // controller (indexed)
266
266
  'org.schema.Organization.alternateName': 'Maria', // usualname (indexed)
267
267
  'org.schema.Service.category': 'health-care',
268
268
  'org.schema.Organization.addressCountry': 'ES',
@@ -667,6 +667,8 @@ console.log(poll.status, poll.attempts);
667
667
  ### `createPhoneReminderTasks`
668
668
 
669
669
  Creates one reminder `Task` per reminder window via `individual/Task/_batch`.
670
+ Primary identity channels are `subjectRef` and `ownerRef` (UUID/email/DID references).
671
+ `notificationPhone` and `controllerPhone` are optional compatibility fields.
670
672
 
671
673
  Each window maps to one deterministic task ID (SHA-256 of routing context + refs + `remindAt`).
672
674
 
@@ -686,10 +688,8 @@ const result = await client.createPhoneReminderTasks(ctx, {
686
688
  { offsetMinutes: 60, remindAt: '2026-05-10T09:00:00.000Z' }, // 1 hour before
687
689
  ],
688
690
  locale: 'es-ES',
689
- notificationPhone: '+34611111111',
690
- controllerPhone: '+34600000001',
691
- subjectRef: 'Person/+34611111111',
692
- ownerRef: 'RelatedPerson/+34600000001',
691
+ subjectRef: 'Person/subject-uuid',
692
+ ownerRef: 'RelatedPerson/controller-uuid',
693
693
  focusRef: 'Appointment/2026-05-10T10:00:00.000Z',
694
694
  reminderSummary: '10/05 10:00 | Hospital San Juan | Consulta cardiología',
695
695
  maxAttempts: 3,
@@ -702,7 +702,8 @@ console.log(result.poll.status); // 200 if all tasks created
702
702
 
703
703
  ### `searchFamilyOrganization`
704
704
 
705
- Search for an existing family organization by controller phone + usualname. Returns `null` when not found.
705
+ Legacy helper: search an existing family organization by controller phone + usualname.
706
+ For portal onboarding, use email-based registration flow docs (`PERSONAL_FLOW_STEP_BY_STEP.md`).
706
707
 
707
708
  ```ts
708
709
  searchFamilyOrganization(
@@ -19,7 +19,7 @@ const client = new DataspaceNodeClient({
19
19
  });
20
20
 
21
21
  const ctx = {
22
- tenantId: 'acme',
22
+ tenantId: 'VATES-B00112233',
23
23
  jurisdiction: 'ES',
24
24
  sector: 'health-care',
25
25
  };
@@ -126,7 +126,7 @@ Scope namespace note:
126
126
 
127
127
  ```ts
128
128
  const consent = await client.grantProfessionalAccessSimple(ctx, {
129
- subjectPhone: '+34600111222',
129
+ subjectDid: 'did:web:subject.example.com',
130
130
  subjectGivenName: 'Ana',
131
131
  actor: { identifier: 'did:web:hospital.example.com' },
132
132
  actorRole: 'Practitioner',
@@ -201,7 +201,7 @@ await client.grantProfessionalAccessSimple(ctx, {
201
201
  });
202
202
  ```
203
203
 
204
- ### C) Actor by email/phone + role
204
+ ### C) Actor by email + role (portal-first)
205
205
 
206
206
  ```ts
207
207
  await client.grantProfessionalAccessSimple(ctx, {
@@ -213,15 +213,7 @@ await client.grantProfessionalAccessSimple(ctx, {
213
213
  });
214
214
  ```
215
215
 
216
- ```ts
217
- await client.grantProfessionalAccessSimple(ctx, {
218
- subjectDid: 'did:web:subject.example.com',
219
- actor: { phone: '+34600111222' }, // maps to urn:tel:+34600111222
220
- actorRole: 'Practitioner',
221
- purpose: 'TREAT',
222
- actions: ['organization/AppointmentResponse.cruds'],
223
- });
224
- ```
216
+ Phone-based actor identifiers are supported for compatibility flows, but email/DID are the primary portal channels.
225
217
 
226
218
  ### D) Jurisdiction + role (explicit claims)
227
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dataspace-client-sdk-node",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Node.js SDK for DIDComm plain batch + async polling flows",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Antifraud Services Inc.",
package/src/types.ts CHANGED
@@ -436,7 +436,15 @@ export type CreatePhoneReminderTasksInput = {
436
436
  * in backend task execution. Provide this only for audit/fallback/optimization.
437
437
  */
438
438
  controllerPhone?: string;
439
+ /**
440
+ * Canonical subject reference (preferred): UUID/resource reference, email-based ref, or DID ref.
441
+ * Example: `Person/subject-uuid`, `Person/mailto:subject@example.com`, `Person/did:web:...`.
442
+ */
439
443
  subjectRef: string;
444
+ /**
445
+ * Canonical owner/controller reference (preferred): UUID/resource reference, email-based ref, or DID ref.
446
+ * Example: `RelatedPerson/controller-uuid`, `RelatedPerson/mailto:controller@example.com`.
447
+ */
440
448
  ownerRef: string;
441
449
  focusRef: string;
442
450
  subjectDisplay?: string;