@quesmed/types 2.6.83 → 2.6.85

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.
@@ -20,8 +20,9 @@ export declare enum IAccessLevel {
20
20
  EXPIRED = "expired"
21
21
  }
22
22
  export declare enum ETheme {
23
- LIGHT = 0,
24
- DARK = 1
23
+ AUTO = 0,
24
+ LIGHT = 1,
25
+ DARK = 2
25
26
  }
26
27
  export type IClassYear = 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Graduated' | 'PhD' | 'BSc' | 'MSc' | 'Beta Tester';
27
28
  export declare const classYears: IClassYear[];
@@ -13,8 +13,9 @@ var IAccessLevel;
13
13
  })(IAccessLevel = exports.IAccessLevel || (exports.IAccessLevel = {}));
14
14
  var ETheme;
15
15
  (function (ETheme) {
16
- ETheme[ETheme["LIGHT"] = 0] = "LIGHT";
17
- ETheme[ETheme["DARK"] = 1] = "DARK";
16
+ ETheme[ETheme["AUTO"] = 0] = "AUTO";
17
+ ETheme[ETheme["LIGHT"] = 1] = "LIGHT";
18
+ ETheme[ETheme["DARK"] = 2] = "DARK";
18
19
  })(ETheme = exports.ETheme || (exports.ETheme = {}));
19
20
  exports.classYears = [
20
21
  'Year 1',
@@ -1,11 +1,11 @@
1
- import { EMockTestType, EProductType, ETopicType } from '../models';
1
+ import { EMockTestType, EOsceType, EPaceType, EProductType, ETopicType } from '../models';
2
2
  import { DB_TYPE } from './enums';
3
3
  export declare const productMapping: Partial<Record<EProductType, {
4
4
  db: DB_TYPE;
5
5
  topicType: ETopicType[];
6
6
  mockType: EMockTestType[];
7
7
  }>>;
8
- export declare const getEntitlementFromTopicType: (topicType: ETopicType, productType: EProductType) => {
8
+ export declare const getEntitlementFromTopicType: (typeId: ETopicType | EOsceType | EPaceType, productType: EProductType) => {
9
9
  id: number;
10
10
  name: string;
11
11
  };
@@ -114,6 +114,24 @@ const topicEntitlementMap = {
114
114
  [models_1.ETopicType.INTERVIEW_IMT]: models_1.EEntitlementType.INTERVIEW_IMT,
115
115
  [models_1.ETopicType.INTERVIEW_RADIOLOGY]: models_1.EEntitlementType.INTERVIEW_RADIOLOGY,
116
116
  };
117
+ const osceEntitlementMap = {
118
+ [models_1.EOsceType.HISTORY_TAKING]: models_1.EEntitlementType.HISTORY_TAKING,
119
+ [models_1.EOsceType.COMMUNICATION_SKILLS]: models_1.EEntitlementType.COMMUNICATION_SKILLS,
120
+ [models_1.EOsceType.EXAMINATION]: models_1.EEntitlementType.EXAMINATION,
121
+ [models_1.EOsceType.PROCEDURE]: models_1.EEntitlementType.PROCEDURE,
122
+ [models_1.EOsceType.INTERPRETATION]: models_1.EEntitlementType.INTERPRETATION,
123
+ [models_1.EOsceType.ABCDE]: models_1.EEntitlementType.ABCDE,
124
+ [models_1.EOsceType.PRESCRIBING]: models_1.EEntitlementType.PRESCRIBING,
125
+ [models_1.EOsceType.MIXED]: models_1.EEntitlementType.MIXED,
126
+ };
127
+ const paceEntitlementMap = {
128
+ [models_1.EPaceType.ABDOMINAL]: models_1.EEntitlementType.ABDOMINAL,
129
+ [models_1.EPaceType.CARDIOVASCULAR]: models_1.EEntitlementType.CARDIOVASCULAR,
130
+ [models_1.EPaceType.COMMUNICATION]: models_1.EEntitlementType.COMMUNICATION,
131
+ [models_1.EPaceType.CONSULTATION]: models_1.EEntitlementType.CONSULTATION,
132
+ [models_1.EPaceType.NEUROLOGY]: models_1.EEntitlementType.NEUROLOGY,
133
+ [models_1.EPaceType.RESPIRATORY]: models_1.EEntitlementType.RESPIRATORY,
134
+ };
117
135
  const clinicalEntitlementMap = {
118
136
  [models_1.EProductType.MEDICAL_SCIENCES]: models_1.EEntitlementType.CLINICAL_SUBSET,
119
137
  [models_1.EProductType.QBANK]: models_1.EEntitlementType.CLINICAL,
@@ -122,10 +140,26 @@ const clinicalEntitlementMap = {
122
140
  [models_1.EProductType.MRCP_PART1]: models_1.EEntitlementType.MRCP_PART_1,
123
141
  [models_1.EProductType.MRCP_PART2]: models_1.EEntitlementType.MRCP_PART_2,
124
142
  };
125
- const getEntitlementFromTopicType = (topicType, productType) => {
126
- const entitlement = topicType === models_1.ETopicType.CLINICAL
127
- ? clinicalEntitlementMap[productType]
128
- : topicEntitlementMap[topicType];
143
+ const getEntitlementFromTopicType = (typeId, productType) => {
144
+ let entitlement;
145
+ switch (productType) {
146
+ case models_1.EProductType.PACES: {
147
+ entitlement = paceEntitlementMap[typeId];
148
+ break;
149
+ }
150
+ case models_1.EProductType.OSCE:
151
+ case models_1.EProductType.PLAB2: {
152
+ entitlement = osceEntitlementMap[typeId];
153
+ break;
154
+ }
155
+ default: {
156
+ entitlement =
157
+ typeId === models_1.ETopicType.CLINICAL
158
+ ? clinicalEntitlementMap[productType]
159
+ : topicEntitlementMap[typeId];
160
+ break;
161
+ }
162
+ }
129
163
  if (!entitlement) {
130
164
  return { id: 0, name: 'Unknown' };
131
165
  }
@@ -0,0 +1,7 @@
1
+ import { graphqlNormalize, RestrictedData } from '../../types';
2
+ import { IChapter } from '../../../models';
3
+ export interface IChapterVar {
4
+ id: number;
5
+ }
6
+ export type IChapterData = RestrictedData<graphqlNormalize & IChapter, 'chapter'>;
7
+ export declare const CHAPTER: import("@apollo/client").DocumentNode;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAPTER = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.CHAPTER = (0, client_1.gql) `
6
+ query chapter($id: Int!) {
7
+ restricted {
8
+ chapter(id: $id) {
9
+ id
10
+ explanation
11
+ }
12
+ }
13
+ }
14
+ `;
@@ -1,4 +1,4 @@
1
- export * from './conceptExplanation';
1
+ export * from './chapter';
2
2
  export * from './concepts';
3
3
  export * from './global';
4
4
  export * from './marksheet';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./conceptExplanation"), exports);
17
+ __exportStar(require("./chapter"), exports);
18
18
  __exportStar(require("./concepts"), exports);
19
19
  __exportStar(require("./global"), exports);
20
20
  __exportStar(require("./marksheet"), exports);
@@ -20,8 +20,9 @@ export declare enum IAccessLevel {
20
20
  EXPIRED = "expired"
21
21
  }
22
22
  export declare enum ETheme {
23
- LIGHT = 0,
24
- DARK = 1
23
+ AUTO = 0,
24
+ LIGHT = 1,
25
+ DARK = 2
25
26
  }
26
27
  export type IClassYear = 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Graduated' | 'PhD' | 'BSc' | 'MSc' | 'Beta Tester';
27
28
  export declare const classYears: IClassYear[];
@@ -10,8 +10,9 @@ export var IAccessLevel;
10
10
  })(IAccessLevel || (IAccessLevel = {}));
11
11
  export var ETheme;
12
12
  (function (ETheme) {
13
- ETheme[ETheme["LIGHT"] = 0] = "LIGHT";
14
- ETheme[ETheme["DARK"] = 1] = "DARK";
13
+ ETheme[ETheme["AUTO"] = 0] = "AUTO";
14
+ ETheme[ETheme["LIGHT"] = 1] = "LIGHT";
15
+ ETheme[ETheme["DARK"] = 2] = "DARK";
15
16
  })(ETheme || (ETheme = {}));
16
17
  export const classYears = [
17
18
  'Year 1',
@@ -1,11 +1,11 @@
1
- import { EMockTestType, EProductType, ETopicType } from '../models';
1
+ import { EMockTestType, EOsceType, EPaceType, EProductType, ETopicType } from '../models';
2
2
  import { DB_TYPE } from './enums';
3
3
  export declare const productMapping: Partial<Record<EProductType, {
4
4
  db: DB_TYPE;
5
5
  topicType: ETopicType[];
6
6
  mockType: EMockTestType[];
7
7
  }>>;
8
- export declare const getEntitlementFromTopicType: (topicType: ETopicType, productType: EProductType) => {
8
+ export declare const getEntitlementFromTopicType: (typeId: ETopicType | EOsceType | EPaceType, productType: EProductType) => {
9
9
  id: number;
10
10
  name: string;
11
11
  };
@@ -1,4 +1,4 @@
1
- import { EEntitlementType, EMockTestType, EProductType, ETopicType, } from '../models';
1
+ import { EEntitlementType, EMockTestType, EOsceType, EPaceType, EProductType, ETopicType, } from '../models';
2
2
  import { titleCase } from '../utils';
3
3
  import { DB_TYPE } from './enums';
4
4
  const ALL_TOPIC_TYPE_WITHOUT_ANATOMY = [
@@ -111,6 +111,24 @@ const topicEntitlementMap = {
111
111
  [ETopicType.INTERVIEW_IMT]: EEntitlementType.INTERVIEW_IMT,
112
112
  [ETopicType.INTERVIEW_RADIOLOGY]: EEntitlementType.INTERVIEW_RADIOLOGY,
113
113
  };
114
+ const osceEntitlementMap = {
115
+ [EOsceType.HISTORY_TAKING]: EEntitlementType.HISTORY_TAKING,
116
+ [EOsceType.COMMUNICATION_SKILLS]: EEntitlementType.COMMUNICATION_SKILLS,
117
+ [EOsceType.EXAMINATION]: EEntitlementType.EXAMINATION,
118
+ [EOsceType.PROCEDURE]: EEntitlementType.PROCEDURE,
119
+ [EOsceType.INTERPRETATION]: EEntitlementType.INTERPRETATION,
120
+ [EOsceType.ABCDE]: EEntitlementType.ABCDE,
121
+ [EOsceType.PRESCRIBING]: EEntitlementType.PRESCRIBING,
122
+ [EOsceType.MIXED]: EEntitlementType.MIXED,
123
+ };
124
+ const paceEntitlementMap = {
125
+ [EPaceType.ABDOMINAL]: EEntitlementType.ABDOMINAL,
126
+ [EPaceType.CARDIOVASCULAR]: EEntitlementType.CARDIOVASCULAR,
127
+ [EPaceType.COMMUNICATION]: EEntitlementType.COMMUNICATION,
128
+ [EPaceType.CONSULTATION]: EEntitlementType.CONSULTATION,
129
+ [EPaceType.NEUROLOGY]: EEntitlementType.NEUROLOGY,
130
+ [EPaceType.RESPIRATORY]: EEntitlementType.RESPIRATORY,
131
+ };
114
132
  const clinicalEntitlementMap = {
115
133
  [EProductType.MEDICAL_SCIENCES]: EEntitlementType.CLINICAL_SUBSET,
116
134
  [EProductType.QBANK]: EEntitlementType.CLINICAL,
@@ -119,10 +137,26 @@ const clinicalEntitlementMap = {
119
137
  [EProductType.MRCP_PART1]: EEntitlementType.MRCP_PART_1,
120
138
  [EProductType.MRCP_PART2]: EEntitlementType.MRCP_PART_2,
121
139
  };
122
- export const getEntitlementFromTopicType = (topicType, productType) => {
123
- const entitlement = topicType === ETopicType.CLINICAL
124
- ? clinicalEntitlementMap[productType]
125
- : topicEntitlementMap[topicType];
140
+ export const getEntitlementFromTopicType = (typeId, productType) => {
141
+ let entitlement;
142
+ switch (productType) {
143
+ case EProductType.PACES: {
144
+ entitlement = paceEntitlementMap[typeId];
145
+ break;
146
+ }
147
+ case EProductType.OSCE:
148
+ case EProductType.PLAB2: {
149
+ entitlement = osceEntitlementMap[typeId];
150
+ break;
151
+ }
152
+ default: {
153
+ entitlement =
154
+ typeId === ETopicType.CLINICAL
155
+ ? clinicalEntitlementMap[productType]
156
+ : topicEntitlementMap[typeId];
157
+ break;
158
+ }
159
+ }
126
160
  if (!entitlement) {
127
161
  return { id: 0, name: 'Unknown' };
128
162
  }
@@ -0,0 +1,7 @@
1
+ import { graphqlNormalize, RestrictedData } from '../../types';
2
+ import { IChapter } from '../../../models';
3
+ export interface IChapterVar {
4
+ id: number;
5
+ }
6
+ export type IChapterData = RestrictedData<graphqlNormalize & IChapter, 'chapter'>;
7
+ export declare const CHAPTER: import("@apollo/client").DocumentNode;
@@ -0,0 +1,11 @@
1
+ import { gql } from '@apollo/client';
2
+ export const CHAPTER = gql `
3
+ query chapter($id: Int!) {
4
+ restricted {
5
+ chapter(id: $id) {
6
+ id
7
+ explanation
8
+ }
9
+ }
10
+ }
11
+ `;
@@ -1,4 +1,4 @@
1
- export * from './conceptExplanation';
1
+ export * from './chapter';
2
2
  export * from './concepts';
3
3
  export * from './global';
4
4
  export * from './marksheet';
@@ -1,4 +1,4 @@
1
- export * from './conceptExplanation';
1
+ export * from './chapter';
2
2
  export * from './concepts';
3
3
  export * from './global';
4
4
  export * from './marksheet';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.83",
3
+ "version": "2.6.85",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -1,12 +0,0 @@
1
- import { graphqlNormalize, RestrictedData } from '../../types';
2
- export interface IQuesBookDict {
3
- topicId: number;
4
- conceptId: number;
5
- chapterId: number;
6
- explanation: string;
7
- }
8
- export interface IConceptExplanationVar {
9
- chapterId: number;
10
- }
11
- export type IConceptExplanationData = RestrictedData<graphqlNormalize & string, 'conceptExplanation'>;
12
- export declare const CONCEPT_EXPLANATION: import("@apollo/client").DocumentNode;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONCEPT_EXPLANATION = void 0;
4
- const client_1 = require("@apollo/client");
5
- exports.CONCEPT_EXPLANATION = (0, client_1.gql) `
6
- query conceptExplanation($chapterId: Int!) {
7
- restricted {
8
- conceptExplanation(chapterId: $chapterId)
9
- }
10
- }
11
- `;
@@ -1,12 +0,0 @@
1
- import { graphqlNormalize, RestrictedData } from '../../types';
2
- export interface IQuesBookDict {
3
- topicId: number;
4
- conceptId: number;
5
- chapterId: number;
6
- explanation: string;
7
- }
8
- export interface IConceptExplanationVar {
9
- chapterId: number;
10
- }
11
- export type IConceptExplanationData = RestrictedData<graphqlNormalize & string, 'conceptExplanation'>;
12
- export declare const CONCEPT_EXPLANATION: import("@apollo/client").DocumentNode;
@@ -1,8 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- export const CONCEPT_EXPLANATION = gql `
3
- query conceptExplanation($chapterId: Int!) {
4
- restricted {
5
- conceptExplanation(chapterId: $chapterId)
6
- }
7
- }
8
- `;