@quesmed/types 2.6.252 → 2.6.254
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/cjs/models/OsceStation.d.ts +6 -0
- package/dist/cjs/resolvers/fragments/osce.js +1 -0
- package/dist/cjs/resolvers/mutation/restricted/book.js +21 -5
- package/dist/mjs/models/OsceStation.d.ts +6 -0
- package/dist/mjs/resolvers/fragments/osce.js +1 -0
- package/dist/mjs/resolvers/mutation/restricted/book.js +21 -5
- package/package.json +1 -1
|
@@ -47,6 +47,11 @@ export interface IStationExaminerQuestion {
|
|
|
47
47
|
index: number;
|
|
48
48
|
question: string;
|
|
49
49
|
}
|
|
50
|
+
export interface IOsceStationPhaseTimer {
|
|
51
|
+
readingPhase: number;
|
|
52
|
+
stationPhase: number;
|
|
53
|
+
examinerPhase: number;
|
|
54
|
+
}
|
|
50
55
|
export interface IOsceStation {
|
|
51
56
|
id: Id;
|
|
52
57
|
createdAt: number | Date;
|
|
@@ -65,6 +70,7 @@ export interface IOsceStation {
|
|
|
65
70
|
marks: IOsceStationMark[];
|
|
66
71
|
totalMarks: number;
|
|
67
72
|
completedMarks: number;
|
|
73
|
+
phaseTimers?: IOsceStationPhaseTimer;
|
|
68
74
|
topics?: ITopic[];
|
|
69
75
|
picture: IPicture | null;
|
|
70
76
|
candidatePictures?: IPicture[];
|
|
@@ -87,21 +87,37 @@ exports.UPSERT_CONCEPT_NOTE = (0, client_1.gql) `
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
`;
|
|
90
|
+
const resolveConceptCacheId = (cache, conceptId) => {
|
|
91
|
+
for (const [cacheId, value] of Object.entries(cache.extract())) {
|
|
92
|
+
if (value &&
|
|
93
|
+
typeof value === 'object' &&
|
|
94
|
+
'__typename' in value &&
|
|
95
|
+
value.__typename === 'Concept' &&
|
|
96
|
+
value.id === conceptId) {
|
|
97
|
+
return cacheId;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return (cache.identify({
|
|
101
|
+
id: conceptId,
|
|
102
|
+
__typename: 'Concept',
|
|
103
|
+
}) ?? undefined);
|
|
104
|
+
};
|
|
90
105
|
const updateCacheOnUpsertConceptNote = (cache, result, options) => {
|
|
91
106
|
const { upsertConceptNote } = result?.data?.restricted || {};
|
|
92
107
|
const { variables } = options || {};
|
|
93
108
|
if (!variables || !upsertConceptNote) {
|
|
94
109
|
return;
|
|
95
110
|
}
|
|
111
|
+
const cacheId = resolveConceptCacheId(cache, variables.conceptId);
|
|
112
|
+
if (!cacheId) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
96
115
|
cache.writeFragment({
|
|
97
|
-
id:
|
|
98
|
-
|
|
99
|
-
__typename: 'Concept',
|
|
100
|
-
}),
|
|
116
|
+
id: cacheId,
|
|
117
|
+
fragment: fragments_1.UPSERT_CONCEPT_NOTE_FRAGMENT,
|
|
101
118
|
data: {
|
|
102
119
|
userNote: upsertConceptNote,
|
|
103
120
|
},
|
|
104
|
-
fragment: fragments_1.UPSERT_CONCEPT_NOTE_FRAGMENT,
|
|
105
121
|
});
|
|
106
122
|
};
|
|
107
123
|
exports.updateCacheOnUpsertConceptNote = updateCacheOnUpsertConceptNote;
|
|
@@ -47,6 +47,11 @@ export interface IStationExaminerQuestion {
|
|
|
47
47
|
index: number;
|
|
48
48
|
question: string;
|
|
49
49
|
}
|
|
50
|
+
export interface IOsceStationPhaseTimer {
|
|
51
|
+
readingPhase: number;
|
|
52
|
+
stationPhase: number;
|
|
53
|
+
examinerPhase: number;
|
|
54
|
+
}
|
|
50
55
|
export interface IOsceStation {
|
|
51
56
|
id: Id;
|
|
52
57
|
createdAt: number | Date;
|
|
@@ -65,6 +70,7 @@ export interface IOsceStation {
|
|
|
65
70
|
marks: IOsceStationMark[];
|
|
66
71
|
totalMarks: number;
|
|
67
72
|
completedMarks: number;
|
|
73
|
+
phaseTimers?: IOsceStationPhaseTimer;
|
|
68
74
|
topics?: ITopic[];
|
|
69
75
|
picture: IPicture | null;
|
|
70
76
|
candidatePictures?: IPicture[];
|
|
@@ -82,21 +82,37 @@ export const UPSERT_CONCEPT_NOTE = gql `
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
`;
|
|
85
|
+
const resolveConceptCacheId = (cache, conceptId) => {
|
|
86
|
+
for (const [cacheId, value] of Object.entries(cache.extract())) {
|
|
87
|
+
if (value &&
|
|
88
|
+
typeof value === 'object' &&
|
|
89
|
+
'__typename' in value &&
|
|
90
|
+
value.__typename === 'Concept' &&
|
|
91
|
+
value.id === conceptId) {
|
|
92
|
+
return cacheId;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return (cache.identify({
|
|
96
|
+
id: conceptId,
|
|
97
|
+
__typename: 'Concept',
|
|
98
|
+
}) ?? undefined);
|
|
99
|
+
};
|
|
85
100
|
export const updateCacheOnUpsertConceptNote = (cache, result, options) => {
|
|
86
101
|
const { upsertConceptNote } = result?.data?.restricted || {};
|
|
87
102
|
const { variables } = options || {};
|
|
88
103
|
if (!variables || !upsertConceptNote) {
|
|
89
104
|
return;
|
|
90
105
|
}
|
|
106
|
+
const cacheId = resolveConceptCacheId(cache, variables.conceptId);
|
|
107
|
+
if (!cacheId) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
91
110
|
cache.writeFragment({
|
|
92
|
-
id:
|
|
93
|
-
|
|
94
|
-
__typename: 'Concept',
|
|
95
|
-
}),
|
|
111
|
+
id: cacheId,
|
|
112
|
+
fragment: UPSERT_CONCEPT_NOTE_FRAGMENT,
|
|
96
113
|
data: {
|
|
97
114
|
userNote: upsertConceptNote,
|
|
98
115
|
},
|
|
99
|
-
fragment: UPSERT_CONCEPT_NOTE_FRAGMENT,
|
|
100
116
|
});
|
|
101
117
|
};
|
|
102
118
|
export const optimisticUpsertConceptNote = (data) => {
|