@easyedu/js-lsm-api 1.25.0 → 1.26.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 +3 -0
- package/README.md +2 -2
- package/dist/apis/CourseApi.d.ts +40 -1
- package/dist/apis/CourseApi.js +100 -0
- package/dist/esm/apis/CourseApi.d.ts +40 -1
- package/dist/esm/apis/CourseApi.js +101 -1
- 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/PostCourseExport.d.ts +41 -0
- package/dist/esm/models/PostCourseExport.js +51 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -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/PostCourseExport.d.ts +41 -0
- package/dist/models/PostCourseExport.js +59 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/package.json +1 -1
- package/src/apis/CourseApi.ts +151 -0
- package/src/models/GetCourseExport.ts +149 -0
- package/src/models/GetCourseExportList.ts +110 -0
- package/src/models/PostCourseExport.ts +78 -0
- package/src/models/index.ts +3 -0
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,149 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Details of a course SCORM export
|
|
18
|
+
* @export
|
|
19
|
+
* @interface GetCourseExport
|
|
20
|
+
*/
|
|
21
|
+
export interface GetCourseExport {
|
|
22
|
+
/**
|
|
23
|
+
* Unique identifier for the export
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof GetCourseExport
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* ID of the course being exported
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof GetCourseExport
|
|
32
|
+
*/
|
|
33
|
+
courseId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The SCORM version to export
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof GetCourseExport
|
|
38
|
+
*/
|
|
39
|
+
scormVersion: GetCourseExportScormVersionEnum;
|
|
40
|
+
/**
|
|
41
|
+
* Current status of the export generation
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof GetCourseExport
|
|
44
|
+
*/
|
|
45
|
+
status: GetCourseExportStatusEnum;
|
|
46
|
+
/**
|
|
47
|
+
* URL to download the export zip file (null if not yet completed)
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof GetCourseExport
|
|
50
|
+
*/
|
|
51
|
+
downloadUrl?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Size of the export file in bytes (null if not yet completed)
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof GetCourseExport
|
|
56
|
+
*/
|
|
57
|
+
fileSize?: number | null;
|
|
58
|
+
/**
|
|
59
|
+
* Error message if status is FAILED
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @memberof GetCourseExport
|
|
62
|
+
*/
|
|
63
|
+
errorMessage?: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Unix epoch timestamp when the export was created
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @memberof GetCourseExport
|
|
68
|
+
*/
|
|
69
|
+
createdAt: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @export
|
|
75
|
+
*/
|
|
76
|
+
export const GetCourseExportScormVersionEnum = {
|
|
77
|
+
Scorm12: 'SCORM_1_2',
|
|
78
|
+
Scorm20043RdEdition: 'SCORM_2004_3RD_EDITION',
|
|
79
|
+
Scorm20044ThEdition: 'SCORM_2004_4TH_EDITION'
|
|
80
|
+
} as const;
|
|
81
|
+
export type GetCourseExportScormVersionEnum = typeof GetCourseExportScormVersionEnum[keyof typeof GetCourseExportScormVersionEnum];
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @export
|
|
85
|
+
*/
|
|
86
|
+
export const GetCourseExportStatusEnum = {
|
|
87
|
+
Pending: 'PENDING',
|
|
88
|
+
Processing: 'PROCESSING',
|
|
89
|
+
Completed: 'COMPLETED',
|
|
90
|
+
Failed: 'FAILED'
|
|
91
|
+
} as const;
|
|
92
|
+
export type GetCourseExportStatusEnum = typeof GetCourseExportStatusEnum[keyof typeof GetCourseExportStatusEnum];
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Check if a given object implements the GetCourseExport interface.
|
|
97
|
+
*/
|
|
98
|
+
export function instanceOfGetCourseExport(value: object): value is GetCourseExport {
|
|
99
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
100
|
+
if (!('courseId' in value) || value['courseId'] === undefined) return false;
|
|
101
|
+
if (!('scormVersion' in value) || value['scormVersion'] === undefined) return false;
|
|
102
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
103
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function GetCourseExportFromJSON(json: any): GetCourseExport {
|
|
108
|
+
return GetCourseExportFromJSONTyped(json, false);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function GetCourseExportFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCourseExport {
|
|
112
|
+
if (json == null) {
|
|
113
|
+
return json;
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
|
|
117
|
+
'id': json['id'],
|
|
118
|
+
'courseId': json['course_id'],
|
|
119
|
+
'scormVersion': json['scorm_version'],
|
|
120
|
+
'status': json['status'],
|
|
121
|
+
'downloadUrl': json['download_url'] == null ? undefined : json['download_url'],
|
|
122
|
+
'fileSize': json['file_size'] == null ? undefined : json['file_size'],
|
|
123
|
+
'errorMessage': json['error_message'] == null ? undefined : json['error_message'],
|
|
124
|
+
'createdAt': json['created_at'],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function GetCourseExportToJSON(json: any): GetCourseExport {
|
|
129
|
+
return GetCourseExportToJSONTyped(json, false);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export function GetCourseExportToJSONTyped(value?: GetCourseExport | null, ignoreDiscriminator: boolean = false): any {
|
|
133
|
+
if (value == null) {
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
|
|
139
|
+
'id': value['id'],
|
|
140
|
+
'course_id': value['courseId'],
|
|
141
|
+
'scorm_version': value['scormVersion'],
|
|
142
|
+
'status': value['status'],
|
|
143
|
+
'download_url': value['downloadUrl'],
|
|
144
|
+
'file_size': value['fileSize'],
|
|
145
|
+
'error_message': value['errorMessage'],
|
|
146
|
+
'created_at': value['createdAt'],
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
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 { GetCourseExport } from './GetCourseExport';
|
|
17
|
+
import {
|
|
18
|
+
GetCourseExportFromJSON,
|
|
19
|
+
GetCourseExportFromJSONTyped,
|
|
20
|
+
GetCourseExportToJSON,
|
|
21
|
+
GetCourseExportToJSONTyped,
|
|
22
|
+
} from './GetCourseExport';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A list of course exports with pagination information
|
|
26
|
+
* @export
|
|
27
|
+
* @interface GetCourseExportList
|
|
28
|
+
*/
|
|
29
|
+
export interface GetCourseExportList {
|
|
30
|
+
/**
|
|
31
|
+
* The current page number
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof GetCourseExportList
|
|
34
|
+
*/
|
|
35
|
+
page: number;
|
|
36
|
+
/**
|
|
37
|
+
* The number of items per page
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof GetCourseExportList
|
|
40
|
+
*/
|
|
41
|
+
pageSize: number;
|
|
42
|
+
/**
|
|
43
|
+
* The total number of pages
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof GetCourseExportList
|
|
46
|
+
*/
|
|
47
|
+
totalPages: number;
|
|
48
|
+
/**
|
|
49
|
+
* The total number of items
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof GetCourseExportList
|
|
52
|
+
*/
|
|
53
|
+
totalItems: number;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {Array<GetCourseExport>}
|
|
57
|
+
* @memberof GetCourseExportList
|
|
58
|
+
*/
|
|
59
|
+
items: Array<GetCourseExport>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the GetCourseExportList interface.
|
|
64
|
+
*/
|
|
65
|
+
export function instanceOfGetCourseExportList(value: object): value is GetCourseExportList {
|
|
66
|
+
if (!('page' in value) || value['page'] === undefined) return false;
|
|
67
|
+
if (!('pageSize' in value) || value['pageSize'] === undefined) return false;
|
|
68
|
+
if (!('totalPages' in value) || value['totalPages'] === undefined) return false;
|
|
69
|
+
if (!('totalItems' in value) || value['totalItems'] === undefined) return false;
|
|
70
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function GetCourseExportListFromJSON(json: any): GetCourseExportList {
|
|
75
|
+
return GetCourseExportListFromJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function GetCourseExportListFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetCourseExportList {
|
|
79
|
+
if (json == null) {
|
|
80
|
+
return json;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'page': json['page'],
|
|
85
|
+
'pageSize': json['page_size'],
|
|
86
|
+
'totalPages': json['total_pages'],
|
|
87
|
+
'totalItems': json['total_items'],
|
|
88
|
+
'items': ((json['items'] as Array<any>).map(GetCourseExportFromJSON)),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function GetCourseExportListToJSON(json: any): GetCourseExportList {
|
|
93
|
+
return GetCourseExportListToJSONTyped(json, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function GetCourseExportListToJSONTyped(value?: GetCourseExportList | null, ignoreDiscriminator: boolean = false): any {
|
|
97
|
+
if (value == null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
|
|
103
|
+
'page': value['page'],
|
|
104
|
+
'page_size': value['pageSize'],
|
|
105
|
+
'total_pages': value['totalPages'],
|
|
106
|
+
'total_items': value['totalItems'],
|
|
107
|
+
'items': ((value['items'] as Array<any>).map(GetCourseExportToJSON)),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Request to create a new SCORM export for a course
|
|
18
|
+
* @export
|
|
19
|
+
* @interface PostCourseExport
|
|
20
|
+
*/
|
|
21
|
+
export interface PostCourseExport {
|
|
22
|
+
/**
|
|
23
|
+
* The SCORM version to export
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof PostCourseExport
|
|
26
|
+
*/
|
|
27
|
+
scormVersion: PostCourseExportScormVersionEnum;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @export
|
|
33
|
+
*/
|
|
34
|
+
export const PostCourseExportScormVersionEnum = {
|
|
35
|
+
Scorm12: 'SCORM_1_2',
|
|
36
|
+
Scorm20043RdEdition: 'SCORM_2004_3RD_EDITION',
|
|
37
|
+
Scorm20044ThEdition: 'SCORM_2004_4TH_EDITION'
|
|
38
|
+
} as const;
|
|
39
|
+
export type PostCourseExportScormVersionEnum = typeof PostCourseExportScormVersionEnum[keyof typeof PostCourseExportScormVersionEnum];
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Check if a given object implements the PostCourseExport interface.
|
|
44
|
+
*/
|
|
45
|
+
export function instanceOfPostCourseExport(value: object): value is PostCourseExport {
|
|
46
|
+
if (!('scormVersion' in value) || value['scormVersion'] === undefined) return false;
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function PostCourseExportFromJSON(json: any): PostCourseExport {
|
|
51
|
+
return PostCourseExportFromJSONTyped(json, false);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function PostCourseExportFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostCourseExport {
|
|
55
|
+
if (json == null) {
|
|
56
|
+
return json;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
|
|
60
|
+
'scormVersion': json['scorm_version'],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function PostCourseExportToJSON(json: any): PostCourseExport {
|
|
65
|
+
return PostCourseExportToJSONTyped(json, false);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function PostCourseExportToJSONTyped(value?: PostCourseExport | null, ignoreDiscriminator: boolean = false): any {
|
|
69
|
+
if (value == null) {
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
|
|
75
|
+
'scorm_version': value['scormVersion'],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -22,6 +22,8 @@ export * from './GetCourse';
|
|
|
22
22
|
export * from './GetCourseEnrollment';
|
|
23
23
|
export * from './GetCourseEnrollmentList';
|
|
24
24
|
export * from './GetCourseEnrollmentListItem';
|
|
25
|
+
export * from './GetCourseExport';
|
|
26
|
+
export * from './GetCourseExportList';
|
|
25
27
|
export * from './GetCourseList';
|
|
26
28
|
export * from './GetCourseReportingBasic';
|
|
27
29
|
export * from './GetCourseStudentReporting';
|
|
@@ -121,6 +123,7 @@ export * from './PostContentSession';
|
|
|
121
123
|
export * from './PostContentUpload';
|
|
122
124
|
export * from './PostCourse';
|
|
123
125
|
export * from './PostCourseEnrollment';
|
|
126
|
+
export * from './PostCourseExport';
|
|
124
127
|
export * from './PostLogin';
|
|
125
128
|
export * from './PostManualQuestionSelection';
|
|
126
129
|
export * from './PostModule';
|