@milobedini/shared-types 1.0.63 → 1.0.65

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.
Files changed (2) hide show
  1. package/dist/types.d.ts +48 -3
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -79,7 +79,7 @@ export type ProgramWithModules = ProgramBase & {
79
79
  modules: Module[];
80
80
  };
81
81
  export type ProgramRef = Pick<Program, '_id' | 'title' | 'description'>;
82
- export type ModuleType = 'questionnaire' | 'psychoeducation' | 'exercise';
82
+ export type ModuleType = 'questionnaire' | 'psychoeducation' | 'exercise' | 'activity_diary';
83
83
  export type Module = {
84
84
  _id: string;
85
85
  title: string;
@@ -164,7 +164,9 @@ export type ModuleAttempt = {
164
164
  createdAt: string;
165
165
  updatedAt: string;
166
166
  };
167
- export type AttemptListItem = Pick<ModuleAttempt, '_id' | 'module' | 'program' | 'moduleType' | 'iteration' | 'status' | 'totalScore' | 'scoreBandLabel' | 'band' | 'weekStart' | 'completedAt' | 'startedAt' | 'lastInteractionAt' | 'dueAt' | 'userNote'>;
167
+ export type AttemptListItem = Pick<ModuleAttempt, '_id' | 'module' | 'program' | 'moduleType' | 'iteration' | 'status' | 'totalScore' | 'scoreBandLabel' | 'band' | 'weekStart' | 'completedAt' | 'startedAt' | 'lastInteractionAt' | 'dueAt' | 'userNote'> & {
168
+ percentComplete?: number;
169
+ };
168
170
  export type AssignmentStatus = 'assigned' | 'in_progress' | 'completed' | 'cancelled';
169
171
  export type AssignmentRecurrence = {
170
172
  freq: 'weekly' | 'monthly' | 'none';
@@ -221,6 +223,8 @@ export type StartAttemptResponse = {
221
223
  };
222
224
  export type SaveProgressInput = {
223
225
  answers?: AttemptAnswer[];
226
+ diaryEntries?: DiaryEntryInput[];
227
+ merge?: boolean;
224
228
  userNote?: string;
225
229
  };
226
230
  export type SaveProgressResponse = {
@@ -261,6 +265,7 @@ export type TherapistLatestRow = {
261
265
  scoreBandLabel?: string;
262
266
  weekStart?: string;
263
267
  band?: ScoreBandSummary;
268
+ percentComplete?: number;
264
269
  };
265
270
  export type TherapistLatestResponse = {
266
271
  success: boolean;
@@ -331,6 +336,7 @@ export type AssignmentLatestAttemptPreview = {
331
336
  completedAt?: string;
332
337
  totalScore?: number;
333
338
  scoreBandLabel?: string;
339
+ percentComplete?: number;
334
340
  };
335
341
  export type ModulePreviewForAssignment = Pick<Module, '_id' | 'title' | 'type' | 'accessPolicy'> & {
336
342
  program?: never;
@@ -356,6 +362,7 @@ export type MyAssignmentView = {
356
362
  latestAttempt?: AssignmentLatestAttemptPreview;
357
363
  createdAt: string;
358
364
  updatedAt: string;
365
+ percentComplete?: number;
359
366
  };
360
367
  export type MyAssignmentsResponse = {
361
368
  success: boolean;
@@ -387,9 +394,47 @@ export type AttemptDetail = {
387
394
  totalQuestions: number;
388
395
  percentComplete: number;
389
396
  };
397
+ export type DiaryEntry = {
398
+ at: string;
399
+ label?: string;
400
+ activity: string;
401
+ mood?: number;
402
+ achievement?: number;
403
+ closeness?: number;
404
+ enjoyment?: number;
405
+ };
406
+ export type DiaryEntryInput = {
407
+ at: string;
408
+ label?: string;
409
+ activity?: string;
410
+ mood?: number;
411
+ achievement?: number;
412
+ closeness?: number;
413
+ enjoyment?: number;
414
+ };
415
+ export type DiaryDay = {
416
+ dateISO: string;
417
+ entries: DiaryEntry[];
418
+ avgMood: number | null;
419
+ avgAchievement: number | null;
420
+ avgCloseness: number | null;
421
+ avgEnjoyment: number | null;
422
+ };
423
+ export type DiaryTotals = {
424
+ count: number;
425
+ avgMood: number | null;
426
+ avgAchievement: number | null;
427
+ avgCloseness: number | null;
428
+ avgEnjoyment: number | null;
429
+ };
430
+ export type DiaryDetail = {
431
+ days: DiaryDay[];
432
+ totals: DiaryTotals;
433
+ };
390
434
  export type AttemptDetailResponseItem = ModuleAttempt & {
391
435
  band?: ScoreBandSummary;
392
- detail: AttemptDetail;
436
+ detail?: AttemptDetail;
437
+ diary?: DiaryDetail;
393
438
  patient?: Pick<AuthUser, '_id' | 'name' | 'username' | 'email'>;
394
439
  module?: Pick<Module, '_id' | 'title' | 'type'>;
395
440
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milobedini/shared-types",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [