@quesmed/types 2.6.280 → 2.6.290

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,3 +1,6 @@
1
+ import { IMarksheetMark } from './Marksheet';
2
+ import { EProductType } from './Product';
3
+ import { Id } from './Type';
1
4
  export { CoverageTier, PostQuizBand } from '../resolvers/enums';
2
5
  export interface ISampleQuizMarkInput {
3
6
  id: number;
@@ -30,8 +33,17 @@ export interface ISampleQuizTopicBreakdown {
30
33
  percentage: number;
31
34
  eligible: boolean;
32
35
  }
36
+ export interface SampleQuizMark {
37
+ id: IMarksheetMark['id'];
38
+ result: IMarksheetMark['result'];
39
+ questionChoiceId: IMarksheetMark['questionId'];
40
+ mark: IMarksheetMark['mark'];
41
+ timeTaken: IMarksheetMark['timeTaken'];
42
+ }
33
43
  export interface ISampleQuizReport {
34
44
  id: string;
45
+ marksheetId: Id;
46
+ productId: EProductType;
35
47
  paperLength: number;
36
48
  attempted: number;
37
49
  correct: number;
@@ -1,6 +1,6 @@
1
1
  import { ApolloCache } from '@apollo/client';
2
2
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../..';
3
- import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IStationExaminerQuestion } from '../../../models';
3
+ import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IResultData, IStationExaminerQuestion } from '../../../models';
4
4
  import { IAssetBinding } from '../../../models/Picture';
5
5
  import { graphqlNormalize, RestrictedData } from '../../types';
6
6
  import { EOsceType } from '../../../models';
@@ -68,6 +68,12 @@ export interface IUpdateStationVar {
68
68
  };
69
69
  }
70
70
  export declare const updateCacheOnUpdateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateStationData>, options: ApolloUpdateOptions<IUpdateStationVar>) => void;
71
+ export declare const DELETE_STATION: import("@apollo/client").DocumentNode;
72
+ export interface IDeleteStationVar {
73
+ stationId: Id;
74
+ }
75
+ export type IDeleteStationData = RestrictedData<graphqlNormalize & IResultData, 'deleteStation'>;
76
+ export declare const updateCacheOnDeleteStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeleteStationData>, options: ApolloUpdateOptions<IDeleteStationVar>) => void;
71
77
  export interface IGenerateStationSession {
72
78
  sessionId: string;
73
79
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GENERATE_STATION = exports.updateCacheOnUpdateStation = exports.UPDATE_STATION = exports.updateCacheOnCreateStation = exports.CREATE_STATION = void 0;
3
+ exports.GENERATE_STATION = exports.updateCacheOnDeleteStation = exports.DELETE_STATION = exports.updateCacheOnUpdateStation = exports.UPDATE_STATION = exports.updateCacheOnCreateStation = exports.CREATE_STATION = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const osce_1 = require("../../fragments/osce");
6
6
  const restricted_1 = require("../../query/restricted");
@@ -79,6 +79,54 @@ const updateCacheOnUpdateStation = (cache, result, options) => {
79
79
  });
80
80
  };
81
81
  exports.updateCacheOnUpdateStation = updateCacheOnUpdateStation;
82
+ exports.DELETE_STATION = (0, client_1.gql) `
83
+ mutation DeleteStation($stationId: Int!) {
84
+ restricted {
85
+ deleteStation(stationId: $stationId) {
86
+ recordIds
87
+ logFile
88
+ batchId
89
+ status
90
+ data
91
+ message
92
+ errors
93
+ }
94
+ }
95
+ }
96
+ `;
97
+ const updateCacheOnDeleteStation = (cache, result, options) => {
98
+ const { deleteStation } = result?.data?.restricted || {};
99
+ const { variables } = options || {};
100
+ if (!variables || !deleteStation) {
101
+ return;
102
+ }
103
+ cache.evict({
104
+ id: cache.identify({
105
+ id: variables.stationId,
106
+ __typename: 'OsceStation',
107
+ }),
108
+ });
109
+ cache.gc();
110
+ const prevData = cache.readQuery({
111
+ variables: { solo: false },
112
+ query: restricted_1.OSCE_STATIONS,
113
+ });
114
+ if (prevData) {
115
+ const { osceStations } = prevData.restricted || {};
116
+ cache.writeQuery({
117
+ query: restricted_1.OSCE_STATIONS,
118
+ variables: { solo: false },
119
+ data: {
120
+ ...prevData,
121
+ restricted: {
122
+ ...prevData.restricted,
123
+ osceStations: osceStations?.filter((station) => station.id !== variables.stationId),
124
+ },
125
+ },
126
+ });
127
+ }
128
+ };
129
+ exports.updateCacheOnDeleteStation = updateCacheOnDeleteStation;
82
130
  exports.GENERATE_STATION = (0, client_1.gql) `
83
131
  mutation GenerateStation($input: GenerateStationInput!) {
84
132
  restricted {
@@ -108,6 +108,8 @@ exports.SAMPLE_QUIZ_REPORT = (0, client_1.gql) `
108
108
  id
109
109
  paperLength
110
110
  attempted
111
+ marksheetId
112
+ productId
111
113
  correct
112
114
  scorePercentage
113
115
  coverageTier
@@ -129,6 +131,13 @@ exports.SAMPLE_QUIZ_REPORT = (0, client_1.gql) `
129
131
  percentage
130
132
  eligible
131
133
  }
134
+ marks {
135
+ id
136
+ result
137
+ questionChoiceId
138
+ mark
139
+ timeTaken
140
+ }
132
141
  recommendedFocus
133
142
  createdAt
134
143
  promoCode
@@ -1,3 +1,6 @@
1
+ import { IMarksheetMark } from './Marksheet';
2
+ import { EProductType } from './Product';
3
+ import { Id } from './Type';
1
4
  export { CoverageTier, PostQuizBand } from '../resolvers/enums';
2
5
  export interface ISampleQuizMarkInput {
3
6
  id: number;
@@ -30,8 +33,17 @@ export interface ISampleQuizTopicBreakdown {
30
33
  percentage: number;
31
34
  eligible: boolean;
32
35
  }
36
+ export interface SampleQuizMark {
37
+ id: IMarksheetMark['id'];
38
+ result: IMarksheetMark['result'];
39
+ questionChoiceId: IMarksheetMark['questionId'];
40
+ mark: IMarksheetMark['mark'];
41
+ timeTaken: IMarksheetMark['timeTaken'];
42
+ }
33
43
  export interface ISampleQuizReport {
34
44
  id: string;
45
+ marksheetId: Id;
46
+ productId: EProductType;
35
47
  paperLength: number;
36
48
  attempted: number;
37
49
  correct: number;
@@ -1,6 +1,6 @@
1
1
  import { ApolloCache } from '@apollo/client';
2
2
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../..';
3
- import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IStationExaminerQuestion } from '../../../models';
3
+ import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IResultData, IStationExaminerQuestion } from '../../../models';
4
4
  import { IAssetBinding } from '../../../models/Picture';
5
5
  import { graphqlNormalize, RestrictedData } from '../../types';
6
6
  import { EOsceType } from '../../../models';
@@ -68,6 +68,12 @@ export interface IUpdateStationVar {
68
68
  };
69
69
  }
70
70
  export declare const updateCacheOnUpdateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateStationData>, options: ApolloUpdateOptions<IUpdateStationVar>) => void;
71
+ export declare const DELETE_STATION: import("@apollo/client").DocumentNode;
72
+ export interface IDeleteStationVar {
73
+ stationId: Id;
74
+ }
75
+ export type IDeleteStationData = RestrictedData<graphqlNormalize & IResultData, 'deleteStation'>;
76
+ export declare const updateCacheOnDeleteStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeleteStationData>, options: ApolloUpdateOptions<IDeleteStationVar>) => void;
71
77
  export interface IGenerateStationSession {
72
78
  sessionId: string;
73
79
  }
@@ -74,6 +74,53 @@ export const updateCacheOnUpdateStation = (cache, result, options) => {
74
74
  fragmentName: 'OsceStationFields',
75
75
  });
76
76
  };
77
+ export const DELETE_STATION = gql `
78
+ mutation DeleteStation($stationId: Int!) {
79
+ restricted {
80
+ deleteStation(stationId: $stationId) {
81
+ recordIds
82
+ logFile
83
+ batchId
84
+ status
85
+ data
86
+ message
87
+ errors
88
+ }
89
+ }
90
+ }
91
+ `;
92
+ export const updateCacheOnDeleteStation = (cache, result, options) => {
93
+ const { deleteStation } = result?.data?.restricted || {};
94
+ const { variables } = options || {};
95
+ if (!variables || !deleteStation) {
96
+ return;
97
+ }
98
+ cache.evict({
99
+ id: cache.identify({
100
+ id: variables.stationId,
101
+ __typename: 'OsceStation',
102
+ }),
103
+ });
104
+ cache.gc();
105
+ const prevData = cache.readQuery({
106
+ variables: { solo: false },
107
+ query: OSCE_STATIONS,
108
+ });
109
+ if (prevData) {
110
+ const { osceStations } = prevData.restricted || {};
111
+ cache.writeQuery({
112
+ query: OSCE_STATIONS,
113
+ variables: { solo: false },
114
+ data: {
115
+ ...prevData,
116
+ restricted: {
117
+ ...prevData.restricted,
118
+ osceStations: osceStations?.filter((station) => station.id !== variables.stationId),
119
+ },
120
+ },
121
+ });
122
+ }
123
+ };
77
124
  export const GENERATE_STATION = gql `
78
125
  mutation GenerateStation($input: GenerateStationInput!) {
79
126
  restricted {
@@ -105,6 +105,8 @@ export const SAMPLE_QUIZ_REPORT = gql `
105
105
  id
106
106
  paperLength
107
107
  attempted
108
+ marksheetId
109
+ productId
108
110
  correct
109
111
  scorePercentage
110
112
  coverageTier
@@ -126,6 +128,13 @@ export const SAMPLE_QUIZ_REPORT = gql `
126
128
  percentage
127
129
  eligible
128
130
  }
131
+ marks {
132
+ id
133
+ result
134
+ questionChoiceId
135
+ mark
136
+ timeTaken
137
+ }
129
138
  recommendedFocus
130
139
  createdAt
131
140
  promoCode
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.280",
3
+ "version": "2.6.290",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",