@easyedu/js-lsm-api 1.0.0-677fab496294ee48248fd8a03fee59e3bf0dcf02
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +35 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +46 -0
- package/dist/apis/ContentApi.d.ts +82 -0
- package/dist/apis/ContentApi.js +204 -0
- package/dist/apis/CourseApi.d.ts +71 -0
- package/dist/apis/CourseApi.js +177 -0
- package/dist/apis/ModuleApi.d.ts +53 -0
- package/dist/apis/ModuleApi.js +125 -0
- package/dist/apis/OtherApi.d.ts +25 -0
- package/dist/apis/OtherApi.js +56 -0
- package/dist/apis/UserApi.d.ts +51 -0
- package/dist/apis/UserApi.js +121 -0
- package/dist/apis/index.d.ts +5 -0
- package/dist/apis/index.js +23 -0
- package/dist/esm/apis/ContentApi.d.ts +82 -0
- package/dist/esm/apis/ContentApi.js +200 -0
- package/dist/esm/apis/CourseApi.d.ts +71 -0
- package/dist/esm/apis/CourseApi.js +173 -0
- package/dist/esm/apis/ModuleApi.d.ts +53 -0
- package/dist/esm/apis/ModuleApi.js +121 -0
- package/dist/esm/apis/OtherApi.d.ts +25 -0
- package/dist/esm/apis/OtherApi.js +52 -0
- package/dist/esm/apis/UserApi.d.ts +51 -0
- package/dist/esm/apis/UserApi.js +117 -0
- package/dist/esm/apis/index.d.ts +5 -0
- package/dist/esm/apis/index.js +7 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/GetContent.d.ts +44 -0
- package/dist/esm/models/GetContent.js +50 -0
- package/dist/esm/models/GetContentList.d.ts +57 -0
- package/dist/esm/models/GetContentList.js +60 -0
- package/dist/esm/models/GetContentSession.d.ts +50 -0
- package/dist/esm/models/GetContentSession.js +55 -0
- package/dist/esm/models/GetContentUpload.d.ts +44 -0
- package/dist/esm/models/GetContentUpload.js +51 -0
- package/dist/esm/models/GetCourse.d.ts +50 -0
- package/dist/esm/models/GetCourse.js +52 -0
- package/dist/esm/models/GetCourseEnrollment.d.ts +79 -0
- package/dist/esm/models/GetCourseEnrollment.js +77 -0
- package/dist/esm/models/GetCourseEnrollmentList.d.ts +57 -0
- package/dist/esm/models/GetCourseEnrollmentList.js +60 -0
- package/dist/esm/models/GetCourseList.d.ts +57 -0
- package/dist/esm/models/GetCourseList.js +60 -0
- package/dist/esm/models/GetModule.d.ts +62 -0
- package/dist/esm/models/GetModule.js +61 -0
- package/dist/esm/models/GetModuleList.d.ts +57 -0
- package/dist/esm/models/GetModuleList.js +60 -0
- package/dist/esm/models/GetUser.d.ts +50 -0
- package/dist/esm/models/GetUser.js +54 -0
- package/dist/esm/models/LoginRes.d.ts +32 -0
- package/dist/esm/models/LoginRes.js +43 -0
- package/dist/esm/models/PostContentScorm.d.ts +38 -0
- package/dist/esm/models/PostContentScorm.js +47 -0
- package/dist/esm/models/PostContentUpload.d.ts +50 -0
- package/dist/esm/models/PostContentUpload.js +58 -0
- package/dist/esm/models/PostCourse.d.ts +44 -0
- package/dist/esm/models/PostCourse.js +51 -0
- package/dist/esm/models/PostCourseEnrollment.d.ts +44 -0
- package/dist/esm/models/PostCourseEnrollment.js +51 -0
- package/dist/esm/models/PostLogin.d.ts +38 -0
- package/dist/esm/models/PostLogin.js +47 -0
- package/dist/esm/models/PostModule.d.ts +44 -0
- package/dist/esm/models/PostModule.js +51 -0
- package/dist/esm/models/PostUser.d.ts +44 -0
- package/dist/esm/models/PostUser.js +51 -0
- package/dist/esm/models/index.d.ts +19 -0
- package/dist/esm/models/index.js +21 -0
- package/dist/esm/runtime.d.ts +182 -0
- package/dist/esm/runtime.js +330 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/GetContent.d.ts +44 -0
- package/dist/models/GetContent.js +57 -0
- package/dist/models/GetContentList.d.ts +57 -0
- package/dist/models/GetContentList.js +67 -0
- package/dist/models/GetContentSession.d.ts +50 -0
- package/dist/models/GetContentSession.js +62 -0
- package/dist/models/GetContentUpload.d.ts +44 -0
- package/dist/models/GetContentUpload.js +58 -0
- package/dist/models/GetCourse.d.ts +50 -0
- package/dist/models/GetCourse.js +59 -0
- package/dist/models/GetCourseEnrollment.d.ts +79 -0
- package/dist/models/GetCourseEnrollment.js +85 -0
- package/dist/models/GetCourseEnrollmentList.d.ts +57 -0
- package/dist/models/GetCourseEnrollmentList.js +67 -0
- package/dist/models/GetCourseList.d.ts +57 -0
- package/dist/models/GetCourseList.js +67 -0
- package/dist/models/GetModule.d.ts +62 -0
- package/dist/models/GetModule.js +68 -0
- package/dist/models/GetModuleList.d.ts +57 -0
- package/dist/models/GetModuleList.js +67 -0
- package/dist/models/GetUser.d.ts +50 -0
- package/dist/models/GetUser.js +61 -0
- package/dist/models/LoginRes.d.ts +32 -0
- package/dist/models/LoginRes.js +50 -0
- package/dist/models/PostContentScorm.d.ts +38 -0
- package/dist/models/PostContentScorm.js +54 -0
- package/dist/models/PostContentUpload.d.ts +50 -0
- package/dist/models/PostContentUpload.js +66 -0
- package/dist/models/PostCourse.d.ts +44 -0
- package/dist/models/PostCourse.js +58 -0
- package/dist/models/PostCourseEnrollment.d.ts +44 -0
- package/dist/models/PostCourseEnrollment.js +58 -0
- package/dist/models/PostLogin.d.ts +38 -0
- package/dist/models/PostLogin.js +54 -0
- package/dist/models/PostModule.d.ts +44 -0
- package/dist/models/PostModule.js +58 -0
- package/dist/models/PostUser.d.ts +44 -0
- package/dist/models/PostUser.js +58 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.js +37 -0
- package/dist/runtime.d.ts +182 -0
- package/dist/runtime.js +346 -0
- package/package.json +21 -0
- package/src/apis/ContentApi.ts +308 -0
- package/src/apis/CourseApi.ts +233 -0
- package/src/apis/ModuleApi.ts +166 -0
- package/src/apis/OtherApi.ts +48 -0
- package/src/apis/UserApi.ts +156 -0
- package/src/apis/index.ts +7 -0
- package/src/index.ts +5 -0
- package/src/models/GetContent.ts +83 -0
- package/src/models/GetContentList.ts +110 -0
- package/src/models/GetContentSession.ts +93 -0
- package/src/models/GetContentUpload.ts +84 -0
- package/src/models/GetCourse.ts +91 -0
- package/src/models/GetCourseEnrollment.ts +134 -0
- package/src/models/GetCourseEnrollmentList.ts +110 -0
- package/src/models/GetCourseList.ts +110 -0
- package/src/models/GetModule.ts +109 -0
- package/src/models/GetModuleList.ts +110 -0
- package/src/models/GetUser.ts +92 -0
- package/src/models/LoginRes.ts +66 -0
- package/src/models/PostContentScorm.ts +75 -0
- package/src/models/PostContentUpload.ts +90 -0
- package/src/models/PostCourse.ts +84 -0
- package/src/models/PostCourseEnrollment.ts +84 -0
- package/src/models/PostLogin.ts +75 -0
- package/src/models/PostModule.ts +84 -0
- package/src/models/PostUser.ts +84 -0
- package/src/models/index.ts +21 -0
- package/src/runtime.ts +431 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
* Check if a given object implements the PostLogin interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfPostLogin(value) {
|
|
18
|
+
if (!('email' in value) || value['email'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
if (!('password' in value) || value['password'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
export function PostLoginFromJSON(json) {
|
|
25
|
+
return PostLoginFromJSONTyped(json, false);
|
|
26
|
+
}
|
|
27
|
+
export function PostLoginFromJSONTyped(json, ignoreDiscriminator) {
|
|
28
|
+
if (json == null) {
|
|
29
|
+
return json;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
'email': json['email'],
|
|
33
|
+
'password': json['password'],
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function PostLoginToJSON(json) {
|
|
37
|
+
return PostLoginToJSONTyped(json, false);
|
|
38
|
+
}
|
|
39
|
+
export function PostLoginToJSONTyped(value, ignoreDiscriminator = false) {
|
|
40
|
+
if (value == null) {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
'email': value['email'],
|
|
45
|
+
'password': value['password'],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMS API
|
|
3
|
+
* LMS API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface PostModule
|
|
16
|
+
*/
|
|
17
|
+
export interface PostModule {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof PostModule
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof PostModule
|
|
28
|
+
*/
|
|
29
|
+
description: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof PostModule
|
|
34
|
+
*/
|
|
35
|
+
order: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the PostModule interface.
|
|
39
|
+
*/
|
|
40
|
+
export declare function instanceOfPostModule(value: object): value is PostModule;
|
|
41
|
+
export declare function PostModuleFromJSON(json: any): PostModule;
|
|
42
|
+
export declare function PostModuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostModule;
|
|
43
|
+
export declare function PostModuleToJSON(json: any): PostModule;
|
|
44
|
+
export declare function PostModuleToJSONTyped(value?: PostModule | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
* Check if a given object implements the PostModule interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfPostModule(value) {
|
|
18
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
if (!('description' in value) || value['description'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('order' in value) || value['order'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
export function PostModuleFromJSON(json) {
|
|
27
|
+
return PostModuleFromJSONTyped(json, false);
|
|
28
|
+
}
|
|
29
|
+
export function PostModuleFromJSONTyped(json, ignoreDiscriminator) {
|
|
30
|
+
if (json == null) {
|
|
31
|
+
return json;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
'name': json['name'],
|
|
35
|
+
'description': json['description'],
|
|
36
|
+
'order': json['order'],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function PostModuleToJSON(json) {
|
|
40
|
+
return PostModuleToJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
export function PostModuleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
43
|
+
if (value == null) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
'name': value['name'],
|
|
48
|
+
'description': value['description'],
|
|
49
|
+
'order': value['order'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMS API
|
|
3
|
+
* LMS API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface PostUser
|
|
16
|
+
*/
|
|
17
|
+
export interface PostUser {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof PostUser
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @memberof PostUser
|
|
28
|
+
*/
|
|
29
|
+
email: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof PostUser
|
|
34
|
+
*/
|
|
35
|
+
password: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the PostUser interface.
|
|
39
|
+
*/
|
|
40
|
+
export declare function instanceOfPostUser(value: object): value is PostUser;
|
|
41
|
+
export declare function PostUserFromJSON(json: any): PostUser;
|
|
42
|
+
export declare function PostUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostUser;
|
|
43
|
+
export declare function PostUserToJSON(json: any): PostUser;
|
|
44
|
+
export declare function PostUserToJSONTyped(value?: PostUser | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
* Check if a given object implements the PostUser interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfPostUser(value) {
|
|
18
|
+
if (!('name' in value) || value['name'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
if (!('email' in value) || value['email'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('password' in value) || value['password'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
export function PostUserFromJSON(json) {
|
|
27
|
+
return PostUserFromJSONTyped(json, false);
|
|
28
|
+
}
|
|
29
|
+
export function PostUserFromJSONTyped(json, ignoreDiscriminator) {
|
|
30
|
+
if (json == null) {
|
|
31
|
+
return json;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
'name': json['name'],
|
|
35
|
+
'email': json['email'],
|
|
36
|
+
'password': json['password'],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function PostUserToJSON(json) {
|
|
40
|
+
return PostUserToJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
export function PostUserToJSONTyped(value, ignoreDiscriminator = false) {
|
|
43
|
+
if (value == null) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
'name': value['name'],
|
|
48
|
+
'email': value['email'],
|
|
49
|
+
'password': value['password'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './GetContent';
|
|
2
|
+
export * from './GetContentList';
|
|
3
|
+
export * from './GetContentSession';
|
|
4
|
+
export * from './GetContentUpload';
|
|
5
|
+
export * from './GetCourse';
|
|
6
|
+
export * from './GetCourseEnrollment';
|
|
7
|
+
export * from './GetCourseEnrollmentList';
|
|
8
|
+
export * from './GetCourseList';
|
|
9
|
+
export * from './GetModule';
|
|
10
|
+
export * from './GetModuleList';
|
|
11
|
+
export * from './GetUser';
|
|
12
|
+
export * from './LoginRes';
|
|
13
|
+
export * from './PostContentScorm';
|
|
14
|
+
export * from './PostContentUpload';
|
|
15
|
+
export * from './PostCourse';
|
|
16
|
+
export * from './PostCourseEnrollment';
|
|
17
|
+
export * from './PostLogin';
|
|
18
|
+
export * from './PostModule';
|
|
19
|
+
export * from './PostUser';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export * from './GetContent';
|
|
4
|
+
export * from './GetContentList';
|
|
5
|
+
export * from './GetContentSession';
|
|
6
|
+
export * from './GetContentUpload';
|
|
7
|
+
export * from './GetCourse';
|
|
8
|
+
export * from './GetCourseEnrollment';
|
|
9
|
+
export * from './GetCourseEnrollmentList';
|
|
10
|
+
export * from './GetCourseList';
|
|
11
|
+
export * from './GetModule';
|
|
12
|
+
export * from './GetModuleList';
|
|
13
|
+
export * from './GetUser';
|
|
14
|
+
export * from './LoginRes';
|
|
15
|
+
export * from './PostContentScorm';
|
|
16
|
+
export * from './PostContentUpload';
|
|
17
|
+
export * from './PostCourse';
|
|
18
|
+
export * from './PostCourseEnrollment';
|
|
19
|
+
export * from './PostLogin';
|
|
20
|
+
export * from './PostModule';
|
|
21
|
+
export * from './PostUser';
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMS API
|
|
3
|
+
* LMS API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BASE_PATH: string;
|
|
13
|
+
export interface ConfigurationParameters {
|
|
14
|
+
basePath?: string;
|
|
15
|
+
fetchApi?: FetchAPI;
|
|
16
|
+
middleware?: Middleware[];
|
|
17
|
+
queryParamsStringify?: (params: HTTPQuery) => string;
|
|
18
|
+
username?: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>);
|
|
21
|
+
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
|
|
22
|
+
headers?: HTTPHeaders;
|
|
23
|
+
credentials?: RequestCredentials;
|
|
24
|
+
}
|
|
25
|
+
export declare class Configuration {
|
|
26
|
+
private configuration;
|
|
27
|
+
constructor(configuration?: ConfigurationParameters);
|
|
28
|
+
set config(configuration: Configuration);
|
|
29
|
+
get basePath(): string;
|
|
30
|
+
get fetchApi(): FetchAPI | undefined;
|
|
31
|
+
get middleware(): Middleware[];
|
|
32
|
+
get queryParamsStringify(): (params: HTTPQuery) => string;
|
|
33
|
+
get username(): string | undefined;
|
|
34
|
+
get password(): string | undefined;
|
|
35
|
+
get apiKey(): ((name: string) => string | Promise<string>) | undefined;
|
|
36
|
+
get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
|
|
37
|
+
get headers(): HTTPHeaders | undefined;
|
|
38
|
+
get credentials(): RequestCredentials | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare const DefaultConfig: Configuration;
|
|
41
|
+
/**
|
|
42
|
+
* This is the base class for all generated API classes.
|
|
43
|
+
*/
|
|
44
|
+
export declare class BaseAPI {
|
|
45
|
+
protected configuration: Configuration;
|
|
46
|
+
private static readonly jsonRegex;
|
|
47
|
+
private middleware;
|
|
48
|
+
constructor(configuration?: Configuration);
|
|
49
|
+
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
|
|
50
|
+
withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
|
|
51
|
+
withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the given MIME is a JSON MIME.
|
|
54
|
+
* JSON MIME examples:
|
|
55
|
+
* application/json
|
|
56
|
+
* application/json; charset=UTF8
|
|
57
|
+
* APPLICATION/JSON
|
|
58
|
+
* application/vnd.company+json
|
|
59
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
60
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
61
|
+
*/
|
|
62
|
+
protected isJsonMime(mime: string | null | undefined): boolean;
|
|
63
|
+
protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response>;
|
|
64
|
+
private createFetchParams;
|
|
65
|
+
private fetchApi;
|
|
66
|
+
/**
|
|
67
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
68
|
+
* and then shallow cloning data members.
|
|
69
|
+
*/
|
|
70
|
+
private clone;
|
|
71
|
+
}
|
|
72
|
+
export declare class ResponseError extends Error {
|
|
73
|
+
response: Response;
|
|
74
|
+
name: "ResponseError";
|
|
75
|
+
constructor(response: Response, msg?: string);
|
|
76
|
+
}
|
|
77
|
+
export declare class FetchError extends Error {
|
|
78
|
+
cause: Error;
|
|
79
|
+
name: "FetchError";
|
|
80
|
+
constructor(cause: Error, msg?: string);
|
|
81
|
+
}
|
|
82
|
+
export declare class RequiredError extends Error {
|
|
83
|
+
field: string;
|
|
84
|
+
name: "RequiredError";
|
|
85
|
+
constructor(field: string, msg?: string);
|
|
86
|
+
}
|
|
87
|
+
export declare const COLLECTION_FORMATS: {
|
|
88
|
+
csv: string;
|
|
89
|
+
ssv: string;
|
|
90
|
+
tsv: string;
|
|
91
|
+
pipes: string;
|
|
92
|
+
};
|
|
93
|
+
export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
|
|
94
|
+
export type Json = any;
|
|
95
|
+
export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
|
|
96
|
+
export type HTTPHeaders = {
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
export type HTTPQuery = {
|
|
100
|
+
[key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
|
|
101
|
+
};
|
|
102
|
+
export type HTTPBody = Json | FormData | URLSearchParams;
|
|
103
|
+
export type HTTPRequestInit = {
|
|
104
|
+
headers?: HTTPHeaders;
|
|
105
|
+
method: HTTPMethod;
|
|
106
|
+
credentials?: RequestCredentials;
|
|
107
|
+
body?: HTTPBody;
|
|
108
|
+
};
|
|
109
|
+
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
110
|
+
export type InitOverrideFunction = (requestContext: {
|
|
111
|
+
init: HTTPRequestInit;
|
|
112
|
+
context: RequestOpts;
|
|
113
|
+
}) => Promise<RequestInit>;
|
|
114
|
+
export interface FetchParams {
|
|
115
|
+
url: string;
|
|
116
|
+
init: RequestInit;
|
|
117
|
+
}
|
|
118
|
+
export interface RequestOpts {
|
|
119
|
+
path: string;
|
|
120
|
+
method: HTTPMethod;
|
|
121
|
+
headers: HTTPHeaders;
|
|
122
|
+
query?: HTTPQuery;
|
|
123
|
+
body?: HTTPBody;
|
|
124
|
+
}
|
|
125
|
+
export declare function querystring(params: HTTPQuery, prefix?: string): string;
|
|
126
|
+
export declare function exists(json: any, key: string): boolean;
|
|
127
|
+
export declare function mapValues(data: any, fn: (item: any) => any): {};
|
|
128
|
+
export declare function canConsumeForm(consumes: Consume[]): boolean;
|
|
129
|
+
export interface Consume {
|
|
130
|
+
contentType: string;
|
|
131
|
+
}
|
|
132
|
+
export interface RequestContext {
|
|
133
|
+
fetch: FetchAPI;
|
|
134
|
+
url: string;
|
|
135
|
+
init: RequestInit;
|
|
136
|
+
}
|
|
137
|
+
export interface ResponseContext {
|
|
138
|
+
fetch: FetchAPI;
|
|
139
|
+
url: string;
|
|
140
|
+
init: RequestInit;
|
|
141
|
+
response: Response;
|
|
142
|
+
}
|
|
143
|
+
export interface ErrorContext {
|
|
144
|
+
fetch: FetchAPI;
|
|
145
|
+
url: string;
|
|
146
|
+
init: RequestInit;
|
|
147
|
+
error: unknown;
|
|
148
|
+
response?: Response;
|
|
149
|
+
}
|
|
150
|
+
export interface Middleware {
|
|
151
|
+
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
152
|
+
post?(context: ResponseContext): Promise<Response | void>;
|
|
153
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
154
|
+
}
|
|
155
|
+
export interface ApiResponse<T> {
|
|
156
|
+
raw: Response;
|
|
157
|
+
value(): Promise<T>;
|
|
158
|
+
}
|
|
159
|
+
export interface ResponseTransformer<T> {
|
|
160
|
+
(json: any): T;
|
|
161
|
+
}
|
|
162
|
+
export declare class JSONApiResponse<T> {
|
|
163
|
+
raw: Response;
|
|
164
|
+
private transformer;
|
|
165
|
+
constructor(raw: Response, transformer?: ResponseTransformer<T>);
|
|
166
|
+
value(): Promise<T>;
|
|
167
|
+
}
|
|
168
|
+
export declare class VoidApiResponse {
|
|
169
|
+
raw: Response;
|
|
170
|
+
constructor(raw: Response);
|
|
171
|
+
value(): Promise<void>;
|
|
172
|
+
}
|
|
173
|
+
export declare class BlobApiResponse {
|
|
174
|
+
raw: Response;
|
|
175
|
+
constructor(raw: Response);
|
|
176
|
+
value(): Promise<Blob>;
|
|
177
|
+
}
|
|
178
|
+
export declare class TextApiResponse {
|
|
179
|
+
raw: Response;
|
|
180
|
+
constructor(raw: Response);
|
|
181
|
+
value(): Promise<string>;
|
|
182
|
+
}
|