@quesmed/types-rn 2.6.15 → 2.6.17

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.
@@ -2,6 +2,7 @@ import { IConcept } from './Concept';
2
2
  import { EDifficultyType } from './Difficulty';
3
3
  import { IPaceScore } from './Paces';
4
4
  import { IPicture } from './Picture';
5
+ import { EProductType } from './Product';
5
6
  import { ITopic } from './Topic';
6
7
  import { Id } from './Type';
7
8
  import { EUserLearningStatus } from './User';
@@ -48,6 +49,7 @@ export interface IOsceStation {
48
49
  name: string;
49
50
  hiddenName: string;
50
51
  osceTypeId: Id;
52
+ productId: EProductType;
51
53
  osceType?: IOsceType;
52
54
  difficulty: EDifficultyType;
53
55
  candidateBrief: string;
@@ -75,6 +77,11 @@ export interface IOsceStationTopic {
75
77
  concept?: IConcept;
76
78
  osceStation?: IOsceStation;
77
79
  }
80
+ export interface IOsceStationProduct {
81
+ id: Id;
82
+ productId: Id;
83
+ stationId: Id;
84
+ }
78
85
  export declare const OSCE_GLOBAL_RATING: {
79
86
  [key: number]: string;
80
87
  };
@@ -19,7 +19,23 @@ export declare enum EProductType {
19
19
  DATA_INTERPRETATION = 16,
20
20
  CLINICAL_SUBSET = 17,
21
21
  CLINICAL_PROBLEM_SOLVING = 18,
22
- PROFESSIONAL_DILEMMA = 19
22
+ PROFESSIONAL_DILEMMA = 19,
23
+ HISTORY_TAKING = 20,
24
+ COMMUNICATION_SKILLS = 21,
25
+ EXAMINATION = 22,
26
+ PROCEDURE = 23,
27
+ INTERPRETATION = 24,
28
+ ABCDE = 25,
29
+ PRESCRIBING = 26,
30
+ MIXED = 27,
31
+ ABDOMINAL = 28,
32
+ CARDIOVASCULAR = 29,
33
+ COMMUNICATION = 30,
34
+ CONSULTATION = 31,
35
+ NEUROLOGY = 32,
36
+ RESPIRATORY = 33,
37
+ PLAB_QBANK = 34,
38
+ PLAB_OSCE = 35
23
39
  }
24
40
  export interface IProduct {
25
41
  id: Id;
@@ -36,7 +52,6 @@ export interface IProduct {
36
52
  export interface IProductType {
37
53
  id: Id;
38
54
  name: string;
39
- displayName: string;
40
55
  }
41
56
  export declare enum EAppType {
42
57
  AMS = 1,
@@ -70,5 +85,5 @@ export interface IProductStats {
70
85
  yellowCards?: number | null;
71
86
  redCards?: number | null;
72
87
  dailyFeedCards?: number | null;
73
- entitlements?: IEntitlementType[];
88
+ types?: IEntitlementType[];
74
89
  }
package/models/Product.js CHANGED
@@ -23,6 +23,22 @@ var EProductType;
23
23
  EProductType[EProductType["CLINICAL_SUBSET"] = 17] = "CLINICAL_SUBSET";
24
24
  EProductType[EProductType["CLINICAL_PROBLEM_SOLVING"] = 18] = "CLINICAL_PROBLEM_SOLVING";
25
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
+ EProductType[EProductType["PLAB_QBANK"] = 34] = "PLAB_QBANK";
41
+ EProductType[EProductType["PLAB_OSCE"] = 35] = "PLAB_OSCE";
26
42
  })(EProductType = exports.EProductType || (exports.EProductType = {}));
27
43
  var EAppType;
28
44
  (function (EAppType) {
package/models/Topic.d.ts CHANGED
@@ -29,19 +29,6 @@ export interface ITopicType {
29
29
  redCards?: number | null;
30
30
  dailyFeedCards?: number | null;
31
31
  }
32
- export interface ITopicStats {
33
- userId: number;
34
- totalQuestions?: number | null;
35
- completedQuestions?: number | null;
36
- correctQuestions?: number | null;
37
- incorrectQuestions?: number | null;
38
- totalCards?: number | null;
39
- greenCards?: number | null;
40
- yellowCards?: number | null;
41
- redCards?: number | null;
42
- dailyFeedCards?: number | null;
43
- types?: ITopicType[];
44
- }
45
32
  export interface ITopic {
46
33
  id: Id;
47
34
  createdAt: number | Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.15",
3
+ "version": "2.6.17",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -512,6 +512,28 @@ const removeCommnetFromDiscussion = (comments, commentId, parentId) => {
512
512
  }
513
513
  return comments.filter(({ id }) => Number(id) !== Number(commentId));
514
514
  };
515
+ const updateCommentFromDiscussion = (comments, commentId, update, parentId) => {
516
+ const updatedComments = [...comments];
517
+ if (parentId) {
518
+ const parentIndex = comments.findIndex((comment) => Number(comment.id) === Number(parentId));
519
+ if (parentIndex !== -1) {
520
+ const parentComment = updatedComments[parentIndex];
521
+ parentComment.replies = (parentComment.replies ?? []).map((reply) => Number(reply.id) === Number(commentId)
522
+ ? { ...reply, ...update }
523
+ : reply);
524
+ }
525
+ }
526
+ else {
527
+ const commentIndex = comments.findIndex((comment) => Number(comment.id) === Number(commentId));
528
+ if (commentIndex !== -1) {
529
+ updatedComments[commentIndex] = {
530
+ ...updatedComments[commentIndex],
531
+ ...update,
532
+ };
533
+ }
534
+ }
535
+ return updatedComments;
536
+ };
515
537
  exports.QUESTION_LIKE = (0, client_1.gql) `
516
538
  mutation QuestionLike($marksheetId: Int, $questionId: Int!, $like: Int!) {
517
539
  restricted {
@@ -757,7 +779,7 @@ const updateQuestionCommentsRemove = (typeId) => (cache, result, options) => {
757
779
  if (!variables || !questionCommentRemove) {
758
780
  return;
759
781
  }
760
- const { questionId, id: commentId, parentId } = questionCommentRemove;
782
+ const { questionId, id: commentId, parentId, userId, user, } = questionCommentRemove;
761
783
  try {
762
784
  const dataFragment = cache.readFragment({
763
785
  id: cache.identify({
@@ -775,7 +797,7 @@ const updateQuestionCommentsRemove = (typeId) => (cache, result, options) => {
775
797
  }),
776
798
  data: {
777
799
  ...dataFragment,
778
- comments: removeCommnetFromDiscussion(comments, commentId, parentId),
800
+ comments: updateCommentFromDiscussion(comments, commentId, { userId, user }, parentId),
779
801
  },
780
802
  fragment: getQuestionFragment(typeId),
781
803
  });
@@ -1,9 +1,8 @@
1
- import { EDifficultyType, EOsceType, EPaceType, Id, IDashboardOsce, IOsceMarksheet, IOsceStation, IOsceStats, IUser } from '../../../models';
1
+ import { EDifficultyType, Id, IDashboardOsce, IOsceMarksheet, IOsceStation, IOsceStats, IUser } from '../../../models';
2
2
  import { ESortOrder } from '../../enums';
3
3
  import { graphqlNormalize, RestrictedData } from '../../types';
4
4
  import { ITopic } from './../../../models/Topic';
5
5
  export interface IOsceStatsVar {
6
- typeId?: EOsceType[] | EPaceType[];
7
6
  solo: boolean;
8
7
  }
9
8
  export type IOsceStatsData = RestrictedData<graphqlNormalize & IOsceStats, 'osceStats'>;
@@ -52,7 +51,6 @@ export interface IOsceMarksheetVar {
52
51
  export type IOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'osceMarksheet'>;
53
52
  export declare const OSCE_STATIONS: import("@apollo/client").DocumentNode;
54
53
  export interface IOsceStationsVar {
55
- osceTypeId?: Id;
56
54
  solo: boolean;
57
55
  attempted?: boolean;
58
56
  difficulty?: EDifficultyType[];
@@ -5,9 +5,9 @@ const client_1 = require("@apollo/client");
5
5
  const osce_1 = require("../../fragments/osce");
6
6
  const osce_2 = require("./../../fragments/osce");
7
7
  exports.OSCE_STATS = (0, client_1.gql) `
8
- query OsceStats($solo: Boolean!, $typeId: [Int]) {
8
+ query OsceStats($solo: Boolean!) {
9
9
  restricted {
10
- osceStats(solo: $solo, typeId: $typeId) {
10
+ osceStats(solo: $solo) {
11
11
  avgScore
12
12
  completed
13
13
  total
@@ -107,7 +107,6 @@ exports.OSCE_MARKSHEET = (0, client_1.gql) `
107
107
  exports.OSCE_STATIONS = (0, client_1.gql) `
108
108
  ${osce_2.OSCE_STATION_FIELDS}
109
109
  query OsceStations(
110
- $osceTypeId: Int
111
110
  $solo: Boolean!
112
111
  $attempted: Boolean
113
112
  $difficulty: [Int!]
@@ -115,7 +114,6 @@ exports.OSCE_STATIONS = (0, client_1.gql) `
115
114
  ) {
116
115
  restricted {
117
116
  osceStations(
118
- osceTypeId: $osceTypeId
119
117
  solo: $solo
120
118
  attempted: $attempted
121
119
  difficulty: $difficulty
@@ -17,10 +17,9 @@ exports.PRODUCT_STATS = (0, client_1.gql) `
17
17
  yellowCards
18
18
  dailyFeedCards
19
19
 
20
- entitlements {
20
+ types {
21
21
  id
22
22
  name
23
- displayName
24
23
  totalQuestions
25
24
  completedQuestions
26
25
  correctQuestions
@@ -1,4 +1,4 @@
1
- import { EOsceType, EPaceType, ETopicType, IConcept, IOsceStation, ITopic } from '../../../models';
1
+ import { ETopicType, IConcept, IOsceStation, ITopic } from '../../../models';
2
2
  import { RestrictedData, graphqlNormalize } from '../../types';
3
3
  export type IQuesBookVar = {
4
4
  /**TODO: make it mandatory once frontend changes are completed */
@@ -9,15 +9,11 @@ export type IQuesBookData = RestrictedData<(graphqlNormalize & ITopic)[], 'quesB
9
9
  export declare const QBANK_KNOWLEDGE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
10
10
  export declare const PUBLIC_QBANK_KNOWLEDGE_LIBRARY: import("@apollo/client").DocumentNode;
11
11
  export type IOsceBookVar = {
12
- /**TODO: make it mandatory once frontend changes are completed */
13
- typeId?: EOsceType[] | EPaceType[];
14
12
  videosOnly?: boolean;
15
13
  };
16
14
  export type IOsceBookData = RestrictedData<(graphqlNormalize & IOsceStation)[], 'osceBook'>;
17
15
  export declare const OSCE_KNOWLEDGE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
18
- export type IPaceBookVar = {
19
- typeId?: EPaceType[];
20
- };
16
+ export type IPaceBookVar = null;
21
17
  export type IPaceBookData = RestrictedData<(graphqlNormalize & IConcept)[], 'paceBook'>;
22
18
  export declare const PACE_KNOWLEDGE_LIBRARY: import("@apollo/client").DocumentNode;
23
19
  export declare const PACE_VIDEO_LIBRARY: import("@apollo/client").DocumentNode;
@@ -125,9 +125,9 @@ exports.PUBLIC_QBANK_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
125
125
  `;
126
126
  exports.OSCE_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
127
127
  ${osce_1.OSCE_STATION_FIELDS}
128
- query OsceKnowledgeVideoLibrary($typeId: [Int], $videosOnly: Boolean) {
128
+ query OsceKnowledgeVideoLibrary($videosOnly: Boolean) {
129
129
  restricted {
130
- osceBook(typeId: $typeId, videosOnly: $videosOnly) {
130
+ osceBook(videosOnly: $videosOnly) {
131
131
  ...OsceStationFields
132
132
  lastOsceMarksheetId
133
133
  score
@@ -136,9 +136,9 @@ exports.OSCE_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
136
136
  }
137
137
  `;
138
138
  exports.PACE_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
139
- query PaceKnowledgeLibrary($typeId: [Int]) {
139
+ query PaceKnowledgeLibrary {
140
140
  restricted {
141
- paceBook(typeId: $typeId) {
141
+ paceBook {
142
142
  id
143
143
  name
144
144
  demo
@@ -182,9 +182,9 @@ query PaceKnowledgeLibrary($typeId: [Int]) {
182
182
  `;
183
183
  exports.PACE_VIDEO_LIBRARY = (0, client_1.gql) `
184
184
  ${osce_1.OSCE_STATION_FIELDS}
185
- query PaceVideoLibrary($typeId: [Int], $videosOnly: Boolean) {
185
+ query PaceVideoLibrary($videosOnly: Boolean) {
186
186
  restricted {
187
- osceBook(typeId: $typeId, videosOnly: $videosOnly) {
187
+ osceBook(videosOnly: $videosOnly) {
188
188
  ...OsceStationFields
189
189
  lastOsceMarksheetId
190
190
  score