@quesmed/types-rn 2.6.99 → 2.6.101
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/Concept.d.ts +2 -1
- package/models/MockTest.d.ts +1 -1
- package/models/Note.d.ts +5 -0
- package/package.json +1 -1
- package/resolvers/fragments/concept.d.ts +1 -0
- package/resolvers/fragments/concept.js +20 -1
- package/resolvers/mutation/restricted/{notes.d.ts → book.d.ts} +18 -4
- package/resolvers/mutation/restricted/{notes.js → book.js} +60 -1
- package/resolvers/mutation/restricted/index.d.ts +1 -1
- package/resolvers/mutation/restricted/index.js +1 -1
- package/resolvers/query/restricted/concepts.js +27 -6
- package/resolvers/query/restricted/quesBook.js +21 -0
- package/resolvers/query/restricted/video.js +7 -0
package/models/Concept.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IChapter } from './Chapter';
|
|
2
|
+
import { IUserConceptChapter, IUserConceptNote } from './Note';
|
|
2
3
|
import { EEntitlementType, IEntitlement } from './Product';
|
|
3
|
-
import { IUserConceptNote } from './Note';
|
|
4
4
|
import { ITopic } from './Topic';
|
|
5
5
|
import { Id } from './Type';
|
|
6
6
|
import { EUserLearningStatus } from './User';
|
|
@@ -29,4 +29,5 @@ export interface IConcept {
|
|
|
29
29
|
dailyFeedCards?: number | null;
|
|
30
30
|
status?: EUserLearningStatus | null;
|
|
31
31
|
userNote: null | IUserConceptNote;
|
|
32
|
+
userChapter: null | IUserConceptChapter;
|
|
32
33
|
}
|
package/models/MockTest.d.ts
CHANGED
package/models/Note.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const CONCEPT_FIELDS: import("@apollo/client").DocumentNode;
|
|
2
2
|
export declare const STATUS_CONCEPT_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
3
3
|
export declare const UPSERT_CONCEPT_NOTE_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
4
|
+
export declare const UPSERT_CONCEPT_CHAPTER_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPSERT_CONCEPT_NOTE_FRAGMENT = exports.STATUS_CONCEPT_FRAGMENT = exports.CONCEPT_FIELDS = void 0;
|
|
3
|
+
exports.UPSERT_CONCEPT_CHAPTER_FRAGMENT = 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");
|
|
@@ -37,6 +37,13 @@ exports.CONCEPT_FIELDS = (0, client_1.gql) `
|
|
|
37
37
|
note
|
|
38
38
|
updatedAt
|
|
39
39
|
}
|
|
40
|
+
userChapter {
|
|
41
|
+
id
|
|
42
|
+
userId
|
|
43
|
+
conceptId
|
|
44
|
+
explanation
|
|
45
|
+
updatedAt
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
`;
|
|
42
49
|
// used in cache updator
|
|
@@ -57,3 +64,15 @@ exports.UPSERT_CONCEPT_NOTE_FRAGMENT = (0, client_1.gql) `
|
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
`;
|
|
67
|
+
// used in cache updator
|
|
68
|
+
exports.UPSERT_CONCEPT_CHAPTER_FRAGMENT = (0, client_1.gql) `
|
|
69
|
+
fragment UpsertConceptChapterFragment on Concept {
|
|
70
|
+
userChapter {
|
|
71
|
+
userId
|
|
72
|
+
explanation
|
|
73
|
+
conceptId
|
|
74
|
+
createdAt
|
|
75
|
+
updatedAt
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { ApolloCache } from
|
|
2
|
-
import { IUserConceptNote, IUserStationNote } from
|
|
3
|
-
import {
|
|
4
|
-
import { RestrictedData, graphqlNormalize } from
|
|
1
|
+
import { ApolloCache } from '@apollo/client';
|
|
2
|
+
import { IUserConceptChapter, IUserConceptNote, IUserStationNote } from '../../../models';
|
|
3
|
+
import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
|
|
4
|
+
import { RestrictedData, graphqlNormalize } from '../../types';
|
|
5
|
+
/**
|
|
6
|
+
* upsertConceptChapter
|
|
7
|
+
*/
|
|
8
|
+
export declare const UPSERT_CONCEPT_BOOK: import("@apollo/client").DocumentNode;
|
|
9
|
+
export interface IUpsertConceptChapterVar {
|
|
10
|
+
conceptId: number;
|
|
11
|
+
explanation: string;
|
|
12
|
+
marksheetId?: number;
|
|
13
|
+
}
|
|
14
|
+
export type IUpsertConceptChapterData = RestrictedData<graphqlNormalize & Omit<IUserConceptChapter, 'concept'>, 'upsertConceptChapter'>;
|
|
15
|
+
export declare const updateCacheOnUpsertConceptChapter: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertConceptChapterData>, options: ApolloUpdateOptions<IUpsertConceptChapterVar>) => void;
|
|
16
|
+
export declare const optimisticUpsertConceptChapter: (data: IUpsertConceptChapterVar & {
|
|
17
|
+
userId: number;
|
|
18
|
+
}) => IUpsertConceptChapterData;
|
|
5
19
|
/**
|
|
6
20
|
* upsertConceptNote
|
|
7
21
|
*/
|
|
@@ -1,8 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
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;
|
|
3
|
+
exports.optimisticUpsertStationNote = exports.updateCacheOnUpsertStationNote = exports.UPSERT_STATION_NOTE = exports.optimisticUpsertConceptNote = exports.updateCacheOnUpsertConceptNote = exports.UPSERT_CONCEPT_NOTE = exports.optimisticUpsertConceptChapter = exports.updateCacheOnUpsertConceptChapter = exports.UPSERT_CONCEPT_BOOK = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const fragments_1 = require("../../fragments");
|
|
6
|
+
/**
|
|
7
|
+
* upsertConceptChapter
|
|
8
|
+
*/
|
|
9
|
+
exports.UPSERT_CONCEPT_BOOK = (0, client_1.gql) `
|
|
10
|
+
mutation UpsertConceptChapter(
|
|
11
|
+
$conceptId: Int!
|
|
12
|
+
$explanation: String!
|
|
13
|
+
$marksheetId: Int
|
|
14
|
+
) {
|
|
15
|
+
restricted {
|
|
16
|
+
upsertConceptChapter(
|
|
17
|
+
conceptId: $conceptId
|
|
18
|
+
explanation: $explanation
|
|
19
|
+
marksheetId: $marksheetId
|
|
20
|
+
) {
|
|
21
|
+
id
|
|
22
|
+
conceptId
|
|
23
|
+
userId
|
|
24
|
+
explanation
|
|
25
|
+
createdAt
|
|
26
|
+
updatedAt
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
const updateCacheOnUpsertConceptChapter = (cache, result, options) => {
|
|
32
|
+
const { upsertConceptChapter } = result?.data?.restricted || {};
|
|
33
|
+
const { variables } = options || {};
|
|
34
|
+
if (!variables || !upsertConceptChapter) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
cache.writeFragment({
|
|
38
|
+
id: cache.identify({
|
|
39
|
+
id: variables.conceptId,
|
|
40
|
+
__typename: 'Concept',
|
|
41
|
+
}),
|
|
42
|
+
data: {
|
|
43
|
+
userChapter: upsertConceptChapter,
|
|
44
|
+
},
|
|
45
|
+
fragment: fragments_1.UPSERT_CONCEPT_CHAPTER_FRAGMENT,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.updateCacheOnUpsertConceptChapter = updateCacheOnUpsertConceptChapter;
|
|
49
|
+
const optimisticUpsertConceptChapter = (data) => {
|
|
50
|
+
const payload = {
|
|
51
|
+
restricted: {
|
|
52
|
+
upsertConceptChapter: {
|
|
53
|
+
__typename: 'UserConceptChapter',
|
|
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.optimisticUpsertConceptChapter = optimisticUpsertConceptChapter;
|
|
6
65
|
/**
|
|
7
66
|
* upsertConceptNote
|
|
8
67
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './agora';
|
|
2
|
+
export * from './book';
|
|
2
3
|
export * from './chapter';
|
|
3
4
|
export * from './contactUs';
|
|
4
5
|
export * from './marksheet';
|
|
5
6
|
export * from './mockTest';
|
|
6
|
-
export * from './notes';
|
|
7
7
|
export * from './notification';
|
|
8
8
|
export * from './osce';
|
|
9
9
|
export * from './preset';
|
|
@@ -15,11 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./agora"), exports);
|
|
18
|
+
__exportStar(require("./book"), exports);
|
|
18
19
|
__exportStar(require("./chapter"), exports);
|
|
19
20
|
__exportStar(require("./contactUs"), exports);
|
|
20
21
|
__exportStar(require("./marksheet"), exports);
|
|
21
22
|
__exportStar(require("./mockTest"), exports);
|
|
22
|
-
__exportStar(require("./notes"), exports);
|
|
23
23
|
__exportStar(require("./notification"), exports);
|
|
24
24
|
__exportStar(require("./osce"), exports);
|
|
25
25
|
__exportStar(require("./preset"), exports);
|
|
@@ -25,6 +25,20 @@ exports.CONCEPT = (0, client_1.gql) `
|
|
|
25
25
|
name
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
userNote {
|
|
29
|
+
id
|
|
30
|
+
userId
|
|
31
|
+
conceptId
|
|
32
|
+
note
|
|
33
|
+
updatedAt
|
|
34
|
+
}
|
|
35
|
+
userChapter {
|
|
36
|
+
id
|
|
37
|
+
userId
|
|
38
|
+
conceptId
|
|
39
|
+
explanation
|
|
40
|
+
updatedAt
|
|
41
|
+
}
|
|
28
42
|
chapter {
|
|
29
43
|
...ChapterFields
|
|
30
44
|
}
|
|
@@ -69,12 +83,19 @@ exports.CONCEPTS = (0, client_1.gql) `
|
|
|
69
83
|
...ChapterFields
|
|
70
84
|
}
|
|
71
85
|
userNote {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
id
|
|
87
|
+
userId
|
|
88
|
+
conceptId
|
|
89
|
+
note
|
|
90
|
+
updatedAt
|
|
91
|
+
}
|
|
92
|
+
userChapter {
|
|
93
|
+
id
|
|
94
|
+
userId
|
|
95
|
+
conceptId
|
|
96
|
+
explanation
|
|
97
|
+
updatedAt
|
|
98
|
+
}
|
|
78
99
|
videos {
|
|
79
100
|
id
|
|
80
101
|
status
|
|
@@ -43,6 +43,13 @@ exports.QBANK_KNOWLEDGE_VIDEO_LIBRARY = (0, client_1.gql) `
|
|
|
43
43
|
note
|
|
44
44
|
updatedAt
|
|
45
45
|
}
|
|
46
|
+
userChapter {
|
|
47
|
+
id
|
|
48
|
+
userId
|
|
49
|
+
conceptId
|
|
50
|
+
explanation
|
|
51
|
+
updatedAt
|
|
52
|
+
}
|
|
46
53
|
topicId
|
|
47
54
|
videos {
|
|
48
55
|
id
|
|
@@ -103,6 +110,13 @@ exports.PUBLIC_QBANK_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
|
|
|
103
110
|
note
|
|
104
111
|
updatedAt
|
|
105
112
|
}
|
|
113
|
+
userChapter {
|
|
114
|
+
id
|
|
115
|
+
userId
|
|
116
|
+
conceptId
|
|
117
|
+
explanation
|
|
118
|
+
updatedAt
|
|
119
|
+
}
|
|
106
120
|
videos {
|
|
107
121
|
id
|
|
108
122
|
demo
|
|
@@ -151,6 +165,13 @@ exports.PACE_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
|
|
|
151
165
|
note
|
|
152
166
|
updatedAt
|
|
153
167
|
}
|
|
168
|
+
userChapter {
|
|
169
|
+
id
|
|
170
|
+
userId
|
|
171
|
+
conceptId
|
|
172
|
+
explanation
|
|
173
|
+
updatedAt
|
|
174
|
+
}
|
|
154
175
|
entitlement {
|
|
155
176
|
id
|
|
156
177
|
name
|