@quesmed/types-rn 2.4.9 → 2.4.11
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/Picture.d.ts +1 -0
- package/package.json +1 -1
- package/resolvers/fragments/chapter.js +1 -0
- package/resolvers/fragments/marksheet.js +1 -0
- package/resolvers/fragments/picture.js +1 -0
- package/resolvers/mutation/restricted/marksheet.js +12 -0
- package/resolvers/query/restricted/conceptExplanation.d.ts +17 -0
- package/resolvers/query/restricted/conceptExplanation.js +11 -0
- package/resolvers/query/restricted/index.d.ts +1 -0
- package/resolvers/query/restricted/index.js +1 -0
- package/resolvers/query/restricted/marksheet.js +13 -0
- package/resolvers/query/restricted/quesBook.js +1 -0
- package/resolvers/query/restricted/question.js +4 -0
- package/resolvers/query/restricted/todos.js +1 -0
- package/resolvers/query/restricted/video.js +2 -0
- package/resolvers/query/sample.js +2 -0
- package/resolvers/query/video.js +2 -0
- package/utils/lightgallery.js +25 -12
package/models/Picture.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -129,6 +129,7 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
|
|
|
129
129
|
path
|
|
130
130
|
path512
|
|
131
131
|
path256
|
|
132
|
+
index
|
|
132
133
|
topicId
|
|
133
134
|
topic {
|
|
134
135
|
id
|
|
@@ -248,6 +249,7 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
|
|
|
248
249
|
path
|
|
249
250
|
path512
|
|
250
251
|
path256
|
|
252
|
+
index
|
|
251
253
|
topicId
|
|
252
254
|
topic {
|
|
253
255
|
id
|
|
@@ -370,6 +372,7 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
|
|
|
370
372
|
path
|
|
371
373
|
path512
|
|
372
374
|
path256
|
|
375
|
+
index
|
|
373
376
|
topicId
|
|
374
377
|
topic {
|
|
375
378
|
id
|
|
@@ -489,6 +492,7 @@ exports.BUILD_QUESTION_MARKSHEET = (0, client_1.gql) `
|
|
|
489
492
|
path
|
|
490
493
|
path512
|
|
491
494
|
path256
|
|
495
|
+
index
|
|
492
496
|
topicId
|
|
493
497
|
topic {
|
|
494
498
|
id
|
|
@@ -703,6 +707,7 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
703
707
|
path
|
|
704
708
|
path512
|
|
705
709
|
path256
|
|
710
|
+
index
|
|
706
711
|
topicId
|
|
707
712
|
topic {
|
|
708
713
|
id
|
|
@@ -822,6 +827,7 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
822
827
|
path
|
|
823
828
|
path512
|
|
824
829
|
path256
|
|
830
|
+
index
|
|
825
831
|
topicId
|
|
826
832
|
topic {
|
|
827
833
|
id
|
|
@@ -944,6 +950,7 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
944
950
|
path
|
|
945
951
|
path512
|
|
946
952
|
path256
|
|
953
|
+
index
|
|
947
954
|
topicId
|
|
948
955
|
topic {
|
|
949
956
|
id
|
|
@@ -1063,6 +1070,7 @@ exports.BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
1063
1070
|
path
|
|
1064
1071
|
path512
|
|
1065
1072
|
path256
|
|
1073
|
+
index
|
|
1066
1074
|
topicId
|
|
1067
1075
|
topic {
|
|
1068
1076
|
id
|
|
@@ -1282,6 +1290,7 @@ exports.RE_BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
1282
1290
|
path
|
|
1283
1291
|
path512
|
|
1284
1292
|
path256
|
|
1293
|
+
index
|
|
1285
1294
|
topicId
|
|
1286
1295
|
topic {
|
|
1287
1296
|
id
|
|
@@ -1401,6 +1410,7 @@ exports.RE_BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
1401
1410
|
path
|
|
1402
1411
|
path512
|
|
1403
1412
|
path256
|
|
1413
|
+
index
|
|
1404
1414
|
topicId
|
|
1405
1415
|
topic {
|
|
1406
1416
|
id
|
|
@@ -1523,6 +1533,7 @@ exports.RE_BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
1523
1533
|
path
|
|
1524
1534
|
path512
|
|
1525
1535
|
path256
|
|
1536
|
+
index
|
|
1526
1537
|
topicId
|
|
1527
1538
|
topic {
|
|
1528
1539
|
id
|
|
@@ -1642,6 +1653,7 @@ exports.RE_BUILD_MARKSHEET = (0, client_1.gql) `
|
|
|
1642
1653
|
path
|
|
1643
1654
|
path512
|
|
1644
1655
|
path256
|
|
1656
|
+
index
|
|
1645
1657
|
topicId
|
|
1646
1658
|
topic {
|
|
1647
1659
|
id
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { graphqlNormalize, RestrictedData } from "../../types";
|
|
2
|
+
export declare type IQuesBookDict = Record<string, {
|
|
3
|
+
conceptId: number;
|
|
4
|
+
topicId: number;
|
|
5
|
+
chapterId: number;
|
|
6
|
+
explanation: string;
|
|
7
|
+
}>;
|
|
8
|
+
export interface IConceptExplanationVar {
|
|
9
|
+
input: {
|
|
10
|
+
conceptName: string;
|
|
11
|
+
conceptId: number;
|
|
12
|
+
topicId: number;
|
|
13
|
+
chapterId: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare type IConceptExplanationData = RestrictedData<graphqlNormalize & string, "conceptExplanation">;
|
|
17
|
+
export declare const CONCEPT_EXPLANATION: import("@apollo/client").DocumentNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONCEPT_EXPLANATION = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
exports.CONCEPT_EXPLANATION = (0, client_1.gql) `
|
|
6
|
+
query conceptExplanation($input: ConceptExplanationInput!) {
|
|
7
|
+
restricted {
|
|
8
|
+
conceptExplanation(input: $input)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./conceptExplanation"), exports);
|
|
13
14
|
__exportStar(require("./global"), exports);
|
|
14
15
|
__exportStar(require("./marksheet"), exports);
|
|
15
16
|
__exportStar(require("./mockTests"), exports);
|
|
@@ -135,6 +135,7 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
135
135
|
path
|
|
136
136
|
path512
|
|
137
137
|
path256
|
|
138
|
+
index
|
|
138
139
|
topicId
|
|
139
140
|
topic {
|
|
140
141
|
id
|
|
@@ -254,6 +255,7 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
254
255
|
path
|
|
255
256
|
path512
|
|
256
257
|
path256
|
|
258
|
+
index
|
|
257
259
|
topicId
|
|
258
260
|
topic {
|
|
259
261
|
id
|
|
@@ -376,6 +378,7 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
376
378
|
path
|
|
377
379
|
path512
|
|
378
380
|
path256
|
|
381
|
+
index
|
|
379
382
|
topicId
|
|
380
383
|
topic {
|
|
381
384
|
id
|
|
@@ -495,6 +498,7 @@ exports.MARKSHEET = (0, client_1.gql) `
|
|
|
495
498
|
path
|
|
496
499
|
path512
|
|
497
500
|
path256
|
|
501
|
+
index
|
|
498
502
|
topicId
|
|
499
503
|
topic {
|
|
500
504
|
id
|
|
@@ -698,6 +702,7 @@ exports.FLAGGED_QUESTIONS = (0, client_1.gql) `
|
|
|
698
702
|
path
|
|
699
703
|
path512
|
|
700
704
|
path256
|
|
705
|
+
index
|
|
701
706
|
topicId
|
|
702
707
|
topic {
|
|
703
708
|
id
|
|
@@ -820,6 +825,7 @@ exports.FLAGGED_QUESTIONS = (0, client_1.gql) `
|
|
|
820
825
|
path
|
|
821
826
|
path512
|
|
822
827
|
path256
|
|
828
|
+
index
|
|
823
829
|
topicId
|
|
824
830
|
topic {
|
|
825
831
|
id
|
|
@@ -939,6 +945,7 @@ exports.FLAGGED_QUESTIONS = (0, client_1.gql) `
|
|
|
939
945
|
path
|
|
940
946
|
path512
|
|
941
947
|
path256
|
|
948
|
+
index
|
|
942
949
|
topicId
|
|
943
950
|
topic {
|
|
944
951
|
id
|
|
@@ -1061,6 +1068,7 @@ exports.FLAGGED_QUESTIONS = (0, client_1.gql) `
|
|
|
1061
1068
|
path
|
|
1062
1069
|
path512
|
|
1063
1070
|
path256
|
|
1071
|
+
index
|
|
1064
1072
|
topicId
|
|
1065
1073
|
topic {
|
|
1066
1074
|
id
|
|
@@ -1180,6 +1188,7 @@ exports.FLAGGED_QUESTIONS = (0, client_1.gql) `
|
|
|
1180
1188
|
path
|
|
1181
1189
|
path512
|
|
1182
1190
|
path256
|
|
1191
|
+
index
|
|
1183
1192
|
topicId
|
|
1184
1193
|
topic {
|
|
1185
1194
|
id
|
|
@@ -1387,6 +1396,7 @@ exports.FLAGGED_QUESTIONS_MARKSHEET = (0, client_1.gql) `
|
|
|
1387
1396
|
path
|
|
1388
1397
|
path512
|
|
1389
1398
|
path256
|
|
1399
|
+
index
|
|
1390
1400
|
topicId
|
|
1391
1401
|
topic {
|
|
1392
1402
|
id
|
|
@@ -1506,6 +1516,7 @@ exports.FLAGGED_QUESTIONS_MARKSHEET = (0, client_1.gql) `
|
|
|
1506
1516
|
path
|
|
1507
1517
|
path512
|
|
1508
1518
|
path256
|
|
1519
|
+
index
|
|
1509
1520
|
topicId
|
|
1510
1521
|
topic {
|
|
1511
1522
|
id
|
|
@@ -1628,6 +1639,7 @@ exports.FLAGGED_QUESTIONS_MARKSHEET = (0, client_1.gql) `
|
|
|
1628
1639
|
path
|
|
1629
1640
|
path512
|
|
1630
1641
|
path256
|
|
1642
|
+
index
|
|
1631
1643
|
topicId
|
|
1632
1644
|
topic {
|
|
1633
1645
|
id
|
|
@@ -1747,6 +1759,7 @@ exports.FLAGGED_QUESTIONS_MARKSHEET = (0, client_1.gql) `
|
|
|
1747
1759
|
path
|
|
1748
1760
|
path512
|
|
1749
1761
|
path256
|
|
1762
|
+
index
|
|
1750
1763
|
topicId
|
|
1751
1764
|
topic {
|
|
1752
1765
|
id
|
|
@@ -78,6 +78,7 @@ exports.QUESTION = (0, client_1.gql) `
|
|
|
78
78
|
path
|
|
79
79
|
path512
|
|
80
80
|
path256
|
|
81
|
+
index
|
|
81
82
|
topicId
|
|
82
83
|
topic {
|
|
83
84
|
id
|
|
@@ -197,6 +198,7 @@ exports.QUESTION = (0, client_1.gql) `
|
|
|
197
198
|
path
|
|
198
199
|
path512
|
|
199
200
|
path256
|
|
201
|
+
index
|
|
200
202
|
topicId
|
|
201
203
|
topic {
|
|
202
204
|
id
|
|
@@ -319,6 +321,7 @@ exports.QUESTION = (0, client_1.gql) `
|
|
|
319
321
|
path
|
|
320
322
|
path512
|
|
321
323
|
path256
|
|
324
|
+
index
|
|
322
325
|
topicId
|
|
323
326
|
topic {
|
|
324
327
|
id
|
|
@@ -438,6 +441,7 @@ exports.QUESTION = (0, client_1.gql) `
|
|
|
438
441
|
path
|
|
439
442
|
path512
|
|
440
443
|
path256
|
|
444
|
+
index
|
|
441
445
|
topicId
|
|
442
446
|
topic {
|
|
443
447
|
id
|
|
@@ -59,6 +59,7 @@ exports.SAMPLE_MARKSHEET = (0, client_1.gql) `
|
|
|
59
59
|
path
|
|
60
60
|
path512
|
|
61
61
|
path256
|
|
62
|
+
index
|
|
62
63
|
topicId
|
|
63
64
|
topic {
|
|
64
65
|
id
|
|
@@ -122,6 +123,7 @@ exports.SAMPLE_TODO = (0, client_1.gql) `
|
|
|
122
123
|
path
|
|
123
124
|
path512
|
|
124
125
|
path256
|
|
126
|
+
index
|
|
125
127
|
topicId
|
|
126
128
|
topic {
|
|
127
129
|
id
|
package/resolvers/query/video.js
CHANGED
package/utils/lightgallery.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.lightgalleryOsceResolve = void 0;
|
|
4
|
-
const lightgalleryRegex = /\[(
|
|
4
|
+
const lightgalleryRegex = /\[lightgallery([0-9]{0,})\]/;
|
|
5
5
|
function isOsceMarksheet(data) {
|
|
6
6
|
return 'osceStationId' in data;
|
|
7
7
|
}
|
|
@@ -55,7 +55,7 @@ const lightgalleryMutation = async (text, pictures, cache) => {
|
|
|
55
55
|
if (pictures.length === 0) {
|
|
56
56
|
return text;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const picturesMdMap = {};
|
|
59
59
|
for (const picture of pictures) {
|
|
60
60
|
const pic = picture.path;
|
|
61
61
|
const uri = `https://app.quesmed.com/${pic}`;
|
|
@@ -74,19 +74,32 @@ const lightgalleryMutation = async (text, pictures, cache) => {
|
|
|
74
74
|
console.error(e);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
let mdPic = ``;
|
|
77
78
|
if (picture.caption?.length > 0) {
|
|
78
|
-
|
|
79
|
+
mdPic = ``;
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
if (!picturesMdMap[picture.index]) {
|
|
82
|
+
picturesMdMap[picture.index] = [];
|
|
83
|
+
}
|
|
84
|
+
picturesMdMap[picture.index].push(mdPic);
|
|
81
85
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const matches = text.matchAll(lightgalleryRegex);
|
|
87
|
+
let matchExists = false;
|
|
88
|
+
for (const match of matches) {
|
|
89
|
+
const index = parseInt(match[1]);
|
|
90
|
+
if (index === 0) {
|
|
91
|
+
matchExists = true;
|
|
92
|
+
}
|
|
93
|
+
if (!picturesMdMap[index]) {
|
|
94
|
+
// TODO: report to sentry or err that lightgallery pictures are missing
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const mdPics = picturesMdMap[index].join(' ');
|
|
98
|
+
const lightgalleryTagToReplace = `[lightgallery${index > 0 ? index : ''}]`;
|
|
99
|
+
text = text.replace(lightgalleryTagToReplace, mdPics);
|
|
88
100
|
}
|
|
89
|
-
|
|
90
|
-
return text + '\n\n' +
|
|
101
|
+
if (!matchExists) {
|
|
102
|
+
return text + '\n\n' + picturesMdMap[0].join(' ') + '\n';
|
|
91
103
|
}
|
|
104
|
+
return text;
|
|
92
105
|
};
|