@fecommunity/reactpress-toolkit 1.0.0-beta.1 → 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 +405 -0
- package/dist/Article.d.ts +121 -0
- package/dist/Article.js +189 -0
- package/dist/Auth.d.ts +30 -0
- package/dist/Auth.js +59 -0
- package/dist/Category.d.ts +49 -0
- package/dist/Category.js +85 -0
- package/dist/Comment.d.ts +58 -0
- package/dist/Comment.js +98 -0
- package/dist/File.d.ts +40 -0
- package/dist/File.js +72 -0
- package/dist/HttpClient.d.ts +41 -0
- package/dist/HttpClient.js +94 -0
- package/dist/Knowledge.d.ts +76 -0
- package/dist/Knowledge.js +124 -0
- package/dist/Page.d.ts +58 -0
- package/dist/Page.js +98 -0
- package/dist/Search.d.ts +30 -0
- package/dist/Search.js +59 -0
- package/dist/Setting.d.ts +22 -0
- package/dist/Setting.js +46 -0
- package/dist/Smtp.d.ts +31 -0
- package/dist/Smtp.js +59 -0
- package/dist/Tag.d.ts +58 -0
- package/dist/Tag.js +98 -0
- package/dist/User.d.ts +41 -0
- package/dist/User.js +73 -0
- package/dist/View.d.ts +49 -0
- package/dist/View.js +85 -0
- package/dist/api/ApiInstance.d.ts +39 -0
- package/dist/api/ApiInstance.js +46 -0
- package/dist/api/Article.d.ts +44 -29
- package/dist/api/Article.js +42 -31
- package/dist/api/ArticleRoute.d.ts +201 -0
- package/dist/api/ArticleRoute.js +12 -0
- package/dist/api/Auth.d.ts +11 -6
- package/dist/api/Auth.js +10 -8
- package/dist/api/AuthRoute.d.ts +44 -0
- package/dist/api/AuthRoute.js +12 -0
- package/dist/api/Category.d.ts +20 -13
- package/dist/api/Category.js +18 -15
- package/dist/api/CategoryRoute.d.ts +79 -0
- package/dist/api/CategoryRoute.js +12 -0
- package/dist/api/Comment.d.ts +22 -14
- package/dist/api/Comment.js +20 -16
- package/dist/api/CommentRoute.d.ts +95 -0
- package/dist/api/CommentRoute.js +12 -0
- package/dist/api/File.d.ts +16 -10
- package/dist/api/File.js +14 -12
- package/dist/api/FileRoute.d.ts +63 -0
- package/dist/api/FileRoute.js +12 -0
- package/dist/api/Knowledge.d.ts +29 -19
- package/dist/api/Knowledge.js +27 -22
- package/dist/api/KnowledgeRoute.d.ts +125 -0
- package/dist/api/KnowledgeRoute.js +12 -0
- package/dist/api/Page.d.ts +23 -15
- package/dist/api/Page.js +21 -17
- package/dist/api/PageRoute.d.ts +95 -0
- package/dist/api/PageRoute.js +12 -0
- package/dist/api/Search.d.ts +12 -7
- package/dist/api/Search.js +11 -9
- package/dist/api/SearchRoute.d.ts +46 -0
- package/dist/api/SearchRoute.js +12 -0
- package/dist/api/Setting.d.ts +10 -6
- package/dist/api/Setting.js +8 -8
- package/dist/api/SettingRoute.d.ts +31 -0
- package/dist/api/SettingRoute.js +12 -0
- package/dist/api/Smtp.d.ts +14 -9
- package/dist/api/Smtp.js +12 -11
- package/dist/api/SmtpRoute.d.ts +47 -0
- package/dist/api/SmtpRoute.js +12 -0
- package/dist/api/Tag.d.ts +22 -14
- package/dist/api/Tag.js +20 -16
- package/dist/api/TagRoute.d.ts +95 -0
- package/dist/api/TagRoute.js +12 -0
- package/dist/api/User.d.ts +15 -8
- package/dist/api/User.js +13 -13
- package/dist/api/UserRoute.d.ts +60 -0
- package/dist/api/UserRoute.js +12 -0
- package/dist/api/View.d.ts +19 -12
- package/dist/api/View.js +17 -14
- package/dist/api/ViewRoute.d.ts +77 -0
- package/dist/api/ViewRoute.js +12 -0
- package/dist/api/httpClient.d.ts +5 -5
- package/dist/api/httpClient.js +4 -2
- package/dist/api/index.d.ts +13 -18
- package/dist/api/index.js +28 -41
- package/dist/api/instance.d.ts +47 -0
- package/dist/api/instance.js +71 -0
- package/dist/data-contracts.d.ts +245 -0
- package/dist/data-contracts.js +12 -0
- package/dist/index.d.ts +5 -9
- package/dist/index.js +16 -21
- package/dist/types/index.d.ts +245 -1
- package/dist/types/index.js +10 -17
- package/dist/utils/common.d.ts +1 -3
- package/dist/utils/common.js +5 -31
- package/dist/utils/http.js +4 -6
- package/dist/utils/index.d.ts +33 -2
- package/dist/utils/index.js +57 -18
- package/package.json +11 -6
- package/demos/simple.ts +0 -65
- package/scripts/generate-api-types.js +0 -571
- package/scripts/generate-swagger.js +0 -47
- package/scripts/organize-api.js +0 -136
- package/src/api/Article.ts +0 -186
- package/src/api/Auth.ts +0 -54
- package/src/api/Category.ts +0 -82
- package/src/api/Comment.ts +0 -95
- package/src/api/File.ts +0 -69
- package/src/api/Knowledge.ts +0 -122
- package/src/api/Page.ts +0 -95
- package/src/api/Search.ts +0 -54
- package/src/api/Setting.ts +0 -43
- package/src/api/Smtp.ts +0 -56
- package/src/api/Tag.ts +0 -95
- package/src/api/User.ts +0 -72
- package/src/api/View.ts +0 -82
- package/src/api/api-instance.ts +0 -69
- package/src/api/httpClient.ts +0 -140
- package/src/api/index.ts +0 -25
- package/src/index.ts +0 -18
- package/src/types/data-contracts.ts +0 -198
- package/src/types/index.ts +0 -4
- package/src/utils/common.ts +0 -108
- package/src/utils/http.ts +0 -52
- package/src/utils/index.ts +0 -5
- package/test-final.js +0 -56
- package/test-import.js +0 -34
- package/tsconfig.json +0 -20
package/src/api/Knowledge.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { IKnowledge } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class Knowledge<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags Knowledge
|
|
20
|
-
* @name createBook
|
|
21
|
-
* @request POST:/Knowledge/book
|
|
22
|
-
*/
|
|
23
|
-
createBook = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<IKnowledge[], any>({
|
|
25
|
-
path: `/Knowledge/book`,
|
|
26
|
-
method: 'POST',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags Knowledge
|
|
34
|
-
* @name createChapter
|
|
35
|
-
* @request POST:/Knowledge/chapter
|
|
36
|
-
*/
|
|
37
|
-
createChapter = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<IKnowledge[], any>({
|
|
39
|
-
path: `/Knowledge/chapter`,
|
|
40
|
-
method: 'POST',
|
|
41
|
-
format: 'json',
|
|
42
|
-
...params,
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* No description
|
|
46
|
-
*
|
|
47
|
-
* @tags Knowledge
|
|
48
|
-
* @name deleteById
|
|
49
|
-
* @request DELETE:/Knowledge/{id}
|
|
50
|
-
*/
|
|
51
|
-
deleteById = (id: string, params: RequestParams = {}) =>
|
|
52
|
-
this.request<void, any>({
|
|
53
|
-
path: `/Knowledge/${id}`,
|
|
54
|
-
method: 'DELETE',
|
|
55
|
-
...params,
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* No description
|
|
59
|
-
*
|
|
60
|
-
* @tags Knowledge
|
|
61
|
-
* @name updateById
|
|
62
|
-
* @request PATCH:/Knowledge/{id}
|
|
63
|
-
*/
|
|
64
|
-
updateById = (id: string, params: RequestParams = {}) =>
|
|
65
|
-
this.request<void, any>({
|
|
66
|
-
path: `/Knowledge/${id}`,
|
|
67
|
-
method: 'PATCH',
|
|
68
|
-
...params,
|
|
69
|
-
});
|
|
70
|
-
/**
|
|
71
|
-
* No description
|
|
72
|
-
*
|
|
73
|
-
* @tags Knowledge
|
|
74
|
-
* @name findById
|
|
75
|
-
* @request GET:/Knowledge/{id}
|
|
76
|
-
*/
|
|
77
|
-
findById = (id: string, params: RequestParams = {}) =>
|
|
78
|
-
this.request<void, any>({
|
|
79
|
-
path: `/Knowledge/${id}`,
|
|
80
|
-
method: 'GET',
|
|
81
|
-
...params,
|
|
82
|
-
});
|
|
83
|
-
/**
|
|
84
|
-
* No description
|
|
85
|
-
*
|
|
86
|
-
* @tags Knowledge
|
|
87
|
-
* @name findAll
|
|
88
|
-
* @request GET:/Knowledge
|
|
89
|
-
*/
|
|
90
|
-
findAll = (params: RequestParams = {}) =>
|
|
91
|
-
this.request<void, any>({
|
|
92
|
-
path: `/Knowledge`,
|
|
93
|
-
method: 'GET',
|
|
94
|
-
...params,
|
|
95
|
-
});
|
|
96
|
-
/**
|
|
97
|
-
* No description
|
|
98
|
-
*
|
|
99
|
-
* @tags Knowledge
|
|
100
|
-
* @name updateViews
|
|
101
|
-
* @request POST:/Knowledge/{id}/views
|
|
102
|
-
*/
|
|
103
|
-
updateViews = (id: string, params: RequestParams = {}) =>
|
|
104
|
-
this.request<void, any>({
|
|
105
|
-
path: `/Knowledge/${id}/views`,
|
|
106
|
-
method: 'POST',
|
|
107
|
-
...params,
|
|
108
|
-
});
|
|
109
|
-
/**
|
|
110
|
-
* No description
|
|
111
|
-
*
|
|
112
|
-
* @tags Knowledge
|
|
113
|
-
* @name updateLikes
|
|
114
|
-
* @request POST:/Knowledge/{id}/likes
|
|
115
|
-
*/
|
|
116
|
-
updateLikes = (id: string, params: RequestParams = {}) =>
|
|
117
|
-
this.request<void, any>({
|
|
118
|
-
path: `/Knowledge/${id}/likes`,
|
|
119
|
-
method: 'POST',
|
|
120
|
-
...params,
|
|
121
|
-
});
|
|
122
|
-
}
|
package/src/api/Page.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { IPage } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class Page<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags Page
|
|
20
|
-
* @name create
|
|
21
|
-
* @request POST:/page
|
|
22
|
-
*/
|
|
23
|
-
create = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<IPage[], any>({
|
|
25
|
-
path: `/page`,
|
|
26
|
-
method: 'POST',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags Page
|
|
34
|
-
* @name findAll
|
|
35
|
-
* @request GET:/page
|
|
36
|
-
*/
|
|
37
|
-
findAll = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<void, any>({
|
|
39
|
-
path: `/page`,
|
|
40
|
-
method: 'GET',
|
|
41
|
-
...params,
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* No description
|
|
45
|
-
*
|
|
46
|
-
* @tags Page
|
|
47
|
-
* @name findById
|
|
48
|
-
* @request GET:/page/{id}
|
|
49
|
-
*/
|
|
50
|
-
findById = (id: string, params: RequestParams = {}) =>
|
|
51
|
-
this.request<void, any>({
|
|
52
|
-
path: `/page/${id}`,
|
|
53
|
-
method: 'GET',
|
|
54
|
-
...params,
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* No description
|
|
58
|
-
*
|
|
59
|
-
* @tags Page
|
|
60
|
-
* @name updateById
|
|
61
|
-
* @request PATCH:/page/{id}
|
|
62
|
-
*/
|
|
63
|
-
updateById = (id: string, params: RequestParams = {}) =>
|
|
64
|
-
this.request<void, any>({
|
|
65
|
-
path: `/page/${id}`,
|
|
66
|
-
method: 'PATCH',
|
|
67
|
-
...params,
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* No description
|
|
71
|
-
*
|
|
72
|
-
* @tags Page
|
|
73
|
-
* @name deleteById
|
|
74
|
-
* @request DELETE:/page/{id}
|
|
75
|
-
*/
|
|
76
|
-
deleteById = (id: string, params: RequestParams = {}) =>
|
|
77
|
-
this.request<void, any>({
|
|
78
|
-
path: `/page/${id}`,
|
|
79
|
-
method: 'DELETE',
|
|
80
|
-
...params,
|
|
81
|
-
});
|
|
82
|
-
/**
|
|
83
|
-
* No description
|
|
84
|
-
*
|
|
85
|
-
* @tags Page
|
|
86
|
-
* @name updateViews
|
|
87
|
-
* @request POST:/page/{id}/views
|
|
88
|
-
*/
|
|
89
|
-
updateViews = (id: string, params: RequestParams = {}) =>
|
|
90
|
-
this.request<void, any>({
|
|
91
|
-
path: `/page/${id}/views`,
|
|
92
|
-
method: 'POST',
|
|
93
|
-
...params,
|
|
94
|
-
});
|
|
95
|
-
}
|
package/src/api/Search.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
13
|
-
|
|
14
|
-
export class Search<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
15
|
-
/**
|
|
16
|
-
* No description
|
|
17
|
-
*
|
|
18
|
-
* @tags Search
|
|
19
|
-
* @name SearchControllerSearchArticle
|
|
20
|
-
* @request GET:/search/article
|
|
21
|
-
*/
|
|
22
|
-
searchControllerSearchArticle = (params: RequestParams = {}) =>
|
|
23
|
-
this.request<void, any>({
|
|
24
|
-
path: `/search/article`,
|
|
25
|
-
method: 'GET',
|
|
26
|
-
...params,
|
|
27
|
-
});
|
|
28
|
-
/**
|
|
29
|
-
* No description
|
|
30
|
-
*
|
|
31
|
-
* @tags Search
|
|
32
|
-
* @name findAll
|
|
33
|
-
* @request GET:/search
|
|
34
|
-
*/
|
|
35
|
-
findAll = (params: RequestParams = {}) =>
|
|
36
|
-
this.request<void, any>({
|
|
37
|
-
path: `/search`,
|
|
38
|
-
method: 'GET',
|
|
39
|
-
...params,
|
|
40
|
-
});
|
|
41
|
-
/**
|
|
42
|
-
* No description
|
|
43
|
-
*
|
|
44
|
-
* @tags Search
|
|
45
|
-
* @name deleteById
|
|
46
|
-
* @request DELETE:/search/{id}
|
|
47
|
-
*/
|
|
48
|
-
deleteById = (id: string, params: RequestParams = {}) =>
|
|
49
|
-
this.request<void, any>({
|
|
50
|
-
path: `/search/${id}`,
|
|
51
|
-
method: 'DELETE',
|
|
52
|
-
...params,
|
|
53
|
-
});
|
|
54
|
-
}
|
package/src/api/Setting.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { ISetting } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class Setting<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags Setting
|
|
20
|
-
* @name SettingControllerUpdate
|
|
21
|
-
* @request POST:/setting
|
|
22
|
-
*/
|
|
23
|
-
settingControllerUpdate = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<ISetting[], any>({
|
|
25
|
-
path: `/setting`,
|
|
26
|
-
method: 'POST',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags Setting
|
|
34
|
-
* @name findAll
|
|
35
|
-
* @request POST:/setting/get
|
|
36
|
-
*/
|
|
37
|
-
findAll = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<void, any>({
|
|
39
|
-
path: `/setting/get`,
|
|
40
|
-
method: 'POST',
|
|
41
|
-
...params,
|
|
42
|
-
});
|
|
43
|
-
}
|
package/src/api/Smtp.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { I_SMTP } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class Smtp<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags Smtp
|
|
20
|
-
* @name create
|
|
21
|
-
* @request POST:/smtp
|
|
22
|
-
*/
|
|
23
|
-
create = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<I_SMTP[], any>({
|
|
25
|
-
path: `/smtp`,
|
|
26
|
-
method: 'POST',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags Smtp
|
|
34
|
-
* @name findAll
|
|
35
|
-
* @request GET:/smtp
|
|
36
|
-
*/
|
|
37
|
-
findAll = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<void, any>({
|
|
39
|
-
path: `/smtp`,
|
|
40
|
-
method: 'GET',
|
|
41
|
-
...params,
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* No description
|
|
45
|
-
*
|
|
46
|
-
* @tags Smtp
|
|
47
|
-
* @name deleteById
|
|
48
|
-
* @request DELETE:/smtp/{id}
|
|
49
|
-
*/
|
|
50
|
-
deleteById = (id: string, params: RequestParams = {}) =>
|
|
51
|
-
this.request<void, any>({
|
|
52
|
-
path: `/smtp/${id}`,
|
|
53
|
-
method: 'DELETE',
|
|
54
|
-
...params,
|
|
55
|
-
});
|
|
56
|
-
}
|
package/src/api/Tag.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { ITag } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class Tag<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags Tag
|
|
20
|
-
* @name create
|
|
21
|
-
* @request POST:/tag
|
|
22
|
-
*/
|
|
23
|
-
create = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<ITag[], any>({
|
|
25
|
-
path: `/tag`,
|
|
26
|
-
method: 'POST',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags Tag
|
|
34
|
-
* @name findAll
|
|
35
|
-
* @request GET:/tag
|
|
36
|
-
*/
|
|
37
|
-
findAll = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<void, any>({
|
|
39
|
-
path: `/tag`,
|
|
40
|
-
method: 'GET',
|
|
41
|
-
...params,
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* No description
|
|
45
|
-
*
|
|
46
|
-
* @tags Tag
|
|
47
|
-
* @name findById
|
|
48
|
-
* @request GET:/tag/{id}
|
|
49
|
-
*/
|
|
50
|
-
findById = (id: string, params: RequestParams = {}) =>
|
|
51
|
-
this.request<void, any>({
|
|
52
|
-
path: `/tag/${id}`,
|
|
53
|
-
method: 'GET',
|
|
54
|
-
...params,
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* No description
|
|
58
|
-
*
|
|
59
|
-
* @tags Tag
|
|
60
|
-
* @name updateById
|
|
61
|
-
* @request PATCH:/tag/{id}
|
|
62
|
-
*/
|
|
63
|
-
updateById = (id: string, params: RequestParams = {}) =>
|
|
64
|
-
this.request<void, any>({
|
|
65
|
-
path: `/tag/${id}`,
|
|
66
|
-
method: 'PATCH',
|
|
67
|
-
...params,
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* No description
|
|
71
|
-
*
|
|
72
|
-
* @tags Tag
|
|
73
|
-
* @name deleteById
|
|
74
|
-
* @request DELETE:/tag/{id}
|
|
75
|
-
*/
|
|
76
|
-
deleteById = (id: string, params: RequestParams = {}) =>
|
|
77
|
-
this.request<void, any>({
|
|
78
|
-
path: `/tag/${id}`,
|
|
79
|
-
method: 'DELETE',
|
|
80
|
-
...params,
|
|
81
|
-
});
|
|
82
|
-
/**
|
|
83
|
-
* No description
|
|
84
|
-
*
|
|
85
|
-
* @tags Tag
|
|
86
|
-
* @name TagControllerGetArticleById
|
|
87
|
-
* @request GET:/tag/{id}/article
|
|
88
|
-
*/
|
|
89
|
-
tagControllerGetArticleById = (id: string, params: RequestParams = {}) =>
|
|
90
|
-
this.request<void, any>({
|
|
91
|
-
path: `/tag/${id}/article`,
|
|
92
|
-
method: 'GET',
|
|
93
|
-
...params,
|
|
94
|
-
});
|
|
95
|
-
}
|
package/src/api/User.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { IUser } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class User<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags User
|
|
20
|
-
* @name findAll
|
|
21
|
-
* @request GET:/user
|
|
22
|
-
*/
|
|
23
|
-
findAll = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<IUser[], void>({
|
|
25
|
-
path: `/user`,
|
|
26
|
-
method: 'GET',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags User
|
|
34
|
-
* @name UserControllerRegister
|
|
35
|
-
* @request POST:/user/register
|
|
36
|
-
*/
|
|
37
|
-
userControllerRegister = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<IUser[], any>({
|
|
39
|
-
path: `/user/register`,
|
|
40
|
-
method: 'POST',
|
|
41
|
-
format: 'json',
|
|
42
|
-
...params,
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* No description
|
|
46
|
-
*
|
|
47
|
-
* @tags User
|
|
48
|
-
* @name UserControllerUpdate
|
|
49
|
-
* @request POST:/user/update
|
|
50
|
-
*/
|
|
51
|
-
userControllerUpdate = (params: RequestParams = {}) =>
|
|
52
|
-
this.request<IUser[], any>({
|
|
53
|
-
path: `/user/update`,
|
|
54
|
-
method: 'POST',
|
|
55
|
-
format: 'json',
|
|
56
|
-
...params,
|
|
57
|
-
});
|
|
58
|
-
/**
|
|
59
|
-
* No description
|
|
60
|
-
*
|
|
61
|
-
* @tags User
|
|
62
|
-
* @name UserControllerUpdatePassword
|
|
63
|
-
* @request POST:/user/password
|
|
64
|
-
*/
|
|
65
|
-
userControllerUpdatePassword = (params: RequestParams = {}) =>
|
|
66
|
-
this.request<IUser[], any>({
|
|
67
|
-
path: `/user/password`,
|
|
68
|
-
method: 'POST',
|
|
69
|
-
format: 'json',
|
|
70
|
-
...params,
|
|
71
|
-
});
|
|
72
|
-
}
|
package/src/api/View.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/*
|
|
4
|
-
* ---------------------------------------------------------------
|
|
5
|
-
* ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
|
|
6
|
-
* ## ##
|
|
7
|
-
* ## AUTHOR: acacode ##
|
|
8
|
-
* ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
|
|
9
|
-
* ---------------------------------------------------------------
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { IView } from '../types/data-contracts';
|
|
13
|
-
import { HttpClient, RequestParams } from './httpClient';
|
|
14
|
-
|
|
15
|
-
export class View<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
16
|
-
/**
|
|
17
|
-
* No description
|
|
18
|
-
*
|
|
19
|
-
* @tags View
|
|
20
|
-
* @name create
|
|
21
|
-
* @request POST:/view
|
|
22
|
-
*/
|
|
23
|
-
create = (params: RequestParams = {}) =>
|
|
24
|
-
this.request<IView[], any>({
|
|
25
|
-
path: `/view`,
|
|
26
|
-
method: 'POST',
|
|
27
|
-
format: 'json',
|
|
28
|
-
...params,
|
|
29
|
-
});
|
|
30
|
-
/**
|
|
31
|
-
* No description
|
|
32
|
-
*
|
|
33
|
-
* @tags View
|
|
34
|
-
* @name findAll
|
|
35
|
-
* @request GET:/view
|
|
36
|
-
*/
|
|
37
|
-
findAll = (params: RequestParams = {}) =>
|
|
38
|
-
this.request<void, any>({
|
|
39
|
-
path: `/view`,
|
|
40
|
-
method: 'GET',
|
|
41
|
-
...params,
|
|
42
|
-
});
|
|
43
|
-
/**
|
|
44
|
-
* No description
|
|
45
|
-
*
|
|
46
|
-
* @tags View
|
|
47
|
-
* @name ViewControllerFindByUrl
|
|
48
|
-
* @request GET:/view/url
|
|
49
|
-
*/
|
|
50
|
-
viewControllerFindByUrl = (params: RequestParams = {}) =>
|
|
51
|
-
this.request<void, any>({
|
|
52
|
-
path: `/view/url`,
|
|
53
|
-
method: 'GET',
|
|
54
|
-
...params,
|
|
55
|
-
});
|
|
56
|
-
/**
|
|
57
|
-
* No description
|
|
58
|
-
*
|
|
59
|
-
* @tags View
|
|
60
|
-
* @name findById
|
|
61
|
-
* @request GET:/view/{id}
|
|
62
|
-
*/
|
|
63
|
-
findById = (id: string, params: RequestParams = {}) =>
|
|
64
|
-
this.request<void, any>({
|
|
65
|
-
path: `/view/${id}`,
|
|
66
|
-
method: 'GET',
|
|
67
|
-
...params,
|
|
68
|
-
});
|
|
69
|
-
/**
|
|
70
|
-
* No description
|
|
71
|
-
*
|
|
72
|
-
* @tags View
|
|
73
|
-
* @name deleteById
|
|
74
|
-
* @request DELETE:/view/{id}
|
|
75
|
-
*/
|
|
76
|
-
deleteById = (id: string, params: RequestParams = {}) =>
|
|
77
|
-
this.request<void, any>({
|
|
78
|
-
path: `/view/${id}`,
|
|
79
|
-
method: 'DELETE',
|
|
80
|
-
...params,
|
|
81
|
-
});
|
|
82
|
-
}
|
package/src/api/api-instance.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// API 实例化文件
|
|
2
|
-
// 自动生成,请勿手动修改
|
|
3
|
-
|
|
4
|
-
import { HttpClient, HttpClientConfig } from './httpClient';
|
|
5
|
-
import { Article } from './Article';
|
|
6
|
-
import { Auth } from './Auth';
|
|
7
|
-
import { Category } from './Category';
|
|
8
|
-
import { Comment } from './Comment';
|
|
9
|
-
import { File } from './File';
|
|
10
|
-
import { Knowledge } from './Knowledge';
|
|
11
|
-
import { Page } from './Page';
|
|
12
|
-
import { Search } from './Search';
|
|
13
|
-
import { Setting } from './Setting';
|
|
14
|
-
import { Smtp } from './Smtp';
|
|
15
|
-
import { Tag } from './Tag';
|
|
16
|
-
import { User } from './User';
|
|
17
|
-
import { View } from './View';
|
|
18
|
-
|
|
19
|
-
export interface ApiConfig<SecurityDataType = unknown> extends HttpClientConfig<SecurityDataType> {
|
|
20
|
-
// 可以添加额外的配置项
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ApiInstance<SecurityDataType = unknown> {
|
|
24
|
-
article: Article<SecurityDataType>;
|
|
25
|
-
auth: Auth<SecurityDataType>;
|
|
26
|
-
category: Category<SecurityDataType>;
|
|
27
|
-
comment: Comment<SecurityDataType>;
|
|
28
|
-
file: File<SecurityDataType>;
|
|
29
|
-
knowledge: Knowledge<SecurityDataType>;
|
|
30
|
-
page: Page<SecurityDataType>;
|
|
31
|
-
search: Search<SecurityDataType>;
|
|
32
|
-
setting: Setting<SecurityDataType>;
|
|
33
|
-
smtp: Smtp<SecurityDataType>;
|
|
34
|
-
tag: Tag<SecurityDataType>;
|
|
35
|
-
user: User<SecurityDataType>;
|
|
36
|
-
view: View<SecurityDataType>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* 创建 API 实例
|
|
41
|
-
* @param config API 配置
|
|
42
|
-
* @returns API 实例对象
|
|
43
|
-
*/
|
|
44
|
-
export function createApiInstance<SecurityDataType = unknown>(
|
|
45
|
-
config: ApiConfig<SecurityDataType> = {}
|
|
46
|
-
): ApiInstance<SecurityDataType> {
|
|
47
|
-
const httpClient = new HttpClient<SecurityDataType>(config);
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
article: new Article(config),
|
|
51
|
-
auth: new Auth(config),
|
|
52
|
-
category: new Category(config),
|
|
53
|
-
comment: new Comment(config),
|
|
54
|
-
file: new File(config),
|
|
55
|
-
knowledge: new Knowledge(config),
|
|
56
|
-
page: new Page(config),
|
|
57
|
-
search: new Search(config),
|
|
58
|
-
setting: new Setting(config),
|
|
59
|
-
smtp: new Smtp(config),
|
|
60
|
-
tag: new Tag(config),
|
|
61
|
-
user: new User(config),
|
|
62
|
-
view: new View(config),
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// 默认 API 实例
|
|
67
|
-
export const api = createApiInstance();
|
|
68
|
-
|
|
69
|
-
export default api;
|