@easyedu/js-lsm-api 1.110.0 → 1.112.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 +42 -0
- package/README.md +33 -2
- package/dist/apis/LearnerExperienceApi.d.ts +153 -0
- package/dist/apis/LearnerExperienceApi.js +401 -0
- package/dist/apis/QuestionImportApi.d.ts +51 -0
- package/dist/apis/QuestionImportApi.js +135 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/apis/LearnerExperienceApi.d.ts +153 -0
- package/dist/esm/apis/LearnerExperienceApi.js +397 -0
- package/dist/esm/apis/QuestionImportApi.d.ts +51 -0
- package/dist/esm/apis/QuestionImportApi.js +131 -0
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/GetEffectiveLearnerExperience.d.ts +62 -0
- package/dist/esm/models/GetEffectiveLearnerExperience.js +62 -0
- package/dist/esm/models/GetLearnerDashboard.d.ts +47 -0
- package/dist/esm/models/GetLearnerDashboard.js +54 -0
- package/dist/esm/models/GetLearnerDashboardCourseList.d.ts +39 -0
- package/dist/esm/models/GetLearnerDashboardCourseList.js +48 -0
- package/dist/esm/models/GetLearnerDashboardSummary.d.ts +56 -0
- package/dist/esm/models/GetLearnerDashboardSummary.js +59 -0
- package/dist/esm/models/GetLearnerExperience.d.ts +67 -0
- package/dist/esm/models/GetLearnerExperience.js +65 -0
- package/dist/esm/models/GetLearnerExperiencePreview.d.ts +40 -0
- package/dist/esm/models/GetLearnerExperiencePreview.js +47 -0
- package/dist/esm/models/GetQuestion.d.ts +7 -0
- package/dist/esm/models/GetQuestion.js +3 -0
- package/dist/esm/models/LearnerExperienceVersion.d.ts +86 -0
- package/dist/esm/models/LearnerExperienceVersion.js +76 -0
- package/dist/esm/models/PostLearnerExperiencePreview.d.ts +40 -0
- package/dist/esm/models/PostLearnerExperiencePreview.js +45 -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/PutLearnerExperienceDraft.d.ts +40 -0
- package/dist/esm/models/PutLearnerExperienceDraft.js +45 -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 +19 -0
- package/dist/esm/models/index.js +19 -0
- package/dist/models/GetEffectiveLearnerExperience.d.ts +62 -0
- package/dist/models/GetEffectiveLearnerExperience.js +70 -0
- package/dist/models/GetLearnerDashboard.d.ts +47 -0
- package/dist/models/GetLearnerDashboard.js +61 -0
- package/dist/models/GetLearnerDashboardCourseList.d.ts +39 -0
- package/dist/models/GetLearnerDashboardCourseList.js +55 -0
- package/dist/models/GetLearnerDashboardSummary.d.ts +56 -0
- package/dist/models/GetLearnerDashboardSummary.js +66 -0
- package/dist/models/GetLearnerExperience.d.ts +67 -0
- package/dist/models/GetLearnerExperience.js +73 -0
- package/dist/models/GetLearnerExperiencePreview.d.ts +40 -0
- package/dist/models/GetLearnerExperiencePreview.js +54 -0
- package/dist/models/GetQuestion.d.ts +7 -0
- package/dist/models/GetQuestion.js +3 -0
- package/dist/models/LearnerExperienceVersion.d.ts +86 -0
- package/dist/models/LearnerExperienceVersion.js +84 -0
- package/dist/models/PostLearnerExperiencePreview.d.ts +40 -0
- package/dist/models/PostLearnerExperiencePreview.js +52 -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/PutLearnerExperienceDraft.d.ts +40 -0
- package/dist/models/PutLearnerExperienceDraft.js +52 -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 +19 -0
- package/dist/models/index.js +19 -0
- package/docs/GetEffectiveLearnerExperience.md +40 -0
- package/docs/GetLearnerDashboard.md +38 -0
- package/docs/GetLearnerDashboardCourseList.md +36 -0
- package/docs/GetLearnerDashboardSummary.md +42 -0
- package/docs/GetLearnerExperience.md +42 -0
- package/docs/GetLearnerExperiencePreview.md +36 -0
- package/docs/GetQuestion.md +2 -0
- package/docs/LearnerExperienceApi.md +622 -0
- package/docs/LearnerExperienceVersion.md +48 -0
- package/docs/PostLearnerExperiencePreview.md +36 -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/PutLearnerExperienceDraft.md +36 -0
- 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/LearnerExperienceApi.ts +465 -0
- package/src/apis/QuestionImportApi.ts +162 -0
- package/src/apis/index.ts +2 -0
- package/src/models/GetEffectiveLearnerExperience.ts +105 -0
- package/src/models/GetLearnerDashboard.ts +106 -0
- package/src/models/GetLearnerDashboardCourseList.ts +83 -0
- package/src/models/GetLearnerDashboardSummary.ts +102 -0
- package/src/models/GetLearnerExperience.ts +121 -0
- package/src/models/GetLearnerExperiencePreview.ts +75 -0
- package/src/models/GetQuestion.ts +15 -0
- package/src/models/LearnerExperienceVersion.ts +140 -0
- package/src/models/PostLearnerExperiencePreview.ts +74 -0
- 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/PutLearnerExperienceDraft.ts +74 -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 +19 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
# PostQuestionImportCommit
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`importToken` | string
|
|
10
|
+
`sourceLabel` | string
|
|
11
|
+
`tags` | Array<string>
|
|
12
|
+
`questions` | [Array<PostQuestionImportCommitItem>](PostQuestionImportCommitItem.md)
|
|
13
|
+
`images` | [Array<QuestionImportPreviewImage>](QuestionImportPreviewImage.md)
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { PostQuestionImportCommit } from '@easyedu/js-lsm-api'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"importToken": null,
|
|
23
|
+
"sourceLabel": null,
|
|
24
|
+
"tags": null,
|
|
25
|
+
"questions": null,
|
|
26
|
+
"images": null,
|
|
27
|
+
} satisfies PostQuestionImportCommit
|
|
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 PostQuestionImportCommit
|
|
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,44 @@
|
|
|
1
|
+
|
|
2
|
+
# PostQuestionImportCommitItem
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`draftId` | string
|
|
10
|
+
`action` | string
|
|
11
|
+
`targetQuestionId` | string
|
|
12
|
+
`sourceKey` | string
|
|
13
|
+
`sourceLocation` | string
|
|
14
|
+
`question` | [PostQuestion](PostQuestion.md)
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { PostQuestionImportCommitItem } from '@easyedu/js-lsm-api'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"draftId": null,
|
|
24
|
+
"action": null,
|
|
25
|
+
"targetQuestionId": null,
|
|
26
|
+
"sourceKey": null,
|
|
27
|
+
"sourceLocation": null,
|
|
28
|
+
"question": null,
|
|
29
|
+
} satisfies PostQuestionImportCommitItem
|
|
30
|
+
|
|
31
|
+
console.log(example)
|
|
32
|
+
|
|
33
|
+
// Convert the instance to a JSON string
|
|
34
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
35
|
+
console.log(exampleJSON)
|
|
36
|
+
|
|
37
|
+
// Parse the JSON string back to an object
|
|
38
|
+
const exampleParsed = JSON.parse(exampleJSON) as PostQuestionImportCommitItem
|
|
39
|
+
console.log(exampleParsed)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# PostQuestionImportCommitResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`createdCount` | number
|
|
10
|
+
`versionedCount` | number
|
|
11
|
+
`skippedCount` | number
|
|
12
|
+
`items` | [Array<QuestionImportCommitResult>](QuestionImportCommitResult.md)
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { PostQuestionImportCommitResponse } from '@easyedu/js-lsm-api'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"createdCount": null,
|
|
22
|
+
"versionedCount": null,
|
|
23
|
+
"skippedCount": null,
|
|
24
|
+
"items": null,
|
|
25
|
+
} satisfies PostQuestionImportCommitResponse
|
|
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 PostQuestionImportCommitResponse
|
|
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
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
# PostQuestionImportParseResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`importToken` | string
|
|
10
|
+
`expiresAt` | Date
|
|
11
|
+
`source` | [QuestionImportSource](QuestionImportSource.md)
|
|
12
|
+
`questions` | [Array<QuestionImportDraft>](QuestionImportDraft.md)
|
|
13
|
+
`images` | [Array<QuestionImportPreviewImage>](QuestionImportPreviewImage.md)
|
|
14
|
+
`parser` | string
|
|
15
|
+
`warnings` | Array<string>
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { PostQuestionImportParseResponse } from '@easyedu/js-lsm-api'
|
|
21
|
+
|
|
22
|
+
// TODO: Update the object below with actual values
|
|
23
|
+
const example = {
|
|
24
|
+
"importToken": null,
|
|
25
|
+
"expiresAt": null,
|
|
26
|
+
"source": null,
|
|
27
|
+
"questions": null,
|
|
28
|
+
"images": null,
|
|
29
|
+
"parser": null,
|
|
30
|
+
"warnings": null,
|
|
31
|
+
} satisfies PostQuestionImportParseResponse
|
|
32
|
+
|
|
33
|
+
console.log(example)
|
|
34
|
+
|
|
35
|
+
// Convert the instance to a JSON string
|
|
36
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
37
|
+
console.log(exampleJSON)
|
|
38
|
+
|
|
39
|
+
// Parse the JSON string back to an object
|
|
40
|
+
const exampleParsed = JSON.parse(exampleJSON) as PostQuestionImportParseResponse
|
|
41
|
+
console.log(exampleParsed)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# PutLearnerExperienceDraft
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`designDocument` | { [key: string]: any; }
|
|
10
|
+
`changeNotes` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { PutLearnerExperienceDraft } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"designDocument": null,
|
|
20
|
+
"changeNotes": null,
|
|
21
|
+
} satisfies PutLearnerExperienceDraft
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as PutLearnerExperienceDraft
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -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
|
+
|