@easyedu/js-lsm-api 1.82.0 → 1.84.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 +60 -0
- package/README.md +64 -2
- package/dist/apis/ContentLibraryApi.d.ts +290 -0
- package/dist/apis/ContentLibraryApi.js +744 -0
- package/dist/apis/CourseApi.d.ts +172 -0
- package/dist/apis/CourseApi.js +443 -0
- package/dist/apis/PlayerApi.d.ts +112 -0
- package/dist/apis/PlayerApi.js +297 -0
- package/dist/apis/QuizApi.d.ts +3 -2
- package/dist/apis/QuizApi.js +4 -2
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/ContentLibraryApi.d.ts +290 -0
- package/dist/esm/apis/ContentLibraryApi.js +740 -0
- package/dist/esm/apis/CourseApi.d.ts +172 -0
- package/dist/esm/apis/CourseApi.js +443 -0
- package/dist/esm/apis/PlayerApi.d.ts +112 -0
- package/dist/esm/apis/PlayerApi.js +297 -0
- package/dist/esm/apis/QuizApi.d.ts +3 -2
- package/dist/esm/apis/QuizApi.js +4 -2
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/ContentLibraryVersionStatus.d.ts +26 -0
- package/dist/esm/models/ContentLibraryVersionStatus.js +44 -0
- package/dist/esm/models/GetContentLibraryVersion.d.ts +126 -0
- package/dist/esm/models/GetContentLibraryVersion.js +87 -0
- package/dist/esm/models/GetCourseVersion.d.ts +101 -0
- package/dist/esm/models/GetCourseVersion.js +86 -0
- package/dist/esm/models/GetCourseVersionItem.d.ts +135 -0
- package/dist/esm/models/GetCourseVersionItem.js +104 -0
- package/dist/esm/models/GetCourseVersionItemLaunch.d.ts +103 -0
- package/dist/esm/models/GetCourseVersionItemLaunch.js +82 -0
- package/dist/esm/models/GetCourseVersionItemSession.d.ts +124 -0
- package/dist/esm/models/GetCourseVersionItemSession.js +101 -0
- package/dist/esm/models/GetCourseVersionList.d.ts +33 -0
- package/dist/esm/models/GetCourseVersionList.js +44 -0
- package/dist/esm/models/GetCourseVersionModule.d.ts +64 -0
- package/dist/esm/models/GetCourseVersionModule.js +65 -0
- package/dist/esm/models/GetQuizAttemptQuestionsInner.d.ts +7 -0
- package/dist/esm/models/GetQuizAttemptQuestionsInner.js +3 -0
- package/dist/esm/models/GetQuizAttemptQuestionsInnerAnswerChoicesInner.d.ts +7 -0
- package/dist/esm/models/GetQuizAttemptQuestionsInnerAnswerChoicesInner.js +3 -0
- package/dist/esm/models/GetQuizResultsQuestionsInner.d.ts +13 -0
- package/dist/esm/models/GetQuizResultsQuestionsInner.js +5 -0
- package/dist/esm/models/GetQuizResultsQuestionsInnerAnswerChoicesInner.d.ts +7 -0
- package/dist/esm/models/GetQuizResultsQuestionsInnerAnswerChoicesInner.js +3 -0
- package/dist/esm/models/GetResource.d.ts +118 -0
- package/dist/esm/models/GetResource.js +95 -0
- package/dist/esm/models/GetResourceList.d.ts +57 -0
- package/dist/esm/models/GetResourceList.js +60 -0
- package/dist/esm/models/GetResourceUsage.d.ts +63 -0
- package/dist/esm/models/GetResourceUsage.js +64 -0
- package/dist/esm/models/GetResourceUsageCoursesInner.d.ts +63 -0
- package/dist/esm/models/GetResourceUsageCoursesInner.js +64 -0
- package/dist/esm/models/GetResourceVersionUpload.d.ts +38 -0
- package/dist/esm/models/GetResourceVersionUpload.js +47 -0
- package/dist/esm/models/PostCourseDraft.d.ts +32 -0
- package/dist/esm/models/PostCourseDraft.js +41 -0
- package/dist/esm/models/PostCourseVersionItem.d.ts +97 -0
- package/dist/esm/models/PostCourseVersionItem.js +71 -0
- package/dist/esm/models/PostCourseVersionItemSession.d.ts +32 -0
- package/dist/esm/models/PostCourseVersionItemSession.js +41 -0
- package/dist/esm/models/PostCourseVersionPublish.d.ts +32 -0
- package/dist/esm/models/PostCourseVersionPublish.js +41 -0
- package/dist/esm/models/PostQuizAttemptQuestionsInner.d.ts +7 -0
- package/dist/esm/models/PostQuizAttemptQuestionsInner.js +3 -0
- package/dist/esm/models/PostQuizAttemptQuestionsInnerAnswerChoicesInner.d.ts +7 -0
- package/dist/esm/models/PostQuizAttemptQuestionsInnerAnswerChoicesInner.js +3 -0
- package/dist/esm/models/PostResource.d.ts +58 -0
- package/dist/esm/models/PostResource.js +55 -0
- package/dist/esm/models/PostResourceVersion.d.ts +45 -0
- package/dist/esm/models/PostResourceVersion.js +46 -0
- package/dist/esm/models/PostResourceVersionComplete.d.ts +32 -0
- package/dist/esm/models/PostResourceVersionComplete.js +43 -0
- package/dist/esm/models/PostResourceVersionUpload.d.ts +50 -0
- package/dist/esm/models/PostResourceVersionUpload.js +55 -0
- package/dist/esm/models/PutCourseVersionItem.d.ts +85 -0
- package/dist/esm/models/PutCourseVersionItem.js +63 -0
- package/dist/esm/models/PutQuizAnswerResponse.d.ts +77 -0
- package/dist/esm/models/PutQuizAnswerResponse.js +64 -0
- package/dist/esm/models/PutQuizAnswerResponseNextQuestion.d.ts +102 -0
- package/dist/esm/models/PutQuizAnswerResponseNextQuestion.js +88 -0
- package/dist/esm/models/PutQuizAnswerResponseNextQuestionAnswerChoicesInner.d.ts +51 -0
- package/dist/esm/models/PutQuizAnswerResponseNextQuestionAnswerChoicesInner.js +54 -0
- package/dist/esm/models/PutQuizAnswerResponseProgress.d.ts +50 -0
- package/dist/esm/models/PutQuizAnswerResponseProgress.js +55 -0
- package/dist/esm/models/PutResource.d.ts +38 -0
- package/dist/esm/models/PutResource.js +43 -0
- package/dist/esm/models/PutResourceVersion.d.ts +53 -0
- package/dist/esm/models/PutResourceVersion.js +48 -0
- package/dist/esm/models/ResourceType.d.ts +32 -0
- package/dist/esm/models/ResourceType.js +50 -0
- package/dist/esm/models/index.d.ts +29 -0
- package/dist/esm/models/index.js +29 -0
- package/dist/models/ContentLibraryVersionStatus.d.ts +26 -0
- package/dist/models/ContentLibraryVersionStatus.js +52 -0
- package/dist/models/GetContentLibraryVersion.d.ts +126 -0
- package/dist/models/GetContentLibraryVersion.js +94 -0
- package/dist/models/GetCourseVersion.d.ts +101 -0
- package/dist/models/GetCourseVersion.js +93 -0
- package/dist/models/GetCourseVersionItem.d.ts +135 -0
- package/dist/models/GetCourseVersionItem.js +112 -0
- package/dist/models/GetCourseVersionItemLaunch.d.ts +103 -0
- package/dist/models/GetCourseVersionItemLaunch.js +89 -0
- package/dist/models/GetCourseVersionItemSession.d.ts +124 -0
- package/dist/models/GetCourseVersionItemSession.js +108 -0
- package/dist/models/GetCourseVersionList.d.ts +33 -0
- package/dist/models/GetCourseVersionList.js +51 -0
- package/dist/models/GetCourseVersionModule.d.ts +64 -0
- package/dist/models/GetCourseVersionModule.js +72 -0
- package/dist/models/GetQuizAttemptQuestionsInner.d.ts +7 -0
- package/dist/models/GetQuizAttemptQuestionsInner.js +3 -0
- package/dist/models/GetQuizAttemptQuestionsInnerAnswerChoicesInner.d.ts +7 -0
- package/dist/models/GetQuizAttemptQuestionsInnerAnswerChoicesInner.js +3 -0
- package/dist/models/GetQuizResultsQuestionsInner.d.ts +13 -0
- package/dist/models/GetQuizResultsQuestionsInner.js +5 -0
- package/dist/models/GetQuizResultsQuestionsInnerAnswerChoicesInner.d.ts +7 -0
- package/dist/models/GetQuizResultsQuestionsInnerAnswerChoicesInner.js +3 -0
- package/dist/models/GetResource.d.ts +118 -0
- package/dist/models/GetResource.js +102 -0
- package/dist/models/GetResourceList.d.ts +57 -0
- package/dist/models/GetResourceList.js +67 -0
- package/dist/models/GetResourceUsage.d.ts +63 -0
- package/dist/models/GetResourceUsage.js +71 -0
- package/dist/models/GetResourceUsageCoursesInner.d.ts +63 -0
- package/dist/models/GetResourceUsageCoursesInner.js +71 -0
- package/dist/models/GetResourceVersionUpload.d.ts +38 -0
- package/dist/models/GetResourceVersionUpload.js +54 -0
- package/dist/models/PostCourseDraft.d.ts +32 -0
- package/dist/models/PostCourseDraft.js +48 -0
- package/dist/models/PostCourseVersionItem.d.ts +97 -0
- package/dist/models/PostCourseVersionItem.js +79 -0
- package/dist/models/PostCourseVersionItemSession.d.ts +32 -0
- package/dist/models/PostCourseVersionItemSession.js +48 -0
- package/dist/models/PostCourseVersionPublish.d.ts +32 -0
- package/dist/models/PostCourseVersionPublish.js +48 -0
- package/dist/models/PostQuizAttemptQuestionsInner.d.ts +7 -0
- package/dist/models/PostQuizAttemptQuestionsInner.js +3 -0
- package/dist/models/PostQuizAttemptQuestionsInnerAnswerChoicesInner.d.ts +7 -0
- package/dist/models/PostQuizAttemptQuestionsInnerAnswerChoicesInner.js +3 -0
- package/dist/models/PostResource.d.ts +58 -0
- package/dist/models/PostResource.js +62 -0
- package/dist/models/PostResourceVersion.d.ts +45 -0
- package/dist/models/PostResourceVersion.js +53 -0
- package/dist/models/PostResourceVersionComplete.d.ts +32 -0
- package/dist/models/PostResourceVersionComplete.js +50 -0
- package/dist/models/PostResourceVersionUpload.d.ts +50 -0
- package/dist/models/PostResourceVersionUpload.js +62 -0
- package/dist/models/PutCourseVersionItem.d.ts +85 -0
- package/dist/models/PutCourseVersionItem.js +71 -0
- package/dist/models/PutQuizAnswerResponse.d.ts +77 -0
- package/dist/models/PutQuizAnswerResponse.js +71 -0
- package/dist/models/PutQuizAnswerResponseNextQuestion.d.ts +102 -0
- package/dist/models/PutQuizAnswerResponseNextQuestion.js +96 -0
- package/dist/models/PutQuizAnswerResponseNextQuestionAnswerChoicesInner.d.ts +51 -0
- package/dist/models/PutQuizAnswerResponseNextQuestionAnswerChoicesInner.js +61 -0
- package/dist/models/PutQuizAnswerResponseProgress.d.ts +50 -0
- package/dist/models/PutQuizAnswerResponseProgress.js +62 -0
- package/dist/models/PutResource.d.ts +38 -0
- package/dist/models/PutResource.js +50 -0
- package/dist/models/PutResourceVersion.d.ts +53 -0
- package/dist/models/PutResourceVersion.js +55 -0
- package/dist/models/ResourceType.d.ts +32 -0
- package/dist/models/ResourceType.js +58 -0
- package/dist/models/index.d.ts +29 -0
- package/dist/models/index.js +29 -0
- package/docs/ContentLibraryApi.md +1132 -0
- package/docs/ContentLibraryVersionStatus.md +33 -0
- package/docs/CourseApi.md +797 -96
- package/docs/GetContentLibraryVersion.md +64 -0
- package/docs/GetCourseVersion.md +56 -0
- package/docs/GetCourseVersionItem.md +62 -0
- package/docs/GetCourseVersionItemLaunch.md +56 -0
- package/docs/GetCourseVersionItemSession.md +65 -0
- package/docs/GetCourseVersionList.md +34 -0
- package/docs/GetCourseVersionModule.md +44 -0
- package/docs/GetQuizAttemptQuestionsInner.md +2 -0
- package/docs/GetQuizAttemptQuestionsInnerAnswerChoicesInner.md +2 -0
- package/docs/GetQuizResultsQuestionsInner.md +4 -0
- package/docs/GetQuizResultsQuestionsInnerAnswerChoicesInner.md +2 -0
- package/docs/GetResource.md +62 -0
- package/docs/GetResourceList.md +42 -0
- package/docs/GetResourceUsage.md +44 -0
- package/docs/GetResourceUsageCoursesInner.md +44 -0
- package/docs/GetResourceVersionUpload.md +36 -0
- package/docs/PlayerApi.md +480 -0
- package/docs/PostCourseDraft.md +34 -0
- package/docs/PostCourseVersionItem.md +52 -0
- package/docs/PostCourseVersionItemSession.md +35 -0
- package/docs/PostCourseVersionPublish.md +34 -0
- package/docs/PostQuizAttemptQuestionsInner.md +2 -0
- package/docs/PostQuizAttemptQuestionsInnerAnswerChoicesInner.md +2 -0
- package/docs/PostResource.md +42 -0
- package/docs/PostResourceVersion.md +38 -0
- package/docs/PostResourceVersionComplete.md +34 -0
- package/docs/PostResourceVersionUpload.md +40 -0
- package/docs/PutCourseVersionItem.md +48 -0
- package/docs/PutQuizAnswerResponse.md +48 -0
- package/docs/PutQuizAnswerResponseNextQuestion.md +52 -0
- package/docs/PutQuizAnswerResponseNextQuestionAnswerChoicesInner.md +40 -0
- package/docs/PutQuizAnswerResponseProgress.md +40 -0
- package/docs/PutResource.md +36 -0
- package/docs/PutResourceVersion.md +40 -0
- package/docs/QuizApi.md +3 -3
- package/docs/ResourceType.md +33 -0
- package/package.json +1 -1
- package/src/apis/ContentLibraryApi.ts +1024 -0
- package/src/apis/CourseApi.ts +636 -0
- package/src/apis/PlayerApi.ts +400 -0
- package/src/apis/QuizApi.ts +10 -4
- package/src/apis/index.ts +1 -0
- package/src/models/ContentLibraryVersionStatus.ts +54 -0
- package/src/models/GetContentLibraryVersion.ts +209 -0
- package/src/models/GetCourseVersion.ts +187 -0
- package/src/models/GetCourseVersionItem.ts +215 -0
- package/src/models/GetCourseVersionItemLaunch.ts +185 -0
- package/src/models/GetCourseVersionItemSession.ts +216 -0
- package/src/models/GetCourseVersionList.ts +74 -0
- package/src/models/GetCourseVersionModule.ts +126 -0
- package/src/models/GetQuizAttemptQuestionsInner.ts +15 -0
- package/src/models/GetQuizAttemptQuestionsInnerAnswerChoicesInner.ts +16 -0
- package/src/models/GetQuizResultsQuestionsInner.ts +23 -0
- package/src/models/GetQuizResultsQuestionsInnerAnswerChoicesInner.ts +16 -0
- package/src/models/GetResource.ts +206 -0
- package/src/models/GetResourceList.ts +110 -0
- package/src/models/GetResourceUsage.ts +119 -0
- package/src/models/GetResourceUsageCoursesInner.ts +121 -0
- package/src/models/GetResourceVersionUpload.ts +75 -0
- package/src/models/PostCourseDraft.ts +65 -0
- package/src/models/PostCourseVersionItem.ts +158 -0
- package/src/models/PostCourseVersionItemSession.ts +65 -0
- package/src/models/PostCourseVersionPublish.ts +65 -0
- package/src/models/PostQuizAttemptQuestionsInner.ts +15 -0
- package/src/models/PostQuizAttemptQuestionsInnerAnswerChoicesInner.ts +16 -0
- package/src/models/PostResource.ts +116 -0
- package/src/models/PostResourceVersion.ts +89 -0
- package/src/models/PostResourceVersionComplete.ts +66 -0
- package/src/models/PostResourceVersionUpload.ts +93 -0
- package/src/models/PutCourseVersionItem.ts +140 -0
- package/src/models/PutQuizAnswerResponse.ts +146 -0
- package/src/models/PutQuizAnswerResponseNextQuestion.ts +175 -0
- package/src/models/PutQuizAnswerResponseNextQuestionAnswerChoicesInner.ts +100 -0
- package/src/models/PutQuizAnswerResponseProgress.ts +93 -0
- package/src/models/PutResource.ts +73 -0
- package/src/models/PutResourceVersion.ts +97 -0
- package/src/models/ResourceType.ts +60 -0
- package/src/models/index.ts +29 -0
|
@@ -0,0 +1,1132 @@
|
|
|
1
|
+
# ContentLibraryApi
|
|
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
|
+
| [**deleteResourceVersion**](ContentLibraryApi.md#deleteresourceversion) | **DELETE** /content-library/resources/{resourceId}/versions/{versionId} | Discard an unreferenced draft resource version |
|
|
8
|
+
| [**getContentLibraryItemList**](ContentLibraryApi.md#getcontentlibraryitemlist) | **GET** /content-library/items | Search Content Library items |
|
|
9
|
+
| [**getResource**](ContentLibraryApi.md#getresource) | **GET** /content-library/resources/{resourceId} | Get a resource and all versions |
|
|
10
|
+
| [**getResourceList**](ContentLibraryApi.md#getresourcelist) | **GET** /content-library/resources | List reusable resources |
|
|
11
|
+
| [**getResourceUsage**](ContentLibraryApi.md#getresourceusage) | **GET** /content-library/resources/{resourceId}/usage | Get course and learner usage for a resource |
|
|
12
|
+
| [**getResourceVersion**](ContentLibraryApi.md#getresourceversion) | **GET** /content-library/resources/{resourceId}/versions/{versionId} | Get a resource version |
|
|
13
|
+
| [**postResource**](ContentLibraryApi.md#postresource) | **POST** /content-library/resources | Create a resource and its first draft version |
|
|
14
|
+
| [**postResourceArchive**](ContentLibraryApi.md#postresourcearchive) | **POST** /content-library/resources/{resourceId}/archive | Archive a logical resource |
|
|
15
|
+
| [**postResourceVersion**](ContentLibraryApi.md#postresourceversion) | **POST** /content-library/resources/{resourceId}/versions | Create the next draft resource version |
|
|
16
|
+
| [**postResourceVersionArchive**](ContentLibraryApi.md#postresourceversionarchive) | **POST** /content-library/resources/{resourceId}/versions/{versionId}/archive | Archive a published resource version |
|
|
17
|
+
| [**postResourceVersionPublish**](ContentLibraryApi.md#postresourceversionpublish) | **POST** /content-library/resources/{resourceId}/versions/{versionId}/publish | Publish an immutable resource version |
|
|
18
|
+
| [**postResourceVersionUpload**](ContentLibraryApi.md#postresourceversionupload) | **POST** /content-library/resources/{resourceId}/versions/{versionId}/upload | Initialize a version-scoped file upload |
|
|
19
|
+
| [**postResourceVersionUploadComplete**](ContentLibraryApi.md#postresourceversionuploadcomplete) | **POST** /content-library/resources/{resourceId}/versions/{versionId}/upload/complete | Verify and complete a resource upload |
|
|
20
|
+
| [**putResource**](ContentLibraryApi.md#putresource) | **PUT** /content-library/resources/{resourceId} | Update resource library metadata |
|
|
21
|
+
| [**putResourceVersion**](ContentLibraryApi.md#putresourceversion) | **PUT** /content-library/resources/{resourceId}/versions/{versionId} | Edit a draft resource version |
|
|
22
|
+
| [**putResourceVersionUploadFile**](ContentLibraryApi.md#putresourceversionuploadfile) | **PUT** /content-library/resources/{resourceId}/versions/{versionId}/upload | Upload bytes for a draft resource version |
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## deleteResourceVersion
|
|
27
|
+
|
|
28
|
+
> deleteResourceVersion(resourceId, versionId)
|
|
29
|
+
|
|
30
|
+
Discard an unreferenced draft resource version
|
|
31
|
+
|
|
32
|
+
### Example
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import {
|
|
36
|
+
Configuration,
|
|
37
|
+
ContentLibraryApi,
|
|
38
|
+
} from '@easyedu/js-lsm-api';
|
|
39
|
+
import type { DeleteResourceVersionRequest } from '@easyedu/js-lsm-api';
|
|
40
|
+
|
|
41
|
+
async function example() {
|
|
42
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
43
|
+
const api = new ContentLibraryApi();
|
|
44
|
+
|
|
45
|
+
const body = {
|
|
46
|
+
// string
|
|
47
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
48
|
+
// string
|
|
49
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
50
|
+
} satisfies DeleteResourceVersionRequest;
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const data = await api.deleteResourceVersion(body);
|
|
54
|
+
console.log(data);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error(error);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Run the test
|
|
61
|
+
example().catch(console.error);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Parameters
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
| Name | Type | Description | Notes |
|
|
68
|
+
|------------- | ------------- | ------------- | -------------|
|
|
69
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
70
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
71
|
+
|
|
72
|
+
### Return type
|
|
73
|
+
|
|
74
|
+
`void` (Empty response body)
|
|
75
|
+
|
|
76
|
+
### Authorization
|
|
77
|
+
|
|
78
|
+
No authorization required
|
|
79
|
+
|
|
80
|
+
### HTTP request headers
|
|
81
|
+
|
|
82
|
+
- **Content-Type**: Not defined
|
|
83
|
+
- **Accept**: Not defined
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### HTTP response details
|
|
87
|
+
| Status code | Description | Response headers |
|
|
88
|
+
|-------------|-------------|------------------|
|
|
89
|
+
| **204** | Draft discarded | - |
|
|
90
|
+
| **409** | Only unreferenced drafts may be discarded | - |
|
|
91
|
+
|
|
92
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## getContentLibraryItemList
|
|
96
|
+
|
|
97
|
+
> GetResourceList getContentLibraryItemList(kind, search, resourceType, page, pageSize)
|
|
98
|
+
|
|
99
|
+
Search Content Library items
|
|
100
|
+
|
|
101
|
+
### Example
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import {
|
|
105
|
+
Configuration,
|
|
106
|
+
ContentLibraryApi,
|
|
107
|
+
} from '@easyedu/js-lsm-api';
|
|
108
|
+
import type { GetContentLibraryItemListRequest } from '@easyedu/js-lsm-api';
|
|
109
|
+
|
|
110
|
+
async function example() {
|
|
111
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
112
|
+
const api = new ContentLibraryApi();
|
|
113
|
+
|
|
114
|
+
const body = {
|
|
115
|
+
// string (optional)
|
|
116
|
+
kind: kind_example,
|
|
117
|
+
// string (optional)
|
|
118
|
+
search: search_example,
|
|
119
|
+
// ResourceType (optional)
|
|
120
|
+
resourceType: ...,
|
|
121
|
+
// number (optional)
|
|
122
|
+
page: 56,
|
|
123
|
+
// number (optional)
|
|
124
|
+
pageSize: 56,
|
|
125
|
+
} satisfies GetContentLibraryItemListRequest;
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
const data = await api.getContentLibraryItemList(body);
|
|
129
|
+
console.log(data);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error(error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Run the test
|
|
136
|
+
example().catch(console.error);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Parameters
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
| Name | Type | Description | Notes |
|
|
143
|
+
|------------- | ------------- | ------------- | -------------|
|
|
144
|
+
| **kind** | `string` | | [Optional] [Defaults to `'resource'`] |
|
|
145
|
+
| **search** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
146
|
+
| **resourceType** | `ResourceType` | | [Optional] [Defaults to `undefined`] [Enum: scorm, video, audio, image, pdf, powerpoint, file, link, rich_text] |
|
|
147
|
+
| **page** | `number` | | [Optional] [Defaults to `1`] |
|
|
148
|
+
| **pageSize** | `number` | | [Optional] [Defaults to `20`] |
|
|
149
|
+
|
|
150
|
+
### Return type
|
|
151
|
+
|
|
152
|
+
[**GetResourceList**](GetResourceList.md)
|
|
153
|
+
|
|
154
|
+
### Authorization
|
|
155
|
+
|
|
156
|
+
No authorization required
|
|
157
|
+
|
|
158
|
+
### HTTP request headers
|
|
159
|
+
|
|
160
|
+
- **Content-Type**: Not defined
|
|
161
|
+
- **Accept**: `application/json`
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### HTTP response details
|
|
165
|
+
| Status code | Description | Response headers |
|
|
166
|
+
|-------------|-------------|------------------|
|
|
167
|
+
| **200** | Content Library items | - |
|
|
168
|
+
|
|
169
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## getResource
|
|
173
|
+
|
|
174
|
+
> GetResource getResource(resourceId)
|
|
175
|
+
|
|
176
|
+
Get a resource and all versions
|
|
177
|
+
|
|
178
|
+
### Example
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
import {
|
|
182
|
+
Configuration,
|
|
183
|
+
ContentLibraryApi,
|
|
184
|
+
} from '@easyedu/js-lsm-api';
|
|
185
|
+
import type { GetResourceRequest } from '@easyedu/js-lsm-api';
|
|
186
|
+
|
|
187
|
+
async function example() {
|
|
188
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
189
|
+
const api = new ContentLibraryApi();
|
|
190
|
+
|
|
191
|
+
const body = {
|
|
192
|
+
// string
|
|
193
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
194
|
+
} satisfies GetResourceRequest;
|
|
195
|
+
|
|
196
|
+
try {
|
|
197
|
+
const data = await api.getResource(body);
|
|
198
|
+
console.log(data);
|
|
199
|
+
} catch (error) {
|
|
200
|
+
console.error(error);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Run the test
|
|
205
|
+
example().catch(console.error);
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Parameters
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
| Name | Type | Description | Notes |
|
|
212
|
+
|------------- | ------------- | ------------- | -------------|
|
|
213
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
214
|
+
|
|
215
|
+
### Return type
|
|
216
|
+
|
|
217
|
+
[**GetResource**](GetResource.md)
|
|
218
|
+
|
|
219
|
+
### Authorization
|
|
220
|
+
|
|
221
|
+
No authorization required
|
|
222
|
+
|
|
223
|
+
### HTTP request headers
|
|
224
|
+
|
|
225
|
+
- **Content-Type**: Not defined
|
|
226
|
+
- **Accept**: `application/json`
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### HTTP response details
|
|
230
|
+
| Status code | Description | Response headers |
|
|
231
|
+
|-------------|-------------|------------------|
|
|
232
|
+
| **200** | Resource detail | - |
|
|
233
|
+
| **404** | Resource not found | - |
|
|
234
|
+
|
|
235
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
## getResourceList
|
|
239
|
+
|
|
240
|
+
> GetResourceList getResourceList(search, resourceType, page, pageSize)
|
|
241
|
+
|
|
242
|
+
List reusable resources
|
|
243
|
+
|
|
244
|
+
### Example
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
import {
|
|
248
|
+
Configuration,
|
|
249
|
+
ContentLibraryApi,
|
|
250
|
+
} from '@easyedu/js-lsm-api';
|
|
251
|
+
import type { GetResourceListRequest } from '@easyedu/js-lsm-api';
|
|
252
|
+
|
|
253
|
+
async function example() {
|
|
254
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
255
|
+
const api = new ContentLibraryApi();
|
|
256
|
+
|
|
257
|
+
const body = {
|
|
258
|
+
// string (optional)
|
|
259
|
+
search: search_example,
|
|
260
|
+
// ResourceType (optional)
|
|
261
|
+
resourceType: ...,
|
|
262
|
+
// number (optional)
|
|
263
|
+
page: 56,
|
|
264
|
+
// number (optional)
|
|
265
|
+
pageSize: 56,
|
|
266
|
+
} satisfies GetResourceListRequest;
|
|
267
|
+
|
|
268
|
+
try {
|
|
269
|
+
const data = await api.getResourceList(body);
|
|
270
|
+
console.log(data);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
console.error(error);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Run the test
|
|
277
|
+
example().catch(console.error);
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Parameters
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
| Name | Type | Description | Notes |
|
|
284
|
+
|------------- | ------------- | ------------- | -------------|
|
|
285
|
+
| **search** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
286
|
+
| **resourceType** | `ResourceType` | | [Optional] [Defaults to `undefined`] [Enum: scorm, video, audio, image, pdf, powerpoint, file, link, rich_text] |
|
|
287
|
+
| **page** | `number` | | [Optional] [Defaults to `1`] |
|
|
288
|
+
| **pageSize** | `number` | | [Optional] [Defaults to `20`] |
|
|
289
|
+
|
|
290
|
+
### Return type
|
|
291
|
+
|
|
292
|
+
[**GetResourceList**](GetResourceList.md)
|
|
293
|
+
|
|
294
|
+
### Authorization
|
|
295
|
+
|
|
296
|
+
No authorization required
|
|
297
|
+
|
|
298
|
+
### HTTP request headers
|
|
299
|
+
|
|
300
|
+
- **Content-Type**: Not defined
|
|
301
|
+
- **Accept**: `application/json`
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
### HTTP response details
|
|
305
|
+
| Status code | Description | Response headers |
|
|
306
|
+
|-------------|-------------|------------------|
|
|
307
|
+
| **200** | Reusable resources | - |
|
|
308
|
+
|
|
309
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
## getResourceUsage
|
|
313
|
+
|
|
314
|
+
> GetResourceUsage getResourceUsage(resourceId)
|
|
315
|
+
|
|
316
|
+
Get course and learner usage for a resource
|
|
317
|
+
|
|
318
|
+
### Example
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
import {
|
|
322
|
+
Configuration,
|
|
323
|
+
ContentLibraryApi,
|
|
324
|
+
} from '@easyedu/js-lsm-api';
|
|
325
|
+
import type { GetResourceUsageRequest } from '@easyedu/js-lsm-api';
|
|
326
|
+
|
|
327
|
+
async function example() {
|
|
328
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
329
|
+
const api = new ContentLibraryApi();
|
|
330
|
+
|
|
331
|
+
const body = {
|
|
332
|
+
// string
|
|
333
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
334
|
+
} satisfies GetResourceUsageRequest;
|
|
335
|
+
|
|
336
|
+
try {
|
|
337
|
+
const data = await api.getResourceUsage(body);
|
|
338
|
+
console.log(data);
|
|
339
|
+
} catch (error) {
|
|
340
|
+
console.error(error);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Run the test
|
|
345
|
+
example().catch(console.error);
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Parameters
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
| Name | Type | Description | Notes |
|
|
352
|
+
|------------- | ------------- | ------------- | -------------|
|
|
353
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
354
|
+
|
|
355
|
+
### Return type
|
|
356
|
+
|
|
357
|
+
[**GetResourceUsage**](GetResourceUsage.md)
|
|
358
|
+
|
|
359
|
+
### Authorization
|
|
360
|
+
|
|
361
|
+
No authorization required
|
|
362
|
+
|
|
363
|
+
### HTTP request headers
|
|
364
|
+
|
|
365
|
+
- **Content-Type**: Not defined
|
|
366
|
+
- **Accept**: `application/json`
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
### HTTP response details
|
|
370
|
+
| Status code | Description | Response headers |
|
|
371
|
+
|-------------|-------------|------------------|
|
|
372
|
+
| **200** | Resource usage | - |
|
|
373
|
+
|
|
374
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
## getResourceVersion
|
|
378
|
+
|
|
379
|
+
> GetContentLibraryVersion getResourceVersion(resourceId, versionId)
|
|
380
|
+
|
|
381
|
+
Get a resource version
|
|
382
|
+
|
|
383
|
+
### Example
|
|
384
|
+
|
|
385
|
+
```ts
|
|
386
|
+
import {
|
|
387
|
+
Configuration,
|
|
388
|
+
ContentLibraryApi,
|
|
389
|
+
} from '@easyedu/js-lsm-api';
|
|
390
|
+
import type { GetResourceVersionRequest } from '@easyedu/js-lsm-api';
|
|
391
|
+
|
|
392
|
+
async function example() {
|
|
393
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
394
|
+
const api = new ContentLibraryApi();
|
|
395
|
+
|
|
396
|
+
const body = {
|
|
397
|
+
// string
|
|
398
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
399
|
+
// string
|
|
400
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
401
|
+
} satisfies GetResourceVersionRequest;
|
|
402
|
+
|
|
403
|
+
try {
|
|
404
|
+
const data = await api.getResourceVersion(body);
|
|
405
|
+
console.log(data);
|
|
406
|
+
} catch (error) {
|
|
407
|
+
console.error(error);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
// Run the test
|
|
412
|
+
example().catch(console.error);
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### Parameters
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
| Name | Type | Description | Notes |
|
|
419
|
+
|------------- | ------------- | ------------- | -------------|
|
|
420
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
421
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
422
|
+
|
|
423
|
+
### Return type
|
|
424
|
+
|
|
425
|
+
[**GetContentLibraryVersion**](GetContentLibraryVersion.md)
|
|
426
|
+
|
|
427
|
+
### Authorization
|
|
428
|
+
|
|
429
|
+
No authorization required
|
|
430
|
+
|
|
431
|
+
### HTTP request headers
|
|
432
|
+
|
|
433
|
+
- **Content-Type**: Not defined
|
|
434
|
+
- **Accept**: `application/json`
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
### HTTP response details
|
|
438
|
+
| Status code | Description | Response headers |
|
|
439
|
+
|-------------|-------------|------------------|
|
|
440
|
+
| **200** | Resource version | - |
|
|
441
|
+
|
|
442
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
## postResource
|
|
446
|
+
|
|
447
|
+
> GetResource postResource(postResource)
|
|
448
|
+
|
|
449
|
+
Create a resource and its first draft version
|
|
450
|
+
|
|
451
|
+
### Example
|
|
452
|
+
|
|
453
|
+
```ts
|
|
454
|
+
import {
|
|
455
|
+
Configuration,
|
|
456
|
+
ContentLibraryApi,
|
|
457
|
+
} from '@easyedu/js-lsm-api';
|
|
458
|
+
import type { PostResourceRequest } from '@easyedu/js-lsm-api';
|
|
459
|
+
|
|
460
|
+
async function example() {
|
|
461
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
462
|
+
const api = new ContentLibraryApi();
|
|
463
|
+
|
|
464
|
+
const body = {
|
|
465
|
+
// PostResource
|
|
466
|
+
postResource: ...,
|
|
467
|
+
} satisfies PostResourceRequest;
|
|
468
|
+
|
|
469
|
+
try {
|
|
470
|
+
const data = await api.postResource(body);
|
|
471
|
+
console.log(data);
|
|
472
|
+
} catch (error) {
|
|
473
|
+
console.error(error);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Run the test
|
|
478
|
+
example().catch(console.error);
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Parameters
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
| Name | Type | Description | Notes |
|
|
485
|
+
|------------- | ------------- | ------------- | -------------|
|
|
486
|
+
| **postResource** | [PostResource](PostResource.md) | | |
|
|
487
|
+
|
|
488
|
+
### Return type
|
|
489
|
+
|
|
490
|
+
[**GetResource**](GetResource.md)
|
|
491
|
+
|
|
492
|
+
### Authorization
|
|
493
|
+
|
|
494
|
+
No authorization required
|
|
495
|
+
|
|
496
|
+
### HTTP request headers
|
|
497
|
+
|
|
498
|
+
- **Content-Type**: `application/json`
|
|
499
|
+
- **Accept**: `application/json`
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
### HTTP response details
|
|
503
|
+
| Status code | Description | Response headers |
|
|
504
|
+
|-------------|-------------|------------------|
|
|
505
|
+
| **201** | Resource created | - |
|
|
506
|
+
| **400** | Invalid resource payload | - |
|
|
507
|
+
|
|
508
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
## postResourceArchive
|
|
512
|
+
|
|
513
|
+
> GetResource postResourceArchive(resourceId)
|
|
514
|
+
|
|
515
|
+
Archive a logical resource
|
|
516
|
+
|
|
517
|
+
### Example
|
|
518
|
+
|
|
519
|
+
```ts
|
|
520
|
+
import {
|
|
521
|
+
Configuration,
|
|
522
|
+
ContentLibraryApi,
|
|
523
|
+
} from '@easyedu/js-lsm-api';
|
|
524
|
+
import type { PostResourceArchiveRequest } from '@easyedu/js-lsm-api';
|
|
525
|
+
|
|
526
|
+
async function example() {
|
|
527
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
528
|
+
const api = new ContentLibraryApi();
|
|
529
|
+
|
|
530
|
+
const body = {
|
|
531
|
+
// string
|
|
532
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
533
|
+
} satisfies PostResourceArchiveRequest;
|
|
534
|
+
|
|
535
|
+
try {
|
|
536
|
+
const data = await api.postResourceArchive(body);
|
|
537
|
+
console.log(data);
|
|
538
|
+
} catch (error) {
|
|
539
|
+
console.error(error);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// Run the test
|
|
544
|
+
example().catch(console.error);
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
### Parameters
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
| Name | Type | Description | Notes |
|
|
551
|
+
|------------- | ------------- | ------------- | -------------|
|
|
552
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
553
|
+
|
|
554
|
+
### Return type
|
|
555
|
+
|
|
556
|
+
[**GetResource**](GetResource.md)
|
|
557
|
+
|
|
558
|
+
### Authorization
|
|
559
|
+
|
|
560
|
+
No authorization required
|
|
561
|
+
|
|
562
|
+
### HTTP request headers
|
|
563
|
+
|
|
564
|
+
- **Content-Type**: Not defined
|
|
565
|
+
- **Accept**: `application/json`
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
### HTTP response details
|
|
569
|
+
| Status code | Description | Response headers |
|
|
570
|
+
|-------------|-------------|------------------|
|
|
571
|
+
| **200** | Resource archived | - |
|
|
572
|
+
|
|
573
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
## postResourceVersion
|
|
577
|
+
|
|
578
|
+
> GetContentLibraryVersion postResourceVersion(resourceId, postResourceVersion)
|
|
579
|
+
|
|
580
|
+
Create the next draft resource version
|
|
581
|
+
|
|
582
|
+
### Example
|
|
583
|
+
|
|
584
|
+
```ts
|
|
585
|
+
import {
|
|
586
|
+
Configuration,
|
|
587
|
+
ContentLibraryApi,
|
|
588
|
+
} from '@easyedu/js-lsm-api';
|
|
589
|
+
import type { PostResourceVersionRequest } from '@easyedu/js-lsm-api';
|
|
590
|
+
|
|
591
|
+
async function example() {
|
|
592
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
593
|
+
const api = new ContentLibraryApi();
|
|
594
|
+
|
|
595
|
+
const body = {
|
|
596
|
+
// string
|
|
597
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
598
|
+
// PostResourceVersion (optional)
|
|
599
|
+
postResourceVersion: ...,
|
|
600
|
+
} satisfies PostResourceVersionRequest;
|
|
601
|
+
|
|
602
|
+
try {
|
|
603
|
+
const data = await api.postResourceVersion(body);
|
|
604
|
+
console.log(data);
|
|
605
|
+
} catch (error) {
|
|
606
|
+
console.error(error);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
// Run the test
|
|
611
|
+
example().catch(console.error);
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
### Parameters
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
| Name | Type | Description | Notes |
|
|
618
|
+
|------------- | ------------- | ------------- | -------------|
|
|
619
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
620
|
+
| **postResourceVersion** | [PostResourceVersion](PostResourceVersion.md) | | [Optional] |
|
|
621
|
+
|
|
622
|
+
### Return type
|
|
623
|
+
|
|
624
|
+
[**GetContentLibraryVersion**](GetContentLibraryVersion.md)
|
|
625
|
+
|
|
626
|
+
### Authorization
|
|
627
|
+
|
|
628
|
+
No authorization required
|
|
629
|
+
|
|
630
|
+
### HTTP request headers
|
|
631
|
+
|
|
632
|
+
- **Content-Type**: `application/json`
|
|
633
|
+
- **Accept**: `application/json`
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
### HTTP response details
|
|
637
|
+
| Status code | Description | Response headers |
|
|
638
|
+
|-------------|-------------|------------------|
|
|
639
|
+
| **201** | Draft version created | - |
|
|
640
|
+
| **409** | The resource already has a draft | - |
|
|
641
|
+
|
|
642
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
## postResourceVersionArchive
|
|
646
|
+
|
|
647
|
+
> GetContentLibraryVersion postResourceVersionArchive(resourceId, versionId)
|
|
648
|
+
|
|
649
|
+
Archive a published resource version
|
|
650
|
+
|
|
651
|
+
### Example
|
|
652
|
+
|
|
653
|
+
```ts
|
|
654
|
+
import {
|
|
655
|
+
Configuration,
|
|
656
|
+
ContentLibraryApi,
|
|
657
|
+
} from '@easyedu/js-lsm-api';
|
|
658
|
+
import type { PostResourceVersionArchiveRequest } from '@easyedu/js-lsm-api';
|
|
659
|
+
|
|
660
|
+
async function example() {
|
|
661
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
662
|
+
const api = new ContentLibraryApi();
|
|
663
|
+
|
|
664
|
+
const body = {
|
|
665
|
+
// string
|
|
666
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
667
|
+
// string
|
|
668
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
669
|
+
} satisfies PostResourceVersionArchiveRequest;
|
|
670
|
+
|
|
671
|
+
try {
|
|
672
|
+
const data = await api.postResourceVersionArchive(body);
|
|
673
|
+
console.log(data);
|
|
674
|
+
} catch (error) {
|
|
675
|
+
console.error(error);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// Run the test
|
|
680
|
+
example().catch(console.error);
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
### Parameters
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
| Name | Type | Description | Notes |
|
|
687
|
+
|------------- | ------------- | ------------- | -------------|
|
|
688
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
689
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
690
|
+
|
|
691
|
+
### Return type
|
|
692
|
+
|
|
693
|
+
[**GetContentLibraryVersion**](GetContentLibraryVersion.md)
|
|
694
|
+
|
|
695
|
+
### Authorization
|
|
696
|
+
|
|
697
|
+
No authorization required
|
|
698
|
+
|
|
699
|
+
### HTTP request headers
|
|
700
|
+
|
|
701
|
+
- **Content-Type**: Not defined
|
|
702
|
+
- **Accept**: `application/json`
|
|
703
|
+
|
|
704
|
+
|
|
705
|
+
### HTTP response details
|
|
706
|
+
| Status code | Description | Response headers |
|
|
707
|
+
|-------------|-------------|------------------|
|
|
708
|
+
| **200** | Version archived | - |
|
|
709
|
+
|
|
710
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
## postResourceVersionPublish
|
|
714
|
+
|
|
715
|
+
> GetContentLibraryVersion postResourceVersionPublish(resourceId, versionId)
|
|
716
|
+
|
|
717
|
+
Publish an immutable resource version
|
|
718
|
+
|
|
719
|
+
### Example
|
|
720
|
+
|
|
721
|
+
```ts
|
|
722
|
+
import {
|
|
723
|
+
Configuration,
|
|
724
|
+
ContentLibraryApi,
|
|
725
|
+
} from '@easyedu/js-lsm-api';
|
|
726
|
+
import type { PostResourceVersionPublishRequest } from '@easyedu/js-lsm-api';
|
|
727
|
+
|
|
728
|
+
async function example() {
|
|
729
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
730
|
+
const api = new ContentLibraryApi();
|
|
731
|
+
|
|
732
|
+
const body = {
|
|
733
|
+
// string
|
|
734
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
735
|
+
// string
|
|
736
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
737
|
+
} satisfies PostResourceVersionPublishRequest;
|
|
738
|
+
|
|
739
|
+
try {
|
|
740
|
+
const data = await api.postResourceVersionPublish(body);
|
|
741
|
+
console.log(data);
|
|
742
|
+
} catch (error) {
|
|
743
|
+
console.error(error);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// Run the test
|
|
748
|
+
example().catch(console.error);
|
|
749
|
+
```
|
|
750
|
+
|
|
751
|
+
### Parameters
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
| Name | Type | Description | Notes |
|
|
755
|
+
|------------- | ------------- | ------------- | -------------|
|
|
756
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
757
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
758
|
+
|
|
759
|
+
### Return type
|
|
760
|
+
|
|
761
|
+
[**GetContentLibraryVersion**](GetContentLibraryVersion.md)
|
|
762
|
+
|
|
763
|
+
### Authorization
|
|
764
|
+
|
|
765
|
+
No authorization required
|
|
766
|
+
|
|
767
|
+
### HTTP request headers
|
|
768
|
+
|
|
769
|
+
- **Content-Type**: Not defined
|
|
770
|
+
- **Accept**: `application/json`
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
### HTTP response details
|
|
774
|
+
| Status code | Description | Response headers |
|
|
775
|
+
|-------------|-------------|------------------|
|
|
776
|
+
| **200** | Version published | - |
|
|
777
|
+
|
|
778
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
## postResourceVersionUpload
|
|
782
|
+
|
|
783
|
+
> GetResourceVersionUpload postResourceVersionUpload(resourceId, versionId, postResourceVersionUpload)
|
|
784
|
+
|
|
785
|
+
Initialize a version-scoped file upload
|
|
786
|
+
|
|
787
|
+
### Example
|
|
788
|
+
|
|
789
|
+
```ts
|
|
790
|
+
import {
|
|
791
|
+
Configuration,
|
|
792
|
+
ContentLibraryApi,
|
|
793
|
+
} from '@easyedu/js-lsm-api';
|
|
794
|
+
import type { PostResourceVersionUploadRequest } from '@easyedu/js-lsm-api';
|
|
795
|
+
|
|
796
|
+
async function example() {
|
|
797
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
798
|
+
const api = new ContentLibraryApi();
|
|
799
|
+
|
|
800
|
+
const body = {
|
|
801
|
+
// string
|
|
802
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
803
|
+
// string
|
|
804
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
805
|
+
// PostResourceVersionUpload
|
|
806
|
+
postResourceVersionUpload: ...,
|
|
807
|
+
} satisfies PostResourceVersionUploadRequest;
|
|
808
|
+
|
|
809
|
+
try {
|
|
810
|
+
const data = await api.postResourceVersionUpload(body);
|
|
811
|
+
console.log(data);
|
|
812
|
+
} catch (error) {
|
|
813
|
+
console.error(error);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
// Run the test
|
|
818
|
+
example().catch(console.error);
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
### Parameters
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
| Name | Type | Description | Notes |
|
|
825
|
+
|------------- | ------------- | ------------- | -------------|
|
|
826
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
827
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
828
|
+
| **postResourceVersionUpload** | [PostResourceVersionUpload](PostResourceVersionUpload.md) | | |
|
|
829
|
+
|
|
830
|
+
### Return type
|
|
831
|
+
|
|
832
|
+
[**GetResourceVersionUpload**](GetResourceVersionUpload.md)
|
|
833
|
+
|
|
834
|
+
### Authorization
|
|
835
|
+
|
|
836
|
+
No authorization required
|
|
837
|
+
|
|
838
|
+
### HTTP request headers
|
|
839
|
+
|
|
840
|
+
- **Content-Type**: `application/json`
|
|
841
|
+
- **Accept**: `application/json`
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
### HTTP response details
|
|
845
|
+
| Status code | Description | Response headers |
|
|
846
|
+
|-------------|-------------|------------------|
|
|
847
|
+
| **200** | Upload initialized | - |
|
|
848
|
+
|
|
849
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
## postResourceVersionUploadComplete
|
|
853
|
+
|
|
854
|
+
> GetContentLibraryVersion postResourceVersionUploadComplete(resourceId, versionId, postResourceVersionComplete)
|
|
855
|
+
|
|
856
|
+
Verify and complete a resource upload
|
|
857
|
+
|
|
858
|
+
### Example
|
|
859
|
+
|
|
860
|
+
```ts
|
|
861
|
+
import {
|
|
862
|
+
Configuration,
|
|
863
|
+
ContentLibraryApi,
|
|
864
|
+
} from '@easyedu/js-lsm-api';
|
|
865
|
+
import type { PostResourceVersionUploadCompleteRequest } from '@easyedu/js-lsm-api';
|
|
866
|
+
|
|
867
|
+
async function example() {
|
|
868
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
869
|
+
const api = new ContentLibraryApi();
|
|
870
|
+
|
|
871
|
+
const body = {
|
|
872
|
+
// string
|
|
873
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
874
|
+
// string
|
|
875
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
876
|
+
// PostResourceVersionComplete
|
|
877
|
+
postResourceVersionComplete: ...,
|
|
878
|
+
} satisfies PostResourceVersionUploadCompleteRequest;
|
|
879
|
+
|
|
880
|
+
try {
|
|
881
|
+
const data = await api.postResourceVersionUploadComplete(body);
|
|
882
|
+
console.log(data);
|
|
883
|
+
} catch (error) {
|
|
884
|
+
console.error(error);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// Run the test
|
|
889
|
+
example().catch(console.error);
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
### Parameters
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
| Name | Type | Description | Notes |
|
|
896
|
+
|------------- | ------------- | ------------- | -------------|
|
|
897
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
898
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
899
|
+
| **postResourceVersionComplete** | [PostResourceVersionComplete](PostResourceVersionComplete.md) | | |
|
|
900
|
+
|
|
901
|
+
### Return type
|
|
902
|
+
|
|
903
|
+
[**GetContentLibraryVersion**](GetContentLibraryVersion.md)
|
|
904
|
+
|
|
905
|
+
### Authorization
|
|
906
|
+
|
|
907
|
+
No authorization required
|
|
908
|
+
|
|
909
|
+
### HTTP request headers
|
|
910
|
+
|
|
911
|
+
- **Content-Type**: `application/json`
|
|
912
|
+
- **Accept**: `application/json`
|
|
913
|
+
|
|
914
|
+
|
|
915
|
+
### HTTP response details
|
|
916
|
+
| Status code | Description | Response headers |
|
|
917
|
+
|-------------|-------------|------------------|
|
|
918
|
+
| **200** | Upload completed | - |
|
|
919
|
+
|
|
920
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
## putResource
|
|
924
|
+
|
|
925
|
+
> GetResource putResource(resourceId, putResource)
|
|
926
|
+
|
|
927
|
+
Update resource library metadata
|
|
928
|
+
|
|
929
|
+
### Example
|
|
930
|
+
|
|
931
|
+
```ts
|
|
932
|
+
import {
|
|
933
|
+
Configuration,
|
|
934
|
+
ContentLibraryApi,
|
|
935
|
+
} from '@easyedu/js-lsm-api';
|
|
936
|
+
import type { PutResourceRequest } from '@easyedu/js-lsm-api';
|
|
937
|
+
|
|
938
|
+
async function example() {
|
|
939
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
940
|
+
const api = new ContentLibraryApi();
|
|
941
|
+
|
|
942
|
+
const body = {
|
|
943
|
+
// string
|
|
944
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
945
|
+
// PutResource
|
|
946
|
+
putResource: ...,
|
|
947
|
+
} satisfies PutResourceRequest;
|
|
948
|
+
|
|
949
|
+
try {
|
|
950
|
+
const data = await api.putResource(body);
|
|
951
|
+
console.log(data);
|
|
952
|
+
} catch (error) {
|
|
953
|
+
console.error(error);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// Run the test
|
|
958
|
+
example().catch(console.error);
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
### Parameters
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
| Name | Type | Description | Notes |
|
|
965
|
+
|------------- | ------------- | ------------- | -------------|
|
|
966
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
967
|
+
| **putResource** | [PutResource](PutResource.md) | | |
|
|
968
|
+
|
|
969
|
+
### Return type
|
|
970
|
+
|
|
971
|
+
[**GetResource**](GetResource.md)
|
|
972
|
+
|
|
973
|
+
### Authorization
|
|
974
|
+
|
|
975
|
+
No authorization required
|
|
976
|
+
|
|
977
|
+
### HTTP request headers
|
|
978
|
+
|
|
979
|
+
- **Content-Type**: `application/json`
|
|
980
|
+
- **Accept**: `application/json`
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
### HTTP response details
|
|
984
|
+
| Status code | Description | Response headers |
|
|
985
|
+
|-------------|-------------|------------------|
|
|
986
|
+
| **200** | Resource updated | - |
|
|
987
|
+
|
|
988
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
## putResourceVersion
|
|
992
|
+
|
|
993
|
+
> GetContentLibraryVersion putResourceVersion(resourceId, versionId, putResourceVersion)
|
|
994
|
+
|
|
995
|
+
Edit a draft resource version
|
|
996
|
+
|
|
997
|
+
### Example
|
|
998
|
+
|
|
999
|
+
```ts
|
|
1000
|
+
import {
|
|
1001
|
+
Configuration,
|
|
1002
|
+
ContentLibraryApi,
|
|
1003
|
+
} from '@easyedu/js-lsm-api';
|
|
1004
|
+
import type { PutResourceVersionRequest } from '@easyedu/js-lsm-api';
|
|
1005
|
+
|
|
1006
|
+
async function example() {
|
|
1007
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1008
|
+
const api = new ContentLibraryApi();
|
|
1009
|
+
|
|
1010
|
+
const body = {
|
|
1011
|
+
// string
|
|
1012
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1013
|
+
// string
|
|
1014
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1015
|
+
// PutResourceVersion
|
|
1016
|
+
putResourceVersion: ...,
|
|
1017
|
+
} satisfies PutResourceVersionRequest;
|
|
1018
|
+
|
|
1019
|
+
try {
|
|
1020
|
+
const data = await api.putResourceVersion(body);
|
|
1021
|
+
console.log(data);
|
|
1022
|
+
} catch (error) {
|
|
1023
|
+
console.error(error);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// Run the test
|
|
1028
|
+
example().catch(console.error);
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
### Parameters
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
| Name | Type | Description | Notes |
|
|
1035
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1036
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
1037
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
1038
|
+
| **putResourceVersion** | [PutResourceVersion](PutResourceVersion.md) | | |
|
|
1039
|
+
|
|
1040
|
+
### Return type
|
|
1041
|
+
|
|
1042
|
+
[**GetContentLibraryVersion**](GetContentLibraryVersion.md)
|
|
1043
|
+
|
|
1044
|
+
### Authorization
|
|
1045
|
+
|
|
1046
|
+
No authorization required
|
|
1047
|
+
|
|
1048
|
+
### HTTP request headers
|
|
1049
|
+
|
|
1050
|
+
- **Content-Type**: `application/json`
|
|
1051
|
+
- **Accept**: `application/json`
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
### HTTP response details
|
|
1055
|
+
| Status code | Description | Response headers |
|
|
1056
|
+
|-------------|-------------|------------------|
|
|
1057
|
+
| **200** | Draft version updated | - |
|
|
1058
|
+
| **409** | Published and archived versions are immutable | - |
|
|
1059
|
+
|
|
1060
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
## putResourceVersionUploadFile
|
|
1064
|
+
|
|
1065
|
+
> putResourceVersionUploadFile(resourceId, versionId, body)
|
|
1066
|
+
|
|
1067
|
+
Upload bytes for a draft resource version
|
|
1068
|
+
|
|
1069
|
+
### Example
|
|
1070
|
+
|
|
1071
|
+
```ts
|
|
1072
|
+
import {
|
|
1073
|
+
Configuration,
|
|
1074
|
+
ContentLibraryApi,
|
|
1075
|
+
} from '@easyedu/js-lsm-api';
|
|
1076
|
+
import type { PutResourceVersionUploadFileRequest } from '@easyedu/js-lsm-api';
|
|
1077
|
+
|
|
1078
|
+
async function example() {
|
|
1079
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1080
|
+
const api = new ContentLibraryApi();
|
|
1081
|
+
|
|
1082
|
+
const body = {
|
|
1083
|
+
// string
|
|
1084
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1085
|
+
// string
|
|
1086
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1087
|
+
// Blob
|
|
1088
|
+
body: BINARY_DATA_HERE,
|
|
1089
|
+
} satisfies PutResourceVersionUploadFileRequest;
|
|
1090
|
+
|
|
1091
|
+
try {
|
|
1092
|
+
const data = await api.putResourceVersionUploadFile(body);
|
|
1093
|
+
console.log(data);
|
|
1094
|
+
} catch (error) {
|
|
1095
|
+
console.error(error);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// Run the test
|
|
1100
|
+
example().catch(console.error);
|
|
1101
|
+
```
|
|
1102
|
+
|
|
1103
|
+
### Parameters
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
| Name | Type | Description | Notes |
|
|
1107
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1108
|
+
| **resourceId** | `string` | | [Defaults to `undefined`] |
|
|
1109
|
+
| **versionId** | `string` | | [Defaults to `undefined`] |
|
|
1110
|
+
| **body** | `Blob` | | |
|
|
1111
|
+
|
|
1112
|
+
### Return type
|
|
1113
|
+
|
|
1114
|
+
`void` (Empty response body)
|
|
1115
|
+
|
|
1116
|
+
### Authorization
|
|
1117
|
+
|
|
1118
|
+
No authorization required
|
|
1119
|
+
|
|
1120
|
+
### HTTP request headers
|
|
1121
|
+
|
|
1122
|
+
- **Content-Type**: `application/octet-stream`
|
|
1123
|
+
- **Accept**: Not defined
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
### HTTP response details
|
|
1127
|
+
| Status code | Description | Response headers |
|
|
1128
|
+
|-------------|-------------|------------------|
|
|
1129
|
+
| **204** | Upload stored | - |
|
|
1130
|
+
|
|
1131
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1132
|
+
|