@easyedu/js-lsm-api 1.112.0 → 1.113.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 +4 -3
- package/dist/apis/QuestionApi.d.ts +17 -2
- package/dist/apis/QuestionApi.js +41 -2
- package/dist/esm/apis/QuestionApi.d.ts +17 -2
- package/dist/esm/apis/QuestionApi.js +41 -2
- package/dist/esm/models/GetQuestion.d.ts +13 -1
- package/dist/esm/models/GetQuestion.js +5 -0
- package/dist/esm/models/PutQuestion.d.ts +6 -0
- package/dist/esm/models/PutQuestion.js +2 -0
- package/dist/models/GetQuestion.d.ts +13 -1
- package/dist/models/GetQuestion.js +5 -0
- package/dist/models/PutQuestion.d.ts +6 -0
- package/dist/models/PutQuestion.js +2 -0
- package/docs/GetQuestion.md +4 -0
- package/docs/PutQuestion.md +2 -0
- package/docs/QuestionApi.md +70 -2
- package/package.json +1 -1
- package/src/apis/QuestionApi.ts +51 -2
- package/src/models/GetQuestion.ts +17 -1
- package/src/models/PutQuestion.ts +8 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @easyedu/js-lsm-api@1.
|
|
1
|
+
# @easyedu/js-lsm-api@1.113.0
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the sbzw93t49b.execute-api.us-east-2.amazonaws.com API.
|
|
4
4
|
|
|
@@ -328,8 +328,9 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
328
328
|
*QuestionApi* | [**deleteQuestion**](docs/QuestionApi.md#deletequestion) | **DELETE** /questions/{questionId} | Delete a question by ID
|
|
329
329
|
*QuestionApi* | [**getQuestion**](docs/QuestionApi.md#getquestion) | **GET** /questions/{questionId} | Get a question by ID
|
|
330
330
|
*QuestionApi* | [**getQuestionList**](docs/QuestionApi.md#getquestionlist) | **GET** /questions | Get list of questions with filtering and pagination
|
|
331
|
+
*QuestionApi* | [**getQuestionVersions**](docs/QuestionApi.md#getquestionversions) | **GET** /questions/{questionId}/versions | Get all versions of a question
|
|
331
332
|
*QuestionApi* | [**postQuestion**](docs/QuestionApi.md#postquestion) | **POST** /questions | Create a new question
|
|
332
|
-
*QuestionApi* | [**putQuestion**](docs/QuestionApi.md#putquestion) | **PUT** /questions/{questionId} |
|
|
333
|
+
*QuestionApi* | [**putQuestion**](docs/QuestionApi.md#putquestion) | **PUT** /questions/{questionId} | Create the next version of a question
|
|
333
334
|
*QuestionImportApi* | [**postQuestionImportCommit**](docs/QuestionImportApi.md#postquestionimportcommit) | **POST** /question-imports/commit | Validate and atomically create, version, or skip approved question drafts
|
|
334
335
|
*QuestionImportApi* | [**postQuestionImportParse**](docs/QuestionImportApi.md#postquestionimportparse) | **POST** /question-imports/parse | Parse a question document into stateless review drafts
|
|
335
336
|
*ReportingApi* | [**getCourseVersionReporting**](docs/ReportingApi.md#getcourseversionreporting) | **GET** /courses/{courseId}/versions/{courseVersionId}/reporting | Get instructor reporting for one explicit course version
|
|
@@ -701,7 +702,7 @@ and is automatically generated by the
|
|
|
701
702
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
702
703
|
|
|
703
704
|
- API version: `1.0.0`
|
|
704
|
-
- Package version: `1.
|
|
705
|
+
- Package version: `1.113.0`
|
|
705
706
|
- Generator version: `7.22.0`
|
|
706
707
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
707
708
|
|
|
@@ -27,6 +27,9 @@ export interface GetQuestionListRequest {
|
|
|
27
27
|
tagId?: string;
|
|
28
28
|
search?: string;
|
|
29
29
|
}
|
|
30
|
+
export interface GetQuestionVersionsRequest {
|
|
31
|
+
questionId: string;
|
|
32
|
+
}
|
|
30
33
|
export interface PostQuestionRequest {
|
|
31
34
|
postQuestion: PostQuestion;
|
|
32
35
|
}
|
|
@@ -74,6 +77,18 @@ export declare class QuestionApi extends runtime.BaseAPI {
|
|
|
74
77
|
* Get list of questions with filtering and pagination
|
|
75
78
|
*/
|
|
76
79
|
getQuestionList(requestParameters?: GetQuestionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetQuestionList>;
|
|
80
|
+
/**
|
|
81
|
+
* Creates request options for getQuestionVersions without sending the request
|
|
82
|
+
*/
|
|
83
|
+
getQuestionVersionsRequestOpts(requestParameters: GetQuestionVersionsRequest): Promise<runtime.RequestOpts>;
|
|
84
|
+
/**
|
|
85
|
+
* Get all versions of a question
|
|
86
|
+
*/
|
|
87
|
+
getQuestionVersionsRaw(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetQuestion>>>;
|
|
88
|
+
/**
|
|
89
|
+
* Get all versions of a question
|
|
90
|
+
*/
|
|
91
|
+
getQuestionVersions(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetQuestion>>;
|
|
77
92
|
/**
|
|
78
93
|
* Creates request options for postQuestion without sending the request
|
|
79
94
|
*/
|
|
@@ -91,11 +106,11 @@ export declare class QuestionApi extends runtime.BaseAPI {
|
|
|
91
106
|
*/
|
|
92
107
|
putQuestionRequestOpts(requestParameters: PutQuestionRequest): Promise<runtime.RequestOpts>;
|
|
93
108
|
/**
|
|
94
|
-
*
|
|
109
|
+
* Create the next version of a question
|
|
95
110
|
*/
|
|
96
111
|
putQuestionRaw(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetQuestion>>;
|
|
97
112
|
/**
|
|
98
|
-
*
|
|
113
|
+
* Create the next version of a question
|
|
99
114
|
*/
|
|
100
115
|
putQuestion(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetQuestion>;
|
|
101
116
|
}
|
package/dist/apis/QuestionApi.js
CHANGED
|
@@ -159,6 +159,45 @@ class QuestionApi extends runtime.BaseAPI {
|
|
|
159
159
|
return yield response.value();
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Creates request options for getQuestionVersions without sending the request
|
|
164
|
+
*/
|
|
165
|
+
getQuestionVersionsRequestOpts(requestParameters) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
if (requestParameters['questionId'] == null) {
|
|
168
|
+
throw new runtime.RequiredError('questionId', 'Required parameter "questionId" was null or undefined when calling getQuestionVersions().');
|
|
169
|
+
}
|
|
170
|
+
const queryParameters = {};
|
|
171
|
+
const headerParameters = {};
|
|
172
|
+
let urlPath = `/questions/{questionId}/versions`;
|
|
173
|
+
urlPath = urlPath.replace('{questionId}', encodeURIComponent(String(requestParameters['questionId'])));
|
|
174
|
+
return {
|
|
175
|
+
path: urlPath,
|
|
176
|
+
method: 'GET',
|
|
177
|
+
headers: headerParameters,
|
|
178
|
+
query: queryParameters,
|
|
179
|
+
};
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Get all versions of a question
|
|
184
|
+
*/
|
|
185
|
+
getQuestionVersionsRaw(requestParameters, initOverrides) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const requestOptions = yield this.getQuestionVersionsRequestOpts(requestParameters);
|
|
188
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
189
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetQuestion_1.GetQuestionFromJSON));
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get all versions of a question
|
|
194
|
+
*/
|
|
195
|
+
getQuestionVersions(requestParameters, initOverrides) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const response = yield this.getQuestionVersionsRaw(requestParameters, initOverrides);
|
|
198
|
+
return yield response.value();
|
|
199
|
+
});
|
|
200
|
+
}
|
|
162
201
|
/**
|
|
163
202
|
* Creates request options for postQuestion without sending the request
|
|
164
203
|
*/
|
|
@@ -225,7 +264,7 @@ class QuestionApi extends runtime.BaseAPI {
|
|
|
225
264
|
});
|
|
226
265
|
}
|
|
227
266
|
/**
|
|
228
|
-
*
|
|
267
|
+
* Create the next version of a question
|
|
229
268
|
*/
|
|
230
269
|
putQuestionRaw(requestParameters, initOverrides) {
|
|
231
270
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -235,7 +274,7 @@ class QuestionApi extends runtime.BaseAPI {
|
|
|
235
274
|
});
|
|
236
275
|
}
|
|
237
276
|
/**
|
|
238
|
-
*
|
|
277
|
+
* Create the next version of a question
|
|
239
278
|
*/
|
|
240
279
|
putQuestion(requestParameters, initOverrides) {
|
|
241
280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -27,6 +27,9 @@ export interface GetQuestionListRequest {
|
|
|
27
27
|
tagId?: string;
|
|
28
28
|
search?: string;
|
|
29
29
|
}
|
|
30
|
+
export interface GetQuestionVersionsRequest {
|
|
31
|
+
questionId: string;
|
|
32
|
+
}
|
|
30
33
|
export interface PostQuestionRequest {
|
|
31
34
|
postQuestion: PostQuestion;
|
|
32
35
|
}
|
|
@@ -74,6 +77,18 @@ export declare class QuestionApi extends runtime.BaseAPI {
|
|
|
74
77
|
* Get list of questions with filtering and pagination
|
|
75
78
|
*/
|
|
76
79
|
getQuestionList(requestParameters?: GetQuestionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetQuestionList>;
|
|
80
|
+
/**
|
|
81
|
+
* Creates request options for getQuestionVersions without sending the request
|
|
82
|
+
*/
|
|
83
|
+
getQuestionVersionsRequestOpts(requestParameters: GetQuestionVersionsRequest): Promise<runtime.RequestOpts>;
|
|
84
|
+
/**
|
|
85
|
+
* Get all versions of a question
|
|
86
|
+
*/
|
|
87
|
+
getQuestionVersionsRaw(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetQuestion>>>;
|
|
88
|
+
/**
|
|
89
|
+
* Get all versions of a question
|
|
90
|
+
*/
|
|
91
|
+
getQuestionVersions(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetQuestion>>;
|
|
77
92
|
/**
|
|
78
93
|
* Creates request options for postQuestion without sending the request
|
|
79
94
|
*/
|
|
@@ -91,11 +106,11 @@ export declare class QuestionApi extends runtime.BaseAPI {
|
|
|
91
106
|
*/
|
|
92
107
|
putQuestionRequestOpts(requestParameters: PutQuestionRequest): Promise<runtime.RequestOpts>;
|
|
93
108
|
/**
|
|
94
|
-
*
|
|
109
|
+
* Create the next version of a question
|
|
95
110
|
*/
|
|
96
111
|
putQuestionRaw(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetQuestion>>;
|
|
97
112
|
/**
|
|
98
|
-
*
|
|
113
|
+
* Create the next version of a question
|
|
99
114
|
*/
|
|
100
115
|
putQuestion(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetQuestion>;
|
|
101
116
|
}
|
|
@@ -156,6 +156,45 @@ export class QuestionApi extends runtime.BaseAPI {
|
|
|
156
156
|
return yield response.value();
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Creates request options for getQuestionVersions without sending the request
|
|
161
|
+
*/
|
|
162
|
+
getQuestionVersionsRequestOpts(requestParameters) {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
if (requestParameters['questionId'] == null) {
|
|
165
|
+
throw new runtime.RequiredError('questionId', 'Required parameter "questionId" was null or undefined when calling getQuestionVersions().');
|
|
166
|
+
}
|
|
167
|
+
const queryParameters = {};
|
|
168
|
+
const headerParameters = {};
|
|
169
|
+
let urlPath = `/questions/{questionId}/versions`;
|
|
170
|
+
urlPath = urlPath.replace('{questionId}', encodeURIComponent(String(requestParameters['questionId'])));
|
|
171
|
+
return {
|
|
172
|
+
path: urlPath,
|
|
173
|
+
method: 'GET',
|
|
174
|
+
headers: headerParameters,
|
|
175
|
+
query: queryParameters,
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get all versions of a question
|
|
181
|
+
*/
|
|
182
|
+
getQuestionVersionsRaw(requestParameters, initOverrides) {
|
|
183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
const requestOptions = yield this.getQuestionVersionsRequestOpts(requestParameters);
|
|
185
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
186
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetQuestionFromJSON));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Get all versions of a question
|
|
191
|
+
*/
|
|
192
|
+
getQuestionVersions(requestParameters, initOverrides) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
const response = yield this.getQuestionVersionsRaw(requestParameters, initOverrides);
|
|
195
|
+
return yield response.value();
|
|
196
|
+
});
|
|
197
|
+
}
|
|
159
198
|
/**
|
|
160
199
|
* Creates request options for postQuestion without sending the request
|
|
161
200
|
*/
|
|
@@ -222,7 +261,7 @@ export class QuestionApi extends runtime.BaseAPI {
|
|
|
222
261
|
});
|
|
223
262
|
}
|
|
224
263
|
/**
|
|
225
|
-
*
|
|
264
|
+
* Create the next version of a question
|
|
226
265
|
*/
|
|
227
266
|
putQuestionRaw(requestParameters, initOverrides) {
|
|
228
267
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -232,7 +271,7 @@ export class QuestionApi extends runtime.BaseAPI {
|
|
|
232
271
|
});
|
|
233
272
|
}
|
|
234
273
|
/**
|
|
235
|
-
*
|
|
274
|
+
* Create the next version of a question
|
|
236
275
|
*/
|
|
237
276
|
putQuestion(requestParameters, initOverrides) {
|
|
238
277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -74,6 +74,18 @@ export interface GetQuestion {
|
|
|
74
74
|
* @memberof GetQuestion
|
|
75
75
|
*/
|
|
76
76
|
readonly versionNumber: number;
|
|
77
|
+
/**
|
|
78
|
+
* Whether this is the current editable version in the question history
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @memberof GetQuestion
|
|
81
|
+
*/
|
|
82
|
+
readonly isLatestVersion: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Optional note describing why this version was created
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @memberof GetQuestion
|
|
87
|
+
*/
|
|
88
|
+
versionCreatedReason?: string;
|
|
77
89
|
/**
|
|
78
90
|
* When the question was created
|
|
79
91
|
* @type {Date}
|
|
@@ -130,4 +142,4 @@ export declare function instanceOfGetQuestion(value: object): value is GetQuesti
|
|
|
130
142
|
export declare function GetQuestionFromJSON(json: any): GetQuestion;
|
|
131
143
|
export declare function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetQuestion;
|
|
132
144
|
export declare function GetQuestionToJSON(json: any): GetQuestion;
|
|
133
|
-
export declare function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id' | 'version_number' | 'created_date' | 'updated_date' | 'created_by' | 'quiz_count' | 'quizzes'> | null, ignoreDiscriminator?: boolean): any;
|
|
145
|
+
export declare function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id' | 'version_number' | 'is_latest_version' | 'created_date' | 'updated_date' | 'created_by' | 'quiz_count' | 'quizzes'> | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -39,6 +39,8 @@ export function instanceOfGetQuestion(value) {
|
|
|
39
39
|
return false;
|
|
40
40
|
if (!('versionNumber' in value) || value['versionNumber'] === undefined)
|
|
41
41
|
return false;
|
|
42
|
+
if (!('isLatestVersion' in value) || value['isLatestVersion'] === undefined)
|
|
43
|
+
return false;
|
|
42
44
|
if (!('createdDate' in value) || value['createdDate'] === undefined)
|
|
43
45
|
return false;
|
|
44
46
|
if (!('updatedDate' in value) || value['updatedDate'] === undefined)
|
|
@@ -62,6 +64,8 @@ export function GetQuestionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
62
64
|
'tags': json['tags'] == null ? undefined : (json['tags'].map(ContentLibraryTagFromJSON)),
|
|
63
65
|
'version': json['version'] == null ? undefined : json['version'],
|
|
64
66
|
'versionNumber': json['version_number'],
|
|
67
|
+
'isLatestVersion': json['is_latest_version'],
|
|
68
|
+
'versionCreatedReason': json['version_created_reason'] == null ? undefined : json['version_created_reason'],
|
|
65
69
|
'createdDate': (new Date(json['created_date'])),
|
|
66
70
|
'updatedDate': (new Date(json['updated_date'])),
|
|
67
71
|
'createdBy': json['created_by'] == null ? undefined : json['created_by'],
|
|
@@ -85,6 +89,7 @@ export function GetQuestionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
85
89
|
'explanation': RichTextDocumentToJSON(value['explanation']),
|
|
86
90
|
'tags': value['tags'] == null ? undefined : (value['tags'].map(ContentLibraryTagToJSON)),
|
|
87
91
|
'version': value['version'],
|
|
92
|
+
'version_created_reason': value['versionCreatedReason'],
|
|
88
93
|
'import_source': QuestionImportSourceSummaryToJSON(value['importSource']),
|
|
89
94
|
};
|
|
90
95
|
}
|
|
@@ -59,6 +59,12 @@ export interface PutQuestion {
|
|
|
59
59
|
* @memberof PutQuestion
|
|
60
60
|
*/
|
|
61
61
|
version?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional note describing the changes in the new version
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @memberof PutQuestion
|
|
66
|
+
*/
|
|
67
|
+
versionReason?: string;
|
|
62
68
|
}
|
|
63
69
|
/**
|
|
64
70
|
* @export
|
|
@@ -45,6 +45,7 @@ export function PutQuestionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
45
45
|
'explanation': json['explanation'] == null ? undefined : RichTextInputFromJSON(json['explanation']),
|
|
46
46
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
47
47
|
'version': json['version'] == null ? undefined : json['version'],
|
|
48
|
+
'versionReason': json['version_reason'] == null ? undefined : json['version_reason'],
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
export function PutQuestionToJSON(json) {
|
|
@@ -62,5 +63,6 @@ export function PutQuestionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
62
63
|
'explanation': RichTextInputToJSON(value['explanation']),
|
|
63
64
|
'tags': value['tags'],
|
|
64
65
|
'version': value['version'],
|
|
66
|
+
'version_reason': value['versionReason'],
|
|
65
67
|
};
|
|
66
68
|
}
|
|
@@ -74,6 +74,18 @@ export interface GetQuestion {
|
|
|
74
74
|
* @memberof GetQuestion
|
|
75
75
|
*/
|
|
76
76
|
readonly versionNumber: number;
|
|
77
|
+
/**
|
|
78
|
+
* Whether this is the current editable version in the question history
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @memberof GetQuestion
|
|
81
|
+
*/
|
|
82
|
+
readonly isLatestVersion: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Optional note describing why this version was created
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @memberof GetQuestion
|
|
87
|
+
*/
|
|
88
|
+
versionCreatedReason?: string;
|
|
77
89
|
/**
|
|
78
90
|
* When the question was created
|
|
79
91
|
* @type {Date}
|
|
@@ -130,4 +142,4 @@ export declare function instanceOfGetQuestion(value: object): value is GetQuesti
|
|
|
130
142
|
export declare function GetQuestionFromJSON(json: any): GetQuestion;
|
|
131
143
|
export declare function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetQuestion;
|
|
132
144
|
export declare function GetQuestionToJSON(json: any): GetQuestion;
|
|
133
|
-
export declare function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id' | 'version_number' | 'created_date' | 'updated_date' | 'created_by' | 'quiz_count' | 'quizzes'> | null, ignoreDiscriminator?: boolean): any;
|
|
145
|
+
export declare function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id' | 'version_number' | 'is_latest_version' | 'created_date' | 'updated_date' | 'created_by' | 'quiz_count' | 'quizzes'> | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -47,6 +47,8 @@ function instanceOfGetQuestion(value) {
|
|
|
47
47
|
return false;
|
|
48
48
|
if (!('versionNumber' in value) || value['versionNumber'] === undefined)
|
|
49
49
|
return false;
|
|
50
|
+
if (!('isLatestVersion' in value) || value['isLatestVersion'] === undefined)
|
|
51
|
+
return false;
|
|
50
52
|
if (!('createdDate' in value) || value['createdDate'] === undefined)
|
|
51
53
|
return false;
|
|
52
54
|
if (!('updatedDate' in value) || value['updatedDate'] === undefined)
|
|
@@ -70,6 +72,8 @@ function GetQuestionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
70
72
|
'tags': json['tags'] == null ? undefined : (json['tags'].map(ContentLibraryTag_1.ContentLibraryTagFromJSON)),
|
|
71
73
|
'version': json['version'] == null ? undefined : json['version'],
|
|
72
74
|
'versionNumber': json['version_number'],
|
|
75
|
+
'isLatestVersion': json['is_latest_version'],
|
|
76
|
+
'versionCreatedReason': json['version_created_reason'] == null ? undefined : json['version_created_reason'],
|
|
73
77
|
'createdDate': (new Date(json['created_date'])),
|
|
74
78
|
'updatedDate': (new Date(json['updated_date'])),
|
|
75
79
|
'createdBy': json['created_by'] == null ? undefined : json['created_by'],
|
|
@@ -93,6 +97,7 @@ function GetQuestionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
93
97
|
'explanation': (0, RichTextDocument_1.RichTextDocumentToJSON)(value['explanation']),
|
|
94
98
|
'tags': value['tags'] == null ? undefined : (value['tags'].map(ContentLibraryTag_1.ContentLibraryTagToJSON)),
|
|
95
99
|
'version': value['version'],
|
|
100
|
+
'version_created_reason': value['versionCreatedReason'],
|
|
96
101
|
'import_source': (0, QuestionImportSourceSummary_1.QuestionImportSourceSummaryToJSON)(value['importSource']),
|
|
97
102
|
};
|
|
98
103
|
}
|
|
@@ -59,6 +59,12 @@ export interface PutQuestion {
|
|
|
59
59
|
* @memberof PutQuestion
|
|
60
60
|
*/
|
|
61
61
|
version?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Optional note describing the changes in the new version
|
|
64
|
+
* @type {string}
|
|
65
|
+
* @memberof PutQuestion
|
|
66
|
+
*/
|
|
67
|
+
versionReason?: string;
|
|
62
68
|
}
|
|
63
69
|
/**
|
|
64
70
|
* @export
|
|
@@ -53,6 +53,7 @@ function PutQuestionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
53
53
|
'explanation': json['explanation'] == null ? undefined : (0, RichTextInput_1.RichTextInputFromJSON)(json['explanation']),
|
|
54
54
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
55
55
|
'version': json['version'] == null ? undefined : json['version'],
|
|
56
|
+
'versionReason': json['version_reason'] == null ? undefined : json['version_reason'],
|
|
56
57
|
};
|
|
57
58
|
}
|
|
58
59
|
function PutQuestionToJSON(json) {
|
|
@@ -70,5 +71,6 @@ function PutQuestionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
70
71
|
'explanation': (0, RichTextInput_1.RichTextInputToJSON)(value['explanation']),
|
|
71
72
|
'tags': value['tags'],
|
|
72
73
|
'version': value['version'],
|
|
74
|
+
'version_reason': value['versionReason'],
|
|
73
75
|
};
|
|
74
76
|
}
|
package/docs/GetQuestion.md
CHANGED
|
@@ -15,6 +15,8 @@ Name | Type
|
|
|
15
15
|
`tags` | [Array<ContentLibraryTag>](ContentLibraryTag.md)
|
|
16
16
|
`version` | string
|
|
17
17
|
`versionNumber` | number
|
|
18
|
+
`isLatestVersion` | boolean
|
|
19
|
+
`versionCreatedReason` | string
|
|
18
20
|
`createdDate` | Date
|
|
19
21
|
`updatedDate` | Date
|
|
20
22
|
`createdBy` | string
|
|
@@ -38,6 +40,8 @@ const example = {
|
|
|
38
40
|
"tags": null,
|
|
39
41
|
"version": null,
|
|
40
42
|
"versionNumber": null,
|
|
43
|
+
"isLatestVersion": null,
|
|
44
|
+
"versionCreatedReason": null,
|
|
41
45
|
"createdDate": null,
|
|
42
46
|
"updatedDate": null,
|
|
43
47
|
"createdBy": null,
|
package/docs/PutQuestion.md
CHANGED
|
@@ -13,6 +13,7 @@ Name | Type
|
|
|
13
13
|
`explanation` | [RichTextInput](RichTextInput.md)
|
|
14
14
|
`tags` | Array<string>
|
|
15
15
|
`version` | string
|
|
16
|
+
`versionReason` | string
|
|
16
17
|
|
|
17
18
|
## Example
|
|
18
19
|
|
|
@@ -28,6 +29,7 @@ const example = {
|
|
|
28
29
|
"explanation": null,
|
|
29
30
|
"tags": null,
|
|
30
31
|
"version": null,
|
|
32
|
+
"versionReason": null,
|
|
31
33
|
} satisfies PutQuestion
|
|
32
34
|
|
|
33
35
|
console.log(example)
|
package/docs/QuestionApi.md
CHANGED
|
@@ -7,8 +7,9 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
7
7
|
| [**deleteQuestion**](QuestionApi.md#deletequestion) | **DELETE** /questions/{questionId} | Delete a question by ID |
|
|
8
8
|
| [**getQuestion**](QuestionApi.md#getquestion) | **GET** /questions/{questionId} | Get a question by ID |
|
|
9
9
|
| [**getQuestionList**](QuestionApi.md#getquestionlist) | **GET** /questions | Get list of questions with filtering and pagination |
|
|
10
|
+
| [**getQuestionVersions**](QuestionApi.md#getquestionversions) | **GET** /questions/{questionId}/versions | Get all versions of a question |
|
|
10
11
|
| [**postQuestion**](QuestionApi.md#postquestion) | **POST** /questions | Create a new question |
|
|
11
|
-
| [**putQuestion**](QuestionApi.md#putquestion) | **PUT** /questions/{questionId} |
|
|
12
|
+
| [**putQuestion**](QuestionApi.md#putquestion) | **PUT** /questions/{questionId} | Create the next version of a question |
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -222,6 +223,72 @@ No authorization required
|
|
|
222
223
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
223
224
|
|
|
224
225
|
|
|
226
|
+
## getQuestionVersions
|
|
227
|
+
|
|
228
|
+
> Array<GetQuestion> getQuestionVersions(questionId)
|
|
229
|
+
|
|
230
|
+
Get all versions of a question
|
|
231
|
+
|
|
232
|
+
### Example
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
import {
|
|
236
|
+
Configuration,
|
|
237
|
+
QuestionApi,
|
|
238
|
+
} from '@easyedu/js-lsm-api';
|
|
239
|
+
import type { GetQuestionVersionsRequest } from '@easyedu/js-lsm-api';
|
|
240
|
+
|
|
241
|
+
async function example() {
|
|
242
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
243
|
+
const api = new QuestionApi();
|
|
244
|
+
|
|
245
|
+
const body = {
|
|
246
|
+
// string
|
|
247
|
+
questionId: questionId_example,
|
|
248
|
+
} satisfies GetQuestionVersionsRequest;
|
|
249
|
+
|
|
250
|
+
try {
|
|
251
|
+
const data = await api.getQuestionVersions(body);
|
|
252
|
+
console.log(data);
|
|
253
|
+
} catch (error) {
|
|
254
|
+
console.error(error);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Run the test
|
|
259
|
+
example().catch(console.error);
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Parameters
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
| Name | Type | Description | Notes |
|
|
266
|
+
|------------- | ------------- | ------------- | -------------|
|
|
267
|
+
| **questionId** | `string` | | [Defaults to `undefined`] |
|
|
268
|
+
|
|
269
|
+
### Return type
|
|
270
|
+
|
|
271
|
+
[**Array<GetQuestion>**](GetQuestion.md)
|
|
272
|
+
|
|
273
|
+
### Authorization
|
|
274
|
+
|
|
275
|
+
No authorization required
|
|
276
|
+
|
|
277
|
+
### HTTP request headers
|
|
278
|
+
|
|
279
|
+
- **Content-Type**: Not defined
|
|
280
|
+
- **Accept**: `application/json`
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
### HTTP response details
|
|
284
|
+
| Status code | Description | Response headers |
|
|
285
|
+
|-------------|-------------|------------------|
|
|
286
|
+
| **200** | Question version history, newest first | - |
|
|
287
|
+
| **404** | question not found | - |
|
|
288
|
+
|
|
289
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
290
|
+
|
|
291
|
+
|
|
225
292
|
## postQuestion
|
|
226
293
|
|
|
227
294
|
> GetQuestion postQuestion(postQuestion)
|
|
@@ -292,7 +359,7 @@ No authorization required
|
|
|
292
359
|
|
|
293
360
|
> GetQuestion putQuestion(questionId, putQuestion)
|
|
294
361
|
|
|
295
|
-
|
|
362
|
+
Create the next version of a question
|
|
296
363
|
|
|
297
364
|
### Example
|
|
298
365
|
|
|
@@ -354,6 +421,7 @@ No authorization required
|
|
|
354
421
|
| **200** | update question response OK | - |
|
|
355
422
|
| **404** | question not found | - |
|
|
356
423
|
| **400** | update question response error | - |
|
|
424
|
+
| **409** | supplied question is a historical or stale version | - |
|
|
357
425
|
|
|
358
426
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
359
427
|
|
package/package.json
CHANGED
package/src/apis/QuestionApi.ts
CHANGED
|
@@ -50,6 +50,10 @@ export interface GetQuestionListRequest {
|
|
|
50
50
|
search?: string;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
export interface GetQuestionVersionsRequest {
|
|
54
|
+
questionId: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
53
57
|
export interface PostQuestionRequest {
|
|
54
58
|
postQuestion: PostQuestion;
|
|
55
59
|
}
|
|
@@ -210,6 +214,51 @@ export class QuestionApi extends runtime.BaseAPI {
|
|
|
210
214
|
return await response.value();
|
|
211
215
|
}
|
|
212
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Creates request options for getQuestionVersions without sending the request
|
|
219
|
+
*/
|
|
220
|
+
async getQuestionVersionsRequestOpts(requestParameters: GetQuestionVersionsRequest): Promise<runtime.RequestOpts> {
|
|
221
|
+
if (requestParameters['questionId'] == null) {
|
|
222
|
+
throw new runtime.RequiredError(
|
|
223
|
+
'questionId',
|
|
224
|
+
'Required parameter "questionId" was null or undefined when calling getQuestionVersions().'
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const queryParameters: any = {};
|
|
229
|
+
|
|
230
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
let urlPath = `/questions/{questionId}/versions`;
|
|
234
|
+
urlPath = urlPath.replace('{questionId}', encodeURIComponent(String(requestParameters['questionId'])));
|
|
235
|
+
|
|
236
|
+
return {
|
|
237
|
+
path: urlPath,
|
|
238
|
+
method: 'GET',
|
|
239
|
+
headers: headerParameters,
|
|
240
|
+
query: queryParameters,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Get all versions of a question
|
|
246
|
+
*/
|
|
247
|
+
async getQuestionVersionsRaw(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetQuestion>>> {
|
|
248
|
+
const requestOptions = await this.getQuestionVersionsRequestOpts(requestParameters);
|
|
249
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
250
|
+
|
|
251
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetQuestionFromJSON));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Get all versions of a question
|
|
256
|
+
*/
|
|
257
|
+
async getQuestionVersions(requestParameters: GetQuestionVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetQuestion>> {
|
|
258
|
+
const response = await this.getQuestionVersionsRaw(requestParameters, initOverrides);
|
|
259
|
+
return await response.value();
|
|
260
|
+
}
|
|
261
|
+
|
|
213
262
|
/**
|
|
214
263
|
* Creates request options for postQuestion without sending the request
|
|
215
264
|
*/
|
|
@@ -295,7 +344,7 @@ export class QuestionApi extends runtime.BaseAPI {
|
|
|
295
344
|
}
|
|
296
345
|
|
|
297
346
|
/**
|
|
298
|
-
*
|
|
347
|
+
* Create the next version of a question
|
|
299
348
|
*/
|
|
300
349
|
async putQuestionRaw(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetQuestion>> {
|
|
301
350
|
const requestOptions = await this.putQuestionRequestOpts(requestParameters);
|
|
@@ -305,7 +354,7 @@ export class QuestionApi extends runtime.BaseAPI {
|
|
|
305
354
|
}
|
|
306
355
|
|
|
307
356
|
/**
|
|
308
|
-
*
|
|
357
|
+
* Create the next version of a question
|
|
309
358
|
*/
|
|
310
359
|
async putQuestion(requestParameters: PutQuestionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetQuestion> {
|
|
311
360
|
const response = await this.putQuestionRaw(requestParameters, initOverrides);
|
|
@@ -109,6 +109,18 @@ export interface GetQuestion {
|
|
|
109
109
|
* @memberof GetQuestion
|
|
110
110
|
*/
|
|
111
111
|
readonly versionNumber: number;
|
|
112
|
+
/**
|
|
113
|
+
* Whether this is the current editable version in the question history
|
|
114
|
+
* @type {boolean}
|
|
115
|
+
* @memberof GetQuestion
|
|
116
|
+
*/
|
|
117
|
+
readonly isLatestVersion: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Optional note describing why this version was created
|
|
120
|
+
* @type {string}
|
|
121
|
+
* @memberof GetQuestion
|
|
122
|
+
*/
|
|
123
|
+
versionCreatedReason?: string;
|
|
112
124
|
/**
|
|
113
125
|
* When the question was created
|
|
114
126
|
* @type {Date}
|
|
@@ -170,6 +182,7 @@ export function instanceOfGetQuestion(value: object): value is GetQuestion {
|
|
|
170
182
|
if (!('questionText' in value) || value['questionText'] === undefined) return false;
|
|
171
183
|
if (!('questionType' in value) || value['questionType'] === undefined) return false;
|
|
172
184
|
if (!('versionNumber' in value) || value['versionNumber'] === undefined) return false;
|
|
185
|
+
if (!('isLatestVersion' in value) || value['isLatestVersion'] === undefined) return false;
|
|
173
186
|
if (!('createdDate' in value) || value['createdDate'] === undefined) return false;
|
|
174
187
|
if (!('updatedDate' in value) || value['updatedDate'] === undefined) return false;
|
|
175
188
|
return true;
|
|
@@ -194,6 +207,8 @@ export function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
194
207
|
'tags': json['tags'] == null ? undefined : ((json['tags'] as Array<any>).map(ContentLibraryTagFromJSON)),
|
|
195
208
|
'version': json['version'] == null ? undefined : json['version'],
|
|
196
209
|
'versionNumber': json['version_number'],
|
|
210
|
+
'isLatestVersion': json['is_latest_version'],
|
|
211
|
+
'versionCreatedReason': json['version_created_reason'] == null ? undefined : json['version_created_reason'],
|
|
197
212
|
'createdDate': (new Date(json['created_date'])),
|
|
198
213
|
'updatedDate': (new Date(json['updated_date'])),
|
|
199
214
|
'createdBy': json['created_by'] == null ? undefined : json['created_by'],
|
|
@@ -207,7 +222,7 @@ export function GetQuestionToJSON(json: any): GetQuestion {
|
|
|
207
222
|
return GetQuestionToJSONTyped(json, false);
|
|
208
223
|
}
|
|
209
224
|
|
|
210
|
-
export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_number'|'created_date'|'updated_date'|'created_by'|'quiz_count'|'quizzes'> | null, ignoreDiscriminator: boolean = false): any {
|
|
225
|
+
export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_number'|'is_latest_version'|'created_date'|'updated_date'|'created_by'|'quiz_count'|'quizzes'> | null, ignoreDiscriminator: boolean = false): any {
|
|
211
226
|
if (value == null) {
|
|
212
227
|
return value;
|
|
213
228
|
}
|
|
@@ -221,6 +236,7 @@ export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'version_n
|
|
|
221
236
|
'explanation': RichTextDocumentToJSON(value['explanation']),
|
|
222
237
|
'tags': value['tags'] == null ? undefined : ((value['tags'] as Array<any>).map(ContentLibraryTagToJSON)),
|
|
223
238
|
'version': value['version'],
|
|
239
|
+
'version_created_reason': value['versionCreatedReason'],
|
|
224
240
|
'import_source': QuestionImportSourceSummaryToJSON(value['importSource']),
|
|
225
241
|
};
|
|
226
242
|
}
|
|
@@ -76,6 +76,12 @@ export interface PutQuestion {
|
|
|
76
76
|
* @memberof PutQuestion
|
|
77
77
|
*/
|
|
78
78
|
version?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Optional note describing the changes in the new version
|
|
81
|
+
* @type {string}
|
|
82
|
+
* @memberof PutQuestion
|
|
83
|
+
*/
|
|
84
|
+
versionReason?: string;
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
|
|
@@ -117,6 +123,7 @@ export function PutQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
117
123
|
'explanation': json['explanation'] == null ? undefined : RichTextInputFromJSON(json['explanation']),
|
|
118
124
|
'tags': json['tags'] == null ? undefined : json['tags'],
|
|
119
125
|
'version': json['version'] == null ? undefined : json['version'],
|
|
126
|
+
'versionReason': json['version_reason'] == null ? undefined : json['version_reason'],
|
|
120
127
|
};
|
|
121
128
|
}
|
|
122
129
|
|
|
@@ -138,6 +145,7 @@ export function PutQuestionToJSONTyped(value?: PutQuestion | null, ignoreDiscrim
|
|
|
138
145
|
'explanation': RichTextInputToJSON(value['explanation']),
|
|
139
146
|
'tags': value['tags'],
|
|
140
147
|
'version': value['version'],
|
|
148
|
+
'version_reason': value['versionReason'],
|
|
141
149
|
};
|
|
142
150
|
}
|
|
143
151
|
|