@quesmed/types-rn 2.6.76 → 2.6.78
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/Chapter.d.ts +0 -2
- package/models/Concept.d.ts +2 -0
- package/models/Note.d.ts +4 -4
- package/package.json +1 -1
- package/resolvers/fragments/chapter.d.ts +0 -1
- package/resolvers/fragments/chapter.js +1 -20
- package/resolvers/fragments/concept.d.ts +1 -0
- package/resolvers/fragments/concept.js +20 -1
- package/resolvers/mutation/restricted/chapter.d.ts +1 -15
- package/resolvers/mutation/restricted/chapter.js +1 -59
- package/resolvers/mutation/restricted/index.d.ts +1 -0
- package/resolvers/mutation/restricted/index.js +1 -0
- package/resolvers/mutation/restricted/notes.d.ts +31 -0
- package/resolvers/mutation/restricted/notes.js +114 -0
- package/resolvers/mutation/restricted/osce.d.ts +1 -14
- package/resolvers/mutation/restricted/osce.js +1 -51
- package/resolvers/query/restricted/concepts.js +7 -0
- package/resolvers/query/restricted/index.d.ts +1 -0
- package/resolvers/query/restricted/index.js +1 -0
- package/resolvers/query/restricted/notes.d.ts +16 -0
- package/resolvers/query/restricted/notes.js +44 -0
- package/resolvers/query/restricted/quesBook.js +14 -0
- package/resolvers/query/restricted/video.js +7 -0
package/models/Chapter.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IFile } from './File';
|
|
2
2
|
import { IHighlightNode } from './Highlight';
|
|
3
|
-
import { IUserChapterNote } from './Note';
|
|
4
3
|
import { IPicture } from './Picture';
|
|
5
4
|
import { ETopicType } from './Topic';
|
|
6
5
|
import { Id } from './Type';
|
|
@@ -13,6 +12,5 @@ export interface IChapter {
|
|
|
13
12
|
typeId: ETopicType | null;
|
|
14
13
|
pictures?: IPicture[];
|
|
15
14
|
files?: IFile[];
|
|
16
|
-
userNote: null | IUserChapterNote;
|
|
17
15
|
highlights?: IHighlightNode[];
|
|
18
16
|
}
|
package/models/Concept.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IChapter } from './Chapter';
|
|
2
|
+
import { IUserConceptNote } from './Note';
|
|
2
3
|
import { EPaceType } from './Paces';
|
|
3
4
|
import { IEntitlement } from './Product';
|
|
4
5
|
import { ITopic } from './Topic';
|
|
@@ -28,4 +29,5 @@ export interface IConcept {
|
|
|
28
29
|
redCards?: number | null;
|
|
29
30
|
dailyFeedCards?: number | null;
|
|
30
31
|
status?: EUserLearningStatus | null;
|
|
32
|
+
userNote: null | IUserConceptNote;
|
|
31
33
|
}
|
package/models/Note.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IConcept } from './Concept';
|
|
2
2
|
import { IOsceStation } from './OsceStation';
|
|
3
3
|
import { Id } from './Type';
|
|
4
4
|
export interface IUserNote {
|
|
@@ -8,9 +8,9 @@ export interface IUserNote {
|
|
|
8
8
|
userId: Id;
|
|
9
9
|
note: string;
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export interface IUserConceptNote extends IUserNote {
|
|
12
|
+
conceptId: Id;
|
|
13
|
+
concept: IConcept;
|
|
14
14
|
}
|
|
15
15
|
export interface IUserStationNote extends IUserNote {
|
|
16
16
|
stationId: Id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHAPTER_WITH_HIGHLIGHT_FIELDS = exports.
|
|
3
|
+
exports.CHAPTER_WITH_HIGHLIGHT_FIELDS = exports.CHAPTER_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const picture_1 = require("./picture");
|
|
6
6
|
const highlight_1 = require("./highlight");
|
|
@@ -17,13 +17,6 @@ exports.CHAPTER_FIELDS = (0, client_1.gql) `
|
|
|
17
17
|
highlights {
|
|
18
18
|
...HighlightFields
|
|
19
19
|
}
|
|
20
|
-
userNote {
|
|
21
|
-
id
|
|
22
|
-
userId
|
|
23
|
-
chapterId
|
|
24
|
-
note
|
|
25
|
-
updatedAt
|
|
26
|
-
}
|
|
27
20
|
files {
|
|
28
21
|
id
|
|
29
22
|
title
|
|
@@ -34,18 +27,6 @@ exports.CHAPTER_FIELDS = (0, client_1.gql) `
|
|
|
34
27
|
}
|
|
35
28
|
`;
|
|
36
29
|
// used in cache updator
|
|
37
|
-
exports.UPSERT_CHAPTER_NOTE_FRAGMENT = (0, client_1.gql) `
|
|
38
|
-
fragment UpsertChapterNoteFragment on Chapter {
|
|
39
|
-
userNote {
|
|
40
|
-
userId
|
|
41
|
-
chapterId
|
|
42
|
-
note
|
|
43
|
-
createdAt
|
|
44
|
-
updatedAt
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
// used in cache updator
|
|
49
30
|
exports.CHAPTER_WITH_HIGHLIGHT_FIELDS = (0, client_1.gql) `
|
|
50
31
|
fragment ChapterWithHighlightFields on Chapter {
|
|
51
32
|
highlights {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STATUS_CONCEPT_FRAGMENT = exports.CONCEPT_FIELDS = void 0;
|
|
3
|
+
exports.UPSERT_CONCEPT_NOTE_FRAGMENT = exports.STATUS_CONCEPT_FRAGMENT = exports.CONCEPT_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const chapter_1 = require("./chapter");
|
|
6
6
|
const video_1 = require("./video");
|
|
@@ -30,6 +30,13 @@ exports.CONCEPT_FIELDS = (0, client_1.gql) `
|
|
|
30
30
|
videos {
|
|
31
31
|
...VideoFields
|
|
32
32
|
}
|
|
33
|
+
userNote {
|
|
34
|
+
id
|
|
35
|
+
userId
|
|
36
|
+
conceptId
|
|
37
|
+
note
|
|
38
|
+
updatedAt
|
|
39
|
+
}
|
|
33
40
|
}
|
|
34
41
|
`;
|
|
35
42
|
// used in cache updator
|
|
@@ -38,3 +45,15 @@ exports.STATUS_CONCEPT_FRAGMENT = (0, client_1.gql) `
|
|
|
38
45
|
status
|
|
39
46
|
}
|
|
40
47
|
`;
|
|
48
|
+
// used in cache updator
|
|
49
|
+
exports.UPSERT_CONCEPT_NOTE_FRAGMENT = (0, client_1.gql) `
|
|
50
|
+
fragment UpsertConceptNoteFragment on Concept {
|
|
51
|
+
userNote {
|
|
52
|
+
userId
|
|
53
|
+
note
|
|
54
|
+
conceptId
|
|
55
|
+
createdAt
|
|
56
|
+
updatedAt
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
import { ApolloCache } from '@apollo/client';
|
|
2
|
-
import { IChapterHighlight, IHighlightNode,
|
|
2
|
+
import { IChapterHighlight, IHighlightNode, Id } from '../../../models';
|
|
3
3
|
import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
|
|
4
4
|
import { RestrictedData, graphqlNormalize } from '../../types';
|
|
5
|
-
/**
|
|
6
|
-
* upsertChapterNote
|
|
7
|
-
*/
|
|
8
|
-
export declare const UPSERT_CHAPTER_NOTE: import("@apollo/client").DocumentNode;
|
|
9
|
-
export interface IUpsertChapterNoteVar {
|
|
10
|
-
chapterId: number;
|
|
11
|
-
note: string;
|
|
12
|
-
marksheetId?: number;
|
|
13
|
-
}
|
|
14
|
-
export type IUpsertChapterNoteData = RestrictedData<graphqlNormalize & Omit<IUserChapterNote, 'chapter'>, 'upsertChapterNote'>;
|
|
15
|
-
export declare const updateCacheOnUpsertChapterNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertChapterNoteData>, options: ApolloUpdateOptions<IUpsertChapterNoteVar>) => void;
|
|
16
|
-
export declare const optimisticUpsertChapterNote: (data: IUpsertChapterNoteVar & {
|
|
17
|
-
userId: number;
|
|
18
|
-
}) => IUpsertChapterNoteData;
|
|
19
5
|
/**
|
|
20
6
|
* addChapterHighlight
|
|
21
7
|
*/
|
|
@@ -1,66 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getChapterHighlightOptimisticResponse = exports.updateChapterHighlights = exports.ADD_CHAPTER_HIGHLIGHT =
|
|
3
|
+
exports.getChapterHighlightOptimisticResponse = exports.updateChapterHighlights = exports.ADD_CHAPTER_HIGHLIGHT = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const fragments_1 = require("../../fragments");
|
|
6
|
-
/**
|
|
7
|
-
* upsertChapterNote
|
|
8
|
-
*/
|
|
9
|
-
exports.UPSERT_CHAPTER_NOTE = (0, client_1.gql) `
|
|
10
|
-
mutation UpsertChapterNote(
|
|
11
|
-
$chapterId: Int!
|
|
12
|
-
$note: String!
|
|
13
|
-
$marksheetId: Int
|
|
14
|
-
) {
|
|
15
|
-
restricted {
|
|
16
|
-
upsertChapterNote(
|
|
17
|
-
chapterId: $chapterId
|
|
18
|
-
note: $note
|
|
19
|
-
marksheetId: $marksheetId
|
|
20
|
-
) {
|
|
21
|
-
id
|
|
22
|
-
chapterId
|
|
23
|
-
userId
|
|
24
|
-
note
|
|
25
|
-
createdAt
|
|
26
|
-
updatedAt
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
const updateCacheOnUpsertChapterNote = (cache, result, options) => {
|
|
32
|
-
const { upsertChapterNote } = result?.data?.restricted || {};
|
|
33
|
-
const { variables } = options || {};
|
|
34
|
-
if (!variables || !upsertChapterNote) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
cache.writeFragment({
|
|
38
|
-
id: cache.identify({
|
|
39
|
-
id: variables.chapterId,
|
|
40
|
-
__typename: 'Chapter',
|
|
41
|
-
}),
|
|
42
|
-
data: {
|
|
43
|
-
userNote: upsertChapterNote,
|
|
44
|
-
},
|
|
45
|
-
fragment: fragments_1.UPSERT_CHAPTER_NOTE_FRAGMENT,
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
exports.updateCacheOnUpsertChapterNote = updateCacheOnUpsertChapterNote;
|
|
49
|
-
const optimisticUpsertChapterNote = (data) => {
|
|
50
|
-
const payload = {
|
|
51
|
-
restricted: {
|
|
52
|
-
upsertChapterNote: {
|
|
53
|
-
__typename: 'UserChapterNote',
|
|
54
|
-
...data,
|
|
55
|
-
id: Date.now(),
|
|
56
|
-
createdAt: new Date(),
|
|
57
|
-
updatedAt: new Date(),
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
return payload;
|
|
62
|
-
};
|
|
63
|
-
exports.optimisticUpsertChapterNote = optimisticUpsertChapterNote;
|
|
64
6
|
exports.ADD_CHAPTER_HIGHLIGHT = (0, client_1.gql) `
|
|
65
7
|
${fragments_1.HIGHLIGHT_FIELDS}
|
|
66
8
|
mutation AddChapterHighlight(
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./chapter"), exports);
|
|
|
19
19
|
__exportStar(require("./contactUs"), exports);
|
|
20
20
|
__exportStar(require("./marksheet"), exports);
|
|
21
21
|
__exportStar(require("./mockTest"), exports);
|
|
22
|
+
__exportStar(require("./notes"), exports);
|
|
22
23
|
__exportStar(require("./notification"), exports);
|
|
23
24
|
__exportStar(require("./osce"), exports);
|
|
24
25
|
__exportStar(require("./preset"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ApolloCache } from "@apollo/client";
|
|
2
|
+
import { IUserConceptNote, IUserStationNote } from "../../../models";
|
|
3
|
+
import { ApolloUpdateResultRestricted, ApolloUpdateOptions } from "../../apollo";
|
|
4
|
+
import { RestrictedData, graphqlNormalize } from "../../types";
|
|
5
|
+
/**
|
|
6
|
+
* upsertConceptNote
|
|
7
|
+
*/
|
|
8
|
+
export declare const UPSERT_CONCEPT_NOTE: import("@apollo/client").DocumentNode;
|
|
9
|
+
export interface IUpsertConceptNoteVar {
|
|
10
|
+
conceptId: number;
|
|
11
|
+
note: string;
|
|
12
|
+
marksheetId?: number;
|
|
13
|
+
}
|
|
14
|
+
export type IUpsertConceptNoteData = RestrictedData<graphqlNormalize & Omit<IUserConceptNote, 'concept'>, 'upsertConceptNote'>;
|
|
15
|
+
export declare const updateCacheOnUpsertConceptNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertConceptNoteData>, options: ApolloUpdateOptions<IUpsertConceptNoteVar>) => void;
|
|
16
|
+
export declare const optimisticUpsertConceptNote: (data: IUpsertConceptNoteVar & {
|
|
17
|
+
userId: number;
|
|
18
|
+
}) => IUpsertConceptNoteData;
|
|
19
|
+
/**
|
|
20
|
+
* upsertStationNote
|
|
21
|
+
*/
|
|
22
|
+
export declare const UPSERT_STATION_NOTE: import("@apollo/client").DocumentNode;
|
|
23
|
+
export interface IUpsertStationNoteVar {
|
|
24
|
+
stationId: number;
|
|
25
|
+
note: string;
|
|
26
|
+
}
|
|
27
|
+
export type IUpsertStationNoteData = RestrictedData<graphqlNormalize & Omit<IUserStationNote, 'station'>, 'upsertStationNote'>;
|
|
28
|
+
export declare const updateCacheOnUpsertStationNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertStationNoteData>, options: ApolloUpdateOptions<IUpsertStationNoteVar>) => void;
|
|
29
|
+
export declare const optimisticUpsertStationNote: (data: IUpsertStationNoteVar & {
|
|
30
|
+
userId: number;
|
|
31
|
+
}) => IUpsertStationNoteData;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.optimisticUpsertStationNote = exports.updateCacheOnUpsertStationNote = exports.UPSERT_STATION_NOTE = exports.optimisticUpsertConceptNote = exports.updateCacheOnUpsertConceptNote = exports.UPSERT_CONCEPT_NOTE = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const fragments_1 = require("../../fragments");
|
|
6
|
+
/**
|
|
7
|
+
* upsertConceptNote
|
|
8
|
+
*/
|
|
9
|
+
exports.UPSERT_CONCEPT_NOTE = (0, client_1.gql) `
|
|
10
|
+
mutation UpsertConceptNote(
|
|
11
|
+
$conceptId: Int!
|
|
12
|
+
$note: String!
|
|
13
|
+
$marksheetId: Int
|
|
14
|
+
) {
|
|
15
|
+
restricted {
|
|
16
|
+
upsertConceptNote(
|
|
17
|
+
conceptId: $conceptId
|
|
18
|
+
note: $note
|
|
19
|
+
marksheetId: $marksheetId
|
|
20
|
+
) {
|
|
21
|
+
id
|
|
22
|
+
conceptId
|
|
23
|
+
userId
|
|
24
|
+
note
|
|
25
|
+
createdAt
|
|
26
|
+
updatedAt
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
const updateCacheOnUpsertConceptNote = (cache, result, options) => {
|
|
32
|
+
const { upsertConceptNote } = result?.data?.restricted || {};
|
|
33
|
+
const { variables } = options || {};
|
|
34
|
+
if (!variables || !upsertConceptNote) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
cache.writeFragment({
|
|
38
|
+
id: cache.identify({
|
|
39
|
+
id: variables.conceptId,
|
|
40
|
+
__typename: 'Concept',
|
|
41
|
+
}),
|
|
42
|
+
data: {
|
|
43
|
+
userNote: upsertConceptNote,
|
|
44
|
+
},
|
|
45
|
+
fragment: fragments_1.UPSERT_CONCEPT_NOTE_FRAGMENT,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.updateCacheOnUpsertConceptNote = updateCacheOnUpsertConceptNote;
|
|
49
|
+
const optimisticUpsertConceptNote = (data) => {
|
|
50
|
+
const payload = {
|
|
51
|
+
restricted: {
|
|
52
|
+
upsertConceptNote: {
|
|
53
|
+
__typename: 'UserConceptNote',
|
|
54
|
+
...data,
|
|
55
|
+
id: Date.now(),
|
|
56
|
+
conceptId: Date.now(),
|
|
57
|
+
createdAt: new Date(),
|
|
58
|
+
updatedAt: new Date(),
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
return payload;
|
|
63
|
+
};
|
|
64
|
+
exports.optimisticUpsertConceptNote = optimisticUpsertConceptNote;
|
|
65
|
+
/**
|
|
66
|
+
* upsertStationNote
|
|
67
|
+
*/
|
|
68
|
+
exports.UPSERT_STATION_NOTE = (0, client_1.gql) `
|
|
69
|
+
mutation UpsertStationNote($stationId: Int!, $note: String!) {
|
|
70
|
+
restricted {
|
|
71
|
+
upsertStationNote(stationId: $stationId, note: $note) {
|
|
72
|
+
id
|
|
73
|
+
stationId
|
|
74
|
+
userId
|
|
75
|
+
note
|
|
76
|
+
createdAt
|
|
77
|
+
updatedAt
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
const updateCacheOnUpsertStationNote = (cache, result, options) => {
|
|
83
|
+
const { upsertStationNote } = result?.data?.restricted || {};
|
|
84
|
+
const { variables } = options || {};
|
|
85
|
+
if (!variables || !upsertStationNote) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
cache.writeFragment({
|
|
89
|
+
id: cache.identify({
|
|
90
|
+
id: variables.stationId,
|
|
91
|
+
__typename: 'OsceStation',
|
|
92
|
+
}),
|
|
93
|
+
data: {
|
|
94
|
+
userNote: upsertStationNote,
|
|
95
|
+
},
|
|
96
|
+
fragment: fragments_1.UPSERT_STATION_NOTE_FRAGMENT,
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
exports.updateCacheOnUpsertStationNote = updateCacheOnUpsertStationNote;
|
|
100
|
+
const optimisticUpsertStationNote = (data) => {
|
|
101
|
+
const payload = {
|
|
102
|
+
restricted: {
|
|
103
|
+
upsertStationNote: {
|
|
104
|
+
__typename: 'UserStationNote',
|
|
105
|
+
...data,
|
|
106
|
+
id: Date.now(),
|
|
107
|
+
createdAt: new Date(),
|
|
108
|
+
updatedAt: new Date(),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
return payload;
|
|
113
|
+
};
|
|
114
|
+
exports.optimisticUpsertStationNote = optimisticUpsertStationNote;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApolloCache } from '@apollo/client';
|
|
2
|
-
import { EEntitlementType, EOsceMarksheetAction, EOsceMarksheetState, EOsceRoles, EPaceMarkType, EProductType, EStudyAction, IOsceMarksheet, IOsceMarksheetMark,
|
|
2
|
+
import { EEntitlementType, EOsceMarksheetAction, EOsceMarksheetState, EOsceRoles, EPaceMarkType, EProductType, EStudyAction, IOsceMarksheet, IOsceMarksheetMark, Id } from '../../../models';
|
|
3
3
|
import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
|
|
4
4
|
import { IOsceMatchmakingAction } from '../../subscription/osce';
|
|
5
5
|
import { RestrictedData, graphqlNormalize } from '../../types';
|
|
@@ -141,16 +141,3 @@ export interface ILeaveOsceMarksheetVar {
|
|
|
141
141
|
osceMarksheetId: Id;
|
|
142
142
|
}
|
|
143
143
|
export type ILeaveOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'leaveOsceMarksheet'>;
|
|
144
|
-
/**
|
|
145
|
-
* upsertStationNote
|
|
146
|
-
*/
|
|
147
|
-
export declare const UPSERT_STATION_NOTE: import("@apollo/client").DocumentNode;
|
|
148
|
-
export interface IUpsertStationNoteVar {
|
|
149
|
-
stationId: number;
|
|
150
|
-
note: string;
|
|
151
|
-
}
|
|
152
|
-
export type IUpsertStationNoteData = RestrictedData<graphqlNormalize & Omit<IUserStationNote, 'station'>, 'upsertStationNote'>;
|
|
153
|
-
export declare const updateCacheOnUpsertStationNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertStationNoteData>, options: ApolloUpdateOptions<IUpsertStationNoteVar>) => void;
|
|
154
|
-
export declare const optimisticUpsertStationNote: (data: IUpsertStationNoteVar & {
|
|
155
|
-
userId: number;
|
|
156
|
-
}) => IUpsertStationNoteData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.LEAVE_OSCE_MARKSHEET = exports.optimisticEndOsceMarksheet = exports.updateCacheOnEndOsceMarksheet = exports.END_OSCE_MARKSHEET = exports.MODIFY_OSCE_MARKSHEET = exports.SAVE_OSCE_MARKSHEET = exports.PRESTART_OSCE_MARKSHEET = exports.START_OSCE_TIMER = exports.START_OSCE_MARKSHEET = exports.SELECT_OSCE_STATION = exports.optimisticMarkOsceMarksheetMark = exports.MARK_OSCE_MARKSHEET_MARK = exports.CHANGE_OSCE_ROLE = exports.BUILD_OSCE_MARKSHEET = exports.CREATE_OR_JOIN_OSCE_MARKSHEET = exports.CANCEL_OSCE_MATCHMAKING = exports.CHECK_OSCE_MATCHMAKING = exports.ACCEPT_OSCE_MATCHMAKING = exports.START_OSCE_MATCHMAKING = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
6
|
const fragments_1 = require("../../fragments");
|
|
@@ -300,53 +300,3 @@ exports.LEAVE_OSCE_MARKSHEET = (0, client_1.gql) `
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
`;
|
|
303
|
-
/**
|
|
304
|
-
* upsertStationNote
|
|
305
|
-
*/
|
|
306
|
-
exports.UPSERT_STATION_NOTE = (0, client_1.gql) `
|
|
307
|
-
mutation UpsertStationNote($stationId: Int!, $note: String!) {
|
|
308
|
-
restricted {
|
|
309
|
-
upsertStationNote(stationId: $stationId, note: $note) {
|
|
310
|
-
id
|
|
311
|
-
stationId
|
|
312
|
-
userId
|
|
313
|
-
note
|
|
314
|
-
createdAt
|
|
315
|
-
updatedAt
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
`;
|
|
320
|
-
const updateCacheOnUpsertStationNote = (cache, result, options) => {
|
|
321
|
-
const { upsertStationNote } = result?.data?.restricted || {};
|
|
322
|
-
const { variables } = options || {};
|
|
323
|
-
if (!variables || !upsertStationNote) {
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
cache.writeFragment({
|
|
327
|
-
id: cache.identify({
|
|
328
|
-
id: variables.stationId,
|
|
329
|
-
__typename: 'OsceStation',
|
|
330
|
-
}),
|
|
331
|
-
data: {
|
|
332
|
-
userNote: upsertStationNote,
|
|
333
|
-
},
|
|
334
|
-
fragment: fragments_1.UPSERT_STATION_NOTE_FRAGMENT,
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
exports.updateCacheOnUpsertStationNote = updateCacheOnUpsertStationNote;
|
|
338
|
-
const optimisticUpsertStationNote = (data) => {
|
|
339
|
-
const payload = {
|
|
340
|
-
restricted: {
|
|
341
|
-
upsertStationNote: {
|
|
342
|
-
__typename: 'UserStationNote',
|
|
343
|
-
...data,
|
|
344
|
-
id: Date.now(),
|
|
345
|
-
createdAt: new Date(),
|
|
346
|
-
updatedAt: new Date(),
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
};
|
|
350
|
-
return payload;
|
|
351
|
-
};
|
|
352
|
-
exports.optimisticUpsertStationNote = optimisticUpsertStationNote;
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./concepts"), exports);
|
|
|
19
19
|
__exportStar(require("./global"), exports);
|
|
20
20
|
__exportStar(require("./marksheet"), exports);
|
|
21
21
|
__exportStar(require("./mockTests"), exports);
|
|
22
|
+
__exportStar(require("./notes"), exports);
|
|
22
23
|
__exportStar(require("./notification"), exports);
|
|
23
24
|
__exportStar(require("./osce"), exports);
|
|
24
25
|
__exportStar(require("./preset"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IUserConceptNote, IUserStationNote } from '../../../models';
|
|
2
|
+
import { RestrictedData, graphqlNormalize } from '../../types';
|
|
3
|
+
export interface IConceptNotesVar {
|
|
4
|
+
search: string | null;
|
|
5
|
+
limit: number;
|
|
6
|
+
offset: number;
|
|
7
|
+
}
|
|
8
|
+
export type IConceptNotesData = RestrictedData<graphqlNormalize & IUserConceptNote[], 'conceptNotes'>;
|
|
9
|
+
export declare const CONCEPT_NOTES: import("@apollo/client").DocumentNode;
|
|
10
|
+
export interface IStationNotesVar {
|
|
11
|
+
search: string | null;
|
|
12
|
+
limit: number;
|
|
13
|
+
offset: number;
|
|
14
|
+
}
|
|
15
|
+
export type IStationNotesData = RestrictedData<graphqlNormalize & IUserStationNote[], 'stationNotes'>;
|
|
16
|
+
export declare const STATION_NOTES: import("@apollo/client").DocumentNode;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STATION_NOTES = exports.CONCEPT_NOTES = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
exports.CONCEPT_NOTES = (0, client_1.gql) `
|
|
6
|
+
query ConceptNotes($search: String, $limit: Int, $offset: Int) {
|
|
7
|
+
restricted {
|
|
8
|
+
conceptNotes(search: $search, limit: $limit, offset: $offset) {
|
|
9
|
+
id
|
|
10
|
+
createdAt
|
|
11
|
+
updatedAt
|
|
12
|
+
note
|
|
13
|
+
userId
|
|
14
|
+
conceptId
|
|
15
|
+
concept {
|
|
16
|
+
name
|
|
17
|
+
topic {
|
|
18
|
+
id
|
|
19
|
+
name
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
exports.STATION_NOTES = (0, client_1.gql) `
|
|
27
|
+
query StationNotes($search: String, $limit: Int, $offset: Int) {
|
|
28
|
+
restricted {
|
|
29
|
+
stationNotes(search: $search, limit: $limit, offset: $offset) {
|
|
30
|
+
id
|
|
31
|
+
createdAt
|
|
32
|
+
updatedAt
|
|
33
|
+
note
|
|
34
|
+
userId
|
|
35
|
+
stationId
|
|
36
|
+
station {
|
|
37
|
+
id
|
|
38
|
+
name
|
|
39
|
+
hiddenName
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -36,6 +36,13 @@ exports.QBANK_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
|
|
|
36
36
|
chapter {
|
|
37
37
|
...ChapterFields
|
|
38
38
|
}
|
|
39
|
+
userNote {
|
|
40
|
+
id
|
|
41
|
+
userId
|
|
42
|
+
conceptId
|
|
43
|
+
note
|
|
44
|
+
updatedAt
|
|
45
|
+
}
|
|
39
46
|
topicId
|
|
40
47
|
videos {
|
|
41
48
|
id
|
|
@@ -89,6 +96,13 @@ exports.PUBLIC_QBANK_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
|
|
|
89
96
|
...ChapterFields
|
|
90
97
|
}
|
|
91
98
|
topicId
|
|
99
|
+
userNote {
|
|
100
|
+
id
|
|
101
|
+
userId
|
|
102
|
+
conceptId
|
|
103
|
+
note
|
|
104
|
+
updatedAt
|
|
105
|
+
}
|
|
92
106
|
videos {
|
|
93
107
|
id
|
|
94
108
|
demo
|