@easyedu/js-lsm-api 1.52.0 → 1.54.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/apis/CourseShareApi.d.ts +19 -3
- package/dist/apis/CourseShareApi.js +22 -7
- package/dist/esm/apis/CourseCatalogApi.d.ts +16 -1
- package/dist/esm/apis/CourseCatalogApi.js +40 -1
- package/dist/esm/apis/CourseShareApi.d.ts +19 -3
- package/dist/esm/apis/CourseShareApi.js +21 -6
- package/dist/esm/models/CourseShare.d.ts +12 -3
- package/dist/esm/models/CourseShare.js +7 -3
- package/dist/models/CourseShare.d.ts +12 -3
- package/dist/models/CourseShare.js +7 -3
- package/docs/CourseCatalogApi.md +68 -0
- package/docs/CourseShare.md +5 -2
- package/docs/CourseShareApi.md +14 -3
- package/package.json +1 -1
- package/src/apis/CourseCatalogApi.ts +52 -0
- package/src/apis/CourseShareApi.ts +27 -5
- package/src/models/CourseShare.ts +18 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @easyedu/js-lsm-api@1.
|
|
1
|
+
# @easyedu/js-lsm-api@1.54.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.54.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
|
*/
|
|
@@ -14,6 +14,9 @@ import type { CourseShare, PostOfferCatalog, PostOfferCatalogResponse, PostOffer
|
|
|
14
14
|
export interface DeleteCourseShareRequest {
|
|
15
15
|
shareId: string;
|
|
16
16
|
}
|
|
17
|
+
export interface GetCourseSharesOfferedToMeRequest {
|
|
18
|
+
state?: GetCourseSharesOfferedToMeStateEnum;
|
|
19
|
+
}
|
|
17
20
|
export interface PostOfferCatalogRequest {
|
|
18
21
|
catalogId: string;
|
|
19
22
|
postOfferCatalog: PostOfferCatalog;
|
|
@@ -67,15 +70,17 @@ export declare class CourseShareApi extends runtime.BaseAPI {
|
|
|
67
70
|
/**
|
|
68
71
|
* Creates request options for getCourseSharesOfferedToMe without sending the request
|
|
69
72
|
*/
|
|
70
|
-
getCourseSharesOfferedToMeRequestOpts(): Promise<runtime.RequestOpts>;
|
|
73
|
+
getCourseSharesOfferedToMeRequestOpts(requestParameters: GetCourseSharesOfferedToMeRequest): Promise<runtime.RequestOpts>;
|
|
71
74
|
/**
|
|
75
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
72
76
|
* List shares offered to the current portal
|
|
73
77
|
*/
|
|
74
|
-
getCourseSharesOfferedToMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CourseShare>>>;
|
|
78
|
+
getCourseSharesOfferedToMeRaw(requestParameters: GetCourseSharesOfferedToMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CourseShare>>>;
|
|
75
79
|
/**
|
|
80
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
76
81
|
* List shares offered to the current portal
|
|
77
82
|
*/
|
|
78
|
-
getCourseSharesOfferedToMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CourseShare>>;
|
|
83
|
+
getCourseSharesOfferedToMe(requestParameters?: GetCourseSharesOfferedToMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CourseShare>>;
|
|
79
84
|
/**
|
|
80
85
|
* Creates request options for postOfferCatalog without sending the request
|
|
81
86
|
*/
|
|
@@ -151,3 +156,14 @@ export declare class CourseShareApi extends runtime.BaseAPI {
|
|
|
151
156
|
*/
|
|
152
157
|
putDeclineShare(requestParameters: PutDeclineShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
153
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* @export
|
|
161
|
+
*/
|
|
162
|
+
export declare const GetCourseSharesOfferedToMeStateEnum: {
|
|
163
|
+
readonly Offered: "offered";
|
|
164
|
+
readonly AcceptedMirror: "accepted_mirror";
|
|
165
|
+
readonly AcceptedClone: "accepted_clone";
|
|
166
|
+
readonly Declined: "declined";
|
|
167
|
+
readonly Revoked: "revoked";
|
|
168
|
+
};
|
|
169
|
+
export type GetCourseSharesOfferedToMeStateEnum = typeof GetCourseSharesOfferedToMeStateEnum[keyof typeof GetCourseSharesOfferedToMeStateEnum];
|
|
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.CourseShareApi = void 0;
|
|
25
|
+
exports.GetCourseSharesOfferedToMeStateEnum = exports.CourseShareApi = void 0;
|
|
26
26
|
const runtime = require("../runtime");
|
|
27
27
|
const index_1 = require("../models/index");
|
|
28
28
|
/**
|
|
@@ -107,9 +107,12 @@ class CourseShareApi extends runtime.BaseAPI {
|
|
|
107
107
|
/**
|
|
108
108
|
* Creates request options for getCourseSharesOfferedToMe without sending the request
|
|
109
109
|
*/
|
|
110
|
-
getCourseSharesOfferedToMeRequestOpts() {
|
|
110
|
+
getCourseSharesOfferedToMeRequestOpts(requestParameters) {
|
|
111
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
112
|
const queryParameters = {};
|
|
113
|
+
if (requestParameters['state'] != null) {
|
|
114
|
+
queryParameters['state'] = requestParameters['state'];
|
|
115
|
+
}
|
|
113
116
|
const headerParameters = {};
|
|
114
117
|
let urlPath = `/course-shares/offered-to-me`;
|
|
115
118
|
return {
|
|
@@ -121,21 +124,23 @@ class CourseShareApi extends runtime.BaseAPI {
|
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
/**
|
|
127
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
124
128
|
* List shares offered to the current portal
|
|
125
129
|
*/
|
|
126
|
-
getCourseSharesOfferedToMeRaw(initOverrides) {
|
|
130
|
+
getCourseSharesOfferedToMeRaw(requestParameters, initOverrides) {
|
|
127
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
const requestOptions = yield this.getCourseSharesOfferedToMeRequestOpts();
|
|
132
|
+
const requestOptions = yield this.getCourseSharesOfferedToMeRequestOpts(requestParameters);
|
|
129
133
|
const response = yield this.request(requestOptions, initOverrides);
|
|
130
134
|
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.CourseShareFromJSON));
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
137
|
/**
|
|
138
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
134
139
|
* List shares offered to the current portal
|
|
135
140
|
*/
|
|
136
|
-
getCourseSharesOfferedToMe(
|
|
137
|
-
return __awaiter(this,
|
|
138
|
-
const response = yield this.getCourseSharesOfferedToMeRaw(initOverrides);
|
|
141
|
+
getCourseSharesOfferedToMe() {
|
|
142
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
143
|
+
const response = yield this.getCourseSharesOfferedToMeRaw(requestParameters, initOverrides);
|
|
139
144
|
return yield response.value();
|
|
140
145
|
});
|
|
141
146
|
}
|
|
@@ -383,3 +388,13 @@ class CourseShareApi extends runtime.BaseAPI {
|
|
|
383
388
|
}
|
|
384
389
|
}
|
|
385
390
|
exports.CourseShareApi = CourseShareApi;
|
|
391
|
+
/**
|
|
392
|
+
* @export
|
|
393
|
+
*/
|
|
394
|
+
exports.GetCourseSharesOfferedToMeStateEnum = {
|
|
395
|
+
Offered: 'offered',
|
|
396
|
+
AcceptedMirror: 'accepted_mirror',
|
|
397
|
+
AcceptedClone: 'accepted_clone',
|
|
398
|
+
Declined: 'declined',
|
|
399
|
+
Revoked: 'revoked'
|
|
400
|
+
};
|
|
@@ -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
|
*/
|
|
@@ -14,6 +14,9 @@ import type { CourseShare, PostOfferCatalog, PostOfferCatalogResponse, PostOffer
|
|
|
14
14
|
export interface DeleteCourseShareRequest {
|
|
15
15
|
shareId: string;
|
|
16
16
|
}
|
|
17
|
+
export interface GetCourseSharesOfferedToMeRequest {
|
|
18
|
+
state?: GetCourseSharesOfferedToMeStateEnum;
|
|
19
|
+
}
|
|
17
20
|
export interface PostOfferCatalogRequest {
|
|
18
21
|
catalogId: string;
|
|
19
22
|
postOfferCatalog: PostOfferCatalog;
|
|
@@ -67,15 +70,17 @@ export declare class CourseShareApi extends runtime.BaseAPI {
|
|
|
67
70
|
/**
|
|
68
71
|
* Creates request options for getCourseSharesOfferedToMe without sending the request
|
|
69
72
|
*/
|
|
70
|
-
getCourseSharesOfferedToMeRequestOpts(): Promise<runtime.RequestOpts>;
|
|
73
|
+
getCourseSharesOfferedToMeRequestOpts(requestParameters: GetCourseSharesOfferedToMeRequest): Promise<runtime.RequestOpts>;
|
|
71
74
|
/**
|
|
75
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
72
76
|
* List shares offered to the current portal
|
|
73
77
|
*/
|
|
74
|
-
getCourseSharesOfferedToMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CourseShare>>>;
|
|
78
|
+
getCourseSharesOfferedToMeRaw(requestParameters: GetCourseSharesOfferedToMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CourseShare>>>;
|
|
75
79
|
/**
|
|
80
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
76
81
|
* List shares offered to the current portal
|
|
77
82
|
*/
|
|
78
|
-
getCourseSharesOfferedToMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CourseShare>>;
|
|
83
|
+
getCourseSharesOfferedToMe(requestParameters?: GetCourseSharesOfferedToMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CourseShare>>;
|
|
79
84
|
/**
|
|
80
85
|
* Creates request options for postOfferCatalog without sending the request
|
|
81
86
|
*/
|
|
@@ -151,3 +156,14 @@ export declare class CourseShareApi extends runtime.BaseAPI {
|
|
|
151
156
|
*/
|
|
152
157
|
putDeclineShare(requestParameters: PutDeclineShareRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
153
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* @export
|
|
161
|
+
*/
|
|
162
|
+
export declare const GetCourseSharesOfferedToMeStateEnum: {
|
|
163
|
+
readonly Offered: "offered";
|
|
164
|
+
readonly AcceptedMirror: "accepted_mirror";
|
|
165
|
+
readonly AcceptedClone: "accepted_clone";
|
|
166
|
+
readonly Declined: "declined";
|
|
167
|
+
readonly Revoked: "revoked";
|
|
168
|
+
};
|
|
169
|
+
export type GetCourseSharesOfferedToMeStateEnum = typeof GetCourseSharesOfferedToMeStateEnum[keyof typeof GetCourseSharesOfferedToMeStateEnum];
|
|
@@ -104,9 +104,12 @@ export class CourseShareApi extends runtime.BaseAPI {
|
|
|
104
104
|
/**
|
|
105
105
|
* Creates request options for getCourseSharesOfferedToMe without sending the request
|
|
106
106
|
*/
|
|
107
|
-
getCourseSharesOfferedToMeRequestOpts() {
|
|
107
|
+
getCourseSharesOfferedToMeRequestOpts(requestParameters) {
|
|
108
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
109
109
|
const queryParameters = {};
|
|
110
|
+
if (requestParameters['state'] != null) {
|
|
111
|
+
queryParameters['state'] = requestParameters['state'];
|
|
112
|
+
}
|
|
110
113
|
const headerParameters = {};
|
|
111
114
|
let urlPath = `/course-shares/offered-to-me`;
|
|
112
115
|
return {
|
|
@@ -118,21 +121,23 @@ export class CourseShareApi extends runtime.BaseAPI {
|
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
/**
|
|
124
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
121
125
|
* List shares offered to the current portal
|
|
122
126
|
*/
|
|
123
|
-
getCourseSharesOfferedToMeRaw(initOverrides) {
|
|
127
|
+
getCourseSharesOfferedToMeRaw(requestParameters, initOverrides) {
|
|
124
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
const requestOptions = yield this.getCourseSharesOfferedToMeRequestOpts();
|
|
129
|
+
const requestOptions = yield this.getCourseSharesOfferedToMeRequestOpts(requestParameters);
|
|
126
130
|
const response = yield this.request(requestOptions, initOverrides);
|
|
127
131
|
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CourseShareFromJSON));
|
|
128
132
|
});
|
|
129
133
|
}
|
|
130
134
|
/**
|
|
135
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
131
136
|
* List shares offered to the current portal
|
|
132
137
|
*/
|
|
133
|
-
getCourseSharesOfferedToMe(
|
|
134
|
-
return __awaiter(this,
|
|
135
|
-
const response = yield this.getCourseSharesOfferedToMeRaw(initOverrides);
|
|
138
|
+
getCourseSharesOfferedToMe() {
|
|
139
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
140
|
+
const response = yield this.getCourseSharesOfferedToMeRaw(requestParameters, initOverrides);
|
|
136
141
|
return yield response.value();
|
|
137
142
|
});
|
|
138
143
|
}
|
|
@@ -379,3 +384,13 @@ export class CourseShareApi extends runtime.BaseAPI {
|
|
|
379
384
|
});
|
|
380
385
|
}
|
|
381
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* @export
|
|
389
|
+
*/
|
|
390
|
+
export const GetCourseSharesOfferedToMeStateEnum = {
|
|
391
|
+
Offered: 'offered',
|
|
392
|
+
AcceptedMirror: 'accepted_mirror',
|
|
393
|
+
AcceptedClone: 'accepted_clone',
|
|
394
|
+
Declined: 'declined',
|
|
395
|
+
Revoked: 'revoked'
|
|
396
|
+
};
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
+
* Shape returned by `GET /course-shares/offered-to-me`. Includes joined source
|
|
14
|
+
* portal name and course name so the child portal can render an inbox without
|
|
15
|
+
* follow-up requests.
|
|
13
16
|
*
|
|
14
17
|
* @export
|
|
15
18
|
* @interface CourseShare
|
|
@@ -28,17 +31,23 @@ export interface CourseShare {
|
|
|
28
31
|
*/
|
|
29
32
|
sourcePortalId: number;
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @type {
|
|
34
|
+
* Display name of the offering portal
|
|
35
|
+
* @type {string}
|
|
33
36
|
* @memberof CourseShare
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
sourcePortalName: string;
|
|
36
39
|
/**
|
|
37
40
|
* Internal ID of the offered course
|
|
38
41
|
* @type {number}
|
|
39
42
|
* @memberof CourseShare
|
|
40
43
|
*/
|
|
41
44
|
courseId: number;
|
|
45
|
+
/**
|
|
46
|
+
* Display name of the offered course
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @memberof CourseShare
|
|
49
|
+
*/
|
|
50
|
+
courseName: string;
|
|
42
51
|
/**
|
|
43
52
|
*
|
|
44
53
|
* @type {CourseShareAllowedModeEnum}
|
|
@@ -37,10 +37,12 @@ export function instanceOfCourseShare(value) {
|
|
|
37
37
|
return false;
|
|
38
38
|
if (!('sourcePortalId' in value) || value['sourcePortalId'] === undefined)
|
|
39
39
|
return false;
|
|
40
|
-
if (!('
|
|
40
|
+
if (!('sourcePortalName' in value) || value['sourcePortalName'] === undefined)
|
|
41
41
|
return false;
|
|
42
42
|
if (!('courseId' in value) || value['courseId'] === undefined)
|
|
43
43
|
return false;
|
|
44
|
+
if (!('courseName' in value) || value['courseName'] === undefined)
|
|
45
|
+
return false;
|
|
44
46
|
if (!('allowedMode' in value) || value['allowedMode'] === undefined)
|
|
45
47
|
return false;
|
|
46
48
|
if (!('state' in value) || value['state'] === undefined)
|
|
@@ -59,8 +61,9 @@ export function CourseShareFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
59
61
|
return {
|
|
60
62
|
'id': json['id'],
|
|
61
63
|
'sourcePortalId': json['source_portal_id'],
|
|
62
|
-
'
|
|
64
|
+
'sourcePortalName': json['source_portal_name'],
|
|
63
65
|
'courseId': json['course_id'],
|
|
66
|
+
'courseName': json['course_name'],
|
|
64
67
|
'allowedMode': json['allowed_mode'],
|
|
65
68
|
'state': json['state'],
|
|
66
69
|
'allowResharing': json['allow_resharing'],
|
|
@@ -76,8 +79,9 @@ export function CourseShareToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
76
79
|
return {
|
|
77
80
|
'id': value['id'],
|
|
78
81
|
'source_portal_id': value['sourcePortalId'],
|
|
79
|
-
'
|
|
82
|
+
'source_portal_name': value['sourcePortalName'],
|
|
80
83
|
'course_id': value['courseId'],
|
|
84
|
+
'course_name': value['courseName'],
|
|
81
85
|
'allowed_mode': value['allowedMode'],
|
|
82
86
|
'state': value['state'],
|
|
83
87
|
'allow_resharing': value['allowResharing'],
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
+
* Shape returned by `GET /course-shares/offered-to-me`. Includes joined source
|
|
14
|
+
* portal name and course name so the child portal can render an inbox without
|
|
15
|
+
* follow-up requests.
|
|
13
16
|
*
|
|
14
17
|
* @export
|
|
15
18
|
* @interface CourseShare
|
|
@@ -28,17 +31,23 @@ export interface CourseShare {
|
|
|
28
31
|
*/
|
|
29
32
|
sourcePortalId: number;
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @type {
|
|
34
|
+
* Display name of the offering portal
|
|
35
|
+
* @type {string}
|
|
33
36
|
* @memberof CourseShare
|
|
34
37
|
*/
|
|
35
|
-
|
|
38
|
+
sourcePortalName: string;
|
|
36
39
|
/**
|
|
37
40
|
* Internal ID of the offered course
|
|
38
41
|
* @type {number}
|
|
39
42
|
* @memberof CourseShare
|
|
40
43
|
*/
|
|
41
44
|
courseId: number;
|
|
45
|
+
/**
|
|
46
|
+
* Display name of the offered course
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @memberof CourseShare
|
|
49
|
+
*/
|
|
50
|
+
courseName: string;
|
|
42
51
|
/**
|
|
43
52
|
*
|
|
44
53
|
* @type {CourseShareAllowedModeEnum}
|
|
@@ -45,10 +45,12 @@ function instanceOfCourseShare(value) {
|
|
|
45
45
|
return false;
|
|
46
46
|
if (!('sourcePortalId' in value) || value['sourcePortalId'] === undefined)
|
|
47
47
|
return false;
|
|
48
|
-
if (!('
|
|
48
|
+
if (!('sourcePortalName' in value) || value['sourcePortalName'] === undefined)
|
|
49
49
|
return false;
|
|
50
50
|
if (!('courseId' in value) || value['courseId'] === undefined)
|
|
51
51
|
return false;
|
|
52
|
+
if (!('courseName' in value) || value['courseName'] === undefined)
|
|
53
|
+
return false;
|
|
52
54
|
if (!('allowedMode' in value) || value['allowedMode'] === undefined)
|
|
53
55
|
return false;
|
|
54
56
|
if (!('state' in value) || value['state'] === undefined)
|
|
@@ -67,8 +69,9 @@ function CourseShareFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
67
69
|
return {
|
|
68
70
|
'id': json['id'],
|
|
69
71
|
'sourcePortalId': json['source_portal_id'],
|
|
70
|
-
'
|
|
72
|
+
'sourcePortalName': json['source_portal_name'],
|
|
71
73
|
'courseId': json['course_id'],
|
|
74
|
+
'courseName': json['course_name'],
|
|
72
75
|
'allowedMode': json['allowed_mode'],
|
|
73
76
|
'state': json['state'],
|
|
74
77
|
'allowResharing': json['allow_resharing'],
|
|
@@ -84,8 +87,9 @@ function CourseShareToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
84
87
|
return {
|
|
85
88
|
'id': value['id'],
|
|
86
89
|
'source_portal_id': value['sourcePortalId'],
|
|
87
|
-
'
|
|
90
|
+
'source_portal_name': value['sourcePortalName'],
|
|
88
91
|
'course_id': value['courseId'],
|
|
92
|
+
'course_name': value['courseName'],
|
|
89
93
|
'allowed_mode': value['allowedMode'],
|
|
90
94
|
'state': value['state'],
|
|
91
95
|
'allow_resharing': value['allowResharing'],
|
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/docs/CourseShare.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# CourseShare
|
|
3
3
|
|
|
4
|
+
Shape returned by `GET /course-shares/offered-to-me`. Includes joined source portal name and course name so the child portal can render an inbox without follow-up requests.
|
|
4
5
|
|
|
5
6
|
## Properties
|
|
6
7
|
|
|
@@ -8,8 +9,9 @@ Name | Type
|
|
|
8
9
|
------------ | -------------
|
|
9
10
|
`id` | string
|
|
10
11
|
`sourcePortalId` | number
|
|
11
|
-
`
|
|
12
|
+
`sourcePortalName` | string
|
|
12
13
|
`courseId` | number
|
|
14
|
+
`courseName` | string
|
|
13
15
|
`allowedMode` | string
|
|
14
16
|
`state` | string
|
|
15
17
|
`allowResharing` | boolean
|
|
@@ -23,8 +25,9 @@ import type { CourseShare } from '@easyedu/js-lsm-api'
|
|
|
23
25
|
const example = {
|
|
24
26
|
"id": null,
|
|
25
27
|
"sourcePortalId": null,
|
|
26
|
-
"
|
|
28
|
+
"sourcePortalName": null,
|
|
27
29
|
"courseId": null,
|
|
30
|
+
"courseName": null,
|
|
28
31
|
"allowedMode": null,
|
|
29
32
|
"state": null,
|
|
30
33
|
"allowResharing": null,
|
package/docs/CourseShareApi.md
CHANGED
|
@@ -144,10 +144,12 @@ No authorization required
|
|
|
144
144
|
|
|
145
145
|
## getCourseSharesOfferedToMe
|
|
146
146
|
|
|
147
|
-
> Array<CourseShare> getCourseSharesOfferedToMe()
|
|
147
|
+
> Array<CourseShare> getCourseSharesOfferedToMe(state)
|
|
148
148
|
|
|
149
149
|
List shares offered to the current portal
|
|
150
150
|
|
|
151
|
+
Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
152
|
+
|
|
151
153
|
### Example
|
|
152
154
|
|
|
153
155
|
```ts
|
|
@@ -161,8 +163,13 @@ async function example() {
|
|
|
161
163
|
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
162
164
|
const api = new CourseShareApi();
|
|
163
165
|
|
|
166
|
+
const body = {
|
|
167
|
+
// 'offered' | 'accepted_mirror' | 'accepted_clone' | 'declined' | 'revoked' | Filter by share state (case-insensitive) (optional)
|
|
168
|
+
state: state_example,
|
|
169
|
+
} satisfies GetCourseSharesOfferedToMeRequest;
|
|
170
|
+
|
|
164
171
|
try {
|
|
165
|
-
const data = await api.getCourseSharesOfferedToMe();
|
|
172
|
+
const data = await api.getCourseSharesOfferedToMe(body);
|
|
166
173
|
console.log(data);
|
|
167
174
|
} catch (error) {
|
|
168
175
|
console.error(error);
|
|
@@ -175,7 +182,10 @@ example().catch(console.error);
|
|
|
175
182
|
|
|
176
183
|
### Parameters
|
|
177
184
|
|
|
178
|
-
|
|
185
|
+
|
|
186
|
+
| Name | Type | Description | Notes |
|
|
187
|
+
|------------- | ------------- | ------------- | -------------|
|
|
188
|
+
| **state** | `offered`, `accepted_mirror`, `accepted_clone`, `declined`, `revoked` | Filter by share state (case-insensitive) | [Optional] [Defaults to `undefined`] [Enum: offered, accepted_mirror, accepted_clone, declined, revoked] |
|
|
179
189
|
|
|
180
190
|
### Return type
|
|
181
191
|
|
|
@@ -195,6 +205,7 @@ No authorization required
|
|
|
195
205
|
| Status code | Description | Response headers |
|
|
196
206
|
|-------------|-------------|------------------|
|
|
197
207
|
| **200** | Shares | - |
|
|
208
|
+
| **400** | Invalid state filter | - |
|
|
198
209
|
|
|
199
210
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
200
211
|
|
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
|
*/
|
|
@@ -38,6 +38,10 @@ export interface DeleteCourseShareRequest {
|
|
|
38
38
|
shareId: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
export interface GetCourseSharesOfferedToMeRequest {
|
|
42
|
+
state?: GetCourseSharesOfferedToMeStateEnum;
|
|
43
|
+
}
|
|
44
|
+
|
|
41
45
|
export interface PostOfferCatalogRequest {
|
|
42
46
|
catalogId: string;
|
|
43
47
|
postOfferCatalog: PostOfferCatalog;
|
|
@@ -155,9 +159,13 @@ export class CourseShareApi extends runtime.BaseAPI {
|
|
|
155
159
|
/**
|
|
156
160
|
* Creates request options for getCourseSharesOfferedToMe without sending the request
|
|
157
161
|
*/
|
|
158
|
-
async getCourseSharesOfferedToMeRequestOpts(): Promise<runtime.RequestOpts> {
|
|
162
|
+
async getCourseSharesOfferedToMeRequestOpts(requestParameters: GetCourseSharesOfferedToMeRequest): Promise<runtime.RequestOpts> {
|
|
159
163
|
const queryParameters: any = {};
|
|
160
164
|
|
|
165
|
+
if (requestParameters['state'] != null) {
|
|
166
|
+
queryParameters['state'] = requestParameters['state'];
|
|
167
|
+
}
|
|
168
|
+
|
|
161
169
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
162
170
|
|
|
163
171
|
|
|
@@ -172,20 +180,22 @@ export class CourseShareApi extends runtime.BaseAPI {
|
|
|
172
180
|
}
|
|
173
181
|
|
|
174
182
|
/**
|
|
183
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
175
184
|
* List shares offered to the current portal
|
|
176
185
|
*/
|
|
177
|
-
async getCourseSharesOfferedToMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CourseShare>>> {
|
|
178
|
-
const requestOptions = await this.getCourseSharesOfferedToMeRequestOpts();
|
|
186
|
+
async getCourseSharesOfferedToMeRaw(requestParameters: GetCourseSharesOfferedToMeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CourseShare>>> {
|
|
187
|
+
const requestOptions = await this.getCourseSharesOfferedToMeRequestOpts(requestParameters);
|
|
179
188
|
const response = await this.request(requestOptions, initOverrides);
|
|
180
189
|
|
|
181
190
|
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CourseShareFromJSON));
|
|
182
191
|
}
|
|
183
192
|
|
|
184
193
|
/**
|
|
194
|
+
* Returns every `course_share` row where the current portal is the target, with the source portal name and course name joined in. Optionally filter by share state via the `state` query parameter.
|
|
185
195
|
* List shares offered to the current portal
|
|
186
196
|
*/
|
|
187
|
-
async getCourseSharesOfferedToMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CourseShare>> {
|
|
188
|
-
const response = await this.getCourseSharesOfferedToMeRaw(initOverrides);
|
|
197
|
+
async getCourseSharesOfferedToMe(requestParameters: GetCourseSharesOfferedToMeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CourseShare>> {
|
|
198
|
+
const response = await this.getCourseSharesOfferedToMeRaw(requestParameters, initOverrides);
|
|
189
199
|
return await response.value();
|
|
190
200
|
}
|
|
191
201
|
|
|
@@ -478,3 +488,15 @@ export class CourseShareApi extends runtime.BaseAPI {
|
|
|
478
488
|
}
|
|
479
489
|
|
|
480
490
|
}
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* @export
|
|
494
|
+
*/
|
|
495
|
+
export const GetCourseSharesOfferedToMeStateEnum = {
|
|
496
|
+
Offered: 'offered',
|
|
497
|
+
AcceptedMirror: 'accepted_mirror',
|
|
498
|
+
AcceptedClone: 'accepted_clone',
|
|
499
|
+
Declined: 'declined',
|
|
500
|
+
Revoked: 'revoked'
|
|
501
|
+
} as const;
|
|
502
|
+
export type GetCourseSharesOfferedToMeStateEnum = typeof GetCourseSharesOfferedToMeStateEnum[keyof typeof GetCourseSharesOfferedToMeStateEnum];
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
16
|
/**
|
|
17
|
+
* Shape returned by `GET /course-shares/offered-to-me`. Includes joined source
|
|
18
|
+
* portal name and course name so the child portal can render an inbox without
|
|
19
|
+
* follow-up requests.
|
|
17
20
|
*
|
|
18
21
|
* @export
|
|
19
22
|
* @interface CourseShare
|
|
@@ -32,17 +35,23 @@ export interface CourseShare {
|
|
|
32
35
|
*/
|
|
33
36
|
sourcePortalId: number;
|
|
34
37
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {
|
|
38
|
+
* Display name of the offering portal
|
|
39
|
+
* @type {string}
|
|
37
40
|
* @memberof CourseShare
|
|
38
41
|
*/
|
|
39
|
-
|
|
42
|
+
sourcePortalName: string;
|
|
40
43
|
/**
|
|
41
44
|
* Internal ID of the offered course
|
|
42
45
|
* @type {number}
|
|
43
46
|
* @memberof CourseShare
|
|
44
47
|
*/
|
|
45
48
|
courseId: number;
|
|
49
|
+
/**
|
|
50
|
+
* Display name of the offered course
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof CourseShare
|
|
53
|
+
*/
|
|
54
|
+
courseName: string;
|
|
46
55
|
/**
|
|
47
56
|
*
|
|
48
57
|
* @type {CourseShareAllowedModeEnum}
|
|
@@ -93,8 +102,9 @@ export type CourseShareStateEnum = typeof CourseShareStateEnum[keyof typeof Cour
|
|
|
93
102
|
export function instanceOfCourseShare(value: object): value is CourseShare {
|
|
94
103
|
if (!('id' in value) || value['id'] === undefined) return false;
|
|
95
104
|
if (!('sourcePortalId' in value) || value['sourcePortalId'] === undefined) return false;
|
|
96
|
-
if (!('
|
|
105
|
+
if (!('sourcePortalName' in value) || value['sourcePortalName'] === undefined) return false;
|
|
97
106
|
if (!('courseId' in value) || value['courseId'] === undefined) return false;
|
|
107
|
+
if (!('courseName' in value) || value['courseName'] === undefined) return false;
|
|
98
108
|
if (!('allowedMode' in value) || value['allowedMode'] === undefined) return false;
|
|
99
109
|
if (!('state' in value) || value['state'] === undefined) return false;
|
|
100
110
|
if (!('allowResharing' in value) || value['allowResharing'] === undefined) return false;
|
|
@@ -113,8 +123,9 @@ export function CourseShareFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
113
123
|
|
|
114
124
|
'id': json['id'],
|
|
115
125
|
'sourcePortalId': json['source_portal_id'],
|
|
116
|
-
'
|
|
126
|
+
'sourcePortalName': json['source_portal_name'],
|
|
117
127
|
'courseId': json['course_id'],
|
|
128
|
+
'courseName': json['course_name'],
|
|
118
129
|
'allowedMode': json['allowed_mode'],
|
|
119
130
|
'state': json['state'],
|
|
120
131
|
'allowResharing': json['allow_resharing'],
|
|
@@ -134,8 +145,9 @@ export function CourseShareToJSONTyped(value?: CourseShare | null, ignoreDiscrim
|
|
|
134
145
|
|
|
135
146
|
'id': value['id'],
|
|
136
147
|
'source_portal_id': value['sourcePortalId'],
|
|
137
|
-
'
|
|
148
|
+
'source_portal_name': value['sourcePortalName'],
|
|
138
149
|
'course_id': value['courseId'],
|
|
150
|
+
'course_name': value['courseName'],
|
|
139
151
|
'allowed_mode': value['allowedMode'],
|
|
140
152
|
'state': value['state'],
|
|
141
153
|
'allow_resharing': value['allowResharing'],
|