Skip to content

Commit 3df7e3c

Browse files
committed
chore(release): 1.0.0 — legacy collector code deleted (plan 61 C1.d/e)
BREAKING: - Deleted classes: Collector, CollectorClient, CollectorInvite (~1420 LOC). - AppManagingAccount: removed createCollector/getCollectors/getCollectorById/ getContacts; now a thin Application subclass. - AppClientAccount: removed handleIncomingRequest/getCollectorClients/ getContacts; now a thin Application subclass. - Contact: removed sources/collectorClients/invites fields + their add* methods. Removed legacy getters (primaryCollectorClient, isPending, hasPendingUpdate, pendingUpdateClients, acceptPendingInvite, refusePendingInvite, formSections, chatStreams, chatPost, collectorSources, bridgeSources). Removed static groupByContact/sourceFromAccess. - Contact.status / isActive / appStreamIds / allPermissions / accessIds / hasChat rewritten to derive from cmcRelationships (+ accessObjects for accessIds). hds-webapp's wrapper getters and ItemInputDialog's formSections consumer continue to work. - interfaces.ts: removed ContactSource/ContactSourceType/ChatStreams + AccessUpdateRequest types. Permission/CollectorSectionInterface/ RequestSectionType retained. - itemLabels.collectItemLabels(itemKey, contacts) now walks cmcRelationships[].hdsFormSpec.sections (was CollectorClient.getSections). KEPT: - CollectorRequest (used by hds-forms-js FormBuilder UI per Path B). - Contact.accessObjects (still populated by aggregateCmc; backs initStreamCache / eventIsAccessible / eventIsFromContact). Tests: 499 passing. Deleted 5 legacy test suites (accessUpdate, apptemplates, and the legacy parts of contact / applicationClass / apptemplatesRequest). New CTDE getter tests for the rewritten Contact derivations. Live verified: doctor signin → sidebar lists FormSpecs → PatientsPage reads form by id → existing invite still visible. Consumers still on legacy: bridge-redcap (frozen on hds-lib#0fedc1d in bridge-redcap@d5acb30).
1 parent 0fedc1d commit 3df7e3c

18 files changed

Lines changed: 191 additions & 3358 deletions

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## [1.0.0] - 2026-05-27
4+
5+
### Plan 61 Phase C — legacy collector code deleted
6+
7+
API surface frozen: no more `Collector` / `CollectorClient` / `CollectorInvite` classes, no `AppManagingAccount.createCollector` / `getCollectors` / `getCollectorById`, no `AppClientAccount.handleIncomingRequest` / `getCollectorClients` / `getContacts`, and `Contact` is CMC-only. The CMC path (`@pryv/cmc` + the `cmc*` helpers in this lib — `cmcFormSpec`, `cmcAppScope`, `cmcConstants`) is the only supported flow for doctor-side forms and patient-side relationships.
8+
9+
`CollectorRequest` survives as a pure editor-state class consumed by `hds-forms-js`'s FormBuilder UI (locked via plan 61 Path B).
10+
11+
### BREAKING
12+
13+
- **Deleted classes:** `Collector`, `CollectorClient`, `CollectorInvite`.
14+
- **Deleted from `Contact`:** `sources`, `collectorClients`, `invites` fields + their `addSource`/`addCollectorClient`/`addInvite` methods. Deleted getters: `primaryCollectorClient`, `incomingCollectorClients`, `isPending`, `hasPendingUpdate`, `pendingUpdateClients`, `pendingCollectorClient`, `acceptPendingInvite`, `refusePendingInvite`, `formSections`, `chatStreams`, `chatPost`, `collectorSources`, `bridgeSources`. Deleted static methods: `Contact.groupByContact`, `Contact.sourceFromAccess`. The `accessObjects` field is kept (used by `initStreamCache` + `eventIsAccessible` + `eventIsFromContact`, populated by `Contact.aggregateCmc`).
15+
- **Rewritten `Contact` getters (CMC-only):** `status` (derived from `cmcRelationships[].acceptedAt`), `hasChat` (from `cmcRelationships[].features.chat`), `appStreamIds` (distinct `appCode` set), `allPermissions` (alias for `cmcAllPermissions`), `isActive`, `accessIds`.
16+
- **Deleted from `AppManagingAccount`:** `createCollector`, `createCollectorUnitialized`, `getCollectors`, `getCollectorById`, `getContacts`. Class is now a thin `Application` subclass.
17+
- **Deleted from `AppClientAccount`:** `handleIncomingRequest`, `getCollectorClientByKey`, `getCollectorClients`, `getContacts`. Class is now a thin `Application` subclass.
18+
- **Deleted from `interfaces.ts`:** `ContactSource`, `ContactSourceType`, `ChatStreams`, `AccessUpdateAction`, `AccessUpdateRequestContent`, `AccessUpdateRequest`. `Permission`, `RequestSectionType`, `CollectorSectionInterface` are kept.
19+
- **Deleted from `appTemplates` re-exports:** `Collector`, `CollectorClient`, `CollectorInvite`, `ContactInvite`, `AccessUpdateRequest*`.
20+
- **`collectItemLabels(itemKey, contacts)`** now walks `contact.cmcRelationships[].hdsFormSpec.sections` instead of legacy `CollectorClient.getSections()`.
21+
22+
### Migration
23+
24+
Callers can pin to `github:healthdatasafe/hds-lib-js#0fedc1d` (the last pre-1.0 commit) until ported to the CMC API. `bridge-redcap` is frozen on this pin pending its own port — see [`_macro/bridge-redcap/CLAUDE.md`](../../bridge-redcap/CLAUDE.md) for the port checklist.
25+
26+
For the doctor-side form-storage migration, see `doctor-dashboard/app/formSpecAdapter.ts` (CollectorRequest ↔ FormSpec translators) and `doctor-dashboard/app/cmcDoctor.ts` (`saveFormSpec` / `listInviteRecordsFor` / etc.) for the reference port.
27+
328
## [Unreleased]
429

530
## [0.11.0] - 2026-05-14

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hds-lib",
3-
"version": "0.12.2",
3+
"version": "1.0.0",
44
"description": "Health Data Safe - Library",
55
"type": "module",
66
"engines": {

tests/accessUpdate.test.js

Lines changed: 0 additions & 187 deletions
This file was deleted.

tests/applicationClass.test.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { assert } from './test-utils/deps-node.js';
22
import { createUserAndPermissions } from './test-utils/pryvService.js';
33
import HDSLib from '../ts/index.ts';
4-
import { helperNewAppManaging } from './test-utils/helpersAppTemplate.js';
54
const Application = HDSLib.appTemplates.Application;
65

76
describe('[APAX] Application class', function () {
@@ -137,38 +136,6 @@ describe('[APAX] Application class', function () {
137136
});
138137
});
139138

140-
describe('[AMGX] AppManagingAccount tests', function () {
141-
it('[AMGA] getCollectorById returns collector when exists', async () => {
142-
const testBaseStreamId = 'amga-test';
143-
const { appManaging } = await helperNewAppManaging(testBaseStreamId, 'test-AMGA');
144-
const collector = await appManaging.createCollector('Test Collector AMGA');
145-
146-
const foundCollector = await appManaging.getCollectorById(collector.id);
147-
assert.ok(foundCollector);
148-
assert.equal(foundCollector.id, collector.id);
149-
});
150-
151-
it('[AMGB] getCollectorById returns undefined when not exists', async () => {
152-
const testBaseStreamId = 'amgb-test';
153-
const { appManaging } = await helperNewAppManaging(testBaseStreamId, 'test-AMGB');
154-
155-
const foundCollector = await appManaging.getCollectorById('non-existent-id');
156-
assert.equal(foundCollector, undefined);
157-
});
158-
159-
it('[AMGC] getCollectors with forceRefresh reloads data', async () => {
160-
const testBaseStreamId = 'amgc-test';
161-
const { appManaging } = await helperNewAppManaging(testBaseStreamId, 'test-AMGC');
162-
163-
const collectors1 = await appManaging.getCollectors();
164-
assert.equal(collectors1.length, 0);
165-
166-
await appManaging.createCollector('Test Collector AMGC');
167-
const collectors2 = await appManaging.getCollectors(true);
168-
assert.equal(collectors2.length, 1);
169-
});
170-
});
171-
172139
describe('[ACSX] Application setCustomSetting tests', function () {
173140
it('[ACSA] setCustomSetting adds a key', async () => {
174141
class Dummy extends Application {

0 commit comments

Comments
 (0)