@easyedu/js-lsm-api 1.79.0 → 1.80.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 +12 -0
- package/README.md +9 -2
- package/dist/apis/UserApi.d.ts +42 -0
- package/dist/apis/UserApi.js +79 -1
- package/dist/esm/apis/UserApi.d.ts +42 -0
- package/dist/esm/apis/UserApi.js +78 -0
- package/dist/esm/models/GetUserCourseList.d.ts +57 -0
- package/dist/esm/models/GetUserCourseList.js +60 -0
- package/dist/esm/models/GetUserCourseListItem.d.ts +54 -0
- package/dist/esm/models/GetUserCourseListItem.js +59 -0
- package/dist/esm/models/GetUserCourseListItemCertificate.d.ts +74 -0
- package/dist/esm/models/GetUserCourseListItemCertificate.js +75 -0
- package/dist/esm/models/GetUserCourseListItemCourse.d.ts +89 -0
- package/dist/esm/models/GetUserCourseListItemCourse.js +82 -0
- package/dist/esm/models/GetUserCourseListItemEnrollment.d.ts +111 -0
- package/dist/esm/models/GetUserCourseListItemEnrollment.js +105 -0
- package/dist/esm/models/GetUserCourseListItemProgress.d.ts +44 -0
- package/dist/esm/models/GetUserCourseListItemProgress.js +51 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/models/GetUserCourseList.d.ts +57 -0
- package/dist/models/GetUserCourseList.js +67 -0
- package/dist/models/GetUserCourseListItem.d.ts +54 -0
- package/dist/models/GetUserCourseListItem.js +66 -0
- package/dist/models/GetUserCourseListItemCertificate.d.ts +74 -0
- package/dist/models/GetUserCourseListItemCertificate.js +83 -0
- package/dist/models/GetUserCourseListItemCourse.d.ts +89 -0
- package/dist/models/GetUserCourseListItemCourse.js +90 -0
- package/dist/models/GetUserCourseListItemEnrollment.d.ts +111 -0
- package/dist/models/GetUserCourseListItemEnrollment.js +113 -0
- package/dist/models/GetUserCourseListItemProgress.d.ts +44 -0
- package/dist/models/GetUserCourseListItemProgress.js +58 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/docs/GetUserCourseList.md +43 -0
- package/docs/GetUserCourseListItem.md +41 -0
- package/docs/GetUserCourseListItemCertificate.md +43 -0
- package/docs/GetUserCourseListItemCourse.md +51 -0
- package/docs/GetUserCourseListItemEnrollment.md +49 -0
- package/docs/GetUserCourseListItemProgress.md +39 -0
- package/docs/UserApi.md +90 -0
- package/package.json +1 -1
- package/src/apis/UserApi.ts +108 -0
- package/src/models/GetUserCourseList.ts +110 -0
- package/src/models/GetUserCourseListItem.ts +122 -0
- package/src/models/GetUserCourseListItemCertificate.ts +124 -0
- package/src/models/GetUserCourseListItemCourse.ts +149 -0
- package/src/models/GetUserCourseListItemEnrollment.ts +171 -0
- package/src/models/GetUserCourseListItemProgress.ts +84 -0
- package/src/models/index.ts +6 -0
package/docs/UserApi.md
CHANGED
|
@@ -8,6 +8,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
8
8
|
| [**getAuthCheck**](UserApi.md#getauthcheck) | **GET** /auth/check | Check if a user is logged in |
|
|
9
9
|
| [**getCurrentUserPermissions**](UserApi.md#getcurrentuserpermissions) | **GET** /users/current/permissions | Get the current user\'s permissions |
|
|
10
10
|
| [**getUser**](UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id |
|
|
11
|
+
| [**getUserCourses**](UserApi.md#getusercourses) | **GET** /users/{userId}/courses | Get enrolled courses for a user |
|
|
11
12
|
| [**getUserEnrollments**](UserApi.md#getuserenrollments) | **GET** /users/{userId}/enrollments | Get user enrollments |
|
|
12
13
|
| [**postLogin**](UserApi.md#postlogin) | **POST** /auth/login | Post a new login |
|
|
13
14
|
| [**postLogout**](UserApi.md#postlogout) | **POST** /auth/logout | Logout a user |
|
|
@@ -269,6 +270,95 @@ No authorization required
|
|
|
269
270
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
270
271
|
|
|
271
272
|
|
|
273
|
+
## getUserCourses
|
|
274
|
+
|
|
275
|
+
> GetUserCourseList getUserCourses(userId, page, pageSize, search, recentActivitySince, enrollmentStatus, orderBy, orderDirection)
|
|
276
|
+
|
|
277
|
+
Get enrolled courses for a user
|
|
278
|
+
|
|
279
|
+
### Example
|
|
280
|
+
|
|
281
|
+
```ts
|
|
282
|
+
import {
|
|
283
|
+
Configuration,
|
|
284
|
+
UserApi,
|
|
285
|
+
} from '@easyedu/js-lsm-api';
|
|
286
|
+
import type { GetUserCoursesRequest } from '@easyedu/js-lsm-api';
|
|
287
|
+
|
|
288
|
+
async function example() {
|
|
289
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
290
|
+
const api = new UserApi();
|
|
291
|
+
|
|
292
|
+
const body = {
|
|
293
|
+
// string | User external ID, or `current` for the authenticated user.
|
|
294
|
+
userId: userId_example,
|
|
295
|
+
// number | Page number for pagination. (optional)
|
|
296
|
+
page: 56,
|
|
297
|
+
// number | Number of items per page. (optional)
|
|
298
|
+
pageSize: 56,
|
|
299
|
+
// string | Case-insensitive match against course name or description. (optional)
|
|
300
|
+
search: search_example,
|
|
301
|
+
// number | Unix timestamp in seconds. Only courses with learner live content-session activity at or after this time are returned. (optional)
|
|
302
|
+
recentActivitySince: 789,
|
|
303
|
+
// string | Comma-separated list of selected enrollment statuses to include. Example: `enrollmentStatus=Enrolled,InProgress,Completed`. Unknown values are ignored. (optional)
|
|
304
|
+
enrollmentStatus: enrollmentStatus_example,
|
|
305
|
+
// 'name' | 'created_at' | 'enrollment_date_start' | 'enrollment_status' | 'completion_percentage' | Field used to order the selected course list. (optional)
|
|
306
|
+
orderBy: orderBy_example,
|
|
307
|
+
// 'asc' | 'desc' | Sort direction. (optional)
|
|
308
|
+
orderDirection: orderDirection_example,
|
|
309
|
+
} satisfies GetUserCoursesRequest;
|
|
310
|
+
|
|
311
|
+
try {
|
|
312
|
+
const data = await api.getUserCourses(body);
|
|
313
|
+
console.log(data);
|
|
314
|
+
} catch (error) {
|
|
315
|
+
console.error(error);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Run the test
|
|
320
|
+
example().catch(console.error);
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### Parameters
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
| Name | Type | Description | Notes |
|
|
327
|
+
|------------- | ------------- | ------------- | -------------|
|
|
328
|
+
| **userId** | `string` | User external ID, or `current` for the authenticated user. | [Defaults to `undefined`] |
|
|
329
|
+
| **page** | `number` | Page number for pagination. | [Optional] [Defaults to `1`] |
|
|
330
|
+
| **pageSize** | `number` | Number of items per page. | [Optional] [Defaults to `20`] |
|
|
331
|
+
| **search** | `string` | Case-insensitive match against course name or description. | [Optional] [Defaults to `undefined`] |
|
|
332
|
+
| **recentActivitySince** | `number` | Unix timestamp in seconds. Only courses with learner live content-session activity at or after this time are returned. | [Optional] [Defaults to `undefined`] |
|
|
333
|
+
| **enrollmentStatus** | `string` | Comma-separated list of selected enrollment statuses to include. Example: `enrollmentStatus=Enrolled,InProgress,Completed`. Unknown values are ignored. | [Optional] [Defaults to `undefined`] |
|
|
334
|
+
| **orderBy** | `name`, `created_at`, `enrollment_date_start`, `enrollment_status`, `completion_percentage` | Field used to order the selected course list. | [Optional] [Defaults to `'enrollment_date_start'`] [Enum: name, created_at, enrollment_date_start, enrollment_status, completion_percentage] |
|
|
335
|
+
| **orderDirection** | `asc`, `desc` | Sort direction. | [Optional] [Defaults to `'desc'`] [Enum: asc, desc] |
|
|
336
|
+
|
|
337
|
+
### Return type
|
|
338
|
+
|
|
339
|
+
[**GetUserCourseList**](GetUserCourseList.md)
|
|
340
|
+
|
|
341
|
+
### Authorization
|
|
342
|
+
|
|
343
|
+
No authorization required
|
|
344
|
+
|
|
345
|
+
### HTTP request headers
|
|
346
|
+
|
|
347
|
+
- **Content-Type**: Not defined
|
|
348
|
+
- **Accept**: `application/json`
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
### HTTP response details
|
|
352
|
+
| Status code | Description | Response headers |
|
|
353
|
+
|-------------|-------------|------------------|
|
|
354
|
+
| **200** | get user courses response OK | - |
|
|
355
|
+
| **400** | Invalid query parameter | - |
|
|
356
|
+
| **403** | Forbidden | - |
|
|
357
|
+
| **404** | User not found | - |
|
|
358
|
+
|
|
359
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
360
|
+
|
|
361
|
+
|
|
272
362
|
## getUserEnrollments
|
|
273
363
|
|
|
274
364
|
> GetCourseEnrollmentList getUserEnrollments(userId, type, status, page, pageSize)
|
package/package.json
CHANGED
package/src/apis/UserApi.ts
CHANGED
|
@@ -28,6 +28,11 @@ import {
|
|
|
28
28
|
GetUserAvatarUploadFromJSON,
|
|
29
29
|
GetUserAvatarUploadToJSON,
|
|
30
30
|
} from '../models/GetUserAvatarUpload';
|
|
31
|
+
import {
|
|
32
|
+
type GetUserCourseList,
|
|
33
|
+
GetUserCourseListFromJSON,
|
|
34
|
+
GetUserCourseListToJSON,
|
|
35
|
+
} from '../models/GetUserCourseList';
|
|
31
36
|
import {
|
|
32
37
|
type LoginRes,
|
|
33
38
|
LoginResFromJSON,
|
|
@@ -72,6 +77,17 @@ export interface GetUserRequest {
|
|
|
72
77
|
userId: string;
|
|
73
78
|
}
|
|
74
79
|
|
|
80
|
+
export interface GetUserCoursesRequest {
|
|
81
|
+
userId: string;
|
|
82
|
+
page?: number;
|
|
83
|
+
pageSize?: number;
|
|
84
|
+
search?: string;
|
|
85
|
+
recentActivitySince?: number;
|
|
86
|
+
enrollmentStatus?: string;
|
|
87
|
+
orderBy?: GetUserCoursesOrderByEnum;
|
|
88
|
+
orderDirection?: GetUserCoursesOrderDirectionEnum;
|
|
89
|
+
}
|
|
90
|
+
|
|
75
91
|
export interface GetUserEnrollmentsRequest {
|
|
76
92
|
userId: string;
|
|
77
93
|
type?: GetUserEnrollmentsTypeEnum;
|
|
@@ -279,6 +295,79 @@ export class UserApi extends runtime.BaseAPI {
|
|
|
279
295
|
return await response.value();
|
|
280
296
|
}
|
|
281
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Creates request options for getUserCourses without sending the request
|
|
300
|
+
*/
|
|
301
|
+
async getUserCoursesRequestOpts(requestParameters: GetUserCoursesRequest): Promise<runtime.RequestOpts> {
|
|
302
|
+
if (requestParameters['userId'] == null) {
|
|
303
|
+
throw new runtime.RequiredError(
|
|
304
|
+
'userId',
|
|
305
|
+
'Required parameter "userId" was null or undefined when calling getUserCourses().'
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const queryParameters: any = {};
|
|
310
|
+
|
|
311
|
+
if (requestParameters['page'] != null) {
|
|
312
|
+
queryParameters['page'] = requestParameters['page'];
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if (requestParameters['pageSize'] != null) {
|
|
316
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (requestParameters['search'] != null) {
|
|
320
|
+
queryParameters['search'] = requestParameters['search'];
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (requestParameters['recentActivitySince'] != null) {
|
|
324
|
+
queryParameters['recentActivitySince'] = requestParameters['recentActivitySince'];
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (requestParameters['enrollmentStatus'] != null) {
|
|
328
|
+
queryParameters['enrollmentStatus'] = requestParameters['enrollmentStatus'];
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (requestParameters['orderBy'] != null) {
|
|
332
|
+
queryParameters['orderBy'] = requestParameters['orderBy'];
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (requestParameters['orderDirection'] != null) {
|
|
336
|
+
queryParameters['orderDirection'] = requestParameters['orderDirection'];
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
let urlPath = `/users/{userId}/courses`;
|
|
343
|
+
urlPath = urlPath.replace('{userId}', encodeURIComponent(String(requestParameters['userId'])));
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
path: urlPath,
|
|
347
|
+
method: 'GET',
|
|
348
|
+
headers: headerParameters,
|
|
349
|
+
query: queryParameters,
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Get enrolled courses for a user
|
|
355
|
+
*/
|
|
356
|
+
async getUserCoursesRaw(requestParameters: GetUserCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetUserCourseList>> {
|
|
357
|
+
const requestOptions = await this.getUserCoursesRequestOpts(requestParameters);
|
|
358
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
359
|
+
|
|
360
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetUserCourseListFromJSON(jsonValue));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Get enrolled courses for a user
|
|
365
|
+
*/
|
|
366
|
+
async getUserCourses(requestParameters: GetUserCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUserCourseList> {
|
|
367
|
+
const response = await this.getUserCoursesRaw(requestParameters, initOverrides);
|
|
368
|
+
return await response.value();
|
|
369
|
+
}
|
|
370
|
+
|
|
282
371
|
/**
|
|
283
372
|
* Creates request options for getUserEnrollments without sending the request
|
|
284
373
|
*/
|
|
@@ -739,6 +828,25 @@ export class UserApi extends runtime.BaseAPI {
|
|
|
739
828
|
|
|
740
829
|
}
|
|
741
830
|
|
|
831
|
+
/**
|
|
832
|
+
* @export
|
|
833
|
+
*/
|
|
834
|
+
export const GetUserCoursesOrderByEnum = {
|
|
835
|
+
Name: 'name',
|
|
836
|
+
CreatedAt: 'created_at',
|
|
837
|
+
EnrollmentDateStart: 'enrollment_date_start',
|
|
838
|
+
EnrollmentStatus: 'enrollment_status',
|
|
839
|
+
CompletionPercentage: 'completion_percentage'
|
|
840
|
+
} as const;
|
|
841
|
+
export type GetUserCoursesOrderByEnum = typeof GetUserCoursesOrderByEnum[keyof typeof GetUserCoursesOrderByEnum];
|
|
842
|
+
/**
|
|
843
|
+
* @export
|
|
844
|
+
*/
|
|
845
|
+
export const GetUserCoursesOrderDirectionEnum = {
|
|
846
|
+
Asc: 'asc',
|
|
847
|
+
Desc: 'desc'
|
|
848
|
+
} as const;
|
|
849
|
+
export type GetUserCoursesOrderDirectionEnum = typeof GetUserCoursesOrderDirectionEnum[keyof typeof GetUserCoursesOrderDirectionEnum];
|
|
742
850
|
/**
|
|
743
851
|
* @export
|
|
744
852
|
*/
|
|
@@ -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 { GetUserCourseListItem } from './GetUserCourseListItem';
|
|
17
|
+
import {
|
|
18
|
+
GetUserCourseListItemFromJSON,
|
|
19
|
+
GetUserCourseListItemFromJSONTyped,
|
|
20
|
+
GetUserCourseListItemToJSON,
|
|
21
|
+
GetUserCourseListItemToJSONTyped,
|
|
22
|
+
} from './GetUserCourseListItem';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A paginated list of courses the target user is enrolled in.
|
|
26
|
+
* @export
|
|
27
|
+
* @interface GetUserCourseList
|
|
28
|
+
*/
|
|
29
|
+
export interface GetUserCourseList {
|
|
30
|
+
/**
|
|
31
|
+
* The current page number
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof GetUserCourseList
|
|
34
|
+
*/
|
|
35
|
+
page: number;
|
|
36
|
+
/**
|
|
37
|
+
* The number of items returned on this page
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof GetUserCourseList
|
|
40
|
+
*/
|
|
41
|
+
pageSize: number;
|
|
42
|
+
/**
|
|
43
|
+
* The total number of pages
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof GetUserCourseList
|
|
46
|
+
*/
|
|
47
|
+
totalPages: number;
|
|
48
|
+
/**
|
|
49
|
+
* The total number of courses after selecting one enrollment per course
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof GetUserCourseList
|
|
52
|
+
*/
|
|
53
|
+
totalItems: number;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {Array<GetUserCourseListItem>}
|
|
57
|
+
* @memberof GetUserCourseList
|
|
58
|
+
*/
|
|
59
|
+
items: Array<GetUserCourseListItem>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the GetUserCourseList interface.
|
|
64
|
+
*/
|
|
65
|
+
export function instanceOfGetUserCourseList(value: object): value is GetUserCourseList {
|
|
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 GetUserCourseListFromJSON(json: any): GetUserCourseList {
|
|
75
|
+
return GetUserCourseListFromJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function GetUserCourseListFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetUserCourseList {
|
|
79
|
+
if (json == null) {
|
|
80
|
+
return json;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'page': json['page'],
|
|
85
|
+
'pageSize': json['pageSize'],
|
|
86
|
+
'totalPages': json['totalPages'],
|
|
87
|
+
'totalItems': json['totalItems'],
|
|
88
|
+
'items': ((json['items'] as Array<any>).map(GetUserCourseListItemFromJSON)),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function GetUserCourseListToJSON(json: any): GetUserCourseList {
|
|
93
|
+
return GetUserCourseListToJSONTyped(json, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function GetUserCourseListToJSONTyped(value?: GetUserCourseList | null, ignoreDiscriminator: boolean = false): any {
|
|
97
|
+
if (value == null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
|
|
103
|
+
'page': value['page'],
|
|
104
|
+
'pageSize': value['pageSize'],
|
|
105
|
+
'totalPages': value['totalPages'],
|
|
106
|
+
'totalItems': value['totalItems'],
|
|
107
|
+
'items': ((value['items'] as Array<any>).map(GetUserCourseListItemToJSON)),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
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 { GetUserCourseListItemCourse } from './GetUserCourseListItemCourse';
|
|
17
|
+
import {
|
|
18
|
+
GetUserCourseListItemCourseFromJSON,
|
|
19
|
+
GetUserCourseListItemCourseFromJSONTyped,
|
|
20
|
+
GetUserCourseListItemCourseToJSON,
|
|
21
|
+
GetUserCourseListItemCourseToJSONTyped,
|
|
22
|
+
} from './GetUserCourseListItemCourse';
|
|
23
|
+
import type { GetUserCourseListItemEnrollment } from './GetUserCourseListItemEnrollment';
|
|
24
|
+
import {
|
|
25
|
+
GetUserCourseListItemEnrollmentFromJSON,
|
|
26
|
+
GetUserCourseListItemEnrollmentFromJSONTyped,
|
|
27
|
+
GetUserCourseListItemEnrollmentToJSON,
|
|
28
|
+
GetUserCourseListItemEnrollmentToJSONTyped,
|
|
29
|
+
} from './GetUserCourseListItemEnrollment';
|
|
30
|
+
import type { GetUserCourseListItemCertificate } from './GetUserCourseListItemCertificate';
|
|
31
|
+
import {
|
|
32
|
+
GetUserCourseListItemCertificateFromJSON,
|
|
33
|
+
GetUserCourseListItemCertificateFromJSONTyped,
|
|
34
|
+
GetUserCourseListItemCertificateToJSON,
|
|
35
|
+
GetUserCourseListItemCertificateToJSONTyped,
|
|
36
|
+
} from './GetUserCourseListItemCertificate';
|
|
37
|
+
import type { GetUserCourseListItemProgress } from './GetUserCourseListItemProgress';
|
|
38
|
+
import {
|
|
39
|
+
GetUserCourseListItemProgressFromJSON,
|
|
40
|
+
GetUserCourseListItemProgressFromJSONTyped,
|
|
41
|
+
GetUserCourseListItemProgressToJSON,
|
|
42
|
+
GetUserCourseListItemProgressToJSONTyped,
|
|
43
|
+
} from './GetUserCourseListItemProgress';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A course the target user is enrolled in, grouped by course and selected enrollment.
|
|
47
|
+
* @export
|
|
48
|
+
* @interface GetUserCourseListItem
|
|
49
|
+
*/
|
|
50
|
+
export interface GetUserCourseListItem {
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @type {GetUserCourseListItemCourse}
|
|
54
|
+
* @memberof GetUserCourseListItem
|
|
55
|
+
*/
|
|
56
|
+
course: GetUserCourseListItemCourse;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @type {GetUserCourseListItemEnrollment}
|
|
60
|
+
* @memberof GetUserCourseListItem
|
|
61
|
+
*/
|
|
62
|
+
enrollment: GetUserCourseListItemEnrollment;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @type {GetUserCourseListItemProgress}
|
|
66
|
+
* @memberof GetUserCourseListItem
|
|
67
|
+
*/
|
|
68
|
+
progress: GetUserCourseListItemProgress;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @type {GetUserCourseListItemCertificate}
|
|
72
|
+
* @memberof GetUserCourseListItem
|
|
73
|
+
*/
|
|
74
|
+
certificate: GetUserCourseListItemCertificate | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check if a given object implements the GetUserCourseListItem interface.
|
|
79
|
+
*/
|
|
80
|
+
export function instanceOfGetUserCourseListItem(value: object): value is GetUserCourseListItem {
|
|
81
|
+
if (!('course' in value) || value['course'] === undefined) return false;
|
|
82
|
+
if (!('enrollment' in value) || value['enrollment'] === undefined) return false;
|
|
83
|
+
if (!('progress' in value) || value['progress'] === undefined) return false;
|
|
84
|
+
if (!('certificate' in value) || value['certificate'] === undefined) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function GetUserCourseListItemFromJSON(json: any): GetUserCourseListItem {
|
|
89
|
+
return GetUserCourseListItemFromJSONTyped(json, false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function GetUserCourseListItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetUserCourseListItem {
|
|
93
|
+
if (json == null) {
|
|
94
|
+
return json;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
|
|
98
|
+
'course': GetUserCourseListItemCourseFromJSON(json['course']),
|
|
99
|
+
'enrollment': GetUserCourseListItemEnrollmentFromJSON(json['enrollment']),
|
|
100
|
+
'progress': GetUserCourseListItemProgressFromJSON(json['progress']),
|
|
101
|
+
'certificate': GetUserCourseListItemCertificateFromJSON(json['certificate']),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function GetUserCourseListItemToJSON(json: any): GetUserCourseListItem {
|
|
106
|
+
return GetUserCourseListItemToJSONTyped(json, false);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function GetUserCourseListItemToJSONTyped(value?: GetUserCourseListItem | null, ignoreDiscriminator: boolean = false): any {
|
|
110
|
+
if (value == null) {
|
|
111
|
+
return value;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
|
|
116
|
+
'course': GetUserCourseListItemCourseToJSON(value['course']),
|
|
117
|
+
'enrollment': GetUserCourseListItemEnrollmentToJSON(value['enrollment']),
|
|
118
|
+
'progress': GetUserCourseListItemProgressToJSON(value['progress']),
|
|
119
|
+
'certificate': GetUserCourseListItemCertificateToJSON(value['certificate']),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
* Latest certificate for the learner and course, if one exists.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface GetUserCourseListItemCertificate
|
|
20
|
+
*/
|
|
21
|
+
export interface GetUserCourseListItemCertificate {
|
|
22
|
+
/**
|
|
23
|
+
* The external ID of the certificate.
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof GetUserCourseListItemCertificate
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* Derived certificate status. Active certificates with expires_at in the past are returned as expired.
|
|
30
|
+
* @type {GetUserCourseListItemCertificateStatusEnum}
|
|
31
|
+
* @memberof GetUserCourseListItemCertificate
|
|
32
|
+
*/
|
|
33
|
+
status: GetUserCourseListItemCertificateStatusEnum;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof GetUserCourseListItemCertificate
|
|
38
|
+
*/
|
|
39
|
+
issuedAt: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof GetUserCourseListItemCertificate
|
|
44
|
+
*/
|
|
45
|
+
expiresAt: number | null;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {GetUserCourseListItemCertificateIssuanceReasonEnum}
|
|
49
|
+
* @memberof GetUserCourseListItemCertificate
|
|
50
|
+
*/
|
|
51
|
+
issuanceReason: GetUserCourseListItemCertificateIssuanceReasonEnum;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export const GetUserCourseListItemCertificateStatusEnum = {
|
|
59
|
+
Active: 'active',
|
|
60
|
+
Expired: 'expired',
|
|
61
|
+
Revoked: 'revoked'
|
|
62
|
+
} as const;
|
|
63
|
+
export type GetUserCourseListItemCertificateStatusEnum = typeof GetUserCourseListItemCertificateStatusEnum[keyof typeof GetUserCourseListItemCertificateStatusEnum];
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @export
|
|
67
|
+
*/
|
|
68
|
+
export const GetUserCourseListItemCertificateIssuanceReasonEnum = {
|
|
69
|
+
CourseCompletion: 'course_completion',
|
|
70
|
+
QuizPassed: 'quiz_passed',
|
|
71
|
+
Manual: 'manual'
|
|
72
|
+
} as const;
|
|
73
|
+
export type GetUserCourseListItemCertificateIssuanceReasonEnum = typeof GetUserCourseListItemCertificateIssuanceReasonEnum[keyof typeof GetUserCourseListItemCertificateIssuanceReasonEnum];
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Check if a given object implements the GetUserCourseListItemCertificate interface.
|
|
78
|
+
*/
|
|
79
|
+
export function instanceOfGetUserCourseListItemCertificate(value: object): value is GetUserCourseListItemCertificate {
|
|
80
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
81
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
82
|
+
if (!('issuedAt' in value) || value['issuedAt'] === undefined) return false;
|
|
83
|
+
if (!('expiresAt' in value) || value['expiresAt'] === undefined) return false;
|
|
84
|
+
if (!('issuanceReason' in value) || value['issuanceReason'] === undefined) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function GetUserCourseListItemCertificateFromJSON(json: any): GetUserCourseListItemCertificate {
|
|
89
|
+
return GetUserCourseListItemCertificateFromJSONTyped(json, false);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function GetUserCourseListItemCertificateFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetUserCourseListItemCertificate {
|
|
93
|
+
if (json == null) {
|
|
94
|
+
return json;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
|
|
98
|
+
'id': json['id'],
|
|
99
|
+
'status': json['status'],
|
|
100
|
+
'issuedAt': json['issued_at'],
|
|
101
|
+
'expiresAt': json['expires_at'],
|
|
102
|
+
'issuanceReason': json['issuance_reason'],
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function GetUserCourseListItemCertificateToJSON(json: any): GetUserCourseListItemCertificate {
|
|
107
|
+
return GetUserCourseListItemCertificateToJSONTyped(json, false);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function GetUserCourseListItemCertificateToJSONTyped(value?: GetUserCourseListItemCertificate | null, ignoreDiscriminator: boolean = false): any {
|
|
111
|
+
if (value == null) {
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
|
|
117
|
+
'id': value['id'],
|
|
118
|
+
'status': value['status'],
|
|
119
|
+
'issued_at': value['issuedAt'],
|
|
120
|
+
'expires_at': value['expiresAt'],
|
|
121
|
+
'issuance_reason': value['issuanceReason'],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|