@easyedu/js-lsm-api 1.88.0 → 1.90.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 +8 -0
- package/README.md +11 -2
- package/dist/apis/ContentLibraryApi.d.ts +19 -0
- package/dist/apis/ContentLibraryApi.js +47 -0
- package/dist/apis/PlayerApi.d.ts +73 -0
- package/dist/apis/PlayerApi.js +188 -0
- package/dist/esm/apis/ContentLibraryApi.d.ts +19 -0
- package/dist/esm/apis/ContentLibraryApi.js +47 -0
- package/dist/esm/apis/PlayerApi.d.ts +73 -0
- package/dist/esm/apis/PlayerApi.js +188 -0
- package/dist/esm/models/CertificateCanvasImageElement.d.ts +0 -13
- package/dist/esm/models/CertificateCanvasImageElement.js +0 -10
- package/dist/esm/models/CertificateCanvasLineElement.d.ts +0 -13
- package/dist/esm/models/CertificateCanvasLineElement.js +0 -10
- package/dist/esm/models/CertificateCanvasPortalLogoElement.d.ts +0 -13
- package/dist/esm/models/CertificateCanvasPortalLogoElement.js +0 -10
- package/dist/esm/models/CertificateCanvasShapeElement.d.ts +0 -13
- package/dist/esm/models/CertificateCanvasShapeElement.js +0 -10
- package/dist/esm/models/CertificateCanvasTextElement.d.ts +0 -13
- package/dist/esm/models/CertificateCanvasTextElement.js +0 -10
- package/dist/esm/models/CertificateCanvasVerificationQrElement.d.ts +0 -13
- package/dist/esm/models/CertificateCanvasVerificationQrElement.js +0 -10
- package/dist/esm/models/GetCourseVersionItemSession.d.ts +7 -0
- package/dist/esm/models/GetCourseVersionItemSession.js +5 -0
- package/dist/esm/models/GetResourceSession.d.ts +161 -0
- package/dist/esm/models/GetResourceSession.js +112 -0
- package/dist/esm/models/GetResourceSessionList.d.ts +57 -0
- package/dist/esm/models/GetResourceSessionList.js +60 -0
- package/dist/esm/models/PostResourceVersionSession.d.ts +32 -0
- package/dist/esm/models/PostResourceVersionSession.js +41 -0
- package/dist/esm/models/ResourceSessionEnvironment.d.ts +25 -0
- package/dist/esm/models/ResourceSessionEnvironment.js +43 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/CertificateCanvasImageElement.d.ts +0 -13
- package/dist/models/CertificateCanvasImageElement.js +1 -11
- package/dist/models/CertificateCanvasLineElement.d.ts +0 -13
- package/dist/models/CertificateCanvasLineElement.js +0 -11
- package/dist/models/CertificateCanvasPortalLogoElement.d.ts +0 -13
- package/dist/models/CertificateCanvasPortalLogoElement.js +0 -11
- package/dist/models/CertificateCanvasShapeElement.d.ts +0 -13
- package/dist/models/CertificateCanvasShapeElement.js +0 -11
- package/dist/models/CertificateCanvasTextElement.d.ts +0 -13
- package/dist/models/CertificateCanvasTextElement.js +1 -11
- package/dist/models/CertificateCanvasVerificationQrElement.d.ts +0 -13
- package/dist/models/CertificateCanvasVerificationQrElement.js +0 -11
- package/dist/models/GetCourseVersionItemSession.d.ts +7 -0
- package/dist/models/GetCourseVersionItemSession.js +5 -0
- package/dist/models/GetResourceSession.d.ts +161 -0
- package/dist/models/GetResourceSession.js +119 -0
- package/dist/models/GetResourceSessionList.d.ts +57 -0
- package/dist/models/GetResourceSessionList.js +67 -0
- package/dist/models/PostResourceVersionSession.d.ts +32 -0
- package/dist/models/PostResourceVersionSession.js +48 -0
- package/dist/models/ResourceSessionEnvironment.d.ts +25 -0
- package/dist/models/ResourceSessionEnvironment.js +51 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/docs/CertificateCanvasElement.md +2 -2
- package/docs/CertificateCanvasImageElement.md +0 -2
- package/docs/CertificateCanvasLineElement.md +0 -2
- package/docs/CertificateCanvasPortalLogoElement.md +0 -2
- package/docs/CertificateCanvasShapeElement.md +0 -2
- package/docs/CertificateCanvasTextElement.md +0 -2
- package/docs/CertificateCanvasVerificationQrElement.md +0 -2
- package/docs/ContentLibraryApi.md +73 -0
- package/docs/GetCourseVersionItemSession.md +2 -0
- package/docs/GetResourceSession.md +77 -0
- package/docs/GetResourceSessionList.md +43 -0
- package/docs/PlayerApi.md +296 -0
- package/docs/PostResourceVersionSession.md +35 -0
- package/docs/ResourceSessionEnvironment.md +33 -0
- package/package.json +1 -1
- package/src/apis/ContentLibraryApi.ts +72 -0
- package/src/apis/PlayerApi.ts +261 -0
- package/src/models/CertificateCanvasImageElement.ts +0 -17
- package/src/models/CertificateCanvasLineElement.ts +0 -19
- package/src/models/CertificateCanvasPortalLogoElement.ts +0 -19
- package/src/models/CertificateCanvasShapeElement.ts +0 -19
- package/src/models/CertificateCanvasTextElement.ts +0 -17
- package/src/models/CertificateCanvasVerificationQrElement.ts +0 -19
- package/src/models/GetCourseVersionItemSession.ts +16 -0
- package/src/models/GetResourceSession.ts +270 -0
- package/src/models/GetResourceSessionList.ts +110 -0
- package/src/models/PostResourceVersionSession.ts +65 -0
- package/src/models/ResourceSessionEnvironment.ts +53 -0
- package/src/models/index.ts +4 -0
|
@@ -8,6 +8,7 @@ A learner resource attempt pinned to an immutable course and Content Library ver
|
|
|
8
8
|
Name | Type
|
|
9
9
|
------------ | -------------
|
|
10
10
|
`id` | string
|
|
11
|
+
`environment` | [ResourceSessionEnvironment](ResourceSessionEnvironment.md)
|
|
11
12
|
`courseVersionId` | string
|
|
12
13
|
`itemId` | string
|
|
13
14
|
`contentLibraryItemId` | string
|
|
@@ -32,6 +33,7 @@ import type { GetCourseVersionItemSession } from '@easyedu/js-lsm-api'
|
|
|
32
33
|
// TODO: Update the object below with actual values
|
|
33
34
|
const example = {
|
|
34
35
|
"id": null,
|
|
36
|
+
"environment": null,
|
|
35
37
|
"courseVersionId": null,
|
|
36
38
|
"itemId": null,
|
|
37
39
|
"contentLibraryItemId": null,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
|
|
2
|
+
# GetResourceSession
|
|
3
|
+
|
|
4
|
+
A user-owned session pinned to an immutable Content Library resource version.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`id` | string
|
|
11
|
+
`userId` | string
|
|
12
|
+
`environment` | [ResourceSessionEnvironment](ResourceSessionEnvironment.md)
|
|
13
|
+
`courseId` | string
|
|
14
|
+
`courseVersionId` | string
|
|
15
|
+
`itemId` | string
|
|
16
|
+
`contentLibraryItemId` | string
|
|
17
|
+
`contentLibraryVersionId` | string
|
|
18
|
+
`resourceName` | string
|
|
19
|
+
`resourceType` | [ResourceType](ResourceType.md)
|
|
20
|
+
`launchMode` | [ContentLaunchMode](ContentLaunchMode.md)
|
|
21
|
+
`launchUrl` | string
|
|
22
|
+
`attemptNumber` | number
|
|
23
|
+
`isCurrent` | boolean
|
|
24
|
+
`completionStatus` | string
|
|
25
|
+
`gradeStatus` | string
|
|
26
|
+
`scoreRaw` | number
|
|
27
|
+
`initializedAt` | number
|
|
28
|
+
`terminatedAt` | number
|
|
29
|
+
`createdAt` | number
|
|
30
|
+
`updatedAt` | number
|
|
31
|
+
`completedAt` | number
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import type { GetResourceSession } from '@easyedu/js-lsm-api'
|
|
37
|
+
|
|
38
|
+
// TODO: Update the object below with actual values
|
|
39
|
+
const example = {
|
|
40
|
+
"id": null,
|
|
41
|
+
"userId": null,
|
|
42
|
+
"environment": null,
|
|
43
|
+
"courseId": null,
|
|
44
|
+
"courseVersionId": null,
|
|
45
|
+
"itemId": null,
|
|
46
|
+
"contentLibraryItemId": null,
|
|
47
|
+
"contentLibraryVersionId": null,
|
|
48
|
+
"resourceName": null,
|
|
49
|
+
"resourceType": null,
|
|
50
|
+
"launchMode": null,
|
|
51
|
+
"launchUrl": null,
|
|
52
|
+
"attemptNumber": null,
|
|
53
|
+
"isCurrent": null,
|
|
54
|
+
"completionStatus": null,
|
|
55
|
+
"gradeStatus": null,
|
|
56
|
+
"scoreRaw": null,
|
|
57
|
+
"initializedAt": null,
|
|
58
|
+
"terminatedAt": null,
|
|
59
|
+
"createdAt": null,
|
|
60
|
+
"updatedAt": null,
|
|
61
|
+
"completedAt": null,
|
|
62
|
+
} satisfies GetResourceSession
|
|
63
|
+
|
|
64
|
+
console.log(example)
|
|
65
|
+
|
|
66
|
+
// Convert the instance to a JSON string
|
|
67
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
68
|
+
console.log(exampleJSON)
|
|
69
|
+
|
|
70
|
+
// Parse the JSON string back to an object
|
|
71
|
+
const exampleParsed = JSON.parse(exampleJSON) as GetResourceSession
|
|
72
|
+
console.log(exampleParsed)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
76
|
+
|
|
77
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
# GetResourceSessionList
|
|
3
|
+
|
|
4
|
+
A filtered page of resource sessions.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`page` | number
|
|
11
|
+
`pageSize` | number
|
|
12
|
+
`totalPages` | number
|
|
13
|
+
`totalItems` | number
|
|
14
|
+
`items` | [Array<GetResourceSession>](GetResourceSession.md)
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { GetResourceSessionList } from '@easyedu/js-lsm-api'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"page": null,
|
|
24
|
+
"pageSize": null,
|
|
25
|
+
"totalPages": null,
|
|
26
|
+
"totalItems": null,
|
|
27
|
+
"items": null,
|
|
28
|
+
} satisfies GetResourceSessionList
|
|
29
|
+
|
|
30
|
+
console.log(example)
|
|
31
|
+
|
|
32
|
+
// Convert the instance to a JSON string
|
|
33
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
34
|
+
console.log(exampleJSON)
|
|
35
|
+
|
|
36
|
+
// Parse the JSON string back to an object
|
|
37
|
+
const exampleParsed = JSON.parse(exampleJSON) as GetResourceSessionList
|
|
38
|
+
console.log(exampleParsed)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
42
|
+
|
|
43
|
+
|
package/docs/PlayerApi.md
CHANGED
|
@@ -14,12 +14,16 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
14
14
|
| [**getPdfPlayer**](PlayerApi.md#getpdfplayer) | **GET** /pdf/session/{sessionId}/player | PDF player HTML page |
|
|
15
15
|
| [**getQuizPlayer**](PlayerApi.md#getquizplayer) | **GET** /quiz/session/{sessionId}/player | Quiz player HTML page |
|
|
16
16
|
| [**getResourceScormValue**](PlayerApi.md#getresourcescormvalue) | **GET** /resource/sessions/{sessionId}/get-value | Read a CMI value from a reusable SCORM resource session |
|
|
17
|
+
| [**getResourceSession**](PlayerApi.md#getresourcesession) | **GET** /resource/sessions/{sessionId} | Get a resource session |
|
|
18
|
+
| [**getResourceSessionAsset**](PlayerApi.md#getresourcesessionasset) | **GET** /resource/sessions/{sessionId}/asset/{assetPath} | Stream an asset pinned to a resource session |
|
|
19
|
+
| [**getResourceSessionList**](PlayerApi.md#getresourcesessionlist) | **GET** /resource/sessions | List resource sessions for the selected portal |
|
|
17
20
|
| [**getResourceSessionPlayer**](PlayerApi.md#getresourcesessionplayer) | **GET** /resource/sessions/{sessionId}/player | Serve the player for a version-pinned reusable resource session |
|
|
18
21
|
| [**getScormAsset**](PlayerApi.md#getscormasset) | **GET** /scorm/{contentId}/scorm/asset/{assetPath} | SCORM package asset |
|
|
19
22
|
| [**getScormPlayer**](PlayerApi.md#getscormplayer) | **GET** /scorm/session/{sessionId}/player | SCORM player HTML page |
|
|
20
23
|
| [**getVideoAsset**](PlayerApi.md#getvideoasset) | **GET** /video/{contentId}/asset | Video asset |
|
|
21
24
|
| [**getVideoPlayer**](PlayerApi.md#getvideoplayer) | **GET** /video/session/{sessionId}/player | Video player HTML page |
|
|
22
25
|
| [**initializeResourceScormSession**](PlayerApi.md#initializeresourcescormsession) | **POST** /resource/sessions/{sessionId}/initialize | Initialize a reusable SCORM resource session |
|
|
26
|
+
| [**postResourceSessionComplete**](PlayerApi.md#postresourcesessioncomplete) | **POST** /resource/sessions/{sessionId}/complete | Complete a non-SCORM resource session |
|
|
23
27
|
| [**setResourceScormValue**](PlayerApi.md#setresourcescormvalue) | **POST** /resource/sessions/{sessionId}/set-value | Store a CMI value in a reusable SCORM resource session |
|
|
24
28
|
| [**terminateResourceScormSession**](PlayerApi.md#terminateresourcescormsession) | **POST** /resource/sessions/{sessionId}/terminate | Terminate a reusable SCORM resource session |
|
|
25
29
|
|
|
@@ -700,6 +704,232 @@ No authorization required
|
|
|
700
704
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
701
705
|
|
|
702
706
|
|
|
707
|
+
## getResourceSession
|
|
708
|
+
|
|
709
|
+
> GetResourceSession getResourceSession(sessionId)
|
|
710
|
+
|
|
711
|
+
Get a resource session
|
|
712
|
+
|
|
713
|
+
### Example
|
|
714
|
+
|
|
715
|
+
```ts
|
|
716
|
+
import {
|
|
717
|
+
Configuration,
|
|
718
|
+
PlayerApi,
|
|
719
|
+
} from '@easyedu/js-lsm-api';
|
|
720
|
+
import type { GetResourceSessionRequest } from '@easyedu/js-lsm-api';
|
|
721
|
+
|
|
722
|
+
async function example() {
|
|
723
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
724
|
+
const api = new PlayerApi();
|
|
725
|
+
|
|
726
|
+
const body = {
|
|
727
|
+
// string
|
|
728
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
729
|
+
} satisfies GetResourceSessionRequest;
|
|
730
|
+
|
|
731
|
+
try {
|
|
732
|
+
const data = await api.getResourceSession(body);
|
|
733
|
+
console.log(data);
|
|
734
|
+
} catch (error) {
|
|
735
|
+
console.error(error);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// Run the test
|
|
740
|
+
example().catch(console.error);
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
### Parameters
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
| Name | Type | Description | Notes |
|
|
747
|
+
|------------- | ------------- | ------------- | -------------|
|
|
748
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
749
|
+
|
|
750
|
+
### Return type
|
|
751
|
+
|
|
752
|
+
[**GetResourceSession**](GetResourceSession.md)
|
|
753
|
+
|
|
754
|
+
### Authorization
|
|
755
|
+
|
|
756
|
+
No authorization required
|
|
757
|
+
|
|
758
|
+
### HTTP request headers
|
|
759
|
+
|
|
760
|
+
- **Content-Type**: Not defined
|
|
761
|
+
- **Accept**: `application/json`
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
### HTTP response details
|
|
765
|
+
| Status code | Description | Response headers |
|
|
766
|
+
|-------------|-------------|------------------|
|
|
767
|
+
| **200** | Resource session | - |
|
|
768
|
+
| **404** | Resource session not found | - |
|
|
769
|
+
|
|
770
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
## getResourceSessionAsset
|
|
774
|
+
|
|
775
|
+
> Blob getResourceSessionAsset(sessionId, assetPath)
|
|
776
|
+
|
|
777
|
+
Stream an asset pinned to a resource session
|
|
778
|
+
|
|
779
|
+
### Example
|
|
780
|
+
|
|
781
|
+
```ts
|
|
782
|
+
import {
|
|
783
|
+
Configuration,
|
|
784
|
+
PlayerApi,
|
|
785
|
+
} from '@easyedu/js-lsm-api';
|
|
786
|
+
import type { GetResourceSessionAssetRequest } from '@easyedu/js-lsm-api';
|
|
787
|
+
|
|
788
|
+
async function example() {
|
|
789
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
790
|
+
const api = new PlayerApi();
|
|
791
|
+
|
|
792
|
+
const body = {
|
|
793
|
+
// string
|
|
794
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
795
|
+
// string
|
|
796
|
+
assetPath: assetPath_example,
|
|
797
|
+
} satisfies GetResourceSessionAssetRequest;
|
|
798
|
+
|
|
799
|
+
try {
|
|
800
|
+
const data = await api.getResourceSessionAsset(body);
|
|
801
|
+
console.log(data);
|
|
802
|
+
} catch (error) {
|
|
803
|
+
console.error(error);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// Run the test
|
|
808
|
+
example().catch(console.error);
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
### Parameters
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
| Name | Type | Description | Notes |
|
|
815
|
+
|------------- | ------------- | ------------- | -------------|
|
|
816
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
817
|
+
| **assetPath** | `string` | | [Defaults to `undefined`] |
|
|
818
|
+
|
|
819
|
+
### Return type
|
|
820
|
+
|
|
821
|
+
**Blob**
|
|
822
|
+
|
|
823
|
+
### Authorization
|
|
824
|
+
|
|
825
|
+
No authorization required
|
|
826
|
+
|
|
827
|
+
### HTTP request headers
|
|
828
|
+
|
|
829
|
+
- **Content-Type**: Not defined
|
|
830
|
+
- **Accept**: `application/octet-stream`
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
### HTTP response details
|
|
834
|
+
| Status code | Description | Response headers |
|
|
835
|
+
|-------------|-------------|------------------|
|
|
836
|
+
| **200** | Resource bytes | - |
|
|
837
|
+
|
|
838
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
839
|
+
|
|
840
|
+
|
|
841
|
+
## getResourceSessionList
|
|
842
|
+
|
|
843
|
+
> GetResourceSessionList getResourceSessionList(userId, resourceId, versionId, courseId, environment, completionStatus, createdFrom, createdTo, page, pageSize)
|
|
844
|
+
|
|
845
|
+
List resource sessions for the selected portal
|
|
846
|
+
|
|
847
|
+
### Example
|
|
848
|
+
|
|
849
|
+
```ts
|
|
850
|
+
import {
|
|
851
|
+
Configuration,
|
|
852
|
+
PlayerApi,
|
|
853
|
+
} from '@easyedu/js-lsm-api';
|
|
854
|
+
import type { GetResourceSessionListRequest } from '@easyedu/js-lsm-api';
|
|
855
|
+
|
|
856
|
+
async function example() {
|
|
857
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
858
|
+
const api = new PlayerApi();
|
|
859
|
+
|
|
860
|
+
const body = {
|
|
861
|
+
// string (optional)
|
|
862
|
+
userId: userId_example,
|
|
863
|
+
// string (optional)
|
|
864
|
+
resourceId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
865
|
+
// string (optional)
|
|
866
|
+
versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
867
|
+
// string (optional)
|
|
868
|
+
courseId: courseId_example,
|
|
869
|
+
// ResourceSessionEnvironment (optional)
|
|
870
|
+
environment: ...,
|
|
871
|
+
// string (optional)
|
|
872
|
+
completionStatus: completionStatus_example,
|
|
873
|
+
// number (optional)
|
|
874
|
+
createdFrom: 789,
|
|
875
|
+
// number (optional)
|
|
876
|
+
createdTo: 789,
|
|
877
|
+
// number (optional)
|
|
878
|
+
page: 56,
|
|
879
|
+
// number (optional)
|
|
880
|
+
pageSize: 56,
|
|
881
|
+
} satisfies GetResourceSessionListRequest;
|
|
882
|
+
|
|
883
|
+
try {
|
|
884
|
+
const data = await api.getResourceSessionList(body);
|
|
885
|
+
console.log(data);
|
|
886
|
+
} catch (error) {
|
|
887
|
+
console.error(error);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
// Run the test
|
|
892
|
+
example().catch(console.error);
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
### Parameters
|
|
896
|
+
|
|
897
|
+
|
|
898
|
+
| Name | Type | Description | Notes |
|
|
899
|
+
|------------- | ------------- | ------------- | -------------|
|
|
900
|
+
| **userId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
901
|
+
| **resourceId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
902
|
+
| **versionId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
903
|
+
| **courseId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
904
|
+
| **environment** | `ResourceSessionEnvironment` | | [Optional] [Defaults to `undefined`] [Enum: live, demo] |
|
|
905
|
+
| **completionStatus** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
906
|
+
| **createdFrom** | `number` | | [Optional] [Defaults to `undefined`] |
|
|
907
|
+
| **createdTo** | `number` | | [Optional] [Defaults to `undefined`] |
|
|
908
|
+
| **page** | `number` | | [Optional] [Defaults to `1`] |
|
|
909
|
+
| **pageSize** | `number` | | [Optional] [Defaults to `20`] |
|
|
910
|
+
|
|
911
|
+
### Return type
|
|
912
|
+
|
|
913
|
+
[**GetResourceSessionList**](GetResourceSessionList.md)
|
|
914
|
+
|
|
915
|
+
### Authorization
|
|
916
|
+
|
|
917
|
+
No authorization required
|
|
918
|
+
|
|
919
|
+
### HTTP request headers
|
|
920
|
+
|
|
921
|
+
- **Content-Type**: Not defined
|
|
922
|
+
- **Accept**: `application/json`
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
### HTTP response details
|
|
926
|
+
| Status code | Description | Response headers |
|
|
927
|
+
|-------------|-------------|------------------|
|
|
928
|
+
| **200** | Resource sessions | - |
|
|
929
|
+
|
|
930
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
931
|
+
|
|
932
|
+
|
|
703
933
|
## getResourceSessionPlayer
|
|
704
934
|
|
|
705
935
|
> string getResourceSessionPlayer(sessionId)
|
|
@@ -1104,6 +1334,72 @@ No authorization required
|
|
|
1104
1334
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1105
1335
|
|
|
1106
1336
|
|
|
1337
|
+
## postResourceSessionComplete
|
|
1338
|
+
|
|
1339
|
+
> GetResourceSession postResourceSessionComplete(sessionId)
|
|
1340
|
+
|
|
1341
|
+
Complete a non-SCORM resource session
|
|
1342
|
+
|
|
1343
|
+
### Example
|
|
1344
|
+
|
|
1345
|
+
```ts
|
|
1346
|
+
import {
|
|
1347
|
+
Configuration,
|
|
1348
|
+
PlayerApi,
|
|
1349
|
+
} from '@easyedu/js-lsm-api';
|
|
1350
|
+
import type { PostResourceSessionCompleteRequest } from '@easyedu/js-lsm-api';
|
|
1351
|
+
|
|
1352
|
+
async function example() {
|
|
1353
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1354
|
+
const api = new PlayerApi();
|
|
1355
|
+
|
|
1356
|
+
const body = {
|
|
1357
|
+
// string
|
|
1358
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1359
|
+
} satisfies PostResourceSessionCompleteRequest;
|
|
1360
|
+
|
|
1361
|
+
try {
|
|
1362
|
+
const data = await api.postResourceSessionComplete(body);
|
|
1363
|
+
console.log(data);
|
|
1364
|
+
} catch (error) {
|
|
1365
|
+
console.error(error);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
// Run the test
|
|
1370
|
+
example().catch(console.error);
|
|
1371
|
+
```
|
|
1372
|
+
|
|
1373
|
+
### Parameters
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
| Name | Type | Description | Notes |
|
|
1377
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1378
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1379
|
+
|
|
1380
|
+
### Return type
|
|
1381
|
+
|
|
1382
|
+
[**GetResourceSession**](GetResourceSession.md)
|
|
1383
|
+
|
|
1384
|
+
### Authorization
|
|
1385
|
+
|
|
1386
|
+
No authorization required
|
|
1387
|
+
|
|
1388
|
+
### HTTP request headers
|
|
1389
|
+
|
|
1390
|
+
- **Content-Type**: Not defined
|
|
1391
|
+
- **Accept**: `application/json`
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
### HTTP response details
|
|
1395
|
+
| Status code | Description | Response headers |
|
|
1396
|
+
|-------------|-------------|------------------|
|
|
1397
|
+
| **200** | Completed resource session | - |
|
|
1398
|
+
| **400** | SCORM sessions complete through their runtime | - |
|
|
1399
|
+
|
|
1400
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1401
|
+
|
|
1402
|
+
|
|
1107
1403
|
## setResourceScormValue
|
|
1108
1404
|
|
|
1109
1405
|
> ScormSetValueResponse setResourceScormValue(sessionId, scormSetValueRequest)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# PostResourceVersionSession
|
|
3
|
+
|
|
4
|
+
Start or resume an isolated demo session for an exact resource version.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`restart` | boolean
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { PostResourceVersionSession } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"restart": null,
|
|
20
|
+
} satisfies PostResourceVersionSession
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as PostResourceVersionSession
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
# ResourceSessionEnvironment
|
|
3
|
+
|
|
4
|
+
Whether the session contributes to learner activity or is isolated administrator testing.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ResourceSessionEnvironment } from '@easyedu/js-lsm-api'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
} satisfies ResourceSessionEnvironment
|
|
19
|
+
|
|
20
|
+
console.log(example)
|
|
21
|
+
|
|
22
|
+
// Convert the instance to a JSON string
|
|
23
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
24
|
+
console.log(exampleJSON)
|
|
25
|
+
|
|
26
|
+
// Parse the JSON string back to an object
|
|
27
|
+
const exampleParsed = JSON.parse(exampleJSON) as ResourceSessionEnvironment
|
|
28
|
+
console.log(exampleParsed)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
32
|
+
|
|
33
|
+
|
package/package.json
CHANGED
|
@@ -28,6 +28,11 @@ import {
|
|
|
28
28
|
GetResourceListFromJSON,
|
|
29
29
|
GetResourceListToJSON,
|
|
30
30
|
} from '../models/GetResourceList';
|
|
31
|
+
import {
|
|
32
|
+
type GetResourceSession,
|
|
33
|
+
GetResourceSessionFromJSON,
|
|
34
|
+
GetResourceSessionToJSON,
|
|
35
|
+
} from '../models/GetResourceSession';
|
|
31
36
|
import {
|
|
32
37
|
type GetResourceUsage,
|
|
33
38
|
GetResourceUsageFromJSON,
|
|
@@ -53,6 +58,11 @@ import {
|
|
|
53
58
|
PostResourceVersionCompleteFromJSON,
|
|
54
59
|
PostResourceVersionCompleteToJSON,
|
|
55
60
|
} from '../models/PostResourceVersionComplete';
|
|
61
|
+
import {
|
|
62
|
+
type PostResourceVersionSession,
|
|
63
|
+
PostResourceVersionSessionFromJSON,
|
|
64
|
+
PostResourceVersionSessionToJSON,
|
|
65
|
+
} from '../models/PostResourceVersionSession';
|
|
56
66
|
import {
|
|
57
67
|
type PostResourceVersionUpload,
|
|
58
68
|
PostResourceVersionUploadFromJSON,
|
|
@@ -130,6 +140,12 @@ export interface PostResourceVersionPublishRequest {
|
|
|
130
140
|
versionId: string;
|
|
131
141
|
}
|
|
132
142
|
|
|
143
|
+
export interface PostResourceVersionSessionRequest {
|
|
144
|
+
resourceId: string;
|
|
145
|
+
versionId: string;
|
|
146
|
+
postResourceVersionSession?: PostResourceVersionSession;
|
|
147
|
+
}
|
|
148
|
+
|
|
133
149
|
export interface PostResourceVersionUploadRequest {
|
|
134
150
|
resourceId: string;
|
|
135
151
|
versionId: string;
|
|
@@ -715,6 +731,62 @@ export class ContentLibraryApi extends runtime.BaseAPI {
|
|
|
715
731
|
return await response.value();
|
|
716
732
|
}
|
|
717
733
|
|
|
734
|
+
/**
|
|
735
|
+
* Creates request options for postResourceVersionSession without sending the request
|
|
736
|
+
*/
|
|
737
|
+
async postResourceVersionSessionRequestOpts(requestParameters: PostResourceVersionSessionRequest): Promise<runtime.RequestOpts> {
|
|
738
|
+
if (requestParameters['resourceId'] == null) {
|
|
739
|
+
throw new runtime.RequiredError(
|
|
740
|
+
'resourceId',
|
|
741
|
+
'Required parameter "resourceId" was null or undefined when calling postResourceVersionSession().'
|
|
742
|
+
);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
if (requestParameters['versionId'] == null) {
|
|
746
|
+
throw new runtime.RequiredError(
|
|
747
|
+
'versionId',
|
|
748
|
+
'Required parameter "versionId" was null or undefined when calling postResourceVersionSession().'
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
const queryParameters: any = {};
|
|
753
|
+
|
|
754
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
755
|
+
|
|
756
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
let urlPath = `/content-library/resources/{resourceId}/versions/{versionId}/sessions`;
|
|
760
|
+
urlPath = urlPath.replace('{resourceId}', encodeURIComponent(String(requestParameters['resourceId'])));
|
|
761
|
+
urlPath = urlPath.replace('{versionId}', encodeURIComponent(String(requestParameters['versionId'])));
|
|
762
|
+
|
|
763
|
+
return {
|
|
764
|
+
path: urlPath,
|
|
765
|
+
method: 'POST',
|
|
766
|
+
headers: headerParameters,
|
|
767
|
+
query: queryParameters,
|
|
768
|
+
body: PostResourceVersionSessionToJSON(requestParameters['postResourceVersionSession']),
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/**
|
|
773
|
+
* Start or resume a demo session for an exact resource version
|
|
774
|
+
*/
|
|
775
|
+
async postResourceVersionSessionRaw(requestParameters: PostResourceVersionSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSession>> {
|
|
776
|
+
const requestOptions = await this.postResourceVersionSessionRequestOpts(requestParameters);
|
|
777
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
778
|
+
|
|
779
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionFromJSON(jsonValue));
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
/**
|
|
783
|
+
* Start or resume a demo session for an exact resource version
|
|
784
|
+
*/
|
|
785
|
+
async postResourceVersionSession(requestParameters: PostResourceVersionSessionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSession> {
|
|
786
|
+
const response = await this.postResourceVersionSessionRaw(requestParameters, initOverrides);
|
|
787
|
+
return await response.value();
|
|
788
|
+
}
|
|
789
|
+
|
|
718
790
|
/**
|
|
719
791
|
* Creates request options for postResourceVersionUpload without sending the request
|
|
720
792
|
*/
|