@easyedu/js-lsm-api 1.8.0 → 1.9.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 +1 -0
- package/README.md +2 -2
- package/dist/apis/CourseApi.d.ts +21 -8
- package/dist/apis/CourseApi.js +46 -10
- package/dist/esm/apis/CourseApi.d.ts +21 -8
- package/dist/esm/apis/CourseApi.js +47 -11
- package/dist/esm/models/GetCourseEnrollment.d.ts +9 -5
- package/dist/esm/models/GetCourseEnrollment.js +5 -3
- package/dist/esm/models/PostContentSession.d.ts +6 -0
- package/dist/esm/models/PostContentSession.js +2 -0
- package/dist/esm/models/PostCourseEnrollment.d.ts +13 -7
- package/dist/esm/models/PostCourseEnrollment.js +4 -4
- package/dist/esm/models/PutCourseEnrollment.d.ts +53 -0
- package/dist/esm/models/PutCourseEnrollment.js +53 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/GetCourseEnrollment.d.ts +9 -5
- package/dist/models/GetCourseEnrollment.js +5 -3
- package/dist/models/PostContentSession.d.ts +6 -0
- package/dist/models/PostContentSession.js +2 -0
- package/dist/models/PostCourseEnrollment.d.ts +13 -7
- package/dist/models/PostCourseEnrollment.js +4 -4
- package/dist/models/PutCourseEnrollment.d.ts +53 -0
- package/dist/models/PutCourseEnrollment.js +61 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/package.json +1 -1
- package/src/apis/CourseApi.ts +70 -11
- package/src/models/GetCourseEnrollment.ts +12 -5
- package/src/models/PostContentSession.ts +8 -0
- package/src/models/PostCourseEnrollment.ts +17 -10
- package/src/models/PutCourseEnrollment.ts +93 -0
- package/src/models/index.ts +1 -0
|
@@ -112,6 +112,7 @@ export * from './PostResetPassword';
|
|
|
112
112
|
export * from './PostSendResetPassword';
|
|
113
113
|
export * from './PutContent';
|
|
114
114
|
export * from './PutCourse';
|
|
115
|
+
export * from './PutCourseEnrollment';
|
|
115
116
|
export * from './PutModule';
|
|
116
117
|
export * from './PutPortalBranding';
|
|
117
118
|
export * from './PutQuestion';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -114,6 +114,7 @@ export * from './PostResetPassword';
|
|
|
114
114
|
export * from './PostSendResetPassword';
|
|
115
115
|
export * from './PutContent';
|
|
116
116
|
export * from './PutCourse';
|
|
117
|
+
export * from './PutCourseEnrollment';
|
|
117
118
|
export * from './PutModule';
|
|
118
119
|
export * from './PutPortalBranding';
|
|
119
120
|
export * from './PutQuestion';
|
|
@@ -16,13 +16,19 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export interface GetCourseEnrollment {
|
|
18
18
|
/**
|
|
19
|
-
* The ID of the
|
|
19
|
+
* The external ID of the enrollment
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof GetCourseEnrollment
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* The external ID of the course
|
|
20
26
|
* @type {string}
|
|
21
27
|
* @memberof GetCourseEnrollment
|
|
22
28
|
*/
|
|
23
29
|
courseId: string;
|
|
24
30
|
/**
|
|
25
|
-
* The ID of the enrolled user
|
|
31
|
+
* The external ID of the enrolled user
|
|
26
32
|
* @type {string}
|
|
27
33
|
* @memberof GetCourseEnrollment
|
|
28
34
|
*/
|
|
@@ -63,10 +69,8 @@ export interface GetCourseEnrollment {
|
|
|
63
69
|
*/
|
|
64
70
|
export declare const GetCourseEnrollmentStatusEnum: {
|
|
65
71
|
readonly Enrolled: "Enrolled";
|
|
66
|
-
readonly Dropped: "Dropped";
|
|
67
72
|
readonly Completed: "Completed";
|
|
68
|
-
readonly
|
|
69
|
-
readonly Unknown: "Unknown";
|
|
73
|
+
readonly Removed: "Removed";
|
|
70
74
|
};
|
|
71
75
|
export type GetCourseEnrollmentStatusEnum = typeof GetCourseEnrollmentStatusEnum[keyof typeof GetCourseEnrollmentStatusEnum];
|
|
72
76
|
/**
|
|
@@ -24,15 +24,15 @@ exports.GetCourseEnrollmentToJSONTyped = GetCourseEnrollmentToJSONTyped;
|
|
|
24
24
|
*/
|
|
25
25
|
exports.GetCourseEnrollmentStatusEnum = {
|
|
26
26
|
Enrolled: 'Enrolled',
|
|
27
|
-
Dropped: 'Dropped',
|
|
28
27
|
Completed: 'Completed',
|
|
29
|
-
|
|
30
|
-
Unknown: 'Unknown'
|
|
28
|
+
Removed: 'Removed'
|
|
31
29
|
};
|
|
32
30
|
/**
|
|
33
31
|
* Check if a given object implements the GetCourseEnrollment interface.
|
|
34
32
|
*/
|
|
35
33
|
function instanceOfGetCourseEnrollment(value) {
|
|
34
|
+
if (!('id' in value) || value['id'] === undefined)
|
|
35
|
+
return false;
|
|
36
36
|
if (!('courseId' in value) || value['courseId'] === undefined)
|
|
37
37
|
return false;
|
|
38
38
|
if (!('userId' in value) || value['userId'] === undefined)
|
|
@@ -57,6 +57,7 @@ function GetCourseEnrollmentFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
57
57
|
return json;
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
|
+
'id': json['id'],
|
|
60
61
|
'courseId': json['course_id'],
|
|
61
62
|
'userId': json['user_id'],
|
|
62
63
|
'enrollmentDateStart': json['enrollment_date_start'],
|
|
@@ -74,6 +75,7 @@ function GetCourseEnrollmentToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
74
75
|
return value;
|
|
75
76
|
}
|
|
76
77
|
return {
|
|
78
|
+
'id': value['id'],
|
|
77
79
|
'course_id': value['courseId'],
|
|
78
80
|
'user_id': value['userId'],
|
|
79
81
|
'enrollment_date_start': value['enrollmentDateStart'],
|
|
@@ -39,6 +39,12 @@ export interface PostContentSession {
|
|
|
39
39
|
* @memberof PostContentSession
|
|
40
40
|
*/
|
|
41
41
|
createdAt: number;
|
|
42
|
+
/**
|
|
43
|
+
* The player session ID (used for SCORM, Quiz, and other interactive content). This is the external_id of the session that the player should use.
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof PostContentSession
|
|
46
|
+
*/
|
|
47
|
+
playerSessionId?: string | null;
|
|
42
48
|
}
|
|
43
49
|
/**
|
|
44
50
|
* Check if a given object implements the PostContentSession interface.
|
|
@@ -44,6 +44,7 @@ function PostContentSessionFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
44
44
|
'userId': json['user_id'],
|
|
45
45
|
'launchUrl': json['launch_url'],
|
|
46
46
|
'createdAt': json['created_at'],
|
|
47
|
+
'playerSessionId': json['player_session_id'] == null ? undefined : json['player_session_id'],
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
function PostContentSessionToJSON(json) {
|
|
@@ -58,5 +59,6 @@ function PostContentSessionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
58
59
|
'user_id': value['userId'],
|
|
59
60
|
'launch_url': value['launchUrl'],
|
|
60
61
|
'created_at': value['createdAt'],
|
|
62
|
+
'player_session_id': value['playerSessionId'],
|
|
61
63
|
};
|
|
62
64
|
}
|
|
@@ -16,23 +16,29 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export interface PostCourseEnrollment {
|
|
18
18
|
/**
|
|
19
|
-
* The ID of the
|
|
19
|
+
* The external ID of the user to enroll
|
|
20
20
|
* @type {string}
|
|
21
21
|
* @memberof PostCourseEnrollment
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
userId: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {
|
|
25
|
+
* Start date of the enrollment (Unix timestamp)
|
|
26
|
+
* @type {number}
|
|
27
27
|
* @memberof PostCourseEnrollment
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
enrollmentDateStart: number;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* End date of the enrollment (Unix timestamp)
|
|
32
32
|
* @type {number}
|
|
33
33
|
* @memberof PostCourseEnrollment
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
enrollmentDateEnd?: number | null;
|
|
36
|
+
/**
|
|
37
|
+
* Optional notes about the enrollment
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof PostCourseEnrollment
|
|
40
|
+
*/
|
|
41
|
+
notes?: string | null;
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* Check if a given object implements the PostCourseEnrollment interface.
|
|
@@ -22,8 +22,6 @@ exports.PostCourseEnrollmentToJSONTyped = PostCourseEnrollmentToJSONTyped;
|
|
|
22
22
|
* Check if a given object implements the PostCourseEnrollment interface.
|
|
23
23
|
*/
|
|
24
24
|
function instanceOfPostCourseEnrollment(value) {
|
|
25
|
-
if (!('courseId' in value) || value['courseId'] === undefined)
|
|
26
|
-
return false;
|
|
27
25
|
if (!('userId' in value) || value['userId'] === undefined)
|
|
28
26
|
return false;
|
|
29
27
|
if (!('enrollmentDateStart' in value) || value['enrollmentDateStart'] === undefined)
|
|
@@ -38,9 +36,10 @@ function PostCourseEnrollmentFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
38
36
|
return json;
|
|
39
37
|
}
|
|
40
38
|
return {
|
|
41
|
-
'courseId': json['course_id'],
|
|
42
39
|
'userId': json['user_id'],
|
|
43
40
|
'enrollmentDateStart': json['enrollment_date_start'],
|
|
41
|
+
'enrollmentDateEnd': json['enrollment_date_end'] == null ? undefined : json['enrollment_date_end'],
|
|
42
|
+
'notes': json['notes'] == null ? undefined : json['notes'],
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
function PostCourseEnrollmentToJSON(json) {
|
|
@@ -51,8 +50,9 @@ function PostCourseEnrollmentToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
51
50
|
return value;
|
|
52
51
|
}
|
|
53
52
|
return {
|
|
54
|
-
'course_id': value['courseId'],
|
|
55
53
|
'user_id': value['userId'],
|
|
56
54
|
'enrollment_date_start': value['enrollmentDateStart'],
|
|
55
|
+
'enrollment_date_end': value['enrollmentDateEnd'],
|
|
56
|
+
'notes': value['notes'],
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMS API
|
|
3
|
+
* LMS API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface PutCourseEnrollment
|
|
16
|
+
*/
|
|
17
|
+
export interface PutCourseEnrollment {
|
|
18
|
+
/**
|
|
19
|
+
* Current status of the enrollment
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof PutCourseEnrollment
|
|
22
|
+
*/
|
|
23
|
+
status?: PutCourseEnrollmentStatusEnum;
|
|
24
|
+
/**
|
|
25
|
+
* End date of the enrollment (Unix timestamp)
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof PutCourseEnrollment
|
|
28
|
+
*/
|
|
29
|
+
enrollmentDateEnd?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Optional notes about the enrollment
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof PutCourseEnrollment
|
|
34
|
+
*/
|
|
35
|
+
notes?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const PutCourseEnrollmentStatusEnum: {
|
|
41
|
+
readonly Enrolled: "Enrolled";
|
|
42
|
+
readonly Completed: "Completed";
|
|
43
|
+
readonly Removed: "Removed";
|
|
44
|
+
};
|
|
45
|
+
export type PutCourseEnrollmentStatusEnum = typeof PutCourseEnrollmentStatusEnum[keyof typeof PutCourseEnrollmentStatusEnum];
|
|
46
|
+
/**
|
|
47
|
+
* Check if a given object implements the PutCourseEnrollment interface.
|
|
48
|
+
*/
|
|
49
|
+
export declare function instanceOfPutCourseEnrollment(value: object): value is PutCourseEnrollment;
|
|
50
|
+
export declare function PutCourseEnrollmentFromJSON(json: any): PutCourseEnrollment;
|
|
51
|
+
export declare function PutCourseEnrollmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): PutCourseEnrollment;
|
|
52
|
+
export declare function PutCourseEnrollmentToJSON(json: any): PutCourseEnrollment;
|
|
53
|
+
export declare function PutCourseEnrollmentToJSONTyped(value?: PutCourseEnrollment | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* LMS API
|
|
6
|
+
* LMS API
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.PutCourseEnrollmentStatusEnum = void 0;
|
|
17
|
+
exports.instanceOfPutCourseEnrollment = instanceOfPutCourseEnrollment;
|
|
18
|
+
exports.PutCourseEnrollmentFromJSON = PutCourseEnrollmentFromJSON;
|
|
19
|
+
exports.PutCourseEnrollmentFromJSONTyped = PutCourseEnrollmentFromJSONTyped;
|
|
20
|
+
exports.PutCourseEnrollmentToJSON = PutCourseEnrollmentToJSON;
|
|
21
|
+
exports.PutCourseEnrollmentToJSONTyped = PutCourseEnrollmentToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
exports.PutCourseEnrollmentStatusEnum = {
|
|
26
|
+
Enrolled: 'Enrolled',
|
|
27
|
+
Completed: 'Completed',
|
|
28
|
+
Removed: 'Removed'
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the PutCourseEnrollment interface.
|
|
32
|
+
*/
|
|
33
|
+
function instanceOfPutCourseEnrollment(value) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
function PutCourseEnrollmentFromJSON(json) {
|
|
37
|
+
return PutCourseEnrollmentFromJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
function PutCourseEnrollmentFromJSONTyped(json, ignoreDiscriminator) {
|
|
40
|
+
if (json == null) {
|
|
41
|
+
return json;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
'status': json['status'] == null ? undefined : json['status'],
|
|
45
|
+
'enrollmentDateEnd': json['enrollment_date_end'] == null ? undefined : json['enrollment_date_end'],
|
|
46
|
+
'notes': json['notes'] == null ? undefined : json['notes'],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function PutCourseEnrollmentToJSON(json) {
|
|
50
|
+
return PutCourseEnrollmentToJSONTyped(json, false);
|
|
51
|
+
}
|
|
52
|
+
function PutCourseEnrollmentToJSONTyped(value, ignoreDiscriminator = false) {
|
|
53
|
+
if (value == null) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
'status': value['status'],
|
|
58
|
+
'enrollment_date_end': value['enrollmentDateEnd'],
|
|
59
|
+
'notes': value['notes'],
|
|
60
|
+
};
|
|
61
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export * from './PostResetPassword';
|
|
|
112
112
|
export * from './PostSendResetPassword';
|
|
113
113
|
export * from './PutContent';
|
|
114
114
|
export * from './PutCourse';
|
|
115
|
+
export * from './PutCourseEnrollment';
|
|
115
116
|
export * from './PutModule';
|
|
116
117
|
export * from './PutPortalBranding';
|
|
117
118
|
export * from './PutQuestion';
|
package/dist/models/index.js
CHANGED
|
@@ -130,6 +130,7 @@ __exportStar(require("./PostResetPassword"), exports);
|
|
|
130
130
|
__exportStar(require("./PostSendResetPassword"), exports);
|
|
131
131
|
__exportStar(require("./PutContent"), exports);
|
|
132
132
|
__exportStar(require("./PutCourse"), exports);
|
|
133
|
+
__exportStar(require("./PutCourseEnrollment"), exports);
|
|
133
134
|
__exportStar(require("./PutModule"), exports);
|
|
134
135
|
__exportStar(require("./PutPortalBranding"), exports);
|
|
135
136
|
__exportStar(require("./PutQuestion"), exports);
|
package/package.json
CHANGED
package/src/apis/CourseApi.ts
CHANGED
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
PostCourse,
|
|
23
23
|
PostCourseEnrollment,
|
|
24
24
|
PutCourse,
|
|
25
|
+
PutCourseEnrollment,
|
|
25
26
|
} from '../models/index';
|
|
26
27
|
import {
|
|
27
28
|
GetCourseFromJSON,
|
|
@@ -38,13 +39,15 @@ import {
|
|
|
38
39
|
PostCourseEnrollmentToJSON,
|
|
39
40
|
PutCourseFromJSON,
|
|
40
41
|
PutCourseToJSON,
|
|
42
|
+
PutCourseEnrollmentFromJSON,
|
|
43
|
+
PutCourseEnrollmentToJSON,
|
|
41
44
|
} from '../models/index';
|
|
42
45
|
|
|
43
46
|
export interface GetCourseRequest {
|
|
44
47
|
courseId: string;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
export interface
|
|
50
|
+
export interface GetCourseEnrollmentsRequest {
|
|
48
51
|
courseId: string;
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -62,6 +65,12 @@ export interface PutCourseRequest {
|
|
|
62
65
|
putCourse: Omit<PutCourse, 'id'>;
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
export interface PutCourseEnrollmentRequest {
|
|
69
|
+
courseId: string;
|
|
70
|
+
enrollmentId: string;
|
|
71
|
+
putCourseEnrollment: PutCourseEnrollment;
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
/**
|
|
66
75
|
*
|
|
67
76
|
*/
|
|
@@ -101,13 +110,13 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
/**
|
|
104
|
-
*
|
|
113
|
+
* Get course enrollments
|
|
105
114
|
*/
|
|
106
|
-
async
|
|
115
|
+
async getCourseEnrollmentsRaw(requestParameters: GetCourseEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseEnrollmentList>> {
|
|
107
116
|
if (requestParameters['courseId'] == null) {
|
|
108
117
|
throw new runtime.RequiredError(
|
|
109
118
|
'courseId',
|
|
110
|
-
'Required parameter "courseId" was null or undefined when calling
|
|
119
|
+
'Required parameter "courseId" was null or undefined when calling getCourseEnrollments().'
|
|
111
120
|
);
|
|
112
121
|
}
|
|
113
122
|
|
|
@@ -116,7 +125,7 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
116
125
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
117
126
|
|
|
118
127
|
const response = await this.request({
|
|
119
|
-
path: `/courses/{courseId}/
|
|
128
|
+
path: `/courses/{courseId}/enrollments`.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))),
|
|
120
129
|
method: 'GET',
|
|
121
130
|
headers: headerParameters,
|
|
122
131
|
query: queryParameters,
|
|
@@ -126,10 +135,10 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
/**
|
|
129
|
-
*
|
|
138
|
+
* Get course enrollments
|
|
130
139
|
*/
|
|
131
|
-
async
|
|
132
|
-
const response = await this.
|
|
140
|
+
async getCourseEnrollments(requestParameters: GetCourseEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseEnrollmentList> {
|
|
141
|
+
const response = await this.getCourseEnrollmentsRaw(requestParameters, initOverrides);
|
|
133
142
|
return await response.value();
|
|
134
143
|
}
|
|
135
144
|
|
|
@@ -196,7 +205,7 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
196
205
|
}
|
|
197
206
|
|
|
198
207
|
/**
|
|
199
|
-
*
|
|
208
|
+
* Create a new course enrollment
|
|
200
209
|
*/
|
|
201
210
|
async postCourseEnrollmentRaw(requestParameters: PostCourseEnrollmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseEnrollment>> {
|
|
202
211
|
if (requestParameters['courseId'] == null) {
|
|
@@ -220,7 +229,7 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
220
229
|
headerParameters['Content-Type'] = 'application/json';
|
|
221
230
|
|
|
222
231
|
const response = await this.request({
|
|
223
|
-
path: `/courses/{courseId}/
|
|
232
|
+
path: `/courses/{courseId}/enrollments`.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))),
|
|
224
233
|
method: 'POST',
|
|
225
234
|
headers: headerParameters,
|
|
226
235
|
query: queryParameters,
|
|
@@ -231,7 +240,7 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
231
240
|
}
|
|
232
241
|
|
|
233
242
|
/**
|
|
234
|
-
*
|
|
243
|
+
* Create a new course enrollment
|
|
235
244
|
*/
|
|
236
245
|
async postCourseEnrollment(requestParameters: PostCourseEnrollmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseEnrollment> {
|
|
237
246
|
const response = await this.postCourseEnrollmentRaw(requestParameters, initOverrides);
|
|
@@ -281,4 +290,54 @@ export class CourseApi extends runtime.BaseAPI {
|
|
|
281
290
|
return await response.value();
|
|
282
291
|
}
|
|
283
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Update a course enrollment
|
|
295
|
+
*/
|
|
296
|
+
async putCourseEnrollmentRaw(requestParameters: PutCourseEnrollmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseEnrollment>> {
|
|
297
|
+
if (requestParameters['courseId'] == null) {
|
|
298
|
+
throw new runtime.RequiredError(
|
|
299
|
+
'courseId',
|
|
300
|
+
'Required parameter "courseId" was null or undefined when calling putCourseEnrollment().'
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (requestParameters['enrollmentId'] == null) {
|
|
305
|
+
throw new runtime.RequiredError(
|
|
306
|
+
'enrollmentId',
|
|
307
|
+
'Required parameter "enrollmentId" was null or undefined when calling putCourseEnrollment().'
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (requestParameters['putCourseEnrollment'] == null) {
|
|
312
|
+
throw new runtime.RequiredError(
|
|
313
|
+
'putCourseEnrollment',
|
|
314
|
+
'Required parameter "putCourseEnrollment" was null or undefined when calling putCourseEnrollment().'
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const queryParameters: any = {};
|
|
319
|
+
|
|
320
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
321
|
+
|
|
322
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
323
|
+
|
|
324
|
+
const response = await this.request({
|
|
325
|
+
path: `/courses/{courseId}/enrollments/{enrollmentId}`.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))).replace(`{${"enrollmentId"}}`, encodeURIComponent(String(requestParameters['enrollmentId']))),
|
|
326
|
+
method: 'PUT',
|
|
327
|
+
headers: headerParameters,
|
|
328
|
+
query: queryParameters,
|
|
329
|
+
body: PutCourseEnrollmentToJSON(requestParameters['putCourseEnrollment']),
|
|
330
|
+
}, initOverrides);
|
|
331
|
+
|
|
332
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseEnrollmentFromJSON(jsonValue));
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Update a course enrollment
|
|
337
|
+
*/
|
|
338
|
+
async putCourseEnrollment(requestParameters: PutCourseEnrollmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseEnrollment> {
|
|
339
|
+
const response = await this.putCourseEnrollmentRaw(requestParameters, initOverrides);
|
|
340
|
+
return await response.value();
|
|
341
|
+
}
|
|
342
|
+
|
|
284
343
|
}
|
|
@@ -20,13 +20,19 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface GetCourseEnrollment {
|
|
22
22
|
/**
|
|
23
|
-
* The ID of the
|
|
23
|
+
* The external ID of the enrollment
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof GetCourseEnrollment
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* The external ID of the course
|
|
24
30
|
* @type {string}
|
|
25
31
|
* @memberof GetCourseEnrollment
|
|
26
32
|
*/
|
|
27
33
|
courseId: string;
|
|
28
34
|
/**
|
|
29
|
-
* The ID of the enrolled user
|
|
35
|
+
* The external ID of the enrolled user
|
|
30
36
|
* @type {string}
|
|
31
37
|
* @memberof GetCourseEnrollment
|
|
32
38
|
*/
|
|
@@ -69,10 +75,8 @@ export interface GetCourseEnrollment {
|
|
|
69
75
|
*/
|
|
70
76
|
export const GetCourseEnrollmentStatusEnum = {
|
|
71
77
|
Enrolled: 'Enrolled',
|
|
72
|
-
Dropped: 'Dropped',
|
|
73
78
|
Completed: 'Completed',
|
|
74
|
-
|
|
75
|
-
Unknown: 'Unknown'
|
|
79
|
+
Removed: 'Removed'
|
|
76
80
|
} as const;
|
|
77
81
|
export type GetCourseEnrollmentStatusEnum = typeof GetCourseEnrollmentStatusEnum[keyof typeof GetCourseEnrollmentStatusEnum];
|
|
78
82
|
|
|
@@ -81,6 +85,7 @@ export type GetCourseEnrollmentStatusEnum = typeof GetCourseEnrollmentStatusEnum
|
|
|
81
85
|
* Check if a given object implements the GetCourseEnrollment interface.
|
|
82
86
|
*/
|
|
83
87
|
export function instanceOfGetCourseEnrollment(value: object): value is GetCourseEnrollment {
|
|
88
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
84
89
|
if (!('courseId' in value) || value['courseId'] === undefined) return false;
|
|
85
90
|
if (!('userId' in value) || value['userId'] === undefined) return false;
|
|
86
91
|
if (!('enrollmentDateStart' in value) || value['enrollmentDateStart'] === undefined) return false;
|
|
@@ -101,6 +106,7 @@ export function GetCourseEnrollmentFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
101
106
|
}
|
|
102
107
|
return {
|
|
103
108
|
|
|
109
|
+
'id': json['id'],
|
|
104
110
|
'courseId': json['course_id'],
|
|
105
111
|
'userId': json['user_id'],
|
|
106
112
|
'enrollmentDateStart': json['enrollment_date_start'],
|
|
@@ -122,6 +128,7 @@ export function GetCourseEnrollmentToJSONTyped(value?: GetCourseEnrollment | nul
|
|
|
122
128
|
|
|
123
129
|
return {
|
|
124
130
|
|
|
131
|
+
'id': value['id'],
|
|
125
132
|
'course_id': value['courseId'],
|
|
126
133
|
'user_id': value['userId'],
|
|
127
134
|
'enrollment_date_start': value['enrollmentDateStart'],
|
|
@@ -43,6 +43,12 @@ export interface PostContentSession {
|
|
|
43
43
|
* @memberof PostContentSession
|
|
44
44
|
*/
|
|
45
45
|
createdAt: number;
|
|
46
|
+
/**
|
|
47
|
+
* The player session ID (used for SCORM, Quiz, and other interactive content). This is the external_id of the session that the player should use.
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof PostContentSession
|
|
50
|
+
*/
|
|
51
|
+
playerSessionId?: string | null;
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
/**
|
|
@@ -70,6 +76,7 @@ export function PostContentSessionFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
70
76
|
'userId': json['user_id'],
|
|
71
77
|
'launchUrl': json['launch_url'],
|
|
72
78
|
'createdAt': json['created_at'],
|
|
79
|
+
'playerSessionId': json['player_session_id'] == null ? undefined : json['player_session_id'],
|
|
73
80
|
};
|
|
74
81
|
}
|
|
75
82
|
|
|
@@ -88,6 +95,7 @@ export function PostContentSessionToJSONTyped(value?: PostContentSession | null,
|
|
|
88
95
|
'user_id': value['userId'],
|
|
89
96
|
'launch_url': value['launchUrl'],
|
|
90
97
|
'created_at': value['createdAt'],
|
|
98
|
+
'player_session_id': value['playerSessionId'],
|
|
91
99
|
};
|
|
92
100
|
}
|
|
93
101
|
|
|
@@ -20,30 +20,35 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface PostCourseEnrollment {
|
|
22
22
|
/**
|
|
23
|
-
* The ID of the
|
|
23
|
+
* The external ID of the user to enroll
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof PostCourseEnrollment
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
userId: string;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @type {
|
|
29
|
+
* Start date of the enrollment (Unix timestamp)
|
|
30
|
+
* @type {number}
|
|
31
31
|
* @memberof PostCourseEnrollment
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
enrollmentDateStart: number;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* End date of the enrollment (Unix timestamp)
|
|
36
36
|
* @type {number}
|
|
37
37
|
* @memberof PostCourseEnrollment
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
enrollmentDateEnd?: number | null;
|
|
40
|
+
/**
|
|
41
|
+
* Optional notes about the enrollment
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof PostCourseEnrollment
|
|
44
|
+
*/
|
|
45
|
+
notes?: string | null;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
48
|
/**
|
|
43
49
|
* Check if a given object implements the PostCourseEnrollment interface.
|
|
44
50
|
*/
|
|
45
51
|
export function instanceOfPostCourseEnrollment(value: object): value is PostCourseEnrollment {
|
|
46
|
-
if (!('courseId' in value) || value['courseId'] === undefined) return false;
|
|
47
52
|
if (!('userId' in value) || value['userId'] === undefined) return false;
|
|
48
53
|
if (!('enrollmentDateStart' in value) || value['enrollmentDateStart'] === undefined) return false;
|
|
49
54
|
return true;
|
|
@@ -59,9 +64,10 @@ export function PostCourseEnrollmentFromJSONTyped(json: any, ignoreDiscriminator
|
|
|
59
64
|
}
|
|
60
65
|
return {
|
|
61
66
|
|
|
62
|
-
'courseId': json['course_id'],
|
|
63
67
|
'userId': json['user_id'],
|
|
64
68
|
'enrollmentDateStart': json['enrollment_date_start'],
|
|
69
|
+
'enrollmentDateEnd': json['enrollment_date_end'] == null ? undefined : json['enrollment_date_end'],
|
|
70
|
+
'notes': json['notes'] == null ? undefined : json['notes'],
|
|
65
71
|
};
|
|
66
72
|
}
|
|
67
73
|
|
|
@@ -76,9 +82,10 @@ export function PostCourseEnrollmentToJSONTyped(value?: PostCourseEnrollment | n
|
|
|
76
82
|
|
|
77
83
|
return {
|
|
78
84
|
|
|
79
|
-
'course_id': value['courseId'],
|
|
80
85
|
'user_id': value['userId'],
|
|
81
86
|
'enrollment_date_start': value['enrollmentDateStart'],
|
|
87
|
+
'enrollment_date_end': value['enrollmentDateEnd'],
|
|
88
|
+
'notes': value['notes'],
|
|
82
89
|
};
|
|
83
90
|
}
|
|
84
91
|
|