@quesmed/types 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/dist/cjs/models/Picture.d.ts +1 -0
- package/dist/cjs/resolvers/fragments/chapter.js +1 -0
- package/dist/cjs/resolvers/fragments/marksheet.js +1 -0
- package/dist/cjs/resolvers/fragments/picture.js +1 -0
- package/dist/cjs/resolvers/mutation/restricted/marksheet.js +12 -0
- package/dist/cjs/resolvers/query/restricted/conceptExplanation.d.ts +17 -0
- package/dist/cjs/resolvers/query/restricted/conceptExplanation.js +11 -0
- package/dist/cjs/resolvers/query/restricted/index.d.ts +1 -0
- package/dist/cjs/resolvers/query/restricted/index.js +1 -0
- package/dist/cjs/resolvers/query/restricted/marksheet.js +13 -0
- package/dist/cjs/resolvers/query/restricted/quesBook.js +1 -0
- package/dist/cjs/resolvers/query/restricted/question.js +4 -0
- package/dist/cjs/resolvers/query/restricted/todos.js +1 -0
- package/dist/cjs/resolvers/query/restricted/video.js +2 -0
- package/dist/cjs/resolvers/query/sample.js +2 -0
- package/dist/cjs/resolvers/query/video.js +2 -0
- package/dist/cjs/utils/lightgallery.js +25 -12
- package/dist/mjs/models/Picture.d.ts +1 -0
- package/dist/mjs/resolvers/fragments/chapter.js +1 -0
- package/dist/mjs/resolvers/fragments/marksheet.js +1 -0
- package/dist/mjs/resolvers/fragments/picture.js +1 -0
- package/dist/mjs/resolvers/mutation/restricted/marksheet.js +12 -0
- package/dist/mjs/resolvers/query/restricted/conceptExplanation.d.ts +17 -0
- package/dist/mjs/resolvers/query/restricted/conceptExplanation.js +8 -0
- package/dist/mjs/resolvers/query/restricted/index.d.ts +1 -0
- package/dist/mjs/resolvers/query/restricted/index.js +1 -0
- package/dist/mjs/resolvers/query/restricted/marksheet.js +13 -0
- package/dist/mjs/resolvers/query/restricted/quesBook.js +1 -0
- package/dist/mjs/resolvers/query/restricted/question.js +4 -0
- package/dist/mjs/resolvers/query/restricted/todos.js +1 -0
- package/dist/mjs/resolvers/query/restricted/video.js +2 -0
- package/dist/mjs/resolvers/query/sample.js +2 -0
- package/dist/mjs/resolvers/query/video.js +2 -0
- package/dist/mjs/utils/lightgallery.js +25 -12
- package/package.json +1 -1
|
@@ -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
|
|
@@ -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
|
};
|
|
@@ -126,6 +126,7 @@ export const BUILD_QUESTION_MARKSHEET = gql `
|
|
|
126
126
|
path
|
|
127
127
|
path512
|
|
128
128
|
path256
|
|
129
|
+
index
|
|
129
130
|
topicId
|
|
130
131
|
topic {
|
|
131
132
|
id
|
|
@@ -245,6 +246,7 @@ export const BUILD_QUESTION_MARKSHEET = gql `
|
|
|
245
246
|
path
|
|
246
247
|
path512
|
|
247
248
|
path256
|
|
249
|
+
index
|
|
248
250
|
topicId
|
|
249
251
|
topic {
|
|
250
252
|
id
|
|
@@ -367,6 +369,7 @@ export const BUILD_QUESTION_MARKSHEET = gql `
|
|
|
367
369
|
path
|
|
368
370
|
path512
|
|
369
371
|
path256
|
|
372
|
+
index
|
|
370
373
|
topicId
|
|
371
374
|
topic {
|
|
372
375
|
id
|
|
@@ -486,6 +489,7 @@ export const BUILD_QUESTION_MARKSHEET = gql `
|
|
|
486
489
|
path
|
|
487
490
|
path512
|
|
488
491
|
path256
|
|
492
|
+
index
|
|
489
493
|
topicId
|
|
490
494
|
topic {
|
|
491
495
|
id
|
|
@@ -700,6 +704,7 @@ export const BUILD_MARKSHEET = gql `
|
|
|
700
704
|
path
|
|
701
705
|
path512
|
|
702
706
|
path256
|
|
707
|
+
index
|
|
703
708
|
topicId
|
|
704
709
|
topic {
|
|
705
710
|
id
|
|
@@ -819,6 +824,7 @@ export const BUILD_MARKSHEET = gql `
|
|
|
819
824
|
path
|
|
820
825
|
path512
|
|
821
826
|
path256
|
|
827
|
+
index
|
|
822
828
|
topicId
|
|
823
829
|
topic {
|
|
824
830
|
id
|
|
@@ -941,6 +947,7 @@ export const BUILD_MARKSHEET = gql `
|
|
|
941
947
|
path
|
|
942
948
|
path512
|
|
943
949
|
path256
|
|
950
|
+
index
|
|
944
951
|
topicId
|
|
945
952
|
topic {
|
|
946
953
|
id
|
|
@@ -1060,6 +1067,7 @@ export const BUILD_MARKSHEET = gql `
|
|
|
1060
1067
|
path
|
|
1061
1068
|
path512
|
|
1062
1069
|
path256
|
|
1070
|
+
index
|
|
1063
1071
|
topicId
|
|
1064
1072
|
topic {
|
|
1065
1073
|
id
|
|
@@ -1279,6 +1287,7 @@ export const RE_BUILD_MARKSHEET = gql `
|
|
|
1279
1287
|
path
|
|
1280
1288
|
path512
|
|
1281
1289
|
path256
|
|
1290
|
+
index
|
|
1282
1291
|
topicId
|
|
1283
1292
|
topic {
|
|
1284
1293
|
id
|
|
@@ -1398,6 +1407,7 @@ export const RE_BUILD_MARKSHEET = gql `
|
|
|
1398
1407
|
path
|
|
1399
1408
|
path512
|
|
1400
1409
|
path256
|
|
1410
|
+
index
|
|
1401
1411
|
topicId
|
|
1402
1412
|
topic {
|
|
1403
1413
|
id
|
|
@@ -1520,6 +1530,7 @@ export const RE_BUILD_MARKSHEET = gql `
|
|
|
1520
1530
|
path
|
|
1521
1531
|
path512
|
|
1522
1532
|
path256
|
|
1533
|
+
index
|
|
1523
1534
|
topicId
|
|
1524
1535
|
topic {
|
|
1525
1536
|
id
|
|
@@ -1639,6 +1650,7 @@ export const RE_BUILD_MARKSHEET = gql `
|
|
|
1639
1650
|
path
|
|
1640
1651
|
path512
|
|
1641
1652
|
path256
|
|
1653
|
+
index
|
|
1642
1654
|
topicId
|
|
1643
1655
|
topic {
|
|
1644
1656
|
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;
|
|
@@ -132,6 +132,7 @@ export const MARKSHEET = gql `
|
|
|
132
132
|
path
|
|
133
133
|
path512
|
|
134
134
|
path256
|
|
135
|
+
index
|
|
135
136
|
topicId
|
|
136
137
|
topic {
|
|
137
138
|
id
|
|
@@ -251,6 +252,7 @@ export const MARKSHEET = gql `
|
|
|
251
252
|
path
|
|
252
253
|
path512
|
|
253
254
|
path256
|
|
255
|
+
index
|
|
254
256
|
topicId
|
|
255
257
|
topic {
|
|
256
258
|
id
|
|
@@ -373,6 +375,7 @@ export const MARKSHEET = gql `
|
|
|
373
375
|
path
|
|
374
376
|
path512
|
|
375
377
|
path256
|
|
378
|
+
index
|
|
376
379
|
topicId
|
|
377
380
|
topic {
|
|
378
381
|
id
|
|
@@ -492,6 +495,7 @@ export const MARKSHEET = gql `
|
|
|
492
495
|
path
|
|
493
496
|
path512
|
|
494
497
|
path256
|
|
498
|
+
index
|
|
495
499
|
topicId
|
|
496
500
|
topic {
|
|
497
501
|
id
|
|
@@ -695,6 +699,7 @@ export const FLAGGED_QUESTIONS = gql `
|
|
|
695
699
|
path
|
|
696
700
|
path512
|
|
697
701
|
path256
|
|
702
|
+
index
|
|
698
703
|
topicId
|
|
699
704
|
topic {
|
|
700
705
|
id
|
|
@@ -817,6 +822,7 @@ export const FLAGGED_QUESTIONS = gql `
|
|
|
817
822
|
path
|
|
818
823
|
path512
|
|
819
824
|
path256
|
|
825
|
+
index
|
|
820
826
|
topicId
|
|
821
827
|
topic {
|
|
822
828
|
id
|
|
@@ -936,6 +942,7 @@ export const FLAGGED_QUESTIONS = gql `
|
|
|
936
942
|
path
|
|
937
943
|
path512
|
|
938
944
|
path256
|
|
945
|
+
index
|
|
939
946
|
topicId
|
|
940
947
|
topic {
|
|
941
948
|
id
|
|
@@ -1058,6 +1065,7 @@ export const FLAGGED_QUESTIONS = gql `
|
|
|
1058
1065
|
path
|
|
1059
1066
|
path512
|
|
1060
1067
|
path256
|
|
1068
|
+
index
|
|
1061
1069
|
topicId
|
|
1062
1070
|
topic {
|
|
1063
1071
|
id
|
|
@@ -1177,6 +1185,7 @@ export const FLAGGED_QUESTIONS = gql `
|
|
|
1177
1185
|
path
|
|
1178
1186
|
path512
|
|
1179
1187
|
path256
|
|
1188
|
+
index
|
|
1180
1189
|
topicId
|
|
1181
1190
|
topic {
|
|
1182
1191
|
id
|
|
@@ -1384,6 +1393,7 @@ export const FLAGGED_QUESTIONS_MARKSHEET = gql `
|
|
|
1384
1393
|
path
|
|
1385
1394
|
path512
|
|
1386
1395
|
path256
|
|
1396
|
+
index
|
|
1387
1397
|
topicId
|
|
1388
1398
|
topic {
|
|
1389
1399
|
id
|
|
@@ -1503,6 +1513,7 @@ export const FLAGGED_QUESTIONS_MARKSHEET = gql `
|
|
|
1503
1513
|
path
|
|
1504
1514
|
path512
|
|
1505
1515
|
path256
|
|
1516
|
+
index
|
|
1506
1517
|
topicId
|
|
1507
1518
|
topic {
|
|
1508
1519
|
id
|
|
@@ -1625,6 +1636,7 @@ export const FLAGGED_QUESTIONS_MARKSHEET = gql `
|
|
|
1625
1636
|
path
|
|
1626
1637
|
path512
|
|
1627
1638
|
path256
|
|
1639
|
+
index
|
|
1628
1640
|
topicId
|
|
1629
1641
|
topic {
|
|
1630
1642
|
id
|
|
@@ -1744,6 +1756,7 @@ export const FLAGGED_QUESTIONS_MARKSHEET = gql `
|
|
|
1744
1756
|
path
|
|
1745
1757
|
path512
|
|
1746
1758
|
path256
|
|
1759
|
+
index
|
|
1747
1760
|
topicId
|
|
1748
1761
|
topic {
|
|
1749
1762
|
id
|
|
@@ -75,6 +75,7 @@ export const QUESTION = gql `
|
|
|
75
75
|
path
|
|
76
76
|
path512
|
|
77
77
|
path256
|
|
78
|
+
index
|
|
78
79
|
topicId
|
|
79
80
|
topic {
|
|
80
81
|
id
|
|
@@ -194,6 +195,7 @@ export const QUESTION = gql `
|
|
|
194
195
|
path
|
|
195
196
|
path512
|
|
196
197
|
path256
|
|
198
|
+
index
|
|
197
199
|
topicId
|
|
198
200
|
topic {
|
|
199
201
|
id
|
|
@@ -316,6 +318,7 @@ export const QUESTION = gql `
|
|
|
316
318
|
path
|
|
317
319
|
path512
|
|
318
320
|
path256
|
|
321
|
+
index
|
|
319
322
|
topicId
|
|
320
323
|
topic {
|
|
321
324
|
id
|
|
@@ -435,6 +438,7 @@ export const QUESTION = gql `
|
|
|
435
438
|
path
|
|
436
439
|
path512
|
|
437
440
|
path256
|
|
441
|
+
index
|
|
438
442
|
topicId
|
|
439
443
|
topic {
|
|
440
444
|
id
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lightgalleryRegex = /\[(
|
|
1
|
+
const lightgalleryRegex = /\[lightgallery([0-9]{0,})\]/;
|
|
2
2
|
function isOsceMarksheet(data) {
|
|
3
3
|
return 'osceStationId' in data;
|
|
4
4
|
}
|
|
@@ -51,7 +51,7 @@ const lightgalleryMutation = async (text, pictures, cache) => {
|
|
|
51
51
|
if (pictures.length === 0) {
|
|
52
52
|
return text;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
54
|
+
const picturesMdMap = {};
|
|
55
55
|
for (const picture of pictures) {
|
|
56
56
|
const pic = picture.path;
|
|
57
57
|
const uri = `https://app.quesmed.com/${pic}`;
|
|
@@ -70,19 +70,32 @@ const lightgalleryMutation = async (text, pictures, cache) => {
|
|
|
70
70
|
console.error(e);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
+
let mdPic = ``;
|
|
73
74
|
if (picture.caption?.length > 0) {
|
|
74
|
-
|
|
75
|
+
mdPic = ``;
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
+
if (!picturesMdMap[picture.index]) {
|
|
78
|
+
picturesMdMap[picture.index] = [];
|
|
79
|
+
}
|
|
80
|
+
picturesMdMap[picture.index].push(mdPic);
|
|
77
81
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const matches = text.matchAll(lightgalleryRegex);
|
|
83
|
+
let matchExists = false;
|
|
84
|
+
for (const match of matches) {
|
|
85
|
+
const index = parseInt(match[1]);
|
|
86
|
+
if (index === 0) {
|
|
87
|
+
matchExists = true;
|
|
88
|
+
}
|
|
89
|
+
if (!picturesMdMap[index]) {
|
|
90
|
+
// TODO: report to sentry or err that lightgallery pictures are missing
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
const mdPics = picturesMdMap[index].join(' ');
|
|
94
|
+
const lightgalleryTagToReplace = `[lightgallery${index > 0 ? index : ''}]`;
|
|
95
|
+
text = text.replace(lightgalleryTagToReplace, mdPics);
|
|
84
96
|
}
|
|
85
|
-
|
|
86
|
-
return text + '\n\n' +
|
|
97
|
+
if (!matchExists) {
|
|
98
|
+
return text + '\n\n' + picturesMdMap[0].join(' ') + '\n';
|
|
87
99
|
}
|
|
100
|
+
return text;
|
|
88
101
|
};
|