Skip to content

Commit 2f4c542

Browse files
committed
refactor(Collector): add typed connection getter (plan 61 B3)
Adds a public `get connection (): pryv.Connection` getter that returns `this.appManaging.connection`, so consumers can drop the `(collector as unknown as { appManaging: { connection: any } }).appManaging.connection` casts that were spreading across PatientsTable / PatientsPage / EmbedInvite. The underlying `appManaging: any` field stays as-is — typing it strictly as AppManagingAccount surfaces a ripple of pre-existing bad annotations in Collector's own `connection.api(...)` calls, and the class is queued for deletion in plan 61 Phase C. The getter is enough to unblock the consumer-side cleanup today.
1 parent 812ca92 commit 2f4c542

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

ts/appTemplates/Collector.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { waitUntilFalse } from '../utils.ts';
44
import { CollectorInvite } from './CollectorInvite.ts';
55
import * as logger from '../logger.ts';
66
import type { Permission, AccessUpdateAction } from './interfaces.ts';
7+
import { pryv } from '../patchedPryv.ts';
78

89
const COLLECTOR_STREAMID_SUFFIXES = {
910
archive: 'archive',
@@ -30,6 +31,17 @@ export class Collector {
3031
});
3132

3233
appManaging: any;
34+
35+
/**
36+
* Plan 60 B3 — typed accessor for the doctor's master connection.
37+
* Lets consumers read `collector.connection` instead of casting through
38+
* `appManaging: any`. The underlying `appManaging` field stays `any` to
39+
* avoid an upgrade-blocking ripple of strict-typing errors in this legacy
40+
* class (the class is queued for deletion in Phase C anyway).
41+
*/
42+
get connection (): pryv.Connection {
43+
return this.appManaging.connection;
44+
}
3345
streamId: string;
3446
name: string;
3547
#streamData: any;

0 commit comments

Comments
 (0)