@easyedu/js-lsm-api 1.25.0 → 1.27.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 +11 -0
- package/README.md +2 -2
- package/dist/apis/ContentApi.d.ts +64 -1
- package/dist/apis/ContentApi.js +155 -0
- package/dist/apis/CourseApi.d.ts +40 -1
- package/dist/apis/CourseApi.js +100 -0
- package/dist/esm/apis/ContentApi.d.ts +64 -1
- package/dist/esm/apis/ContentApi.js +156 -1
- package/dist/esm/apis/CourseApi.d.ts +40 -1
- package/dist/esm/apis/CourseApi.js +101 -1
- package/dist/esm/models/GetContentVersion.d.ts +76 -0
- package/dist/esm/models/GetContentVersion.js +71 -0
- package/dist/esm/models/GetContentVersionList.d.ts +57 -0
- package/dist/esm/models/GetContentVersionList.js +60 -0
- package/dist/esm/models/GetContentVersionListItemsInner.d.ts +56 -0
- package/dist/esm/models/GetContentVersionListItemsInner.js +59 -0
- package/dist/esm/models/GetContentVersionSandbox.d.ts +32 -0
- package/dist/esm/models/GetContentVersionSandbox.js +43 -0
- package/dist/esm/models/GetContentVersionScormData.d.ts +32 -0
- package/dist/esm/models/GetContentVersionScormData.js +43 -0
- package/dist/esm/models/GetCourseExport.d.ts +93 -0
- package/dist/esm/models/GetCourseExport.js +82 -0
- package/dist/esm/models/GetCourseExportList.d.ts +57 -0
- package/dist/esm/models/GetCourseExportList.js +60 -0
- package/dist/esm/models/GetScormPackage.d.ts +39 -0
- package/dist/esm/models/GetScormPackage.js +48 -0
- package/dist/esm/models/GetScormPackagePackageInfo.d.ts +104 -0
- package/dist/esm/models/GetScormPackagePackageInfo.js +81 -0
- package/dist/esm/models/PostCourseExport.d.ts +41 -0
- package/dist/esm/models/PostCourseExport.js +51 -0
- package/dist/esm/models/PutContentVersion.d.ts +32 -0
- package/dist/esm/models/PutContentVersion.js +43 -0
- package/dist/esm/models/index.d.ts +11 -0
- package/dist/esm/models/index.js +11 -0
- package/dist/models/GetContentVersion.d.ts +76 -0
- package/dist/models/GetContentVersion.js +78 -0
- package/dist/models/GetContentVersionList.d.ts +57 -0
- package/dist/models/GetContentVersionList.js +67 -0
- package/dist/models/GetContentVersionListItemsInner.d.ts +56 -0
- package/dist/models/GetContentVersionListItemsInner.js +66 -0
- package/dist/models/GetContentVersionSandbox.d.ts +32 -0
- package/dist/models/GetContentVersionSandbox.js +50 -0
- package/dist/models/GetContentVersionScormData.d.ts +32 -0
- package/dist/models/GetContentVersionScormData.js +50 -0
- package/dist/models/GetCourseExport.d.ts +93 -0
- package/dist/models/GetCourseExport.js +90 -0
- package/dist/models/GetCourseExportList.d.ts +57 -0
- package/dist/models/GetCourseExportList.js +67 -0
- package/dist/models/GetScormPackage.d.ts +39 -0
- package/dist/models/GetScormPackage.js +55 -0
- package/dist/models/GetScormPackagePackageInfo.d.ts +104 -0
- package/dist/models/GetScormPackagePackageInfo.js +88 -0
- package/dist/models/PostCourseExport.d.ts +41 -0
- package/dist/models/PostCourseExport.js +59 -0
- package/dist/models/PutContentVersion.d.ts +32 -0
- package/dist/models/PutContentVersion.js +50 -0
- package/dist/models/index.d.ts +11 -0
- package/dist/models/index.js +11 -0
- package/package.json +1 -1
- package/src/apis/ContentApi.ts +253 -0
- package/src/apis/CourseApi.ts +151 -0
- package/src/models/GetContentVersion.ts +143 -0
- package/src/models/GetContentVersionList.ts +110 -0
- package/src/models/GetContentVersionListItemsInner.ts +102 -0
- package/src/models/GetContentVersionSandbox.ts +66 -0
- package/src/models/GetContentVersionScormData.ts +66 -0
- package/src/models/GetCourseExport.ts +149 -0
- package/src/models/GetCourseExportList.ts +110 -0
- package/src/models/GetScormPackage.ts +83 -0
- package/src/models/GetScormPackagePackageInfo.ts +169 -0
- package/src/models/PostCourseExport.ts +78 -0
- package/src/models/PutContentVersion.ts +66 -0
- package/src/models/index.ts +11 -0
package/src/apis/ContentApi.ts
CHANGED
|
@@ -19,10 +19,14 @@ import type {
|
|
|
19
19
|
GetContentList,
|
|
20
20
|
GetContentSession,
|
|
21
21
|
GetContentUpload,
|
|
22
|
+
GetContentVersion,
|
|
23
|
+
GetContentVersionList,
|
|
24
|
+
GetScormPackage,
|
|
22
25
|
PostContentQuiz,
|
|
23
26
|
PostContentSession,
|
|
24
27
|
PostContentUpload,
|
|
25
28
|
PutContent,
|
|
29
|
+
PutContentVersion,
|
|
26
30
|
} from '../models/index';
|
|
27
31
|
import {
|
|
28
32
|
GetContentFromJSON,
|
|
@@ -33,6 +37,12 @@ import {
|
|
|
33
37
|
GetContentSessionToJSON,
|
|
34
38
|
GetContentUploadFromJSON,
|
|
35
39
|
GetContentUploadToJSON,
|
|
40
|
+
GetContentVersionFromJSON,
|
|
41
|
+
GetContentVersionToJSON,
|
|
42
|
+
GetContentVersionListFromJSON,
|
|
43
|
+
GetContentVersionListToJSON,
|
|
44
|
+
GetScormPackageFromJSON,
|
|
45
|
+
GetScormPackageToJSON,
|
|
36
46
|
PostContentQuizFromJSON,
|
|
37
47
|
PostContentQuizToJSON,
|
|
38
48
|
PostContentSessionFromJSON,
|
|
@@ -41,6 +51,8 @@ import {
|
|
|
41
51
|
PostContentUploadToJSON,
|
|
42
52
|
PutContentFromJSON,
|
|
43
53
|
PutContentToJSON,
|
|
54
|
+
PutContentVersionFromJSON,
|
|
55
|
+
PutContentVersionToJSON,
|
|
44
56
|
} from '../models/index';
|
|
45
57
|
|
|
46
58
|
export interface GetContentRequest {
|
|
@@ -60,6 +72,25 @@ export interface GetContentSessionRequest {
|
|
|
60
72
|
courseId: string;
|
|
61
73
|
}
|
|
62
74
|
|
|
75
|
+
export interface GetContentVersionRequest {
|
|
76
|
+
contentId: string;
|
|
77
|
+
moduleId: string;
|
|
78
|
+
courseId: string;
|
|
79
|
+
versionId: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface GetContentVersionListRequest {
|
|
83
|
+
contentId: string;
|
|
84
|
+
moduleId: string;
|
|
85
|
+
courseId: string;
|
|
86
|
+
page?: number;
|
|
87
|
+
pageSize?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface GetScormPackageRequest {
|
|
91
|
+
packageId: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
63
94
|
export interface PostContentProcessRequest {
|
|
64
95
|
moduleId: string;
|
|
65
96
|
courseId: string;
|
|
@@ -91,6 +122,14 @@ export interface PutContentRequest {
|
|
|
91
122
|
putContent: PutContent;
|
|
92
123
|
}
|
|
93
124
|
|
|
125
|
+
export interface PutContentVersionRequest {
|
|
126
|
+
contentId: string;
|
|
127
|
+
moduleId: string;
|
|
128
|
+
courseId: string;
|
|
129
|
+
versionId: string;
|
|
130
|
+
putContentVersion: PutContentVersion;
|
|
131
|
+
}
|
|
132
|
+
|
|
94
133
|
/**
|
|
95
134
|
*
|
|
96
135
|
*/
|
|
@@ -230,6 +269,154 @@ export class ContentApi extends runtime.BaseAPI {
|
|
|
230
269
|
return await response.value();
|
|
231
270
|
}
|
|
232
271
|
|
|
272
|
+
/**
|
|
273
|
+
* Returns detailed information about a specific version of the content, including sandbox launch URL and SCORM-specific data (package info and table of contents) if applicable.
|
|
274
|
+
* Get details of a specific content version
|
|
275
|
+
*/
|
|
276
|
+
async getContentVersionRaw(requestParameters: GetContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentVersion>> {
|
|
277
|
+
if (requestParameters['contentId'] == null) {
|
|
278
|
+
throw new runtime.RequiredError(
|
|
279
|
+
'contentId',
|
|
280
|
+
'Required parameter "contentId" was null or undefined when calling getContentVersion().'
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (requestParameters['moduleId'] == null) {
|
|
285
|
+
throw new runtime.RequiredError(
|
|
286
|
+
'moduleId',
|
|
287
|
+
'Required parameter "moduleId" was null or undefined when calling getContentVersion().'
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (requestParameters['courseId'] == null) {
|
|
292
|
+
throw new runtime.RequiredError(
|
|
293
|
+
'courseId',
|
|
294
|
+
'Required parameter "courseId" was null or undefined when calling getContentVersion().'
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (requestParameters['versionId'] == null) {
|
|
299
|
+
throw new runtime.RequiredError(
|
|
300
|
+
'versionId',
|
|
301
|
+
'Required parameter "versionId" was null or undefined when calling getContentVersion().'
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const queryParameters: any = {};
|
|
306
|
+
|
|
307
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
308
|
+
|
|
309
|
+
const response = await this.request({
|
|
310
|
+
path: `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/versions/{versionId}`.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId']))).replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId']))).replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
|
|
311
|
+
method: 'GET',
|
|
312
|
+
headers: headerParameters,
|
|
313
|
+
query: queryParameters,
|
|
314
|
+
}, initOverrides);
|
|
315
|
+
|
|
316
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetContentVersionFromJSON(jsonValue));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Returns detailed information about a specific version of the content, including sandbox launch URL and SCORM-specific data (package info and table of contents) if applicable.
|
|
321
|
+
* Get details of a specific content version
|
|
322
|
+
*/
|
|
323
|
+
async getContentVersion(requestParameters: GetContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentVersion> {
|
|
324
|
+
const response = await this.getContentVersionRaw(requestParameters, initOverrides);
|
|
325
|
+
return await response.value();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Returns a paginated list of all versions for the specified content. Returns an empty array if the content has no versions.
|
|
330
|
+
* Get all versions of a content
|
|
331
|
+
*/
|
|
332
|
+
async getContentVersionListRaw(requestParameters: GetContentVersionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentVersionList>> {
|
|
333
|
+
if (requestParameters['contentId'] == null) {
|
|
334
|
+
throw new runtime.RequiredError(
|
|
335
|
+
'contentId',
|
|
336
|
+
'Required parameter "contentId" was null or undefined when calling getContentVersionList().'
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (requestParameters['moduleId'] == null) {
|
|
341
|
+
throw new runtime.RequiredError(
|
|
342
|
+
'moduleId',
|
|
343
|
+
'Required parameter "moduleId" was null or undefined when calling getContentVersionList().'
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (requestParameters['courseId'] == null) {
|
|
348
|
+
throw new runtime.RequiredError(
|
|
349
|
+
'courseId',
|
|
350
|
+
'Required parameter "courseId" was null or undefined when calling getContentVersionList().'
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const queryParameters: any = {};
|
|
355
|
+
|
|
356
|
+
if (requestParameters['page'] != null) {
|
|
357
|
+
queryParameters['page'] = requestParameters['page'];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (requestParameters['pageSize'] != null) {
|
|
361
|
+
queryParameters['page_size'] = requestParameters['pageSize'];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
365
|
+
|
|
366
|
+
const response = await this.request({
|
|
367
|
+
path: `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/versions`.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId']))).replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId']))).replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))),
|
|
368
|
+
method: 'GET',
|
|
369
|
+
headers: headerParameters,
|
|
370
|
+
query: queryParameters,
|
|
371
|
+
}, initOverrides);
|
|
372
|
+
|
|
373
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetContentVersionListFromJSON(jsonValue));
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Returns a paginated list of all versions for the specified content. Returns an empty array if the content has no versions.
|
|
378
|
+
* Get all versions of a content
|
|
379
|
+
*/
|
|
380
|
+
async getContentVersionList(requestParameters: GetContentVersionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentVersionList> {
|
|
381
|
+
const response = await this.getContentVersionListRaw(requestParameters, initOverrides);
|
|
382
|
+
return await response.value();
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Returns package information and table of contents for a SCORM package
|
|
387
|
+
* Get details of a SCORM package
|
|
388
|
+
*/
|
|
389
|
+
async getScormPackageRaw(requestParameters: GetScormPackageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetScormPackage>> {
|
|
390
|
+
if (requestParameters['packageId'] == null) {
|
|
391
|
+
throw new runtime.RequiredError(
|
|
392
|
+
'packageId',
|
|
393
|
+
'Required parameter "packageId" was null or undefined when calling getScormPackage().'
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const queryParameters: any = {};
|
|
398
|
+
|
|
399
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
400
|
+
|
|
401
|
+
const response = await this.request({
|
|
402
|
+
path: `/scorm/packages/{packageId}`.replace(`{${"packageId"}}`, encodeURIComponent(String(requestParameters['packageId']))),
|
|
403
|
+
method: 'GET',
|
|
404
|
+
headers: headerParameters,
|
|
405
|
+
query: queryParameters,
|
|
406
|
+
}, initOverrides);
|
|
407
|
+
|
|
408
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetScormPackageFromJSON(jsonValue));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Returns package information and table of contents for a SCORM package
|
|
413
|
+
* Get details of a SCORM package
|
|
414
|
+
*/
|
|
415
|
+
async getScormPackage(requestParameters: GetScormPackageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetScormPackage> {
|
|
416
|
+
const response = await this.getScormPackageRaw(requestParameters, initOverrides);
|
|
417
|
+
return await response.value();
|
|
418
|
+
}
|
|
419
|
+
|
|
233
420
|
/**
|
|
234
421
|
* Post a new content process
|
|
235
422
|
*/
|
|
@@ -483,4 +670,70 @@ export class ContentApi extends runtime.BaseAPI {
|
|
|
483
670
|
return await response.value();
|
|
484
671
|
}
|
|
485
672
|
|
|
673
|
+
/**
|
|
674
|
+
* Activates this version by setting is_active to true. Automatically deactivates all other versions of the same content. Only setting is_active to true is allowed.
|
|
675
|
+
* Update a content version
|
|
676
|
+
*/
|
|
677
|
+
async putContentVersionRaw(requestParameters: PutContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentVersion>> {
|
|
678
|
+
if (requestParameters['contentId'] == null) {
|
|
679
|
+
throw new runtime.RequiredError(
|
|
680
|
+
'contentId',
|
|
681
|
+
'Required parameter "contentId" was null or undefined when calling putContentVersion().'
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
if (requestParameters['moduleId'] == null) {
|
|
686
|
+
throw new runtime.RequiredError(
|
|
687
|
+
'moduleId',
|
|
688
|
+
'Required parameter "moduleId" was null or undefined when calling putContentVersion().'
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
if (requestParameters['courseId'] == null) {
|
|
693
|
+
throw new runtime.RequiredError(
|
|
694
|
+
'courseId',
|
|
695
|
+
'Required parameter "courseId" was null or undefined when calling putContentVersion().'
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if (requestParameters['versionId'] == null) {
|
|
700
|
+
throw new runtime.RequiredError(
|
|
701
|
+
'versionId',
|
|
702
|
+
'Required parameter "versionId" was null or undefined when calling putContentVersion().'
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
if (requestParameters['putContentVersion'] == null) {
|
|
707
|
+
throw new runtime.RequiredError(
|
|
708
|
+
'putContentVersion',
|
|
709
|
+
'Required parameter "putContentVersion" was null or undefined when calling putContentVersion().'
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
const queryParameters: any = {};
|
|
714
|
+
|
|
715
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
716
|
+
|
|
717
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
718
|
+
|
|
719
|
+
const response = await this.request({
|
|
720
|
+
path: `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/versions/{versionId}`.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId']))).replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId']))).replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
|
|
721
|
+
method: 'PUT',
|
|
722
|
+
headers: headerParameters,
|
|
723
|
+
query: queryParameters,
|
|
724
|
+
body: PutContentVersionToJSON(requestParameters['putContentVersion']),
|
|
725
|
+
}, initOverrides);
|
|
726
|
+
|
|
727
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetContentVersionFromJSON(jsonValue));
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Activates this version by setting is_active to true. Automatically deactivates all other versions of the same content. Only setting is_active to true is allowed.
|
|
732
|
+
* Update a content version
|
|
733
|
+
*/
|
|
734
|
+
async putContentVersion(requestParameters: PutContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentVersion> {
|
|
735
|
+
const response = await this.putContentVersionRaw(requestParameters, initOverrides);
|
|
736
|
+
return await response.value();
|
|
737
|
+
}
|
|
738
|
+
|
|
486
739
|
}
|
package/src/apis/CourseApi.ts
CHANGED
|
@@ -18,10 +18,13 @@ import type {
|
|
|
18
18
|
GetCourse,
|
|
19
19
|
GetCourseEnrollment,
|
|
20
20
|
GetCourseEnrollmentList,
|
|
21
|
+
GetCourseExport,
|
|
22
|
+
GetCourseExportList,
|
|
21
23
|
GetCourseList,
|
|
22
24
|
GetCourseReportingBasic,
|
|
23
25
|
PostCourse,
|
|
24
26
|
PostCourseEnrollment,
|
|
27
|
+
PostCourseExport,
|
|
25
28
|
PutCourse,
|
|
26
29
|
PutCourseEnrollment,
|
|
27
30
|
} from '../models/index';
|
|
@@ -32,6 +35,10 @@ import {
|
|
|
32
35
|
GetCourseEnrollmentToJSON,
|
|
33
36
|
GetCourseEnrollmentListFromJSON,
|
|
34
37
|
GetCourseEnrollmentListToJSON,
|
|
38
|
+
GetCourseExportFromJSON,
|
|
39
|
+
GetCourseExportToJSON,
|
|
40
|
+
GetCourseExportListFromJSON,
|
|
41
|
+
GetCourseExportListToJSON,
|
|
35
42
|
GetCourseListFromJSON,
|
|
36
43
|
GetCourseListToJSON,
|
|
37
44
|
GetCourseReportingBasicFromJSON,
|
|
@@ -40,6 +47,8 @@ import {
|
|
|
40
47
|
PostCourseToJSON,
|
|
41
48
|
PostCourseEnrollmentFromJSON,
|
|
42
49
|
PostCourseEnrollmentToJSON,
|
|
50
|
+
PostCourseExportFromJSON,
|
|
51
|
+
PostCourseExportToJSON,
|
|
43
52
|
PutCourseFromJSON,
|
|
44
53
|
PutCourseToJSON,
|
|
45
54
|
PutCourseEnrollmentFromJSON,
|
|
@@ -62,6 +71,17 @@ export interface GetCourseEnrollmentsRequest {
|
|
|
62
71
|
pageSize?: number;
|
|
63
72
|
}
|
|
64
73
|
|
|
74
|
+
export interface GetCourseExportRequest {
|
|
75
|
+
courseId: string;
|
|
76
|
+
exportId: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface GetCourseExportsRequest {
|
|
80
|
+
courseId: string;
|
|
81
|
+
page?: number;
|
|
82
|
+
pageSize?: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
65
85
|
export interface GetCourseListRequest {
|
|
66
86
|
enrolled?: boolean;
|
|
67
87
|
}
|
|
@@ -79,6 +99,11 @@ export interface PostCourseEnrollmentRequest {
|
|
|
79
99
|
postCourseEnrollment: PostCourseEnrollment;
|
|
80
100
|
}
|
|
81
101
|
|
|
102
|
+
export interface PostCourseExportRequest {
|
|
103
|
+
courseId: string;
|
|
104
|
+
postCourseExport: PostCourseExport;
|
|
105
|
+
}
|
|
106
|
+
|
|
82
107
|
export interface PutCourseRequest {
|
|
83
108
|
courseId: string;
|
|
84
109
|
putCourse: Omit<PutCourse, 'id'>;
|
|
@@ -213,6 +238,87 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
213
238
|
return await response.value();
|
|
214
239
|
}
|
|
215
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Get details of a specific SCORM export
|
|
243
|
+
*/
|
|
244
|
+
async getCourseExportRaw(requestParameters: GetCourseExportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseExport>> {
|
|
245
|
+
if (requestParameters['courseId'] == null) {
|
|
246
|
+
throw new runtime.RequiredError(
|
|
247
|
+
'courseId',
|
|
248
|
+
'Required parameter "courseId" was null or undefined when calling getCourseExport().'
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (requestParameters['exportId'] == null) {
|
|
253
|
+
throw new runtime.RequiredError(
|
|
254
|
+
'exportId',
|
|
255
|
+
'Required parameter "exportId" was null or undefined when calling getCourseExport().'
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const queryParameters: any = {};
|
|
260
|
+
|
|
261
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
262
|
+
|
|
263
|
+
const response = await this.request({
|
|
264
|
+
path: `/courses/{courseId}/exports/{exportId}`.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))).replace(`{${"exportId"}}`, encodeURIComponent(String(requestParameters['exportId']))),
|
|
265
|
+
method: 'GET',
|
|
266
|
+
headers: headerParameters,
|
|
267
|
+
query: queryParameters,
|
|
268
|
+
}, initOverrides);
|
|
269
|
+
|
|
270
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseExportFromJSON(jsonValue));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Get details of a specific SCORM export
|
|
275
|
+
*/
|
|
276
|
+
async getCourseExport(requestParameters: GetCourseExportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseExport> {
|
|
277
|
+
const response = await this.getCourseExportRaw(requestParameters, initOverrides);
|
|
278
|
+
return await response.value();
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* List all SCORM exports for a course
|
|
283
|
+
*/
|
|
284
|
+
async getCourseExportsRaw(requestParameters: GetCourseExportsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseExportList>> {
|
|
285
|
+
if (requestParameters['courseId'] == null) {
|
|
286
|
+
throw new runtime.RequiredError(
|
|
287
|
+
'courseId',
|
|
288
|
+
'Required parameter "courseId" was null or undefined when calling getCourseExports().'
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
const queryParameters: any = {};
|
|
293
|
+
|
|
294
|
+
if (requestParameters['page'] != null) {
|
|
295
|
+
queryParameters['page'] = requestParameters['page'];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (requestParameters['pageSize'] != null) {
|
|
299
|
+
queryParameters['page_size'] = requestParameters['pageSize'];
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
303
|
+
|
|
304
|
+
const response = await this.request({
|
|
305
|
+
path: `/courses/{courseId}/exports`.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))),
|
|
306
|
+
method: 'GET',
|
|
307
|
+
headers: headerParameters,
|
|
308
|
+
query: queryParameters,
|
|
309
|
+
}, initOverrides);
|
|
310
|
+
|
|
311
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseExportListFromJSON(jsonValue));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* List all SCORM exports for a course
|
|
316
|
+
*/
|
|
317
|
+
async getCourseExports(requestParameters: GetCourseExportsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseExportList> {
|
|
318
|
+
const response = await this.getCourseExportsRaw(requestParameters, initOverrides);
|
|
319
|
+
return await response.value();
|
|
320
|
+
}
|
|
321
|
+
|
|
216
322
|
/**
|
|
217
323
|
* get course list
|
|
218
324
|
*/
|
|
@@ -355,6 +461,51 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
355
461
|
return await response.value();
|
|
356
462
|
}
|
|
357
463
|
|
|
464
|
+
/**
|
|
465
|
+
* Enqueues a job to generate a SCORM export package for the course. Returns immediately with PENDING status. **NOTES:** - This endpoint enqueues a background job to generate the SCORM package - Actual SCORM package generation is not yet implemented (TODO) - Export metadata should be persisted to a database table (TODO) - Poll GET /courses/{courseId}/exports/{exportId} to check status - Download URL will be available when status becomes COMPLETED
|
|
466
|
+
* Create a new SCORM export for a course
|
|
467
|
+
*/
|
|
468
|
+
async postCourseExportRaw(requestParameters: PostCourseExportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseExport>> {
|
|
469
|
+
if (requestParameters['courseId'] == null) {
|
|
470
|
+
throw new runtime.RequiredError(
|
|
471
|
+
'courseId',
|
|
472
|
+
'Required parameter "courseId" was null or undefined when calling postCourseExport().'
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (requestParameters['postCourseExport'] == null) {
|
|
477
|
+
throw new runtime.RequiredError(
|
|
478
|
+
'postCourseExport',
|
|
479
|
+
'Required parameter "postCourseExport" was null or undefined when calling postCourseExport().'
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
const queryParameters: any = {};
|
|
484
|
+
|
|
485
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
486
|
+
|
|
487
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
488
|
+
|
|
489
|
+
const response = await this.request({
|
|
490
|
+
path: `/courses/{courseId}/exports`.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))),
|
|
491
|
+
method: 'POST',
|
|
492
|
+
headers: headerParameters,
|
|
493
|
+
query: queryParameters,
|
|
494
|
+
body: PostCourseExportToJSON(requestParameters['postCourseExport']),
|
|
495
|
+
}, initOverrides);
|
|
496
|
+
|
|
497
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseExportFromJSON(jsonValue));
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Enqueues a job to generate a SCORM export package for the course. Returns immediately with PENDING status. **NOTES:** - This endpoint enqueues a background job to generate the SCORM package - Actual SCORM package generation is not yet implemented (TODO) - Export metadata should be persisted to a database table (TODO) - Poll GET /courses/{courseId}/exports/{exportId} to check status - Download URL will be available when status becomes COMPLETED
|
|
502
|
+
* Create a new SCORM export for a course
|
|
503
|
+
*/
|
|
504
|
+
async postCourseExport(requestParameters: PostCourseExportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseExport> {
|
|
505
|
+
const response = await this.postCourseExportRaw(requestParameters, initOverrides);
|
|
506
|
+
return await response.value();
|
|
507
|
+
}
|
|
508
|
+
|
|
358
509
|
/**
|
|
359
510
|
* Update a course by id
|
|
360
511
|
*/
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* LMS API
|
|
5
|
+
* LMS API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { GetContentVersionSandbox } from './GetContentVersionSandbox';
|
|
17
|
+
import {
|
|
18
|
+
GetContentVersionSandboxFromJSON,
|
|
19
|
+
GetContentVersionSandboxFromJSONTyped,
|
|
20
|
+
GetContentVersionSandboxToJSON,
|
|
21
|
+
GetContentVersionSandboxToJSONTyped,
|
|
22
|
+
} from './GetContentVersionSandbox';
|
|
23
|
+
import type { GetContentVersionScormData } from './GetContentVersionScormData';
|
|
24
|
+
import {
|
|
25
|
+
GetContentVersionScormDataFromJSON,
|
|
26
|
+
GetContentVersionScormDataFromJSONTyped,
|
|
27
|
+
GetContentVersionScormDataToJSON,
|
|
28
|
+
GetContentVersionScormDataToJSONTyped,
|
|
29
|
+
} from './GetContentVersionScormData';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Details of a specific content version
|
|
33
|
+
* @export
|
|
34
|
+
* @interface GetContentVersion
|
|
35
|
+
*/
|
|
36
|
+
export interface GetContentVersion {
|
|
37
|
+
/**
|
|
38
|
+
* The external_id (UUID) for this version
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof GetContentVersion
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* The content's external_id that this version belongs to
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @memberof GetContentVersion
|
|
47
|
+
*/
|
|
48
|
+
contentId: string;
|
|
49
|
+
/**
|
|
50
|
+
* Version number
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof GetContentVersion
|
|
53
|
+
*/
|
|
54
|
+
version: number;
|
|
55
|
+
/**
|
|
56
|
+
* Whether this is the currently active version
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
* @memberof GetContentVersion
|
|
59
|
+
*/
|
|
60
|
+
isActive: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* When this version was created
|
|
63
|
+
* @type {Date}
|
|
64
|
+
* @memberof GetContentVersion
|
|
65
|
+
*/
|
|
66
|
+
createdAt: Date;
|
|
67
|
+
/**
|
|
68
|
+
* When this version was last updated
|
|
69
|
+
* @type {Date}
|
|
70
|
+
* @memberof GetContentVersion
|
|
71
|
+
*/
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {GetContentVersionSandbox}
|
|
76
|
+
* @memberof GetContentVersion
|
|
77
|
+
*/
|
|
78
|
+
sandbox: GetContentVersionSandbox;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @type {GetContentVersionScormData}
|
|
82
|
+
* @memberof GetContentVersion
|
|
83
|
+
*/
|
|
84
|
+
scormData?: GetContentVersionScormData | null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Check if a given object implements the GetContentVersion interface.
|
|
89
|
+
*/
|
|
90
|
+
export function instanceOfGetContentVersion(value: object): value is GetContentVersion {
|
|
91
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
92
|
+
if (!('contentId' in value) || value['contentId'] === undefined) return false;
|
|
93
|
+
if (!('version' in value) || value['version'] === undefined) return false;
|
|
94
|
+
if (!('isActive' in value) || value['isActive'] === undefined) return false;
|
|
95
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
96
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
97
|
+
if (!('sandbox' in value) || value['sandbox'] === undefined) return false;
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function GetContentVersionFromJSON(json: any): GetContentVersion {
|
|
102
|
+
return GetContentVersionFromJSONTyped(json, false);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function GetContentVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetContentVersion {
|
|
106
|
+
if (json == null) {
|
|
107
|
+
return json;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
|
|
111
|
+
'id': json['id'],
|
|
112
|
+
'contentId': json['content_id'],
|
|
113
|
+
'version': json['version'],
|
|
114
|
+
'isActive': json['is_active'],
|
|
115
|
+
'createdAt': (new Date(json['created_at'])),
|
|
116
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
117
|
+
'sandbox': GetContentVersionSandboxFromJSON(json['sandbox']),
|
|
118
|
+
'scormData': json['scorm_data'] == null ? undefined : GetContentVersionScormDataFromJSON(json['scorm_data']),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function GetContentVersionToJSON(json: any): GetContentVersion {
|
|
123
|
+
return GetContentVersionToJSONTyped(json, false);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function GetContentVersionToJSONTyped(value?: GetContentVersion | null, ignoreDiscriminator: boolean = false): any {
|
|
127
|
+
if (value == null) {
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
|
|
133
|
+
'id': value['id'],
|
|
134
|
+
'content_id': value['contentId'],
|
|
135
|
+
'version': value['version'],
|
|
136
|
+
'is_active': value['isActive'],
|
|
137
|
+
'created_at': ((value['createdAt']).toISOString()),
|
|
138
|
+
'updated_at': ((value['updatedAt']).toISOString()),
|
|
139
|
+
'sandbox': GetContentVersionSandboxToJSON(value['sandbox']),
|
|
140
|
+
'scorm_data': GetContentVersionScormDataToJSON(value['scormData']),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|