@openedc/sdk 3.9.0 → 3.9.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.
- package/README.md +17 -0
- package/openedc-sdk.d.ts +11 -5
- package/openedc-sdk.js +1192 -1169
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -152,6 +152,23 @@ const itemData = await ItemData
|
|
|
152
152
|
.all();
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
+
#### Subject key rendering
|
|
156
|
+
|
|
157
|
+
Full subject keys (e.g., SCREENING-MS-001) are rendered dynamically to allow updates to prefix, padding, and location settings. This requires the use of certain `SubjectData` methods to compose and render full subject keys at runtime.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { SubjectData } from "@openedc/sdk";
|
|
161
|
+
|
|
162
|
+
// Render one subject key dynamically
|
|
163
|
+
const subject = await SubjectData.where().first();
|
|
164
|
+
const subjectKey = await subject.getIdAsync();
|
|
165
|
+
|
|
166
|
+
// Render multiple subject keys in a loop
|
|
167
|
+
const subjects = await SubjectData.where().all();
|
|
168
|
+
const keyOptions = await SubjectData.fetchSubjectKeyOptions();
|
|
169
|
+
const subjectKeys = subjects.map(subject => subject.getId(keyOptions));
|
|
170
|
+
```
|
|
171
|
+
|
|
155
172
|
### Live queries
|
|
156
173
|
|
|
157
174
|
```ts
|
package/openedc-sdk.d.ts
CHANGED
|
@@ -642,8 +642,7 @@ export declare class ProjectUser extends DataBlock {
|
|
|
642
642
|
get language(): string | undefined;
|
|
643
643
|
get fullName(): string | undefined;
|
|
644
644
|
get type(): "team-member" | "study-participant";
|
|
645
|
-
|
|
646
|
-
getComboboxEntry(subjects?: SubjectData[], options?: SubjectKeyOptions): {
|
|
645
|
+
getComboboxEntry(): {
|
|
647
646
|
value: string;
|
|
648
647
|
content: string;
|
|
649
648
|
};
|
|
@@ -800,6 +799,10 @@ export declare class SubjectData extends DataBlock {
|
|
|
800
799
|
static fetchSubjectKeyOptions(projectUUID?: string | undefined): Promise<SubjectKeyOptions>;
|
|
801
800
|
editableBy(user?: ProjectUser, action?: string): boolean | BlockReference<Location$1> | undefined;
|
|
802
801
|
viewableBy(user?: ProjectUser): boolean | BlockReference<Location$1> | undefined;
|
|
802
|
+
getComboboxEntry(options: SubjectKeyOptions): {
|
|
803
|
+
value: string;
|
|
804
|
+
content: string;
|
|
805
|
+
};
|
|
803
806
|
}
|
|
804
807
|
export declare class CalendarEvent extends DataBlock {
|
|
805
808
|
owner: BlockReference<User>;
|
|
@@ -1103,12 +1106,14 @@ declare class ShareableBlock extends DataBlock {
|
|
|
1103
1106
|
sharedWithParticipants?: boolean;
|
|
1104
1107
|
locationsFilter?: BlockReference<Location$1>[];
|
|
1105
1108
|
usersFilter?: BlockReference<User>[];
|
|
1109
|
+
subjectsFilter?: BlockReference<SubjectData>[];
|
|
1106
1110
|
collaborators?: BlockReference<User>[];
|
|
1107
1111
|
constructor(owner: BlockReference<User>);
|
|
1108
|
-
get explicitUsers(): BlockReference<User>[];
|
|
1109
1112
|
userHasAccess(user?: ProjectUser, subjects?: SubjectData[]): boolean | undefined;
|
|
1110
1113
|
userMayEdit(user?: ProjectUser): boolean | undefined;
|
|
1111
|
-
usersLocationFilter(user?: ProjectUser
|
|
1114
|
+
usersLocationFilter(user?: ProjectUser): boolean | undefined;
|
|
1115
|
+
subjectsLocationFilter(subject?: SubjectData): boolean;
|
|
1116
|
+
static getWith(owner: User, recipient: BlockReference<User> | BlockReference<SubjectData>): Promise<ShareableBlock>;
|
|
1112
1117
|
}
|
|
1113
1118
|
export declare class MessengerChannel extends ShareableBlock {
|
|
1114
1119
|
title?: string;
|
|
@@ -1118,7 +1123,8 @@ export declare class ChannelMessage extends DataBlock {
|
|
|
1118
1123
|
channel: BlockReference<MessengerChannel>;
|
|
1119
1124
|
author: BlockReference<User>;
|
|
1120
1125
|
text: string;
|
|
1121
|
-
|
|
1126
|
+
participant?: BlockReference<SubjectData>;
|
|
1127
|
+
constructor(channel: BlockReference<MessengerChannel>, author: BlockReference<User>, text: string, participant?: BlockReference<SubjectData>);
|
|
1122
1128
|
}
|
|
1123
1129
|
export declare class ChannelStatus extends DataBlock {
|
|
1124
1130
|
channel: BlockReference<MessengerChannel>;
|