@fecommunity/reactpress-toolkit 1.0.0-beta.2 → 1.0.0-beta.3
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 +221 -6
- package/dist/api/Article.d.ts +43 -28
- package/dist/api/Article.js +42 -31
- package/dist/api/Auth.d.ts +12 -7
- package/dist/api/Auth.js +12 -10
- package/dist/api/Category.d.ts +19 -12
- package/dist/api/Category.js +18 -15
- package/dist/api/Comment.d.ts +22 -14
- package/dist/api/Comment.js +21 -17
- package/dist/api/File.d.ts +16 -10
- package/dist/api/File.js +15 -13
- package/dist/{HttpClient.d.ts → api/HttpClient.d.ts} +2 -2
- package/dist/{HttpClient.js → api/HttpClient.js} +4 -2
- package/dist/api/Knowledge.d.ts +28 -18
- package/dist/api/Knowledge.js +27 -22
- package/dist/api/Page.d.ts +22 -14
- package/dist/api/Page.js +21 -17
- package/dist/api/Search.d.ts +12 -7
- package/dist/api/Search.js +12 -10
- package/dist/api/Setting.d.ts +10 -6
- package/dist/api/Setting.js +9 -9
- package/dist/api/Smtp.d.ts +13 -8
- package/dist/api/Smtp.js +12 -11
- package/dist/api/Tag.d.ts +22 -14
- package/dist/api/Tag.js +21 -17
- package/dist/api/User.d.ts +17 -10
- package/dist/api/User.js +16 -16
- package/dist/api/View.d.ts +19 -12
- package/dist/api/View.js +18 -15
- package/dist/api/index.d.ts +13 -18
- package/dist/api/index.js +28 -40
- package/dist/api/instance.d.ts +47 -0
- package/dist/api/instance.js +71 -0
- package/dist/config/env.d.ts +1 -0
- package/dist/config/env.js +93 -0
- package/dist/config/global.d.ts +34 -0
- package/dist/config/global.js +382 -0
- package/dist/config/i18n.d.ts +5 -0
- package/dist/config/i18n.js +47 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.js +30 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +21 -18
- package/dist/locales/en.json +97 -0
- package/dist/locales/zh.json +97 -0
- package/dist/types/index.d.ts +245 -1
- package/dist/types/index.js +10 -17
- package/dist/utils/index.d.ts +33 -2
- package/dist/utils/index.js +57 -18
- package/package.json +12 -5
- package/dist/Article.d.ts +0 -121
- package/dist/Article.js +0 -189
- package/dist/Auth.d.ts +0 -30
- package/dist/Auth.js +0 -59
- package/dist/Category.d.ts +0 -49
- package/dist/Category.js +0 -85
- package/dist/Comment.d.ts +0 -58
- package/dist/Comment.js +0 -98
- package/dist/File.d.ts +0 -40
- package/dist/File.js +0 -72
- package/dist/Knowledge.d.ts +0 -76
- package/dist/Knowledge.js +0 -124
- package/dist/Page.d.ts +0 -58
- package/dist/Page.js +0 -98
- package/dist/Search.d.ts +0 -30
- package/dist/Search.js +0 -59
- package/dist/Setting.d.ts +0 -22
- package/dist/Setting.js +0 -46
- package/dist/Smtp.d.ts +0 -31
- package/dist/Smtp.js +0 -59
- package/dist/Tag.d.ts +0 -58
- package/dist/Tag.js +0 -98
- package/dist/User.d.ts +0 -41
- package/dist/User.js +0 -73
- package/dist/View.d.ts +0 -49
- package/dist/View.js +0 -85
- package/dist/api/Admin.d.ts +0 -14
- package/dist/api/Admin.js +0 -32
- package/dist/api/All.d.ts +0 -14
- package/dist/api/All.js +0 -32
- package/dist/api/ApiInstance.d.ts +0 -39
- package/dist/api/ApiInstance.js +0 -46
- package/dist/api/Archives.d.ts +0 -14
- package/dist/api/Archives.js +0 -32
- package/dist/api/ArticleRoute.d.ts +0 -201
- package/dist/api/ArticleRoute.js +0 -12
- package/dist/api/AuthRoute.d.ts +0 -44
- package/dist/api/AuthRoute.js +0 -12
- package/dist/api/Book.d.ts +0 -15
- package/dist/api/Book.js +0 -33
- package/dist/api/CategoryRoute.d.ts +0 -79
- package/dist/api/CategoryRoute.js +0 -12
- package/dist/api/Chapter.d.ts +0 -15
- package/dist/api/Chapter.js +0 -33
- package/dist/api/CommentRoute.d.ts +0 -95
- package/dist/api/CommentRoute.js +0 -12
- package/dist/api/FileRoute.d.ts +0 -63
- package/dist/api/FileRoute.js +0 -12
- package/dist/api/Get.d.ts +0 -14
- package/dist/api/Get.js +0 -32
- package/dist/api/Github.d.ts +0 -14
- package/dist/api/Github.js +0 -32
- package/dist/api/Host.d.ts +0 -14
- package/dist/api/Host.js +0 -32
- package/dist/api/Id.d.ts +0 -284
- package/dist/api/Id.js +0 -422
- package/dist/api/KnowledgeRoute.d.ts +0 -125
- package/dist/api/KnowledgeRoute.js +0 -12
- package/dist/api/Login.d.ts +0 -14
- package/dist/api/Login.js +0 -32
- package/dist/api/PageRoute.d.ts +0 -95
- package/dist/api/PageRoute.js +0 -12
- package/dist/api/Password.d.ts +0 -15
- package/dist/api/Password.js +0 -33
- package/dist/api/Recommend.d.ts +0 -14
- package/dist/api/Recommend.js +0 -32
- package/dist/api/Register.d.ts +0 -15
- package/dist/api/Register.js +0 -33
- package/dist/api/SearchRoute.d.ts +0 -46
- package/dist/api/SearchRoute.js +0 -12
- package/dist/api/SettingRoute.d.ts +0 -31
- package/dist/api/SettingRoute.js +0 -12
- package/dist/api/SmtpRoute.d.ts +0 -47
- package/dist/api/SmtpRoute.js +0 -12
- package/dist/api/TagRoute.d.ts +0 -95
- package/dist/api/TagRoute.js +0 -12
- package/dist/api/Update.d.ts +0 -15
- package/dist/api/Update.js +0 -33
- package/dist/api/Upload.d.ts +0 -15
- package/dist/api/Upload.js +0 -33
- package/dist/api/Url.d.ts +0 -14
- package/dist/api/Url.js +0 -32
- package/dist/api/UserRoute.d.ts +0 -60
- package/dist/api/UserRoute.js +0 -12
- package/dist/api/ViewRoute.d.ts +0 -77
- package/dist/api/ViewRoute.js +0 -12
- package/dist/api/api-instance.d.ts +0 -39
- package/dist/api/api-instance.js +0 -46
- package/dist/api/http-client.d.ts +0 -41
- package/dist/api/http-client.js +0 -94
- package/dist/api/httpClient.d.ts +0 -42
- package/dist/api/httpClient.js +0 -95
- package/dist/data-contracts.d.ts +0 -245
- package/dist/data-contracts.js +0 -12
- package/dist/types/data-contracts.d.ts +0 -177
- package/dist/types/data-contracts.js +0 -12
- package/dist/utils/common.d.ts +0 -21
- package/dist/utils/common.js +0 -52
- package/dist/utils/http.d.ts +0 -3
- package/dist/utils/http.js +0 -45
package/dist/api/Auth.js
CHANGED
|
@@ -11,18 +11,17 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Auth = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class Auth {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags Auth
|
|
22
|
-
* @name
|
|
20
|
+
* @name AuthControllerLogin
|
|
23
21
|
* @request POST:/auth/login
|
|
22
|
+
* @response `200` `IAuthControllerLoginData`
|
|
24
23
|
*/
|
|
25
|
-
this.login = (params = {}) => this.request({
|
|
24
|
+
this.login = (params = {}) => this.http.request({
|
|
26
25
|
path: `/auth/login`,
|
|
27
26
|
method: 'POST',
|
|
28
27
|
...params,
|
|
@@ -31,10 +30,11 @@ class Auth extends HttpClient_1.HttpClient {
|
|
|
31
30
|
* No description
|
|
32
31
|
*
|
|
33
32
|
* @tags Auth
|
|
34
|
-
* @name
|
|
33
|
+
* @name AuthControllerCreateBook
|
|
35
34
|
* @request POST:/auth/admin
|
|
35
|
+
* @response `201` `IAuthControllerCreateBookData`
|
|
36
36
|
*/
|
|
37
|
-
this.createBook = (params = {}) => this.request({
|
|
37
|
+
this.createBook = (params = {}) => this.http.request({
|
|
38
38
|
path: `/auth/admin`,
|
|
39
39
|
method: 'POST',
|
|
40
40
|
...params,
|
|
@@ -43,14 +43,16 @@ class Auth extends HttpClient_1.HttpClient {
|
|
|
43
43
|
* No description
|
|
44
44
|
*
|
|
45
45
|
* @tags Auth
|
|
46
|
-
* @name
|
|
46
|
+
* @name AuthControllerLoginWithGithub
|
|
47
47
|
* @request POST:/auth/github
|
|
48
|
+
* @response `201` `IAuthControllerLoginWithGithubData`
|
|
48
49
|
*/
|
|
49
|
-
this.loginWithGithub = (params = {}) => this.request({
|
|
50
|
+
this.loginWithGithub = (params = {}) => this.http.request({
|
|
50
51
|
path: `/auth/github`,
|
|
51
52
|
method: 'POST',
|
|
52
53
|
...params,
|
|
53
54
|
});
|
|
55
|
+
this.http = http;
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
exports.Auth = Auth;
|
package/dist/api/Category.d.ts
CHANGED
|
@@ -1,44 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICategoryControllerCreateData } from '../types';
|
|
2
2
|
import { HttpClient, RequestParams } from './HttpClient';
|
|
3
|
-
export declare class Category<SecurityDataType = unknown>
|
|
3
|
+
export declare class Category<SecurityDataType = unknown> {
|
|
4
|
+
http: HttpClient<SecurityDataType>;
|
|
5
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
4
6
|
/**
|
|
5
7
|
* No description
|
|
6
8
|
*
|
|
7
9
|
* @tags Category
|
|
8
|
-
* @name
|
|
10
|
+
* @name CategoryControllerCreate
|
|
9
11
|
* @request POST:/category
|
|
12
|
+
* @response `200` `ICategoryControllerCreateData` 添加分类
|
|
10
13
|
*/
|
|
11
|
-
create: (params?: RequestParams) => Promise<
|
|
14
|
+
create: (params?: RequestParams) => Promise<ICategoryControllerCreateData>;
|
|
12
15
|
/**
|
|
13
16
|
* No description
|
|
14
17
|
*
|
|
15
18
|
* @tags Category
|
|
16
|
-
* @name
|
|
19
|
+
* @name CategoryControllerFindAll
|
|
17
20
|
* @request GET:/category
|
|
21
|
+
* @response `200` `ICategoryControllerFindAllData`
|
|
18
22
|
*/
|
|
19
|
-
findAll: (params?: RequestParams) => Promise<
|
|
23
|
+
findAll: (params?: RequestParams) => Promise<any>;
|
|
20
24
|
/**
|
|
21
25
|
* No description
|
|
22
26
|
*
|
|
23
27
|
* @tags Category
|
|
24
|
-
* @name
|
|
28
|
+
* @name CategoryControllerFindById
|
|
25
29
|
* @request GET:/category/{id}
|
|
30
|
+
* @response `200` `ICategoryControllerFindByIdData`
|
|
26
31
|
*/
|
|
27
|
-
findById: (id: string, params?: RequestParams) => Promise<
|
|
32
|
+
findById: (id: string, params?: RequestParams) => Promise<any>;
|
|
28
33
|
/**
|
|
29
34
|
* No description
|
|
30
35
|
*
|
|
31
36
|
* @tags Category
|
|
32
|
-
* @name
|
|
37
|
+
* @name CategoryControllerUpdateById
|
|
33
38
|
* @request PATCH:/category/{id}
|
|
39
|
+
* @response `200` `ICategoryControllerUpdateByIdData`
|
|
34
40
|
*/
|
|
35
|
-
updateById: (id: string, params?: RequestParams) => Promise<
|
|
41
|
+
updateById: (id: string, params?: RequestParams) => Promise<any>;
|
|
36
42
|
/**
|
|
37
43
|
* No description
|
|
38
44
|
*
|
|
39
45
|
* @tags Category
|
|
40
|
-
* @name
|
|
46
|
+
* @name CategoryControllerDeleteById
|
|
41
47
|
* @request DELETE:/category/{id}
|
|
48
|
+
* @response `200` `ICategoryControllerDeleteByIdData`
|
|
42
49
|
*/
|
|
43
|
-
deleteById: (id: string, params?: RequestParams) => Promise<
|
|
50
|
+
deleteById: (id: string, params?: RequestParams) => Promise<any>;
|
|
44
51
|
}
|
package/dist/api/Category.js
CHANGED
|
@@ -11,31 +11,30 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Category = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class Category {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags Category
|
|
22
|
-
* @name
|
|
20
|
+
* @name CategoryControllerCreate
|
|
23
21
|
* @request POST:/category
|
|
22
|
+
* @response `200` `ICategoryControllerCreateData` 添加分类
|
|
24
23
|
*/
|
|
25
|
-
this.create = (params = {}) => this.request({
|
|
24
|
+
this.create = (params = {}) => this.http.request({
|
|
26
25
|
path: `/category`,
|
|
27
26
|
method: 'POST',
|
|
28
|
-
format: 'json',
|
|
29
27
|
...params,
|
|
30
28
|
});
|
|
31
29
|
/**
|
|
32
30
|
* No description
|
|
33
31
|
*
|
|
34
32
|
* @tags Category
|
|
35
|
-
* @name
|
|
33
|
+
* @name CategoryControllerFindAll
|
|
36
34
|
* @request GET:/category
|
|
35
|
+
* @response `200` `ICategoryControllerFindAllData`
|
|
37
36
|
*/
|
|
38
|
-
this.findAll = (params = {}) => this.request({
|
|
37
|
+
this.findAll = (params = {}) => this.http.request({
|
|
39
38
|
path: `/category`,
|
|
40
39
|
method: 'GET',
|
|
41
40
|
...params,
|
|
@@ -44,10 +43,11 @@ class Category extends HttpClient_1.HttpClient {
|
|
|
44
43
|
* No description
|
|
45
44
|
*
|
|
46
45
|
* @tags Category
|
|
47
|
-
* @name
|
|
46
|
+
* @name CategoryControllerFindById
|
|
48
47
|
* @request GET:/category/{id}
|
|
48
|
+
* @response `200` `ICategoryControllerFindByIdData`
|
|
49
49
|
*/
|
|
50
|
-
this.findById = (id, params = {}) => this.request({
|
|
50
|
+
this.findById = (id, params = {}) => this.http.request({
|
|
51
51
|
path: `/category/${id}`,
|
|
52
52
|
method: 'GET',
|
|
53
53
|
...params,
|
|
@@ -56,10 +56,11 @@ class Category extends HttpClient_1.HttpClient {
|
|
|
56
56
|
* No description
|
|
57
57
|
*
|
|
58
58
|
* @tags Category
|
|
59
|
-
* @name
|
|
59
|
+
* @name CategoryControllerUpdateById
|
|
60
60
|
* @request PATCH:/category/{id}
|
|
61
|
+
* @response `200` `ICategoryControllerUpdateByIdData`
|
|
61
62
|
*/
|
|
62
|
-
this.updateById = (id, params = {}) => this.request({
|
|
63
|
+
this.updateById = (id, params = {}) => this.http.request({
|
|
63
64
|
path: `/category/${id}`,
|
|
64
65
|
method: 'PATCH',
|
|
65
66
|
...params,
|
|
@@ -68,14 +69,16 @@ class Category extends HttpClient_1.HttpClient {
|
|
|
68
69
|
* No description
|
|
69
70
|
*
|
|
70
71
|
* @tags Category
|
|
71
|
-
* @name
|
|
72
|
+
* @name CategoryControllerDeleteById
|
|
72
73
|
* @request DELETE:/category/{id}
|
|
74
|
+
* @response `200` `ICategoryControllerDeleteByIdData`
|
|
73
75
|
*/
|
|
74
|
-
this.deleteById = (id, params = {}) => this.request({
|
|
76
|
+
this.deleteById = (id, params = {}) => this.http.request({
|
|
75
77
|
path: `/category/${id}`,
|
|
76
78
|
method: 'DELETE',
|
|
77
79
|
...params,
|
|
78
80
|
});
|
|
81
|
+
this.http = http;
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
exports.Category = Category;
|
package/dist/api/Comment.d.ts
CHANGED
|
@@ -1,52 +1,60 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICommentControllerCreateData } from '../types';
|
|
2
2
|
import { HttpClient, RequestParams } from './HttpClient';
|
|
3
|
-
export declare class Comment<SecurityDataType = unknown>
|
|
3
|
+
export declare class Comment<SecurityDataType = unknown> {
|
|
4
|
+
http: HttpClient<SecurityDataType>;
|
|
5
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
4
6
|
/**
|
|
5
7
|
* No description
|
|
6
8
|
*
|
|
7
9
|
* @tags Comment
|
|
8
|
-
* @name
|
|
10
|
+
* @name CommentControllerCreate
|
|
9
11
|
* @request POST:/comment
|
|
12
|
+
* @response `200` `ICommentControllerCreateData` 创建评论
|
|
10
13
|
*/
|
|
11
|
-
create: (params?: RequestParams) => Promise<
|
|
14
|
+
create: (params?: RequestParams) => Promise<ICommentControllerCreateData>;
|
|
12
15
|
/**
|
|
13
16
|
* No description
|
|
14
17
|
*
|
|
15
18
|
* @tags Comment
|
|
16
|
-
* @name
|
|
19
|
+
* @name CommentControllerFindAll
|
|
17
20
|
* @request GET:/comment
|
|
21
|
+
* @response `200` `ICommentControllerFindAllData`
|
|
18
22
|
*/
|
|
19
|
-
findAll: (params?: RequestParams) => Promise<
|
|
23
|
+
findAll: (params?: RequestParams) => Promise<any>;
|
|
20
24
|
/**
|
|
21
25
|
* No description
|
|
22
26
|
*
|
|
23
27
|
* @tags Comment
|
|
24
|
-
* @name
|
|
28
|
+
* @name CommentControllerFindById
|
|
25
29
|
* @request GET:/comment/{id}
|
|
30
|
+
* @response `200` `ICommentControllerFindByIdData`
|
|
26
31
|
*/
|
|
27
|
-
findById: (id: string, params?: RequestParams) => Promise<
|
|
32
|
+
findById: (id: string, params?: RequestParams) => Promise<any>;
|
|
28
33
|
/**
|
|
29
34
|
* No description
|
|
30
35
|
*
|
|
31
36
|
* @tags Comment
|
|
32
|
-
* @name
|
|
37
|
+
* @name CommentControllerUpdateById
|
|
33
38
|
* @request PATCH:/comment/{id}
|
|
39
|
+
* @response `200` `ICommentControllerUpdateByIdData`
|
|
34
40
|
*/
|
|
35
|
-
updateById: (id: string, params?: RequestParams) => Promise<
|
|
41
|
+
updateById: (id: string, params?: RequestParams) => Promise<any>;
|
|
36
42
|
/**
|
|
37
43
|
* No description
|
|
38
44
|
*
|
|
39
45
|
* @tags Comment
|
|
40
|
-
* @name
|
|
46
|
+
* @name CommentControllerDeleteById
|
|
41
47
|
* @request DELETE:/comment/{id}
|
|
48
|
+
* @response `200` `ICommentControllerDeleteByIdData`
|
|
42
49
|
*/
|
|
43
|
-
deleteById: (id: string, params?: RequestParams) => Promise<
|
|
50
|
+
deleteById: (id: string, params?: RequestParams) => Promise<any>;
|
|
44
51
|
/**
|
|
45
52
|
* No description
|
|
46
53
|
*
|
|
47
54
|
* @tags Comment
|
|
48
|
-
* @name
|
|
55
|
+
* @name CommentControllerGetArticleComments
|
|
49
56
|
* @request GET:/comment/host/{hostId}
|
|
57
|
+
* @response `200` `ICommentControllerGetArticleCommentsData`
|
|
50
58
|
*/
|
|
51
|
-
getArticleComments: (hostId: string, params?: RequestParams) => Promise<
|
|
59
|
+
getArticleComments: (hostId: string, params?: RequestParams) => Promise<any>;
|
|
52
60
|
}
|
package/dist/api/Comment.js
CHANGED
|
@@ -11,31 +11,30 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Comment = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class Comment {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags Comment
|
|
22
|
-
* @name
|
|
20
|
+
* @name CommentControllerCreate
|
|
23
21
|
* @request POST:/comment
|
|
22
|
+
* @response `200` `ICommentControllerCreateData` 创建评论
|
|
24
23
|
*/
|
|
25
|
-
this.create = (params = {}) => this.request({
|
|
24
|
+
this.create = (params = {}) => this.http.request({
|
|
26
25
|
path: `/comment`,
|
|
27
26
|
method: 'POST',
|
|
28
|
-
format: 'json',
|
|
29
27
|
...params,
|
|
30
28
|
});
|
|
31
29
|
/**
|
|
32
30
|
* No description
|
|
33
31
|
*
|
|
34
32
|
* @tags Comment
|
|
35
|
-
* @name
|
|
33
|
+
* @name CommentControllerFindAll
|
|
36
34
|
* @request GET:/comment
|
|
35
|
+
* @response `200` `ICommentControllerFindAllData`
|
|
37
36
|
*/
|
|
38
|
-
this.findAll = (params = {}) => this.request({
|
|
37
|
+
this.findAll = (params = {}) => this.http.request({
|
|
39
38
|
path: `/comment`,
|
|
40
39
|
method: 'GET',
|
|
41
40
|
...params,
|
|
@@ -44,10 +43,11 @@ class Comment extends HttpClient_1.HttpClient {
|
|
|
44
43
|
* No description
|
|
45
44
|
*
|
|
46
45
|
* @tags Comment
|
|
47
|
-
* @name
|
|
46
|
+
* @name CommentControllerFindById
|
|
48
47
|
* @request GET:/comment/{id}
|
|
48
|
+
* @response `200` `ICommentControllerFindByIdData`
|
|
49
49
|
*/
|
|
50
|
-
this.findById = (id, params = {}) => this.request({
|
|
50
|
+
this.findById = (id, params = {}) => this.http.request({
|
|
51
51
|
path: `/comment/${id}`,
|
|
52
52
|
method: 'GET',
|
|
53
53
|
...params,
|
|
@@ -56,10 +56,11 @@ class Comment extends HttpClient_1.HttpClient {
|
|
|
56
56
|
* No description
|
|
57
57
|
*
|
|
58
58
|
* @tags Comment
|
|
59
|
-
* @name
|
|
59
|
+
* @name CommentControllerUpdateById
|
|
60
60
|
* @request PATCH:/comment/{id}
|
|
61
|
+
* @response `200` `ICommentControllerUpdateByIdData`
|
|
61
62
|
*/
|
|
62
|
-
this.updateById = (id, params = {}) => this.request({
|
|
63
|
+
this.updateById = (id, params = {}) => this.http.request({
|
|
63
64
|
path: `/comment/${id}`,
|
|
64
65
|
method: 'PATCH',
|
|
65
66
|
...params,
|
|
@@ -68,10 +69,11 @@ class Comment extends HttpClient_1.HttpClient {
|
|
|
68
69
|
* No description
|
|
69
70
|
*
|
|
70
71
|
* @tags Comment
|
|
71
|
-
* @name
|
|
72
|
+
* @name CommentControllerDeleteById
|
|
72
73
|
* @request DELETE:/comment/{id}
|
|
74
|
+
* @response `200` `ICommentControllerDeleteByIdData`
|
|
73
75
|
*/
|
|
74
|
-
this.deleteById = (id, params = {}) => this.request({
|
|
76
|
+
this.deleteById = (id, params = {}) => this.http.request({
|
|
75
77
|
path: `/comment/${id}`,
|
|
76
78
|
method: 'DELETE',
|
|
77
79
|
...params,
|
|
@@ -80,14 +82,16 @@ class Comment extends HttpClient_1.HttpClient {
|
|
|
80
82
|
* No description
|
|
81
83
|
*
|
|
82
84
|
* @tags Comment
|
|
83
|
-
* @name
|
|
85
|
+
* @name CommentControllerGetArticleComments
|
|
84
86
|
* @request GET:/comment/host/{hostId}
|
|
87
|
+
* @response `200` `ICommentControllerGetArticleCommentsData`
|
|
85
88
|
*/
|
|
86
|
-
this.getArticleComments = (hostId, params = {}) => this.request({
|
|
89
|
+
this.getArticleComments = (hostId, params = {}) => this.http.request({
|
|
87
90
|
path: `/comment/host/${hostId}`,
|
|
88
91
|
method: 'GET',
|
|
89
92
|
...params,
|
|
90
93
|
});
|
|
94
|
+
this.http = http;
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
exports.Comment = Comment;
|
package/dist/api/File.d.ts
CHANGED
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IFileControllerUploadFileData } from '../types';
|
|
2
2
|
import { HttpClient, RequestParams } from './HttpClient';
|
|
3
|
-
export declare class File<SecurityDataType = unknown>
|
|
3
|
+
export declare class File<SecurityDataType = unknown> {
|
|
4
|
+
http: HttpClient<SecurityDataType>;
|
|
5
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
4
6
|
/**
|
|
5
7
|
* No description
|
|
6
8
|
*
|
|
7
9
|
* @tags File
|
|
8
|
-
* @name
|
|
10
|
+
* @name FileControllerUploadFile
|
|
9
11
|
* @request POST:/file/upload
|
|
12
|
+
* @response `200` `IFileControllerUploadFileData` 上传文件
|
|
10
13
|
*/
|
|
11
|
-
uploadFile: (params?: RequestParams) => Promise<
|
|
14
|
+
uploadFile: (params?: RequestParams) => Promise<IFileControllerUploadFileData>;
|
|
12
15
|
/**
|
|
13
16
|
* No description
|
|
14
17
|
*
|
|
15
18
|
* @tags File
|
|
16
|
-
* @name
|
|
19
|
+
* @name FileControllerFindAll
|
|
17
20
|
* @request GET:/file
|
|
21
|
+
* @response `200` `IFileControllerFindAllData`
|
|
18
22
|
*/
|
|
19
|
-
findAll: (params?: RequestParams) => Promise<
|
|
23
|
+
findAll: (params?: RequestParams) => Promise<any>;
|
|
20
24
|
/**
|
|
21
25
|
* No description
|
|
22
26
|
*
|
|
23
27
|
* @tags File
|
|
24
|
-
* @name
|
|
28
|
+
* @name FileControllerFindById
|
|
25
29
|
* @request GET:/file/{id}
|
|
30
|
+
* @response `200` `IFileControllerFindByIdData`
|
|
26
31
|
*/
|
|
27
|
-
findById: (id: string, params?: RequestParams) => Promise<
|
|
32
|
+
findById: (id: string, params?: RequestParams) => Promise<any>;
|
|
28
33
|
/**
|
|
29
34
|
* No description
|
|
30
35
|
*
|
|
31
36
|
* @tags File
|
|
32
|
-
* @name
|
|
37
|
+
* @name FileControllerDeleteById
|
|
33
38
|
* @request DELETE:/file/{id}
|
|
39
|
+
* @response `200` `IFileControllerDeleteByIdData`
|
|
34
40
|
*/
|
|
35
|
-
deleteById: (id: string, params?: RequestParams) => Promise<
|
|
41
|
+
deleteById: (id: string, params?: RequestParams) => Promise<any>;
|
|
36
42
|
}
|
package/dist/api/File.js
CHANGED
|
@@ -11,31 +11,30 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.File = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class File {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags File
|
|
22
|
-
* @name
|
|
20
|
+
* @name FileControllerUploadFile
|
|
23
21
|
* @request POST:/file/upload
|
|
22
|
+
* @response `200` `IFileControllerUploadFileData` 上传文件
|
|
24
23
|
*/
|
|
25
|
-
this.uploadFile = (params = {}) => this.request({
|
|
24
|
+
this.uploadFile = (params = {}) => this.http.request({
|
|
26
25
|
path: `/file/upload`,
|
|
27
26
|
method: 'POST',
|
|
28
|
-
format: 'json',
|
|
29
27
|
...params,
|
|
30
28
|
});
|
|
31
29
|
/**
|
|
32
30
|
* No description
|
|
33
31
|
*
|
|
34
32
|
* @tags File
|
|
35
|
-
* @name
|
|
33
|
+
* @name FileControllerFindAll
|
|
36
34
|
* @request GET:/file
|
|
35
|
+
* @response `200` `IFileControllerFindAllData`
|
|
37
36
|
*/
|
|
38
|
-
this.findAll = (params = {}) => this.request({
|
|
37
|
+
this.findAll = (params = {}) => this.http.request({
|
|
39
38
|
path: `/file`,
|
|
40
39
|
method: 'GET',
|
|
41
40
|
...params,
|
|
@@ -44,10 +43,11 @@ class File extends HttpClient_1.HttpClient {
|
|
|
44
43
|
* No description
|
|
45
44
|
*
|
|
46
45
|
* @tags File
|
|
47
|
-
* @name
|
|
46
|
+
* @name FileControllerFindById
|
|
48
47
|
* @request GET:/file/{id}
|
|
48
|
+
* @response `200` `IFileControllerFindByIdData`
|
|
49
49
|
*/
|
|
50
|
-
this.findById = (id, params = {}) => this.request({
|
|
50
|
+
this.findById = (id, params = {}) => this.http.request({
|
|
51
51
|
path: `/file/${id}`,
|
|
52
52
|
method: 'GET',
|
|
53
53
|
...params,
|
|
@@ -56,14 +56,16 @@ class File extends HttpClient_1.HttpClient {
|
|
|
56
56
|
* No description
|
|
57
57
|
*
|
|
58
58
|
* @tags File
|
|
59
|
-
* @name
|
|
59
|
+
* @name FileControllerDeleteById
|
|
60
60
|
* @request DELETE:/file/{id}
|
|
61
|
+
* @response `200` `IFileControllerDeleteByIdData`
|
|
61
62
|
*/
|
|
62
|
-
this.deleteById = (id, params = {}) => this.request({
|
|
63
|
+
this.deleteById = (id, params = {}) => this.http.request({
|
|
63
64
|
path: `/file/${id}`,
|
|
64
65
|
method: 'DELETE',
|
|
65
66
|
...params,
|
|
66
67
|
});
|
|
68
|
+
this.http = http;
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
exports.File = File;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosInstance, AxiosRequestConfig,
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, ResponseType } from 'axios';
|
|
2
2
|
export declare type QueryParamsType = Record<string | number, any>;
|
|
3
3
|
export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
|
|
4
4
|
/** set parameter to `true` for call `securityWorker` for this request */
|
|
@@ -37,5 +37,5 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
37
37
|
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
38
38
|
protected stringifyFormItem(formItem: unknown): string;
|
|
39
39
|
protected createFormData(input: Record<string, unknown>): FormData;
|
|
40
|
-
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<
|
|
40
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<T>;
|
|
41
41
|
}
|
|
@@ -41,7 +41,8 @@ class HttpClient {
|
|
|
41
41
|
if (type === ContentType.Text && body && body !== null && typeof body !== 'string') {
|
|
42
42
|
body = JSON.stringify(body);
|
|
43
43
|
}
|
|
44
|
-
return this.instance
|
|
44
|
+
return this.instance
|
|
45
|
+
.request({
|
|
45
46
|
...requestParams,
|
|
46
47
|
headers: {
|
|
47
48
|
...(requestParams.headers || {}),
|
|
@@ -51,7 +52,8 @@ class HttpClient {
|
|
|
51
52
|
responseType: responseFormat,
|
|
52
53
|
data: body,
|
|
53
54
|
url: path,
|
|
54
|
-
})
|
|
55
|
+
})
|
|
56
|
+
.then((response) => response.data);
|
|
55
57
|
};
|
|
56
58
|
this.instance = axios_1.default.create({ ...axiosConfig, baseURL: axiosConfig.baseURL || 'http://localhost:3002' });
|
|
57
59
|
this.secure = secure;
|
package/dist/api/Knowledge.d.ts
CHANGED
|
@@ -1,68 +1,78 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IKnowledgeControllerCreateBookData, IKnowledgeControllerCreateChapterData } from '../types';
|
|
2
2
|
import { HttpClient, RequestParams } from './HttpClient';
|
|
3
|
-
export declare class Knowledge<SecurityDataType = unknown>
|
|
3
|
+
export declare class Knowledge<SecurityDataType = unknown> {
|
|
4
|
+
http: HttpClient<SecurityDataType>;
|
|
5
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
4
6
|
/**
|
|
5
7
|
* No description
|
|
6
8
|
*
|
|
7
9
|
* @tags Knowledge
|
|
8
|
-
* @name
|
|
10
|
+
* @name KnowledgeControllerCreateBook
|
|
9
11
|
* @request POST:/Knowledge/book
|
|
12
|
+
* @response `200` `IKnowledgeControllerCreateBookData` 创建知识库
|
|
10
13
|
*/
|
|
11
|
-
createBook: (params?: RequestParams) => Promise<
|
|
14
|
+
createBook: (params?: RequestParams) => Promise<IKnowledgeControllerCreateBookData>;
|
|
12
15
|
/**
|
|
13
16
|
* No description
|
|
14
17
|
*
|
|
15
18
|
* @tags Knowledge
|
|
16
|
-
* @name
|
|
19
|
+
* @name KnowledgeControllerCreateChapter
|
|
17
20
|
* @request POST:/Knowledge/chapter
|
|
21
|
+
* @response `200` `IKnowledgeControllerCreateChapterData` 创建知识章节
|
|
18
22
|
*/
|
|
19
|
-
createChapter: (params?: RequestParams) => Promise<
|
|
23
|
+
createChapter: (params?: RequestParams) => Promise<IKnowledgeControllerCreateChapterData>;
|
|
20
24
|
/**
|
|
21
25
|
* No description
|
|
22
26
|
*
|
|
23
27
|
* @tags Knowledge
|
|
24
|
-
* @name
|
|
28
|
+
* @name KnowledgeControllerDeleteById
|
|
25
29
|
* @request DELETE:/Knowledge/{id}
|
|
30
|
+
* @response `200` `IKnowledgeControllerDeleteByIdData`
|
|
26
31
|
*/
|
|
27
|
-
deleteById: (id: string, params?: RequestParams) => Promise<
|
|
32
|
+
deleteById: (id: string, params?: RequestParams) => Promise<any>;
|
|
28
33
|
/**
|
|
29
34
|
* No description
|
|
30
35
|
*
|
|
31
36
|
* @tags Knowledge
|
|
32
|
-
* @name
|
|
37
|
+
* @name KnowledgeControllerUpdateById
|
|
33
38
|
* @request PATCH:/Knowledge/{id}
|
|
39
|
+
* @response `200` `IKnowledgeControllerUpdateByIdData`
|
|
34
40
|
*/
|
|
35
|
-
updateById: (id: string, params?: RequestParams) => Promise<
|
|
41
|
+
updateById: (id: string, params?: RequestParams) => Promise<any>;
|
|
36
42
|
/**
|
|
37
43
|
* No description
|
|
38
44
|
*
|
|
39
45
|
* @tags Knowledge
|
|
40
|
-
* @name
|
|
46
|
+
* @name KnowledgeControllerFindById
|
|
41
47
|
* @request GET:/Knowledge/{id}
|
|
48
|
+
* @response `200` `IKnowledgeControllerFindByIdData`
|
|
42
49
|
*/
|
|
43
|
-
findById: (id: string, params?: RequestParams) => Promise<
|
|
50
|
+
findById: (id: string, params?: RequestParams) => Promise<any>;
|
|
44
51
|
/**
|
|
45
52
|
* No description
|
|
46
53
|
*
|
|
47
54
|
* @tags Knowledge
|
|
48
|
-
* @name
|
|
55
|
+
* @name KnowledgeControllerFindAll
|
|
49
56
|
* @request GET:/Knowledge
|
|
57
|
+
* @response `200` `IKnowledgeControllerFindAllData`
|
|
50
58
|
*/
|
|
51
|
-
findAll: (params?: RequestParams) => Promise<
|
|
59
|
+
findAll: (params?: RequestParams) => Promise<any>;
|
|
52
60
|
/**
|
|
53
61
|
* No description
|
|
54
62
|
*
|
|
55
63
|
* @tags Knowledge
|
|
56
|
-
* @name
|
|
64
|
+
* @name KnowledgeControllerUpdateViewsById
|
|
57
65
|
* @request POST:/Knowledge/{id}/views
|
|
66
|
+
* @response `200` `IKnowledgeControllerUpdateViewsByIdData`
|
|
58
67
|
*/
|
|
59
|
-
updateViewsById: (id: string, params?: RequestParams) => Promise<
|
|
68
|
+
updateViewsById: (id: string, params?: RequestParams) => Promise<any>;
|
|
60
69
|
/**
|
|
61
70
|
* No description
|
|
62
71
|
*
|
|
63
72
|
* @tags Knowledge
|
|
64
|
-
* @name
|
|
73
|
+
* @name KnowledgeControllerUpdateLikesById
|
|
65
74
|
* @request POST:/Knowledge/{id}/likes
|
|
75
|
+
* @response `200` `IKnowledgeControllerUpdateLikesByIdData`
|
|
66
76
|
*/
|
|
67
|
-
updateLikesById: (id: string, params?: RequestParams) => Promise<
|
|
77
|
+
updateLikesById: (id: string, params?: RequestParams) => Promise<any>;
|
|
68
78
|
}
|