lamp-core-lst 2025.11.20 → 2025.12.0-1.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/dist/model/Activity.d.ts +4 -0
- package/dist/service/Activity.service.d.ts +8 -1
- package/dist/service/Activity.service.js +50 -7
- package/dist/service/Fetch.js +23 -10
- package/dist/service/Researcher.service.d.ts +62 -0
- package/dist/service/Researcher.service.js +210 -0
- package/dist/service/ResearcherSettings.d.ts +69 -0
- package/dist/service/ResearcherSettings.js +12 -0
- package/package.json +1 -1
- package/src/model/Activity.ts +5 -0
- package/src/service/Activity.service.ts +58 -4
- package/src/service/Fetch.ts +22 -4
- package/src/service/Researcher.service.ts +170 -1
- package/src/service/ResearcherSettings.ts +77 -0
package/dist/model/Activity.d.ts
CHANGED
|
@@ -73,6 +73,10 @@ export declare class Activity {
|
|
|
73
73
|
* The tab settings for the activity.
|
|
74
74
|
*/
|
|
75
75
|
category?: Tab[] | null;
|
|
76
|
+
/**
|
|
77
|
+
* The photo/image URL for the activity (stored in Azure Blob Storage).
|
|
78
|
+
*/
|
|
79
|
+
photo?: any;
|
|
76
80
|
/**
|
|
77
81
|
* The type of streak for the activity.
|
|
78
82
|
*/
|
|
@@ -23,8 +23,15 @@ export declare class ActivityService {
|
|
|
23
23
|
/**
|
|
24
24
|
* Get the set of all activities available to participants of a single study, by study identifier.
|
|
25
25
|
* @param studyId
|
|
26
|
+
* @param transform
|
|
27
|
+
* @param ignore_binary
|
|
28
|
+
* @param limit Optional limit for pagination
|
|
29
|
+
* @param offset Optional offset for pagination
|
|
26
30
|
*/
|
|
27
|
-
allByStudy(studyId: Identifier, transform?: string, ignore_binary?: boolean): Promise<Activity[]
|
|
31
|
+
allByStudy(studyId: Identifier, transform?: string, ignore_binary?: boolean, limit?: number, offset?: number): Promise<Activity[] | {
|
|
32
|
+
data: Activity[];
|
|
33
|
+
total: number;
|
|
34
|
+
}>;
|
|
28
35
|
/**
|
|
29
36
|
* Get the set of all activities available to participants of a single study, by participant identifier.
|
|
30
37
|
* @param participantId
|
|
@@ -199,13 +199,17 @@ var ActivityService = /** @class */ (function () {
|
|
|
199
199
|
/**
|
|
200
200
|
* Get the set of all activities available to participants of a single study, by study identifier.
|
|
201
201
|
* @param studyId
|
|
202
|
+
* @param transform
|
|
203
|
+
* @param ignore_binary
|
|
204
|
+
* @param limit Optional limit for pagination
|
|
205
|
+
* @param offset Optional offset for pagination
|
|
202
206
|
*/
|
|
203
|
-
ActivityService.prototype.allByStudy = function (studyId, transform, ignore_binary) {
|
|
204
|
-
var _a
|
|
207
|
+
ActivityService.prototype.allByStudy = function (studyId, transform, ignore_binary, limit, offset) {
|
|
208
|
+
var _a;
|
|
205
209
|
return __awaiter(this, void 0, void 0, function () {
|
|
206
|
-
var auth_4, credential, output;
|
|
207
|
-
return __generator(this, function (
|
|
208
|
-
switch (
|
|
210
|
+
var auth_4, credential, output, total, paginatedOutput, params, queryString, result, activitiesArray, totalCount, mappedActivities;
|
|
211
|
+
return __generator(this, function (_b) {
|
|
212
|
+
switch (_b.label) {
|
|
209
213
|
case 0:
|
|
210
214
|
if (studyId === null || studyId === undefined)
|
|
211
215
|
throw new Error("Required parameter studyId was null or undefined when calling activityAllByStudy.");
|
|
@@ -221,14 +225,53 @@ var ActivityService = /** @class */ (function () {
|
|
|
221
225
|
if (Demo_1.Demo.Study.filter(function (x) { return x["id"] === studyId; }).length > 0) {
|
|
222
226
|
output = (_a = Demo_1.Demo.Activity.filter(function (x) { return x["#parent"] === studyId; })) === null || _a === void 0 ? void 0 : _a.map(function (x) { return Object.assign(new Activity_1.Activity(), x); });
|
|
223
227
|
output = typeof transform === "string" ? jsonata_1.default(transform).evaluate(output) : output;
|
|
228
|
+
// If pagination is requested, return paginated result with total
|
|
229
|
+
if (typeof limit === 'number' && limit > 0 || typeof offset === 'number' && offset > 0) {
|
|
230
|
+
total = output.length;
|
|
231
|
+
paginatedOutput = limit !== undefined && offset !== undefined
|
|
232
|
+
? output.slice(offset, offset + limit)
|
|
233
|
+
: output;
|
|
234
|
+
return [2 /*return*/, Promise.resolve({ data: paginatedOutput, total: total })];
|
|
235
|
+
}
|
|
224
236
|
return [2 /*return*/, Promise.resolve(output)];
|
|
225
237
|
}
|
|
226
238
|
else {
|
|
227
239
|
return [2 /*return*/, Promise.resolve({ error: "404.not-found" })];
|
|
228
240
|
}
|
|
229
241
|
}
|
|
230
|
-
|
|
231
|
-
|
|
242
|
+
params = new URLSearchParams();
|
|
243
|
+
params.append('ignore_binary', String(ignore_binary));
|
|
244
|
+
if (limit !== undefined && limit !== null) {
|
|
245
|
+
params.append('limit', limit.toString());
|
|
246
|
+
}
|
|
247
|
+
if (offset !== undefined && offset !== null) {
|
|
248
|
+
params.append('offset', offset.toString());
|
|
249
|
+
}
|
|
250
|
+
queryString = params.toString();
|
|
251
|
+
return [4 /*yield*/, Fetch_1.Fetch.get("/study/" + studyId + "/activity?" + queryString, this.configuration)
|
|
252
|
+
// Handle the response structure based on _select function behavior:
|
|
253
|
+
// - With pagination (limit > 0 OR offset >= 0): { data: Activity[], total: number }
|
|
254
|
+
// - Without pagination: { data: Activity[] } (total property is missing)
|
|
255
|
+
];
|
|
256
|
+
case 1:
|
|
257
|
+
result = _b.sent();
|
|
258
|
+
activitiesArray = [];
|
|
259
|
+
totalCount = 0;
|
|
260
|
+
if (result && result.data && Array.isArray(result.data)) {
|
|
261
|
+
activitiesArray = result.data;
|
|
262
|
+
totalCount = typeof result.total === 'number' ? result.total : activitiesArray.length;
|
|
263
|
+
}
|
|
264
|
+
else if (Array.isArray(result)) {
|
|
265
|
+
// Legacy fallback: if result is directly an array
|
|
266
|
+
activitiesArray = result;
|
|
267
|
+
totalCount = result.length;
|
|
268
|
+
}
|
|
269
|
+
mappedActivities = activitiesArray.map(function (x) { return Object.assign(new Activity_1.Activity(), x); });
|
|
270
|
+
// If pagination was requested, return { data, total }, otherwise return array for backward compatibility
|
|
271
|
+
if (typeof limit === 'number' && limit > 0 || typeof offset === 'number' && offset > 0) {
|
|
272
|
+
return [2 /*return*/, { data: mappedActivities, total: totalCount }];
|
|
273
|
+
}
|
|
274
|
+
return [2 /*return*/, mappedActivities];
|
|
232
275
|
}
|
|
233
276
|
});
|
|
234
277
|
});
|
package/dist/service/Fetch.js
CHANGED
|
@@ -60,24 +60,37 @@ var handleSessionExpiry = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
60
60
|
});
|
|
61
61
|
}); };
|
|
62
62
|
//If access Token expired then call api for renewing the tokens
|
|
63
|
-
var handleRenewToken = function (refreshToken, base) { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
|
-
var credService, res, accessToken, error_1;
|
|
65
|
-
var _a, _b, _c;
|
|
66
|
-
return __generator(this, function (
|
|
67
|
-
switch (
|
|
63
|
+
var handleRenewToken = function (refreshToken, base, configuration) { return __awaiter(void 0, void 0, void 0, function () {
|
|
64
|
+
var credService, res, accessToken, newRefreshToken, LAMP, identityObject, serverAddress, error_1;
|
|
65
|
+
var _a, _b, _c, _d, _e, _f;
|
|
66
|
+
return __generator(this, function (_g) {
|
|
67
|
+
switch (_g.label) {
|
|
68
68
|
case 0:
|
|
69
|
-
|
|
69
|
+
_g.trys.push([0, 2, , 3]);
|
|
70
70
|
credService = new Credential_service_1.CredentialService();
|
|
71
71
|
return [4 /*yield*/, credService.renewToken(refreshToken, base)];
|
|
72
72
|
case 1:
|
|
73
|
-
res =
|
|
73
|
+
res = _g.sent();
|
|
74
74
|
accessToken = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.access_token;
|
|
75
75
|
if (accessToken) {
|
|
76
|
-
|
|
76
|
+
newRefreshToken = ((_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.refresh_token) || refreshToken;
|
|
77
|
+
sessionStorage.setItem(userTokenKey, JSON.stringify({ accessToken: (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.access_token, refreshToken: newRefreshToken }));
|
|
78
|
+
LAMP = global.LAMP || (typeof window !== "undefined" ? window.LAMP : null);
|
|
79
|
+
if (LAMP && typeof LAMP.dispatchEvent === "function") {
|
|
80
|
+
identityObject = ((_d = LAMP.Auth) === null || _d === void 0 ? void 0 : _d._me) || null;
|
|
81
|
+
serverAddress = (configuration === null || configuration === void 0 ? void 0 : configuration.base) || base || ((_e = LAMP.configuration) === null || _e === void 0 ? void 0 : _e.base);
|
|
82
|
+
LAMP.dispatchEvent("renewToken", {
|
|
83
|
+
authorizationToken: (configuration === null || configuration === void 0 ? void 0 : configuration.authorization) || ((_f = LAMP.configuration) === null || _f === void 0 ? void 0 : _f.authorization),
|
|
84
|
+
identityObject: identityObject,
|
|
85
|
+
serverAddress: serverAddress,
|
|
86
|
+
accessToken: accessToken,
|
|
87
|
+
refreshToken: newRefreshToken,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
77
90
|
}
|
|
78
91
|
return [2 /*return*/, accessToken];
|
|
79
92
|
case 2:
|
|
80
|
-
error_1 =
|
|
93
|
+
error_1 = _g.sent();
|
|
81
94
|
console.log(error_1);
|
|
82
95
|
return [3 /*break*/, 3];
|
|
83
96
|
case 3: return [2 /*return*/];
|
|
@@ -129,7 +142,7 @@ function _fetch(method, route, configuration, body) {
|
|
|
129
142
|
handleSessionExpiry();
|
|
130
143
|
return [2 /*return*/, { data: [], error: "401.invalid-token" }];
|
|
131
144
|
}
|
|
132
|
-
return [4 /*yield*/, handleRenewToken(refreshToken, configuration.base)];
|
|
145
|
+
return [4 /*yield*/, handleRenewToken(refreshToken, configuration.base, configuration)];
|
|
133
146
|
case 5:
|
|
134
147
|
token = _d.sent();
|
|
135
148
|
if (!token) return [3 /*break*/, 17];
|
|
@@ -31,4 +31,66 @@ export declare class ResearcherService {
|
|
|
31
31
|
usersList(id: string, filters: any): Promise<any>;
|
|
32
32
|
activitiesList(id: string, filters: any): Promise<any>;
|
|
33
33
|
sensorsList(id: string, filters: any): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* Create an activity export job.
|
|
36
|
+
* @param researcherId
|
|
37
|
+
* @param body - { studyIds: string[], specs?: string[], format?: "json" | "ndjson" }
|
|
38
|
+
*/
|
|
39
|
+
createActivityExport(researcherId: Identifier, body: {
|
|
40
|
+
studyIds: string[];
|
|
41
|
+
specs?: string[];
|
|
42
|
+
format?: "json" | "ndjson";
|
|
43
|
+
}): Promise<{
|
|
44
|
+
jobId: string;
|
|
45
|
+
status: string;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Get activity export job status.
|
|
49
|
+
* @param jobId
|
|
50
|
+
*/
|
|
51
|
+
getActivityExportJob(jobId: string): Promise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* Get activity export download URL.
|
|
54
|
+
* @param jobId
|
|
55
|
+
* @param ttl - Time to live in seconds (default: 600)
|
|
56
|
+
*/
|
|
57
|
+
getActivityExportDownloadUrl(jobId: string, ttl?: number): Promise<{
|
|
58
|
+
url: string;
|
|
59
|
+
expiresIn: number;
|
|
60
|
+
contentType: string;
|
|
61
|
+
contentLength: number;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Create an activity import job.
|
|
65
|
+
* @param researcherId
|
|
66
|
+
* @param body - { studyId: string, format?: "json" | "ndjson" }
|
|
67
|
+
*/
|
|
68
|
+
createActivityImport(researcherId: Identifier, body: {
|
|
69
|
+
studyId: string;
|
|
70
|
+
format?: "json" | "ndjson";
|
|
71
|
+
}): Promise<{
|
|
72
|
+
jobId: string;
|
|
73
|
+
status: string;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Get activity import job status.
|
|
77
|
+
* @param jobId
|
|
78
|
+
*/
|
|
79
|
+
getActivityImportJob(jobId: string): Promise<any>;
|
|
80
|
+
/**
|
|
81
|
+
* Get activity import upload URL.
|
|
82
|
+
* @param jobId
|
|
83
|
+
* @param ttl - Time to live in seconds (default: 600)
|
|
84
|
+
*/
|
|
85
|
+
getActivityImportUploadUrl(jobId: string, ttl?: number): Promise<{
|
|
86
|
+
url: string;
|
|
87
|
+
expiresIn: number;
|
|
88
|
+
blobName: string;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Complete activity import upload and trigger processing.
|
|
92
|
+
* @param jobId
|
|
93
|
+
* @param blobName
|
|
94
|
+
*/
|
|
95
|
+
completeActivityImportUpload(jobId: string, blobName: string): Promise<any>;
|
|
34
96
|
}
|
|
@@ -247,6 +247,216 @@ var ResearcherService = /** @class */ (function () {
|
|
|
247
247
|
});
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
|
+
/**
|
|
251
|
+
* Create an activity export job.
|
|
252
|
+
* @param researcherId
|
|
253
|
+
* @param body - { studyIds: string[], specs?: string[], format?: "json" | "ndjson" }
|
|
254
|
+
*/
|
|
255
|
+
ResearcherService.prototype.createActivityExport = function (researcherId, body) {
|
|
256
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
+
var result;
|
|
258
|
+
return __generator(this, function (_a) {
|
|
259
|
+
switch (_a.label) {
|
|
260
|
+
case 0:
|
|
261
|
+
if (researcherId === null || researcherId === undefined)
|
|
262
|
+
throw new Error("Required parameter researcherId was null or undefined when calling createActivityExport.");
|
|
263
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
264
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
265
|
+
}
|
|
266
|
+
return [4 /*yield*/, Fetch_1.Fetch.post("/researcher/" + researcherId + "/activity-export", body, this.configuration)];
|
|
267
|
+
case 1:
|
|
268
|
+
result = _a.sent();
|
|
269
|
+
if (result.error) {
|
|
270
|
+
throw new Error(result.error);
|
|
271
|
+
}
|
|
272
|
+
if (!result.data) {
|
|
273
|
+
throw new Error("Invalid response from export API");
|
|
274
|
+
}
|
|
275
|
+
return [2 /*return*/, result.data];
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Get activity export job status.
|
|
282
|
+
* @param jobId
|
|
283
|
+
*/
|
|
284
|
+
ResearcherService.prototype.getActivityExportJob = function (jobId) {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
286
|
+
var result;
|
|
287
|
+
return __generator(this, function (_a) {
|
|
288
|
+
switch (_a.label) {
|
|
289
|
+
case 0:
|
|
290
|
+
if (jobId === null || jobId === undefined)
|
|
291
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityExportJob.");
|
|
292
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
293
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
294
|
+
}
|
|
295
|
+
return [4 /*yield*/, Fetch_1.Fetch.get("/exports/" + jobId, this.configuration)];
|
|
296
|
+
case 1:
|
|
297
|
+
result = _a.sent();
|
|
298
|
+
if (result.error) {
|
|
299
|
+
throw new Error(result.error);
|
|
300
|
+
}
|
|
301
|
+
if (!result.data) {
|
|
302
|
+
throw new Error("Invalid response from export job API");
|
|
303
|
+
}
|
|
304
|
+
return [2 /*return*/, result.data];
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Get activity export download URL.
|
|
311
|
+
* @param jobId
|
|
312
|
+
* @param ttl - Time to live in seconds (default: 600)
|
|
313
|
+
*/
|
|
314
|
+
ResearcherService.prototype.getActivityExportDownloadUrl = function (jobId, ttl) {
|
|
315
|
+
if (ttl === void 0) { ttl = 600; }
|
|
316
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
317
|
+
var result;
|
|
318
|
+
return __generator(this, function (_a) {
|
|
319
|
+
switch (_a.label) {
|
|
320
|
+
case 0:
|
|
321
|
+
if (jobId === null || jobId === undefined)
|
|
322
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityExportDownloadUrl.");
|
|
323
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
324
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
325
|
+
}
|
|
326
|
+
return [4 /*yield*/, Fetch_1.Fetch.get("/exports/" + jobId + "/download?ttl=" + ttl, this.configuration)];
|
|
327
|
+
case 1:
|
|
328
|
+
result = _a.sent();
|
|
329
|
+
if (result.error) {
|
|
330
|
+
throw new Error(result.error);
|
|
331
|
+
}
|
|
332
|
+
if (!result.data) {
|
|
333
|
+
throw new Error("Invalid response from export download API");
|
|
334
|
+
}
|
|
335
|
+
return [2 /*return*/, result.data];
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* Create an activity import job.
|
|
342
|
+
* @param researcherId
|
|
343
|
+
* @param body - { studyId: string, format?: "json" | "ndjson" }
|
|
344
|
+
*/
|
|
345
|
+
ResearcherService.prototype.createActivityImport = function (researcherId, body) {
|
|
346
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
347
|
+
var result;
|
|
348
|
+
return __generator(this, function (_a) {
|
|
349
|
+
switch (_a.label) {
|
|
350
|
+
case 0:
|
|
351
|
+
if (researcherId === null || researcherId === undefined)
|
|
352
|
+
throw new Error("Required parameter researcherId was null or undefined when calling createActivityImport.");
|
|
353
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
354
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
355
|
+
}
|
|
356
|
+
return [4 /*yield*/, Fetch_1.Fetch.post("/researcher/" + researcherId + "/activity-import", body, this.configuration)];
|
|
357
|
+
case 1:
|
|
358
|
+
result = _a.sent();
|
|
359
|
+
if (result.error) {
|
|
360
|
+
throw new Error(result.error);
|
|
361
|
+
}
|
|
362
|
+
if (!result.data) {
|
|
363
|
+
throw new Error("Invalid response from import API");
|
|
364
|
+
}
|
|
365
|
+
return [2 /*return*/, result.data];
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* Get activity import job status.
|
|
372
|
+
* @param jobId
|
|
373
|
+
*/
|
|
374
|
+
ResearcherService.prototype.getActivityImportJob = function (jobId) {
|
|
375
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
376
|
+
var result;
|
|
377
|
+
return __generator(this, function (_a) {
|
|
378
|
+
switch (_a.label) {
|
|
379
|
+
case 0:
|
|
380
|
+
if (jobId === null || jobId === undefined)
|
|
381
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityImportJob.");
|
|
382
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
383
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
384
|
+
}
|
|
385
|
+
return [4 /*yield*/, Fetch_1.Fetch.get("/imports/" + jobId, this.configuration)];
|
|
386
|
+
case 1:
|
|
387
|
+
result = _a.sent();
|
|
388
|
+
if (result.error) {
|
|
389
|
+
throw new Error(result.error);
|
|
390
|
+
}
|
|
391
|
+
if (!result.data) {
|
|
392
|
+
throw new Error("Invalid response from import job API");
|
|
393
|
+
}
|
|
394
|
+
return [2 /*return*/, result.data];
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
});
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Get activity import upload URL.
|
|
401
|
+
* @param jobId
|
|
402
|
+
* @param ttl - Time to live in seconds (default: 600)
|
|
403
|
+
*/
|
|
404
|
+
ResearcherService.prototype.getActivityImportUploadUrl = function (jobId, ttl) {
|
|
405
|
+
if (ttl === void 0) { ttl = 600; }
|
|
406
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
407
|
+
var result;
|
|
408
|
+
return __generator(this, function (_a) {
|
|
409
|
+
switch (_a.label) {
|
|
410
|
+
case 0:
|
|
411
|
+
if (jobId === null || jobId === undefined)
|
|
412
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityImportUploadUrl.");
|
|
413
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
414
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
415
|
+
}
|
|
416
|
+
return [4 /*yield*/, Fetch_1.Fetch.post("/imports/" + jobId + "/upload-url", { ttl: ttl }, this.configuration)];
|
|
417
|
+
case 1:
|
|
418
|
+
result = _a.sent();
|
|
419
|
+
if (result.error) {
|
|
420
|
+
throw new Error(result.error);
|
|
421
|
+
}
|
|
422
|
+
if (!result.data) {
|
|
423
|
+
throw new Error("Invalid response from import upload URL API");
|
|
424
|
+
}
|
|
425
|
+
return [2 /*return*/, result.data];
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* Complete activity import upload and trigger processing.
|
|
432
|
+
* @param jobId
|
|
433
|
+
* @param blobName
|
|
434
|
+
*/
|
|
435
|
+
ResearcherService.prototype.completeActivityImportUpload = function (jobId, blobName) {
|
|
436
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
437
|
+
var result;
|
|
438
|
+
return __generator(this, function (_a) {
|
|
439
|
+
switch (_a.label) {
|
|
440
|
+
case 0:
|
|
441
|
+
if (jobId === null || jobId === undefined)
|
|
442
|
+
throw new Error("Required parameter jobId was null or undefined when calling completeActivityImportUpload.");
|
|
443
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
444
|
+
return [2 /*return*/, Promise.resolve({ error: "500.demo-restriction" })];
|
|
445
|
+
}
|
|
446
|
+
return [4 /*yield*/, Fetch_1.Fetch.post("/imports/" + jobId + "/complete-upload", { blobName: blobName }, this.configuration)];
|
|
447
|
+
case 1:
|
|
448
|
+
result = _a.sent();
|
|
449
|
+
if (result.error) {
|
|
450
|
+
throw new Error(result.error);
|
|
451
|
+
}
|
|
452
|
+
if (!result.data) {
|
|
453
|
+
throw new Error("Invalid response from complete import upload API");
|
|
454
|
+
}
|
|
455
|
+
return [2 /*return*/, result.data];
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
};
|
|
250
460
|
return ResearcherService;
|
|
251
461
|
}());
|
|
252
462
|
exports.ResearcherService = ResearcherService;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Timestamp } from "../model/Type";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export declare class ResearcherSettings {
|
|
6
|
+
/**
|
|
7
|
+
* The banner greeting.
|
|
8
|
+
*/
|
|
9
|
+
bannerSettings?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The banner heading
|
|
12
|
+
*/
|
|
13
|
+
bannerHeading?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The banner sub heading
|
|
16
|
+
*/
|
|
17
|
+
bannerSubHeading?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The image icon for banner
|
|
20
|
+
*/
|
|
21
|
+
imageBase64?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The selected activity
|
|
24
|
+
*/
|
|
25
|
+
selectedActivity?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The selected group
|
|
28
|
+
*/
|
|
29
|
+
selectedGroup?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The button text
|
|
32
|
+
*/
|
|
33
|
+
buttonText?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The activityId
|
|
36
|
+
*/
|
|
37
|
+
activityId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The favourite activities
|
|
40
|
+
*/
|
|
41
|
+
favouriteActivities?: any;
|
|
42
|
+
/**
|
|
43
|
+
* The featured activity
|
|
44
|
+
*/
|
|
45
|
+
featuredActivity?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The streak type
|
|
48
|
+
*/
|
|
49
|
+
streak?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The Streak title
|
|
52
|
+
*/
|
|
53
|
+
streakTitle?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The Streak description
|
|
56
|
+
*/
|
|
57
|
+
streakDesc?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The timestamp
|
|
60
|
+
*/
|
|
61
|
+
timestamp?: Timestamp;
|
|
62
|
+
/**
|
|
63
|
+
* The deleted flag
|
|
64
|
+
*/
|
|
65
|
+
deleted?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export declare type ResearcherBanner = {
|
|
68
|
+
data: ResearcherSettings;
|
|
69
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResearcherSettings = void 0;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
var ResearcherSettings = /** @class */ (function () {
|
|
8
|
+
function ResearcherSettings() {
|
|
9
|
+
}
|
|
10
|
+
return ResearcherSettings;
|
|
11
|
+
}());
|
|
12
|
+
exports.ResearcherSettings = ResearcherSettings;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lamp-core-lst",
|
|
3
|
-
"version": "2025.
|
|
3
|
+
"version": "2025.12.0-1.1",
|
|
4
4
|
"author": "BIDMC Division of Digital Psychiatry <team@digitalpsych.org>",
|
|
5
5
|
"description": "The JavaScript and TypeScript API client for the LAMP Platform.",
|
|
6
6
|
"homepage": "https://docs.lamp.digital/",
|
package/src/model/Activity.ts
CHANGED
|
@@ -142,8 +142,18 @@ export class ActivityService {
|
|
|
142
142
|
/**
|
|
143
143
|
* Get the set of all activities available to participants of a single study, by study identifier.
|
|
144
144
|
* @param studyId
|
|
145
|
+
* @param transform
|
|
146
|
+
* @param ignore_binary
|
|
147
|
+
* @param limit Optional limit for pagination
|
|
148
|
+
* @param offset Optional offset for pagination
|
|
145
149
|
*/
|
|
146
|
-
public async allByStudy(
|
|
150
|
+
public async allByStudy(
|
|
151
|
+
studyId: Identifier,
|
|
152
|
+
transform?: string,
|
|
153
|
+
ignore_binary?: boolean,
|
|
154
|
+
limit?: number,
|
|
155
|
+
offset?: number
|
|
156
|
+
): Promise<Activity[] | { data: Activity[], total: number }> {
|
|
147
157
|
if (studyId === null || studyId === undefined)
|
|
148
158
|
throw new Error("Required parameter studyId was null or undefined when calling activityAllByStudy.")
|
|
149
159
|
if (ignore_binary === null || ignore_binary === undefined) ignore_binary = false
|
|
@@ -157,14 +167,58 @@ export class ActivityService {
|
|
|
157
167
|
if (Demo.Study.filter((x) => x["id"] === studyId).length > 0) {
|
|
158
168
|
let output = Demo.Activity.filter((x) => x["#parent"] === studyId)?.map((x) => Object.assign(new Activity(), x))
|
|
159
169
|
output = typeof transform === "string" ? jsonata(transform).evaluate(output) : output
|
|
170
|
+
// If pagination is requested, return paginated result with total
|
|
171
|
+
if (typeof limit === 'number' && limit > 0 || typeof offset === 'number' && offset > 0) {
|
|
172
|
+
const total = output.length
|
|
173
|
+
const paginatedOutput = limit !== undefined && offset !== undefined
|
|
174
|
+
? output.slice(offset, offset + limit)
|
|
175
|
+
: output
|
|
176
|
+
return Promise.resolve({ data: paginatedOutput, total })
|
|
177
|
+
}
|
|
160
178
|
return Promise.resolve(output)
|
|
161
179
|
} else {
|
|
162
180
|
return Promise.resolve({ error: "404.not-found" } as any)
|
|
163
181
|
}
|
|
164
182
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
183
|
+
|
|
184
|
+
// Build query string with pagination parameters
|
|
185
|
+
const params = new URLSearchParams()
|
|
186
|
+
params.append('ignore_binary', String(ignore_binary))
|
|
187
|
+
if (limit !== undefined && limit !== null) {
|
|
188
|
+
params.append('limit', limit.toString())
|
|
189
|
+
}
|
|
190
|
+
if (offset !== undefined && offset !== null) {
|
|
191
|
+
params.append('offset', offset.toString())
|
|
192
|
+
}
|
|
193
|
+
const queryString = params.toString()
|
|
194
|
+
|
|
195
|
+
const result: any = await Fetch.get<{ data: Activity[], total?: number }>(
|
|
196
|
+
`/study/${studyId}/activity?${queryString}`,
|
|
197
|
+
this.configuration
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
// Handle the response structure based on _select function behavior:
|
|
201
|
+
// - With pagination (limit > 0 OR offset >= 0): { data: Activity[], total: number }
|
|
202
|
+
// - Without pagination: { data: Activity[] } (total property is missing)
|
|
203
|
+
let activitiesArray: any[] = []
|
|
204
|
+
let totalCount = 0
|
|
205
|
+
|
|
206
|
+
if (result && result.data && Array.isArray(result.data)) {
|
|
207
|
+
activitiesArray = result.data
|
|
208
|
+
totalCount = typeof result.total === 'number' ? result.total : activitiesArray.length
|
|
209
|
+
} else if (Array.isArray(result)) {
|
|
210
|
+
// Legacy fallback: if result is directly an array
|
|
211
|
+
activitiesArray = result
|
|
212
|
+
totalCount = result.length
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const mappedActivities = activitiesArray.map((x: any) => Object.assign(new Activity(), x))
|
|
216
|
+
|
|
217
|
+
// If pagination was requested, return { data, total }, otherwise return array for backward compatibility
|
|
218
|
+
if (typeof limit === 'number' && limit > 0 || typeof offset === 'number' && offset > 0) {
|
|
219
|
+
return { data: mappedActivities, total: totalCount }
|
|
220
|
+
}
|
|
221
|
+
return mappedActivities
|
|
168
222
|
}
|
|
169
223
|
/**
|
|
170
224
|
* Get the set of all activities available to participants of a single study, by participant identifier.
|
package/src/service/Fetch.ts
CHANGED
|
@@ -38,7 +38,7 @@ const handleSessionExpiry = async () => {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
//If access Token expired then call api for renewing the tokens
|
|
41
|
-
const handleRenewToken = async (refreshToken: string, base: string) => {
|
|
41
|
+
const handleRenewToken = async (refreshToken: string, base: string, configuration?: Configuration) => {
|
|
42
42
|
try {
|
|
43
43
|
const credService = new CredentialService()
|
|
44
44
|
const res = await credService.renewToken(refreshToken, base)
|
|
@@ -46,10 +46,28 @@ const handleRenewToken = async (refreshToken: string, base: string) => {
|
|
|
46
46
|
const accessToken = res?.data?.access_token
|
|
47
47
|
|
|
48
48
|
if (accessToken) {
|
|
49
|
+
const newRefreshToken = res?.data?.refresh_token || refreshToken
|
|
49
50
|
sessionStorage.setItem(
|
|
50
51
|
userTokenKey,
|
|
51
|
-
JSON.stringify({ accessToken: res?.data?.access_token, refreshToken:
|
|
52
|
+
JSON.stringify({ accessToken: res?.data?.access_token, refreshToken: newRefreshToken })
|
|
52
53
|
)
|
|
54
|
+
|
|
55
|
+
// Dispatch renewToken event similar to LOGIN event
|
|
56
|
+
// Access LAMP from global scope to avoid circular dependency
|
|
57
|
+
const LAMP = (global as any).LAMP || (typeof window !== "undefined" ? (window as any).LAMP : null)
|
|
58
|
+
if (LAMP && typeof LAMP.dispatchEvent === "function") {
|
|
59
|
+
// Get identity object from LAMP.Auth if available
|
|
60
|
+
const identityObject = LAMP.Auth?._me || null
|
|
61
|
+
const serverAddress = configuration?.base || base || LAMP.configuration?.base
|
|
62
|
+
|
|
63
|
+
LAMP.dispatchEvent("renewToken", {
|
|
64
|
+
authorizationToken: configuration?.authorization || LAMP.configuration?.authorization,
|
|
65
|
+
identityObject: identityObject,
|
|
66
|
+
serverAddress: serverAddress,
|
|
67
|
+
accessToken: accessToken,
|
|
68
|
+
refreshToken: newRefreshToken,
|
|
69
|
+
})
|
|
70
|
+
}
|
|
53
71
|
}
|
|
54
72
|
return accessToken
|
|
55
73
|
} catch (error) {
|
|
@@ -93,7 +111,7 @@ async function _fetch<ResultType>(
|
|
|
93
111
|
...(configuration!.headers || {}),
|
|
94
112
|
} as any)
|
|
95
113
|
),
|
|
96
|
-
credentials: "include",
|
|
114
|
+
credentials: "include",
|
|
97
115
|
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
98
116
|
})
|
|
99
117
|
if (!response.ok) {
|
|
@@ -113,7 +131,7 @@ async function _fetch<ResultType>(
|
|
|
113
131
|
handleSessionExpiry()
|
|
114
132
|
return { data: [], error: "401.invalid-token" } as unknown as ResultType
|
|
115
133
|
}
|
|
116
|
-
const token = await handleRenewToken(refreshToken, configuration.base)
|
|
134
|
+
const token = await handleRenewToken(refreshToken, configuration.base, configuration)
|
|
117
135
|
if (token) {
|
|
118
136
|
configuration.authorization = token
|
|
119
137
|
// retry the same request
|
|
@@ -144,4 +144,173 @@ export class ResearcherService {
|
|
|
144
144
|
const result = await Fetch.post(`/researcher/sensors/${id}`, filters, this.configuration) as any
|
|
145
145
|
return result?.data
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Create an activity export job.
|
|
150
|
+
* @param researcherId
|
|
151
|
+
* @param body - { studyIds: string[], specs?: string[], format?: "json" | "ndjson" }
|
|
152
|
+
*/
|
|
153
|
+
public async createActivityExport(researcherId: Identifier, body: {
|
|
154
|
+
studyIds: string[]
|
|
155
|
+
specs?: string[]
|
|
156
|
+
format?: "json" | "ndjson"
|
|
157
|
+
}): Promise<{ jobId: string; status: string }> {
|
|
158
|
+
if (researcherId === null || researcherId === undefined)
|
|
159
|
+
throw new Error("Required parameter researcherId was null or undefined when calling createActivityExport.")
|
|
160
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
161
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
162
|
+
}
|
|
163
|
+
const result = await Fetch.post<{ data: { jobId: string; status: string }; error?: string }>(
|
|
164
|
+
`/researcher/${researcherId}/activity-export`,
|
|
165
|
+
body,
|
|
166
|
+
this.configuration
|
|
167
|
+
)
|
|
168
|
+
if (result.error) {
|
|
169
|
+
throw new Error(result.error)
|
|
170
|
+
}
|
|
171
|
+
if (!result.data) {
|
|
172
|
+
throw new Error("Invalid response from export API")
|
|
173
|
+
}
|
|
174
|
+
return result.data
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Get activity export job status.
|
|
179
|
+
* @param jobId
|
|
180
|
+
*/
|
|
181
|
+
public async getActivityExportJob(jobId: string): Promise<any> {
|
|
182
|
+
if (jobId === null || jobId === undefined)
|
|
183
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityExportJob.")
|
|
184
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
185
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
186
|
+
}
|
|
187
|
+
const result = await Fetch.get<{ data: any; error?: string }>(`/exports/${jobId}`, this.configuration)
|
|
188
|
+
if (result.error) {
|
|
189
|
+
throw new Error(result.error)
|
|
190
|
+
}
|
|
191
|
+
if (!result.data) {
|
|
192
|
+
throw new Error("Invalid response from export job API")
|
|
193
|
+
}
|
|
194
|
+
return result.data
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Get activity export download URL.
|
|
199
|
+
* @param jobId
|
|
200
|
+
* @param ttl - Time to live in seconds (default: 600)
|
|
201
|
+
*/
|
|
202
|
+
public async getActivityExportDownloadUrl(jobId: string, ttl: number = 600): Promise<{
|
|
203
|
+
url: string
|
|
204
|
+
expiresIn: number
|
|
205
|
+
contentType: string
|
|
206
|
+
contentLength: number
|
|
207
|
+
}> {
|
|
208
|
+
if (jobId === null || jobId === undefined)
|
|
209
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityExportDownloadUrl.")
|
|
210
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
211
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
212
|
+
}
|
|
213
|
+
const result = await Fetch.get<{ data: any; error?: string }>(`/exports/${jobId}/download?ttl=${ttl}`, this.configuration)
|
|
214
|
+
if (result.error) {
|
|
215
|
+
throw new Error(result.error)
|
|
216
|
+
}
|
|
217
|
+
if (!result.data) {
|
|
218
|
+
throw new Error("Invalid response from export download API")
|
|
219
|
+
}
|
|
220
|
+
return result.data
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Create an activity import job.
|
|
225
|
+
* @param researcherId
|
|
226
|
+
* @param body - { studyId: string, format?: "json" | "ndjson" }
|
|
227
|
+
*/
|
|
228
|
+
public async createActivityImport(researcherId: Identifier, body: {
|
|
229
|
+
studyId: string
|
|
230
|
+
format?: "json" | "ndjson"
|
|
231
|
+
}): Promise<{ jobId: string; status: string }> {
|
|
232
|
+
if (researcherId === null || researcherId === undefined)
|
|
233
|
+
throw new Error("Required parameter researcherId was null or undefined when calling createActivityImport.")
|
|
234
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
235
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
236
|
+
}
|
|
237
|
+
const result = await Fetch.post<{ data: { jobId: string; status: string }; error?: string }>(
|
|
238
|
+
`/researcher/${researcherId}/activity-import`,
|
|
239
|
+
body,
|
|
240
|
+
this.configuration
|
|
241
|
+
)
|
|
242
|
+
if (result.error) {
|
|
243
|
+
throw new Error(result.error)
|
|
244
|
+
}
|
|
245
|
+
if (!result.data) {
|
|
246
|
+
throw new Error("Invalid response from import API")
|
|
247
|
+
}
|
|
248
|
+
return result.data
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Get activity import job status.
|
|
253
|
+
* @param jobId
|
|
254
|
+
*/
|
|
255
|
+
public async getActivityImportJob(jobId: string): Promise<any> {
|
|
256
|
+
if (jobId === null || jobId === undefined)
|
|
257
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityImportJob.")
|
|
258
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
259
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
260
|
+
}
|
|
261
|
+
const result = await Fetch.get<{ data: any; error?: string }>(`/imports/${jobId}`, this.configuration)
|
|
262
|
+
if (result.error) {
|
|
263
|
+
throw new Error(result.error)
|
|
264
|
+
}
|
|
265
|
+
if (!result.data) {
|
|
266
|
+
throw new Error("Invalid response from import job API")
|
|
267
|
+
}
|
|
268
|
+
return result.data
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Get activity import upload URL.
|
|
273
|
+
* @param jobId
|
|
274
|
+
* @param ttl - Time to live in seconds (default: 600)
|
|
275
|
+
*/
|
|
276
|
+
public async getActivityImportUploadUrl(jobId: string, ttl: number = 600): Promise<{
|
|
277
|
+
url: string
|
|
278
|
+
expiresIn: number
|
|
279
|
+
blobName: string
|
|
280
|
+
}> {
|
|
281
|
+
if (jobId === null || jobId === undefined)
|
|
282
|
+
throw new Error("Required parameter jobId was null or undefined when calling getActivityImportUploadUrl.")
|
|
283
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
284
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
285
|
+
}
|
|
286
|
+
const result = await Fetch.post<{ data: any; error?: string }>(`/imports/${jobId}/upload-url`, { ttl }, this.configuration)
|
|
287
|
+
if (result.error) {
|
|
288
|
+
throw new Error(result.error)
|
|
289
|
+
}
|
|
290
|
+
if (!result.data) {
|
|
291
|
+
throw new Error("Invalid response from import upload URL API")
|
|
292
|
+
}
|
|
293
|
+
return result.data
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Complete activity import upload and trigger processing.
|
|
298
|
+
* @param jobId
|
|
299
|
+
* @param blobName
|
|
300
|
+
*/
|
|
301
|
+
public async completeActivityImportUpload(jobId: string, blobName: string): Promise<any> {
|
|
302
|
+
if (jobId === null || jobId === undefined)
|
|
303
|
+
throw new Error("Required parameter jobId was null or undefined when calling completeActivityImportUpload.")
|
|
304
|
+
if (this.configuration.base === "https://demo.lamp.digital") {
|
|
305
|
+
return Promise.resolve({ error: "500.demo-restriction" } as any)
|
|
306
|
+
}
|
|
307
|
+
const result = await Fetch.post<{ data: any; error?: string }>(`/imports/${jobId}/complete-upload`, { blobName }, this.configuration)
|
|
308
|
+
if (result.error) {
|
|
309
|
+
throw new Error(result.error)
|
|
310
|
+
}
|
|
311
|
+
if (!result.data) {
|
|
312
|
+
throw new Error("Invalid response from complete import upload API")
|
|
313
|
+
}
|
|
314
|
+
return result.data
|
|
315
|
+
}
|
|
316
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Identifier, Timestamp } from "../model/Type"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export class ResearcherSettings {
|
|
7
|
+
/**
|
|
8
|
+
* The banner greeting.
|
|
9
|
+
*/
|
|
10
|
+
bannerSettings?: string
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The banner heading
|
|
14
|
+
*/
|
|
15
|
+
bannerHeading?: string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The banner sub heading
|
|
19
|
+
*/
|
|
20
|
+
bannerSubHeading?: string
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The image icon for banner
|
|
24
|
+
*/
|
|
25
|
+
imageBase64?: string
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The selected activity
|
|
29
|
+
*/
|
|
30
|
+
selectedActivity?: string
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The selected group
|
|
34
|
+
*/
|
|
35
|
+
selectedGroup?: string
|
|
36
|
+
/**
|
|
37
|
+
* The button text
|
|
38
|
+
*/
|
|
39
|
+
buttonText?: string
|
|
40
|
+
/**
|
|
41
|
+
* The activityId
|
|
42
|
+
*/
|
|
43
|
+
activityId?: string
|
|
44
|
+
/**
|
|
45
|
+
* The favourite activities
|
|
46
|
+
*/
|
|
47
|
+
favouriteActivities?: any
|
|
48
|
+
/**
|
|
49
|
+
* The featured activity
|
|
50
|
+
*/
|
|
51
|
+
featuredActivity?: string
|
|
52
|
+
/**
|
|
53
|
+
* The streak type
|
|
54
|
+
*/
|
|
55
|
+
streak?: string
|
|
56
|
+
/**
|
|
57
|
+
* The Streak title
|
|
58
|
+
*/
|
|
59
|
+
streakTitle?: string
|
|
60
|
+
/**
|
|
61
|
+
* The Streak description
|
|
62
|
+
*/
|
|
63
|
+
streakDesc?: string
|
|
64
|
+
/**
|
|
65
|
+
* The timestamp
|
|
66
|
+
*/
|
|
67
|
+
timestamp?: Timestamp
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The deleted flag
|
|
71
|
+
*/
|
|
72
|
+
deleted?: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type ResearcherBanner = {
|
|
76
|
+
data: ResearcherSettings
|
|
77
|
+
}
|