@easyedu/js-lsm-api 1.52.0 → 1.53.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 +3 -2
- package/dist/apis/CourseCatalogApi.d.ts +16 -1
- package/dist/apis/CourseCatalogApi.js +39 -0
- package/dist/esm/apis/CourseCatalogApi.d.ts +16 -1
- package/dist/esm/apis/CourseCatalogApi.js +40 -1
- package/docs/CourseCatalogApi.md +68 -0
- package/package.json +1 -1
- package/src/apis/CourseCatalogApi.ts +52 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @easyedu/js-lsm-api@1.
|
|
1
|
+
# @easyedu/js-lsm-api@1.53.0
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the sbzw93t49b.execute-api.us-east-2.amazonaws.com API.
|
|
4
4
|
|
|
@@ -107,6 +107,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
107
107
|
*CourseApi* | [**putCourseEnrollment**](docs/CourseApi.md#putcourseenrollment) | **PUT** /courses/{courseId}/enrollments/{enrollmentId} | Update a course enrollment
|
|
108
108
|
*CourseCatalogApi* | [**addCourseToCatalog**](docs/CourseCatalogApi.md#addcoursetocatalog) | **POST** /catalogs/{catalogId}/courses/{courseId} | Add a course to a catalog
|
|
109
109
|
*CourseCatalogApi* | [**deleteCourseCatalog**](docs/CourseCatalogApi.md#deletecoursecatalog) | **DELETE** /catalogs/{catalogId} | Delete a catalog
|
|
110
|
+
*CourseCatalogApi* | [**getCatalogCourses**](docs/CourseCatalogApi.md#getcatalogcourses) | **GET** /catalogs/{catalogId}/courses | List the courses in a catalog
|
|
110
111
|
*CourseCatalogApi* | [**getCourseCatalog**](docs/CourseCatalogApi.md#getcoursecatalog) | **GET** /catalogs/{catalogId} | Get a catalog
|
|
111
112
|
*CourseCatalogApi* | [**getCourseCatalogs**](docs/CourseCatalogApi.md#getcoursecatalogs) | **GET** /catalogs | List catalogs in the current portal
|
|
112
113
|
*CourseCatalogApi* | [**postCourseCatalog**](docs/CourseCatalogApi.md#postcoursecatalog) | **POST** /catalogs | Create a course catalog
|
|
@@ -471,7 +472,7 @@ and is automatically generated by the
|
|
|
471
472
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
472
473
|
|
|
473
474
|
- API version: `1.0.0`
|
|
474
|
-
- Package version: `1.
|
|
475
|
+
- Package version: `1.53.0`
|
|
475
476
|
- Generator version: `7.21.0`
|
|
476
477
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
477
478
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { CourseCatalog, PostCourseCatalog, PutCourseCatalog } from '../models/index';
|
|
13
|
+
import type { CourseCatalog, GetCourse, PostCourseCatalog, PutCourseCatalog } from '../models/index';
|
|
14
14
|
export interface AddCourseToCatalogRequest {
|
|
15
15
|
catalogId: string;
|
|
16
16
|
courseId: string;
|
|
@@ -18,6 +18,9 @@ export interface AddCourseToCatalogRequest {
|
|
|
18
18
|
export interface DeleteCourseCatalogRequest {
|
|
19
19
|
catalogId: string;
|
|
20
20
|
}
|
|
21
|
+
export interface GetCatalogCoursesRequest {
|
|
22
|
+
catalogId: string;
|
|
23
|
+
}
|
|
21
24
|
export interface GetCourseCatalogRequest {
|
|
22
25
|
catalogId: string;
|
|
23
26
|
}
|
|
@@ -60,6 +63,18 @@ export declare class CourseCatalogApi extends runtime.BaseAPI {
|
|
|
60
63
|
* Delete a catalog
|
|
61
64
|
*/
|
|
62
65
|
deleteCourseCatalog(requestParameters: DeleteCourseCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Creates request options for getCatalogCourses without sending the request
|
|
68
|
+
*/
|
|
69
|
+
getCatalogCoursesRequestOpts(requestParameters: GetCatalogCoursesRequest): Promise<runtime.RequestOpts>;
|
|
70
|
+
/**
|
|
71
|
+
* List the courses in a catalog
|
|
72
|
+
*/
|
|
73
|
+
getCatalogCoursesRaw(requestParameters: GetCatalogCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetCourse>>>;
|
|
74
|
+
/**
|
|
75
|
+
* List the courses in a catalog
|
|
76
|
+
*/
|
|
77
|
+
getCatalogCourses(requestParameters: GetCatalogCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetCourse>>;
|
|
63
78
|
/**
|
|
64
79
|
* Creates request options for getCourseCatalog without sending the request
|
|
65
80
|
*/
|
|
@@ -109,6 +109,45 @@ class CourseCatalogApi extends runtime.BaseAPI {
|
|
|
109
109
|
yield this.deleteCourseCatalogRaw(requestParameters, initOverrides);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates request options for getCatalogCourses without sending the request
|
|
114
|
+
*/
|
|
115
|
+
getCatalogCoursesRequestOpts(requestParameters) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
if (requestParameters['catalogId'] == null) {
|
|
118
|
+
throw new runtime.RequiredError('catalogId', 'Required parameter "catalogId" was null or undefined when calling getCatalogCourses().');
|
|
119
|
+
}
|
|
120
|
+
const queryParameters = {};
|
|
121
|
+
const headerParameters = {};
|
|
122
|
+
let urlPath = `/catalogs/{catalogId}/courses`;
|
|
123
|
+
urlPath = urlPath.replace(`{${"catalogId"}}`, encodeURIComponent(String(requestParameters['catalogId'])));
|
|
124
|
+
return {
|
|
125
|
+
path: urlPath,
|
|
126
|
+
method: 'GET',
|
|
127
|
+
headers: headerParameters,
|
|
128
|
+
query: queryParameters,
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* List the courses in a catalog
|
|
134
|
+
*/
|
|
135
|
+
getCatalogCoursesRaw(requestParameters, initOverrides) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
const requestOptions = yield this.getCatalogCoursesRequestOpts(requestParameters);
|
|
138
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
139
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.GetCourseFromJSON));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* List the courses in a catalog
|
|
144
|
+
*/
|
|
145
|
+
getCatalogCourses(requestParameters, initOverrides) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const response = yield this.getCatalogCoursesRaw(requestParameters, initOverrides);
|
|
148
|
+
return yield response.value();
|
|
149
|
+
});
|
|
150
|
+
}
|
|
112
151
|
/**
|
|
113
152
|
* Creates request options for getCourseCatalog without sending the request
|
|
114
153
|
*/
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { CourseCatalog, PostCourseCatalog, PutCourseCatalog } from '../models/index';
|
|
13
|
+
import type { CourseCatalog, GetCourse, PostCourseCatalog, PutCourseCatalog } from '../models/index';
|
|
14
14
|
export interface AddCourseToCatalogRequest {
|
|
15
15
|
catalogId: string;
|
|
16
16
|
courseId: string;
|
|
@@ -18,6 +18,9 @@ export interface AddCourseToCatalogRequest {
|
|
|
18
18
|
export interface DeleteCourseCatalogRequest {
|
|
19
19
|
catalogId: string;
|
|
20
20
|
}
|
|
21
|
+
export interface GetCatalogCoursesRequest {
|
|
22
|
+
catalogId: string;
|
|
23
|
+
}
|
|
21
24
|
export interface GetCourseCatalogRequest {
|
|
22
25
|
catalogId: string;
|
|
23
26
|
}
|
|
@@ -60,6 +63,18 @@ export declare class CourseCatalogApi extends runtime.BaseAPI {
|
|
|
60
63
|
* Delete a catalog
|
|
61
64
|
*/
|
|
62
65
|
deleteCourseCatalog(requestParameters: DeleteCourseCatalogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Creates request options for getCatalogCourses without sending the request
|
|
68
|
+
*/
|
|
69
|
+
getCatalogCoursesRequestOpts(requestParameters: GetCatalogCoursesRequest): Promise<runtime.RequestOpts>;
|
|
70
|
+
/**
|
|
71
|
+
* List the courses in a catalog
|
|
72
|
+
*/
|
|
73
|
+
getCatalogCoursesRaw(requestParameters: GetCatalogCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetCourse>>>;
|
|
74
|
+
/**
|
|
75
|
+
* List the courses in a catalog
|
|
76
|
+
*/
|
|
77
|
+
getCatalogCourses(requestParameters: GetCatalogCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetCourse>>;
|
|
63
78
|
/**
|
|
64
79
|
* Creates request options for getCourseCatalog without sending the request
|
|
65
80
|
*/
|
|
@@ -21,7 +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 { CourseCatalogFromJSON, PostCourseCatalogToJSON, PutCourseCatalogToJSON, } from '../models/index';
|
|
24
|
+
import { CourseCatalogFromJSON, GetCourseFromJSON, PostCourseCatalogToJSON, PutCourseCatalogToJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
@@ -106,6 +106,45 @@ export class CourseCatalogApi extends runtime.BaseAPI {
|
|
|
106
106
|
yield this.deleteCourseCatalogRaw(requestParameters, initOverrides);
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates request options for getCatalogCourses without sending the request
|
|
111
|
+
*/
|
|
112
|
+
getCatalogCoursesRequestOpts(requestParameters) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
if (requestParameters['catalogId'] == null) {
|
|
115
|
+
throw new runtime.RequiredError('catalogId', 'Required parameter "catalogId" was null or undefined when calling getCatalogCourses().');
|
|
116
|
+
}
|
|
117
|
+
const queryParameters = {};
|
|
118
|
+
const headerParameters = {};
|
|
119
|
+
let urlPath = `/catalogs/{catalogId}/courses`;
|
|
120
|
+
urlPath = urlPath.replace(`{${"catalogId"}}`, encodeURIComponent(String(requestParameters['catalogId'])));
|
|
121
|
+
return {
|
|
122
|
+
path: urlPath,
|
|
123
|
+
method: 'GET',
|
|
124
|
+
headers: headerParameters,
|
|
125
|
+
query: queryParameters,
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* List the courses in a catalog
|
|
131
|
+
*/
|
|
132
|
+
getCatalogCoursesRaw(requestParameters, initOverrides) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
const requestOptions = yield this.getCatalogCoursesRequestOpts(requestParameters);
|
|
135
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
136
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCourseFromJSON));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* List the courses in a catalog
|
|
141
|
+
*/
|
|
142
|
+
getCatalogCourses(requestParameters, initOverrides) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const response = yield this.getCatalogCoursesRaw(requestParameters, initOverrides);
|
|
145
|
+
return yield response.value();
|
|
146
|
+
});
|
|
147
|
+
}
|
|
109
148
|
/**
|
|
110
149
|
* Creates request options for getCourseCatalog without sending the request
|
|
111
150
|
*/
|
package/docs/CourseCatalogApi.md
CHANGED
|
@@ -6,6 +6,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**addCourseToCatalog**](CourseCatalogApi.md#addcoursetocatalog) | **POST** /catalogs/{catalogId}/courses/{courseId} | Add a course to a catalog |
|
|
8
8
|
| [**deleteCourseCatalog**](CourseCatalogApi.md#deletecoursecatalog) | **DELETE** /catalogs/{catalogId} | Delete a catalog |
|
|
9
|
+
| [**getCatalogCourses**](CourseCatalogApi.md#getcatalogcourses) | **GET** /catalogs/{catalogId}/courses | List the courses in a catalog |
|
|
9
10
|
| [**getCourseCatalog**](CourseCatalogApi.md#getcoursecatalog) | **GET** /catalogs/{catalogId} | Get a catalog |
|
|
10
11
|
| [**getCourseCatalogs**](CourseCatalogApi.md#getcoursecatalogs) | **GET** /catalogs | List catalogs in the current portal |
|
|
11
12
|
| [**postCourseCatalog**](CourseCatalogApi.md#postcoursecatalog) | **POST** /catalogs | Create a course catalog |
|
|
@@ -149,6 +150,73 @@ No authorization required
|
|
|
149
150
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
150
151
|
|
|
151
152
|
|
|
153
|
+
## getCatalogCourses
|
|
154
|
+
|
|
155
|
+
> Array<GetCourse> getCatalogCourses(catalogId)
|
|
156
|
+
|
|
157
|
+
List the courses in a catalog
|
|
158
|
+
|
|
159
|
+
### Example
|
|
160
|
+
|
|
161
|
+
```ts
|
|
162
|
+
import {
|
|
163
|
+
Configuration,
|
|
164
|
+
CourseCatalogApi,
|
|
165
|
+
} from '@easyedu/js-lsm-api';
|
|
166
|
+
import type { GetCatalogCoursesRequest } from '@easyedu/js-lsm-api';
|
|
167
|
+
|
|
168
|
+
async function example() {
|
|
169
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
170
|
+
const api = new CourseCatalogApi();
|
|
171
|
+
|
|
172
|
+
const body = {
|
|
173
|
+
// string
|
|
174
|
+
catalogId: catalogId_example,
|
|
175
|
+
} satisfies GetCatalogCoursesRequest;
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
const data = await api.getCatalogCourses(body);
|
|
179
|
+
console.log(data);
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error(error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Run the test
|
|
186
|
+
example().catch(console.error);
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Parameters
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
| Name | Type | Description | Notes |
|
|
193
|
+
|------------- | ------------- | ------------- | -------------|
|
|
194
|
+
| **catalogId** | `string` | | [Defaults to `undefined`] |
|
|
195
|
+
|
|
196
|
+
### Return type
|
|
197
|
+
|
|
198
|
+
[**Array<GetCourse>**](GetCourse.md)
|
|
199
|
+
|
|
200
|
+
### Authorization
|
|
201
|
+
|
|
202
|
+
No authorization required
|
|
203
|
+
|
|
204
|
+
### HTTP request headers
|
|
205
|
+
|
|
206
|
+
- **Content-Type**: Not defined
|
|
207
|
+
- **Accept**: `application/json`
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
### HTTP response details
|
|
211
|
+
| Status code | Description | Response headers |
|
|
212
|
+
|-------------|-------------|------------------|
|
|
213
|
+
| **200** | Courses in the catalog | - |
|
|
214
|
+
| **403** | Catalog not owned by your portal | - |
|
|
215
|
+
| **404** | Catalog not found | - |
|
|
216
|
+
|
|
217
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
218
|
+
|
|
219
|
+
|
|
152
220
|
## getCourseCatalog
|
|
153
221
|
|
|
154
222
|
> CourseCatalog getCourseCatalog(catalogId)
|
package/package.json
CHANGED
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
CourseCatalog,
|
|
19
|
+
GetCourse,
|
|
19
20
|
PostCourseCatalog,
|
|
20
21
|
PutCourseCatalog,
|
|
21
22
|
} from '../models/index';
|
|
22
23
|
import {
|
|
23
24
|
CourseCatalogFromJSON,
|
|
24
25
|
CourseCatalogToJSON,
|
|
26
|
+
GetCourseFromJSON,
|
|
27
|
+
GetCourseToJSON,
|
|
25
28
|
PostCourseCatalogFromJSON,
|
|
26
29
|
PostCourseCatalogToJSON,
|
|
27
30
|
PutCourseCatalogFromJSON,
|
|
@@ -37,6 +40,10 @@ export interface DeleteCourseCatalogRequest {
|
|
|
37
40
|
catalogId: string;
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
export interface GetCatalogCoursesRequest {
|
|
44
|
+
catalogId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
export interface GetCourseCatalogRequest {
|
|
41
48
|
catalogId: string;
|
|
42
49
|
}
|
|
@@ -156,6 +163,51 @@ export class CourseCatalogApi extends runtime.BaseAPI {
|
|
|
156
163
|
await this.deleteCourseCatalogRaw(requestParameters, initOverrides);
|
|
157
164
|
}
|
|
158
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Creates request options for getCatalogCourses without sending the request
|
|
168
|
+
*/
|
|
169
|
+
async getCatalogCoursesRequestOpts(requestParameters: GetCatalogCoursesRequest): Promise<runtime.RequestOpts> {
|
|
170
|
+
if (requestParameters['catalogId'] == null) {
|
|
171
|
+
throw new runtime.RequiredError(
|
|
172
|
+
'catalogId',
|
|
173
|
+
'Required parameter "catalogId" was null or undefined when calling getCatalogCourses().'
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const queryParameters: any = {};
|
|
178
|
+
|
|
179
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
let urlPath = `/catalogs/{catalogId}/courses`;
|
|
183
|
+
urlPath = urlPath.replace(`{${"catalogId"}}`, encodeURIComponent(String(requestParameters['catalogId'])));
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
path: urlPath,
|
|
187
|
+
method: 'GET',
|
|
188
|
+
headers: headerParameters,
|
|
189
|
+
query: queryParameters,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* List the courses in a catalog
|
|
195
|
+
*/
|
|
196
|
+
async getCatalogCoursesRaw(requestParameters: GetCatalogCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetCourse>>> {
|
|
197
|
+
const requestOptions = await this.getCatalogCoursesRequestOpts(requestParameters);
|
|
198
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
199
|
+
|
|
200
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetCourseFromJSON));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* List the courses in a catalog
|
|
205
|
+
*/
|
|
206
|
+
async getCatalogCourses(requestParameters: GetCatalogCoursesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetCourse>> {
|
|
207
|
+
const response = await this.getCatalogCoursesRaw(requestParameters, initOverrides);
|
|
208
|
+
return await response.value();
|
|
209
|
+
}
|
|
210
|
+
|
|
159
211
|
/**
|
|
160
212
|
* Creates request options for getCourseCatalog without sending the request
|
|
161
213
|
*/
|