@gyldendalas/gyldendal-divine-api 0.2.7 → 0.2.9
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/index.cjs +20 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -16
- package/dist/index.d.ts +6 -16
- package/dist/index.js +20 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AIBotService: () => AIBotService,
|
|
24
|
-
ApiErrors: () => ApiErrors,
|
|
25
24
|
CookieConsentLog: () => CookieConsentLog,
|
|
26
25
|
HighlightResultType: () => HighlightResultType,
|
|
27
26
|
HighlightService: () => HighlightService,
|
|
@@ -1075,13 +1074,7 @@ var AIBotService = class extends base_service_default {
|
|
|
1075
1074
|
};
|
|
1076
1075
|
|
|
1077
1076
|
// src/services/quiz_service.ts
|
|
1078
|
-
var
|
|
1079
|
-
ApiErrors2["OVERVIEW_NOT_FOUND"] = "Quiz overview not found";
|
|
1080
|
-
ApiErrors2["NOT_FOUND"] = "Quiz not found";
|
|
1081
|
-
ApiErrors2["ARCHIVED"] = "This shared quiz session is archived";
|
|
1082
|
-
ApiErrors2["GALE_USER_DATA_CLIENT_ERROR"] = "Failed to fetch Gale user data: Client error";
|
|
1083
|
-
return ApiErrors2;
|
|
1084
|
-
})(ApiErrors || {});
|
|
1077
|
+
var REQUEST_TIMEOUT = 1e4;
|
|
1085
1078
|
var QuizService = class extends base_service_default {
|
|
1086
1079
|
discoverUrlPrefix() {
|
|
1087
1080
|
switch (this.environment) {
|
|
@@ -1112,11 +1105,11 @@ var QuizService = class extends base_service_default {
|
|
|
1112
1105
|
// ─────────────────────────────────────────────────────────────
|
|
1113
1106
|
async checkActiveSession({
|
|
1114
1107
|
isbn,
|
|
1115
|
-
|
|
1108
|
+
quiz,
|
|
1116
1109
|
extraHeaders,
|
|
1117
|
-
timeout =
|
|
1110
|
+
timeout = REQUEST_TIMEOUT
|
|
1118
1111
|
}) {
|
|
1119
|
-
const url = `${this.getUrlPrefix()}/isbn/${isbn}/quiz/${
|
|
1112
|
+
const url = `${this.getUrlPrefix()}/isbn/${isbn}/quiz/${quiz}`;
|
|
1120
1113
|
const headers = this.makeHeaders(extraHeaders);
|
|
1121
1114
|
const res = await this.getAsync({ url, headers, timeout });
|
|
1122
1115
|
return await res.json();
|
|
@@ -1126,7 +1119,7 @@ var QuizService = class extends base_service_default {
|
|
|
1126
1119
|
quiz,
|
|
1127
1120
|
shared,
|
|
1128
1121
|
extraHeaders,
|
|
1129
|
-
timeout =
|
|
1122
|
+
timeout = REQUEST_TIMEOUT
|
|
1130
1123
|
}) {
|
|
1131
1124
|
const url = shared ? `${this.getUrlPrefix()}/shared/student/${quiz}` : `${this.getUrlPrefix()}/isbn/${isbn}/quiz/${quiz}`;
|
|
1132
1125
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1138,7 +1131,7 @@ var QuizService = class extends base_service_default {
|
|
|
1138
1131
|
quizUnitId,
|
|
1139
1132
|
shared,
|
|
1140
1133
|
extraHeaders,
|
|
1141
|
-
timeout =
|
|
1134
|
+
timeout = REQUEST_TIMEOUT
|
|
1142
1135
|
}) {
|
|
1143
1136
|
const url = shared ? `${this.getUrlPrefix()}/shared/student/${quizUnitId}` : `${this.getUrlPrefix()}/isbn/${isbn}/student/${quizUnitId}`;
|
|
1144
1137
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1150,7 +1143,7 @@ var QuizService = class extends base_service_default {
|
|
|
1150
1143
|
quizUnitId,
|
|
1151
1144
|
questionID,
|
|
1152
1145
|
extraHeaders,
|
|
1153
|
-
timeout =
|
|
1146
|
+
timeout = REQUEST_TIMEOUT
|
|
1154
1147
|
}) {
|
|
1155
1148
|
const url = `${this.getUrlPrefix()}/isbn/${isbn}/student/${quizUnitId}/question/${questionID}`;
|
|
1156
1149
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1168,7 +1161,7 @@ var QuizService = class extends base_service_default {
|
|
|
1168
1161
|
answer,
|
|
1169
1162
|
shared,
|
|
1170
1163
|
extraHeaders,
|
|
1171
|
-
timeout =
|
|
1164
|
+
timeout = REQUEST_TIMEOUT
|
|
1172
1165
|
}) {
|
|
1173
1166
|
const url = shared ? `${this.getUrlPrefix()}/shared/student/${quizUnitId}` : `${this.getUrlPrefix()}/isbn/${isbn}/student/${quizUnitId}`;
|
|
1174
1167
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1185,7 +1178,7 @@ var QuizService = class extends base_service_default {
|
|
|
1185
1178
|
quizUnitId,
|
|
1186
1179
|
shared,
|
|
1187
1180
|
extraHeaders,
|
|
1188
|
-
timeout =
|
|
1181
|
+
timeout = REQUEST_TIMEOUT
|
|
1189
1182
|
}) {
|
|
1190
1183
|
const url = shared ? `${this.getUrlPrefix()}/shared/student/${quizUnitId}/finish` : `${this.getUrlPrefix()}/isbn/${isbn}/student/${quizUnitId}`;
|
|
1191
1184
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1202,7 +1195,7 @@ var QuizService = class extends base_service_default {
|
|
|
1202
1195
|
quizUnitId,
|
|
1203
1196
|
shared,
|
|
1204
1197
|
extraHeaders,
|
|
1205
|
-
timeout =
|
|
1198
|
+
timeout = REQUEST_TIMEOUT
|
|
1206
1199
|
}) {
|
|
1207
1200
|
const url = shared ? `${this.getUrlPrefix()}/shared/student/${quizUnitId}/result` : `${this.getUrlPrefix()}/isbn/${isbn}/student/overview/${quizUnitId}`;
|
|
1208
1201
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1215,7 +1208,7 @@ var QuizService = class extends base_service_default {
|
|
|
1215
1208
|
async createSharedQuiz({
|
|
1216
1209
|
quizData,
|
|
1217
1210
|
extraHeaders,
|
|
1218
|
-
timeout =
|
|
1211
|
+
timeout = REQUEST_TIMEOUT
|
|
1219
1212
|
}) {
|
|
1220
1213
|
const url = `${this.getUrlPrefix()}/shared/quiz`;
|
|
1221
1214
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1232,7 +1225,7 @@ var QuizService = class extends base_service_default {
|
|
|
1232
1225
|
quizData,
|
|
1233
1226
|
action,
|
|
1234
1227
|
extraHeaders,
|
|
1235
|
-
timeout =
|
|
1228
|
+
timeout = REQUEST_TIMEOUT
|
|
1236
1229
|
}) {
|
|
1237
1230
|
const url = `${this.getUrlPrefix()}/shared/quiz/${quizSessionId}`;
|
|
1238
1231
|
const method = action === "edit" ? "PUT" : "POST";
|
|
@@ -1253,7 +1246,7 @@ var QuizService = class extends base_service_default {
|
|
|
1253
1246
|
async getTeachersQuizProblems({
|
|
1254
1247
|
quizSessionId,
|
|
1255
1248
|
extraHeaders,
|
|
1256
|
-
timeout =
|
|
1249
|
+
timeout = REQUEST_TIMEOUT
|
|
1257
1250
|
}) {
|
|
1258
1251
|
const url = `${this.getUrlPrefix()}/shared/teacher/quizzes/${quizSessionId}/problems`;
|
|
1259
1252
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1264,7 +1257,7 @@ var QuizService = class extends base_service_default {
|
|
|
1264
1257
|
quizSessionId,
|
|
1265
1258
|
quizUnitId,
|
|
1266
1259
|
extraHeaders,
|
|
1267
|
-
timeout =
|
|
1260
|
+
timeout = REQUEST_TIMEOUT
|
|
1268
1261
|
}) {
|
|
1269
1262
|
const url = `${this.getUrlPrefix()}/shared/teacher/quizzes/${quizSessionId}/units/${quizUnitId}`;
|
|
1270
1263
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1276,7 +1269,7 @@ var QuizService = class extends base_service_default {
|
|
|
1276
1269
|
questionId,
|
|
1277
1270
|
activate,
|
|
1278
1271
|
extraHeaders,
|
|
1279
|
-
timeout =
|
|
1272
|
+
timeout = REQUEST_TIMEOUT
|
|
1280
1273
|
}) {
|
|
1281
1274
|
const url = `${this.getUrlPrefix()}/shared/teacher/quiz/${quizSessionId}/question/${questionId}`;
|
|
1282
1275
|
const method = activate ? "PATCH" : "DELETE";
|
|
@@ -1291,7 +1284,7 @@ var QuizService = class extends base_service_default {
|
|
|
1291
1284
|
}
|
|
1292
1285
|
async getTeachersQuizzes({
|
|
1293
1286
|
extraHeaders,
|
|
1294
|
-
timeout =
|
|
1287
|
+
timeout = REQUEST_TIMEOUT
|
|
1295
1288
|
}) {
|
|
1296
1289
|
const url = `${this.getUrlPrefix()}/shared/teacher/quizzes`;
|
|
1297
1290
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1300,7 +1293,7 @@ var QuizService = class extends base_service_default {
|
|
|
1300
1293
|
}
|
|
1301
1294
|
async getStudentsQuizzes({
|
|
1302
1295
|
extraHeaders,
|
|
1303
|
-
timeout =
|
|
1296
|
+
timeout = REQUEST_TIMEOUT
|
|
1304
1297
|
}) {
|
|
1305
1298
|
const url = `${this.getUrlPrefix()}/shared/student/quizzes`;
|
|
1306
1299
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1310,7 +1303,7 @@ var QuizService = class extends base_service_default {
|
|
|
1310
1303
|
async getTeachersQuiz({
|
|
1311
1304
|
quizSessionId,
|
|
1312
1305
|
extraHeaders,
|
|
1313
|
-
timeout =
|
|
1306
|
+
timeout = REQUEST_TIMEOUT
|
|
1314
1307
|
}) {
|
|
1315
1308
|
const url = `${this.getUrlPrefix()}/shared/teacher/quizzes/${quizSessionId}`;
|
|
1316
1309
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1321,7 +1314,7 @@ var QuizService = class extends base_service_default {
|
|
|
1321
1314
|
quizSessionId,
|
|
1322
1315
|
archive,
|
|
1323
1316
|
extraHeaders,
|
|
1324
|
-
timeout =
|
|
1317
|
+
timeout = REQUEST_TIMEOUT
|
|
1325
1318
|
}) {
|
|
1326
1319
|
const url = `${this.getUrlPrefix()}/shared/quiz/${quizSessionId}`;
|
|
1327
1320
|
const method = archive ? "DELETE" : "PATCH";
|
|
@@ -1338,7 +1331,7 @@ var QuizService = class extends base_service_default {
|
|
|
1338
1331
|
quizSessionId,
|
|
1339
1332
|
quizUnitId,
|
|
1340
1333
|
extraHeaders,
|
|
1341
|
-
timeout =
|
|
1334
|
+
timeout = REQUEST_TIMEOUT
|
|
1342
1335
|
}) {
|
|
1343
1336
|
const url = `${this.getUrlPrefix()}/shared/teacher/quizzes/${quizSessionId}/units/${quizUnitId}`;
|
|
1344
1337
|
const headers = this.makeHeaders(extraHeaders);
|
|
@@ -1385,7 +1378,6 @@ var SolrProxyService = class extends base_service_default {
|
|
|
1385
1378
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1386
1379
|
0 && (module.exports = {
|
|
1387
1380
|
AIBotService,
|
|
1388
|
-
ApiErrors,
|
|
1389
1381
|
CookieConsentLog,
|
|
1390
1382
|
HighlightResultType,
|
|
1391
1383
|
HighlightService,
|