@quesmed/types 2.6.52 → 2.6.53
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.
- package/dist/cjs/models/Marksheet.d.ts +1 -1
- package/dist/cjs/models/OsceMarksheet.d.ts +1 -1
- package/dist/cjs/models/OsceStation.d.ts +2 -2
- package/dist/cjs/models/Product.d.ts +1 -1
- package/dist/cjs/models/Question.d.ts +2 -2
- package/dist/cjs/models/Topic.d.ts +1 -2
- package/dist/cjs/resolvers/fragments/chapter.d.ts +1 -0
- package/dist/cjs/resolvers/fragments/chapter.js +12 -1
- package/dist/cjs/resolvers/mutation/restricted/chapter.d.ts +17 -0
- package/dist/cjs/resolvers/mutation/restricted/chapter.js +31 -1
- package/dist/cjs/resolvers/mutation/restricted/marksheet.d.ts +2 -2
- package/dist/cjs/resolvers/mutation/restricted/mockTest.d.ts +1 -1
- package/dist/cjs/resolvers/mutation/restricted/osce.d.ts +1 -1
- package/dist/mjs/models/Marksheet.d.ts +1 -1
- package/dist/mjs/models/OsceMarksheet.d.ts +1 -1
- package/dist/mjs/models/OsceStation.d.ts +2 -2
- package/dist/mjs/models/Product.d.ts +1 -1
- package/dist/mjs/models/Question.d.ts +2 -2
- package/dist/mjs/models/Topic.d.ts +1 -2
- package/dist/mjs/resolvers/fragments/chapter.d.ts +1 -0
- package/dist/mjs/resolvers/fragments/chapter.js +11 -0
- package/dist/mjs/resolvers/mutation/restricted/chapter.d.ts +17 -0
- package/dist/mjs/resolvers/mutation/restricted/chapter.js +28 -0
- package/dist/mjs/resolvers/mutation/restricted/marksheet.d.ts +2 -2
- package/dist/mjs/resolvers/mutation/restricted/mockTest.d.ts +1 -1
- package/dist/mjs/resolvers/mutation/restricted/osce.d.ts +1 -1
- package/package.json +1 -1
|
@@ -91,7 +91,7 @@ export interface IMarksheet {
|
|
|
91
91
|
topicConceptData?: string;
|
|
92
92
|
preBuildData?: IPreBuildMarksheet;
|
|
93
93
|
builderConfig?: IBuildConfigData;
|
|
94
|
-
|
|
94
|
+
entitlementId: EProductType;
|
|
95
95
|
}
|
|
96
96
|
export type IMarksheetMarkJSONB = string | [string] | [IQuestionQAAnswer] | [string[], string[]] | [IPrescribeMark] | null;
|
|
97
97
|
export interface IMarksheetMark {
|
|
@@ -78,9 +78,9 @@ export interface IOsceStationTopic {
|
|
|
78
78
|
concept?: IConcept;
|
|
79
79
|
osceStation?: IOsceStation;
|
|
80
80
|
}
|
|
81
|
-
export interface
|
|
81
|
+
export interface IOsceStationEntitlement {
|
|
82
82
|
id: Id;
|
|
83
|
-
|
|
83
|
+
entitlementId: Id;
|
|
84
84
|
stationId: Id;
|
|
85
85
|
}
|
|
86
86
|
export declare const OSCE_GLOBAL_RATING: {
|
|
@@ -153,9 +153,9 @@ export interface IPSAQuestionType {
|
|
|
153
153
|
id: Id;
|
|
154
154
|
name: string;
|
|
155
155
|
}
|
|
156
|
-
export interface
|
|
156
|
+
export interface IQuestionEntitlement {
|
|
157
157
|
id: Id;
|
|
158
|
-
|
|
158
|
+
entitlementId: Id;
|
|
159
159
|
questionId: Id;
|
|
160
160
|
}
|
|
161
161
|
export declare function isQuestionSBA(data: IQuestionAll): data is IQuestionSBA;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IConcept } from './Concept';
|
|
2
|
-
import {
|
|
2
|
+
import { IEntitlement } from './Product';
|
|
3
3
|
import { Id } from './Type';
|
|
4
4
|
export declare enum ETopicType {
|
|
5
5
|
ALL = 0,
|
|
@@ -38,7 +38,6 @@ export interface ITopic {
|
|
|
38
38
|
demo?: boolean;
|
|
39
39
|
entitlement: IEntitlement;
|
|
40
40
|
typeId: ETopicType | null;
|
|
41
|
-
productId: EProductType | null;
|
|
42
41
|
type?: ITopicType | null;
|
|
43
42
|
concepts?: IConcept[];
|
|
44
43
|
totalQuestions?: number | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHAPTER_FIELDS = void 0;
|
|
3
|
+
exports.UPSERT_CHAPTER_NOTE_FRAGMENT = exports.CHAPTER_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const picture_1 = require("./picture");
|
|
6
6
|
exports.CHAPTER_FIELDS = (0, client_1.gql) `
|
|
@@ -28,3 +28,14 @@ exports.CHAPTER_FIELDS = (0, client_1.gql) `
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
`;
|
|
31
|
+
exports.UPSERT_CHAPTER_NOTE_FRAGMENT = (0, client_1.gql) `
|
|
32
|
+
fragment UpsertChapterNoteFragment on Chapter {
|
|
33
|
+
userNote {
|
|
34
|
+
userId
|
|
35
|
+
chapterId
|
|
36
|
+
note
|
|
37
|
+
createdAt
|
|
38
|
+
updatedAt
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ApolloCache } from '@apollo/client';
|
|
1
2
|
import { IUserChapterNote } from '../../../models';
|
|
3
|
+
import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
|
|
2
4
|
import { RestrictedData } from '../../types';
|
|
3
5
|
export declare const UPSERT_CHAPTER_NOTE: import("@apollo/client").DocumentNode;
|
|
4
6
|
export interface IUpsertChapterNoteVar {
|
|
@@ -6,3 +8,18 @@ export interface IUpsertChapterNoteVar {
|
|
|
6
8
|
note: string;
|
|
7
9
|
}
|
|
8
10
|
export type IUpsertChapterNoteData = RestrictedData<IUserChapterNote, 'upsertChapterNote'>;
|
|
11
|
+
export declare const updateCacheOnUpsertChapterNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertChapterNoteData>, options: ApolloUpdateOptions<IUpsertChapterNoteVar>) => void;
|
|
12
|
+
export declare const optimisticUpsertChapterNote: (data: IUpsertChapterNoteVar & {
|
|
13
|
+
userId: number;
|
|
14
|
+
}) => {
|
|
15
|
+
restricted: {
|
|
16
|
+
upsertChapterNote: {
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
chapterId: number;
|
|
20
|
+
note: string;
|
|
21
|
+
userId: number;
|
|
22
|
+
__typename: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPSERT_CHAPTER_NOTE = void 0;
|
|
3
|
+
exports.optimisticUpsertChapterNote = exports.updateCacheOnUpsertChapterNote = exports.UPSERT_CHAPTER_NOTE = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
|
+
const fragments_1 = require("../../fragments");
|
|
5
6
|
exports.UPSERT_CHAPTER_NOTE = (0, client_1.gql) `
|
|
6
7
|
mutation UpsertChapterNote($chapterId: Int!, $note: String!) {
|
|
7
8
|
restricted {
|
|
@@ -16,3 +17,32 @@ exports.UPSERT_CHAPTER_NOTE = (0, client_1.gql) `
|
|
|
16
17
|
}
|
|
17
18
|
}
|
|
18
19
|
`;
|
|
20
|
+
const updateCacheOnUpsertChapterNote = (cache, result, options) => {
|
|
21
|
+
const { upsertChapterNote } = result?.data?.restricted || {};
|
|
22
|
+
const { variables } = options || {};
|
|
23
|
+
if (!variables || !upsertChapterNote) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const { id, ...updatedData } = upsertChapterNote;
|
|
27
|
+
cache.writeFragment({
|
|
28
|
+
id: cache.identify({ id, __typename: 'UserChapterNote' }),
|
|
29
|
+
data: {
|
|
30
|
+
...updatedData,
|
|
31
|
+
},
|
|
32
|
+
fragment: fragments_1.UPSERT_CHAPTER_NOTE_FRAGMENT,
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
exports.updateCacheOnUpsertChapterNote = updateCacheOnUpsertChapterNote;
|
|
36
|
+
const optimisticUpsertChapterNote = (data) => {
|
|
37
|
+
return {
|
|
38
|
+
restricted: {
|
|
39
|
+
upsertChapterNote: {
|
|
40
|
+
__typename: 'UserChapterNote',
|
|
41
|
+
...data,
|
|
42
|
+
createdAt: new Date(),
|
|
43
|
+
updatedAt: new Date(),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
exports.optimisticUpsertChapterNote = optimisticUpsertChapterNote;
|
|
@@ -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
|
-
|
|
191
|
+
entitlementId: import("../../../models").EProductType;
|
|
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
|
-
|
|
284
|
+
entitlementId: import("../../../models").EProductType;
|
|
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
|
-
|
|
81
|
+
entitlementId: import("../../../models").EProductType;
|
|
82
82
|
__typename: string;
|
|
83
83
|
};
|
|
84
84
|
};
|
|
@@ -129,7 +129,7 @@ export declare const optimisticEndOsceMarksheet: (marksheet: IOsceMarksheet) =>
|
|
|
129
129
|
activeUsers?: import("../../../models").IUser[] | undefined;
|
|
130
130
|
members: import("../../../models").IOsceMarksheetMember[];
|
|
131
131
|
state: EOsceMarksheetState;
|
|
132
|
-
|
|
132
|
+
entitlementId: EProductType;
|
|
133
133
|
isTimed: boolean;
|
|
134
134
|
__typename: string;
|
|
135
135
|
};
|
|
@@ -91,7 +91,7 @@ export interface IMarksheet {
|
|
|
91
91
|
topicConceptData?: string;
|
|
92
92
|
preBuildData?: IPreBuildMarksheet;
|
|
93
93
|
builderConfig?: IBuildConfigData;
|
|
94
|
-
|
|
94
|
+
entitlementId: EProductType;
|
|
95
95
|
}
|
|
96
96
|
export type IMarksheetMarkJSONB = string | [string] | [IQuestionQAAnswer] | [string[], string[]] | [IPrescribeMark] | null;
|
|
97
97
|
export interface IMarksheetMark {
|
|
@@ -78,9 +78,9 @@ export interface IOsceStationTopic {
|
|
|
78
78
|
concept?: IConcept;
|
|
79
79
|
osceStation?: IOsceStation;
|
|
80
80
|
}
|
|
81
|
-
export interface
|
|
81
|
+
export interface IOsceStationEntitlement {
|
|
82
82
|
id: Id;
|
|
83
|
-
|
|
83
|
+
entitlementId: Id;
|
|
84
84
|
stationId: Id;
|
|
85
85
|
}
|
|
86
86
|
export declare const OSCE_GLOBAL_RATING: {
|
|
@@ -153,9 +153,9 @@ export interface IPSAQuestionType {
|
|
|
153
153
|
id: Id;
|
|
154
154
|
name: string;
|
|
155
155
|
}
|
|
156
|
-
export interface
|
|
156
|
+
export interface IQuestionEntitlement {
|
|
157
157
|
id: Id;
|
|
158
|
-
|
|
158
|
+
entitlementId: Id;
|
|
159
159
|
questionId: Id;
|
|
160
160
|
}
|
|
161
161
|
export declare function isQuestionSBA(data: IQuestionAll): data is IQuestionSBA;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IConcept } from './Concept';
|
|
2
|
-
import {
|
|
2
|
+
import { IEntitlement } from './Product';
|
|
3
3
|
import { Id } from './Type';
|
|
4
4
|
export declare enum ETopicType {
|
|
5
5
|
ALL = 0,
|
|
@@ -38,7 +38,6 @@ export interface ITopic {
|
|
|
38
38
|
demo?: boolean;
|
|
39
39
|
entitlement: IEntitlement;
|
|
40
40
|
typeId: ETopicType | null;
|
|
41
|
-
productId: EProductType | null;
|
|
42
41
|
type?: ITopicType | null;
|
|
43
42
|
concepts?: IConcept[];
|
|
44
43
|
totalQuestions?: number | null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ApolloCache } from '@apollo/client';
|
|
1
2
|
import { IUserChapterNote } from '../../../models';
|
|
3
|
+
import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
|
|
2
4
|
import { RestrictedData } from '../../types';
|
|
3
5
|
export declare const UPSERT_CHAPTER_NOTE: import("@apollo/client").DocumentNode;
|
|
4
6
|
export interface IUpsertChapterNoteVar {
|
|
@@ -6,3 +8,18 @@ export interface IUpsertChapterNoteVar {
|
|
|
6
8
|
note: string;
|
|
7
9
|
}
|
|
8
10
|
export type IUpsertChapterNoteData = RestrictedData<IUserChapterNote, 'upsertChapterNote'>;
|
|
11
|
+
export declare const updateCacheOnUpsertChapterNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertChapterNoteData>, options: ApolloUpdateOptions<IUpsertChapterNoteVar>) => void;
|
|
12
|
+
export declare const optimisticUpsertChapterNote: (data: IUpsertChapterNoteVar & {
|
|
13
|
+
userId: number;
|
|
14
|
+
}) => {
|
|
15
|
+
restricted: {
|
|
16
|
+
upsertChapterNote: {
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
chapterId: number;
|
|
20
|
+
note: string;
|
|
21
|
+
userId: number;
|
|
22
|
+
__typename: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
|
+
import { UPSERT_CHAPTER_NOTE_FRAGMENT } from '../../fragments';
|
|
2
3
|
export const UPSERT_CHAPTER_NOTE = gql `
|
|
3
4
|
mutation UpsertChapterNote($chapterId: Int!, $note: String!) {
|
|
4
5
|
restricted {
|
|
@@ -13,3 +14,30 @@ export const UPSERT_CHAPTER_NOTE = gql `
|
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
`;
|
|
17
|
+
export const updateCacheOnUpsertChapterNote = (cache, result, options) => {
|
|
18
|
+
const { upsertChapterNote } = result?.data?.restricted || {};
|
|
19
|
+
const { variables } = options || {};
|
|
20
|
+
if (!variables || !upsertChapterNote) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const { id, ...updatedData } = upsertChapterNote;
|
|
24
|
+
cache.writeFragment({
|
|
25
|
+
id: cache.identify({ id, __typename: 'UserChapterNote' }),
|
|
26
|
+
data: {
|
|
27
|
+
...updatedData,
|
|
28
|
+
},
|
|
29
|
+
fragment: UPSERT_CHAPTER_NOTE_FRAGMENT,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export const optimisticUpsertChapterNote = (data) => {
|
|
33
|
+
return {
|
|
34
|
+
restricted: {
|
|
35
|
+
upsertChapterNote: {
|
|
36
|
+
__typename: 'UserChapterNote',
|
|
37
|
+
...data,
|
|
38
|
+
createdAt: new Date(),
|
|
39
|
+
updatedAt: new Date(),
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -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
|
-
|
|
191
|
+
entitlementId: import("../../../models").EProductType;
|
|
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
|
-
|
|
284
|
+
entitlementId: import("../../../models").EProductType;
|
|
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
|
-
|
|
81
|
+
entitlementId: import("../../../models").EProductType;
|
|
82
82
|
__typename: string;
|
|
83
83
|
};
|
|
84
84
|
};
|
|
@@ -129,7 +129,7 @@ export declare const optimisticEndOsceMarksheet: (marksheet: IOsceMarksheet) =>
|
|
|
129
129
|
activeUsers?: import("../../../models").IUser[] | undefined;
|
|
130
130
|
members: import("../../../models").IOsceMarksheetMember[];
|
|
131
131
|
state: EOsceMarksheetState;
|
|
132
|
-
|
|
132
|
+
entitlementId: EProductType;
|
|
133
133
|
isTimed: boolean;
|
|
134
134
|
__typename: string;
|
|
135
135
|
};
|