@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.
Files changed (139) hide show
  1. package/.openapi-generator/FILES +30 -0
  2. package/README.md +28 -2
  3. package/dist/apis/DispatchApi.d.ts +18 -0
  4. package/dist/apis/DispatchApi.js +43 -0
  5. package/dist/apis/LRSApi.d.ts +152 -0
  6. package/dist/apis/LRSApi.js +369 -0
  7. package/dist/apis/PlayerApi.d.ts +71 -0
  8. package/dist/apis/PlayerApi.js +177 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/DispatchApi.d.ts +18 -0
  12. package/dist/esm/apis/DispatchApi.js +43 -0
  13. package/dist/esm/apis/LRSApi.d.ts +152 -0
  14. package/dist/esm/apis/LRSApi.js +365 -0
  15. package/dist/esm/apis/PlayerApi.d.ts +71 -0
  16. package/dist/esm/apis/PlayerApi.js +177 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/Cmi5Launch.d.ts +52 -0
  20. package/dist/esm/models/Cmi5Launch.js +58 -0
  21. package/dist/esm/models/DeleteLrsUserRecordsResponse.d.ts +38 -0
  22. package/dist/esm/models/DeleteLrsUserRecordsResponse.js +47 -0
  23. package/dist/esm/models/GetCourseExport.d.ts +2 -1
  24. package/dist/esm/models/GetCourseExport.js +2 -1
  25. package/dist/esm/models/GetLrsCredentials.d.ts +46 -0
  26. package/dist/esm/models/GetLrsCredentials.js +53 -0
  27. package/dist/esm/models/GetLrsStatementList.d.ts +57 -0
  28. package/dist/esm/models/GetLrsStatementList.js +60 -0
  29. package/dist/esm/models/GetResourceSessionActivity.d.ts +2 -1
  30. package/dist/esm/models/GetResourceSessionActivity.js +2 -1
  31. package/dist/esm/models/H5pState.d.ts +32 -0
  32. package/dist/esm/models/H5pState.js +43 -0
  33. package/dist/esm/models/H5pStatementResult.d.ts +44 -0
  34. package/dist/esm/models/H5pStatementResult.js +49 -0
  35. package/dist/esm/models/HostedScormAccessPolicy.d.ts +1 -1
  36. package/dist/esm/models/LrsCredential.d.ts +74 -0
  37. package/dist/esm/models/LrsCredential.js +67 -0
  38. package/dist/esm/models/LrsScope.d.ts +38 -0
  39. package/dist/esm/models/LrsScope.js +47 -0
  40. package/dist/esm/models/LrsStatement.d.ts +112 -0
  41. package/dist/esm/models/LrsStatement.js +81 -0
  42. package/dist/esm/models/PostCourseExport.d.ts +2 -1
  43. package/dist/esm/models/PostCourseExport.js +2 -1
  44. package/dist/esm/models/PostDispatchCmi5Launch.d.ts +64 -0
  45. package/dist/esm/models/PostDispatchCmi5Launch.js +63 -0
  46. package/dist/esm/models/PostH5pStatement.d.ts +40 -0
  47. package/dist/esm/models/PostH5pStatement.js +47 -0
  48. package/dist/esm/models/PostLrsCredential.d.ts +38 -0
  49. package/dist/esm/models/PostLrsCredential.js +47 -0
  50. package/dist/esm/models/PostLrsCredentialResponse.d.ts +45 -0
  51. package/dist/esm/models/PostLrsCredentialResponse.js +52 -0
  52. package/dist/esm/models/PutLrsCredential.d.ts +38 -0
  53. package/dist/esm/models/PutLrsCredential.js +43 -0
  54. package/dist/esm/models/ResourceType.d.ts +2 -0
  55. package/dist/esm/models/ResourceType.js +3 -1
  56. package/dist/esm/models/index.d.ts +14 -0
  57. package/dist/esm/models/index.js +14 -0
  58. package/dist/models/Cmi5Launch.d.ts +52 -0
  59. package/dist/models/Cmi5Launch.js +66 -0
  60. package/dist/models/DeleteLrsUserRecordsResponse.d.ts +38 -0
  61. package/dist/models/DeleteLrsUserRecordsResponse.js +54 -0
  62. package/dist/models/GetCourseExport.d.ts +2 -1
  63. package/dist/models/GetCourseExport.js +2 -1
  64. package/dist/models/GetLrsCredentials.d.ts +46 -0
  65. package/dist/models/GetLrsCredentials.js +60 -0
  66. package/dist/models/GetLrsStatementList.d.ts +57 -0
  67. package/dist/models/GetLrsStatementList.js +67 -0
  68. package/dist/models/GetResourceSessionActivity.d.ts +2 -1
  69. package/dist/models/GetResourceSessionActivity.js +2 -1
  70. package/dist/models/H5pState.d.ts +32 -0
  71. package/dist/models/H5pState.js +50 -0
  72. package/dist/models/H5pStatementResult.d.ts +44 -0
  73. package/dist/models/H5pStatementResult.js +56 -0
  74. package/dist/models/HostedScormAccessPolicy.d.ts +1 -1
  75. package/dist/models/LrsCredential.d.ts +74 -0
  76. package/dist/models/LrsCredential.js +74 -0
  77. package/dist/models/LrsScope.d.ts +38 -0
  78. package/dist/models/LrsScope.js +54 -0
  79. package/dist/models/LrsStatement.d.ts +112 -0
  80. package/dist/models/LrsStatement.js +88 -0
  81. package/dist/models/PostCourseExport.d.ts +2 -1
  82. package/dist/models/PostCourseExport.js +2 -1
  83. package/dist/models/PostDispatchCmi5Launch.d.ts +64 -0
  84. package/dist/models/PostDispatchCmi5Launch.js +70 -0
  85. package/dist/models/PostH5pStatement.d.ts +40 -0
  86. package/dist/models/PostH5pStatement.js +54 -0
  87. package/dist/models/PostLrsCredential.d.ts +38 -0
  88. package/dist/models/PostLrsCredential.js +54 -0
  89. package/dist/models/PostLrsCredentialResponse.d.ts +45 -0
  90. package/dist/models/PostLrsCredentialResponse.js +59 -0
  91. package/dist/models/PutLrsCredential.d.ts +38 -0
  92. package/dist/models/PutLrsCredential.js +50 -0
  93. package/dist/models/ResourceType.d.ts +2 -0
  94. package/dist/models/ResourceType.js +3 -1
  95. package/dist/models/index.d.ts +14 -0
  96. package/dist/models/index.js +14 -0
  97. package/docs/Cmi5Launch.md +39 -0
  98. package/docs/ContentLibraryApi.md +2 -2
  99. package/docs/DeleteLrsUserRecordsResponse.md +37 -0
  100. package/docs/DispatchApi.md +73 -0
  101. package/docs/GetLrsCredentials.md +38 -0
  102. package/docs/GetLrsStatementList.md +42 -0
  103. package/docs/H5pState.md +35 -0
  104. package/docs/H5pStatementResult.md +39 -0
  105. package/docs/LRSApi.md +531 -0
  106. package/docs/LrsCredential.md +49 -0
  107. package/docs/LrsScope.md +37 -0
  108. package/docs/LrsStatement.md +61 -0
  109. package/docs/PlayerApi.md +286 -1
  110. package/docs/PostDispatchCmi5Launch.md +45 -0
  111. package/docs/PostH5pStatement.md +37 -0
  112. package/docs/PostLrsCredential.md +36 -0
  113. package/docs/PostLrsCredentialResponse.md +39 -0
  114. package/docs/PutLrsCredential.md +36 -0
  115. package/package.json +1 -1
  116. package/src/apis/DispatchApi.ts +58 -0
  117. package/src/apis/LRSApi.ts +486 -0
  118. package/src/apis/PlayerApi.ts +250 -0
  119. package/src/apis/index.ts +1 -0
  120. package/src/models/Cmi5Launch.ts +95 -0
  121. package/src/models/DeleteLrsUserRecordsResponse.ts +75 -0
  122. package/src/models/GetCourseExport.ts +3 -2
  123. package/src/models/GetLrsCredentials.ts +99 -0
  124. package/src/models/GetLrsStatementList.ts +110 -0
  125. package/src/models/GetResourceSessionActivity.ts +3 -2
  126. package/src/models/H5pState.ts +66 -0
  127. package/src/models/H5pStatementResult.ts +83 -0
  128. package/src/models/HostedScormAccessPolicy.ts +1 -1
  129. package/src/models/LrsCredential.ts +127 -0
  130. package/src/models/LrsScope.ts +75 -0
  131. package/src/models/LrsStatement.ts +176 -0
  132. package/src/models/PostCourseExport.ts +3 -2
  133. package/src/models/PostDispatchCmi5Launch.ts +111 -0
  134. package/src/models/PostH5pStatement.ts +75 -0
  135. package/src/models/PostLrsCredential.ts +75 -0
  136. package/src/models/PostLrsCredentialResponse.ts +92 -0
  137. package/src/models/PutLrsCredential.ts +73 -0
  138. package/src/models/ResourceType.ts +3 -1
  139. package/src/models/index.ts +14 -0
package/docs/LRSApi.md ADDED
@@ -0,0 +1,531 @@
1
+ # LRSApi
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
+ | [**deleteLrsCredential**](LRSApi.md#deletelrscredential) | **DELETE** /lrs/credentials/{credentialId} | Revoke an LRS credential |
8
+ | [**deleteLrsUserRecords**](LRSApi.md#deletelrsuserrecords) | **DELETE** /lrs/users/{userId}/records | Permanently delete one learner\'s xAPI statements and documents from the selected portal |
9
+ | [**getLrsCredentials**](LRSApi.md#getlrscredentials) | **GET** /lrs/credentials | List the selected portal\'s LRS credentials, the scopes they can be granted, and the xAPI endpoint |
10
+ | [**getLrsStatements**](LRSApi.md#getlrsstatements) | **GET** /lrs/statements | Browse the xAPI statements stored for the selected portal, newest first |
11
+ | [**getLrsStatementsExport**](LRSApi.md#getlrsstatementsexport) | **GET** /lrs/statements/export | Export the selected portal\'s xAPI statements as JSON or CSV, oldest first |
12
+ | [**postLrsCredential**](LRSApi.md#postlrscredential) | **POST** /lrs/credentials | Create an LRS credential for the selected portal |
13
+ | [**putLrsCredential**](LRSApi.md#putlrscredential) | **PUT** /lrs/credentials/{credentialId} | Rename an LRS credential or replace its scopes |
14
+
15
+
16
+
17
+ ## deleteLrsCredential
18
+
19
+ > deleteLrsCredential(credentialId)
20
+
21
+ Revoke an LRS credential
22
+
23
+ ### Example
24
+
25
+ ```ts
26
+ import {
27
+ Configuration,
28
+ LRSApi,
29
+ } from '@easyedu/js-lsm-api';
30
+ import type { DeleteLrsCredentialRequest } from '@easyedu/js-lsm-api';
31
+
32
+ async function example() {
33
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
34
+ const api = new LRSApi();
35
+
36
+ const body = {
37
+ // string
38
+ credentialId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
39
+ } satisfies DeleteLrsCredentialRequest;
40
+
41
+ try {
42
+ const data = await api.deleteLrsCredential(body);
43
+ console.log(data);
44
+ } catch (error) {
45
+ console.error(error);
46
+ }
47
+ }
48
+
49
+ // Run the test
50
+ example().catch(console.error);
51
+ ```
52
+
53
+ ### Parameters
54
+
55
+
56
+ | Name | Type | Description | Notes |
57
+ |------------- | ------------- | ------------- | -------------|
58
+ | **credentialId** | `string` | | [Defaults to `undefined`] |
59
+
60
+ ### Return type
61
+
62
+ `void` (Empty response body)
63
+
64
+ ### Authorization
65
+
66
+ No authorization required
67
+
68
+ ### HTTP request headers
69
+
70
+ - **Content-Type**: Not defined
71
+ - **Accept**: Not defined
72
+
73
+
74
+ ### HTTP response details
75
+ | Status code | Description | Response headers |
76
+ |-------------|-------------|------------------|
77
+ | **204** | LRS credential revoked | - |
78
+ | **403** | Forbidden | - |
79
+ | **404** | LRS credential not found | - |
80
+
81
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
82
+
83
+
84
+ ## deleteLrsUserRecords
85
+
86
+ > DeleteLrsUserRecordsResponse deleteLrsUserRecords(userId)
87
+
88
+ Permanently delete one learner\'s xAPI statements and documents from the selected portal
89
+
90
+ ### Example
91
+
92
+ ```ts
93
+ import {
94
+ Configuration,
95
+ LRSApi,
96
+ } from '@easyedu/js-lsm-api';
97
+ import type { DeleteLrsUserRecordsRequest } from '@easyedu/js-lsm-api';
98
+
99
+ async function example() {
100
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
101
+ const api = new LRSApi();
102
+
103
+ const body = {
104
+ // string | The LMS user\'s id.
105
+ userId: userId_example,
106
+ } satisfies DeleteLrsUserRecordsRequest;
107
+
108
+ try {
109
+ const data = await api.deleteLrsUserRecords(body);
110
+ console.log(data);
111
+ } catch (error) {
112
+ console.error(error);
113
+ }
114
+ }
115
+
116
+ // Run the test
117
+ example().catch(console.error);
118
+ ```
119
+
120
+ ### Parameters
121
+
122
+
123
+ | Name | Type | Description | Notes |
124
+ |------------- | ------------- | ------------- | -------------|
125
+ | **userId** | `string` | The LMS user\'s id. | [Defaults to `undefined`] |
126
+
127
+ ### Return type
128
+
129
+ [**DeleteLrsUserRecordsResponse**](DeleteLrsUserRecordsResponse.md)
130
+
131
+ ### Authorization
132
+
133
+ No authorization required
134
+
135
+ ### HTTP request headers
136
+
137
+ - **Content-Type**: Not defined
138
+ - **Accept**: `application/json`
139
+
140
+
141
+ ### HTTP response details
142
+ | Status code | Description | Response headers |
143
+ |-------------|-------------|------------------|
144
+ | **200** | The learner\'s records were deleted | - |
145
+ | **403** | Forbidden | - |
146
+ | **404** | The user is not a member of the selected portal | - |
147
+
148
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
149
+
150
+
151
+ ## getLrsCredentials
152
+
153
+ > GetLrsCredentials getLrsCredentials()
154
+
155
+ List the selected portal\'s LRS credentials, the scopes they can be granted, and the xAPI endpoint
156
+
157
+ ### Example
158
+
159
+ ```ts
160
+ import {
161
+ Configuration,
162
+ LRSApi,
163
+ } from '@easyedu/js-lsm-api';
164
+ import type { GetLrsCredentialsRequest } from '@easyedu/js-lsm-api';
165
+
166
+ async function example() {
167
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
168
+ const api = new LRSApi();
169
+
170
+ try {
171
+ const data = await api.getLrsCredentials();
172
+ console.log(data);
173
+ } catch (error) {
174
+ console.error(error);
175
+ }
176
+ }
177
+
178
+ // Run the test
179
+ example().catch(console.error);
180
+ ```
181
+
182
+ ### Parameters
183
+
184
+ This endpoint does not need any parameter.
185
+
186
+ ### Return type
187
+
188
+ [**GetLrsCredentials**](GetLrsCredentials.md)
189
+
190
+ ### Authorization
191
+
192
+ No authorization required
193
+
194
+ ### HTTP request headers
195
+
196
+ - **Content-Type**: Not defined
197
+ - **Accept**: `application/json`
198
+
199
+
200
+ ### HTTP response details
201
+ | Status code | Description | Response headers |
202
+ |-------------|-------------|------------------|
203
+ | **200** | LRS credentials | - |
204
+ | **403** | Forbidden | - |
205
+
206
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
207
+
208
+
209
+ ## getLrsStatements
210
+
211
+ > GetLrsStatementList getLrsStatements(userId, courseId, verb, activity, registration, since, until, includeVoided, page, pageSize)
212
+
213
+ Browse the xAPI statements stored for the selected portal, newest first
214
+
215
+ ### Example
216
+
217
+ ```ts
218
+ import {
219
+ Configuration,
220
+ LRSApi,
221
+ } from '@easyedu/js-lsm-api';
222
+ import type { GetLrsStatementsRequest } from '@easyedu/js-lsm-api';
223
+
224
+ async function example() {
225
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
226
+ const api = new LRSApi();
227
+
228
+ const body = {
229
+ // string | Only statements whose actor is this LMS user. (optional)
230
+ userId: userId_example,
231
+ // string | Only statements recorded in resource sessions of this course (cmi5 and H5P content). (optional)
232
+ courseId: courseId_example,
233
+ // string | Only statements with this verb IRI. (optional)
234
+ verb: verb_example,
235
+ // string | Only statements whose object is this activity IRI. (optional)
236
+ activity: activity_example,
237
+ // string (optional)
238
+ registration: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
239
+ // number | Only statements stored after this Unix epoch timestamp. (optional)
240
+ since: 789,
241
+ // number | Only statements stored at or before this Unix epoch timestamp. (optional)
242
+ until: 789,
243
+ // boolean (optional)
244
+ includeVoided: true,
245
+ // number (optional)
246
+ page: 56,
247
+ // number (optional)
248
+ pageSize: 56,
249
+ } satisfies GetLrsStatementsRequest;
250
+
251
+ try {
252
+ const data = await api.getLrsStatements(body);
253
+ console.log(data);
254
+ } catch (error) {
255
+ console.error(error);
256
+ }
257
+ }
258
+
259
+ // Run the test
260
+ example().catch(console.error);
261
+ ```
262
+
263
+ ### Parameters
264
+
265
+
266
+ | Name | Type | Description | Notes |
267
+ |------------- | ------------- | ------------- | -------------|
268
+ | **userId** | `string` | Only statements whose actor is this LMS user. | [Optional] [Defaults to `undefined`] |
269
+ | **courseId** | `string` | Only statements recorded in resource sessions of this course (cmi5 and H5P content). | [Optional] [Defaults to `undefined`] |
270
+ | **verb** | `string` | Only statements with this verb IRI. | [Optional] [Defaults to `undefined`] |
271
+ | **activity** | `string` | Only statements whose object is this activity IRI. | [Optional] [Defaults to `undefined`] |
272
+ | **registration** | `string` | | [Optional] [Defaults to `undefined`] |
273
+ | **since** | `number` | Only statements stored after this Unix epoch timestamp. | [Optional] [Defaults to `undefined`] |
274
+ | **until** | `number` | Only statements stored at or before this Unix epoch timestamp. | [Optional] [Defaults to `undefined`] |
275
+ | **includeVoided** | `boolean` | | [Optional] [Defaults to `false`] |
276
+ | **page** | `number` | | [Optional] [Defaults to `1`] |
277
+ | **pageSize** | `number` | | [Optional] [Defaults to `25`] |
278
+
279
+ ### Return type
280
+
281
+ [**GetLrsStatementList**](GetLrsStatementList.md)
282
+
283
+ ### Authorization
284
+
285
+ No authorization required
286
+
287
+ ### HTTP request headers
288
+
289
+ - **Content-Type**: Not defined
290
+ - **Accept**: `application/json`
291
+
292
+
293
+ ### HTTP response details
294
+ | Status code | Description | Response headers |
295
+ |-------------|-------------|------------------|
296
+ | **200** | A page of statements | - |
297
+ | **400** | Invalid filter | - |
298
+ | **403** | Forbidden | - |
299
+
300
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
301
+
302
+
303
+ ## getLrsStatementsExport
304
+
305
+ > Blob getLrsStatementsExport(format, userId, courseId, verb, activity, registration, since, until, includeVoided)
306
+
307
+ Export the selected portal\'s xAPI statements as JSON or CSV, oldest first
308
+
309
+ ### Example
310
+
311
+ ```ts
312
+ import {
313
+ Configuration,
314
+ LRSApi,
315
+ } from '@easyedu/js-lsm-api';
316
+ import type { GetLrsStatementsExportRequest } from '@easyedu/js-lsm-api';
317
+
318
+ async function example() {
319
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
320
+ const api = new LRSApi();
321
+
322
+ const body = {
323
+ // 'json' | 'csv' (optional)
324
+ format: format_example,
325
+ // string | Only statements whose actor is this LMS user. (optional)
326
+ userId: userId_example,
327
+ // string | Only statements recorded in resource sessions of this course (cmi5 and H5P content). (optional)
328
+ courseId: courseId_example,
329
+ // string | Only statements with this verb IRI. (optional)
330
+ verb: verb_example,
331
+ // string | Only statements whose object is this activity IRI. (optional)
332
+ activity: activity_example,
333
+ // string (optional)
334
+ registration: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
335
+ // number | Only statements stored after this Unix epoch timestamp. (optional)
336
+ since: 789,
337
+ // number | Only statements stored at or before this Unix epoch timestamp. (optional)
338
+ until: 789,
339
+ // boolean (optional)
340
+ includeVoided: true,
341
+ } satisfies GetLrsStatementsExportRequest;
342
+
343
+ try {
344
+ const data = await api.getLrsStatementsExport(body);
345
+ console.log(data);
346
+ } catch (error) {
347
+ console.error(error);
348
+ }
349
+ }
350
+
351
+ // Run the test
352
+ example().catch(console.error);
353
+ ```
354
+
355
+ ### Parameters
356
+
357
+
358
+ | Name | Type | Description | Notes |
359
+ |------------- | ------------- | ------------- | -------------|
360
+ | **format** | `json`, `csv` | | [Optional] [Defaults to `'json'`] [Enum: json, csv] |
361
+ | **userId** | `string` | Only statements whose actor is this LMS user. | [Optional] [Defaults to `undefined`] |
362
+ | **courseId** | `string` | Only statements recorded in resource sessions of this course (cmi5 and H5P content). | [Optional] [Defaults to `undefined`] |
363
+ | **verb** | `string` | Only statements with this verb IRI. | [Optional] [Defaults to `undefined`] |
364
+ | **activity** | `string` | Only statements whose object is this activity IRI. | [Optional] [Defaults to `undefined`] |
365
+ | **registration** | `string` | | [Optional] [Defaults to `undefined`] |
366
+ | **since** | `number` | Only statements stored after this Unix epoch timestamp. | [Optional] [Defaults to `undefined`] |
367
+ | **until** | `number` | Only statements stored at or before this Unix epoch timestamp. | [Optional] [Defaults to `undefined`] |
368
+ | **includeVoided** | `boolean` | | [Optional] [Defaults to `false`] |
369
+
370
+ ### Return type
371
+
372
+ **Blob**
373
+
374
+ ### Authorization
375
+
376
+ No authorization required
377
+
378
+ ### HTTP request headers
379
+
380
+ - **Content-Type**: Not defined
381
+ - **Accept**: `application/json`, `text/csv`
382
+
383
+
384
+ ### HTTP response details
385
+ | Status code | Description | Response headers |
386
+ |-------------|-------------|------------------|
387
+ | **200** | Statement export | - |
388
+ | **400** | Invalid filter or format | - |
389
+ | **403** | Forbidden | - |
390
+
391
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
392
+
393
+
394
+ ## postLrsCredential
395
+
396
+ > PostLrsCredentialResponse postLrsCredential(postLrsCredential)
397
+
398
+ Create an LRS credential for the selected portal
399
+
400
+ ### Example
401
+
402
+ ```ts
403
+ import {
404
+ Configuration,
405
+ LRSApi,
406
+ } from '@easyedu/js-lsm-api';
407
+ import type { PostLrsCredentialRequest } from '@easyedu/js-lsm-api';
408
+
409
+ async function example() {
410
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
411
+ const api = new LRSApi();
412
+
413
+ const body = {
414
+ // PostLrsCredential
415
+ postLrsCredential: ...,
416
+ } satisfies PostLrsCredentialRequest;
417
+
418
+ try {
419
+ const data = await api.postLrsCredential(body);
420
+ console.log(data);
421
+ } catch (error) {
422
+ console.error(error);
423
+ }
424
+ }
425
+
426
+ // Run the test
427
+ example().catch(console.error);
428
+ ```
429
+
430
+ ### Parameters
431
+
432
+
433
+ | Name | Type | Description | Notes |
434
+ |------------- | ------------- | ------------- | -------------|
435
+ | **postLrsCredential** | [PostLrsCredential](PostLrsCredential.md) | | |
436
+
437
+ ### Return type
438
+
439
+ [**PostLrsCredentialResponse**](PostLrsCredentialResponse.md)
440
+
441
+ ### Authorization
442
+
443
+ No authorization required
444
+
445
+ ### HTTP request headers
446
+
447
+ - **Content-Type**: `application/json`
448
+ - **Accept**: `application/json`
449
+
450
+
451
+ ### HTTP response details
452
+ | Status code | Description | Response headers |
453
+ |-------------|-------------|------------------|
454
+ | **201** | LRS credential created; the secret is returned only once | - |
455
+ | **400** | Invalid name or scopes | - |
456
+ | **403** | Forbidden | - |
457
+ | **409** | The portal already has the maximum number of active credentials | - |
458
+
459
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
460
+
461
+
462
+ ## putLrsCredential
463
+
464
+ > LrsCredential putLrsCredential(credentialId, putLrsCredential)
465
+
466
+ Rename an LRS credential or replace its scopes
467
+
468
+ ### Example
469
+
470
+ ```ts
471
+ import {
472
+ Configuration,
473
+ LRSApi,
474
+ } from '@easyedu/js-lsm-api';
475
+ import type { PutLrsCredentialRequest } from '@easyedu/js-lsm-api';
476
+
477
+ async function example() {
478
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
479
+ const api = new LRSApi();
480
+
481
+ const body = {
482
+ // string
483
+ credentialId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
484
+ // PutLrsCredential
485
+ putLrsCredential: ...,
486
+ } satisfies PutLrsCredentialRequest;
487
+
488
+ try {
489
+ const data = await api.putLrsCredential(body);
490
+ console.log(data);
491
+ } catch (error) {
492
+ console.error(error);
493
+ }
494
+ }
495
+
496
+ // Run the test
497
+ example().catch(console.error);
498
+ ```
499
+
500
+ ### Parameters
501
+
502
+
503
+ | Name | Type | Description | Notes |
504
+ |------------- | ------------- | ------------- | -------------|
505
+ | **credentialId** | `string` | | [Defaults to `undefined`] |
506
+ | **putLrsCredential** | [PutLrsCredential](PutLrsCredential.md) | | |
507
+
508
+ ### Return type
509
+
510
+ [**LrsCredential**](LrsCredential.md)
511
+
512
+ ### Authorization
513
+
514
+ No authorization required
515
+
516
+ ### HTTP request headers
517
+
518
+ - **Content-Type**: `application/json`
519
+ - **Accept**: `application/json`
520
+
521
+
522
+ ### HTTP response details
523
+ | Status code | Description | Response headers |
524
+ |-------------|-------------|------------------|
525
+ | **200** | LRS credential updated | - |
526
+ | **400** | Invalid name or scopes | - |
527
+ | **403** | Forbidden | - |
528
+ | **404** | LRS credential not found | - |
529
+
530
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
531
+
@@ -0,0 +1,49 @@
1
+
2
+ # LrsCredential
3
+
4
+ A portal-scoped credential for the xAPI Learning Record Store. External systems use the key and secret as HTTP Basic credentials. The secret is never included here.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `id` | string
11
+ `name` | string
12
+ `apiKey` | string
13
+ `scopes` | Array<string>
14
+ `createdAt` | number
15
+ `updatedAt` | number
16
+ `lastUsedAt` | number
17
+ `revokedAt` | number
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import type { LrsCredential } from '@easyedu/js-lsm-api'
23
+
24
+ // TODO: Update the object below with actual values
25
+ const example = {
26
+ "id": null,
27
+ "name": null,
28
+ "apiKey": null,
29
+ "scopes": null,
30
+ "createdAt": null,
31
+ "updatedAt": null,
32
+ "lastUsedAt": null,
33
+ "revokedAt": null,
34
+ } satisfies LrsCredential
35
+
36
+ console.log(example)
37
+
38
+ // Convert the instance to a JSON string
39
+ const exampleJSON: string = JSON.stringify(example)
40
+ console.log(exampleJSON)
41
+
42
+ // Parse the JSON string back to an object
43
+ const exampleParsed = JSON.parse(exampleJSON) as LrsCredential
44
+ console.log(exampleParsed)
45
+ ```
46
+
47
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
48
+
49
+
@@ -0,0 +1,37 @@
1
+
2
+ # LrsScope
3
+
4
+ An xAPI authorization scope that can be granted to an LRS credential.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `key` | string
11
+ `description` | string
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { LrsScope } from '@easyedu/js-lsm-api'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "key": null,
21
+ "description": null,
22
+ } satisfies LrsScope
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 LrsScope
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,61 @@
1
+
2
+ # LrsStatement
3
+
4
+ An xAPI statement stored for the portal, with the fields administrators filter on.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `id` | string
11
+ `stored` | number
12
+ `timestamp` | number
13
+ `verbId` | string
14
+ `verbDisplay` | string
15
+ `actorName` | string
16
+ `objectType` | string
17
+ `objectId` | string
18
+ `objectName` | string
19
+ `userId` | string
20
+ `registration` | string
21
+ `credentialId` | string
22
+ `voided` | boolean
23
+ `statement` | { [key: string]: any; }
24
+
25
+ ## Example
26
+
27
+ ```typescript
28
+ import type { LrsStatement } from '@easyedu/js-lsm-api'
29
+
30
+ // TODO: Update the object below with actual values
31
+ const example = {
32
+ "id": null,
33
+ "stored": null,
34
+ "timestamp": null,
35
+ "verbId": null,
36
+ "verbDisplay": null,
37
+ "actorName": null,
38
+ "objectType": null,
39
+ "objectId": null,
40
+ "objectName": null,
41
+ "userId": null,
42
+ "registration": null,
43
+ "credentialId": null,
44
+ "voided": null,
45
+ "statement": null,
46
+ } satisfies LrsStatement
47
+
48
+ console.log(example)
49
+
50
+ // Convert the instance to a JSON string
51
+ const exampleJSON: string = JSON.stringify(example)
52
+ console.log(exampleJSON)
53
+
54
+ // Parse the JSON string back to an object
55
+ const exampleParsed = JSON.parse(exampleJSON) as LrsStatement
56
+ console.log(exampleParsed)
57
+ ```
58
+
59
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
60
+
61
+