@easyedu/js-lsm-api 1.73.0 → 1.75.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @easyedu/js-lsm-api@1.73.0
1
+ # @easyedu/js-lsm-api@1.75.0
2
2
 
3
3
  A TypeScript SDK client for the sbzw93t49b.execute-api.us-east-2.amazonaws.com API.
4
4
 
@@ -240,6 +240,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
240
240
  *UserApi* | [**getAuthCheck**](docs/UserApi.md#getauthcheck) | **GET** /auth/check | Check if a user is logged in
241
241
  *UserApi* | [**getCurrentUserPermissions**](docs/UserApi.md#getcurrentuserpermissions) | **GET** /users/current/permissions | Get the current user\'s permissions
242
242
  *UserApi* | [**getUser**](docs/UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id
243
+ *UserApi* | [**getUserEnrollments**](docs/UserApi.md#getuserenrollments) | **GET** /users/{userId}/enrollments | Get user enrollments
243
244
  *UserApi* | [**postLogin**](docs/UserApi.md#postlogin) | **POST** /auth/login | Post a new login
244
245
  *UserApi* | [**postLogout**](docs/UserApi.md#postlogout) | **POST** /auth/logout | Logout a user
245
246
  *UserApi* | [**postSignupRequest**](docs/UserApi.md#postsignuprequest) | **POST** /auth/signup-request | Request a new organization signup
@@ -537,7 +538,7 @@ and is automatically generated by the
537
538
  [OpenAPI Generator](https://openapi-generator.tech) project:
538
539
 
539
540
  - API version: `1.0.0`
540
- - Package version: `1.73.0`
541
+ - Package version: `1.75.0`
541
542
  - Generator version: `7.22.0`
542
543
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
543
544
 
@@ -51,6 +51,7 @@ export interface GetCourseEnrollmentRequest {
51
51
  }
52
52
  export interface GetCourseEnrollmentsRequest {
53
53
  courseId: string;
54
+ userId?: string;
54
55
  type?: GetCourseEnrollmentsTypeEnum;
55
56
  status?: string;
56
57
  page?: number;
@@ -338,6 +338,9 @@ class CourseApi extends runtime.BaseAPI {
338
338
  throw new runtime.RequiredError('courseId', 'Required parameter "courseId" was null or undefined when calling getCourseEnrollments().');
339
339
  }
340
340
  const queryParameters = {};
341
+ if (requestParameters['userId'] != null) {
342
+ queryParameters['userId'] = requestParameters['userId'];
343
+ }
341
344
  if (requestParameters['type'] != null) {
342
345
  queryParameters['type'] = requestParameters['type'];
343
346
  }
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
+ import { type GetCourseEnrollmentList } from '../models/GetCourseEnrollmentList';
13
14
  import { type GetUser } from '../models/GetUser';
14
15
  import { type GetUserAvatarUpload } from '../models/GetUserAvatarUpload';
15
16
  import { type LoginRes } from '../models/LoginRes';
@@ -25,6 +26,13 @@ export interface DeleteUserAvatarRequest {
25
26
  export interface GetUserRequest {
26
27
  userId: string;
27
28
  }
29
+ export interface GetUserEnrollmentsRequest {
30
+ userId: string;
31
+ type?: GetUserEnrollmentsTypeEnum;
32
+ status?: string;
33
+ page?: number;
34
+ pageSize?: number;
35
+ }
28
36
  export interface PostLoginRequest {
29
37
  postLogin: PostLogin;
30
38
  }
@@ -102,6 +110,18 @@ export declare class UserApi extends runtime.BaseAPI {
102
110
  * Get a user by id
103
111
  */
104
112
  getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUser>;
113
+ /**
114
+ * Creates request options for getUserEnrollments without sending the request
115
+ */
116
+ getUserEnrollmentsRequestOpts(requestParameters: GetUserEnrollmentsRequest): Promise<runtime.RequestOpts>;
117
+ /**
118
+ * Get user enrollments
119
+ */
120
+ getUserEnrollmentsRaw(requestParameters: GetUserEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseEnrollmentList>>;
121
+ /**
122
+ * Get user enrollments
123
+ */
124
+ getUserEnrollments(requestParameters: GetUserEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseEnrollmentList>;
105
125
  /**
106
126
  * Creates request options for postLogin without sending the request
107
127
  */
@@ -199,3 +219,11 @@ export declare class UserApi extends runtime.BaseAPI {
199
219
  */
200
220
  verifySignupRequest(requestParameters: VerifySignupRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
201
221
  }
222
+ /**
223
+ * @export
224
+ */
225
+ export declare const GetUserEnrollmentsTypeEnum: {
226
+ readonly Student: "student";
227
+ readonly Instructor: "instructor";
228
+ };
229
+ export type GetUserEnrollmentsTypeEnum = typeof GetUserEnrollmentsTypeEnum[keyof typeof GetUserEnrollmentsTypeEnum];
@@ -22,8 +22,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.UserApi = void 0;
25
+ exports.GetUserEnrollmentsTypeEnum = exports.UserApi = void 0;
26
26
  const runtime = require("../runtime");
27
+ const GetCourseEnrollmentList_1 = require("../models/GetCourseEnrollmentList");
27
28
  const GetUser_1 = require("../models/GetUser");
28
29
  const GetUserAvatarUpload_1 = require("../models/GetUserAvatarUpload");
29
30
  const LoginRes_1 = require("../models/LoginRes");
@@ -185,6 +186,57 @@ class UserApi extends runtime.BaseAPI {
185
186
  return yield response.value();
186
187
  });
187
188
  }
189
+ /**
190
+ * Creates request options for getUserEnrollments without sending the request
191
+ */
192
+ getUserEnrollmentsRequestOpts(requestParameters) {
193
+ return __awaiter(this, void 0, void 0, function* () {
194
+ if (requestParameters['userId'] == null) {
195
+ throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling getUserEnrollments().');
196
+ }
197
+ const queryParameters = {};
198
+ if (requestParameters['type'] != null) {
199
+ queryParameters['type'] = requestParameters['type'];
200
+ }
201
+ if (requestParameters['status'] != null) {
202
+ queryParameters['status'] = requestParameters['status'];
203
+ }
204
+ if (requestParameters['page'] != null) {
205
+ queryParameters['page'] = requestParameters['page'];
206
+ }
207
+ if (requestParameters['pageSize'] != null) {
208
+ queryParameters['pageSize'] = requestParameters['pageSize'];
209
+ }
210
+ const headerParameters = {};
211
+ let urlPath = `/users/{userId}/enrollments`;
212
+ urlPath = urlPath.replace('{userId}', encodeURIComponent(String(requestParameters['userId'])));
213
+ return {
214
+ path: urlPath,
215
+ method: 'GET',
216
+ headers: headerParameters,
217
+ query: queryParameters,
218
+ };
219
+ });
220
+ }
221
+ /**
222
+ * Get user enrollments
223
+ */
224
+ getUserEnrollmentsRaw(requestParameters, initOverrides) {
225
+ return __awaiter(this, void 0, void 0, function* () {
226
+ const requestOptions = yield this.getUserEnrollmentsRequestOpts(requestParameters);
227
+ const response = yield this.request(requestOptions, initOverrides);
228
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, GetCourseEnrollmentList_1.GetCourseEnrollmentListFromJSON)(jsonValue));
229
+ });
230
+ }
231
+ /**
232
+ * Get user enrollments
233
+ */
234
+ getUserEnrollments(requestParameters, initOverrides) {
235
+ return __awaiter(this, void 0, void 0, function* () {
236
+ const response = yield this.getUserEnrollmentsRaw(requestParameters, initOverrides);
237
+ return yield response.value();
238
+ });
239
+ }
188
240
  /**
189
241
  * Creates request options for postLogin without sending the request
190
242
  */
@@ -524,3 +576,10 @@ class UserApi extends runtime.BaseAPI {
524
576
  }
525
577
  }
526
578
  exports.UserApi = UserApi;
579
+ /**
580
+ * @export
581
+ */
582
+ exports.GetUserEnrollmentsTypeEnum = {
583
+ Student: 'student',
584
+ Instructor: 'instructor'
585
+ };
@@ -51,6 +51,7 @@ export interface GetCourseEnrollmentRequest {
51
51
  }
52
52
  export interface GetCourseEnrollmentsRequest {
53
53
  courseId: string;
54
+ userId?: string;
54
55
  type?: GetCourseEnrollmentsTypeEnum;
55
56
  status?: string;
56
57
  page?: number;
@@ -335,6 +335,9 @@ export class CourseApi extends runtime.BaseAPI {
335
335
  throw new runtime.RequiredError('courseId', 'Required parameter "courseId" was null or undefined when calling getCourseEnrollments().');
336
336
  }
337
337
  const queryParameters = {};
338
+ if (requestParameters['userId'] != null) {
339
+ queryParameters['userId'] = requestParameters['userId'];
340
+ }
338
341
  if (requestParameters['type'] != null) {
339
342
  queryParameters['type'] = requestParameters['type'];
340
343
  }
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
+ import { type GetCourseEnrollmentList } from '../models/GetCourseEnrollmentList';
13
14
  import { type GetUser } from '../models/GetUser';
14
15
  import { type GetUserAvatarUpload } from '../models/GetUserAvatarUpload';
15
16
  import { type LoginRes } from '../models/LoginRes';
@@ -25,6 +26,13 @@ export interface DeleteUserAvatarRequest {
25
26
  export interface GetUserRequest {
26
27
  userId: string;
27
28
  }
29
+ export interface GetUserEnrollmentsRequest {
30
+ userId: string;
31
+ type?: GetUserEnrollmentsTypeEnum;
32
+ status?: string;
33
+ page?: number;
34
+ pageSize?: number;
35
+ }
28
36
  export interface PostLoginRequest {
29
37
  postLogin: PostLogin;
30
38
  }
@@ -102,6 +110,18 @@ export declare class UserApi extends runtime.BaseAPI {
102
110
  * Get a user by id
103
111
  */
104
112
  getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUser>;
113
+ /**
114
+ * Creates request options for getUserEnrollments without sending the request
115
+ */
116
+ getUserEnrollmentsRequestOpts(requestParameters: GetUserEnrollmentsRequest): Promise<runtime.RequestOpts>;
117
+ /**
118
+ * Get user enrollments
119
+ */
120
+ getUserEnrollmentsRaw(requestParameters: GetUserEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseEnrollmentList>>;
121
+ /**
122
+ * Get user enrollments
123
+ */
124
+ getUserEnrollments(requestParameters: GetUserEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseEnrollmentList>;
105
125
  /**
106
126
  * Creates request options for postLogin without sending the request
107
127
  */
@@ -199,3 +219,11 @@ export declare class UserApi extends runtime.BaseAPI {
199
219
  */
200
220
  verifySignupRequest(requestParameters: VerifySignupRequestRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
201
221
  }
222
+ /**
223
+ * @export
224
+ */
225
+ export declare const GetUserEnrollmentsTypeEnum: {
226
+ readonly Student: "student";
227
+ readonly Instructor: "instructor";
228
+ };
229
+ export type GetUserEnrollmentsTypeEnum = typeof GetUserEnrollmentsTypeEnum[keyof typeof GetUserEnrollmentsTypeEnum];
@@ -21,6 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
+ import { GetCourseEnrollmentListFromJSON, } from '../models/GetCourseEnrollmentList';
24
25
  import { GetUserFromJSON, } from '../models/GetUser';
25
26
  import { GetUserAvatarUploadFromJSON, } from '../models/GetUserAvatarUpload';
26
27
  import { LoginResFromJSON, } from '../models/LoginRes';
@@ -182,6 +183,57 @@ export class UserApi extends runtime.BaseAPI {
182
183
  return yield response.value();
183
184
  });
184
185
  }
186
+ /**
187
+ * Creates request options for getUserEnrollments without sending the request
188
+ */
189
+ getUserEnrollmentsRequestOpts(requestParameters) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ if (requestParameters['userId'] == null) {
192
+ throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling getUserEnrollments().');
193
+ }
194
+ const queryParameters = {};
195
+ if (requestParameters['type'] != null) {
196
+ queryParameters['type'] = requestParameters['type'];
197
+ }
198
+ if (requestParameters['status'] != null) {
199
+ queryParameters['status'] = requestParameters['status'];
200
+ }
201
+ if (requestParameters['page'] != null) {
202
+ queryParameters['page'] = requestParameters['page'];
203
+ }
204
+ if (requestParameters['pageSize'] != null) {
205
+ queryParameters['pageSize'] = requestParameters['pageSize'];
206
+ }
207
+ const headerParameters = {};
208
+ let urlPath = `/users/{userId}/enrollments`;
209
+ urlPath = urlPath.replace('{userId}', encodeURIComponent(String(requestParameters['userId'])));
210
+ return {
211
+ path: urlPath,
212
+ method: 'GET',
213
+ headers: headerParameters,
214
+ query: queryParameters,
215
+ };
216
+ });
217
+ }
218
+ /**
219
+ * Get user enrollments
220
+ */
221
+ getUserEnrollmentsRaw(requestParameters, initOverrides) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ const requestOptions = yield this.getUserEnrollmentsRequestOpts(requestParameters);
224
+ const response = yield this.request(requestOptions, initOverrides);
225
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseEnrollmentListFromJSON(jsonValue));
226
+ });
227
+ }
228
+ /**
229
+ * Get user enrollments
230
+ */
231
+ getUserEnrollments(requestParameters, initOverrides) {
232
+ return __awaiter(this, void 0, void 0, function* () {
233
+ const response = yield this.getUserEnrollmentsRaw(requestParameters, initOverrides);
234
+ return yield response.value();
235
+ });
236
+ }
185
237
  /**
186
238
  * Creates request options for postLogin without sending the request
187
239
  */
@@ -520,3 +572,10 @@ export class UserApi extends runtime.BaseAPI {
520
572
  });
521
573
  }
522
574
  }
575
+ /**
576
+ * @export
577
+ */
578
+ export const GetUserEnrollmentsTypeEnum = {
579
+ Student: 'student',
580
+ Instructor: 'instructor'
581
+ };
@@ -100,6 +100,7 @@ No authorization required
100
100
  |-------------|-------------|------------------|
101
101
  | **200** | Successfully committed SCORM session data | - |
102
102
  | **401** | Unauthorized | - |
103
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
103
104
  | **404** | SCORM session not found | - |
104
105
 
105
106
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -1070,6 +1071,7 @@ No authorization required
1070
1071
  |-------------|-------------|------------------|
1071
1072
  | **200** | Successfully retrieved CMI element value | - |
1072
1073
  | **401** | Unauthorized | - |
1074
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
1073
1075
  | **404** | SCORM session not found | - |
1074
1076
 
1075
1077
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -1139,6 +1141,7 @@ No authorization required
1139
1141
  |-------------|-------------|------------------|
1140
1142
  | **200** | Successfully initialized SCORM session | - |
1141
1143
  | **401** | Unauthorized | - |
1144
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
1142
1145
  | **404** | SCORM session not found | - |
1143
1146
 
1144
1147
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -1522,6 +1525,8 @@ No authorization required
1522
1525
  | Status code | Description | Response headers |
1523
1526
  |-------------|-------------|------------------|
1524
1527
  | **200** | post session response OK | - |
1528
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
1529
+ | **404** | Course, module, or content not found | - |
1525
1530
 
1526
1531
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
1527
1532
 
@@ -1596,6 +1601,8 @@ No authorization required
1596
1601
  | Status code | Description | Response headers |
1597
1602
  |-------------|-------------|------------------|
1598
1603
  | **200** | post retake session response OK | - |
1604
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
1605
+ | **404** | Course, module, or content not found | - |
1599
1606
  | **409** | Maximum attempts reached for this content | - |
1600
1607
 
1601
1608
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -2045,6 +2052,7 @@ No authorization required
2045
2052
  |-------------|-------------|------------------|
2046
2053
  | **200** | Successfully set CMI element value | - |
2047
2054
  | **401** | Unauthorized | - |
2055
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
2048
2056
  | **404** | SCORM session not found | - |
2049
2057
 
2050
2058
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -2114,6 +2122,7 @@ No authorization required
2114
2122
  |-------------|-------------|------------------|
2115
2123
  | **200** | Successfully terminated SCORM session | - |
2116
2124
  | **401** | Unauthorized | - |
2125
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
2117
2126
  | **404** | SCORM session not found | - |
2118
2127
 
2119
2128
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
package/docs/CourseApi.md CHANGED
@@ -117,7 +117,7 @@ async function example() {
117
117
  const body = {
118
118
  // string
119
119
  courseId: courseId_example,
120
- // string
120
+ // string | Enrollment external ID.
121
121
  enrollmentId: enrollmentId_example,
122
122
  } satisfies DeleteCourseEnrollmentRequest;
123
123
 
@@ -139,7 +139,7 @@ example().catch(console.error);
139
139
  | Name | Type | Description | Notes |
140
140
  |------------- | ------------- | ------------- | -------------|
141
141
  | **courseId** | `string` | | [Defaults to `undefined`] |
142
- | **enrollmentId** | `string` | | [Defaults to `undefined`] |
142
+ | **enrollmentId** | `string` | Enrollment external ID. | [Defaults to `undefined`] |
143
143
 
144
144
  ### Return type
145
145
 
@@ -458,7 +458,7 @@ async function example() {
458
458
  const body = {
459
459
  // string
460
460
  courseId: courseId_example,
461
- // string
461
+ // string | Enrollment external ID.
462
462
  enrollmentId: enrollmentId_example,
463
463
  } satisfies GetCourseEnrollmentRequest;
464
464
 
@@ -480,7 +480,7 @@ example().catch(console.error);
480
480
  | Name | Type | Description | Notes |
481
481
  |------------- | ------------- | ------------- | -------------|
482
482
  | **courseId** | `string` | | [Defaults to `undefined`] |
483
- | **enrollmentId** | `string` | | [Defaults to `undefined`] |
483
+ | **enrollmentId** | `string` | Enrollment external ID. | [Defaults to `undefined`] |
484
484
 
485
485
  ### Return type
486
486
 
@@ -506,7 +506,7 @@ No authorization required
506
506
 
507
507
  ## getCourseEnrollments
508
508
 
509
- > GetCourseEnrollmentList getCourseEnrollments(courseId, type, status, page, pageSize)
509
+ > GetCourseEnrollmentList getCourseEnrollments(courseId, userId, type, status, page, pageSize)
510
510
 
511
511
  Get course enrollments
512
512
 
@@ -526,6 +526,8 @@ async function example() {
526
526
  const body = {
527
527
  // string
528
528
  courseId: courseId_example,
529
+ // string | Filter enrollments to a specific user external ID, or `current` for the authenticated user. (optional)
530
+ userId: userId_example,
529
531
  // 'student' | 'instructor' | Filter enrollments by user type (optional)
530
532
  type: type_example,
531
533
  // string | Comma-separated list of enrollment statuses to include. Example: `status=Enrolled,InProgress,Expired`. Unknown values are ignored. (optional)
@@ -554,6 +556,7 @@ example().catch(console.error);
554
556
  | Name | Type | Description | Notes |
555
557
  |------------- | ------------- | ------------- | -------------|
556
558
  | **courseId** | `string` | | [Defaults to `undefined`] |
559
+ | **userId** | `string` | Filter enrollments to a specific user external ID, or &#x60;current&#x60; for the authenticated user. | [Optional] [Defaults to `undefined`] |
557
560
  | **type** | `student`, `instructor` | Filter enrollments by user type | [Optional] [Defaults to `undefined`] [Enum: student, instructor] |
558
561
  | **status** | `string` | Comma-separated list of enrollment statuses to include. Example: &#x60;status&#x3D;Enrolled,InProgress,Expired&#x60;. Unknown values are ignored. | [Optional] [Defaults to `undefined`] |
559
562
  | **page** | `number` | Page number for pagination | [Optional] [Defaults to `1`] |
@@ -1300,7 +1303,7 @@ async function example() {
1300
1303
  const body = {
1301
1304
  // string
1302
1305
  courseId: courseId_example,
1303
- // string
1306
+ // string | Enrollment external ID.
1304
1307
  enrollmentId: enrollmentId_example,
1305
1308
  // PutCourseEnrollment | Course enrollment fields to update
1306
1309
  putCourseEnrollment: ...,
@@ -1324,7 +1327,7 @@ example().catch(console.error);
1324
1327
  | Name | Type | Description | Notes |
1325
1328
  |------------- | ------------- | ------------- | -------------|
1326
1329
  | **courseId** | `string` | | [Defaults to `undefined`] |
1327
- | **enrollmentId** | `string` | | [Defaults to `undefined`] |
1330
+ | **enrollmentId** | `string` | Enrollment external ID. | [Defaults to `undefined`] |
1328
1331
  | **putCourseEnrollment** | [PutCourseEnrollment](PutCourseEnrollment.md) | Course enrollment fields to update | |
1329
1332
 
1330
1333
  ### Return type
package/docs/PlayerApi.md CHANGED
@@ -146,7 +146,7 @@ No authorization required
146
146
  | Status code | Description | Response headers |
147
147
  |-------------|-------------|------------------|
148
148
  | **302** | Redirect to asset URL | - |
149
- | **403** | Forbidden | - |
149
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
150
150
  | **404** | Content not found | - |
151
151
 
152
152
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -213,7 +213,7 @@ No authorization required
213
213
  | Status code | Description | Response headers |
214
214
  |-------------|-------------|------------------|
215
215
  | **200** | HTML player page | - |
216
- | **403** | Forbidden | - |
216
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
217
217
  | **404** | Session not found | - |
218
218
 
219
219
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -280,7 +280,7 @@ No authorization required
280
280
  | Status code | Description | Response headers |
281
281
  |-------------|-------------|------------------|
282
282
  | **200** | HTML player page | - |
283
- | **403** | Forbidden | - |
283
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
284
284
  | **404** | Session not found | - |
285
285
 
286
286
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -347,7 +347,7 @@ No authorization required
347
347
  | Status code | Description | Response headers |
348
348
  |-------------|-------------|------------------|
349
349
  | **302** | Redirect to asset URL | - |
350
- | **403** | Forbidden | - |
350
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
351
351
  | **404** | Content not found | - |
352
352
 
353
353
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -414,7 +414,7 @@ No authorization required
414
414
  | Status code | Description | Response headers |
415
415
  |-------------|-------------|------------------|
416
416
  | **200** | HTML player page | - |
417
- | **403** | Forbidden | - |
417
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
418
418
  | **404** | Session not found | - |
419
419
 
420
420
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -481,7 +481,7 @@ No authorization required
481
481
  | Status code | Description | Response headers |
482
482
  |-------------|-------------|------------------|
483
483
  | **200** | HTML player page | - |
484
- | **403** | Forbidden | - |
484
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
485
485
  | **404** | Session not found | - |
486
486
 
487
487
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -552,7 +552,7 @@ No authorization required
552
552
  |-------------|-------------|------------------|
553
553
  | **200** | SCORM asset content | - |
554
554
  | **302** | Redirect to asset URL | - |
555
- | **403** | Forbidden | - |
555
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
556
556
  | **404** | Content or asset not found | - |
557
557
 
558
558
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -619,7 +619,7 @@ No authorization required
619
619
  | Status code | Description | Response headers |
620
620
  |-------------|-------------|------------------|
621
621
  | **200** | HTML player page | - |
622
- | **403** | Forbidden | - |
622
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
623
623
  | **404** | Session not found | - |
624
624
 
625
625
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -686,7 +686,7 @@ No authorization required
686
686
  | Status code | Description | Response headers |
687
687
  |-------------|-------------|------------------|
688
688
  | **302** | Redirect to asset URL | - |
689
- | **403** | Forbidden | - |
689
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
690
690
  | **404** | Content not found | - |
691
691
 
692
692
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -753,7 +753,7 @@ No authorization required
753
753
  | Status code | Description | Response headers |
754
754
  |-------------|-------------|------------------|
755
755
  | **200** | HTML player page | - |
756
- | **403** | Forbidden | - |
756
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
757
757
  | **404** | Session not found | - |
758
758
 
759
759
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
package/docs/QuizApi.md CHANGED
@@ -642,7 +642,7 @@ No authorization required
642
642
  |-------------|-------------|------------------|
643
643
  | **200** | Quiz attempt retrieved successfully | - |
644
644
  | **404** | Attempt not found | - |
645
- | **403** | Not authorized to view this attempt | - |
645
+ | **403** | Not authorized to view this attempt, or enrollment is expired, suspended, or otherwise not launchable | - |
646
646
 
647
647
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
648
648
 
@@ -1584,7 +1584,7 @@ No authorization required
1584
1584
  | **200** | Answer saved successfully | - |
1585
1585
  | **400** | Invalid answer format | - |
1586
1586
  | **404** | Attempt or question not found | - |
1587
- | **403** | Not authorized to answer this question | - |
1587
+ | **403** | Not authorized to answer this question, or enrollment is expired, suspended, or otherwise not launchable | - |
1588
1588
  | **409** | Attempt is not in progress | - |
1589
1589
 
1590
1590
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -1652,6 +1652,7 @@ No authorization required
1652
1652
  |-------------|-------------|------------------|
1653
1653
  | **201** | Quiz attempt started successfully | - |
1654
1654
  | **400** | Cannot start attempt (max attempts reached, etc.) | - |
1655
+ | **403** | Forbidden - enrollment is expired, suspended, or otherwise not launchable | - |
1655
1656
  | **404** | Quiz not found | - |
1656
1657
 
1657
1658
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
@@ -1723,7 +1724,7 @@ No authorization required
1723
1724
  | **200** | Quiz submitted successfully | - |
1724
1725
  | **400** | Cannot submit (missing required answers, etc.) | - |
1725
1726
  | **404** | Attempt not found | - |
1726
- | **403** | Not authorized to submit this attempt | - |
1727
+ | **403** | Not authorized to submit this attempt, or enrollment is expired, suspended, or otherwise not launchable | - |
1727
1728
  | **409** | Attempt already submitted | - |
1728
1729
 
1729
1730
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
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\&#39;s permissions |
10
10
  | [**getUser**](UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id |
11
+ | [**getUserEnrollments**](UserApi.md#getuserenrollments) | **GET** /users/{userId}/enrollments | Get user enrollments |
11
12
  | [**postLogin**](UserApi.md#postlogin) | **POST** /auth/login | Post a new login |
12
13
  | [**postLogout**](UserApi.md#postlogout) | **POST** /auth/logout | Logout a user |
13
14
  | [**postSignupRequest**](UserApi.md#postsignuprequest) | **POST** /auth/signup-request | Request a new organization signup |
@@ -268,6 +269,84 @@ No authorization required
268
269
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
269
270
 
270
271
 
272
+ ## getUserEnrollments
273
+
274
+ > GetCourseEnrollmentList getUserEnrollments(userId, type, status, page, pageSize)
275
+
276
+ Get user enrollments
277
+
278
+ ### Example
279
+
280
+ ```ts
281
+ import {
282
+ Configuration,
283
+ UserApi,
284
+ } from '@easyedu/js-lsm-api';
285
+ import type { GetUserEnrollmentsRequest } from '@easyedu/js-lsm-api';
286
+
287
+ async function example() {
288
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
289
+ const api = new UserApi();
290
+
291
+ const body = {
292
+ // string | User external ID, or `current` for the authenticated user.
293
+ userId: userId_example,
294
+ // 'student' | 'instructor' | Filter enrollments by user type (optional)
295
+ type: type_example,
296
+ // string | Comma-separated list of enrollment statuses to include. Example: `status=Enrolled,InProgress,Expired`. Unknown values are ignored. (optional)
297
+ status: status_example,
298
+ // number | Page number for pagination (optional)
299
+ page: 56,
300
+ // number | Number of items per page (optional)
301
+ pageSize: 56,
302
+ } satisfies GetUserEnrollmentsRequest;
303
+
304
+ try {
305
+ const data = await api.getUserEnrollments(body);
306
+ console.log(data);
307
+ } catch (error) {
308
+ console.error(error);
309
+ }
310
+ }
311
+
312
+ // Run the test
313
+ example().catch(console.error);
314
+ ```
315
+
316
+ ### Parameters
317
+
318
+
319
+ | Name | Type | Description | Notes |
320
+ |------------- | ------------- | ------------- | -------------|
321
+ | **userId** | `string` | User external ID, or &#x60;current&#x60; for the authenticated user. | [Defaults to `undefined`] |
322
+ | **type** | `student`, `instructor` | Filter enrollments by user type | [Optional] [Defaults to `undefined`] [Enum: student, instructor] |
323
+ | **status** | `string` | Comma-separated list of enrollment statuses to include. Example: &#x60;status&#x3D;Enrolled,InProgress,Expired&#x60;. Unknown values are ignored. | [Optional] [Defaults to `undefined`] |
324
+ | **page** | `number` | Page number for pagination | [Optional] [Defaults to `1`] |
325
+ | **pageSize** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
326
+
327
+ ### Return type
328
+
329
+ [**GetCourseEnrollmentList**](GetCourseEnrollmentList.md)
330
+
331
+ ### Authorization
332
+
333
+ No authorization required
334
+
335
+ ### HTTP request headers
336
+
337
+ - **Content-Type**: Not defined
338
+ - **Accept**: `application/json`
339
+
340
+
341
+ ### HTTP response details
342
+ | Status code | Description | Response headers |
343
+ |-------------|-------------|------------------|
344
+ | **200** | get user enrollments response OK | - |
345
+ | **403** | Forbidden | - |
346
+
347
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
348
+
349
+
271
350
  ## postLogin
272
351
 
273
352
  > LoginRes postLogin(postLogin)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyedu/js-lsm-api",
3
- "version": "1.73.0",
3
+ "version": "1.75.0",
4
4
  "description": "OpenAPI client for @easyedu/js-lsm-api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -118,6 +118,7 @@ export interface GetCourseEnrollmentRequest {
118
118
 
119
119
  export interface GetCourseEnrollmentsRequest {
120
120
  courseId: string;
121
+ userId?: string;
121
122
  type?: GetCourseEnrollmentsTypeEnum;
122
123
  status?: string;
123
124
  page?: number;
@@ -544,6 +545,10 @@ export class CourseApi extends runtime.BaseAPI {
544
545
 
545
546
  const queryParameters: any = {};
546
547
 
548
+ if (requestParameters['userId'] != null) {
549
+ queryParameters['userId'] = requestParameters['userId'];
550
+ }
551
+
547
552
  if (requestParameters['type'] != null) {
548
553
  queryParameters['type'] = requestParameters['type'];
549
554
  }
@@ -13,6 +13,11 @@
13
13
  */
14
14
 
15
15
  import * as runtime from '../runtime';
16
+ import {
17
+ type GetCourseEnrollmentList,
18
+ GetCourseEnrollmentListFromJSON,
19
+ GetCourseEnrollmentListToJSON,
20
+ } from '../models/GetCourseEnrollmentList';
16
21
  import {
17
22
  type GetUser,
18
23
  GetUserFromJSON,
@@ -67,6 +72,14 @@ export interface GetUserRequest {
67
72
  userId: string;
68
73
  }
69
74
 
75
+ export interface GetUserEnrollmentsRequest {
76
+ userId: string;
77
+ type?: GetUserEnrollmentsTypeEnum;
78
+ status?: string;
79
+ page?: number;
80
+ pageSize?: number;
81
+ }
82
+
70
83
  export interface PostLoginRequest {
71
84
  postLogin: PostLogin;
72
85
  }
@@ -266,6 +279,67 @@ export class UserApi extends runtime.BaseAPI {
266
279
  return await response.value();
267
280
  }
268
281
 
282
+ /**
283
+ * Creates request options for getUserEnrollments without sending the request
284
+ */
285
+ async getUserEnrollmentsRequestOpts(requestParameters: GetUserEnrollmentsRequest): Promise<runtime.RequestOpts> {
286
+ if (requestParameters['userId'] == null) {
287
+ throw new runtime.RequiredError(
288
+ 'userId',
289
+ 'Required parameter "userId" was null or undefined when calling getUserEnrollments().'
290
+ );
291
+ }
292
+
293
+ const queryParameters: any = {};
294
+
295
+ if (requestParameters['type'] != null) {
296
+ queryParameters['type'] = requestParameters['type'];
297
+ }
298
+
299
+ if (requestParameters['status'] != null) {
300
+ queryParameters['status'] = requestParameters['status'];
301
+ }
302
+
303
+ if (requestParameters['page'] != null) {
304
+ queryParameters['page'] = requestParameters['page'];
305
+ }
306
+
307
+ if (requestParameters['pageSize'] != null) {
308
+ queryParameters['pageSize'] = requestParameters['pageSize'];
309
+ }
310
+
311
+ const headerParameters: runtime.HTTPHeaders = {};
312
+
313
+
314
+ let urlPath = `/users/{userId}/enrollments`;
315
+ urlPath = urlPath.replace('{userId}', encodeURIComponent(String(requestParameters['userId'])));
316
+
317
+ return {
318
+ path: urlPath,
319
+ method: 'GET',
320
+ headers: headerParameters,
321
+ query: queryParameters,
322
+ };
323
+ }
324
+
325
+ /**
326
+ * Get user enrollments
327
+ */
328
+ async getUserEnrollmentsRaw(requestParameters: GetUserEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourseEnrollmentList>> {
329
+ const requestOptions = await this.getUserEnrollmentsRequestOpts(requestParameters);
330
+ const response = await this.request(requestOptions, initOverrides);
331
+
332
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseEnrollmentListFromJSON(jsonValue));
333
+ }
334
+
335
+ /**
336
+ * Get user enrollments
337
+ */
338
+ async getUserEnrollments(requestParameters: GetUserEnrollmentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourseEnrollmentList> {
339
+ const response = await this.getUserEnrollmentsRaw(requestParameters, initOverrides);
340
+ return await response.value();
341
+ }
342
+
269
343
  /**
270
344
  * Creates request options for postLogin without sending the request
271
345
  */
@@ -664,3 +738,12 @@ export class UserApi extends runtime.BaseAPI {
664
738
  }
665
739
 
666
740
  }
741
+
742
+ /**
743
+ * @export
744
+ */
745
+ export const GetUserEnrollmentsTypeEnum = {
746
+ Student: 'student',
747
+ Instructor: 'instructor'
748
+ } as const;
749
+ export type GetUserEnrollmentsTypeEnum = typeof GetUserEnrollmentsTypeEnum[keyof typeof GetUserEnrollmentsTypeEnum];