@quesmed/types 2.6.44 → 2.6.46

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.
@@ -17,7 +17,7 @@ export interface IOsceMarksheetMember {
17
17
  export interface IOsceMarksheetMark {
18
18
  id: Id;
19
19
  index: number;
20
- mark: number;
20
+ mark: number | null;
21
21
  selectedChoice: Nullable<EPaceMarkType>;
22
22
  osceMarksheetId: Id;
23
23
  osceMarksheet?: IOsceMarksheet;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.COMPLETED_OSCE_STATION_FRAGMENT = exports.COMPLETED_OSCE_MARKSHEET_FRAGMENT = exports.STATION_CONCEPT_FRAGMENT = exports.OSCE_MATCHMAKING_ACTION_FIELDS = exports.OSCE_MARKSHEET_FIELDS = exports.OSCE_MARKSHEET_MARK_FIELDS = exports.OSCE_STATION_FIELDS = exports.OSCE_STATION_MARK_FIELDS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const picture_1 = require("./picture");
6
+ const video_1 = require("./video");
6
7
  exports.OSCE_STATION_MARK_FIELDS = (0, client_1.gql) `
7
8
  fragment OsceStationMarkFields on OsceStationMark {
8
9
  id
@@ -21,6 +22,7 @@ exports.OSCE_STATION_MARK_FIELDS = (0, client_1.gql) `
21
22
  exports.OSCE_STATION_FIELDS = (0, client_1.gql) `
22
23
  ${picture_1.PICTURE_FIELDS}
23
24
  ${exports.OSCE_STATION_MARK_FIELDS}
25
+ ${video_1.VIDEO_FIELDS}
24
26
  fragment OsceStationFields on OsceStation {
25
27
  id
26
28
  updatedAt
@@ -63,22 +65,9 @@ exports.OSCE_STATION_FIELDS = (0, client_1.gql) `
63
65
  ...PictureFields
64
66
  }
65
67
  videos {
66
- id
67
- demo
68
- title
69
- status
70
- museId
71
- thumbnail
72
- concepts {
73
- id
74
- name
75
- }
76
- live
77
- description
78
- duration
68
+ ...VideoFields
79
69
  }
80
70
  demo
81
-
82
71
  # user-specific keys
83
72
  # lastOsceMarksheetId
84
73
  # score
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VIDEO_STATUS_FRAGMENT = exports.VIDEO_FIELDS = exports.VIDEO_FILE_FIELDS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
- const picture_1 = require("./picture");
6
5
  exports.VIDEO_FILE_FIELDS = (0, client_1.gql) `
7
6
  fragment VideoFileFields on File {
8
7
  id
@@ -13,7 +12,6 @@ exports.VIDEO_FILE_FIELDS = (0, client_1.gql) `
13
12
  }
14
13
  `;
15
14
  exports.VIDEO_FIELDS = (0, client_1.gql) `
16
- ${picture_1.PICTURE_FIELDS}
17
15
  ${exports.VIDEO_FILE_FIELDS}
18
16
  fragment VideoFields on Video {
19
17
  id
@@ -30,6 +28,13 @@ exports.VIDEO_FIELDS = (0, client_1.gql) `
30
28
  startTime
31
29
  endTime
32
30
  viewsToday
31
+ views
32
+ userViewed
33
+ osceStation {
34
+ id
35
+ name
36
+ hiddenName
37
+ }
33
38
  concepts {
34
39
  id
35
40
  name
@@ -93,12 +93,13 @@ exports.MARK_OSCE_MARKSHEET_MARK = (0, client_1.gql) `
93
93
  `;
94
94
  const optimisticMarkOsceMarksheetMark = (variables, productType) => {
95
95
  const data = {};
96
- if (productType === models_1.EProductType.OSCE) {
97
- data.mark = variables.mark;
98
- data.selectedChoice = null;
96
+ if (productType === models_1.EProductType.PACES) {
97
+ data.selectedChoice = variables.mark;
98
+ data.mark = null;
99
99
  }
100
100
  else {
101
- data.selectedChoice = variables.mark;
101
+ data.mark = variables.mark;
102
+ data.selectedChoice = null;
102
103
  }
103
104
  return {
104
105
  restricted: {
@@ -34,4 +34,4 @@ export interface ICreatePresetVar {
34
34
  conceptIds: Id[];
35
35
  };
36
36
  }
37
- export declare const updateCacheOnCreatePreset: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
37
+ export declare const updateCacheOnCreatePreset: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
@@ -167,18 +167,18 @@ exports.CREATE_PRESET = (0, client_1.gql) `
167
167
  }
168
168
  }
169
169
  `;
170
- const updateCacheOnCreatePreset = () => (cache, result) => {
170
+ const updateCacheOnCreatePreset = (cache, result) => {
171
171
  const { createPreset } = result?.data?.restricted || {};
172
172
  if (createPreset) {
173
173
  const prevData = cache.readQuery({
174
- variables: {},
174
+ variables: { order: __1.ESortOrder.DESC },
175
175
  query: restricted_1.PRESETS,
176
176
  });
177
177
  if (prevData) {
178
178
  const { presets } = prevData.restricted || {};
179
179
  cache.writeQuery({
180
180
  query: restricted_1.PRESETS,
181
- variables: {},
181
+ variables: { order: __1.ESortOrder.DESC },
182
182
  data: {
183
183
  ...prevData,
184
184
  restricted: {
@@ -188,6 +188,18 @@ const updateCacheOnCreatePreset = () => (cache, result) => {
188
188
  },
189
189
  });
190
190
  }
191
+ else {
192
+ cache.writeQuery({
193
+ query: restricted_1.PRESETS,
194
+ variables: {},
195
+ data: {
196
+ restricted: {
197
+ __typename: 'RestrictedQuery',
198
+ presets: [{ ...createPreset }],
199
+ },
200
+ },
201
+ });
202
+ }
191
203
  }
192
204
  };
193
205
  exports.updateCacheOnCreatePreset = updateCacheOnCreatePreset;
@@ -17,7 +17,7 @@ export interface IOsceMarksheetMember {
17
17
  export interface IOsceMarksheetMark {
18
18
  id: Id;
19
19
  index: number;
20
- mark: number;
20
+ mark: number | null;
21
21
  selectedChoice: Nullable<EPaceMarkType>;
22
22
  osceMarksheetId: Id;
23
23
  osceMarksheet?: IOsceMarksheet;
@@ -1,5 +1,6 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { PICTURE_FIELDS } from './picture';
3
+ import { VIDEO_FIELDS } from './video';
3
4
  export const OSCE_STATION_MARK_FIELDS = gql `
4
5
  fragment OsceStationMarkFields on OsceStationMark {
5
6
  id
@@ -18,6 +19,7 @@ export const OSCE_STATION_MARK_FIELDS = gql `
18
19
  export const OSCE_STATION_FIELDS = gql `
19
20
  ${PICTURE_FIELDS}
20
21
  ${OSCE_STATION_MARK_FIELDS}
22
+ ${VIDEO_FIELDS}
21
23
  fragment OsceStationFields on OsceStation {
22
24
  id
23
25
  updatedAt
@@ -60,22 +62,9 @@ export const OSCE_STATION_FIELDS = gql `
60
62
  ...PictureFields
61
63
  }
62
64
  videos {
63
- id
64
- demo
65
- title
66
- status
67
- museId
68
- thumbnail
69
- concepts {
70
- id
71
- name
72
- }
73
- live
74
- description
75
- duration
65
+ ...VideoFields
76
66
  }
77
67
  demo
78
-
79
68
  # user-specific keys
80
69
  # lastOsceMarksheetId
81
70
  # score
@@ -1,5 +1,4 @@
1
1
  import { gql } from '@apollo/client';
2
- import { PICTURE_FIELDS } from './picture';
3
2
  export const VIDEO_FILE_FIELDS = gql `
4
3
  fragment VideoFileFields on File {
5
4
  id
@@ -10,7 +9,6 @@ export const VIDEO_FILE_FIELDS = gql `
10
9
  }
11
10
  `;
12
11
  export const VIDEO_FIELDS = gql `
13
- ${PICTURE_FIELDS}
14
12
  ${VIDEO_FILE_FIELDS}
15
13
  fragment VideoFields on Video {
16
14
  id
@@ -27,6 +25,13 @@ export const VIDEO_FIELDS = gql `
27
25
  startTime
28
26
  endTime
29
27
  viewsToday
28
+ views
29
+ userViewed
30
+ osceStation {
31
+ id
32
+ name
33
+ hiddenName
34
+ }
30
35
  concepts {
31
36
  id
32
37
  name
@@ -90,12 +90,13 @@ export const MARK_OSCE_MARKSHEET_MARK = gql `
90
90
  `;
91
91
  export const optimisticMarkOsceMarksheetMark = (variables, productType) => {
92
92
  const data = {};
93
- if (productType === EProductType.OSCE) {
94
- data.mark = variables.mark;
95
- data.selectedChoice = null;
93
+ if (productType === EProductType.PACES) {
94
+ data.selectedChoice = variables.mark;
95
+ data.mark = null;
96
96
  }
97
97
  else {
98
- data.selectedChoice = variables.mark;
98
+ data.mark = variables.mark;
99
+ data.selectedChoice = null;
99
100
  }
100
101
  return {
101
102
  restricted: {
@@ -34,4 +34,4 @@ export interface ICreatePresetVar {
34
34
  conceptIds: Id[];
35
35
  };
36
36
  }
37
- export declare const updateCacheOnCreatePreset: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
37
+ export declare const updateCacheOnCreatePreset: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
@@ -162,18 +162,18 @@ export const CREATE_PRESET = gql `
162
162
  }
163
163
  }
164
164
  `;
165
- export const updateCacheOnCreatePreset = () => (cache, result) => {
165
+ export const updateCacheOnCreatePreset = (cache, result) => {
166
166
  const { createPreset } = result?.data?.restricted || {};
167
167
  if (createPreset) {
168
168
  const prevData = cache.readQuery({
169
- variables: {},
169
+ variables: { order: ESortOrder.DESC },
170
170
  query: PRESETS,
171
171
  });
172
172
  if (prevData) {
173
173
  const { presets } = prevData.restricted || {};
174
174
  cache.writeQuery({
175
175
  query: PRESETS,
176
- variables: {},
176
+ variables: { order: ESortOrder.DESC },
177
177
  data: {
178
178
  ...prevData,
179
179
  restricted: {
@@ -183,5 +183,17 @@ export const updateCacheOnCreatePreset = () => (cache, result) => {
183
183
  },
184
184
  });
185
185
  }
186
+ else {
187
+ cache.writeQuery({
188
+ query: PRESETS,
189
+ variables: {},
190
+ data: {
191
+ restricted: {
192
+ __typename: 'RestrictedQuery',
193
+ presets: [{ ...createPreset }],
194
+ },
195
+ },
196
+ });
197
+ }
186
198
  }
187
199
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.44",
3
+ "version": "2.6.46",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",