@quesmed/types-rn 2.6.56 → 2.6.58

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.
@@ -1,9 +1,9 @@
1
1
  import { IFile } from './File';
2
2
  import { IHighlightNode } from './Highlight';
3
+ import { IUserChapterNote } from './Note';
3
4
  import { IPicture } from './Picture';
4
5
  import { ETopicType } from './Topic';
5
6
  import { Id } from './Type';
6
- import { IUserChapterNote } from './User';
7
7
  export interface IChapter {
8
8
  id: Id;
9
9
  createdAt: number | Date;
@@ -1,5 +1,5 @@
1
1
  import { IBuildConfigData, IPreBuildMarksheet } from '../resolvers/mutation/restricted/marksheet';
2
- import { EProductType, IEntitlement } from './Product';
2
+ import { EEntitlementType, EProductType, IEntitlement } from './Product';
3
3
  import { IPrescribeMark, IQuestion, IQuestionChoice, IQuestionQAAnswer } from './Question';
4
4
  import { ETopicType } from './Topic';
5
5
  import { Id } from './Type';
@@ -91,7 +91,7 @@ export interface IMarksheet {
91
91
  topicConceptData?: string;
92
92
  preBuildData?: IPreBuildMarksheet;
93
93
  builderConfig?: IBuildConfigData;
94
- entitlementId: EProductType;
94
+ entitlementId: EProductType | EEntitlementType;
95
95
  }
96
96
  export type IMarksheetMarkJSONB = string | [string] | [IQuestionQAAnswer] | [string[], string[]] | [IPrescribeMark] | null;
97
97
  export interface IMarksheetMark {
@@ -118,4 +118,5 @@ export interface IPreBuildMarksheetRef {
118
118
  seenCorrect: number[];
119
119
  seenIncorrect: number[];
120
120
  source: string;
121
+ entitlementId: IMarksheet['entitlementId'];
121
122
  }
@@ -0,0 +1,18 @@
1
+ import { IChapter } from './Chapter';
2
+ import { IOsceStation } from './OsceStation';
3
+ import { Id } from './Type';
4
+ export interface IUserNote {
5
+ id: Id;
6
+ createdAt: number | Date;
7
+ updatedAt: number | Date;
8
+ userId: Id;
9
+ note: string;
10
+ }
11
+ export interface IUserChapterNote extends IUserNote {
12
+ chapterId: Id;
13
+ chapter: IChapter;
14
+ }
15
+ export interface IUserStationNote extends IUserNote {
16
+ stationId: Id;
17
+ station: IOsceStation;
18
+ }
package/models/Note.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  import { Nullable } from '../resolvers';
2
2
  import { IOsceStation, IOsceStationMark, IOsceType } from './OsceStation';
3
3
  import { EPaceMarkType } from './Paces';
4
- import { EProductType } from './Product';
4
+ import { EEntitlementType, EProductType } from './Product';
5
5
  import { Id } from './Type';
6
6
  import { IUser } from './User';
7
7
  export interface IOsceMarksheetMember {
@@ -85,7 +85,7 @@ export interface IOsceMarksheet {
85
85
  members: IOsceMarksheetMember[];
86
86
  state: EOsceMarksheetState;
87
87
  completed: boolean;
88
- entitlementId: EProductType;
88
+ entitlementId: EProductType | EEntitlementType;
89
89
  isTimed: boolean;
90
90
  }
91
91
  export interface IDashboardOsce {
@@ -1,5 +1,6 @@
1
1
  import { IConcept } from './Concept';
2
2
  import { EDifficultyType } from './Difficulty';
3
+ import { IUserStationNote } from './Note';
3
4
  import { IPaceScore } from './Paces';
4
5
  import { IPicture } from './Picture';
5
6
  import { IEntitlement } from './Product';
@@ -70,6 +71,7 @@ export interface IOsceStation {
70
71
  score?: number;
71
72
  status?: EUserLearningStatus;
72
73
  demo?: boolean;
74
+ userNote: null | IUserStationNote;
73
75
  }
74
76
  export interface IOsceStationTopic {
75
77
  id: Id;
@@ -15,6 +15,10 @@ export declare enum EProductType {
15
15
  INTERVIEW_CST = 12,
16
16
  INTERVIEW_IMT = 13,
17
17
  INTERVIEW_RADIOLOGY = 14,
18
+ PLAB1 = 34,
19
+ PLAB2 = 35
20
+ }
21
+ export declare enum EEntitlementType {
18
22
  CLINICAL = 15,
19
23
  DATA_INTERPRETATION = 16,
20
24
  CLINICAL_SUBSET = 17,
@@ -34,8 +38,10 @@ export declare enum EProductType {
34
38
  CONSULTATION = 31,
35
39
  NEUROLOGY = 32,
36
40
  RESPIRATORY = 33,
37
- PLAB1 = 34,
38
- PLAB2 = 35
41
+ ANATOMY = 36,
42
+ PRE_CLINICAL = 37,
43
+ MRCP_PART_1 = 38,
44
+ MRCP_PART_2 = 39
39
45
  }
40
46
  export interface IProduct {
41
47
  id: Id;
@@ -52,6 +58,7 @@ export interface IProduct {
52
58
  export interface IEntitlementType {
53
59
  id: Id;
54
60
  name: string;
61
+ isProduct: boolean;
55
62
  }
56
63
  export declare enum EAppType {
57
64
  AMS = 1,
package/models/Product.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EAppType = exports.EProductType = void 0;
3
+ exports.EAppType = exports.EEntitlementType = exports.EProductType = void 0;
4
4
  var EProductType;
5
5
  (function (EProductType) {
6
6
  EProductType[EProductType["ALL"] = 0] = "ALL";
@@ -18,28 +18,35 @@ var EProductType;
18
18
  EProductType[EProductType["INTERVIEW_CST"] = 12] = "INTERVIEW_CST";
19
19
  EProductType[EProductType["INTERVIEW_IMT"] = 13] = "INTERVIEW_IMT";
20
20
  EProductType[EProductType["INTERVIEW_RADIOLOGY"] = 14] = "INTERVIEW_RADIOLOGY";
21
- EProductType[EProductType["CLINICAL"] = 15] = "CLINICAL";
22
- EProductType[EProductType["DATA_INTERPRETATION"] = 16] = "DATA_INTERPRETATION";
23
- EProductType[EProductType["CLINICAL_SUBSET"] = 17] = "CLINICAL_SUBSET";
24
- EProductType[EProductType["CLINICAL_PROBLEM_SOLVING"] = 18] = "CLINICAL_PROBLEM_SOLVING";
25
- EProductType[EProductType["PROFESSIONAL_DILEMMA"] = 19] = "PROFESSIONAL_DILEMMA";
26
- EProductType[EProductType["HISTORY_TAKING"] = 20] = "HISTORY_TAKING";
27
- EProductType[EProductType["COMMUNICATION_SKILLS"] = 21] = "COMMUNICATION_SKILLS";
28
- EProductType[EProductType["EXAMINATION"] = 22] = "EXAMINATION";
29
- EProductType[EProductType["PROCEDURE"] = 23] = "PROCEDURE";
30
- EProductType[EProductType["INTERPRETATION"] = 24] = "INTERPRETATION";
31
- EProductType[EProductType["ABCDE"] = 25] = "ABCDE";
32
- EProductType[EProductType["PRESCRIBING"] = 26] = "PRESCRIBING";
33
- EProductType[EProductType["MIXED"] = 27] = "MIXED";
34
- EProductType[EProductType["ABDOMINAL"] = 28] = "ABDOMINAL";
35
- EProductType[EProductType["CARDIOVASCULAR"] = 29] = "CARDIOVASCULAR";
36
- EProductType[EProductType["COMMUNICATION"] = 30] = "COMMUNICATION";
37
- EProductType[EProductType["CONSULTATION"] = 31] = "CONSULTATION";
38
- EProductType[EProductType["NEUROLOGY"] = 32] = "NEUROLOGY";
39
- EProductType[EProductType["RESPIRATORY"] = 33] = "RESPIRATORY";
40
21
  EProductType[EProductType["PLAB1"] = 34] = "PLAB1";
41
22
  EProductType[EProductType["PLAB2"] = 35] = "PLAB2";
42
23
  })(EProductType = exports.EProductType || (exports.EProductType = {}));
24
+ var EEntitlementType;
25
+ (function (EEntitlementType) {
26
+ EEntitlementType[EEntitlementType["CLINICAL"] = 15] = "CLINICAL";
27
+ EEntitlementType[EEntitlementType["DATA_INTERPRETATION"] = 16] = "DATA_INTERPRETATION";
28
+ EEntitlementType[EEntitlementType["CLINICAL_SUBSET"] = 17] = "CLINICAL_SUBSET";
29
+ EEntitlementType[EEntitlementType["CLINICAL_PROBLEM_SOLVING"] = 18] = "CLINICAL_PROBLEM_SOLVING";
30
+ EEntitlementType[EEntitlementType["PROFESSIONAL_DILEMMA"] = 19] = "PROFESSIONAL_DILEMMA";
31
+ EEntitlementType[EEntitlementType["HISTORY_TAKING"] = 20] = "HISTORY_TAKING";
32
+ EEntitlementType[EEntitlementType["COMMUNICATION_SKILLS"] = 21] = "COMMUNICATION_SKILLS";
33
+ EEntitlementType[EEntitlementType["EXAMINATION"] = 22] = "EXAMINATION";
34
+ EEntitlementType[EEntitlementType["PROCEDURE"] = 23] = "PROCEDURE";
35
+ EEntitlementType[EEntitlementType["INTERPRETATION"] = 24] = "INTERPRETATION";
36
+ EEntitlementType[EEntitlementType["ABCDE"] = 25] = "ABCDE";
37
+ EEntitlementType[EEntitlementType["PRESCRIBING"] = 26] = "PRESCRIBING";
38
+ EEntitlementType[EEntitlementType["MIXED"] = 27] = "MIXED";
39
+ EEntitlementType[EEntitlementType["ABDOMINAL"] = 28] = "ABDOMINAL";
40
+ EEntitlementType[EEntitlementType["CARDIOVASCULAR"] = 29] = "CARDIOVASCULAR";
41
+ EEntitlementType[EEntitlementType["COMMUNICATION"] = 30] = "COMMUNICATION";
42
+ EEntitlementType[EEntitlementType["CONSULTATION"] = 31] = "CONSULTATION";
43
+ EEntitlementType[EEntitlementType["NEUROLOGY"] = 32] = "NEUROLOGY";
44
+ EEntitlementType[EEntitlementType["RESPIRATORY"] = 33] = "RESPIRATORY";
45
+ EEntitlementType[EEntitlementType["ANATOMY"] = 36] = "ANATOMY";
46
+ EEntitlementType[EEntitlementType["PRE_CLINICAL"] = 37] = "PRE_CLINICAL";
47
+ EEntitlementType[EEntitlementType["MRCP_PART_1"] = 38] = "MRCP_PART_1";
48
+ EEntitlementType[EEntitlementType["MRCP_PART_2"] = 39] = "MRCP_PART_2";
49
+ })(EEntitlementType = exports.EEntitlementType || (exports.EEntitlementType = {}));
43
50
  var EAppType;
44
51
  (function (EAppType) {
45
52
  EAppType[EAppType["AMS"] = 1] = "AMS";
package/models/User.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ExtractKeysWithPattern } from '../resolvers/types';
2
2
  import { ICard } from './Card';
3
- import { IChapter } from './Chapter';
4
3
  import { IConcept } from './Concept';
5
4
  import { IMarksheet } from './Marksheet';
6
5
  import { INotification } from './Notification';
@@ -156,15 +155,6 @@ export interface IUserCompletedQuestion {
156
155
  question: IQuestion;
157
156
  concept: IConcept;
158
157
  }
159
- export interface IUserChapterNote {
160
- id: Id;
161
- createdAt: number | Date;
162
- updatedAt: number | Date;
163
- chapterId: Id;
164
- chapter: IChapter;
165
- userId: Id;
166
- note: string;
167
- }
168
158
  export interface IUserCompletedCard {
169
159
  id: Id;
170
160
  createdAt: number | Date;
package/models/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from './File';
11
11
  export * from './Highlight';
12
12
  export * from './Marksheet';
13
13
  export * from './MockTest';
14
+ export * from './Note';
14
15
  export * from './Notification';
15
16
  export * from './OsceMarksheet';
16
17
  export * from './OsceStation';
package/models/index.js CHANGED
@@ -27,6 +27,7 @@ __exportStar(require("./File"), exports);
27
27
  __exportStar(require("./Highlight"), exports);
28
28
  __exportStar(require("./Marksheet"), exports);
29
29
  __exportStar(require("./MockTest"), exports);
30
+ __exportStar(require("./Note"), exports);
30
31
  __exportStar(require("./Notification"), exports);
31
32
  __exportStar(require("./OsceMarksheet"), exports);
32
33
  __exportStar(require("./OsceStation"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.56",
3
+ "version": "2.6.58",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -6,3 +6,4 @@ export declare const OSCE_MATCHMAKING_ACTION_FIELDS: import("@apollo/client").Do
6
6
  export declare const STATION_CONCEPT_FRAGMENT: import("@apollo/client").DocumentNode;
7
7
  export declare const COMPLETED_OSCE_MARKSHEET_FRAGMENT: import("@apollo/client").DocumentNode;
8
8
  export declare const COMPLETED_OSCE_STATION_FRAGMENT: import("@apollo/client").DocumentNode;
9
+ export declare const UPSERT_STATION_NOTE_FRAGMENT: import("@apollo/client").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.UPSERT_STATION_NOTE_FRAGMENT = 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
6
  const video_1 = require("./video");
@@ -29,6 +29,13 @@ exports.OSCE_STATION_FIELDS = (0, client_1.gql) `
29
29
  name
30
30
  hiddenName
31
31
  status
32
+ userNote {
33
+ id
34
+ userId
35
+ stationId
36
+ note
37
+ updatedAt
38
+ }
32
39
  osceType {
33
40
  id
34
41
  name
@@ -172,3 +179,15 @@ exports.COMPLETED_OSCE_STATION_FRAGMENT = (0, client_1.gql) `
172
179
  lastOsceMarksheetId
173
180
  }
174
181
  `;
182
+ // used in cache updator
183
+ exports.UPSERT_STATION_NOTE_FRAGMENT = (0, client_1.gql) `
184
+ fragment UpsertStationNoteFragment on OsceStation {
185
+ userNote {
186
+ userId
187
+ stationId
188
+ note
189
+ createdAt
190
+ updatedAt
191
+ }
192
+ }
193
+ `;
@@ -188,7 +188,7 @@ export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: numbe
188
188
  currentMarkId?: number | undefined;
189
189
  topicConceptData?: string | undefined;
190
190
  preBuildData?: IPreBuildMarksheet | undefined;
191
- entitlementId: import("../../../models").EProductType;
191
+ entitlementId: import("../../../models").EProductType | import("../../../models").EEntitlementType;
192
192
  };
193
193
  };
194
194
  };
@@ -281,7 +281,7 @@ export declare const optimisticEndMarksheet: (marksheet: IMarksheet) => {
281
281
  topicConceptData?: string | undefined;
282
282
  preBuildData?: IPreBuildMarksheet | undefined;
283
283
  builderConfig?: IBuildConfigData | undefined;
284
- entitlementId: import("../../../models").EProductType;
284
+ entitlementId: import("../../../models").EProductType | import("../../../models").EEntitlementType;
285
285
  __typename: string;
286
286
  };
287
287
  };
@@ -78,7 +78,7 @@ export declare const optimisticEndMockTest: (marksheet: IMarksheet) => {
78
78
  topicConceptData?: string | undefined;
79
79
  preBuildData?: import("./marksheet").IPreBuildMarksheet | undefined;
80
80
  builderConfig?: import("./marksheet").IBuildConfigData | undefined;
81
- entitlementId: import("../../../models").EProductType;
81
+ entitlementId: import("../../../models").EProductType | import("../../../models").EEntitlementType;
82
82
  __typename: string;
83
83
  };
84
84
  };
@@ -1,5 +1,5 @@
1
1
  import { ApolloCache } from '@apollo/client';
2
- import { EOsceMarksheetAction, EOsceMarksheetState, EOsceRoles, EPaceMarkType, EProductType, EStudyAction, IOsceMarksheet, IOsceMarksheetMark, Id } from '../../../models';
2
+ import { EEntitlementType, EOsceMarksheetAction, EOsceMarksheetState, EOsceRoles, EPaceMarkType, EProductType, EStudyAction, IOsceMarksheet, IOsceMarksheetMark, IUserStationNote, Id } from '../../../models';
3
3
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
4
4
  import { IOsceMatchmakingAction } from '../../subscription/osce';
5
5
  import { RestrictedData, graphqlNormalize } from '../../types';
@@ -31,6 +31,7 @@ export declare const BUILD_OSCE_MARKSHEET: import("@apollo/client").DocumentNode
31
31
  export interface IBuildOsceMarksheetVar {
32
32
  osceStationId?: Id;
33
33
  osceMarksheetId?: Id;
34
+ entitlementId?: EEntitlementType;
34
35
  }
35
36
  export type IBuildOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'buildOsceMarksheet'>;
36
37
  export declare const CHANGE_OSCE_ROLE: import("@apollo/client").DocumentNode;
@@ -129,7 +130,7 @@ export declare const optimisticEndOsceMarksheet: (marksheet: IOsceMarksheet) =>
129
130
  activeUsers?: import("../../../models").IUser[] | undefined;
130
131
  members: import("../../../models").IOsceMarksheetMember[];
131
132
  state: EOsceMarksheetState;
132
- entitlementId: EProductType;
133
+ entitlementId: EProductType | EEntitlementType;
133
134
  isTimed: boolean;
134
135
  __typename: string;
135
136
  };
@@ -140,3 +141,27 @@ export interface ILeaveOsceMarksheetVar {
140
141
  osceMarksheetId: Id;
141
142
  }
142
143
  export type ILeaveOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'leaveOsceMarksheet'>;
144
+ /**
145
+ * upsertStationNote
146
+ */
147
+ export declare const UPSERT_STATION_NOTE: import("@apollo/client").DocumentNode;
148
+ export interface IUpsertStationNoteVar {
149
+ stationId: number;
150
+ note: string;
151
+ }
152
+ export type IUpsertStationNoteData = RestrictedData<IUserStationNote, 'upsertStationNote'>;
153
+ export declare const updateCacheOnUpsertStationNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertStationNoteData>, options: ApolloUpdateOptions<IUpsertStationNoteVar>) => void;
154
+ export declare const optimisticUpsertStationNote: (data: IUpsertStationNoteVar & {
155
+ userId: number;
156
+ }) => {
157
+ restricted: {
158
+ upsertStationNote: {
159
+ createdAt: Date;
160
+ updatedAt: Date;
161
+ stationId: number;
162
+ note: string;
163
+ userId: number;
164
+ __typename: string;
165
+ };
166
+ };
167
+ };
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LEAVE_OSCE_MARKSHEET = exports.optimisticEndOsceMarksheet = exports.updateCacheOnEndOsceMarksheet = exports.END_OSCE_MARKSHEET = exports.MODIFY_OSCE_MARKSHEET = exports.SAVE_OSCE_MARKSHEET = exports.PRESTART_OSCE_MARKSHEET = exports.START_OSCE_TIMER = exports.START_OSCE_MARKSHEET = exports.SELECT_OSCE_STATION = exports.optimisticMarkOsceMarksheetMark = exports.MARK_OSCE_MARKSHEET_MARK = exports.CHANGE_OSCE_ROLE = exports.BUILD_OSCE_MARKSHEET = exports.CREATE_OR_JOIN_OSCE_MARKSHEET = exports.CANCEL_OSCE_MATCHMAKING = exports.CHECK_OSCE_MATCHMAKING = exports.ACCEPT_OSCE_MATCHMAKING = exports.START_OSCE_MATCHMAKING = void 0;
3
+ exports.optimisticUpsertStationNote = exports.updateCacheOnUpsertStationNote = exports.UPSERT_STATION_NOTE = exports.LEAVE_OSCE_MARKSHEET = exports.optimisticEndOsceMarksheet = exports.updateCacheOnEndOsceMarksheet = exports.END_OSCE_MARKSHEET = exports.MODIFY_OSCE_MARKSHEET = exports.SAVE_OSCE_MARKSHEET = exports.PRESTART_OSCE_MARKSHEET = exports.START_OSCE_TIMER = exports.START_OSCE_MARKSHEET = exports.SELECT_OSCE_STATION = exports.optimisticMarkOsceMarksheetMark = exports.MARK_OSCE_MARKSHEET_MARK = exports.CHANGE_OSCE_ROLE = exports.BUILD_OSCE_MARKSHEET = exports.CREATE_OR_JOIN_OSCE_MARKSHEET = exports.CANCEL_OSCE_MATCHMAKING = exports.CHECK_OSCE_MATCHMAKING = exports.ACCEPT_OSCE_MATCHMAKING = exports.START_OSCE_MATCHMAKING = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const models_1 = require("../../../models");
6
- const osce_1 = require("../../fragments/osce");
7
- const osce_2 = require("./../../fragments/osce");
6
+ const fragments_1 = require("../../fragments");
8
7
  exports.START_OSCE_MATCHMAKING = (0, client_1.gql) `
9
8
  mutation StartOsceMatchmaking($sessionId: String!) {
10
9
  restricted {
@@ -20,7 +19,7 @@ exports.ACCEPT_OSCE_MATCHMAKING = (0, client_1.gql) `
20
19
  }
21
20
  `;
22
21
  exports.CHECK_OSCE_MATCHMAKING = (0, client_1.gql) `
23
- ${osce_1.OSCE_MATCHMAKING_ACTION_FIELDS}
22
+ ${fragments_1.OSCE_MATCHMAKING_ACTION_FIELDS}
24
23
  mutation CheckOsceMatchmaking {
25
24
  restricted {
26
25
  checkOsceMatchmaking {
@@ -37,8 +36,8 @@ exports.CANCEL_OSCE_MATCHMAKING = (0, client_1.gql) `
37
36
  }
38
37
  `;
39
38
  exports.CREATE_OR_JOIN_OSCE_MARKSHEET = (0, client_1.gql) `
40
- ${osce_2.OSCE_STATION_FIELDS}
41
- ${osce_1.OSCE_MARKSHEET_FIELDS}
39
+ ${fragments_1.OSCE_STATION_FIELDS}
40
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
42
41
  mutation CreateOrJoinOsceMarksheet($sessionId: String!, $action: Int!) {
43
42
  restricted {
44
43
  createOrJoinOsceMarksheet(sessionId: $sessionId, action: $action) {
@@ -51,13 +50,14 @@ exports.CREATE_OR_JOIN_OSCE_MARKSHEET = (0, client_1.gql) `
51
50
  }
52
51
  `;
53
52
  exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
54
- ${osce_2.OSCE_STATION_FIELDS}
55
- ${osce_1.OSCE_MARKSHEET_FIELDS}
56
- mutation BuildOsceMarksheet($osceStationId: Int!, $osceMarksheetId: Int) {
53
+ ${fragments_1.OSCE_STATION_FIELDS}
54
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
55
+ mutation BuildOsceMarksheet($osceStationId: Int!, $osceMarksheetId: Int, $entitlementId: Int) {
57
56
  restricted {
58
57
  buildOsceMarksheet(
59
58
  osceStationId: $osceStationId
60
59
  osceMarksheetId: $osceMarksheetId
60
+ entitlementId: $entitlementId
61
61
  ) {
62
62
  ...OsceMarksheetFields
63
63
  osceStation {
@@ -68,7 +68,7 @@ exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
68
68
  }
69
69
  `;
70
70
  exports.CHANGE_OSCE_ROLE = (0, client_1.gql) `
71
- ${osce_1.OSCE_MARKSHEET_FIELDS}
71
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
72
72
  mutation ChangeOsceRole($sessionId: String!, $role: Int!) {
73
73
  restricted {
74
74
  changeOsceRole(sessionId: $sessionId, role: $role) {
@@ -113,8 +113,8 @@ const optimisticMarkOsceMarksheetMark = (variables, productType) => {
113
113
  };
114
114
  exports.optimisticMarkOsceMarksheetMark = optimisticMarkOsceMarksheetMark;
115
115
  exports.SELECT_OSCE_STATION = (0, client_1.gql) `
116
- ${osce_2.OSCE_STATION_FIELDS}
117
- ${osce_1.OSCE_MARKSHEET_FIELDS}
116
+ ${fragments_1.OSCE_STATION_FIELDS}
117
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
118
118
  mutation SelectOsceMarksheetStation(
119
119
  $osceMarksheetId: Int!
120
120
  $osceStationId: Int!
@@ -133,8 +133,8 @@ exports.SELECT_OSCE_STATION = (0, client_1.gql) `
133
133
  }
134
134
  `;
135
135
  exports.START_OSCE_MARKSHEET = (0, client_1.gql) `
136
- ${osce_2.OSCE_STATION_FIELDS}
137
- ${osce_1.OSCE_MARKSHEET_FIELDS}
136
+ ${fragments_1.OSCE_STATION_FIELDS}
137
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
138
138
  mutation StartOsceMarksheet($osceMarksheetId: Int!) {
139
139
  restricted {
140
140
  startOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
@@ -162,8 +162,8 @@ exports.START_OSCE_TIMER = (0, client_1.gql) `
162
162
  }
163
163
  `;
164
164
  exports.PRESTART_OSCE_MARKSHEET = (0, client_1.gql) `
165
- ${osce_2.OSCE_STATION_FIELDS}
166
- ${osce_1.OSCE_MARKSHEET_FIELDS}
165
+ ${fragments_1.OSCE_STATION_FIELDS}
166
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
167
167
  mutation PrestartOsceMarksheet(
168
168
  $osceMarksheetId: Int!
169
169
  $readingTime: Int!
@@ -188,7 +188,7 @@ exports.PRESTART_OSCE_MARKSHEET = (0, client_1.gql) `
188
188
  }
189
189
  `;
190
190
  exports.SAVE_OSCE_MARKSHEET = (0, client_1.gql) `
191
- ${osce_1.OSCE_MARKSHEET_FIELDS}
191
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
192
192
  mutation SaveOsceMarksheet(
193
193
  $osceMarksheetId: Int!
194
194
  $feedback: String
@@ -221,7 +221,7 @@ exports.MODIFY_OSCE_MARKSHEET = (0, client_1.gql) `
221
221
  }
222
222
  `;
223
223
  exports.END_OSCE_MARKSHEET = (0, client_1.gql) `
224
- ${osce_1.OSCE_MARKSHEET_FIELDS}
224
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
225
225
  mutation EndOsceMarksheet(
226
226
  $osceMarksheetId: Int!
227
227
  $feedback: String
@@ -257,7 +257,7 @@ const updateCacheOnEndOsceMarksheet = (productType) => (cache, result, options)
257
257
  timeTaken: endOsceMarksheet.timeTaken,
258
258
  endedAt: endOsceMarksheet.endedAt,
259
259
  },
260
- fragment: osce_1.COMPLETED_OSCE_MARKSHEET_FRAGMENT,
260
+ fragment: fragments_1.COMPLETED_OSCE_MARKSHEET_FRAGMENT,
261
261
  });
262
262
  cache.writeFragment({
263
263
  id: cache.identify({
@@ -271,7 +271,7 @@ const updateCacheOnEndOsceMarksheet = (productType) => (cache, result, options)
271
271
  score: endOsceMarksheet.score,
272
272
  lastOsceMarksheetId: endOsceMarksheet.id,
273
273
  },
274
- fragment: osce_1.COMPLETED_OSCE_STATION_FRAGMENT,
274
+ fragment: fragments_1.COMPLETED_OSCE_STATION_FRAGMENT,
275
275
  });
276
276
  };
277
277
  exports.updateCacheOnEndOsceMarksheet = updateCacheOnEndOsceMarksheet;
@@ -287,7 +287,7 @@ const optimisticEndOsceMarksheet = (marksheet) => ({
287
287
  });
288
288
  exports.optimisticEndOsceMarksheet = optimisticEndOsceMarksheet;
289
289
  exports.LEAVE_OSCE_MARKSHEET = (0, client_1.gql) `
290
- ${osce_1.OSCE_MARKSHEET_FIELDS}
290
+ ${fragments_1.OSCE_MARKSHEET_FIELDS}
291
291
  mutation LeaveOsceMarksheet($osceMarksheetId: Int!) {
292
292
  restricted {
293
293
  leaveOsceMarksheet(osceMarksheetId: $osceMarksheetId) {
@@ -296,3 +296,51 @@ exports.LEAVE_OSCE_MARKSHEET = (0, client_1.gql) `
296
296
  }
297
297
  }
298
298
  `;
299
+ /**
300
+ * upsertStationNote
301
+ */
302
+ exports.UPSERT_STATION_NOTE = (0, client_1.gql) `
303
+ mutation UpsertStationNote($stationId: Int!, $note: String!) {
304
+ restricted {
305
+ upsertStationNote(stationId: $stationId, note: $note) {
306
+ id
307
+ stationId
308
+ userId
309
+ note
310
+ createdAt
311
+ updatedAt
312
+ }
313
+ }
314
+ }
315
+ `;
316
+ const updateCacheOnUpsertStationNote = (cache, result, options) => {
317
+ const { upsertStationNote } = result?.data?.restricted || {};
318
+ const { variables } = options || {};
319
+ if (!variables || !upsertStationNote) {
320
+ return;
321
+ }
322
+ cache.writeFragment({
323
+ id: cache.identify({
324
+ id: variables.stationId,
325
+ __typename: 'OsceStation',
326
+ }),
327
+ data: {
328
+ userNote: upsertStationNote,
329
+ },
330
+ fragment: fragments_1.UPSERT_STATION_NOTE_FRAGMENT,
331
+ });
332
+ };
333
+ exports.updateCacheOnUpsertStationNote = updateCacheOnUpsertStationNote;
334
+ const optimisticUpsertStationNote = (data) => {
335
+ return {
336
+ restricted: {
337
+ upsertStationNote: {
338
+ __typename: 'UserStationNote',
339
+ ...data,
340
+ createdAt: new Date(),
341
+ updatedAt: new Date(),
342
+ },
343
+ },
344
+ };
345
+ };
346
+ exports.optimisticUpsertStationNote = optimisticUpsertStationNote;
@@ -1,4 +1,4 @@
1
- import { EDifficultyType, Id, IMarksheet, IUserFlaggedQuestion } from '../../../models';
1
+ import { EDifficultyType, EEntitlementType, Id, IMarksheet, IUserFlaggedQuestion } from '../../../models';
2
2
  import { ESortOrder } from '../../enums';
3
3
  import { IPreBuildMarksheet } from '../../mutation/restricted';
4
4
  import { graphqlNormalize, RestrictedData } from '../../types';
@@ -115,6 +115,7 @@ export interface IPreBuildMarksheetVar {
115
115
  marksheetId?: Id;
116
116
  source: string;
117
117
  difficulty?: EDifficultyType[];
118
+ entitlementId?: EEntitlementType;
118
119
  }
119
120
  export type IPreBuildMarksheetData = RestrictedData<graphqlNormalize & IPreBuildMarksheet, 'preBuildMarksheet'>;
120
121
  export declare const PRE_BUILD_MARKSHEET: import("@apollo/client").DocumentNode;
@@ -175,6 +175,7 @@ exports.PRE_BUILD_MARKSHEET = (0, client_1.gql) `
175
175
  $search: String
176
176
  $marksheetId: Int
177
177
  $difficulty: [Int!]
178
+ $entitlementId: Int
178
179
  ) {
179
180
  restricted {
180
181
  preBuildMarksheet(
@@ -184,6 +185,7 @@ exports.PRE_BUILD_MARKSHEET = (0, client_1.gql) `
184
185
  search: $search
185
186
  marksheetId: $marksheetId
186
187
  difficulty: $difficulty
188
+ entitlementId: $entitlementId
187
189
  ) {
188
190
  unseen
189
191
  seenCorrect
@@ -1,10 +1,11 @@
1
- import { Id, IPreBuildTodo, ITodo } from '../../../models';
1
+ import { EEntitlementType, Id, IPreBuildTodo, ITodo } from '../../../models';
2
2
  import { graphqlNormalize, RestrictedData } from '../../types';
3
3
  export interface IPreBuildTodoVar {
4
4
  topicIds: number[];
5
5
  conceptIds: number[];
6
6
  search: string;
7
7
  source: string;
8
+ entitlementId?: EEntitlementType;
8
9
  }
9
10
  export type IPreBuildTodoData = RestrictedData<graphqlNormalize & IPreBuildTodo, 'preBuildTodo'>;
10
11
  export declare const PRE_BUILD_TODO: import("@apollo/client").DocumentNode;
@@ -9,6 +9,7 @@ exports.PRE_BUILD_TODO = (0, client_1.gql) `
9
9
  $conceptIds: [Int!]
10
10
  $search: String
11
11
  $source: String!
12
+ $entitlementId: Int
12
13
  ) {
13
14
  restricted {
14
15
  preBuildTodo(
@@ -16,6 +17,7 @@ exports.PRE_BUILD_TODO = (0, client_1.gql) `
16
17
  conceptIds: $conceptIds
17
18
  search: $search
18
19
  source: $source
20
+ entitlementId: $entitlementId
19
21
  ) {
20
22
  unseen
21
23
  seen