@fecommunity/reactpress-toolkit 1.0.0-beta.2 → 1.0.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 +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/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/httpClient.d.ts +5 -6
- package/dist/api/httpClient.js +4 -3
- 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/index.d.ts +4 -4
- package/dist/index.js +15 -19
- 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 +7 -4
package/dist/api/Tag.js
CHANGED
|
@@ -11,31 +11,30 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.Tag = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class Tag {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags Tag
|
|
22
|
-
* @name
|
|
20
|
+
* @name TagControllerCreate
|
|
23
21
|
* @request POST:/tag
|
|
22
|
+
* @response `200` `ITagControllerCreateData` 创建标签
|
|
24
23
|
*/
|
|
25
|
-
this.create = (params = {}) => this.request({
|
|
24
|
+
this.create = (params = {}) => this.http.request({
|
|
26
25
|
path: `/tag`,
|
|
27
26
|
method: 'POST',
|
|
28
|
-
format: 'json',
|
|
29
27
|
...params,
|
|
30
28
|
});
|
|
31
29
|
/**
|
|
32
30
|
* No description
|
|
33
31
|
*
|
|
34
32
|
* @tags Tag
|
|
35
|
-
* @name
|
|
33
|
+
* @name TagControllerFindAll
|
|
36
34
|
* @request GET:/tag
|
|
35
|
+
* @response `200` `ITagControllerFindAllData`
|
|
37
36
|
*/
|
|
38
|
-
this.findAll = (params = {}) => this.request({
|
|
37
|
+
this.findAll = (params = {}) => this.http.request({
|
|
39
38
|
path: `/tag`,
|
|
40
39
|
method: 'GET',
|
|
41
40
|
...params,
|
|
@@ -44,10 +43,11 @@ class Tag extends HttpClient_1.HttpClient {
|
|
|
44
43
|
* No description
|
|
45
44
|
*
|
|
46
45
|
* @tags Tag
|
|
47
|
-
* @name
|
|
46
|
+
* @name TagControllerFindById
|
|
48
47
|
* @request GET:/tag/{id}
|
|
48
|
+
* @response `200` `ITagControllerFindByIdData`
|
|
49
49
|
*/
|
|
50
|
-
this.findById = (id, params = {}) => this.request({
|
|
50
|
+
this.findById = (id, params = {}) => this.http.request({
|
|
51
51
|
path: `/tag/${id}`,
|
|
52
52
|
method: 'GET',
|
|
53
53
|
...params,
|
|
@@ -56,10 +56,11 @@ class Tag extends HttpClient_1.HttpClient {
|
|
|
56
56
|
* No description
|
|
57
57
|
*
|
|
58
58
|
* @tags Tag
|
|
59
|
-
* @name
|
|
59
|
+
* @name TagControllerUpdateById
|
|
60
60
|
* @request PATCH:/tag/{id}
|
|
61
|
+
* @response `200` `ITagControllerUpdateByIdData`
|
|
61
62
|
*/
|
|
62
|
-
this.updateById = (id, params = {}) => this.request({
|
|
63
|
+
this.updateById = (id, params = {}) => this.http.request({
|
|
63
64
|
path: `/tag/${id}`,
|
|
64
65
|
method: 'PATCH',
|
|
65
66
|
...params,
|
|
@@ -68,10 +69,11 @@ class Tag extends HttpClient_1.HttpClient {
|
|
|
68
69
|
* No description
|
|
69
70
|
*
|
|
70
71
|
* @tags Tag
|
|
71
|
-
* @name
|
|
72
|
+
* @name TagControllerDeleteById
|
|
72
73
|
* @request DELETE:/tag/{id}
|
|
74
|
+
* @response `200` `ITagControllerDeleteByIdData`
|
|
73
75
|
*/
|
|
74
|
-
this.deleteById = (id, params = {}) => this.request({
|
|
76
|
+
this.deleteById = (id, params = {}) => this.http.request({
|
|
75
77
|
path: `/tag/${id}`,
|
|
76
78
|
method: 'DELETE',
|
|
77
79
|
...params,
|
|
@@ -80,14 +82,16 @@ class Tag extends HttpClient_1.HttpClient {
|
|
|
80
82
|
* No description
|
|
81
83
|
*
|
|
82
84
|
* @tags Tag
|
|
83
|
-
* @name
|
|
85
|
+
* @name TagControllerGetArticleById
|
|
84
86
|
* @request GET:/tag/{id}/article
|
|
87
|
+
* @response `200` `ITagControllerGetArticleByIdData`
|
|
85
88
|
*/
|
|
86
|
-
this.getArticleById = (id, params = {}) => this.request({
|
|
89
|
+
this.getArticleById = (id, params = {}) => this.http.request({
|
|
87
90
|
path: `/tag/${id}/article`,
|
|
88
91
|
method: 'GET',
|
|
89
92
|
...params,
|
|
90
93
|
});
|
|
94
|
+
this.http = http;
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
exports.Tag = Tag;
|
package/dist/api/User.d.ts
CHANGED
|
@@ -1,36 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IUserControllerFindAllData, IUserControllerRegisterData, IUserControllerUpdateData, IUserControllerUpdatePasswordData } from '../types';
|
|
2
2
|
import { HttpClient, RequestParams } from './HttpClient';
|
|
3
|
-
export declare class User<SecurityDataType = unknown>
|
|
3
|
+
export declare class User<SecurityDataType = unknown> {
|
|
4
|
+
http: HttpClient<SecurityDataType>;
|
|
5
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
4
6
|
/**
|
|
5
7
|
* No description
|
|
6
8
|
*
|
|
7
9
|
* @tags User
|
|
8
|
-
* @name
|
|
10
|
+
* @name UserControllerFindAll
|
|
9
11
|
* @request GET:/user
|
|
12
|
+
* @response `200` `IUserControllerFindAllData` 获取用户列表
|
|
13
|
+
* @response `403` `void` 无权获取用户列表
|
|
10
14
|
*/
|
|
11
|
-
findAll: (params?: RequestParams) => Promise<
|
|
15
|
+
findAll: (params?: RequestParams) => Promise<IUserControllerFindAllData>;
|
|
12
16
|
/**
|
|
13
17
|
* No description
|
|
14
18
|
*
|
|
15
19
|
* @tags User
|
|
16
|
-
* @name
|
|
20
|
+
* @name UserControllerRegister
|
|
17
21
|
* @request POST:/user/register
|
|
22
|
+
* @response `201` `IUserControllerRegisterData` 创建用户
|
|
18
23
|
*/
|
|
19
|
-
register: (params?: RequestParams) => Promise<
|
|
24
|
+
register: (params?: RequestParams) => Promise<IUserControllerRegisterData>;
|
|
20
25
|
/**
|
|
21
26
|
* No description
|
|
22
27
|
*
|
|
23
28
|
* @tags User
|
|
24
|
-
* @name
|
|
29
|
+
* @name UserControllerUpdate
|
|
25
30
|
* @request POST:/user/update
|
|
31
|
+
* @response `200` `IUserControllerUpdateData` 更新用户成功
|
|
26
32
|
*/
|
|
27
|
-
update: (params?: RequestParams) => Promise<
|
|
33
|
+
update: (params?: RequestParams) => Promise<IUserControllerUpdateData>;
|
|
28
34
|
/**
|
|
29
35
|
* No description
|
|
30
36
|
*
|
|
31
37
|
* @tags User
|
|
32
|
-
* @name
|
|
38
|
+
* @name UserControllerUpdatePassword
|
|
33
39
|
* @request POST:/user/password
|
|
40
|
+
* @response `201` `IUserControllerUpdatePasswordData` 更新密码成功
|
|
34
41
|
*/
|
|
35
|
-
updatePassword: (params?: RequestParams) => Promise<
|
|
42
|
+
updatePassword: (params?: RequestParams) => Promise<IUserControllerUpdatePasswordData>;
|
|
36
43
|
}
|
package/dist/api/User.js
CHANGED
|
@@ -11,62 +11,62 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.User = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class User {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags User
|
|
22
|
-
* @name
|
|
20
|
+
* @name UserControllerFindAll
|
|
23
21
|
* @request GET:/user
|
|
22
|
+
* @response `200` `IUserControllerFindAllData` 获取用户列表
|
|
23
|
+
* @response `403` `void` 无权获取用户列表
|
|
24
24
|
*/
|
|
25
|
-
this.findAll = (params = {}) => this.request({
|
|
25
|
+
this.findAll = (params = {}) => this.http.request({
|
|
26
26
|
path: `/user`,
|
|
27
27
|
method: 'GET',
|
|
28
|
-
format: 'json',
|
|
29
28
|
...params,
|
|
30
29
|
});
|
|
31
30
|
/**
|
|
32
31
|
* No description
|
|
33
32
|
*
|
|
34
33
|
* @tags User
|
|
35
|
-
* @name
|
|
34
|
+
* @name UserControllerRegister
|
|
36
35
|
* @request POST:/user/register
|
|
36
|
+
* @response `201` `IUserControllerRegisterData` 创建用户
|
|
37
37
|
*/
|
|
38
|
-
this.register = (params = {}) => this.request({
|
|
38
|
+
this.register = (params = {}) => this.http.request({
|
|
39
39
|
path: `/user/register`,
|
|
40
40
|
method: 'POST',
|
|
41
|
-
format: 'json',
|
|
42
41
|
...params,
|
|
43
42
|
});
|
|
44
43
|
/**
|
|
45
44
|
* No description
|
|
46
45
|
*
|
|
47
46
|
* @tags User
|
|
48
|
-
* @name
|
|
47
|
+
* @name UserControllerUpdate
|
|
49
48
|
* @request POST:/user/update
|
|
49
|
+
* @response `200` `IUserControllerUpdateData` 更新用户成功
|
|
50
50
|
*/
|
|
51
|
-
this.update = (params = {}) => this.request({
|
|
51
|
+
this.update = (params = {}) => this.http.request({
|
|
52
52
|
path: `/user/update`,
|
|
53
53
|
method: 'POST',
|
|
54
|
-
format: 'json',
|
|
55
54
|
...params,
|
|
56
55
|
});
|
|
57
56
|
/**
|
|
58
57
|
* No description
|
|
59
58
|
*
|
|
60
59
|
* @tags User
|
|
61
|
-
* @name
|
|
60
|
+
* @name UserControllerUpdatePassword
|
|
62
61
|
* @request POST:/user/password
|
|
62
|
+
* @response `201` `IUserControllerUpdatePasswordData` 更新密码成功
|
|
63
63
|
*/
|
|
64
|
-
this.updatePassword = (params = {}) => this.request({
|
|
64
|
+
this.updatePassword = (params = {}) => this.http.request({
|
|
65
65
|
path: `/user/password`,
|
|
66
66
|
method: 'POST',
|
|
67
|
-
format: 'json',
|
|
68
67
|
...params,
|
|
69
68
|
});
|
|
69
|
+
this.http = http;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
exports.User = User;
|
package/dist/api/View.d.ts
CHANGED
|
@@ -1,44 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IViewControllerCreateData } from '../types';
|
|
2
2
|
import { HttpClient, RequestParams } from './HttpClient';
|
|
3
|
-
export declare class View<SecurityDataType = unknown>
|
|
3
|
+
export declare class View<SecurityDataType = unknown> {
|
|
4
|
+
http: HttpClient<SecurityDataType>;
|
|
5
|
+
constructor(http: HttpClient<SecurityDataType>);
|
|
4
6
|
/**
|
|
5
7
|
* No description
|
|
6
8
|
*
|
|
7
9
|
* @tags View
|
|
8
|
-
* @name
|
|
10
|
+
* @name ViewControllerCreate
|
|
9
11
|
* @request POST:/view
|
|
12
|
+
* @response `200` `IViewControllerCreateData` 访问记录添加成功
|
|
10
13
|
*/
|
|
11
|
-
create: (params?: RequestParams) => Promise<
|
|
14
|
+
create: (params?: RequestParams) => Promise<IViewControllerCreateData>;
|
|
12
15
|
/**
|
|
13
16
|
* No description
|
|
14
17
|
*
|
|
15
18
|
* @tags View
|
|
16
|
-
* @name
|
|
19
|
+
* @name ViewControllerFindAll
|
|
17
20
|
* @request GET:/view
|
|
21
|
+
* @response `200` `IViewControllerFindAllData`
|
|
18
22
|
*/
|
|
19
|
-
findAll: (params?: RequestParams) => Promise<
|
|
23
|
+
findAll: (params?: RequestParams) => Promise<any>;
|
|
20
24
|
/**
|
|
21
25
|
* No description
|
|
22
26
|
*
|
|
23
27
|
* @tags View
|
|
24
|
-
* @name
|
|
28
|
+
* @name ViewControllerFindByUrl
|
|
25
29
|
* @request GET:/view/url
|
|
30
|
+
* @response `200` `IViewControllerFindByUrlData`
|
|
26
31
|
*/
|
|
27
|
-
findByUrl: (params?: RequestParams) => Promise<
|
|
32
|
+
findByUrl: (params?: RequestParams) => Promise<any>;
|
|
28
33
|
/**
|
|
29
34
|
* No description
|
|
30
35
|
*
|
|
31
36
|
* @tags View
|
|
32
|
-
* @name
|
|
37
|
+
* @name ViewControllerFindById
|
|
33
38
|
* @request GET:/view/{id}
|
|
39
|
+
* @response `200` `IViewControllerFindByIdData`
|
|
34
40
|
*/
|
|
35
|
-
findById: (id: string, params?: RequestParams) => Promise<
|
|
41
|
+
findById: (id: string, params?: RequestParams) => Promise<any>;
|
|
36
42
|
/**
|
|
37
43
|
* No description
|
|
38
44
|
*
|
|
39
45
|
* @tags View
|
|
40
|
-
* @name
|
|
46
|
+
* @name ViewControllerDeleteById
|
|
41
47
|
* @request DELETE:/view/{id}
|
|
48
|
+
* @response `200` `IViewControllerDeleteByIdData`
|
|
42
49
|
*/
|
|
43
|
-
deleteById: (id: string, params?: RequestParams) => Promise<
|
|
50
|
+
deleteById: (id: string, params?: RequestParams) => Promise<any>;
|
|
44
51
|
}
|
package/dist/api/View.js
CHANGED
|
@@ -11,31 +11,30 @@
|
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.View = void 0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
14
|
+
class View {
|
|
15
|
+
constructor(http) {
|
|
18
16
|
/**
|
|
19
17
|
* No description
|
|
20
18
|
*
|
|
21
19
|
* @tags View
|
|
22
|
-
* @name
|
|
20
|
+
* @name ViewControllerCreate
|
|
23
21
|
* @request POST:/view
|
|
22
|
+
* @response `200` `IViewControllerCreateData` 访问记录添加成功
|
|
24
23
|
*/
|
|
25
|
-
this.create = (params = {}) => this.request({
|
|
24
|
+
this.create = (params = {}) => this.http.request({
|
|
26
25
|
path: `/view`,
|
|
27
26
|
method: 'POST',
|
|
28
|
-
format: 'json',
|
|
29
27
|
...params,
|
|
30
28
|
});
|
|
31
29
|
/**
|
|
32
30
|
* No description
|
|
33
31
|
*
|
|
34
32
|
* @tags View
|
|
35
|
-
* @name
|
|
33
|
+
* @name ViewControllerFindAll
|
|
36
34
|
* @request GET:/view
|
|
35
|
+
* @response `200` `IViewControllerFindAllData`
|
|
37
36
|
*/
|
|
38
|
-
this.findAll = (params = {}) => this.request({
|
|
37
|
+
this.findAll = (params = {}) => this.http.request({
|
|
39
38
|
path: `/view`,
|
|
40
39
|
method: 'GET',
|
|
41
40
|
...params,
|
|
@@ -44,10 +43,11 @@ class View extends HttpClient_1.HttpClient {
|
|
|
44
43
|
* No description
|
|
45
44
|
*
|
|
46
45
|
* @tags View
|
|
47
|
-
* @name
|
|
46
|
+
* @name ViewControllerFindByUrl
|
|
48
47
|
* @request GET:/view/url
|
|
48
|
+
* @response `200` `IViewControllerFindByUrlData`
|
|
49
49
|
*/
|
|
50
|
-
this.findByUrl = (params = {}) => this.request({
|
|
50
|
+
this.findByUrl = (params = {}) => this.http.request({
|
|
51
51
|
path: `/view/url`,
|
|
52
52
|
method: 'GET',
|
|
53
53
|
...params,
|
|
@@ -56,10 +56,11 @@ class View extends HttpClient_1.HttpClient {
|
|
|
56
56
|
* No description
|
|
57
57
|
*
|
|
58
58
|
* @tags View
|
|
59
|
-
* @name
|
|
59
|
+
* @name ViewControllerFindById
|
|
60
60
|
* @request GET:/view/{id}
|
|
61
|
+
* @response `200` `IViewControllerFindByIdData`
|
|
61
62
|
*/
|
|
62
|
-
this.findById = (id, params = {}) => this.request({
|
|
63
|
+
this.findById = (id, params = {}) => this.http.request({
|
|
63
64
|
path: `/view/${id}`,
|
|
64
65
|
method: 'GET',
|
|
65
66
|
...params,
|
|
@@ -68,14 +69,16 @@ class View extends HttpClient_1.HttpClient {
|
|
|
68
69
|
* No description
|
|
69
70
|
*
|
|
70
71
|
* @tags View
|
|
71
|
-
* @name
|
|
72
|
+
* @name ViewControllerDeleteById
|
|
72
73
|
* @request DELETE:/view/{id}
|
|
74
|
+
* @response `200` `IViewControllerDeleteByIdData`
|
|
73
75
|
*/
|
|
74
|
-
this.deleteById = (id, params = {}) => this.request({
|
|
76
|
+
this.deleteById = (id, params = {}) => this.http.request({
|
|
75
77
|
path: `/view/${id}`,
|
|
76
78
|
method: 'DELETE',
|
|
77
79
|
...params,
|
|
78
80
|
});
|
|
81
|
+
this.http = http;
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
exports.View = View;
|
package/dist/api/httpClient.d.ts
CHANGED
|
@@ -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 */
|
|
@@ -15,7 +15,7 @@ export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'pa
|
|
|
15
15
|
body?: unknown;
|
|
16
16
|
}
|
|
17
17
|
export declare type RequestParams = Omit<FullRequestParams, 'body' | 'method' | 'query' | 'path'>;
|
|
18
|
-
export interface
|
|
18
|
+
export interface ApiConfig<SecurityDataType = unknown> extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
|
|
19
19
|
securityWorker?: (securityData: SecurityDataType | null) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
|
|
20
20
|
secure?: boolean;
|
|
21
21
|
format?: ResponseType;
|
|
@@ -29,14 +29,13 @@ export declare enum ContentType {
|
|
|
29
29
|
export declare class HttpClient<SecurityDataType = unknown> {
|
|
30
30
|
instance: AxiosInstance;
|
|
31
31
|
private securityData;
|
|
32
|
-
|
|
32
|
+
private securityWorker?;
|
|
33
33
|
private secure?;
|
|
34
34
|
private format?;
|
|
35
|
-
constructor({ securityWorker, secure, format, ...axiosConfig }?:
|
|
35
|
+
constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig<SecurityDataType>);
|
|
36
36
|
setSecurityData: (data: SecurityDataType | null) => void;
|
|
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
|
}
|
|
42
|
-
export default HttpClient;
|
package/dist/api/httpClient.js
CHANGED
|
@@ -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;
|
|
@@ -92,4 +94,3 @@ class HttpClient {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
exports.HttpClient = HttpClient;
|
|
95
|
-
exports.default = HttpClient;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export * from './View';
|
|
15
|
-
export { default as HttpClient } from './HttpClient';
|
|
16
|
-
export type { HttpClientConfig } from './HttpClient';
|
|
17
|
-
export * from './ApiInstance';
|
|
18
|
-
export { default as api } from './ApiInstance';
|
|
1
|
+
export { Article } from './Article';
|
|
2
|
+
export { Auth } from './Auth';
|
|
3
|
+
export { Category } from './Category';
|
|
4
|
+
export { Comment } from './Comment';
|
|
5
|
+
export { File } from './File';
|
|
6
|
+
export { Knowledge } from './Knowledge';
|
|
7
|
+
export { Page } from './Page';
|
|
8
|
+
export { Search } from './Search';
|
|
9
|
+
export { Setting } from './Setting';
|
|
10
|
+
export { Smtp } from './Smtp';
|
|
11
|
+
export { Tag } from './Tag';
|
|
12
|
+
export { User } from './User';
|
|
13
|
+
export { View } from './View';
|
package/dist/api/index.js
CHANGED
|
@@ -1,42 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// API
|
|
3
|
-
// 自动生成,请勿手动修改
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
-
};
|
|
18
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
-
};
|
|
2
|
+
// Auto-generated API module index
|
|
21
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
Object.defineProperty(exports, "
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
Object.defineProperty(exports, "
|
|
4
|
+
exports.View = exports.User = exports.Tag = exports.Smtp = exports.Setting = exports.Search = exports.Page = exports.Knowledge = exports.File = exports.Comment = exports.Category = exports.Auth = exports.Article = void 0;
|
|
5
|
+
var Article_1 = require("./Article");
|
|
6
|
+
Object.defineProperty(exports, "Article", { enumerable: true, get: function () { return Article_1.Article; } });
|
|
7
|
+
var Auth_1 = require("./Auth");
|
|
8
|
+
Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return Auth_1.Auth; } });
|
|
9
|
+
var Category_1 = require("./Category");
|
|
10
|
+
Object.defineProperty(exports, "Category", { enumerable: true, get: function () { return Category_1.Category; } });
|
|
11
|
+
var Comment_1 = require("./Comment");
|
|
12
|
+
Object.defineProperty(exports, "Comment", { enumerable: true, get: function () { return Comment_1.Comment; } });
|
|
13
|
+
var File_1 = require("./File");
|
|
14
|
+
Object.defineProperty(exports, "File", { enumerable: true, get: function () { return File_1.File; } });
|
|
15
|
+
var Knowledge_1 = require("./Knowledge");
|
|
16
|
+
Object.defineProperty(exports, "Knowledge", { enumerable: true, get: function () { return Knowledge_1.Knowledge; } });
|
|
17
|
+
var Page_1 = require("./Page");
|
|
18
|
+
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
19
|
+
var Search_1 = require("./Search");
|
|
20
|
+
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return Search_1.Search; } });
|
|
21
|
+
var Setting_1 = require("./Setting");
|
|
22
|
+
Object.defineProperty(exports, "Setting", { enumerable: true, get: function () { return Setting_1.Setting; } });
|
|
23
|
+
var Smtp_1 = require("./Smtp");
|
|
24
|
+
Object.defineProperty(exports, "Smtp", { enumerable: true, get: function () { return Smtp_1.Smtp; } });
|
|
25
|
+
var Tag_1 = require("./Tag");
|
|
26
|
+
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return Tag_1.Tag; } });
|
|
27
|
+
var User_1 = require("./User");
|
|
28
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return User_1.User; } });
|
|
29
|
+
var View_1 = require("./View");
|
|
30
|
+
Object.defineProperty(exports, "View", { enumerable: true, get: function () { return View_1.View; } });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HttpClient } from './HttpClient';
|
|
2
|
+
import { Article } from './Article';
|
|
3
|
+
import { Auth } from './Auth';
|
|
4
|
+
import { Category } from './Category';
|
|
5
|
+
import { Comment } from './Comment';
|
|
6
|
+
import { File } from './File';
|
|
7
|
+
import { Knowledge } from './Knowledge';
|
|
8
|
+
import { Page } from './Page';
|
|
9
|
+
import { Search } from './Search';
|
|
10
|
+
import { Setting } from './Setting';
|
|
11
|
+
import { Smtp } from './Smtp';
|
|
12
|
+
import { Tag } from './Tag';
|
|
13
|
+
import { User } from './User';
|
|
14
|
+
import { View } from './View';
|
|
15
|
+
export declare const http: HttpClient<unknown>;
|
|
16
|
+
export declare const api: {
|
|
17
|
+
article: Article<unknown>;
|
|
18
|
+
auth: Auth<unknown>;
|
|
19
|
+
category: Category<unknown>;
|
|
20
|
+
comment: Comment<unknown>;
|
|
21
|
+
file: File<unknown>;
|
|
22
|
+
knowledge: Knowledge<unknown>;
|
|
23
|
+
page: Page<unknown>;
|
|
24
|
+
search: Search<unknown>;
|
|
25
|
+
setting: Setting<unknown>;
|
|
26
|
+
smtp: Smtp<unknown>;
|
|
27
|
+
tag: Tag<unknown>;
|
|
28
|
+
user: User<unknown>;
|
|
29
|
+
view: View<unknown>;
|
|
30
|
+
};
|
|
31
|
+
export declare function createApiInstance(config: any): {
|
|
32
|
+
article: Article<unknown>;
|
|
33
|
+
auth: Auth<unknown>;
|
|
34
|
+
category: Category<unknown>;
|
|
35
|
+
comment: Comment<unknown>;
|
|
36
|
+
file: File<unknown>;
|
|
37
|
+
knowledge: Knowledge<unknown>;
|
|
38
|
+
page: Page<unknown>;
|
|
39
|
+
search: Search<unknown>;
|
|
40
|
+
setting: Setting<unknown>;
|
|
41
|
+
smtp: Smtp<unknown>;
|
|
42
|
+
tag: Tag<unknown>;
|
|
43
|
+
user: User<unknown>;
|
|
44
|
+
view: View<unknown>;
|
|
45
|
+
};
|
|
46
|
+
export default api;
|
|
47
|
+
export { Article, Auth, Category, Comment, File, Knowledge, Page, Search, Setting, Smtp, Tag, User, View, };
|