@easyedu/js-lsm-api 1.98.0 → 1.99.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 +10 -0
- package/README.md +10 -2
- package/dist/apis/PlayerApi.d.ts +57 -0
- package/dist/apis/PlayerApi.js +148 -0
- package/dist/esm/apis/PlayerApi.d.ts +57 -0
- package/dist/esm/apis/PlayerApi.js +148 -0
- package/dist/esm/models/GetCourseVersionItemSession.d.ts +6 -0
- package/dist/esm/models/GetCourseVersionItemSession.js +4 -0
- package/dist/esm/models/GetLibraryQuizSession.d.ts +6 -0
- package/dist/esm/models/GetLibraryQuizSession.js +4 -0
- package/dist/esm/models/GetResourceSession.d.ts +6 -0
- package/dist/esm/models/GetResourceSession.js +4 -0
- package/dist/esm/models/GetResourceSessionActivity.d.ts +125 -0
- package/dist/esm/models/GetResourceSessionActivity.js +97 -0
- package/dist/esm/models/GetResourceSessionActivityEvent.d.ts +62 -0
- package/dist/esm/models/GetResourceSessionActivityEvent.js +61 -0
- package/dist/esm/models/GetResourceSessionActivityEventList.d.ts +33 -0
- package/dist/esm/models/GetResourceSessionActivityEventList.js +44 -0
- package/dist/esm/models/GetResourceSessionActivityList.d.ts +33 -0
- package/dist/esm/models/GetResourceSessionActivityList.js +44 -0
- package/dist/esm/models/PostResourceSessionActivityEvent.d.ts +62 -0
- package/dist/esm/models/PostResourceSessionActivityEvent.js +66 -0
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/models/GetCourseVersionItemSession.d.ts +6 -0
- package/dist/models/GetCourseVersionItemSession.js +4 -0
- package/dist/models/GetLibraryQuizSession.d.ts +6 -0
- package/dist/models/GetLibraryQuizSession.js +4 -0
- package/dist/models/GetResourceSession.d.ts +6 -0
- package/dist/models/GetResourceSession.js +4 -0
- package/dist/models/GetResourceSessionActivity.d.ts +125 -0
- package/dist/models/GetResourceSessionActivity.js +105 -0
- package/dist/models/GetResourceSessionActivityEvent.d.ts +62 -0
- package/dist/models/GetResourceSessionActivityEvent.js +68 -0
- package/dist/models/GetResourceSessionActivityEventList.d.ts +33 -0
- package/dist/models/GetResourceSessionActivityEventList.js +51 -0
- package/dist/models/GetResourceSessionActivityList.d.ts +33 -0
- package/dist/models/GetResourceSessionActivityList.js +51 -0
- package/dist/models/PostResourceSessionActivityEvent.d.ts +62 -0
- package/dist/models/PostResourceSessionActivityEvent.js +74 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/docs/ContentLibraryQuizApi.md +2 -2
- package/docs/GetCourseVersionItemSession.md +2 -0
- package/docs/GetLibraryQuizSession.md +2 -0
- package/docs/GetResourceSession.md +2 -0
- package/docs/GetResourceSessionActivity.md +63 -0
- package/docs/GetResourceSessionActivityEvent.md +45 -0
- package/docs/GetResourceSessionActivityEventList.md +35 -0
- package/docs/GetResourceSessionActivityList.md +35 -0
- package/docs/PlayerApi.md +231 -6
- package/docs/PostResourceSessionActivityEvent.md +39 -0
- package/package.json +1 -1
- package/src/apis/PlayerApi.ts +217 -0
- package/src/models/GetCourseVersionItemSession.ts +9 -0
- package/src/models/GetLibraryQuizSession.ts +9 -0
- package/src/models/GetResourceSession.ts +9 -0
- package/src/models/GetResourceSessionActivity.ts +199 -0
- package/src/models/GetResourceSessionActivityEvent.ts +110 -0
- package/src/models/GetResourceSessionActivityEventList.ts +74 -0
- package/src/models/GetResourceSessionActivityList.ts +74 -0
- package/src/models/PostResourceSessionActivityEvent.ts +104 -0
- package/src/models/index.ts +5 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# GetResourceSessionActivityEventList
|
|
3
|
+
|
|
4
|
+
Recorded learner activity events for one resource-session attempt.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`items` | [Array<GetResourceSessionActivityEvent>](GetResourceSessionActivityEvent.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { GetResourceSessionActivityEventList } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"items": null,
|
|
20
|
+
} satisfies GetResourceSessionActivityEventList
|
|
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 GetResourceSessionActivityEventList
|
|
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,35 @@
|
|
|
1
|
+
|
|
2
|
+
# GetResourceSessionActivityList
|
|
3
|
+
|
|
4
|
+
Activities belonging to one resource-session attempt.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`items` | [Array<GetResourceSessionActivity>](GetResourceSessionActivity.md)
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { GetResourceSessionActivityList } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"items": null,
|
|
20
|
+
} satisfies GetResourceSessionActivityList
|
|
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 GetResourceSessionActivityList
|
|
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
|
+
|
package/docs/PlayerApi.md
CHANGED
|
@@ -9,6 +9,8 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
9
9
|
| [**getLibraryQuizSessionPlayer**](PlayerApi.md#getlibraryquizsessionplayer) | **GET** /quiz/sessions/{sessionId}/player | Serve the player for a reusable quiz session |
|
|
10
10
|
| [**getResourceScormValue**](PlayerApi.md#getresourcescormvalue) | **GET** /resource/sessions/{sessionId}/get-value | Read a CMI value from a reusable SCORM resource session |
|
|
11
11
|
| [**getResourceSession**](PlayerApi.md#getresourcesession) | **GET** /resource/sessions/{sessionId} | Get a resource session |
|
|
12
|
+
| [**getResourceSessionActivities**](PlayerApi.md#getresourcesessionactivities) | **GET** /resource/sessions/{sessionId}/activities | List tracked activities for a resource session |
|
|
13
|
+
| [**getResourceSessionActivityEvents**](PlayerApi.md#getresourcesessionactivityevents) | **GET** /resource/sessions/{sessionId}/activity-events | List recorded learner activity events for a resource session |
|
|
12
14
|
| [**getResourceSessionAsset**](PlayerApi.md#getresourcesessionasset) | **GET** /resource/sessions/{sessionId}/asset/{assetPath} | Stream an asset pinned to a resource session |
|
|
13
15
|
| [**getResourceSessionDiagnostics**](PlayerApi.md#getresourcesessiondiagnostics) | **GET** /resource/sessions/{sessionId}/diagnostics | Get administrator diagnostics for a resource session |
|
|
14
16
|
| [**getResourceSessionList**](PlayerApi.md#getresourcesessionlist) | **GET** /resource/sessions | List resource sessions for the selected portal |
|
|
@@ -16,6 +18,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
16
18
|
| [**getResourceSessionScormApiLogs**](PlayerApi.md#getresourcesessionscormapilogs) | **GET** /resource/sessions/{sessionId}/api-logs | Get SCORM runtime logs for a resource session |
|
|
17
19
|
| [**getResourceSessionScormData**](PlayerApi.md#getresourcesessionscormdata) | **GET** /resource/sessions/{sessionId}/scorm-data | Get SCORM CMI data for a resource session |
|
|
18
20
|
| [**initializeResourceScormSession**](PlayerApi.md#initializeresourcescormsession) | **POST** /resource/sessions/{sessionId}/initialize | Initialize a reusable SCORM resource session |
|
|
21
|
+
| [**postResourceSessionActivityEvent**](PlayerApi.md#postresourcesessionactivityevent) | **POST** /resource/sessions/{sessionId}/activities/{activityId}/events | Record learner activity and update active time |
|
|
19
22
|
| [**postResourceSessionComplete**](PlayerApi.md#postresourcesessioncomplete) | **POST** /resource/sessions/{sessionId}/complete | Complete a non-SCORM resource session |
|
|
20
23
|
| [**setResourceScormValue**](PlayerApi.md#setresourcescormvalue) | **POST** /resource/sessions/{sessionId}/set-value | Store a CMI value in a reusable SCORM resource session |
|
|
21
24
|
| [**terminateResourceScormSession**](PlayerApi.md#terminateresourcescormsession) | **POST** /resource/sessions/{sessionId}/terminate | Terminate a reusable SCORM resource session |
|
|
@@ -24,7 +27,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
24
27
|
|
|
25
28
|
## commitResourceScormSession
|
|
26
29
|
|
|
27
|
-
> commitResourceScormSession(sessionId)
|
|
30
|
+
> commitResourceScormSession(sessionId, activityId)
|
|
28
31
|
|
|
29
32
|
Commit a reusable SCORM resource session
|
|
30
33
|
|
|
@@ -44,6 +47,8 @@ async function example() {
|
|
|
44
47
|
const body = {
|
|
45
48
|
// string
|
|
46
49
|
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
50
|
+
// string (optional)
|
|
51
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
47
52
|
} satisfies CommitResourceScormSessionRequest;
|
|
48
53
|
|
|
49
54
|
try {
|
|
@@ -64,6 +69,7 @@ example().catch(console.error);
|
|
|
64
69
|
| Name | Type | Description | Notes |
|
|
65
70
|
|------------- | ------------- | ------------- | -------------|
|
|
66
71
|
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
72
|
+
| **activityId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
67
73
|
|
|
68
74
|
### Return type
|
|
69
75
|
|
|
@@ -226,7 +232,7 @@ No authorization required
|
|
|
226
232
|
|
|
227
233
|
## getResourceScormValue
|
|
228
234
|
|
|
229
|
-
> ScormGetValueResponse getResourceScormValue(sessionId, key)
|
|
235
|
+
> ScormGetValueResponse getResourceScormValue(sessionId, key, activityId)
|
|
230
236
|
|
|
231
237
|
Read a CMI value from a reusable SCORM resource session
|
|
232
238
|
|
|
@@ -248,6 +254,8 @@ async function example() {
|
|
|
248
254
|
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
249
255
|
// string
|
|
250
256
|
key: key_example,
|
|
257
|
+
// string (optional)
|
|
258
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
251
259
|
} satisfies GetResourceScormValueRequest;
|
|
252
260
|
|
|
253
261
|
try {
|
|
@@ -269,6 +277,7 @@ example().catch(console.error);
|
|
|
269
277
|
|------------- | ------------- | ------------- | -------------|
|
|
270
278
|
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
271
279
|
| **key** | `string` | | [Defaults to `undefined`] |
|
|
280
|
+
| **activityId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
272
281
|
|
|
273
282
|
### Return type
|
|
274
283
|
|
|
@@ -359,6 +368,138 @@ No authorization required
|
|
|
359
368
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
360
369
|
|
|
361
370
|
|
|
371
|
+
## getResourceSessionActivities
|
|
372
|
+
|
|
373
|
+
> GetResourceSessionActivityList getResourceSessionActivities(sessionId)
|
|
374
|
+
|
|
375
|
+
List tracked activities for a resource session
|
|
376
|
+
|
|
377
|
+
### Example
|
|
378
|
+
|
|
379
|
+
```ts
|
|
380
|
+
import {
|
|
381
|
+
Configuration,
|
|
382
|
+
PlayerApi,
|
|
383
|
+
} from '@easyedu/js-lsm-api';
|
|
384
|
+
import type { GetResourceSessionActivitiesRequest } from '@easyedu/js-lsm-api';
|
|
385
|
+
|
|
386
|
+
async function example() {
|
|
387
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
388
|
+
const api = new PlayerApi();
|
|
389
|
+
|
|
390
|
+
const body = {
|
|
391
|
+
// string
|
|
392
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
393
|
+
} satisfies GetResourceSessionActivitiesRequest;
|
|
394
|
+
|
|
395
|
+
try {
|
|
396
|
+
const data = await api.getResourceSessionActivities(body);
|
|
397
|
+
console.log(data);
|
|
398
|
+
} catch (error) {
|
|
399
|
+
console.error(error);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// Run the test
|
|
404
|
+
example().catch(console.error);
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Parameters
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
| Name | Type | Description | Notes |
|
|
411
|
+
|------------- | ------------- | ------------- | -------------|
|
|
412
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
413
|
+
|
|
414
|
+
### Return type
|
|
415
|
+
|
|
416
|
+
[**GetResourceSessionActivityList**](GetResourceSessionActivityList.md)
|
|
417
|
+
|
|
418
|
+
### Authorization
|
|
419
|
+
|
|
420
|
+
No authorization required
|
|
421
|
+
|
|
422
|
+
### HTTP request headers
|
|
423
|
+
|
|
424
|
+
- **Content-Type**: Not defined
|
|
425
|
+
- **Accept**: `application/json`
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
### HTTP response details
|
|
429
|
+
| Status code | Description | Response headers |
|
|
430
|
+
|-------------|-------------|------------------|
|
|
431
|
+
| **200** | Resource-session activities | - |
|
|
432
|
+
| **404** | Resource session not found | - |
|
|
433
|
+
|
|
434
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
## getResourceSessionActivityEvents
|
|
438
|
+
|
|
439
|
+
> GetResourceSessionActivityEventList getResourceSessionActivityEvents(sessionId)
|
|
440
|
+
|
|
441
|
+
List recorded learner activity events for a resource session
|
|
442
|
+
|
|
443
|
+
### Example
|
|
444
|
+
|
|
445
|
+
```ts
|
|
446
|
+
import {
|
|
447
|
+
Configuration,
|
|
448
|
+
PlayerApi,
|
|
449
|
+
} from '@easyedu/js-lsm-api';
|
|
450
|
+
import type { GetResourceSessionActivityEventsRequest } from '@easyedu/js-lsm-api';
|
|
451
|
+
|
|
452
|
+
async function example() {
|
|
453
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
454
|
+
const api = new PlayerApi();
|
|
455
|
+
|
|
456
|
+
const body = {
|
|
457
|
+
// string
|
|
458
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
459
|
+
} satisfies GetResourceSessionActivityEventsRequest;
|
|
460
|
+
|
|
461
|
+
try {
|
|
462
|
+
const data = await api.getResourceSessionActivityEvents(body);
|
|
463
|
+
console.log(data);
|
|
464
|
+
} catch (error) {
|
|
465
|
+
console.error(error);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// Run the test
|
|
470
|
+
example().catch(console.error);
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### Parameters
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
| Name | Type | Description | Notes |
|
|
477
|
+
|------------- | ------------- | ------------- | -------------|
|
|
478
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
479
|
+
|
|
480
|
+
### Return type
|
|
481
|
+
|
|
482
|
+
[**GetResourceSessionActivityEventList**](GetResourceSessionActivityEventList.md)
|
|
483
|
+
|
|
484
|
+
### Authorization
|
|
485
|
+
|
|
486
|
+
No authorization required
|
|
487
|
+
|
|
488
|
+
### HTTP request headers
|
|
489
|
+
|
|
490
|
+
- **Content-Type**: Not defined
|
|
491
|
+
- **Accept**: `application/json`
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
### HTTP response details
|
|
495
|
+
| Status code | Description | Response headers |
|
|
496
|
+
|-------------|-------------|------------------|
|
|
497
|
+
| **200** | Resource-session activity events | - |
|
|
498
|
+
| **404** | Resource session not found | - |
|
|
499
|
+
|
|
500
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
501
|
+
|
|
502
|
+
|
|
362
503
|
## getResourceSessionAsset
|
|
363
504
|
|
|
364
505
|
> Blob getResourceSessionAsset(sessionId, assetPath)
|
|
@@ -768,7 +909,7 @@ No authorization required
|
|
|
768
909
|
|
|
769
910
|
## getResourceSessionScormData
|
|
770
911
|
|
|
771
|
-
> GetResourceSessionScormData getResourceSessionScormData(sessionId)
|
|
912
|
+
> GetResourceSessionScormData getResourceSessionScormData(sessionId, activityId)
|
|
772
913
|
|
|
773
914
|
Get SCORM CMI data for a resource session
|
|
774
915
|
|
|
@@ -788,6 +929,8 @@ async function example() {
|
|
|
788
929
|
const body = {
|
|
789
930
|
// string
|
|
790
931
|
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
932
|
+
// string (optional)
|
|
933
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
791
934
|
} satisfies GetResourceSessionScormDataRequest;
|
|
792
935
|
|
|
793
936
|
try {
|
|
@@ -808,6 +951,7 @@ example().catch(console.error);
|
|
|
808
951
|
| Name | Type | Description | Notes |
|
|
809
952
|
|------------- | ------------- | ------------- | -------------|
|
|
810
953
|
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
954
|
+
| **activityId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
811
955
|
|
|
812
956
|
### Return type
|
|
813
957
|
|
|
@@ -835,7 +979,7 @@ No authorization required
|
|
|
835
979
|
|
|
836
980
|
## initializeResourceScormSession
|
|
837
981
|
|
|
838
|
-
> initializeResourceScormSession(sessionId)
|
|
982
|
+
> initializeResourceScormSession(sessionId, activityId)
|
|
839
983
|
|
|
840
984
|
Initialize a reusable SCORM resource session
|
|
841
985
|
|
|
@@ -855,6 +999,8 @@ async function example() {
|
|
|
855
999
|
const body = {
|
|
856
1000
|
// string
|
|
857
1001
|
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1002
|
+
// string (optional)
|
|
1003
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
858
1004
|
} satisfies InitializeResourceScormSessionRequest;
|
|
859
1005
|
|
|
860
1006
|
try {
|
|
@@ -875,6 +1021,7 @@ example().catch(console.error);
|
|
|
875
1021
|
| Name | Type | Description | Notes |
|
|
876
1022
|
|------------- | ------------- | ------------- | -------------|
|
|
877
1023
|
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1024
|
+
| **activityId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
878
1025
|
|
|
879
1026
|
### Return type
|
|
880
1027
|
|
|
@@ -899,6 +1046,78 @@ No authorization required
|
|
|
899
1046
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
900
1047
|
|
|
901
1048
|
|
|
1049
|
+
## postResourceSessionActivityEvent
|
|
1050
|
+
|
|
1051
|
+
> GetResourceSessionActivity postResourceSessionActivityEvent(sessionId, activityId, postResourceSessionActivityEvent)
|
|
1052
|
+
|
|
1053
|
+
Record learner activity and update active time
|
|
1054
|
+
|
|
1055
|
+
### Example
|
|
1056
|
+
|
|
1057
|
+
```ts
|
|
1058
|
+
import {
|
|
1059
|
+
Configuration,
|
|
1060
|
+
PlayerApi,
|
|
1061
|
+
} from '@easyedu/js-lsm-api';
|
|
1062
|
+
import type { PostResourceSessionActivityEventRequest } from '@easyedu/js-lsm-api';
|
|
1063
|
+
|
|
1064
|
+
async function example() {
|
|
1065
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
1066
|
+
const api = new PlayerApi();
|
|
1067
|
+
|
|
1068
|
+
const body = {
|
|
1069
|
+
// string
|
|
1070
|
+
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1071
|
+
// string
|
|
1072
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1073
|
+
// PostResourceSessionActivityEvent
|
|
1074
|
+
postResourceSessionActivityEvent: ...,
|
|
1075
|
+
} satisfies PostResourceSessionActivityEventRequest;
|
|
1076
|
+
|
|
1077
|
+
try {
|
|
1078
|
+
const data = await api.postResourceSessionActivityEvent(body);
|
|
1079
|
+
console.log(data);
|
|
1080
|
+
} catch (error) {
|
|
1081
|
+
console.error(error);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
// Run the test
|
|
1086
|
+
example().catch(console.error);
|
|
1087
|
+
```
|
|
1088
|
+
|
|
1089
|
+
### Parameters
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
| Name | Type | Description | Notes |
|
|
1093
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1094
|
+
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1095
|
+
| **activityId** | `string` | | [Defaults to `undefined`] |
|
|
1096
|
+
| **postResourceSessionActivityEvent** | [PostResourceSessionActivityEvent](PostResourceSessionActivityEvent.md) | | |
|
|
1097
|
+
|
|
1098
|
+
### Return type
|
|
1099
|
+
|
|
1100
|
+
[**GetResourceSessionActivity**](GetResourceSessionActivity.md)
|
|
1101
|
+
|
|
1102
|
+
### Authorization
|
|
1103
|
+
|
|
1104
|
+
No authorization required
|
|
1105
|
+
|
|
1106
|
+
### HTTP request headers
|
|
1107
|
+
|
|
1108
|
+
- **Content-Type**: `application/json`
|
|
1109
|
+
- **Accept**: `application/json`
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
### HTTP response details
|
|
1113
|
+
| Status code | Description | Response headers |
|
|
1114
|
+
|-------------|-------------|------------------|
|
|
1115
|
+
| **200** | Updated resource-session activity | - |
|
|
1116
|
+
| **404** | Resource session or activity not found | - |
|
|
1117
|
+
|
|
1118
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1119
|
+
|
|
1120
|
+
|
|
902
1121
|
## postResourceSessionComplete
|
|
903
1122
|
|
|
904
1123
|
> GetResourceSession postResourceSessionComplete(sessionId)
|
|
@@ -967,7 +1186,7 @@ No authorization required
|
|
|
967
1186
|
|
|
968
1187
|
## setResourceScormValue
|
|
969
1188
|
|
|
970
|
-
> ScormSetValueResponse setResourceScormValue(sessionId, scormSetValueRequest)
|
|
1189
|
+
> ScormSetValueResponse setResourceScormValue(sessionId, scormSetValueRequest, activityId)
|
|
971
1190
|
|
|
972
1191
|
Store a CMI value in a reusable SCORM resource session
|
|
973
1192
|
|
|
@@ -989,6 +1208,8 @@ async function example() {
|
|
|
989
1208
|
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
990
1209
|
// ScormSetValueRequest
|
|
991
1210
|
scormSetValueRequest: ...,
|
|
1211
|
+
// string (optional)
|
|
1212
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
992
1213
|
} satisfies SetResourceScormValueRequest;
|
|
993
1214
|
|
|
994
1215
|
try {
|
|
@@ -1010,6 +1231,7 @@ example().catch(console.error);
|
|
|
1010
1231
|
|------------- | ------------- | ------------- | -------------|
|
|
1011
1232
|
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1012
1233
|
| **scormSetValueRequest** | [ScormSetValueRequest](ScormSetValueRequest.md) | | |
|
|
1234
|
+
| **activityId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
1013
1235
|
|
|
1014
1236
|
### Return type
|
|
1015
1237
|
|
|
@@ -1036,7 +1258,7 @@ No authorization required
|
|
|
1036
1258
|
|
|
1037
1259
|
## terminateResourceScormSession
|
|
1038
1260
|
|
|
1039
|
-
> terminateResourceScormSession(sessionId)
|
|
1261
|
+
> terminateResourceScormSession(sessionId, activityId)
|
|
1040
1262
|
|
|
1041
1263
|
Terminate a reusable SCORM resource session
|
|
1042
1264
|
|
|
@@ -1056,6 +1278,8 @@ async function example() {
|
|
|
1056
1278
|
const body = {
|
|
1057
1279
|
// string
|
|
1058
1280
|
sessionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1281
|
+
// string (optional)
|
|
1282
|
+
activityId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
1059
1283
|
} satisfies TerminateResourceScormSessionRequest;
|
|
1060
1284
|
|
|
1061
1285
|
try {
|
|
@@ -1076,6 +1300,7 @@ example().catch(console.error);
|
|
|
1076
1300
|
| Name | Type | Description | Notes |
|
|
1077
1301
|
|------------- | ------------- | ------------- | -------------|
|
|
1078
1302
|
| **sessionId** | `string` | | [Defaults to `undefined`] |
|
|
1303
|
+
| **activityId** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
1079
1304
|
|
|
1080
1305
|
### Return type
|
|
1081
1306
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# PostResourceSessionActivityEvent
|
|
3
|
+
|
|
4
|
+
A learner activity signal. Timing is calculated from server receipt times.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`eventId` | string
|
|
11
|
+
`eventType` | string
|
|
12
|
+
`positionSeconds` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { PostResourceSessionActivityEvent } from '@easyedu/js-lsm-api'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"eventId": null,
|
|
22
|
+
"eventType": null,
|
|
23
|
+
"positionSeconds": null,
|
|
24
|
+
} satisfies PostResourceSessionActivityEvent
|
|
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 PostResourceSessionActivityEvent
|
|
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
|
+
|