@easyedu/js-lsm-api 1.140.0 → 1.142.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 +30 -0
- package/README.md +28 -2
- package/dist/apis/DispatchApi.d.ts +18 -0
- package/dist/apis/DispatchApi.js +43 -0
- package/dist/apis/LRSApi.d.ts +152 -0
- package/dist/apis/LRSApi.js +369 -0
- package/dist/apis/PlayerApi.d.ts +71 -0
- package/dist/apis/PlayerApi.js +177 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/DispatchApi.d.ts +18 -0
- package/dist/esm/apis/DispatchApi.js +43 -0
- package/dist/esm/apis/LRSApi.d.ts +152 -0
- package/dist/esm/apis/LRSApi.js +365 -0
- package/dist/esm/apis/PlayerApi.d.ts +71 -0
- package/dist/esm/apis/PlayerApi.js +177 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/Cmi5Launch.d.ts +52 -0
- package/dist/esm/models/Cmi5Launch.js +58 -0
- package/dist/esm/models/DeleteLrsUserRecordsResponse.d.ts +38 -0
- package/dist/esm/models/DeleteLrsUserRecordsResponse.js +47 -0
- package/dist/esm/models/GetCourseExport.d.ts +2 -1
- package/dist/esm/models/GetCourseExport.js +2 -1
- package/dist/esm/models/GetLrsCredentials.d.ts +46 -0
- package/dist/esm/models/GetLrsCredentials.js +53 -0
- package/dist/esm/models/GetLrsStatementList.d.ts +57 -0
- package/dist/esm/models/GetLrsStatementList.js +60 -0
- package/dist/esm/models/GetResourceSessionActivity.d.ts +2 -1
- package/dist/esm/models/GetResourceSessionActivity.js +2 -1
- package/dist/esm/models/H5pState.d.ts +32 -0
- package/dist/esm/models/H5pState.js +43 -0
- package/dist/esm/models/H5pStatementResult.d.ts +44 -0
- package/dist/esm/models/H5pStatementResult.js +49 -0
- package/dist/esm/models/HostedScormAccessPolicy.d.ts +1 -1
- package/dist/esm/models/LrsCredential.d.ts +74 -0
- package/dist/esm/models/LrsCredential.js +67 -0
- package/dist/esm/models/LrsScope.d.ts +38 -0
- package/dist/esm/models/LrsScope.js +47 -0
- package/dist/esm/models/LrsStatement.d.ts +112 -0
- package/dist/esm/models/LrsStatement.js +81 -0
- package/dist/esm/models/PostCourseExport.d.ts +2 -1
- package/dist/esm/models/PostCourseExport.js +2 -1
- package/dist/esm/models/PostDispatchCmi5Launch.d.ts +64 -0
- package/dist/esm/models/PostDispatchCmi5Launch.js +63 -0
- package/dist/esm/models/PostH5pStatement.d.ts +40 -0
- package/dist/esm/models/PostH5pStatement.js +47 -0
- package/dist/esm/models/PostLrsCredential.d.ts +38 -0
- package/dist/esm/models/PostLrsCredential.js +47 -0
- package/dist/esm/models/PostLrsCredentialResponse.d.ts +45 -0
- package/dist/esm/models/PostLrsCredentialResponse.js +52 -0
- package/dist/esm/models/PutLrsCredential.d.ts +38 -0
- package/dist/esm/models/PutLrsCredential.js +43 -0
- package/dist/esm/models/ResourceType.d.ts +2 -0
- package/dist/esm/models/ResourceType.js +3 -1
- package/dist/esm/models/index.d.ts +14 -0
- package/dist/esm/models/index.js +14 -0
- package/dist/models/Cmi5Launch.d.ts +52 -0
- package/dist/models/Cmi5Launch.js +66 -0
- package/dist/models/DeleteLrsUserRecordsResponse.d.ts +38 -0
- package/dist/models/DeleteLrsUserRecordsResponse.js +54 -0
- package/dist/models/GetCourseExport.d.ts +2 -1
- package/dist/models/GetCourseExport.js +2 -1
- package/dist/models/GetLrsCredentials.d.ts +46 -0
- package/dist/models/GetLrsCredentials.js +60 -0
- package/dist/models/GetLrsStatementList.d.ts +57 -0
- package/dist/models/GetLrsStatementList.js +67 -0
- package/dist/models/GetResourceSessionActivity.d.ts +2 -1
- package/dist/models/GetResourceSessionActivity.js +2 -1
- package/dist/models/H5pState.d.ts +32 -0
- package/dist/models/H5pState.js +50 -0
- package/dist/models/H5pStatementResult.d.ts +44 -0
- package/dist/models/H5pStatementResult.js +56 -0
- package/dist/models/HostedScormAccessPolicy.d.ts +1 -1
- package/dist/models/LrsCredential.d.ts +74 -0
- package/dist/models/LrsCredential.js +74 -0
- package/dist/models/LrsScope.d.ts +38 -0
- package/dist/models/LrsScope.js +54 -0
- package/dist/models/LrsStatement.d.ts +112 -0
- package/dist/models/LrsStatement.js +88 -0
- package/dist/models/PostCourseExport.d.ts +2 -1
- package/dist/models/PostCourseExport.js +2 -1
- package/dist/models/PostDispatchCmi5Launch.d.ts +64 -0
- package/dist/models/PostDispatchCmi5Launch.js +70 -0
- package/dist/models/PostH5pStatement.d.ts +40 -0
- package/dist/models/PostH5pStatement.js +54 -0
- package/dist/models/PostLrsCredential.d.ts +38 -0
- package/dist/models/PostLrsCredential.js +54 -0
- package/dist/models/PostLrsCredentialResponse.d.ts +45 -0
- package/dist/models/PostLrsCredentialResponse.js +59 -0
- package/dist/models/PutLrsCredential.d.ts +38 -0
- package/dist/models/PutLrsCredential.js +50 -0
- package/dist/models/ResourceType.d.ts +2 -0
- package/dist/models/ResourceType.js +3 -1
- package/dist/models/index.d.ts +14 -0
- package/dist/models/index.js +14 -0
- package/docs/Cmi5Launch.md +39 -0
- package/docs/ContentLibraryApi.md +2 -2
- package/docs/DeleteLrsUserRecordsResponse.md +37 -0
- package/docs/DispatchApi.md +73 -0
- package/docs/GetLrsCredentials.md +38 -0
- package/docs/GetLrsStatementList.md +42 -0
- package/docs/H5pState.md +35 -0
- package/docs/H5pStatementResult.md +39 -0
- package/docs/LRSApi.md +531 -0
- package/docs/LrsCredential.md +49 -0
- package/docs/LrsScope.md +37 -0
- package/docs/LrsStatement.md +61 -0
- package/docs/PlayerApi.md +286 -1
- package/docs/PostDispatchCmi5Launch.md +45 -0
- package/docs/PostH5pStatement.md +37 -0
- package/docs/PostLrsCredential.md +36 -0
- package/docs/PostLrsCredentialResponse.md +39 -0
- package/docs/PutLrsCredential.md +36 -0
- package/package.json +1 -1
- package/src/apis/DispatchApi.ts +58 -0
- package/src/apis/LRSApi.ts +486 -0
- package/src/apis/PlayerApi.ts +250 -0
- package/src/apis/index.ts +1 -0
- package/src/models/Cmi5Launch.ts +95 -0
- package/src/models/DeleteLrsUserRecordsResponse.ts +75 -0
- package/src/models/GetCourseExport.ts +3 -2
- package/src/models/GetLrsCredentials.ts +99 -0
- package/src/models/GetLrsStatementList.ts +110 -0
- package/src/models/GetResourceSessionActivity.ts +3 -2
- package/src/models/H5pState.ts +66 -0
- package/src/models/H5pStatementResult.ts +83 -0
- package/src/models/HostedScormAccessPolicy.ts +1 -1
- package/src/models/LrsCredential.ts +127 -0
- package/src/models/LrsScope.ts +75 -0
- package/src/models/LrsStatement.ts +176 -0
- package/src/models/PostCourseExport.ts +3 -2
- package/src/models/PostDispatchCmi5Launch.ts +111 -0
- package/src/models/PostH5pStatement.ts +75 -0
- package/src/models/PostLrsCredential.ts +75 -0
- package/src/models/PostLrsCredentialResponse.ts +92 -0
- package/src/models/PutLrsCredential.ts +73 -0
- package/src/models/ResourceType.ts +3 -1
- package/src/models/index.ts +14 -0
package/docs/PlayerApi.md
CHANGED
|
@@ -13,6 +13,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
13
13
|
| [**getResourceSessionActivityEvents**](PlayerApi.md#getresourcesessionactivityevents) | **GET** /resource/sessions/{sessionId}/activity-events | List recorded learner activity events for a resource session |
|
|
14
14
|
| [**getResourceSessionAsset**](PlayerApi.md#getresourcesessionasset) | **GET** /resource/sessions/{sessionId}/asset/{assetPath} | Stream an asset pinned to a resource session |
|
|
15
15
|
| [**getResourceSessionDiagnostics**](PlayerApi.md#getresourcesessiondiagnostics) | **GET** /resource/sessions/{sessionId}/diagnostics | Get administrator diagnostics for a resource session |
|
|
16
|
+
| [**getResourceSessionH5pState**](PlayerApi.md#getresourcesessionh5pstate) | **GET** /resource/sessions/{sessionId}/h5p/state | Read the learner\'s saved H5P state for the session |
|
|
16
17
|
| [**getResourceSessionList**](PlayerApi.md#getresourcesessionlist) | **GET** /resource/sessions | List resource sessions for the selected portal |
|
|
17
18
|
| [**getResourceSessionPlayer**](PlayerApi.md#getresourcesessionplayer) | **GET** /resource/sessions/{sessionId}/player | Serve the player for a version-pinned reusable resource session |
|
|
18
19
|
| [**getResourceSessionScormApiLogs**](PlayerApi.md#getresourcesessionscormapilogs) | **GET** /resource/sessions/{sessionId}/api-logs | Get SCORM runtime logs for a resource session |
|
|
@@ -20,7 +21,10 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
20
21
|
| [**initializeResourceScormSession**](PlayerApi.md#initializeresourcescormsession) | **POST** /resource/sessions/{sessionId}/initialize | Initialize a reusable SCORM resource session |
|
|
21
22
|
| [**navigateResourceScormSession**](PlayerApi.md#navigateresourcescormsession) | **POST** /resource/sessions/{sessionId}/navigation | Process a SCORM 2004 sequencing and navigation request |
|
|
22
23
|
| [**postResourceSessionActivityEvent**](PlayerApi.md#postresourcesessionactivityevent) | **POST** /resource/sessions/{sessionId}/activities/{activityId}/events | Record learner activity and update active time |
|
|
24
|
+
| [**postResourceSessionCmi5Launch**](PlayerApi.md#postresourcesessioncmi5launch) | **POST** /resource/sessions/{sessionId}/cmi5/activities/{activityId}/launch | Launch one Assignable Unit of the session\'s cmi5 course |
|
|
23
25
|
| [**postResourceSessionComplete**](PlayerApi.md#postresourcesessioncomplete) | **POST** /resource/sessions/{sessionId}/complete | Complete a non-SCORM resource session |
|
|
26
|
+
| [**postResourceSessionH5pStatement**](PlayerApi.md#postresourcesessionh5pstatement) | **POST** /resource/sessions/{sessionId}/h5p/statements | Record an xAPI statement emitted by the session\'s H5P content |
|
|
27
|
+
| [**putResourceSessionH5pState**](PlayerApi.md#putresourcesessionh5pstate) | **PUT** /resource/sessions/{sessionId}/h5p/state | Save the learner\'s in-progress H5P state for the session |
|
|
24
28
|
| [**putResourceSessionOverride**](PlayerApi.md#putresourcesessionoverride) | **PUT** /resource/sessions/{sessionId}/override | Override a learner\'s live resource-session progress |
|
|
25
29
|
| [**setResourceScormValue**](PlayerApi.md#setresourcescormvalue) | **POST** /resource/sessions/{sessionId}/set-value | Store a CMI value in a reusable SCORM resource session |
|
|
26
30
|
| [**terminateResourceScormSession**](PlayerApi.md#terminateresourcescormsession) | **POST** /resource/sessions/{sessionId}/terminate | Terminate a reusable SCORM resource session |
|
|
@@ -636,6 +640,73 @@ No authorization required
|
|
|
636
640
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
637
641
|
|
|
638
642
|
|
|
643
|
+
## getResourceSessionH5pState
|
|
644
|
+
|
|
645
|
+
> H5pState getResourceSessionH5pState(sessionId)
|
|
646
|
+
|
|
647
|
+
Read the learner\'s saved H5P state for the session
|
|
648
|
+
|
|
649
|
+
### Example
|
|
650
|
+
|
|
651
|
+
```ts
|
|
652
|
+
import {
|
|
653
|
+
Configuration,
|
|
654
|
+
PlayerApi,
|
|
655
|
+
} from '@easyedu/js-lsm-api';
|
|
656
|
+
import type { GetResourceSessionH5pStateRequest } from '@easyedu/js-lsm-api';
|
|
657
|
+
|
|
658
|
+
async function example() {
|
|
659
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
660
|
+
const api = new PlayerApi();
|
|
661
|
+
|
|
662
|
+
const body = {
|
|
663
|
+
// string
|
|
664
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
665
|
+
} satisfies GetResourceSessionH5pStateRequest;
|
|
666
|
+
|
|
667
|
+
try {
|
|
668
|
+
const data = await api.getResourceSessionH5pState(body);
|
|
669
|
+
console.log(data);
|
|
670
|
+
} catch (error) {
|
|
671
|
+
console.error(error);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// Run the test
|
|
676
|
+
example().catch(console.error);
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
### Parameters
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
| Name | Type | Description | Notes |
|
|
683
|
+
|------------- | ------------- | ------------- | -------------|
|
|
684
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
685
|
+
|
|
686
|
+
### Return type
|
|
687
|
+
|
|
688
|
+
[**H5pState**](H5pState.md)
|
|
689
|
+
|
|
690
|
+
### Authorization
|
|
691
|
+
|
|
692
|
+
No authorization required
|
|
693
|
+
|
|
694
|
+
### HTTP request headers
|
|
695
|
+
|
|
696
|
+
- **Content-Type**: Not defined
|
|
697
|
+
- **Accept**: `application/json`
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
### HTTP response details
|
|
701
|
+
| Status code | Description | Response headers |
|
|
702
|
+
|-------------|-------------|------------------|
|
|
703
|
+
| **200** | Saved state, or null | - |
|
|
704
|
+
| **400** | The session is not H5P | - |
|
|
705
|
+
| **404** | Resource session not found | - |
|
|
706
|
+
|
|
707
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
708
|
+
|
|
709
|
+
|
|
639
710
|
## getResourceSessionList
|
|
640
711
|
|
|
641
712
|
> GetResourceSessionList getResourceSessionList(userId, resourceId, versionId, courseId, courseVersionId, itemId, resourceType, environment, completionStatus, gradeStatus, isCurrent, attemptNumber, createdFrom, createdTo, updatedFrom, updatedTo, hasScormErrors, sortBy, sortDirection, page, pageSize)
|
|
@@ -723,7 +794,7 @@ example().catch(console.error);
|
|
|
723
794
|
| **courseId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
724
795
|
| **courseVersionId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
725
796
|
| **itemId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
726
|
-
| **resourceType** | `ResourceType` | | [Optional] [Defaults to `undefined`] [Enum: scorm, video, audio, image, pdf, powerpoint, file, link, rich_text] |
|
|
797
|
+
| **resourceType** | `ResourceType` | | [Optional] [Defaults to `undefined`] [Enum: scorm, video, audio, image, pdf, powerpoint, file, link, rich_text, cmi5, h5p] |
|
|
727
798
|
| **environment** | `ResourceSessionEnvironment` | | [Optional] [Defaults to `undefined`] [Enum: live, demo] |
|
|
728
799
|
| **completionStatus** | `not_attempted`, `in_progress`, `completed` | | [Optional] [Defaults to `undefined`] [Enum: not_attempted, in_progress, completed] |
|
|
729
800
|
| **gradeStatus** | `ungraded`, `passed`, `failed`, `points_earned`, `percentage_earned`, `not_applicable` | | [Optional] [Defaults to `undefined`] [Enum: ungraded, passed, failed, points_earned, percentage_earned, not_applicable] |
|
|
@@ -1193,6 +1264,78 @@ No authorization required
|
|
|
1193
1264
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1194
1265
|
|
|
1195
1266
|
|
|
1267
|
+
## postResourceSessionCmi5Launch
|
|
1268
|
+
|
|
1269
|
+
> Cmi5Launch postResourceSessionCmi5Launch(sessionId, activityId)
|
|
1270
|
+
|
|
1271
|
+
Launch one Assignable Unit of the session\'s cmi5 course
|
|
1272
|
+
|
|
1273
|
+
Writes the cmi5 launch data and the Launched statement to the Learning Record Store and returns the Assignable Unit\'s URL with the cmi5 launch parameters. A launch left open by an earlier visit is recorded as Abandoned.
|
|
1274
|
+
|
|
1275
|
+
### Example
|
|
1276
|
+
|
|
1277
|
+
```ts
|
|
1278
|
+
import {
|
|
1279
|
+
Configuration,
|
|
1280
|
+
PlayerApi,
|
|
1281
|
+
} from '@easyedu/js-lsm-api';
|
|
1282
|
+
import type { PostResourceSessionCmi5LaunchRequest } from '@easyedu/js-lsm-api';
|
|
1283
|
+
|
|
1284
|
+
async function example() {
|
|
1285
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1286
|
+
const api = new PlayerApi();
|
|
1287
|
+
|
|
1288
|
+
const body = {
|
|
1289
|
+
// string
|
|
1290
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1291
|
+
// string
|
|
1292
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1293
|
+
} satisfies PostResourceSessionCmi5LaunchRequest;
|
|
1294
|
+
|
|
1295
|
+
try {
|
|
1296
|
+
const data = await api.postResourceSessionCmi5Launch(body);
|
|
1297
|
+
console.log(data);
|
|
1298
|
+
} catch (error) {
|
|
1299
|
+
console.error(error);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
// Run the test
|
|
1304
|
+
example().catch(console.error);
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
### Parameters
|
|
1308
|
+
|
|
1309
|
+
|
|
1310
|
+
| Name | Type | Description | Notes |
|
|
1311
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1312
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1313
|
+
| **activityId** | `string` | | [Defaults to `undefined`] |
|
|
1314
|
+
|
|
1315
|
+
### Return type
|
|
1316
|
+
|
|
1317
|
+
[**Cmi5Launch**](Cmi5Launch.md)
|
|
1318
|
+
|
|
1319
|
+
### Authorization
|
|
1320
|
+
|
|
1321
|
+
No authorization required
|
|
1322
|
+
|
|
1323
|
+
### HTTP request headers
|
|
1324
|
+
|
|
1325
|
+
- **Content-Type**: Not defined
|
|
1326
|
+
- **Accept**: `application/json`
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
### HTTP response details
|
|
1330
|
+
| Status code | Description | Response headers |
|
|
1331
|
+
|-------------|-------------|------------------|
|
|
1332
|
+
| **200** | Launch details | - |
|
|
1333
|
+
| **400** | The session is not cmi5 | - |
|
|
1334
|
+
| **404** | Resource session or activity not found | - |
|
|
1335
|
+
|
|
1336
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1337
|
+
|
|
1338
|
+
|
|
1196
1339
|
## postResourceSessionComplete
|
|
1197
1340
|
|
|
1198
1341
|
> GetResourceSession postResourceSessionComplete(sessionId)
|
|
@@ -1260,6 +1403,148 @@ No authorization required
|
|
|
1260
1403
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1261
1404
|
|
|
1262
1405
|
|
|
1406
|
+
## postResourceSessionH5pStatement
|
|
1407
|
+
|
|
1408
|
+
> H5pStatementResult postResourceSessionH5pStatement(sessionId, postH5pStatement)
|
|
1409
|
+
|
|
1410
|
+
Record an xAPI statement emitted by the session\'s H5P content
|
|
1411
|
+
|
|
1412
|
+
Stores the statement in the portal\'s Learning Record Store on behalf of the session\'s learner and updates the session\'s completion, grade, and score from it.
|
|
1413
|
+
|
|
1414
|
+
### Example
|
|
1415
|
+
|
|
1416
|
+
```ts
|
|
1417
|
+
import {
|
|
1418
|
+
Configuration,
|
|
1419
|
+
PlayerApi,
|
|
1420
|
+
} from '@easyedu/js-lsm-api';
|
|
1421
|
+
import type { PostResourceSessionH5pStatementRequest } from '@easyedu/js-lsm-api';
|
|
1422
|
+
|
|
1423
|
+
async function example() {
|
|
1424
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1425
|
+
const api = new PlayerApi();
|
|
1426
|
+
|
|
1427
|
+
const body = {
|
|
1428
|
+
// string
|
|
1429
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1430
|
+
// PostH5pStatement
|
|
1431
|
+
postH5pStatement: ...,
|
|
1432
|
+
} satisfies PostResourceSessionH5pStatementRequest;
|
|
1433
|
+
|
|
1434
|
+
try {
|
|
1435
|
+
const data = await api.postResourceSessionH5pStatement(body);
|
|
1436
|
+
console.log(data);
|
|
1437
|
+
} catch (error) {
|
|
1438
|
+
console.error(error);
|
|
1439
|
+
}
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// Run the test
|
|
1443
|
+
example().catch(console.error);
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1446
|
+
### Parameters
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
| Name | Type | Description | Notes |
|
|
1450
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1451
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1452
|
+
| **postH5pStatement** | [PostH5pStatement](PostH5pStatement.md) | | |
|
|
1453
|
+
|
|
1454
|
+
### Return type
|
|
1455
|
+
|
|
1456
|
+
[**H5pStatementResult**](H5pStatementResult.md)
|
|
1457
|
+
|
|
1458
|
+
### Authorization
|
|
1459
|
+
|
|
1460
|
+
No authorization required
|
|
1461
|
+
|
|
1462
|
+
### HTTP request headers
|
|
1463
|
+
|
|
1464
|
+
- **Content-Type**: `application/json`
|
|
1465
|
+
- **Accept**: `application/json`
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
### HTTP response details
|
|
1469
|
+
| Status code | Description | Response headers |
|
|
1470
|
+
|-------------|-------------|------------------|
|
|
1471
|
+
| **200** | The statement was recorded | - |
|
|
1472
|
+
| **400** | The session is not H5P, or the statement is not valid xAPI | - |
|
|
1473
|
+
| **404** | Resource session not found | - |
|
|
1474
|
+
|
|
1475
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
## putResourceSessionH5pState
|
|
1479
|
+
|
|
1480
|
+
> putResourceSessionH5pState(sessionId, h5pState)
|
|
1481
|
+
|
|
1482
|
+
Save the learner\'s in-progress H5P state for the session
|
|
1483
|
+
|
|
1484
|
+
### Example
|
|
1485
|
+
|
|
1486
|
+
```ts
|
|
1487
|
+
import {
|
|
1488
|
+
Configuration,
|
|
1489
|
+
PlayerApi,
|
|
1490
|
+
} from '@easyedu/js-lsm-api';
|
|
1491
|
+
import type { PutResourceSessionH5pStateRequest } from '@easyedu/js-lsm-api';
|
|
1492
|
+
|
|
1493
|
+
async function example() {
|
|
1494
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1495
|
+
const api = new PlayerApi();
|
|
1496
|
+
|
|
1497
|
+
const body = {
|
|
1498
|
+
// string
|
|
1499
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1500
|
+
// H5pState
|
|
1501
|
+
h5pState: ...,
|
|
1502
|
+
} satisfies PutResourceSessionH5pStateRequest;
|
|
1503
|
+
|
|
1504
|
+
try {
|
|
1505
|
+
const data = await api.putResourceSessionH5pState(body);
|
|
1506
|
+
console.log(data);
|
|
1507
|
+
} catch (error) {
|
|
1508
|
+
console.error(error);
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
// Run the test
|
|
1513
|
+
example().catch(console.error);
|
|
1514
|
+
```
|
|
1515
|
+
|
|
1516
|
+
### Parameters
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
| Name | Type | Description | Notes |
|
|
1520
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1521
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1522
|
+
| **h5pState** | [H5pState](H5pState.md) | | |
|
|
1523
|
+
|
|
1524
|
+
### Return type
|
|
1525
|
+
|
|
1526
|
+
`void` (Empty response body)
|
|
1527
|
+
|
|
1528
|
+
### Authorization
|
|
1529
|
+
|
|
1530
|
+
No authorization required
|
|
1531
|
+
|
|
1532
|
+
### HTTP request headers
|
|
1533
|
+
|
|
1534
|
+
- **Content-Type**: `application/json`
|
|
1535
|
+
- **Accept**: Not defined
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
### HTTP response details
|
|
1539
|
+
| Status code | Description | Response headers |
|
|
1540
|
+
|-------------|-------------|------------------|
|
|
1541
|
+
| **204** | State saved | - |
|
|
1542
|
+
| **400** | The session is not H5P, or the state is too large | - |
|
|
1543
|
+
| **404** | Resource session not found | - |
|
|
1544
|
+
|
|
1545
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1546
|
+
|
|
1547
|
+
|
|
1263
1548
|
## putResourceSessionOverride
|
|
1264
1549
|
|
|
1265
1550
|
> GetResourceSession putResourceSessionOverride(sessionId, putResourceSessionOverride)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
# PostDispatchCmi5Launch
|
|
3
|
+
|
|
4
|
+
The cmi5 launch a client\'s LMS handed to the launcher page of a cmi5 course export, with the LRS credentials the launcher obtained from the client\'s fetch URL.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`dispatchId` | string
|
|
11
|
+
`endpoint` | string
|
|
12
|
+
`authToken` | string
|
|
13
|
+
`actor` | { [key: string]: any; }
|
|
14
|
+
`registration` | string
|
|
15
|
+
`activityId` | string
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { PostDispatchCmi5Launch } from '@easyedu/js-lsm-api'
|
|
21
|
+
|
|
22
|
+
// TODO: Update the object below with actual values
|
|
23
|
+
const example = {
|
|
24
|
+
"dispatchId": null,
|
|
25
|
+
"endpoint": null,
|
|
26
|
+
"authToken": null,
|
|
27
|
+
"actor": null,
|
|
28
|
+
"registration": null,
|
|
29
|
+
"activityId": null,
|
|
30
|
+
} satisfies PostDispatchCmi5Launch
|
|
31
|
+
|
|
32
|
+
console.log(example)
|
|
33
|
+
|
|
34
|
+
// Convert the instance to a JSON string
|
|
35
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
36
|
+
console.log(exampleJSON)
|
|
37
|
+
|
|
38
|
+
// Parse the JSON string back to an object
|
|
39
|
+
const exampleParsed = JSON.parse(exampleJSON) as PostDispatchCmi5Launch
|
|
40
|
+
console.log(exampleParsed)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
44
|
+
|
|
45
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# PostH5pStatement
|
|
3
|
+
|
|
4
|
+
An xAPI statement emitted by H5P content in the learner\'s browser.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`eventId` | string
|
|
11
|
+
`statement` | { [key: string]: any; }
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { PostH5pStatement } from '@easyedu/js-lsm-api'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"eventId": null,
|
|
21
|
+
"statement": null,
|
|
22
|
+
} satisfies PostH5pStatement
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as PostH5pStatement
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# PostLrsCredential
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`scopes` | Set<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { PostLrsCredential } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"name": null,
|
|
20
|
+
"scopes": null,
|
|
21
|
+
} satisfies PostLrsCredential
|
|
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 PostLrsCredential
|
|
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,39 @@
|
|
|
1
|
+
|
|
2
|
+
# PostLrsCredentialResponse
|
|
3
|
+
|
|
4
|
+
A newly created LRS credential. The secret is returned only once.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`credential` | [LrsCredential](LrsCredential.md)
|
|
11
|
+
`secret` | string
|
|
12
|
+
`endpoint` | string
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { PostLrsCredentialResponse } from '@easyedu/js-lsm-api'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"credential": null,
|
|
22
|
+
"secret": null,
|
|
23
|
+
"endpoint": null,
|
|
24
|
+
} satisfies PostLrsCredentialResponse
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as PostLrsCredentialResponse
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# PutLrsCredential
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`scopes` | Set<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { PutLrsCredential } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"name": null,
|
|
20
|
+
"scopes": null,
|
|
21
|
+
} satisfies PutLrsCredential
|
|
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 PutLrsCredential
|
|
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
|
+
|
package/package.json
CHANGED
package/src/apis/DispatchApi.ts
CHANGED
|
@@ -38,6 +38,11 @@ import {
|
|
|
38
38
|
GetLibraryQuizSessionFromJSON,
|
|
39
39
|
GetLibraryQuizSessionToJSON,
|
|
40
40
|
} from '../models/GetLibraryQuizSession';
|
|
41
|
+
import {
|
|
42
|
+
type PostDispatchCmi5Launch,
|
|
43
|
+
PostDispatchCmi5LaunchFromJSON,
|
|
44
|
+
PostDispatchCmi5LaunchToJSON,
|
|
45
|
+
} from '../models/PostDispatchCmi5Launch';
|
|
41
46
|
import {
|
|
42
47
|
type PostDispatchItemLaunch,
|
|
43
48
|
PostDispatchItemLaunchFromJSON,
|
|
@@ -86,6 +91,10 @@ export interface GetDispatchRollupRequest {
|
|
|
86
91
|
dispatchPackageId: string;
|
|
87
92
|
}
|
|
88
93
|
|
|
94
|
+
export interface PostDispatchCmi5LaunchRequest {
|
|
95
|
+
postDispatchCmi5Launch: PostDispatchCmi5Launch;
|
|
96
|
+
}
|
|
97
|
+
|
|
89
98
|
export interface PostDispatchItemLaunchRequest {
|
|
90
99
|
itemId: string;
|
|
91
100
|
postDispatchItemLaunch?: PostDispatchItemLaunch;
|
|
@@ -303,6 +312,55 @@ export class DispatchApi extends runtime.BaseAPI {
|
|
|
303
312
|
return await response.value();
|
|
304
313
|
}
|
|
305
314
|
|
|
315
|
+
/**
|
|
316
|
+
* Creates request options for postDispatchCmi5Launch without sending the request
|
|
317
|
+
*/
|
|
318
|
+
async postDispatchCmi5LaunchRequestOpts(requestParameters: PostDispatchCmi5LaunchRequest): Promise<runtime.RequestOpts> {
|
|
319
|
+
if (requestParameters['postDispatchCmi5Launch'] == null) {
|
|
320
|
+
throw new runtime.RequiredError(
|
|
321
|
+
'postDispatchCmi5Launch',
|
|
322
|
+
'Required parameter "postDispatchCmi5Launch" was null or undefined when calling postDispatchCmi5Launch().'
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const queryParameters: any = {};
|
|
327
|
+
|
|
328
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
329
|
+
|
|
330
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
let urlPath = `/dispatch/cmi5/launch`;
|
|
334
|
+
|
|
335
|
+
return {
|
|
336
|
+
path: urlPath,
|
|
337
|
+
method: 'POST',
|
|
338
|
+
headers: headerParameters,
|
|
339
|
+
query: queryParameters,
|
|
340
|
+
body: PostDispatchCmi5LaunchToJSON(requestParameters['postDispatchCmi5Launch']),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Called by the launcher page of a cmi5 course export after it has exchanged the client LMS\'s fetch URL for LRS credentials. Applies the export\'s access policy to the client LRS origin, confirms the launch with that LRS when the export restricts origins, and returns the hosted player launch for the learner.
|
|
346
|
+
* Start a hosted-course launch from a cmi5 launch
|
|
347
|
+
*/
|
|
348
|
+
async postDispatchCmi5LaunchRaw(requestParameters: PostDispatchCmi5LaunchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostDispatchLaunchResponse>> {
|
|
349
|
+
const requestOptions = await this.postDispatchCmi5LaunchRequestOpts(requestParameters);
|
|
350
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
351
|
+
|
|
352
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PostDispatchLaunchResponseFromJSON(jsonValue));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Called by the launcher page of a cmi5 course export after it has exchanged the client LMS\'s fetch URL for LRS credentials. Applies the export\'s access policy to the client LRS origin, confirms the launch with that LRS when the export restricts origins, and returns the hosted player launch for the learner.
|
|
357
|
+
* Start a hosted-course launch from a cmi5 launch
|
|
358
|
+
*/
|
|
359
|
+
async postDispatchCmi5Launch(requestParameters: PostDispatchCmi5LaunchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostDispatchLaunchResponse> {
|
|
360
|
+
const response = await this.postDispatchCmi5LaunchRaw(requestParameters, initOverrides);
|
|
361
|
+
return await response.value();
|
|
362
|
+
}
|
|
363
|
+
|
|
306
364
|
/**
|
|
307
365
|
* Creates request options for postDispatchItemLaunch without sending the request
|
|
308
366
|
*/
|