@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.
Files changed (130) hide show
  1. package/README.md +405 -0
  2. package/dist/Article.d.ts +121 -0
  3. package/dist/Article.js +189 -0
  4. package/dist/Auth.d.ts +30 -0
  5. package/dist/Auth.js +59 -0
  6. package/dist/Category.d.ts +49 -0
  7. package/dist/Category.js +85 -0
  8. package/dist/Comment.d.ts +58 -0
  9. package/dist/Comment.js +98 -0
  10. package/dist/File.d.ts +40 -0
  11. package/dist/File.js +72 -0
  12. package/dist/HttpClient.d.ts +41 -0
  13. package/dist/HttpClient.js +94 -0
  14. package/dist/Knowledge.d.ts +76 -0
  15. package/dist/Knowledge.js +124 -0
  16. package/dist/Page.d.ts +58 -0
  17. package/dist/Page.js +98 -0
  18. package/dist/Search.d.ts +30 -0
  19. package/dist/Search.js +59 -0
  20. package/dist/Setting.d.ts +22 -0
  21. package/dist/Setting.js +46 -0
  22. package/dist/Smtp.d.ts +31 -0
  23. package/dist/Smtp.js +59 -0
  24. package/dist/Tag.d.ts +58 -0
  25. package/dist/Tag.js +98 -0
  26. package/dist/User.d.ts +41 -0
  27. package/dist/User.js +73 -0
  28. package/dist/View.d.ts +49 -0
  29. package/dist/View.js +85 -0
  30. package/dist/api/ApiInstance.d.ts +39 -0
  31. package/dist/api/ApiInstance.js +46 -0
  32. package/dist/api/Article.d.ts +44 -29
  33. package/dist/api/Article.js +42 -31
  34. package/dist/api/ArticleRoute.d.ts +201 -0
  35. package/dist/api/ArticleRoute.js +12 -0
  36. package/dist/api/Auth.d.ts +11 -6
  37. package/dist/api/Auth.js +10 -8
  38. package/dist/api/AuthRoute.d.ts +44 -0
  39. package/dist/api/AuthRoute.js +12 -0
  40. package/dist/api/Category.d.ts +20 -13
  41. package/dist/api/Category.js +18 -15
  42. package/dist/api/CategoryRoute.d.ts +79 -0
  43. package/dist/api/CategoryRoute.js +12 -0
  44. package/dist/api/Comment.d.ts +22 -14
  45. package/dist/api/Comment.js +20 -16
  46. package/dist/api/CommentRoute.d.ts +95 -0
  47. package/dist/api/CommentRoute.js +12 -0
  48. package/dist/api/File.d.ts +16 -10
  49. package/dist/api/File.js +14 -12
  50. package/dist/api/FileRoute.d.ts +63 -0
  51. package/dist/api/FileRoute.js +12 -0
  52. package/dist/api/Knowledge.d.ts +29 -19
  53. package/dist/api/Knowledge.js +27 -22
  54. package/dist/api/KnowledgeRoute.d.ts +125 -0
  55. package/dist/api/KnowledgeRoute.js +12 -0
  56. package/dist/api/Page.d.ts +23 -15
  57. package/dist/api/Page.js +21 -17
  58. package/dist/api/PageRoute.d.ts +95 -0
  59. package/dist/api/PageRoute.js +12 -0
  60. package/dist/api/Search.d.ts +12 -7
  61. package/dist/api/Search.js +11 -9
  62. package/dist/api/SearchRoute.d.ts +46 -0
  63. package/dist/api/SearchRoute.js +12 -0
  64. package/dist/api/Setting.d.ts +10 -6
  65. package/dist/api/Setting.js +8 -8
  66. package/dist/api/SettingRoute.d.ts +31 -0
  67. package/dist/api/SettingRoute.js +12 -0
  68. package/dist/api/Smtp.d.ts +14 -9
  69. package/dist/api/Smtp.js +12 -11
  70. package/dist/api/SmtpRoute.d.ts +47 -0
  71. package/dist/api/SmtpRoute.js +12 -0
  72. package/dist/api/Tag.d.ts +22 -14
  73. package/dist/api/Tag.js +20 -16
  74. package/dist/api/TagRoute.d.ts +95 -0
  75. package/dist/api/TagRoute.js +12 -0
  76. package/dist/api/User.d.ts +15 -8
  77. package/dist/api/User.js +13 -13
  78. package/dist/api/UserRoute.d.ts +60 -0
  79. package/dist/api/UserRoute.js +12 -0
  80. package/dist/api/View.d.ts +19 -12
  81. package/dist/api/View.js +17 -14
  82. package/dist/api/ViewRoute.d.ts +77 -0
  83. package/dist/api/ViewRoute.js +12 -0
  84. package/dist/api/httpClient.d.ts +5 -5
  85. package/dist/api/httpClient.js +4 -2
  86. package/dist/api/index.d.ts +13 -18
  87. package/dist/api/index.js +28 -41
  88. package/dist/api/instance.d.ts +47 -0
  89. package/dist/api/instance.js +71 -0
  90. package/dist/data-contracts.d.ts +245 -0
  91. package/dist/data-contracts.js +12 -0
  92. package/dist/index.d.ts +5 -9
  93. package/dist/index.js +16 -21
  94. package/dist/types/index.d.ts +245 -1
  95. package/dist/types/index.js +10 -17
  96. package/dist/utils/common.d.ts +1 -3
  97. package/dist/utils/common.js +5 -31
  98. package/dist/utils/http.js +4 -6
  99. package/dist/utils/index.d.ts +33 -2
  100. package/dist/utils/index.js +57 -18
  101. package/package.json +11 -6
  102. package/demos/simple.ts +0 -65
  103. package/scripts/generate-api-types.js +0 -571
  104. package/scripts/generate-swagger.js +0 -47
  105. package/scripts/organize-api.js +0 -136
  106. package/src/api/Article.ts +0 -186
  107. package/src/api/Auth.ts +0 -54
  108. package/src/api/Category.ts +0 -82
  109. package/src/api/Comment.ts +0 -95
  110. package/src/api/File.ts +0 -69
  111. package/src/api/Knowledge.ts +0 -122
  112. package/src/api/Page.ts +0 -95
  113. package/src/api/Search.ts +0 -54
  114. package/src/api/Setting.ts +0 -43
  115. package/src/api/Smtp.ts +0 -56
  116. package/src/api/Tag.ts +0 -95
  117. package/src/api/User.ts +0 -72
  118. package/src/api/View.ts +0 -82
  119. package/src/api/api-instance.ts +0 -69
  120. package/src/api/httpClient.ts +0 -140
  121. package/src/api/index.ts +0 -25
  122. package/src/index.ts +0 -18
  123. package/src/types/data-contracts.ts +0 -198
  124. package/src/types/index.ts +0 -4
  125. package/src/utils/common.ts +0 -108
  126. package/src/utils/http.ts +0 -52
  127. package/src/utils/index.ts +0 -5
  128. package/test-final.js +0 -56
  129. package/test-import.js +0 -34
  130. package/tsconfig.json +0 -20
@@ -11,31 +11,30 @@
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Article = void 0;
14
- const httpClient_1 = require("./httpClient");
15
- class Article extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Article {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Article
22
- * @name create
20
+ * @name ArticleControllerCreate
23
21
  * @request POST:/article
22
+ * @response `200` `IArticleControllerCreateData` 创建文章
24
23
  */
25
- this.create = (params = {}) => this.request({
24
+ this.create = (params = {}) => this.http.request({
26
25
  path: `/article`,
27
26
  method: 'POST',
28
- format: 'json',
29
27
  ...params,
30
28
  });
31
29
  /**
32
30
  * No description
33
31
  *
34
32
  * @tags Article
35
- * @name findAll
33
+ * @name ArticleControllerFindAll
36
34
  * @request GET:/article
35
+ * @response `200` `IArticleControllerFindAllData`
37
36
  */
38
- this.findAll = (params = {}) => this.request({
37
+ this.findAll = (params = {}) => this.http.request({
39
38
  path: `/article`,
40
39
  method: 'GET',
41
40
  ...params,
@@ -44,10 +43,11 @@ class Article extends httpClient_1.HttpClient {
44
43
  * No description
45
44
  *
46
45
  * @tags Article
47
- * @name findByCategory
46
+ * @name ArticleControllerFindArticlesByCategory
48
47
  * @request GET:/article/category/{id}
48
+ * @response `200` `IArticleControllerFindArticlesByCategoryData`
49
49
  */
50
- this.findByCategory = (id, params = {}) => this.request({
50
+ this.findArticlesByCategory = (id, params = {}) => this.http.request({
51
51
  path: `/article/category/${id}`,
52
52
  method: 'GET',
53
53
  ...params,
@@ -56,10 +56,11 @@ class Article extends httpClient_1.HttpClient {
56
56
  * No description
57
57
  *
58
58
  * @tags Article
59
- * @name findByTag
59
+ * @name ArticleControllerFindArticlesByTag
60
60
  * @request GET:/article/tag/{id}
61
+ * @response `200` `IArticleControllerFindArticlesByTagData`
61
62
  */
62
- this.findByTag = (id, params = {}) => this.request({
63
+ this.findArticlesByTag = (id, params = {}) => this.http.request({
63
64
  path: `/article/tag/${id}`,
64
65
  method: 'GET',
65
66
  ...params,
@@ -68,10 +69,11 @@ class Article extends httpClient_1.HttpClient {
68
69
  * No description
69
70
  *
70
71
  * @tags Article
71
- * @name getRecommendations
72
+ * @name ArticleControllerGetRecommendArticles
72
73
  * @request GET:/article/all/recommend
74
+ * @response `200` `IArticleControllerGetRecommendArticlesData`
73
75
  */
74
- this.getRecommendations = (params = {}) => this.request({
76
+ this.getRecommendArticles = (params = {}) => this.http.request({
75
77
  path: `/article/all/recommend`,
76
78
  method: 'GET',
77
79
  ...params,
@@ -80,10 +82,11 @@ class Article extends httpClient_1.HttpClient {
80
82
  * No description
81
83
  *
82
84
  * @tags Article
83
- * @name getArchives
85
+ * @name ArticleControllerGetArchives
84
86
  * @request GET:/article/archives
87
+ * @response `200` `IArticleControllerGetArchivesData`
85
88
  */
86
- this.getArchives = (params = {}) => this.request({
89
+ this.getArchives = (params = {}) => this.http.request({
87
90
  path: `/article/archives`,
88
91
  method: 'GET',
89
92
  ...params,
@@ -92,10 +95,11 @@ class Article extends httpClient_1.HttpClient {
92
95
  * No description
93
96
  *
94
97
  * @tags Article
95
- * @name recommend
98
+ * @name ArticleControllerRecommend
96
99
  * @request GET:/article/recommend
100
+ * @response `200` `IArticleControllerRecommendData`
97
101
  */
98
- this.recommend = (params = {}) => this.request({
102
+ this.recommend = (params = {}) => this.http.request({
99
103
  path: `/article/recommend`,
100
104
  method: 'GET',
101
105
  ...params,
@@ -104,10 +108,11 @@ class Article extends httpClient_1.HttpClient {
104
108
  * No description
105
109
  *
106
110
  * @tags Article
107
- * @name findById
111
+ * @name ArticleControllerFindById
108
112
  * @request GET:/article/{id}
113
+ * @response `200` `IArticleControllerFindByIdData`
109
114
  */
110
- this.findById = (id, params = {}) => this.request({
115
+ this.findById = (id, params = {}) => this.http.request({
111
116
  path: `/article/${id}`,
112
117
  method: 'GET',
113
118
  ...params,
@@ -116,10 +121,11 @@ class Article extends httpClient_1.HttpClient {
116
121
  * No description
117
122
  *
118
123
  * @tags Article
119
- * @name updateById
124
+ * @name ArticleControllerUpdateById
120
125
  * @request PATCH:/article/{id}
126
+ * @response `200` `IArticleControllerUpdateByIdData`
121
127
  */
122
- this.updateById = (id, params = {}) => this.request({
128
+ this.updateById = (id, params = {}) => this.http.request({
123
129
  path: `/article/${id}`,
124
130
  method: 'PATCH',
125
131
  ...params,
@@ -128,10 +134,11 @@ class Article extends httpClient_1.HttpClient {
128
134
  * No description
129
135
  *
130
136
  * @tags Article
131
- * @name deleteById
137
+ * @name ArticleControllerDeleteById
132
138
  * @request DELETE:/article/{id}
139
+ * @response `200` `IArticleControllerDeleteByIdData`
133
140
  */
134
- this.deleteById = (id, params = {}) => this.request({
141
+ this.deleteById = (id, params = {}) => this.http.request({
135
142
  path: `/article/${id}`,
136
143
  method: 'DELETE',
137
144
  ...params,
@@ -140,10 +147,11 @@ class Article extends httpClient_1.HttpClient {
140
147
  * No description
141
148
  *
142
149
  * @tags Article
143
- * @name checkPassword
150
+ * @name ArticleControllerCheckPassword
144
151
  * @request POST:/article/{id}/checkPassword
152
+ * @response `200` `IArticleControllerCheckPasswordData`
145
153
  */
146
- this.checkPassword = (id, params = {}) => this.request({
154
+ this.checkPassword = (id, params = {}) => this.http.request({
147
155
  path: `/article/${id}/checkPassword`,
148
156
  method: 'POST',
149
157
  ...params,
@@ -152,10 +160,11 @@ class Article extends httpClient_1.HttpClient {
152
160
  * No description
153
161
  *
154
162
  * @tags Article
155
- * @name updateViews
163
+ * @name ArticleControllerUpdateViewsById
156
164
  * @request POST:/article/{id}/views
165
+ * @response `200` `IArticleControllerUpdateViewsByIdData`
157
166
  */
158
- this.updateViews = (id, params = {}) => this.request({
167
+ this.updateViewsById = (id, params = {}) => this.http.request({
159
168
  path: `/article/${id}/views`,
160
169
  method: 'POST',
161
170
  ...params,
@@ -164,14 +173,16 @@ class Article extends httpClient_1.HttpClient {
164
173
  * No description
165
174
  *
166
175
  * @tags Article
167
- * @name updateLikes
176
+ * @name ArticleControllerUpdateLikesById
168
177
  * @request POST:/article/{id}/likes
178
+ * @response `200` `IArticleControllerUpdateLikesByIdData`
169
179
  */
170
- this.updateLikes = (id, params = {}) => this.request({
180
+ this.updateLikesById = (id, params = {}) => this.http.request({
171
181
  path: `/article/${id}/likes`,
172
182
  method: 'POST',
173
183
  ...params,
174
184
  });
185
+ this.http = http;
175
186
  }
176
187
  }
177
188
  exports.Article = Article;
@@ -0,0 +1,201 @@
1
+ import { IArticle } from '../types/data-contracts';
2
+ export declare namespace Article {
3
+ /**
4
+ * No description
5
+ * @tags Article
6
+ * @name create
7
+ * @request POST:/article
8
+ * @response `200` `(IArticle)[]` 创建文章
9
+ */
10
+ namespace create {
11
+ type RequestParams = {};
12
+ type RequestQuery = {};
13
+ type RequestBody = never;
14
+ type RequestHeaders = {};
15
+ type ResponseBody = IArticle[];
16
+ }
17
+ /**
18
+ * No description
19
+ * @tags Article
20
+ * @name findAll
21
+ * @request GET:/article
22
+ * @response `200` `void`
23
+ */
24
+ namespace findAll {
25
+ type RequestParams = {};
26
+ type RequestQuery = {};
27
+ type RequestBody = never;
28
+ type RequestHeaders = {};
29
+ type ResponseBody = void;
30
+ }
31
+ /**
32
+ * No description
33
+ * @tags Article
34
+ * @name findArticlesByCategory
35
+ * @request GET:/article/category/{id}
36
+ * @response `200` `void`
37
+ */
38
+ namespace findArticlesByCategory {
39
+ type RequestParams = {
40
+ id: string;
41
+ };
42
+ type RequestQuery = {};
43
+ type RequestBody = never;
44
+ type RequestHeaders = {};
45
+ type ResponseBody = void;
46
+ }
47
+ /**
48
+ * No description
49
+ * @tags Article
50
+ * @name findArticlesByTag
51
+ * @request GET:/article/tag/{id}
52
+ * @response `200` `void`
53
+ */
54
+ namespace findArticlesByTag {
55
+ type RequestParams = {
56
+ id: string;
57
+ };
58
+ type RequestQuery = {};
59
+ type RequestBody = never;
60
+ type RequestHeaders = {};
61
+ type ResponseBody = void;
62
+ }
63
+ /**
64
+ * No description
65
+ * @tags Article
66
+ * @name getRecommendArticles
67
+ * @request GET:/article/all/recommend
68
+ * @response `200` `void`
69
+ */
70
+ namespace getRecommendArticles {
71
+ type RequestParams = {};
72
+ type RequestQuery = {};
73
+ type RequestBody = never;
74
+ type RequestHeaders = {};
75
+ type ResponseBody = void;
76
+ }
77
+ /**
78
+ * No description
79
+ * @tags Article
80
+ * @name getArchives
81
+ * @request GET:/article/archives
82
+ * @response `200` `void`
83
+ */
84
+ namespace getArchives {
85
+ type RequestParams = {};
86
+ type RequestQuery = {};
87
+ type RequestBody = never;
88
+ type RequestHeaders = {};
89
+ type ResponseBody = void;
90
+ }
91
+ /**
92
+ * No description
93
+ * @tags Article
94
+ * @name recommend
95
+ * @request GET:/article/recommend
96
+ * @response `200` `void`
97
+ */
98
+ namespace recommend {
99
+ type RequestParams = {};
100
+ type RequestQuery = {};
101
+ type RequestBody = never;
102
+ type RequestHeaders = {};
103
+ type ResponseBody = void;
104
+ }
105
+ /**
106
+ * No description
107
+ * @tags Article
108
+ * @name findById
109
+ * @request GET:/article/{id}
110
+ * @response `200` `void`
111
+ */
112
+ namespace findById {
113
+ type RequestParams = {
114
+ id: string;
115
+ };
116
+ type RequestQuery = {};
117
+ type RequestBody = never;
118
+ type RequestHeaders = {};
119
+ type ResponseBody = void;
120
+ }
121
+ /**
122
+ * No description
123
+ * @tags Article
124
+ * @name updateById
125
+ * @request PATCH:/article/{id}
126
+ * @response `200` `void`
127
+ */
128
+ namespace updateById {
129
+ type RequestParams = {
130
+ id: string;
131
+ };
132
+ type RequestQuery = {};
133
+ type RequestBody = never;
134
+ type RequestHeaders = {};
135
+ type ResponseBody = void;
136
+ }
137
+ /**
138
+ * No description
139
+ * @tags Article
140
+ * @name deleteById
141
+ * @request DELETE:/article/{id}
142
+ * @response `200` `void`
143
+ */
144
+ namespace deleteById {
145
+ type RequestParams = {
146
+ id: string;
147
+ };
148
+ type RequestQuery = {};
149
+ type RequestBody = never;
150
+ type RequestHeaders = {};
151
+ type ResponseBody = void;
152
+ }
153
+ /**
154
+ * No description
155
+ * @tags Article
156
+ * @name checkPassword
157
+ * @request POST:/article/{id}/checkPassword
158
+ * @response `200` `void`
159
+ */
160
+ namespace checkPassword {
161
+ type RequestParams = {
162
+ id: string;
163
+ };
164
+ type RequestQuery = {};
165
+ type RequestBody = never;
166
+ type RequestHeaders = {};
167
+ type ResponseBody = void;
168
+ }
169
+ /**
170
+ * No description
171
+ * @tags Article
172
+ * @name updateViewsById
173
+ * @request POST:/article/{id}/views
174
+ * @response `200` `void`
175
+ */
176
+ namespace updateViewsById {
177
+ type RequestParams = {
178
+ id: string;
179
+ };
180
+ type RequestQuery = {};
181
+ type RequestBody = never;
182
+ type RequestHeaders = {};
183
+ type ResponseBody = void;
184
+ }
185
+ /**
186
+ * No description
187
+ * @tags Article
188
+ * @name updateLikesById
189
+ * @request POST:/article/{id}/likes
190
+ * @response `200` `void`
191
+ */
192
+ namespace updateLikesById {
193
+ type RequestParams = {
194
+ id: string;
195
+ };
196
+ type RequestQuery = {};
197
+ type RequestBody = never;
198
+ type RequestHeaders = {};
199
+ type ResponseBody = void;
200
+ }
201
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,27 +1,32 @@
1
- import { HttpClient, RequestParams } from './httpClient';
2
- export declare class Auth<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { HttpClient, RequestParams } from './HttpClient';
2
+ export declare class Auth<SecurityDataType = unknown> {
3
+ http: HttpClient<SecurityDataType>;
4
+ constructor(http: HttpClient<SecurityDataType>);
3
5
  /**
4
6
  * No description
5
7
  *
6
8
  * @tags Auth
7
9
  * @name AuthControllerLogin
8
10
  * @request POST:/auth/login
11
+ * @response `200` `IAuthControllerLoginData`
9
12
  */
10
- authControllerLogin: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
13
+ login: (params?: RequestParams) => Promise<any>;
11
14
  /**
12
15
  * No description
13
16
  *
14
17
  * @tags Auth
15
- * @name createBook
18
+ * @name AuthControllerCreateBook
16
19
  * @request POST:/auth/admin
20
+ * @response `201` `IAuthControllerCreateBookData`
17
21
  */
18
- createBook: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
22
+ createBook: (params?: RequestParams) => Promise<any>;
19
23
  /**
20
24
  * No description
21
25
  *
22
26
  * @tags Auth
23
27
  * @name AuthControllerLoginWithGithub
24
28
  * @request POST:/auth/github
29
+ * @response `201` `IAuthControllerLoginWithGithubData`
25
30
  */
26
- authControllerLoginWithGithub: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
31
+ loginWithGithub: (params?: RequestParams) => Promise<any>;
27
32
  }
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
- const httpClient_1 = require("./httpClient");
15
- class Auth extends httpClient_1.HttpClient {
16
- constructor() {
17
- super(...arguments);
14
+ class Auth {
15
+ constructor(http) {
18
16
  /**
19
17
  * No description
20
18
  *
21
19
  * @tags Auth
22
20
  * @name AuthControllerLogin
23
21
  * @request POST:/auth/login
22
+ * @response `200` `IAuthControllerLoginData`
24
23
  */
25
- this.authControllerLogin = (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 createBook
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,
@@ -45,12 +45,14 @@ class Auth extends httpClient_1.HttpClient {
45
45
  * @tags Auth
46
46
  * @name AuthControllerLoginWithGithub
47
47
  * @request POST:/auth/github
48
+ * @response `201` `IAuthControllerLoginWithGithubData`
48
49
  */
49
- this.authControllerLoginWithGithub = (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;
@@ -0,0 +1,44 @@
1
+ export declare namespace Auth {
2
+ /**
3
+ * No description
4
+ * @tags Auth
5
+ * @name login
6
+ * @request POST:/auth/login
7
+ * @response `200` `void`
8
+ */
9
+ namespace login {
10
+ type RequestParams = {};
11
+ type RequestQuery = {};
12
+ type RequestBody = never;
13
+ type RequestHeaders = {};
14
+ type ResponseBody = void;
15
+ }
16
+ /**
17
+ * No description
18
+ * @tags Auth
19
+ * @name createBook
20
+ * @request POST:/auth/admin
21
+ * @response `201` `void`
22
+ */
23
+ namespace createBook {
24
+ type RequestParams = {};
25
+ type RequestQuery = {};
26
+ type RequestBody = never;
27
+ type RequestHeaders = {};
28
+ type ResponseBody = void;
29
+ }
30
+ /**
31
+ * No description
32
+ * @tags Auth
33
+ * @name loginWithGithub
34
+ * @request POST:/auth/github
35
+ * @response `201` `void`
36
+ */
37
+ namespace loginWithGithub {
38
+ type RequestParams = {};
39
+ type RequestQuery = {};
40
+ type RequestBody = never;
41
+ type RequestHeaders = {};
42
+ type ResponseBody = void;
43
+ }
44
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,44 +1,51 @@
1
- import { ICategory } from '../types/data-contracts';
2
- import { HttpClient, RequestParams } from './httpClient';
3
- export declare class Category<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
1
+ import { ICategoryControllerCreateData } from '../types';
2
+ import { HttpClient, RequestParams } from './HttpClient';
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 create
10
+ * @name CategoryControllerCreate
9
11
  * @request POST:/category
12
+ * @response `200` `ICategoryControllerCreateData` 添加分类
10
13
  */
11
- create: (params?: RequestParams) => Promise<import("axios").AxiosResponse<ICategory[], any, {}>>;
14
+ create: (params?: RequestParams) => Promise<ICategoryControllerCreateData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Category
16
- * @name findAll
19
+ * @name CategoryControllerFindAll
17
20
  * @request GET:/category
21
+ * @response `200` `ICategoryControllerFindAllData`
18
22
  */
19
- findAll: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
23
+ findAll: (params?: RequestParams) => Promise<any>;
20
24
  /**
21
25
  * No description
22
26
  *
23
27
  * @tags Category
24
- * @name findById
28
+ * @name CategoryControllerFindById
25
29
  * @request GET:/category/{id}
30
+ * @response `200` `ICategoryControllerFindByIdData`
26
31
  */
27
- findById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
32
+ findById: (id: string, params?: RequestParams) => Promise<any>;
28
33
  /**
29
34
  * No description
30
35
  *
31
36
  * @tags Category
32
- * @name updateById
37
+ * @name CategoryControllerUpdateById
33
38
  * @request PATCH:/category/{id}
39
+ * @response `200` `ICategoryControllerUpdateByIdData`
34
40
  */
35
- updateById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
41
+ updateById: (id: string, params?: RequestParams) => Promise<any>;
36
42
  /**
37
43
  * No description
38
44
  *
39
45
  * @tags Category
40
- * @name deleteById
46
+ * @name CategoryControllerDeleteById
41
47
  * @request DELETE:/category/{id}
48
+ * @response `200` `ICategoryControllerDeleteByIdData`
42
49
  */
43
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
50
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
44
51
  }