@quesmed/types-rn 2.6.52 → 2.6.54
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/models/Marksheet.d.ts +1 -1
- package/models/OsceMarksheet.d.ts +1 -1
- package/models/OsceStation.d.ts +2 -2
- package/models/Product.d.ts +1 -1
- package/models/Question.d.ts +2 -2
- package/models/Topic.d.ts +1 -2
- package/package.json +1 -1
- package/resolvers/fragments/chapter.d.ts +1 -0
- package/resolvers/fragments/chapter.js +12 -1
- package/resolvers/mutation/restricted/chapter.d.ts +17 -0
- package/resolvers/mutation/restricted/chapter.js +33 -1
- package/resolvers/mutation/restricted/marksheet.d.ts +2 -2
- package/resolvers/mutation/restricted/mockTest.d.ts +1 -1
- package/resolvers/mutation/restricted/osce.d.ts +1 -1
package/models/Marksheet.d.ts
CHANGED
|
@@ -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 {
|
package/models/OsceStation.d.ts
CHANGED
|
@@ -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: {
|
package/models/Product.d.ts
CHANGED
package/models/Question.d.ts
CHANGED
|
@@ -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;
|
package/models/Topic.d.ts
CHANGED
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -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,34 @@ 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
|
+
cache.writeFragment({
|
|
27
|
+
id: cache.identify({
|
|
28
|
+
id: variables.chapterId,
|
|
29
|
+
__typename: 'Chapter',
|
|
30
|
+
}),
|
|
31
|
+
data: {
|
|
32
|
+
userNote: upsertChapterNote,
|
|
33
|
+
},
|
|
34
|
+
fragment: fragments_1.UPSERT_CHAPTER_NOTE_FRAGMENT,
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.updateCacheOnUpsertChapterNote = updateCacheOnUpsertChapterNote;
|
|
38
|
+
const optimisticUpsertChapterNote = (data) => {
|
|
39
|
+
return {
|
|
40
|
+
restricted: {
|
|
41
|
+
upsertChapterNote: {
|
|
42
|
+
__typename: 'UserChapterNote',
|
|
43
|
+
...data,
|
|
44
|
+
createdAt: new Date(),
|
|
45
|
+
updatedAt: new Date(),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
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
|
};
|