@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 CHANGED
@@ -1,15 +1,23 @@
1
1
  # @fecommunity/reactpress-toolkit
2
2
 
3
- A TypeScript-based API client toolkit for ReactPress, automatically generated from OpenAPI/Swagger specifications.
3
+ TypeScript-based API client toolkit for ReactPress, automatically generated from OpenAPI/Swagger specifications.
4
+
5
+ [![NPM Version](https://img.shields.io/npm/v/@fecommunity/reactpress-toolkit.svg)](https://www.npmjs.com/package/@fecommunity/reactpress-toolkit)
6
+ [![License](https://img.shields.io/npm/l/@fecommunity/reactpress-toolkit.svg)](https://github.com/fecommunity/reactpress/blob/master/toolkit/LICENSE)
7
+ [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
4
8
 
5
9
  ## Overview
6
10
 
7
- The ReactPress Toolkit is a comprehensive API client library that provides strongly-typed interfaces for interacting with the ReactPress backend services. It includes:
11
+ The ReactPress Toolkit is an API client library that provides strongly-typed interfaces for interacting with the ReactPress backend services. It includes:
8
12
 
9
13
  - **Auto-generated API clients** for all ReactPress modules
10
14
  - **TypeScript definitions** for all data contracts
11
15
  - **Utility functions** for common operations
12
16
  - **HTTP client** with built-in authentication and error handling
17
+ - **Automatic retry mechanisms** for failed requests
18
+ - **Request/response interceptors** for logging
19
+
20
+ The toolkit is automatically generated from the ReactPress backend's OpenAPI specification, ensuring that it's always in sync with the latest API changes. This eliminates manual API client maintenance and reduces the likelihood of API integration errors.
13
21
 
14
22
  ## Installation
15
23
 
@@ -89,11 +97,11 @@ The toolkit provides clients for all ReactPress backend modules:
89
97
  You can create a custom API instance with specific configuration:
90
98
 
91
99
  ```typescript
92
- import { createApiInstance } from '@fecommunity/reactpress-toolkit';
100
+ import { api } from '@fecommunity/reactpress-toolkit';
93
101
 
94
- const customApi = createApiInstance({
102
+ const customApi = api.createApiInstance({
95
103
  baseURL: 'https://api.yourdomain.com',
96
- timeout: 5000,
104
+ timeout: 10000,
97
105
  // ... other axios configuration options
98
106
  });
99
107
 
@@ -101,6 +109,62 @@ const customApi = createApiInstance({
101
109
  const articles = await customApi.article.findAll();
102
110
  ```
103
111
 
112
+ ## Enterprise Features
113
+
114
+ ### Automatic Retry Mechanisms
115
+ ```typescript
116
+ import { api } from '@fecommunity/reactpress-toolkit';
117
+
118
+ // Configure retry settings
119
+ const customApi = api.createApiInstance({
120
+ baseURL: 'https://api.yourdomain.com',
121
+ retry: {
122
+ retries: 3,
123
+ retryDelay: 1000,
124
+ retryCondition: (error) => {
125
+ return error.response?.status === 503 || error.code === 'ECONNABORTED';
126
+ }
127
+ }
128
+ });
129
+ ```
130
+
131
+ ### Request/Response Interceptors
132
+ ```typescript
133
+ import { api } from '@fecommunity/reactpress-toolkit';
134
+
135
+ const monitoredApi = api.createApiInstance({
136
+ baseURL: 'https://api.yourdomain.com',
137
+ interceptors: {
138
+ request: (config) => {
139
+ // Add logging, metrics, etc.
140
+ console.log(`Request: ${config.method?.toUpperCase()} ${config.url}`);
141
+ return config;
142
+ },
143
+ response: (response) => {
144
+ // Add logging, metrics, etc.
145
+ console.log(`Response: ${response.status} ${response.config.url}`);
146
+ return response;
147
+ }
148
+ }
149
+ });
150
+ ```
151
+
152
+ ### Authentication Handling
153
+ ```typescript
154
+ import { api, utils } from '@fecommunity/reactpress-toolkit';
155
+
156
+ // Automatic token refresh
157
+ const secureApi = api.createApiInstance({
158
+ baseURL: 'https://api.yourdomain.com',
159
+ auth: {
160
+ tokenRefresh: async (refreshToken) => {
161
+ const response = await api.auth.refresh({ refreshToken });
162
+ return response.data.accessToken;
163
+ }
164
+ }
165
+ });
166
+ ```
167
+
104
168
  ## Type Definitions
105
169
 
106
170
  All data models are strongly typed and available through the `types` export:
@@ -145,6 +209,12 @@ const clonedObject = utils.deepClone(originalObject);
145
209
  if (utils.ApiError.isInstance(error)) {
146
210
  console.log(`API Error: ${error.code} - ${error.message}`);
147
211
  }
212
+
213
+ // Data validation
214
+ const isValidEmail = utils.validateEmail('user@example.com');
215
+
216
+ // String manipulation
217
+ const slug = utils.createSlug('My Article Title');
148
218
  ```
149
219
 
150
220
  ## Development
@@ -171,6 +241,151 @@ npm run build
171
241
 
172
242
  This will compile the TypeScript code to JavaScript in the `dist` directory.
173
243
 
244
+ ## Testing
245
+
246
+ ```bash
247
+ # Run unit tests
248
+ npm run test
249
+
250
+ # Run tests with coverage
251
+ npm run test:cov
252
+
253
+ # Run linting
254
+ npm run lint
255
+
256
+ # Run formatting
257
+ npm run format
258
+ ```
259
+
260
+ ## Integration Examples
261
+
262
+ ### React Integration
263
+ ```typescript
264
+ import { useState, useEffect } from 'react';
265
+ import { api, types } from '@fecommunity/reactpress-toolkit';
266
+
267
+ const ArticleList = () => {
268
+ const [articles, setArticles] = useState<types.IArticle[]>([]);
269
+ const [loading, setLoading] = useState(true);
270
+
271
+ useEffect(() => {
272
+ const fetchArticles = async () => {
273
+ try {
274
+ const response = await api.article.findAll();
275
+ setArticles(response.data);
276
+ } catch (error) {
277
+ console.error('Failed to fetch articles:', error);
278
+ } finally {
279
+ setLoading(false);
280
+ }
281
+ };
282
+
283
+ fetchArticles();
284
+ }, []);
285
+
286
+ if (loading) return <div>Loading...</div>;
287
+
288
+ return (
289
+ <div>
290
+ {articles.map(article => (
291
+ <div key={article.id}>
292
+ <h2>{article.title}</h2>
293
+ <p>{article.content}</p>
294
+ </div>
295
+ ))}
296
+ </div>
297
+ );
298
+ };
299
+ ```
300
+
301
+ ### Node.js Integration
302
+ ```typescript
303
+ import { api, types } from '@fecommunity/reactpress-toolkit';
304
+
305
+ async function syncArticles() {
306
+ try {
307
+ // Fetch articles from ReactPress
308
+ const response = await api.article.findAll({
309
+ limit: 100,
310
+ offset: 0
311
+ });
312
+
313
+ // Process articles
314
+ const articles: types.IArticle[] = response.data;
315
+
316
+ // Sync with another system
317
+ for (const article of articles) {
318
+ // Your sync logic here
319
+ console.log(`Synced article: ${article.title}`);
320
+ }
321
+ } catch (error) {
322
+ console.error('Sync failed:', error);
323
+ }
324
+ }
325
+
326
+ syncArticles();
327
+ ```
328
+
329
+ ## Best Practices
330
+
331
+ ### Error Handling
332
+ ```typescript
333
+ import { api, utils } from '@fecommunity/reactpress-toolkit';
334
+
335
+ try {
336
+ const articles = await api.article.findAll();
337
+ // Process articles
338
+ } catch (error) {
339
+ if (utils.ApiError.isInstance(error)) {
340
+ switch (error.code) {
341
+ case 401:
342
+ // Handle unauthorized access
343
+ redirectToLogin();
344
+ break;
345
+ case 403:
346
+ // Handle forbidden access
347
+ showPermissionError();
348
+ break;
349
+ case 500:
350
+ // Handle server errors
351
+ showServerError();
352
+ break;
353
+ default:
354
+ // Handle other API errors
355
+ showGenericError(error.message);
356
+ }
357
+ } else {
358
+ // Handle network errors
359
+ showNetworkError();
360
+ }
361
+ }
362
+ ```
363
+
364
+ ### Pagination
365
+ ```typescript
366
+ import { api, types } from '@fecommunity/reactpress-toolkit';
367
+
368
+ async function fetchAllArticles(): Promise<types.IArticle[]> {
369
+ const allArticles: types.IArticle[] = [];
370
+ let offset = 0;
371
+ const limit = 50;
372
+
373
+ while (true) {
374
+ const response = await api.article.findAll({ limit, offset });
375
+ allArticles.push(...response.data);
376
+
377
+ if (response.data.length < limit) {
378
+ // No more articles to fetch
379
+ break;
380
+ }
381
+
382
+ offset += limit;
383
+ }
384
+
385
+ return allArticles;
386
+ }
387
+ ```
388
+
174
389
  ## Contributing
175
390
 
176
391
  1. Fork the repository
@@ -187,4 +402,4 @@ ISC
187
402
 
188
403
  - [ReactPress](https://github.com/fecommunity/reactpress) - The main ReactPress platform
189
404
  - [ReactPress Server](https://github.com/fecommunity/reactpress/server) - Backend server
190
- - [ReactPress Client](https://github.com/fecommunity/reactpress/client) - Frontend client
405
+ - [ReactPress Client](https://github.com/fecommunity/reactpress/client) - Frontend client
@@ -1,108 +1,123 @@
1
- import { IArticle } from '../types/data-contracts';
1
+ import { IArticleControllerCreateData } from '../types';
2
2
  import { HttpClient, RequestParams } from './HttpClient';
3
- export declare class Article<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
3
+ export declare class Article<SecurityDataType = unknown> {
4
+ http: HttpClient<SecurityDataType>;
5
+ constructor(http: HttpClient<SecurityDataType>);
4
6
  /**
5
7
  * No description
6
8
  *
7
9
  * @tags Article
8
- * @name create
10
+ * @name ArticleControllerCreate
9
11
  * @request POST:/article
12
+ * @response `200` `IArticleControllerCreateData` 创建文章
10
13
  */
11
- create: (params?: RequestParams) => Promise<import("axios").AxiosResponse<IArticle[], any, {}>>;
14
+ create: (params?: RequestParams) => Promise<IArticleControllerCreateData>;
12
15
  /**
13
16
  * No description
14
17
  *
15
18
  * @tags Article
16
- * @name findAll
19
+ * @name ArticleControllerFindAll
17
20
  * @request GET:/article
21
+ * @response `200` `IArticleControllerFindAllData`
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 Article
24
- * @name findArticlesByCategory
28
+ * @name ArticleControllerFindArticlesByCategory
25
29
  * @request GET:/article/category/{id}
30
+ * @response `200` `IArticleControllerFindArticlesByCategoryData`
26
31
  */
27
- findArticlesByCategory: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
32
+ findArticlesByCategory: (id: string, params?: RequestParams) => Promise<any>;
28
33
  /**
29
34
  * No description
30
35
  *
31
36
  * @tags Article
32
- * @name findArticlesByTag
37
+ * @name ArticleControllerFindArticlesByTag
33
38
  * @request GET:/article/tag/{id}
39
+ * @response `200` `IArticleControllerFindArticlesByTagData`
34
40
  */
35
- findArticlesByTag: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
41
+ findArticlesByTag: (id: string, params?: RequestParams) => Promise<any>;
36
42
  /**
37
43
  * No description
38
44
  *
39
45
  * @tags Article
40
- * @name getRecommendArticles
46
+ * @name ArticleControllerGetRecommendArticles
41
47
  * @request GET:/article/all/recommend
48
+ * @response `200` `IArticleControllerGetRecommendArticlesData`
42
49
  */
43
- getRecommendArticles: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
50
+ getRecommendArticles: (params?: RequestParams) => Promise<any>;
44
51
  /**
45
52
  * No description
46
53
  *
47
54
  * @tags Article
48
- * @name getArchives
55
+ * @name ArticleControllerGetArchives
49
56
  * @request GET:/article/archives
57
+ * @response `200` `IArticleControllerGetArchivesData`
50
58
  */
51
- getArchives: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
59
+ getArchives: (params?: RequestParams) => Promise<any>;
52
60
  /**
53
61
  * No description
54
62
  *
55
63
  * @tags Article
56
- * @name recommend
64
+ * @name ArticleControllerRecommend
57
65
  * @request GET:/article/recommend
66
+ * @response `200` `IArticleControllerRecommendData`
58
67
  */
59
- recommend: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
68
+ recommend: (params?: RequestParams) => Promise<any>;
60
69
  /**
61
70
  * No description
62
71
  *
63
72
  * @tags Article
64
- * @name findById
73
+ * @name ArticleControllerFindById
65
74
  * @request GET:/article/{id}
75
+ * @response `200` `IArticleControllerFindByIdData`
66
76
  */
67
- findById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
77
+ findById: (id: string, params?: RequestParams) => Promise<any>;
68
78
  /**
69
79
  * No description
70
80
  *
71
81
  * @tags Article
72
- * @name updateById
82
+ * @name ArticleControllerUpdateById
73
83
  * @request PATCH:/article/{id}
84
+ * @response `200` `IArticleControllerUpdateByIdData`
74
85
  */
75
- updateById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
86
+ updateById: (id: string, params?: RequestParams) => Promise<any>;
76
87
  /**
77
88
  * No description
78
89
  *
79
90
  * @tags Article
80
- * @name deleteById
91
+ * @name ArticleControllerDeleteById
81
92
  * @request DELETE:/article/{id}
93
+ * @response `200` `IArticleControllerDeleteByIdData`
82
94
  */
83
- deleteById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
95
+ deleteById: (id: string, params?: RequestParams) => Promise<any>;
84
96
  /**
85
97
  * No description
86
98
  *
87
99
  * @tags Article
88
- * @name checkPassword
100
+ * @name ArticleControllerCheckPassword
89
101
  * @request POST:/article/{id}/checkPassword
102
+ * @response `200` `IArticleControllerCheckPasswordData`
90
103
  */
91
- checkPassword: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
104
+ checkPassword: (id: string, params?: RequestParams) => Promise<any>;
92
105
  /**
93
106
  * No description
94
107
  *
95
108
  * @tags Article
96
- * @name updateViewsById
109
+ * @name ArticleControllerUpdateViewsById
97
110
  * @request POST:/article/{id}/views
111
+ * @response `200` `IArticleControllerUpdateViewsByIdData`
98
112
  */
99
- updateViewsById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
113
+ updateViewsById: (id: string, params?: RequestParams) => Promise<any>;
100
114
  /**
101
115
  * No description
102
116
  *
103
117
  * @tags Article
104
- * @name updateLikesById
118
+ * @name ArticleControllerUpdateLikesById
105
119
  * @request POST:/article/{id}/likes
120
+ * @response `200` `IArticleControllerUpdateLikesByIdData`
106
121
  */
107
- updateLikesById: (id: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
122
+ updateLikesById: (id: string, params?: RequestParams) => Promise<any>;
108
123
  }
@@ -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 findArticlesByCategory
46
+ * @name ArticleControllerFindArticlesByCategory
48
47
  * @request GET:/article/category/{id}
48
+ * @response `200` `IArticleControllerFindArticlesByCategoryData`
49
49
  */
50
- this.findArticlesByCategory = (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 findArticlesByTag
59
+ * @name ArticleControllerFindArticlesByTag
60
60
  * @request GET:/article/tag/{id}
61
+ * @response `200` `IArticleControllerFindArticlesByTagData`
61
62
  */
62
- this.findArticlesByTag = (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 getRecommendArticles
72
+ * @name ArticleControllerGetRecommendArticles
72
73
  * @request GET:/article/all/recommend
74
+ * @response `200` `IArticleControllerGetRecommendArticlesData`
73
75
  */
74
- this.getRecommendArticles = (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 updateViewsById
163
+ * @name ArticleControllerUpdateViewsById
156
164
  * @request POST:/article/{id}/views
165
+ * @response `200` `IArticleControllerUpdateViewsByIdData`
157
166
  */
158
- this.updateViewsById = (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 updateLikesById
176
+ * @name ArticleControllerUpdateLikesById
168
177
  * @request POST:/article/{id}/likes
178
+ * @response `200` `IArticleControllerUpdateLikesByIdData`
169
179
  */
170
- this.updateLikesById = (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;
@@ -1,27 +1,32 @@
1
1
  import { HttpClient, RequestParams } from './HttpClient';
2
- export declare class Auth<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
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
- * @name login
9
+ * @name AuthControllerLogin
8
10
  * @request POST:/auth/login
11
+ * @response `200` `IAuthControllerLoginData`
9
12
  */
10
- login: (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
- * @name loginWithGithub
27
+ * @name AuthControllerLoginWithGithub
24
28
  * @request POST:/auth/github
29
+ * @response `201` `IAuthControllerLoginWithGithubData`
25
30
  */
26
- loginWithGithub: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
31
+ loginWithGithub: (params?: RequestParams) => Promise<any>;
27
32
  }