@easyedu/js-lsm-api 1.79.0 → 1.81.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.
Files changed (133) hide show
  1. package/.openapi-generator/FILES +26 -0
  2. package/README.md +18 -2
  3. package/dist/apis/RichTextApi.d.ts +67 -0
  4. package/dist/apis/RichTextApi.js +158 -0
  5. package/dist/apis/UserApi.d.ts +42 -0
  6. package/dist/apis/UserApi.js +79 -1
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/apis/RichTextApi.d.ts +67 -0
  10. package/dist/esm/apis/RichTextApi.js +154 -0
  11. package/dist/esm/apis/UserApi.d.ts +42 -0
  12. package/dist/esm/apis/UserApi.js +78 -0
  13. package/dist/esm/apis/index.d.ts +1 -0
  14. package/dist/esm/apis/index.js +1 -0
  15. package/dist/esm/models/GetQuestion.d.ts +7 -6
  16. package/dist/esm/models/GetQuestion.js +5 -4
  17. package/dist/esm/models/GetQuestionAnswerChoicesInner.d.ts +3 -2
  18. package/dist/esm/models/GetQuestionAnswerChoicesInner.js +3 -2
  19. package/dist/esm/models/GetRichTextAssetUpload.d.ts +50 -0
  20. package/dist/esm/models/GetRichTextAssetUpload.js +55 -0
  21. package/dist/esm/models/GetUserCourseList.d.ts +57 -0
  22. package/dist/esm/models/GetUserCourseList.js +60 -0
  23. package/dist/esm/models/GetUserCourseListItem.d.ts +54 -0
  24. package/dist/esm/models/GetUserCourseListItem.js +59 -0
  25. package/dist/esm/models/GetUserCourseListItemCertificate.d.ts +74 -0
  26. package/dist/esm/models/GetUserCourseListItemCertificate.js +75 -0
  27. package/dist/esm/models/GetUserCourseListItemCourse.d.ts +89 -0
  28. package/dist/esm/models/GetUserCourseListItemCourse.js +82 -0
  29. package/dist/esm/models/GetUserCourseListItemEnrollment.d.ts +111 -0
  30. package/dist/esm/models/GetUserCourseListItemEnrollment.js +105 -0
  31. package/dist/esm/models/GetUserCourseListItemProgress.d.ts +44 -0
  32. package/dist/esm/models/GetUserCourseListItemProgress.js +51 -0
  33. package/dist/esm/models/PostQuestion.d.ts +7 -6
  34. package/dist/esm/models/PostQuestion.js +5 -4
  35. package/dist/esm/models/PostQuestionAnswerChoicesInner.d.ts +3 -2
  36. package/dist/esm/models/PostQuestionAnswerChoicesInner.js +3 -2
  37. package/dist/esm/models/PostRichTextAssetComplete.d.ts +44 -0
  38. package/dist/esm/models/PostRichTextAssetComplete.js +47 -0
  39. package/dist/esm/models/PostRichTextAssetUpload.d.ts +69 -0
  40. package/dist/esm/models/PostRichTextAssetUpload.js +65 -0
  41. package/dist/esm/models/PutQuestion.d.ts +7 -6
  42. package/dist/esm/models/PutQuestion.js +5 -4
  43. package/dist/esm/models/PutQuestionAnswerChoicesInner.d.ts +3 -2
  44. package/dist/esm/models/PutQuestionAnswerChoicesInner.js +3 -2
  45. package/dist/esm/models/RichTextAsset.d.ts +62 -0
  46. package/dist/esm/models/RichTextAsset.js +59 -0
  47. package/dist/esm/models/RichTextDocument.d.ts +60 -0
  48. package/dist/esm/models/RichTextDocument.js +62 -0
  49. package/dist/esm/models/RichTextInput.d.ts +47 -0
  50. package/dist/esm/models/RichTextInput.js +53 -0
  51. package/dist/esm/models/index.d.ts +12 -0
  52. package/dist/esm/models/index.js +12 -0
  53. package/dist/models/GetQuestion.d.ts +7 -6
  54. package/dist/models/GetQuestion.js +5 -4
  55. package/dist/models/GetQuestionAnswerChoicesInner.d.ts +3 -2
  56. package/dist/models/GetQuestionAnswerChoicesInner.js +3 -2
  57. package/dist/models/GetRichTextAssetUpload.d.ts +50 -0
  58. package/dist/models/GetRichTextAssetUpload.js +62 -0
  59. package/dist/models/GetUserCourseList.d.ts +57 -0
  60. package/dist/models/GetUserCourseList.js +67 -0
  61. package/dist/models/GetUserCourseListItem.d.ts +54 -0
  62. package/dist/models/GetUserCourseListItem.js +66 -0
  63. package/dist/models/GetUserCourseListItemCertificate.d.ts +74 -0
  64. package/dist/models/GetUserCourseListItemCertificate.js +83 -0
  65. package/dist/models/GetUserCourseListItemCourse.d.ts +89 -0
  66. package/dist/models/GetUserCourseListItemCourse.js +90 -0
  67. package/dist/models/GetUserCourseListItemEnrollment.d.ts +111 -0
  68. package/dist/models/GetUserCourseListItemEnrollment.js +113 -0
  69. package/dist/models/GetUserCourseListItemProgress.d.ts +44 -0
  70. package/dist/models/GetUserCourseListItemProgress.js +58 -0
  71. package/dist/models/PostQuestion.d.ts +7 -6
  72. package/dist/models/PostQuestion.js +5 -4
  73. package/dist/models/PostQuestionAnswerChoicesInner.d.ts +3 -2
  74. package/dist/models/PostQuestionAnswerChoicesInner.js +3 -2
  75. package/dist/models/PostRichTextAssetComplete.d.ts +44 -0
  76. package/dist/models/PostRichTextAssetComplete.js +54 -0
  77. package/dist/models/PostRichTextAssetUpload.d.ts +69 -0
  78. package/dist/models/PostRichTextAssetUpload.js +73 -0
  79. package/dist/models/PutQuestion.d.ts +7 -6
  80. package/dist/models/PutQuestion.js +5 -4
  81. package/dist/models/PutQuestionAnswerChoicesInner.d.ts +3 -2
  82. package/dist/models/PutQuestionAnswerChoicesInner.js +3 -2
  83. package/dist/models/RichTextAsset.d.ts +62 -0
  84. package/dist/models/RichTextAsset.js +66 -0
  85. package/dist/models/RichTextDocument.d.ts +60 -0
  86. package/dist/models/RichTextDocument.js +70 -0
  87. package/dist/models/RichTextInput.d.ts +47 -0
  88. package/dist/models/RichTextInput.js +61 -0
  89. package/dist/models/index.d.ts +12 -0
  90. package/dist/models/index.js +12 -0
  91. package/docs/GetQuestion.md +2 -2
  92. package/docs/GetQuestionAnswerChoicesInner.md +1 -1
  93. package/docs/GetRichTextAssetUpload.md +40 -0
  94. package/docs/GetUserCourseList.md +43 -0
  95. package/docs/GetUserCourseListItem.md +41 -0
  96. package/docs/GetUserCourseListItemCertificate.md +43 -0
  97. package/docs/GetUserCourseListItemCourse.md +51 -0
  98. package/docs/GetUserCourseListItemEnrollment.md +49 -0
  99. package/docs/GetUserCourseListItemProgress.md +39 -0
  100. package/docs/PostQuestion.md +2 -2
  101. package/docs/PostQuestionAnswerChoicesInner.md +1 -1
  102. package/docs/PostRichTextAssetComplete.md +38 -0
  103. package/docs/PostRichTextAssetUpload.md +44 -0
  104. package/docs/PutQuestion.md +2 -2
  105. package/docs/PutQuestionAnswerChoicesInner.md +1 -1
  106. package/docs/RichTextApi.md +212 -0
  107. package/docs/RichTextAsset.md +44 -0
  108. package/docs/RichTextDocument.md +40 -0
  109. package/docs/RichTextInput.md +36 -0
  110. package/docs/UserApi.md +90 -0
  111. package/package.json +1 -1
  112. package/src/apis/RichTextApi.ts +201 -0
  113. package/src/apis/UserApi.ts +108 -0
  114. package/src/apis/index.ts +1 -0
  115. package/src/models/GetQuestion.ts +17 -10
  116. package/src/models/GetQuestionAnswerChoicesInner.ts +12 -4
  117. package/src/models/GetRichTextAssetUpload.ts +93 -0
  118. package/src/models/GetUserCourseList.ts +110 -0
  119. package/src/models/GetUserCourseListItem.ts +122 -0
  120. package/src/models/GetUserCourseListItemCertificate.ts +124 -0
  121. package/src/models/GetUserCourseListItemCourse.ts +149 -0
  122. package/src/models/GetUserCourseListItemEnrollment.ts +171 -0
  123. package/src/models/GetUserCourseListItemProgress.ts +84 -0
  124. package/src/models/PostQuestion.ts +17 -10
  125. package/src/models/PostQuestionAnswerChoicesInner.ts +12 -4
  126. package/src/models/PostRichTextAssetComplete.ts +82 -0
  127. package/src/models/PostRichTextAssetUpload.ts +119 -0
  128. package/src/models/PutQuestion.ts +17 -10
  129. package/src/models/PutQuestionAnswerChoicesInner.ts +12 -4
  130. package/src/models/RichTextAsset.ts +109 -0
  131. package/src/models/RichTextDocument.ts +111 -0
  132. package/src/models/RichTextInput.ts +85 -0
  133. package/src/models/index.ts +12 -0
@@ -0,0 +1,40 @@
1
+
2
+ # RichTextDocument
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `format` | string
10
+ `document` | { [key: string]: any; }
11
+ `plainText` | string
12
+ `assets` | [Array<RichTextAsset>](RichTextAsset.md)
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import type { RichTextDocument } from '@easyedu/js-lsm-api'
18
+
19
+ // TODO: Update the object below with actual values
20
+ const example = {
21
+ "format": null,
22
+ "document": null,
23
+ "plainText": null,
24
+ "assets": null,
25
+ } satisfies RichTextDocument
26
+
27
+ console.log(example)
28
+
29
+ // Convert the instance to a JSON string
30
+ const exampleJSON: string = JSON.stringify(example)
31
+ console.log(exampleJSON)
32
+
33
+ // Parse the JSON string back to an object
34
+ const exampleParsed = JSON.parse(exampleJSON) as RichTextDocument
35
+ console.log(exampleParsed)
36
+ ```
37
+
38
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
39
+
40
+
@@ -0,0 +1,36 @@
1
+
2
+ # RichTextInput
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `format` | string
10
+ `document` | { [key: string]: any; }
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { RichTextInput } from '@easyedu/js-lsm-api'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "format": null,
20
+ "document": null,
21
+ } satisfies RichTextInput
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as RichTextInput
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyedu/js-lsm-api",
3
- "version": "1.79.0",
3
+ "version": "1.81.0",
4
4
  "description": "OpenAPI client for @easyedu/js-lsm-api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -0,0 +1,201 @@
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 * as runtime from '../runtime';
16
+ import {
17
+ type GetRichTextAssetUpload,
18
+ GetRichTextAssetUploadFromJSON,
19
+ GetRichTextAssetUploadToJSON,
20
+ } from '../models/GetRichTextAssetUpload';
21
+ import {
22
+ type PostRichTextAssetComplete,
23
+ PostRichTextAssetCompleteFromJSON,
24
+ PostRichTextAssetCompleteToJSON,
25
+ } from '../models/PostRichTextAssetComplete';
26
+ import {
27
+ type PostRichTextAssetUpload,
28
+ PostRichTextAssetUploadFromJSON,
29
+ PostRichTextAssetUploadToJSON,
30
+ } from '../models/PostRichTextAssetUpload';
31
+ import {
32
+ type RichTextAsset,
33
+ RichTextAssetFromJSON,
34
+ RichTextAssetToJSON,
35
+ } from '../models/RichTextAsset';
36
+
37
+ export interface GetRichTextAssetRequest {
38
+ assetId: string;
39
+ }
40
+
41
+ export interface PostRichTextAssetCompleteRequest {
42
+ assetId: string;
43
+ postRichTextAssetComplete: PostRichTextAssetComplete;
44
+ }
45
+
46
+ export interface PostRichTextAssetUploadRequest {
47
+ postRichTextAssetUpload: PostRichTextAssetUpload;
48
+ }
49
+
50
+ /**
51
+ *
52
+ */
53
+ export class RichTextApi extends runtime.BaseAPI {
54
+
55
+ /**
56
+ * Creates request options for getRichTextAsset without sending the request
57
+ */
58
+ async getRichTextAssetRequestOpts(requestParameters: GetRichTextAssetRequest): Promise<runtime.RequestOpts> {
59
+ if (requestParameters['assetId'] == null) {
60
+ throw new runtime.RequiredError(
61
+ 'assetId',
62
+ 'Required parameter "assetId" was null or undefined when calling getRichTextAsset().'
63
+ );
64
+ }
65
+
66
+ const queryParameters: any = {};
67
+
68
+ const headerParameters: runtime.HTTPHeaders = {};
69
+
70
+
71
+ let urlPath = `/rich-text/assets/{assetId}`;
72
+ urlPath = urlPath.replace('{assetId}', encodeURIComponent(String(requestParameters['assetId'])));
73
+
74
+ return {
75
+ path: urlPath,
76
+ method: 'GET',
77
+ headers: headerParameters,
78
+ query: queryParameters,
79
+ };
80
+ }
81
+
82
+ /**
83
+ * Redirect to a signed rich text asset URL
84
+ */
85
+ async getRichTextAssetRaw(requestParameters: GetRichTextAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
86
+ const requestOptions = await this.getRichTextAssetRequestOpts(requestParameters);
87
+ const response = await this.request(requestOptions, initOverrides);
88
+
89
+ return new runtime.VoidApiResponse(response);
90
+ }
91
+
92
+ /**
93
+ * Redirect to a signed rich text asset URL
94
+ */
95
+ async getRichTextAsset(requestParameters: GetRichTextAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
96
+ await this.getRichTextAssetRaw(requestParameters, initOverrides);
97
+ }
98
+
99
+ /**
100
+ * Creates request options for postRichTextAssetComplete without sending the request
101
+ */
102
+ async postRichTextAssetCompleteRequestOpts(requestParameters: PostRichTextAssetCompleteRequest): Promise<runtime.RequestOpts> {
103
+ if (requestParameters['assetId'] == null) {
104
+ throw new runtime.RequiredError(
105
+ 'assetId',
106
+ 'Required parameter "assetId" was null or undefined when calling postRichTextAssetComplete().'
107
+ );
108
+ }
109
+
110
+ if (requestParameters['postRichTextAssetComplete'] == null) {
111
+ throw new runtime.RequiredError(
112
+ 'postRichTextAssetComplete',
113
+ 'Required parameter "postRichTextAssetComplete" was null or undefined when calling postRichTextAssetComplete().'
114
+ );
115
+ }
116
+
117
+ const queryParameters: any = {};
118
+
119
+ const headerParameters: runtime.HTTPHeaders = {};
120
+
121
+ headerParameters['Content-Type'] = 'application/json';
122
+
123
+
124
+ let urlPath = `/rich-text/assets/{assetId}/complete`;
125
+ urlPath = urlPath.replace('{assetId}', encodeURIComponent(String(requestParameters['assetId'])));
126
+
127
+ return {
128
+ path: urlPath,
129
+ method: 'POST',
130
+ headers: headerParameters,
131
+ query: queryParameters,
132
+ body: PostRichTextAssetCompleteToJSON(requestParameters['postRichTextAssetComplete']),
133
+ };
134
+ }
135
+
136
+ /**
137
+ * Complete a pending rich text asset upload
138
+ */
139
+ async postRichTextAssetCompleteRaw(requestParameters: PostRichTextAssetCompleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RichTextAsset>> {
140
+ const requestOptions = await this.postRichTextAssetCompleteRequestOpts(requestParameters);
141
+ const response = await this.request(requestOptions, initOverrides);
142
+
143
+ return new runtime.JSONApiResponse(response, (jsonValue) => RichTextAssetFromJSON(jsonValue));
144
+ }
145
+
146
+ /**
147
+ * Complete a pending rich text asset upload
148
+ */
149
+ async postRichTextAssetComplete(requestParameters: PostRichTextAssetCompleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RichTextAsset> {
150
+ const response = await this.postRichTextAssetCompleteRaw(requestParameters, initOverrides);
151
+ return await response.value();
152
+ }
153
+
154
+ /**
155
+ * Creates request options for postRichTextAssetUpload without sending the request
156
+ */
157
+ async postRichTextAssetUploadRequestOpts(requestParameters: PostRichTextAssetUploadRequest): Promise<runtime.RequestOpts> {
158
+ if (requestParameters['postRichTextAssetUpload'] == null) {
159
+ throw new runtime.RequiredError(
160
+ 'postRichTextAssetUpload',
161
+ 'Required parameter "postRichTextAssetUpload" was null or undefined when calling postRichTextAssetUpload().'
162
+ );
163
+ }
164
+
165
+ const queryParameters: any = {};
166
+
167
+ const headerParameters: runtime.HTTPHeaders = {};
168
+
169
+ headerParameters['Content-Type'] = 'application/json';
170
+
171
+
172
+ let urlPath = `/rich-text/assets/uploads`;
173
+
174
+ return {
175
+ path: urlPath,
176
+ method: 'POST',
177
+ headers: headerParameters,
178
+ query: queryParameters,
179
+ body: PostRichTextAssetUploadToJSON(requestParameters['postRichTextAssetUpload']),
180
+ };
181
+ }
182
+
183
+ /**
184
+ * Create a pending rich text asset upload
185
+ */
186
+ async postRichTextAssetUploadRaw(requestParameters: PostRichTextAssetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetRichTextAssetUpload>> {
187
+ const requestOptions = await this.postRichTextAssetUploadRequestOpts(requestParameters);
188
+ const response = await this.request(requestOptions, initOverrides);
189
+
190
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetRichTextAssetUploadFromJSON(jsonValue));
191
+ }
192
+
193
+ /**
194
+ * Create a pending rich text asset upload
195
+ */
196
+ async postRichTextAssetUpload(requestParameters: PostRichTextAssetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetRichTextAssetUpload> {
197
+ const response = await this.postRichTextAssetUploadRaw(requestParameters, initOverrides);
198
+ return await response.value();
199
+ }
200
+
201
+ }
@@ -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
  */
package/src/apis/index.ts CHANGED
@@ -15,6 +15,7 @@ export * from './PortalSublicenseApi';
15
15
  export * from './QuestionApi';
16
16
  export * from './QuizApi';
17
17
  export * from './ReportingApi';
18
+ export * from './RichTextApi';
18
19
  export * from './RoleApi';
19
20
  export * from './SupportTicketApi';
20
21
  export * from './SystemApi';
@@ -13,6 +13,13 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { RichTextDocument } from './RichTextDocument';
17
+ import {
18
+ RichTextDocumentFromJSON,
19
+ RichTextDocumentFromJSONTyped,
20
+ RichTextDocumentToJSON,
21
+ RichTextDocumentToJSONTyped,
22
+ } from './RichTextDocument';
16
23
  import type { GetQuestionAnswerChoicesInner } from './GetQuestionAnswerChoicesInner';
17
24
  import {
18
25
  GetQuestionAnswerChoicesInnerFromJSON,
@@ -41,11 +48,11 @@ export interface GetQuestion {
41
48
  */
42
49
  readonly id: string;
43
50
  /**
44
- * The main question text or prompt
45
- * @type {string}
51
+ *
52
+ * @type {RichTextDocument}
46
53
  * @memberof GetQuestion
47
54
  */
48
- questionText: string;
55
+ questionText: RichTextDocument;
49
56
  /**
50
57
  * Type of question
51
58
  * @type {GetQuestionQuestionTypeEnum}
@@ -65,11 +72,11 @@ export interface GetQuestion {
65
72
  */
66
73
  correctAnswer?: string;
67
74
  /**
68
- * Explanation of the correct answer
69
- * @type {string}
75
+ *
76
+ * @type {RichTextDocument}
70
77
  * @memberof GetQuestion
71
78
  */
72
- explanation?: string;
79
+ explanation?: RichTextDocument;
73
80
  /**
74
81
  * Topic category (Fire Alarm, Fire Pump, Fire Sprinkler, etc.)
75
82
  * @type {string}
@@ -176,11 +183,11 @@ export function GetQuestionFromJSONTyped(json: any, ignoreDiscriminator: boolean
176
183
  return {
177
184
 
178
185
  'id': json['id'],
179
- 'questionText': json['question_text'],
186
+ 'questionText': RichTextDocumentFromJSON(json['question_text']),
180
187
  'questionType': json['question_type'],
181
188
  'answerChoices': json['answer_choices'] == null ? undefined : ((json['answer_choices'] as Array<any>).map(GetQuestionAnswerChoicesInnerFromJSON)),
182
189
  'correctAnswer': json['correct_answer'] == null ? undefined : json['correct_answer'],
183
- 'explanation': json['explanation'] == null ? undefined : json['explanation'],
190
+ 'explanation': json['explanation'] == null ? undefined : RichTextDocumentFromJSON(json['explanation']),
184
191
  'topic': json['topic'],
185
192
  'difficultyLevel': json['difficulty_level'],
186
193
  'tags': json['tags'] == null ? undefined : json['tags'],
@@ -204,11 +211,11 @@ export function GetQuestionToJSONTyped(value?: Omit<GetQuestion, 'id'|'created_d
204
211
 
205
212
  return {
206
213
 
207
- 'question_text': value['questionText'],
214
+ 'question_text': RichTextDocumentToJSON(value['questionText']),
208
215
  'question_type': value['questionType'],
209
216
  'answer_choices': value['answerChoices'] == null ? undefined : ((value['answerChoices'] as Array<any>).map(GetQuestionAnswerChoicesInnerToJSON)),
210
217
  'correct_answer': value['correctAnswer'],
211
- 'explanation': value['explanation'],
218
+ 'explanation': RichTextDocumentToJSON(value['explanation']),
212
219
  'topic': value['topic'],
213
220
  'difficulty_level': value['difficultyLevel'],
214
221
  'tags': value['tags'],
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { RichTextDocument } from './RichTextDocument';
17
+ import {
18
+ RichTextDocumentFromJSON,
19
+ RichTextDocumentFromJSONTyped,
20
+ RichTextDocumentToJSON,
21
+ RichTextDocumentToJSONTyped,
22
+ } from './RichTextDocument';
23
+
16
24
  /**
17
25
  *
18
26
  * @export
@@ -27,10 +35,10 @@ export interface GetQuestionAnswerChoicesInner {
27
35
  id: string;
28
36
  /**
29
37
  *
30
- * @type {string}
38
+ * @type {RichTextDocument}
31
39
  * @memberof GetQuestionAnswerChoicesInner
32
40
  */
33
- text: string;
41
+ text: RichTextDocument;
34
42
  /**
35
43
  *
36
44
  * @type {boolean}
@@ -60,7 +68,7 @@ export function GetQuestionAnswerChoicesInnerFromJSONTyped(json: any, ignoreDisc
60
68
  return {
61
69
 
62
70
  'id': json['id'],
63
- 'text': json['text'],
71
+ 'text': RichTextDocumentFromJSON(json['text']),
64
72
  'isCorrect': json['is_correct'],
65
73
  };
66
74
  }
@@ -77,7 +85,7 @@ export function GetQuestionAnswerChoicesInnerToJSONTyped(value?: GetQuestionAnsw
77
85
  return {
78
86
 
79
87
  'id': value['id'],
80
- 'text': value['text'],
88
+ 'text': RichTextDocumentToJSON(value['text']),
81
89
  'is_correct': value['isCorrect'],
82
90
  };
83
91
  }