@easyedu/js-lsm-api 1.111.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/.openapi-generator/FILES +22 -0
- package/README.md +16 -3
- package/dist/apis/QuestionApi.d.ts +17 -2
- package/dist/apis/QuestionApi.js +41 -2
- package/dist/apis/QuestionImportApi.d.ts +51 -0
- package/dist/apis/QuestionImportApi.js +135 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/QuestionApi.d.ts +17 -2
- package/dist/esm/apis/QuestionApi.js +41 -2
- package/dist/esm/apis/QuestionImportApi.d.ts +51 -0
- package/dist/esm/apis/QuestionImportApi.js +131 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/GetQuestion.d.ts +20 -1
- package/dist/esm/models/GetQuestion.js +8 -0
- package/dist/esm/models/PostQuestionImportCommit.d.ts +58 -0
- package/dist/esm/models/PostQuestionImportCommit.js +59 -0
- package/dist/esm/models/PostQuestionImportCommitItem.d.ts +72 -0
- package/dist/esm/models/PostQuestionImportCommitItem.js +66 -0
- package/dist/esm/models/PostQuestionImportCommitResponse.d.ts +51 -0
- package/dist/esm/models/PostQuestionImportCommitResponse.js +56 -0
- package/dist/esm/models/PostQuestionImportParseResponse.d.ts +71 -0
- package/dist/esm/models/PostQuestionImportParseResponse.js +70 -0
- package/dist/esm/models/PutQuestion.d.ts +6 -0
- package/dist/esm/models/PutQuestion.js +2 -0
- package/dist/esm/models/QuestionImportCommitResult.d.ts +53 -0
- package/dist/esm/models/QuestionImportCommitResult.js +57 -0
- package/dist/esm/models/QuestionImportDraft.d.ts +76 -0
- package/dist/esm/models/QuestionImportDraft.js +69 -0
- package/dist/esm/models/QuestionImportDuplicate.d.ts +66 -0
- package/dist/esm/models/QuestionImportDuplicate.js +62 -0
- package/dist/esm/models/QuestionImportPreviewImage.d.ts +84 -0
- package/dist/esm/models/QuestionImportPreviewImage.js +76 -0
- package/dist/esm/models/QuestionImportSource.d.ts +56 -0
- package/dist/esm/models/QuestionImportSource.js +57 -0
- package/dist/esm/models/QuestionImportSourceSummary.d.ts +50 -0
- package/dist/esm/models/QuestionImportSourceSummary.js +53 -0
- package/dist/esm/models/index.d.ts +10 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/models/GetQuestion.d.ts +20 -1
- package/dist/models/GetQuestion.js +8 -0
- package/dist/models/PostQuestionImportCommit.d.ts +58 -0
- package/dist/models/PostQuestionImportCommit.js +66 -0
- package/dist/models/PostQuestionImportCommitItem.d.ts +72 -0
- package/dist/models/PostQuestionImportCommitItem.js +74 -0
- package/dist/models/PostQuestionImportCommitResponse.d.ts +51 -0
- package/dist/models/PostQuestionImportCommitResponse.js +63 -0
- package/dist/models/PostQuestionImportParseResponse.d.ts +71 -0
- package/dist/models/PostQuestionImportParseResponse.js +77 -0
- package/dist/models/PutQuestion.d.ts +6 -0
- package/dist/models/PutQuestion.js +2 -0
- package/dist/models/QuestionImportCommitResult.d.ts +53 -0
- package/dist/models/QuestionImportCommitResult.js +65 -0
- package/dist/models/QuestionImportDraft.d.ts +76 -0
- package/dist/models/QuestionImportDraft.js +76 -0
- package/dist/models/QuestionImportDuplicate.d.ts +66 -0
- package/dist/models/QuestionImportDuplicate.js +70 -0
- package/dist/models/QuestionImportPreviewImage.d.ts +84 -0
- package/dist/models/QuestionImportPreviewImage.js +84 -0
- package/dist/models/QuestionImportSource.d.ts +56 -0
- package/dist/models/QuestionImportSource.js +64 -0
- package/dist/models/QuestionImportSourceSummary.d.ts +50 -0
- package/dist/models/QuestionImportSourceSummary.js +60 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +10 -0
- package/docs/GetQuestion.md +6 -0
- package/docs/PostQuestionImportCommit.md +42 -0
- package/docs/PostQuestionImportCommitItem.md +44 -0
- package/docs/PostQuestionImportCommitResponse.md +40 -0
- package/docs/PostQuestionImportParseResponse.md +46 -0
- package/docs/PutQuestion.md +2 -0
- package/docs/QuestionApi.md +70 -2
- package/docs/QuestionImportApi.md +149 -0
- package/docs/QuestionImportCommitResult.md +38 -0
- package/docs/QuestionImportDraft.md +48 -0
- package/docs/QuestionImportDuplicate.md +42 -0
- package/docs/QuestionImportPreviewImage.md +48 -0
- package/docs/QuestionImportSource.md +42 -0
- package/docs/QuestionImportSourceSummary.md +40 -0
- package/package.json +1 -1
- package/src/apis/QuestionApi.ts +51 -2
- package/src/apis/QuestionImportApi.ts +162 -0
- package/src/apis/index.ts +1 -0
- package/src/models/GetQuestion.ts +32 -1
- package/src/models/PostQuestionImportCommit.ts +116 -0
- package/src/models/PostQuestionImportCommitItem.ts +128 -0
- package/src/models/PostQuestionImportCommitResponse.ts +101 -0
- package/src/models/PostQuestionImportParseResponse.ts +142 -0
- package/src/models/PutQuestion.ts +8 -0
- package/src/models/QuestionImportCommitResult.ts +95 -0
- package/src/models/QuestionImportDraft.ts +142 -0
- package/src/models/QuestionImportDuplicate.ts +112 -0
- package/src/models/QuestionImportPreviewImage.ts +140 -0
- package/src/models/QuestionImportSource.ts +101 -0
- package/src/models/QuestionImportSourceSummary.ts +92 -0
- package/src/models/index.ts +10 -0
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
|
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# QuestionImportApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com/stage1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**postQuestionImportCommit**](QuestionImportApi.md#postquestionimportcommit) | **POST** /question-imports/commit | Validate and atomically create, version, or skip approved question drafts |
|
|
8
|
+
| [**postQuestionImportParse**](QuestionImportApi.md#postquestionimportparse) | **POST** /question-imports/parse | Parse a question document into stateless review drafts |
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## postQuestionImportCommit
|
|
13
|
+
|
|
14
|
+
> PostQuestionImportCommitResponse postQuestionImportCommit(postQuestionImportCommit)
|
|
15
|
+
|
|
16
|
+
Validate and atomically create, version, or skip approved question drafts
|
|
17
|
+
|
|
18
|
+
### Example
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {
|
|
22
|
+
Configuration,
|
|
23
|
+
QuestionImportApi,
|
|
24
|
+
} from '@easyedu/js-lsm-api';
|
|
25
|
+
import type { PostQuestionImportCommitRequest } from '@easyedu/js-lsm-api';
|
|
26
|
+
|
|
27
|
+
async function example() {
|
|
28
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
29
|
+
const api = new QuestionImportApi();
|
|
30
|
+
|
|
31
|
+
const body = {
|
|
32
|
+
// PostQuestionImportCommit
|
|
33
|
+
postQuestionImportCommit: ...,
|
|
34
|
+
} satisfies PostQuestionImportCommitRequest;
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
const data = await api.postQuestionImportCommit(body);
|
|
38
|
+
console.log(data);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Run the test
|
|
45
|
+
example().catch(console.error);
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Parameters
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
| Name | Type | Description | Notes |
|
|
52
|
+
|------------- | ------------- | ------------- | -------------|
|
|
53
|
+
| **postQuestionImportCommit** | [PostQuestionImportCommit](PostQuestionImportCommit.md) | | |
|
|
54
|
+
|
|
55
|
+
### Return type
|
|
56
|
+
|
|
57
|
+
[**PostQuestionImportCommitResponse**](PostQuestionImportCommitResponse.md)
|
|
58
|
+
|
|
59
|
+
### Authorization
|
|
60
|
+
|
|
61
|
+
No authorization required
|
|
62
|
+
|
|
63
|
+
### HTTP request headers
|
|
64
|
+
|
|
65
|
+
- **Content-Type**: `application/json`
|
|
66
|
+
- **Accept**: `application/json`
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### HTTP response details
|
|
70
|
+
| Status code | Description | Response headers |
|
|
71
|
+
|-------------|-------------|------------------|
|
|
72
|
+
| **200** | Approved question drafts committed | - |
|
|
73
|
+
| **400** | Invalid draft, asset, or import token | - |
|
|
74
|
+
| **409** | Import approval conflicts with current data | - |
|
|
75
|
+
|
|
76
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## postQuestionImportParse
|
|
80
|
+
|
|
81
|
+
> PostQuestionImportParseResponse postQuestionImportParse(file, sourceLabel)
|
|
82
|
+
|
|
83
|
+
Parse a question document into stateless review drafts
|
|
84
|
+
|
|
85
|
+
### Example
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import {
|
|
89
|
+
Configuration,
|
|
90
|
+
QuestionImportApi,
|
|
91
|
+
} from '@easyedu/js-lsm-api';
|
|
92
|
+
import type { PostQuestionImportParseRequest } from '@easyedu/js-lsm-api';
|
|
93
|
+
|
|
94
|
+
async function example() {
|
|
95
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
96
|
+
const api = new QuestionImportApi();
|
|
97
|
+
|
|
98
|
+
const body = {
|
|
99
|
+
// Blob
|
|
100
|
+
file: BINARY_DATA_HERE,
|
|
101
|
+
// string | Optional source label override (optional)
|
|
102
|
+
sourceLabel: sourceLabel_example,
|
|
103
|
+
} satisfies PostQuestionImportParseRequest;
|
|
104
|
+
|
|
105
|
+
try {
|
|
106
|
+
const data = await api.postQuestionImportParse(body);
|
|
107
|
+
console.log(data);
|
|
108
|
+
} catch (error) {
|
|
109
|
+
console.error(error);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Run the test
|
|
114
|
+
example().catch(console.error);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Parameters
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
| Name | Type | Description | Notes |
|
|
121
|
+
|------------- | ------------- | ------------- | -------------|
|
|
122
|
+
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
123
|
+
| **sourceLabel** | `string` | Optional source label override | [Optional] [Defaults to `undefined`] |
|
|
124
|
+
|
|
125
|
+
### Return type
|
|
126
|
+
|
|
127
|
+
[**PostQuestionImportParseResponse**](PostQuestionImportParseResponse.md)
|
|
128
|
+
|
|
129
|
+
### Authorization
|
|
130
|
+
|
|
131
|
+
No authorization required
|
|
132
|
+
|
|
133
|
+
### HTTP request headers
|
|
134
|
+
|
|
135
|
+
- **Content-Type**: `multipart/form-data`
|
|
136
|
+
- **Accept**: `application/json`
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### HTTP response details
|
|
140
|
+
| Status code | Description | Response headers |
|
|
141
|
+
|-------------|-------------|------------------|
|
|
142
|
+
| **200** | Document parsed into review drafts | - |
|
|
143
|
+
| **400** | Invalid or unsupported document | - |
|
|
144
|
+
| **413** | Document exceeds import limits | - |
|
|
145
|
+
| **422** | No questions could be extracted | - |
|
|
146
|
+
| **503** | Generic document interpretation is unavailable | - |
|
|
147
|
+
|
|
148
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
149
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# QuestionImportCommitResult
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`draftId` | string
|
|
10
|
+
`action` | string
|
|
11
|
+
`questionId` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { QuestionImportCommitResult } from '@easyedu/js-lsm-api'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"draftId": null,
|
|
21
|
+
"action": null,
|
|
22
|
+
"questionId": null,
|
|
23
|
+
} satisfies QuestionImportCommitResult
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as QuestionImportCommitResult
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
# QuestionImportDraft
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`draftId` | string
|
|
10
|
+
`sourceKey` | string
|
|
11
|
+
`sourceLocation` | string
|
|
12
|
+
`question` | [PostQuestion](PostQuestion.md)
|
|
13
|
+
`duplicate` | [QuestionImportDuplicate](QuestionImportDuplicate.md)
|
|
14
|
+
`warnings` | Array<string>
|
|
15
|
+
`confidence` | number
|
|
16
|
+
`included` | boolean
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { QuestionImportDraft } from '@easyedu/js-lsm-api'
|
|
22
|
+
|
|
23
|
+
// TODO: Update the object below with actual values
|
|
24
|
+
const example = {
|
|
25
|
+
"draftId": null,
|
|
26
|
+
"sourceKey": null,
|
|
27
|
+
"sourceLocation": null,
|
|
28
|
+
"question": null,
|
|
29
|
+
"duplicate": null,
|
|
30
|
+
"warnings": null,
|
|
31
|
+
"confidence": null,
|
|
32
|
+
"included": null,
|
|
33
|
+
} satisfies QuestionImportDraft
|
|
34
|
+
|
|
35
|
+
console.log(example)
|
|
36
|
+
|
|
37
|
+
// Convert the instance to a JSON string
|
|
38
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
39
|
+
console.log(exampleJSON)
|
|
40
|
+
|
|
41
|
+
// Parse the JSON string back to an object
|
|
42
|
+
const exampleParsed = JSON.parse(exampleJSON) as QuestionImportDraft
|
|
43
|
+
console.log(exampleParsed)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
47
|
+
|
|
48
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
# QuestionImportDuplicate
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`status` | string
|
|
10
|
+
`matchedQuestionId` | string
|
|
11
|
+
`matchedDraftId` | string
|
|
12
|
+
`matchedQuestionText` | string
|
|
13
|
+
`similarity` | number
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { QuestionImportDuplicate } from '@easyedu/js-lsm-api'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"status": null,
|
|
23
|
+
"matchedQuestionId": null,
|
|
24
|
+
"matchedDraftId": null,
|
|
25
|
+
"matchedQuestionText": null,
|
|
26
|
+
"similarity": null,
|
|
27
|
+
} satisfies QuestionImportDuplicate
|
|
28
|
+
|
|
29
|
+
console.log(example)
|
|
30
|
+
|
|
31
|
+
// Convert the instance to a JSON string
|
|
32
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
33
|
+
console.log(exampleJSON)
|
|
34
|
+
|
|
35
|
+
// Parse the JSON string back to an object
|
|
36
|
+
const exampleParsed = JSON.parse(exampleJSON) as QuestionImportDuplicate
|
|
37
|
+
console.log(exampleParsed)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
# QuestionImportPreviewImage
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`sourceId` | string
|
|
10
|
+
`filename` | string
|
|
11
|
+
`mimeType` | string
|
|
12
|
+
`byteSize` | number
|
|
13
|
+
`width` | number
|
|
14
|
+
`height` | number
|
|
15
|
+
`sha256` | string
|
|
16
|
+
`dataBase64` | string
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import type { QuestionImportPreviewImage } from '@easyedu/js-lsm-api'
|
|
22
|
+
|
|
23
|
+
// TODO: Update the object below with actual values
|
|
24
|
+
const example = {
|
|
25
|
+
"sourceId": null,
|
|
26
|
+
"filename": null,
|
|
27
|
+
"mimeType": null,
|
|
28
|
+
"byteSize": null,
|
|
29
|
+
"width": null,
|
|
30
|
+
"height": null,
|
|
31
|
+
"sha256": null,
|
|
32
|
+
"dataBase64": null,
|
|
33
|
+
} satisfies QuestionImportPreviewImage
|
|
34
|
+
|
|
35
|
+
console.log(example)
|
|
36
|
+
|
|
37
|
+
// Convert the instance to a JSON string
|
|
38
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
39
|
+
console.log(exampleJSON)
|
|
40
|
+
|
|
41
|
+
// Parse the JSON string back to an object
|
|
42
|
+
const exampleParsed = JSON.parse(exampleJSON) as QuestionImportPreviewImage
|
|
43
|
+
console.log(exampleParsed)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
47
|
+
|
|
48
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
# QuestionImportSource
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`label` | string
|
|
10
|
+
`detectedTitle` | string
|
|
11
|
+
`originalFilename` | string
|
|
12
|
+
`mediaType` | string
|
|
13
|
+
`fileSha256` | string
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { QuestionImportSource } from '@easyedu/js-lsm-api'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"label": null,
|
|
23
|
+
"detectedTitle": null,
|
|
24
|
+
"originalFilename": null,
|
|
25
|
+
"mediaType": null,
|
|
26
|
+
"fileSha256": null,
|
|
27
|
+
} satisfies QuestionImportSource
|
|
28
|
+
|
|
29
|
+
console.log(example)
|
|
30
|
+
|
|
31
|
+
// Convert the instance to a JSON string
|
|
32
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
33
|
+
console.log(exampleJSON)
|
|
34
|
+
|
|
35
|
+
// Parse the JSON string back to an object
|
|
36
|
+
const exampleParsed = JSON.parse(exampleJSON) as QuestionImportSource
|
|
37
|
+
console.log(exampleParsed)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# QuestionImportSourceSummary
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`label` | string
|
|
10
|
+
`originalFilename` | string
|
|
11
|
+
`sourceKey` | string
|
|
12
|
+
`importedAt` | Date
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { QuestionImportSourceSummary } from '@easyedu/js-lsm-api'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"label": null,
|
|
22
|
+
"originalFilename": null,
|
|
23
|
+
"sourceKey": null,
|
|
24
|
+
"importedAt": null,
|
|
25
|
+
} satisfies QuestionImportSourceSummary
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as QuestionImportSourceSummary
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
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);
|