@instructure/athena-api-client 3.39.2 → 3.40.0
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/README.md +12 -0
- package/dist/apis/AdminApi.d.ts +17 -1
- package/dist/apis/AdminApi.js +47 -0
- package/dist/apis/QuizzesApi.d.ts +30 -1
- package/dist/apis/QuizzesApi.js +87 -0
- package/dist/apis/ResourcesApi.d.ts +11 -2
- package/dist/apis/ResourcesApi.js +13 -3
- package/dist/apis/SharedQuizzesApi.d.ts +46 -0
- package/dist/apis/SharedQuizzesApi.js +115 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/AdminApi.d.ts +17 -1
- package/dist/esm/apis/AdminApi.js +48 -1
- package/dist/esm/apis/QuizzesApi.d.ts +30 -1
- package/dist/esm/apis/QuizzesApi.js +88 -1
- package/dist/esm/apis/ResourcesApi.d.ts +11 -2
- package/dist/esm/apis/ResourcesApi.js +12 -2
- package/dist/esm/apis/SharedQuizzesApi.d.ts +46 -0
- package/dist/esm/apis/SharedQuizzesApi.js +111 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AdminPaginatedQuizParticipantSessions.d.ts +39 -0
- package/dist/esm/models/AdminPaginatedQuizParticipantSessions.js +48 -0
- package/dist/esm/models/AdminQuizParticipantSessionListItem.d.ts +84 -0
- package/dist/esm/models/AdminQuizParticipantSessionListItem.js +80 -0
- package/dist/esm/models/AdminQuizParticipantSessionScore.d.ts +44 -0
- package/dist/esm/models/AdminQuizParticipantSessionScore.js +51 -0
- package/dist/esm/models/QuizSharing.d.ts +50 -0
- package/dist/esm/models/QuizSharing.js +55 -0
- package/dist/esm/models/ResourceListItem.d.ts +16 -3
- package/dist/esm/models/ResourceListItem.js +9 -0
- package/dist/esm/models/ResourceSharing.d.ts +44 -0
- package/dist/esm/models/ResourceSharing.js +51 -0
- package/dist/esm/models/SharedQuiz.d.ts +97 -0
- package/dist/esm/models/SharedQuiz.js +90 -0
- package/dist/esm/models/UpdateQuizSharingRequest.d.ts +32 -0
- package/dist/esm/models/UpdateQuizSharingRequest.js +43 -0
- package/dist/esm/models/index.d.ts +7 -0
- package/dist/esm/models/index.js +7 -0
- package/dist/models/AdminPaginatedQuizParticipantSessions.d.ts +39 -0
- package/dist/models/AdminPaginatedQuizParticipantSessions.js +55 -0
- package/dist/models/AdminQuizParticipantSessionListItem.d.ts +84 -0
- package/dist/models/AdminQuizParticipantSessionListItem.js +88 -0
- package/dist/models/AdminQuizParticipantSessionScore.d.ts +44 -0
- package/dist/models/AdminQuizParticipantSessionScore.js +58 -0
- package/dist/models/QuizSharing.d.ts +50 -0
- package/dist/models/QuizSharing.js +62 -0
- package/dist/models/ResourceListItem.d.ts +16 -3
- package/dist/models/ResourceListItem.js +9 -0
- package/dist/models/ResourceSharing.d.ts +44 -0
- package/dist/models/ResourceSharing.js +58 -0
- package/dist/models/SharedQuiz.d.ts +97 -0
- package/dist/models/SharedQuiz.js +98 -0
- package/dist/models/UpdateQuizSharingRequest.d.ts +32 -0
- package/dist/models/UpdateQuizSharingRequest.js +50 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ All URIs are relative to *http://localhost:3000*
|
|
|
70
70
|
*AdminApi* | [**adminListActiveStreaks**](docs/AdminApi.md#adminlistactivestreaks) | **GET** /api/v1/admin/streaks/active | List all active streaks (currentDays > 0) across the account, paginated
|
|
71
71
|
*AdminApi* | [**adminListChats**](docs/AdminApi.md#adminlistchats) | **GET** /api/v1/admin/chats | List recent chats across all account users
|
|
72
72
|
*AdminApi* | [**adminListLastExchanges**](docs/AdminApi.md#adminlistlastexchanges) | **GET** /api/v1/admin/last-exchanges | List the final user message and assistant reply for low-engagement new users
|
|
73
|
+
*AdminApi* | [**adminListQuizParticipantSessions**](docs/AdminApi.md#adminlistquizparticipantsessions) | **GET** /api/v1/admin/quizzes/{quizId}/sessions | List every learner\'s sessions on a quiz within the account
|
|
73
74
|
*AdminApi* | [**adminListQuizSessions**](docs/AdminApi.md#adminlistquizsessions) | **GET** /api/v1/admin/quiz-sessions | List recent quiz sessions across all account users
|
|
74
75
|
*AdminApi* | [**adminListStudyObjectives**](docs/AdminApi.md#adminliststudyobjectives) | **GET** /api/v1/admin/study-objectives | List study objectives across all account users
|
|
75
76
|
*AdminApi* | [**adminListStudyObjectivesByUser**](docs/AdminApi.md#adminliststudyobjectivesbyuser) | **GET** /api/v1/admin/study-objectives/by-user | Per-user study-objective counts across all account users
|
|
@@ -128,13 +129,17 @@ All URIs are relative to *http://localhost:3000*
|
|
|
128
129
|
*QuizSessionsApi* | [**submitQuizResponse**](docs/QuizSessionsApi.md#submitquizresponseoperation) | **POST** /api/v1/quiz-sessions/{sessionId}/responses | Submit a quiz response
|
|
129
130
|
*QuizSessionsApi* | [**updateQuizSession**](docs/QuizSessionsApi.md#updatequizsessionoperation) | **PATCH** /api/v1/quiz-sessions/{sessionId} | Update quiz session status
|
|
130
131
|
*QuizzesApi* | [**getQuiz**](docs/QuizzesApi.md#getquiz) | **GET** /api/v1/quizzes/{quizId} | Get quiz with questions
|
|
132
|
+
*QuizzesApi* | [**getQuizSharing**](docs/QuizzesApi.md#getquizsharing) | **GET** /api/v1/quizzes/{quizId}/sharing | Get a quiz\'s sharing state
|
|
131
133
|
*QuizzesApi* | [**listQuizzes**](docs/QuizzesApi.md#listquizzes) | **GET** /api/v1/quizzes | List user quizzes
|
|
134
|
+
*QuizzesApi* | [**updateQuizSharing**](docs/QuizzesApi.md#updatequizsharingoperation) | **PATCH** /api/v1/quizzes/{quizId}/sharing | Turn link sharing on or off for a quiz
|
|
132
135
|
*ResourcesApi* | [**listResources**](docs/ResourcesApi.md#listresources) | **GET** /api/v1/resources | List the user\'s generated study resources
|
|
133
136
|
*ServiceTokensApi* | [**createServiceToken**](docs/ServiceTokensApi.md#createservicetoken) | **POST** /api/v1/tokens | Create a new service token
|
|
134
137
|
*ServiceTokensApi* | [**deleteServiceToken**](docs/ServiceTokensApi.md#deleteservicetoken) | **DELETE** /api/v1/tokens/{id} | Delete service token
|
|
135
138
|
*ServiceTokensApi* | [**getServiceToken**](docs/ServiceTokensApi.md#getservicetoken) | **GET** /api/v1/tokens/{id} | Get service token by ID
|
|
136
139
|
*ServiceTokensApi* | [**listServiceTokens**](docs/ServiceTokensApi.md#listservicetokens) | **GET** /api/v1/tokens | List all service tokens
|
|
137
140
|
*ServiceTokensApi* | [**updateServiceToken**](docs/ServiceTokensApi.md#updateservicetoken) | **PATCH** /api/v1/tokens/{id} | Update service token status
|
|
141
|
+
*SharedQuizzesApi* | [**getSharedQuiz**](docs/SharedQuizzesApi.md#getsharedquiz) | **GET** /api/v1/shared-quizzes/{token} | Resolve a quiz share link
|
|
142
|
+
*SharedQuizzesApi* | [**startSharedQuizSession**](docs/SharedQuizzesApi.md#startsharedquizsession) | **POST** /api/v1/shared-quizzes/{token}/sessions | Start or resume the caller\'s session on a shared quiz
|
|
138
143
|
*StudyObjectiveConceptsApi* | [**listStudyObjectiveConcepts**](docs/StudyObjectiveConceptsApi.md#liststudyobjectiveconcepts) | **GET** /api/v1/study-objective-concepts | List study-objective concept attachments
|
|
139
144
|
*StudyObjectiveConceptsApi* | [**triggerStudyObjectiveConceptExtraction**](docs/StudyObjectiveConceptsApi.md#triggerstudyobjectiveconceptextractionoperation) | **POST** /api/v1/study-objective-concepts/extract | Trigger study-objective concept extraction
|
|
140
145
|
*StudyObjectivesApi* | [**createObjectiveResource**](docs/StudyObjectivesApi.md#createobjectiveresource) | **POST** /api/v1/study-objectives/{studyObjectiveId}/resources | Attach a chat resource to a study objective
|
|
@@ -213,12 +218,15 @@ All URIs are relative to *http://localhost:3000*
|
|
|
213
218
|
- [AdminPaginatedActiveStreaks](docs/AdminPaginatedActiveStreaks.md)
|
|
214
219
|
- [AdminPaginatedChats](docs/AdminPaginatedChats.md)
|
|
215
220
|
- [AdminPaginatedLastExchanges](docs/AdminPaginatedLastExchanges.md)
|
|
221
|
+
- [AdminPaginatedQuizParticipantSessions](docs/AdminPaginatedQuizParticipantSessions.md)
|
|
216
222
|
- [AdminPaginatedQuizSessions](docs/AdminPaginatedQuizSessions.md)
|
|
217
223
|
- [AdminPaginatedStudyObjectiveUserCounts](docs/AdminPaginatedStudyObjectiveUserCounts.md)
|
|
218
224
|
- [AdminPaginatedStudyObjectives](docs/AdminPaginatedStudyObjectives.md)
|
|
219
225
|
- [AdminPaginatedTaxonomyEnrollments](docs/AdminPaginatedTaxonomyEnrollments.md)
|
|
220
226
|
- [AdminQuizGeneration](docs/AdminQuizGeneration.md)
|
|
221
227
|
- [AdminQuizGenerationInput](docs/AdminQuizGenerationInput.md)
|
|
228
|
+
- [AdminQuizParticipantSessionListItem](docs/AdminQuizParticipantSessionListItem.md)
|
|
229
|
+
- [AdminQuizParticipantSessionScore](docs/AdminQuizParticipantSessionScore.md)
|
|
222
230
|
- [AdminQuizSessionListItem](docs/AdminQuizSessionListItem.md)
|
|
223
231
|
- [AdminQuizSessionScore](docs/AdminQuizSessionScore.md)
|
|
224
232
|
- [AdminQuizSourceFile](docs/AdminQuizSourceFile.md)
|
|
@@ -317,17 +325,20 @@ All URIs are relative to *http://localhost:3000*
|
|
|
317
325
|
- [QuizSessionListItem](docs/QuizSessionListItem.md)
|
|
318
326
|
- [QuizSessionScore](docs/QuizSessionScore.md)
|
|
319
327
|
- [QuizSessionSummary](docs/QuizSessionSummary.md)
|
|
328
|
+
- [QuizSharing](docs/QuizSharing.md)
|
|
320
329
|
- [QuizWithQuestions](docs/QuizWithQuestions.md)
|
|
321
330
|
- [RecordQuizQuestionViewRequest](docs/RecordQuizQuestionViewRequest.md)
|
|
322
331
|
- [ResourceActivity](docs/ResourceActivity.md)
|
|
323
332
|
- [ResourceChat](docs/ResourceChat.md)
|
|
324
333
|
- [ResourceListItem](docs/ResourceListItem.md)
|
|
325
334
|
- [ResourceSession](docs/ResourceSession.md)
|
|
335
|
+
- [ResourceSharing](docs/ResourceSharing.md)
|
|
326
336
|
- [ResourceStudyObjective](docs/ResourceStudyObjective.md)
|
|
327
337
|
- [ResourceStudySpace](docs/ResourceStudySpace.md)
|
|
328
338
|
- [Score](docs/Score.md)
|
|
329
339
|
- [ScoreByTypeValue](docs/ScoreByTypeValue.md)
|
|
330
340
|
- [ServiceToken](docs/ServiceToken.md)
|
|
341
|
+
- [SharedQuiz](docs/SharedQuiz.md)
|
|
331
342
|
- [StudyObjective](docs/StudyObjective.md)
|
|
332
343
|
- [StudyObjectiveCanvasDocument](docs/StudyObjectiveCanvasDocument.md)
|
|
333
344
|
- [StudyObjectiveConceptAttachment](docs/StudyObjectiveConceptAttachment.md)
|
|
@@ -364,6 +375,7 @@ All URIs are relative to *http://localhost:3000*
|
|
|
364
375
|
- [UpdateFeatureDto](docs/UpdateFeatureDto.md)
|
|
365
376
|
- [UpdatePlanDto](docs/UpdatePlanDto.md)
|
|
366
377
|
- [UpdateQuizSessionRequest](docs/UpdateQuizSessionRequest.md)
|
|
378
|
+
- [UpdateQuizSharingRequest](docs/UpdateQuizSharingRequest.md)
|
|
367
379
|
- [UpdateStudyObjectiveDto](docs/UpdateStudyObjectiveDto.md)
|
|
368
380
|
- [UpdateStudySpaceDto](docs/UpdateStudySpaceDto.md)
|
|
369
381
|
- [UpdateTokenRequest](docs/UpdateTokenRequest.md)
|
package/dist/apis/AdminApi.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { AdminChat, AdminChatAnalysis, AdminChatCanvasUsage, AdminChatWithStats, AdminCohortStats, AdminPaginatedActiveStreaks, AdminPaginatedChats, AdminPaginatedLastExchanges, AdminPaginatedQuizSessions, AdminPaginatedStudyObjectiveUserCounts, AdminPaginatedStudyObjectives, AdminPaginatedTaxonomyEnrollments, AdminResetLearningDataResponse, AdminStreak, AdminStudyObjectiveSummary, AdminTriggerAnalysisResponse, AdminUpdateChatRequest, AdminUserActivity, AdminUserActivityTotals, AdminUserEngagement, AdminUsersActivityRequest, AdminUsersActivityTotalsRequest, QuizSessionSummary } from '../models/index';
|
|
13
|
+
import type { AdminChat, AdminChatAnalysis, AdminChatCanvasUsage, AdminChatWithStats, AdminCohortStats, AdminPaginatedActiveStreaks, AdminPaginatedChats, AdminPaginatedLastExchanges, AdminPaginatedQuizParticipantSessions, AdminPaginatedQuizSessions, AdminPaginatedStudyObjectiveUserCounts, AdminPaginatedStudyObjectives, AdminPaginatedTaxonomyEnrollments, AdminResetLearningDataResponse, AdminStreak, AdminStudyObjectiveSummary, AdminTriggerAnalysisResponse, AdminUpdateChatRequest, AdminUserActivity, AdminUserActivityTotals, AdminUserEngagement, AdminUsersActivityRequest, AdminUsersActivityTotalsRequest, QuizSessionSummary } from '../models/index';
|
|
14
14
|
export interface AdminGetChatRequest {
|
|
15
15
|
xUserId: string;
|
|
16
16
|
chatId: string;
|
|
@@ -72,6 +72,12 @@ export interface AdminListLastExchangesRequest {
|
|
|
72
72
|
maxUserMessages?: number;
|
|
73
73
|
inactiveDays?: number;
|
|
74
74
|
}
|
|
75
|
+
export interface AdminListQuizParticipantSessionsRequest {
|
|
76
|
+
xUserId: string;
|
|
77
|
+
quizId: string;
|
|
78
|
+
limit?: number;
|
|
79
|
+
cursor?: string;
|
|
80
|
+
}
|
|
75
81
|
export interface AdminListQuizSessionsRequest {
|
|
76
82
|
xUserId: string;
|
|
77
83
|
limit?: number;
|
|
@@ -239,6 +245,16 @@ export declare class AdminApi extends runtime.BaseAPI {
|
|
|
239
245
|
* List the final user message and assistant reply for low-engagement new users
|
|
240
246
|
*/
|
|
241
247
|
adminListLastExchanges(requestParameters: AdminListLastExchangesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminPaginatedLastExchanges>;
|
|
248
|
+
/**
|
|
249
|
+
* Admin-only. Returns a paginated list of all sessions on one quiz, newest first, across the quiz owner and every learner who opened it by share link. Each item identifies the learner by external id and says whether that learner is the quiz owner. Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation, so the quiz must belong to a user within the caller\'s account. Like the other admin quiz endpoints, this is not gated on the `enhanced-quizzing` feature flag.
|
|
250
|
+
* List every learner\'s sessions on a quiz within the account
|
|
251
|
+
*/
|
|
252
|
+
adminListQuizParticipantSessionsRaw(requestParameters: AdminListQuizParticipantSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminPaginatedQuizParticipantSessions>>;
|
|
253
|
+
/**
|
|
254
|
+
* Admin-only. Returns a paginated list of all sessions on one quiz, newest first, across the quiz owner and every learner who opened it by share link. Each item identifies the learner by external id and says whether that learner is the quiz owner. Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation, so the quiz must belong to a user within the caller\'s account. Like the other admin quiz endpoints, this is not gated on the `enhanced-quizzing` feature flag.
|
|
255
|
+
* List every learner\'s sessions on a quiz within the account
|
|
256
|
+
*/
|
|
257
|
+
adminListQuizParticipantSessions(requestParameters: AdminListQuizParticipantSessionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminPaginatedQuizParticipantSessions>;
|
|
242
258
|
/**
|
|
243
259
|
* Returns a paginated list of quiz sessions belonging to users within the caller\'s account, ordered by start date (newest first), with embedded quiz info, the owning user\'s external id, and a score summary (including the number of questions answered). Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation. Questions and responses are not included; fetch them per session via the summary endpoint. Like the summary endpoint, this is not gated on the `enhanced-quizzing` feature flag.
|
|
244
260
|
* List recent quiz sessions across all account users
|
package/dist/apis/AdminApi.js
CHANGED
|
@@ -579,6 +579,53 @@ class AdminApi extends runtime.BaseAPI {
|
|
|
579
579
|
return yield response.value();
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Admin-only. Returns a paginated list of all sessions on one quiz, newest first, across the quiz owner and every learner who opened it by share link. Each item identifies the learner by external id and says whether that learner is the quiz owner. Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation, so the quiz must belong to a user within the caller\'s account. Like the other admin quiz endpoints, this is not gated on the `enhanced-quizzing` feature flag.
|
|
584
|
+
* List every learner\'s sessions on a quiz within the account
|
|
585
|
+
*/
|
|
586
|
+
adminListQuizParticipantSessionsRaw(requestParameters, initOverrides) {
|
|
587
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
588
|
+
if (requestParameters['xUserId'] == null) {
|
|
589
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling adminListQuizParticipantSessions().');
|
|
590
|
+
}
|
|
591
|
+
if (requestParameters['quizId'] == null) {
|
|
592
|
+
throw new runtime.RequiredError('quizId', 'Required parameter "quizId" was null or undefined when calling adminListQuizParticipantSessions().');
|
|
593
|
+
}
|
|
594
|
+
const queryParameters = {};
|
|
595
|
+
if (requestParameters['limit'] != null) {
|
|
596
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
597
|
+
}
|
|
598
|
+
if (requestParameters['cursor'] != null) {
|
|
599
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
600
|
+
}
|
|
601
|
+
const headerParameters = {};
|
|
602
|
+
if (requestParameters['xUserId'] != null) {
|
|
603
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
604
|
+
}
|
|
605
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
606
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
607
|
+
}
|
|
608
|
+
let urlPath = `/api/v1/admin/quizzes/{quizId}/sessions`;
|
|
609
|
+
urlPath = urlPath.replace(`{${"quizId"}}`, encodeURIComponent(String(requestParameters['quizId'])));
|
|
610
|
+
const response = yield this.request({
|
|
611
|
+
path: urlPath,
|
|
612
|
+
method: 'GET',
|
|
613
|
+
headers: headerParameters,
|
|
614
|
+
query: queryParameters,
|
|
615
|
+
}, initOverrides);
|
|
616
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AdminPaginatedQuizParticipantSessionsFromJSON)(jsonValue));
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Admin-only. Returns a paginated list of all sessions on one quiz, newest first, across the quiz owner and every learner who opened it by share link. Each item identifies the learner by external id and says whether that learner is the quiz owner. Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation, so the quiz must belong to a user within the caller\'s account. Like the other admin quiz endpoints, this is not gated on the `enhanced-quizzing` feature flag.
|
|
621
|
+
* List every learner\'s sessions on a quiz within the account
|
|
622
|
+
*/
|
|
623
|
+
adminListQuizParticipantSessions(requestParameters, initOverrides) {
|
|
624
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
625
|
+
const response = yield this.adminListQuizParticipantSessionsRaw(requestParameters, initOverrides);
|
|
626
|
+
return yield response.value();
|
|
627
|
+
});
|
|
628
|
+
}
|
|
582
629
|
/**
|
|
583
630
|
* Returns a paginated list of quiz sessions belonging to users within the caller\'s account, ordered by start date (newest first), with embedded quiz info, the owning user\'s external id, and a score summary (including the number of questions answered). Intended for admin-style views in calling applications; authorization on whether the calling user is allowed to act as an admin is the calling application\'s responsibility - this endpoint only enforces account isolation. Questions and responses are not included; fetch them per session via the summary endpoint. Like the summary endpoint, this is not gated on the `enhanced-quizzing` feature flag.
|
|
584
631
|
* List recent quiz sessions across all account users
|
|
@@ -10,17 +10,26 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { PaginatedQuizzes, QuizWithQuestions } from '../models/index';
|
|
13
|
+
import type { PaginatedQuizzes, QuizSharing, QuizWithQuestions, UpdateQuizSharingRequest } from '../models/index';
|
|
14
14
|
export interface GetQuizRequest {
|
|
15
15
|
quizId: string;
|
|
16
16
|
xUserId: string;
|
|
17
17
|
}
|
|
18
|
+
export interface GetQuizSharingRequest {
|
|
19
|
+
quizId: string;
|
|
20
|
+
xUserId: string;
|
|
21
|
+
}
|
|
18
22
|
export interface ListQuizzesRequest {
|
|
19
23
|
xUserId: string;
|
|
20
24
|
limit?: number;
|
|
21
25
|
cursor?: string;
|
|
22
26
|
mode?: ListQuizzesModeEnum;
|
|
23
27
|
}
|
|
28
|
+
export interface UpdateQuizSharingOperationRequest {
|
|
29
|
+
quizId: string;
|
|
30
|
+
xUserId: string;
|
|
31
|
+
updateQuizSharingRequest: UpdateQuizSharingRequest;
|
|
32
|
+
}
|
|
24
33
|
/**
|
|
25
34
|
*
|
|
26
35
|
*/
|
|
@@ -35,6 +44,16 @@ export declare class QuizzesApi extends runtime.BaseAPI {
|
|
|
35
44
|
* Get quiz with questions
|
|
36
45
|
*/
|
|
37
46
|
getQuiz(requestParameters: GetQuizRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QuizWithQuestions>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns whether the quiz is open to other learners by link, and the link token if so. Only the quiz owner can read this.
|
|
49
|
+
* Get a quiz\'s sharing state
|
|
50
|
+
*/
|
|
51
|
+
getQuizSharingRaw(requestParameters: GetQuizSharingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QuizSharing>>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns whether the quiz is open to other learners by link, and the link token if so. Only the quiz owner can read this.
|
|
54
|
+
* Get a quiz\'s sharing state
|
|
55
|
+
*/
|
|
56
|
+
getQuizSharing(requestParameters: GetQuizSharingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QuizSharing>;
|
|
38
57
|
/**
|
|
39
58
|
* Returns a paginated list of quizzes owned by the authenticated user, ordered by creation date (newest first).
|
|
40
59
|
* List user quizzes
|
|
@@ -45,6 +64,16 @@ export declare class QuizzesApi extends runtime.BaseAPI {
|
|
|
45
64
|
* List user quizzes
|
|
46
65
|
*/
|
|
47
66
|
listQuizzes(requestParameters: ListQuizzesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedQuizzes>;
|
|
67
|
+
/**
|
|
68
|
+
* Enabling issues a link token other learners can redeem to take the quiz under their own sessions; enabling an already-shared quiz keeps its token. Disabling revokes the token so the link stops resolving. Sessions learners already started stay theirs. Only the quiz owner can change this.
|
|
69
|
+
* Turn link sharing on or off for a quiz
|
|
70
|
+
*/
|
|
71
|
+
updateQuizSharingRaw(requestParameters: UpdateQuizSharingOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QuizSharing>>;
|
|
72
|
+
/**
|
|
73
|
+
* Enabling issues a link token other learners can redeem to take the quiz under their own sessions; enabling an already-shared quiz keeps its token. Disabling revokes the token so the link stops resolving. Sessions learners already started stay theirs. Only the quiz owner can change this.
|
|
74
|
+
* Turn link sharing on or off for a quiz
|
|
75
|
+
*/
|
|
76
|
+
updateQuizSharing(requestParameters: UpdateQuizSharingOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QuizSharing>;
|
|
48
77
|
}
|
|
49
78
|
/**
|
|
50
79
|
* @export
|
package/dist/apis/QuizzesApi.js
CHANGED
|
@@ -70,6 +70,47 @@ class QuizzesApi extends runtime.BaseAPI {
|
|
|
70
70
|
return yield response.value();
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns whether the quiz is open to other learners by link, and the link token if so. Only the quiz owner can read this.
|
|
75
|
+
* Get a quiz\'s sharing state
|
|
76
|
+
*/
|
|
77
|
+
getQuizSharingRaw(requestParameters, initOverrides) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
if (requestParameters['quizId'] == null) {
|
|
80
|
+
throw new runtime.RequiredError('quizId', 'Required parameter "quizId" was null or undefined when calling getQuizSharing().');
|
|
81
|
+
}
|
|
82
|
+
if (requestParameters['xUserId'] == null) {
|
|
83
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getQuizSharing().');
|
|
84
|
+
}
|
|
85
|
+
const queryParameters = {};
|
|
86
|
+
const headerParameters = {};
|
|
87
|
+
if (requestParameters['xUserId'] != null) {
|
|
88
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
89
|
+
}
|
|
90
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
91
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
92
|
+
}
|
|
93
|
+
let urlPath = `/api/v1/quizzes/{quizId}/sharing`;
|
|
94
|
+
urlPath = urlPath.replace(`{${"quizId"}}`, encodeURIComponent(String(requestParameters['quizId'])));
|
|
95
|
+
const response = yield this.request({
|
|
96
|
+
path: urlPath,
|
|
97
|
+
method: 'GET',
|
|
98
|
+
headers: headerParameters,
|
|
99
|
+
query: queryParameters,
|
|
100
|
+
}, initOverrides);
|
|
101
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.QuizSharingFromJSON)(jsonValue));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns whether the quiz is open to other learners by link, and the link token if so. Only the quiz owner can read this.
|
|
106
|
+
* Get a quiz\'s sharing state
|
|
107
|
+
*/
|
|
108
|
+
getQuizSharing(requestParameters, initOverrides) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const response = yield this.getQuizSharingRaw(requestParameters, initOverrides);
|
|
111
|
+
return yield response.value();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
73
114
|
/**
|
|
74
115
|
* Returns a paginated list of quizzes owned by the authenticated user, ordered by creation date (newest first).
|
|
75
116
|
* List user quizzes
|
|
@@ -116,6 +157,52 @@ class QuizzesApi extends runtime.BaseAPI {
|
|
|
116
157
|
return yield response.value();
|
|
117
158
|
});
|
|
118
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Enabling issues a link token other learners can redeem to take the quiz under their own sessions; enabling an already-shared quiz keeps its token. Disabling revokes the token so the link stops resolving. Sessions learners already started stay theirs. Only the quiz owner can change this.
|
|
162
|
+
* Turn link sharing on or off for a quiz
|
|
163
|
+
*/
|
|
164
|
+
updateQuizSharingRaw(requestParameters, initOverrides) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
if (requestParameters['quizId'] == null) {
|
|
167
|
+
throw new runtime.RequiredError('quizId', 'Required parameter "quizId" was null or undefined when calling updateQuizSharing().');
|
|
168
|
+
}
|
|
169
|
+
if (requestParameters['xUserId'] == null) {
|
|
170
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling updateQuizSharing().');
|
|
171
|
+
}
|
|
172
|
+
if (requestParameters['updateQuizSharingRequest'] == null) {
|
|
173
|
+
throw new runtime.RequiredError('updateQuizSharingRequest', 'Required parameter "updateQuizSharingRequest" was null or undefined when calling updateQuizSharing().');
|
|
174
|
+
}
|
|
175
|
+
const queryParameters = {};
|
|
176
|
+
const headerParameters = {};
|
|
177
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
178
|
+
if (requestParameters['xUserId'] != null) {
|
|
179
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
180
|
+
}
|
|
181
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
182
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
183
|
+
}
|
|
184
|
+
let urlPath = `/api/v1/quizzes/{quizId}/sharing`;
|
|
185
|
+
urlPath = urlPath.replace(`{${"quizId"}}`, encodeURIComponent(String(requestParameters['quizId'])));
|
|
186
|
+
const response = yield this.request({
|
|
187
|
+
path: urlPath,
|
|
188
|
+
method: 'PATCH',
|
|
189
|
+
headers: headerParameters,
|
|
190
|
+
query: queryParameters,
|
|
191
|
+
body: (0, index_1.UpdateQuizSharingRequestToJSON)(requestParameters['updateQuizSharingRequest']),
|
|
192
|
+
}, initOverrides);
|
|
193
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.QuizSharingFromJSON)(jsonValue));
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Enabling issues a link token other learners can redeem to take the quiz under their own sessions; enabling an already-shared quiz keeps its token. Disabling revokes the token so the link stops resolving. Sessions learners already started stay theirs. Only the quiz owner can change this.
|
|
198
|
+
* Turn link sharing on or off for a quiz
|
|
199
|
+
*/
|
|
200
|
+
updateQuizSharing(requestParameters, initOverrides) {
|
|
201
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
const response = yield this.updateQuizSharingRaw(requestParameters, initOverrides);
|
|
203
|
+
return yield response.value();
|
|
204
|
+
});
|
|
205
|
+
}
|
|
119
206
|
}
|
|
120
207
|
exports.QuizzesApi = QuizzesApi;
|
|
121
208
|
/**
|
|
@@ -16,6 +16,7 @@ export interface ListResourcesRequest {
|
|
|
16
16
|
limit?: number;
|
|
17
17
|
cursor?: string;
|
|
18
18
|
type?: ListResourcesTypeEnum;
|
|
19
|
+
ownership?: ListResourcesOwnershipEnum;
|
|
19
20
|
courseId?: string;
|
|
20
21
|
chatId?: string;
|
|
21
22
|
studySpaceId?: string;
|
|
@@ -26,12 +27,12 @@ export interface ListResourcesRequest {
|
|
|
26
27
|
*/
|
|
27
28
|
export declare class ResourcesApi extends runtime.BaseAPI {
|
|
28
29
|
/**
|
|
29
|
-
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request.
|
|
30
|
+
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request. By default lists what the user generated; `ownership=shared` lists other learners\' resources the user has opened through a share link, with the owner\'s chat, objective, space, and course withheld.
|
|
30
31
|
* List the user\'s generated study resources
|
|
31
32
|
*/
|
|
32
33
|
listResourcesRaw(requestParameters: ListResourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResources>>;
|
|
33
34
|
/**
|
|
34
|
-
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request.
|
|
35
|
+
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request. By default lists what the user generated; `ownership=shared` lists other learners\' resources the user has opened through a share link, with the owner\'s chat, objective, space, and course withheld.
|
|
35
36
|
* List the user\'s generated study resources
|
|
36
37
|
*/
|
|
37
38
|
listResources(requestParameters: ListResourcesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResources>;
|
|
@@ -44,6 +45,14 @@ export declare const ListResourcesTypeEnum: {
|
|
|
44
45
|
readonly Flashcards: "flashcards";
|
|
45
46
|
};
|
|
46
47
|
export type ListResourcesTypeEnum = typeof ListResourcesTypeEnum[keyof typeof ListResourcesTypeEnum];
|
|
48
|
+
/**
|
|
49
|
+
* @export
|
|
50
|
+
*/
|
|
51
|
+
export declare const ListResourcesOwnershipEnum: {
|
|
52
|
+
readonly Owned: "owned";
|
|
53
|
+
readonly Shared: "shared";
|
|
54
|
+
};
|
|
55
|
+
export type ListResourcesOwnershipEnum = typeof ListResourcesOwnershipEnum[keyof typeof ListResourcesOwnershipEnum];
|
|
47
56
|
/**
|
|
48
57
|
* @export
|
|
49
58
|
*/
|
|
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ListResourcesProgressEnum = exports.ListResourcesTypeEnum = exports.ResourcesApi = void 0;
|
|
25
|
+
exports.ListResourcesProgressEnum = exports.ListResourcesOwnershipEnum = exports.ListResourcesTypeEnum = exports.ResourcesApi = void 0;
|
|
26
26
|
const runtime = require("../runtime");
|
|
27
27
|
const index_1 = require("../models/index");
|
|
28
28
|
/**
|
|
@@ -30,7 +30,7 @@ const index_1 = require("../models/index");
|
|
|
30
30
|
*/
|
|
31
31
|
class ResourcesApi extends runtime.BaseAPI {
|
|
32
32
|
/**
|
|
33
|
-
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request.
|
|
33
|
+
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request. By default lists what the user generated; `ownership=shared` lists other learners\' resources the user has opened through a share link, with the owner\'s chat, objective, space, and course withheld.
|
|
34
34
|
* List the user\'s generated study resources
|
|
35
35
|
*/
|
|
36
36
|
listResourcesRaw(requestParameters, initOverrides) {
|
|
@@ -48,6 +48,9 @@ class ResourcesApi extends runtime.BaseAPI {
|
|
|
48
48
|
if (requestParameters['type'] != null) {
|
|
49
49
|
queryParameters['type'] = requestParameters['type'];
|
|
50
50
|
}
|
|
51
|
+
if (requestParameters['ownership'] != null) {
|
|
52
|
+
queryParameters['ownership'] = requestParameters['ownership'];
|
|
53
|
+
}
|
|
51
54
|
if (requestParameters['courseId'] != null) {
|
|
52
55
|
queryParameters['courseId'] = requestParameters['courseId'];
|
|
53
56
|
}
|
|
@@ -78,7 +81,7 @@ class ResourcesApi extends runtime.BaseAPI {
|
|
|
78
81
|
});
|
|
79
82
|
}
|
|
80
83
|
/**
|
|
81
|
-
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request.
|
|
84
|
+
* Returns the authenticated user\'s quizzes and flashcard sets, newest first, each with its question rollup, originating chat, course attribution, study objective, and session activity. Intended for a library view, so every row carries enough to render a card without a follow-up request. By default lists what the user generated; `ownership=shared` lists other learners\' resources the user has opened through a share link, with the owner\'s chat, objective, space, and course withheld.
|
|
82
85
|
* List the user\'s generated study resources
|
|
83
86
|
*/
|
|
84
87
|
listResources(requestParameters, initOverrides) {
|
|
@@ -96,6 +99,13 @@ exports.ListResourcesTypeEnum = {
|
|
|
96
99
|
Quiz: 'quiz',
|
|
97
100
|
Flashcards: 'flashcards'
|
|
98
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* @export
|
|
104
|
+
*/
|
|
105
|
+
exports.ListResourcesOwnershipEnum = {
|
|
106
|
+
Owned: 'owned',
|
|
107
|
+
Shared: 'shared'
|
|
108
|
+
};
|
|
99
109
|
/**
|
|
100
110
|
* @export
|
|
101
111
|
*/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Athena API
|
|
3
|
+
* REST API for the Athena system
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { QuizSession, SharedQuiz } from '../models/index';
|
|
14
|
+
export interface GetSharedQuizRequest {
|
|
15
|
+
token: string;
|
|
16
|
+
xUserId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StartSharedQuizSessionRequest {
|
|
19
|
+
token: string;
|
|
20
|
+
xUserId: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export declare class SharedQuizzesApi extends runtime.BaseAPI {
|
|
26
|
+
/**
|
|
27
|
+
* Returns the quiz behind a share link: enough to render a landing card and start a session, without identifying the owner.
|
|
28
|
+
* Resolve a quiz share link
|
|
29
|
+
*/
|
|
30
|
+
getSharedQuizRaw(requestParameters: GetSharedQuizRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SharedQuiz>>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the quiz behind a share link: enough to render a landing card and start a session, without identifying the owner.
|
|
33
|
+
* Resolve a quiz share link
|
|
34
|
+
*/
|
|
35
|
+
getSharedQuiz(requestParameters: GetSharedQuizRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SharedQuiz>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the caller\'s active session on the quiz behind the link, creating one if none is active. The session belongs to the caller; its answers never touch the owner\'s progress. Returns 201 whether the session was created or resumed.
|
|
38
|
+
* Start or resume the caller\'s session on a shared quiz
|
|
39
|
+
*/
|
|
40
|
+
startSharedQuizSessionRaw(requestParameters: StartSharedQuizSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<QuizSession>>;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the caller\'s active session on the quiz behind the link, creating one if none is active. The session belongs to the caller; its answers never touch the owner\'s progress. Returns 201 whether the session was created or resumed.
|
|
43
|
+
* Start or resume the caller\'s session on a shared quiz
|
|
44
|
+
*/
|
|
45
|
+
startSharedQuizSession(requestParameters: StartSharedQuizSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<QuizSession>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Athena API
|
|
6
|
+
* REST API for the Athena system
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.SharedQuizzesApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class SharedQuizzesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns the quiz behind a share link: enough to render a landing card and start a session, without identifying the owner.
|
|
34
|
+
* Resolve a quiz share link
|
|
35
|
+
*/
|
|
36
|
+
getSharedQuizRaw(requestParameters, initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (requestParameters['token'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('token', 'Required parameter "token" was null or undefined when calling getSharedQuiz().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['xUserId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getSharedQuiz().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
if (requestParameters['xUserId'] != null) {
|
|
47
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
48
|
+
}
|
|
49
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
50
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
51
|
+
}
|
|
52
|
+
let urlPath = `/api/v1/shared-quizzes/{token}`;
|
|
53
|
+
urlPath = urlPath.replace(`{${"token"}}`, encodeURIComponent(String(requestParameters['token'])));
|
|
54
|
+
const response = yield this.request({
|
|
55
|
+
path: urlPath,
|
|
56
|
+
method: 'GET',
|
|
57
|
+
headers: headerParameters,
|
|
58
|
+
query: queryParameters,
|
|
59
|
+
}, initOverrides);
|
|
60
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.SharedQuizFromJSON)(jsonValue));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns the quiz behind a share link: enough to render a landing card and start a session, without identifying the owner.
|
|
65
|
+
* Resolve a quiz share link
|
|
66
|
+
*/
|
|
67
|
+
getSharedQuiz(requestParameters, initOverrides) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const response = yield this.getSharedQuizRaw(requestParameters, initOverrides);
|
|
70
|
+
return yield response.value();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the caller\'s active session on the quiz behind the link, creating one if none is active. The session belongs to the caller; its answers never touch the owner\'s progress. Returns 201 whether the session was created or resumed.
|
|
75
|
+
* Start or resume the caller\'s session on a shared quiz
|
|
76
|
+
*/
|
|
77
|
+
startSharedQuizSessionRaw(requestParameters, initOverrides) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
if (requestParameters['token'] == null) {
|
|
80
|
+
throw new runtime.RequiredError('token', 'Required parameter "token" was null or undefined when calling startSharedQuizSession().');
|
|
81
|
+
}
|
|
82
|
+
if (requestParameters['xUserId'] == null) {
|
|
83
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling startSharedQuizSession().');
|
|
84
|
+
}
|
|
85
|
+
const queryParameters = {};
|
|
86
|
+
const headerParameters = {};
|
|
87
|
+
if (requestParameters['xUserId'] != null) {
|
|
88
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
89
|
+
}
|
|
90
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
91
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
92
|
+
}
|
|
93
|
+
let urlPath = `/api/v1/shared-quizzes/{token}/sessions`;
|
|
94
|
+
urlPath = urlPath.replace(`{${"token"}}`, encodeURIComponent(String(requestParameters['token'])));
|
|
95
|
+
const response = yield this.request({
|
|
96
|
+
path: urlPath,
|
|
97
|
+
method: 'POST',
|
|
98
|
+
headers: headerParameters,
|
|
99
|
+
query: queryParameters,
|
|
100
|
+
}, initOverrides);
|
|
101
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.QuizSessionFromJSON)(jsonValue));
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns the caller\'s active session on the quiz behind the link, creating one if none is active. The session belongs to the caller; its answers never touch the owner\'s progress. Returns 201 whether the session was created or resumed.
|
|
106
|
+
* Start or resume the caller\'s session on a shared quiz
|
|
107
|
+
*/
|
|
108
|
+
startSharedQuizSession(requestParameters, initOverrides) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const response = yield this.startSharedQuizSessionRaw(requestParameters, initOverrides);
|
|
111
|
+
return yield response.value();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.SharedQuizzesApi = SharedQuizzesApi;
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './QuizSessionsApi';
|
|
|
20
20
|
export * from './QuizzesApi';
|
|
21
21
|
export * from './ResourcesApi';
|
|
22
22
|
export * from './ServiceTokensApi';
|
|
23
|
+
export * from './SharedQuizzesApi';
|
|
23
24
|
export * from './StudyObjectiveConceptsApi';
|
|
24
25
|
export * from './StudyObjectivesApi';
|
|
25
26
|
export * from './StudyPlansApi';
|
package/dist/apis/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __exportStar(require("./QuizSessionsApi"), exports);
|
|
|
38
38
|
__exportStar(require("./QuizzesApi"), exports);
|
|
39
39
|
__exportStar(require("./ResourcesApi"), exports);
|
|
40
40
|
__exportStar(require("./ServiceTokensApi"), exports);
|
|
41
|
+
__exportStar(require("./SharedQuizzesApi"), exports);
|
|
41
42
|
__exportStar(require("./StudyObjectiveConceptsApi"), exports);
|
|
42
43
|
__exportStar(require("./StudyObjectivesApi"), exports);
|
|
43
44
|
__exportStar(require("./StudyPlansApi"), exports);
|