@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
@@ -1,136 +0,0 @@
1
- const path = require('path');
2
- const fs = require('fs-extra');
3
-
4
- // 配置常量
5
- const SRC_DIR = path.resolve(__dirname, '../src');
6
- const API_DIR = path.join(SRC_DIR, 'api');
7
- const TYPES_DIR = path.join(SRC_DIR, 'types');
8
- const UTILS_DIR = path.join(SRC_DIR, 'utils');
9
-
10
- // 修复 API 文件中的导入路径
11
- async function fixApiImports() {
12
- console.log('🔧 修复 API 文件中的导入路径...');
13
-
14
- // 获取所有 API 文件
15
- const apiFiles = fs.readdirSync(API_DIR).filter(file => file.endsWith('.ts') && file !== 'index.ts');
16
-
17
- for (const file of apiFiles) {
18
- const filePath = path.join(API_DIR, file);
19
- let content = fs.readFileSync(filePath, 'utf8');
20
-
21
- // 修复导入路径
22
- content = content.replace(
23
- /from '\.\/data-contracts'/g,
24
- "from '../types/data-contracts'"
25
- );
26
-
27
- // 修复其他可能的类型导入
28
- content = content.replace(
29
- /from '\.\/([^']+)'/g,
30
- (match, importPath) => {
31
- // 如果导入路径是类型文件,则重定向到 types 目录
32
- if (importPath.includes('contract') || importPath === 'types') {
33
- return `from '../types/${importPath}'`;
34
- }
35
- return match;
36
- }
37
- );
38
-
39
- // 写入修复后的内容
40
- fs.writeFileSync(filePath, content);
41
- console.log(`✅ 修复 ${file} 的导入路径`);
42
- }
43
-
44
- console.log('✅ 所有 API 文件的导入路径已修复');
45
- }
46
-
47
- // 创建统一的类型索引
48
- async function createTypeIndex() {
49
- console.log('📝 创建统一的类型索引...');
50
-
51
- // 获取所有类型文件
52
- const typeFiles = fs.readdirSync(TYPES_DIR).filter(file => file.endsWith('.ts') && file !== 'index.ts');
53
-
54
- let indexContent = '// 类型定义索引\n// 自动生成,请勿手动修改\n\n';
55
-
56
- // 添加所有类型文件的导出
57
- typeFiles.forEach(file => {
58
- const moduleName = file.replace('.ts', '');
59
- indexContent += `export * from './${moduleName}';\n`;
60
- });
61
-
62
- // 写入索引文件
63
- fs.writeFileSync(path.join(TYPES_DIR, 'index.ts'), indexContent);
64
- console.log('✅ 类型索引文件已创建');
65
- }
66
-
67
- // 创建统一的 API 索引
68
- async function createApiIndex() {
69
- console.log('📝 创建统一的 API 索引...');
70
-
71
- // 获取所有 API 文件
72
- const apiFiles = fs.readdirSync(API_DIR).filter(file => file.endsWith('.ts') && file !== 'index.ts');
73
-
74
- let indexContent = '// API 客户端索引\n// 自动生成,请勿手动修改\n\n';
75
-
76
- // 添加所有 API 文件的导出
77
- apiFiles.forEach(file => {
78
- const moduleName = file.replace('.ts', '');
79
- indexContent += `export * from './${moduleName}';\n`;
80
- });
81
-
82
- // 添加默认导出(如果有 API 客户端)
83
- const clientFiles = apiFiles.filter(file => file.includes('client'));
84
- if (clientFiles.length > 0) {
85
- const clientFile = clientFiles[0];
86
- const clientName = clientFile.replace('.ts', '');
87
- indexContent += `\nexport { default as ${clientName} } from './${clientName}';\n`;
88
- }
89
-
90
- // 写入索引文件
91
- fs.writeFileSync(path.join(API_DIR, 'index.ts'), indexContent);
92
- console.log('✅ API 索引文件已创建');
93
- }
94
-
95
- // 创建主入口文件
96
- async function createMainIndex() {
97
- console.log('📝 创建主入口文件...');
98
-
99
- const mainIndexContent = `// Auto-generated API client
100
- // Generated from Swagger/OpenAPI specification
101
-
102
- import * as api from './api';
103
- import * as types from './types';
104
- import * as utils from './utils';
105
-
106
-
107
- export { api, types, utils }
108
-
109
- `;
110
-
111
- fs.writeFileSync(path.join(SRC_DIR, 'index.ts'), mainIndexContent);
112
- console.log('✅ 主入口文件已创建');
113
- }
114
-
115
- // 修复所有文件
116
- async function fixAllFiles() {
117
- try {
118
- await fixApiImports();
119
- await createTypeIndex();
120
- await createApiIndex();
121
- await createMainIndex();
122
-
123
- console.log('🎉 所有文件修复完成!');
124
- console.log('📁 修复后的文件结构:');
125
- console.log(' - src/api/ # API 客户端 (导入路径已修复)');
126
- console.log(' - src/types/ # 类型定义');
127
- console.log(' - src/utils/ # 工具函数');
128
- console.log(' - src/index.ts # 主入口文件');
129
- } catch (error) {
130
- console.error('❌ 文件修复失败:', error.message);
131
- process.exit(1);
132
- }
133
- }
134
-
135
- // 执行修复
136
- fixAllFiles();
@@ -1,186 +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 { IArticle } from '../types/data-contracts';
13
- import { HttpClient, RequestParams } from './httpClient';
14
-
15
- export class Article<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
16
- /**
17
- * No description
18
- *
19
- * @tags Article
20
- * @name create
21
- * @request POST:/article
22
- */
23
- create = (params: RequestParams = {}) =>
24
- this.request<IArticle[], any>({
25
- path: `/article`,
26
- method: 'POST',
27
- format: 'json',
28
- ...params,
29
- });
30
- /**
31
- * No description
32
- *
33
- * @tags Article
34
- * @name findAll
35
- * @request GET:/article
36
- */
37
- findAll = (params: RequestParams = {}) =>
38
- this.request<void, any>({
39
- path: `/article`,
40
- method: 'GET',
41
- ...params,
42
- });
43
- /**
44
- * No description
45
- *
46
- * @tags Article
47
- * @name findByCategory
48
- * @request GET:/article/category/{id}
49
- */
50
- findByCategory = (id: string, params: RequestParams = {}) =>
51
- this.request<void, any>({
52
- path: `/article/category/${id}`,
53
- method: 'GET',
54
- ...params,
55
- });
56
- /**
57
- * No description
58
- *
59
- * @tags Article
60
- * @name findByTag
61
- * @request GET:/article/tag/{id}
62
- */
63
- findByTag = (id: string, params: RequestParams = {}) =>
64
- this.request<void, any>({
65
- path: `/article/tag/${id}`,
66
- method: 'GET',
67
- ...params,
68
- });
69
- /**
70
- * No description
71
- *
72
- * @tags Article
73
- * @name getRecommendations
74
- * @request GET:/article/all/recommend
75
- */
76
- getRecommendations = (params: RequestParams = {}) =>
77
- this.request<void, any>({
78
- path: `/article/all/recommend`,
79
- method: 'GET',
80
- ...params,
81
- });
82
- /**
83
- * No description
84
- *
85
- * @tags Article
86
- * @name getArchives
87
- * @request GET:/article/archives
88
- */
89
- getArchives = (params: RequestParams = {}) =>
90
- this.request<void, any>({
91
- path: `/article/archives`,
92
- method: 'GET',
93
- ...params,
94
- });
95
- /**
96
- * No description
97
- *
98
- * @tags Article
99
- * @name recommend
100
- * @request GET:/article/recommend
101
- */
102
- recommend = (params: RequestParams = {}) =>
103
- this.request<void, any>({
104
- path: `/article/recommend`,
105
- method: 'GET',
106
- ...params,
107
- });
108
- /**
109
- * No description
110
- *
111
- * @tags Article
112
- * @name findById
113
- * @request GET:/article/{id}
114
- */
115
- findById = (id: string, params: RequestParams = {}) =>
116
- this.request<void, any>({
117
- path: `/article/${id}`,
118
- method: 'GET',
119
- ...params,
120
- });
121
- /**
122
- * No description
123
- *
124
- * @tags Article
125
- * @name updateById
126
- * @request PATCH:/article/{id}
127
- */
128
- updateById = (id: string, params: RequestParams = {}) =>
129
- this.request<void, any>({
130
- path: `/article/${id}`,
131
- method: 'PATCH',
132
- ...params,
133
- });
134
- /**
135
- * No description
136
- *
137
- * @tags Article
138
- * @name deleteById
139
- * @request DELETE:/article/{id}
140
- */
141
- deleteById = (id: string, params: RequestParams = {}) =>
142
- this.request<void, any>({
143
- path: `/article/${id}`,
144
- method: 'DELETE',
145
- ...params,
146
- });
147
- /**
148
- * No description
149
- *
150
- * @tags Article
151
- * @name checkPassword
152
- * @request POST:/article/{id}/checkPassword
153
- */
154
- checkPassword = (id: string, params: RequestParams = {}) =>
155
- this.request<void, any>({
156
- path: `/article/${id}/checkPassword`,
157
- method: 'POST',
158
- ...params,
159
- });
160
- /**
161
- * No description
162
- *
163
- * @tags Article
164
- * @name updateViews
165
- * @request POST:/article/{id}/views
166
- */
167
- updateViews = (id: string, params: RequestParams = {}) =>
168
- this.request<void, any>({
169
- path: `/article/${id}/views`,
170
- method: 'POST',
171
- ...params,
172
- });
173
- /**
174
- * No description
175
- *
176
- * @tags Article
177
- * @name updateLikes
178
- * @request POST:/article/{id}/likes
179
- */
180
- updateLikes = (id: string, params: RequestParams = {}) =>
181
- this.request<void, any>({
182
- path: `/article/${id}/likes`,
183
- method: 'POST',
184
- ...params,
185
- });
186
- }
package/src/api/Auth.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 Auth<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
15
- /**
16
- * No description
17
- *
18
- * @tags Auth
19
- * @name AuthControllerLogin
20
- * @request POST:/auth/login
21
- */
22
- authControllerLogin = (params: RequestParams = {}) =>
23
- this.request<void, any>({
24
- path: `/auth/login`,
25
- method: 'POST',
26
- ...params,
27
- });
28
- /**
29
- * No description
30
- *
31
- * @tags Auth
32
- * @name createBook
33
- * @request POST:/auth/admin
34
- */
35
- createBook = (params: RequestParams = {}) =>
36
- this.request<void, any>({
37
- path: `/auth/admin`,
38
- method: 'POST',
39
- ...params,
40
- });
41
- /**
42
- * No description
43
- *
44
- * @tags Auth
45
- * @name AuthControllerLoginWithGithub
46
- * @request POST:/auth/github
47
- */
48
- authControllerLoginWithGithub = (params: RequestParams = {}) =>
49
- this.request<void, any>({
50
- path: `/auth/github`,
51
- method: 'POST',
52
- ...params,
53
- });
54
- }
@@ -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 { ICategory } from '../types/data-contracts';
13
- import { HttpClient, RequestParams } from './httpClient';
14
-
15
- export class Category<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
16
- /**
17
- * No description
18
- *
19
- * @tags Category
20
- * @name create
21
- * @request POST:/category
22
- */
23
- create = (params: RequestParams = {}) =>
24
- this.request<ICategory[], any>({
25
- path: `/category`,
26
- method: 'POST',
27
- format: 'json',
28
- ...params,
29
- });
30
- /**
31
- * No description
32
- *
33
- * @tags Category
34
- * @name findAll
35
- * @request GET:/category
36
- */
37
- findAll = (params: RequestParams = {}) =>
38
- this.request<void, any>({
39
- path: `/category`,
40
- method: 'GET',
41
- ...params,
42
- });
43
- /**
44
- * No description
45
- *
46
- * @tags Category
47
- * @name findById
48
- * @request GET:/category/{id}
49
- */
50
- findById = (id: string, params: RequestParams = {}) =>
51
- this.request<void, any>({
52
- path: `/category/${id}`,
53
- method: 'GET',
54
- ...params,
55
- });
56
- /**
57
- * No description
58
- *
59
- * @tags Category
60
- * @name updateById
61
- * @request PATCH:/category/{id}
62
- */
63
- updateById = (id: string, params: RequestParams = {}) =>
64
- this.request<void, any>({
65
- path: `/category/${id}`,
66
- method: 'PATCH',
67
- ...params,
68
- });
69
- /**
70
- * No description
71
- *
72
- * @tags Category
73
- * @name deleteById
74
- * @request DELETE:/category/{id}
75
- */
76
- deleteById = (id: string, params: RequestParams = {}) =>
77
- this.request<void, any>({
78
- path: `/category/${id}`,
79
- method: 'DELETE',
80
- ...params,
81
- });
82
- }
@@ -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 { IComment } from '../types/data-contracts';
13
- import { HttpClient, RequestParams } from './httpClient';
14
-
15
- export class Comment<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
16
- /**
17
- * No description
18
- *
19
- * @tags Comment
20
- * @name create
21
- * @request POST:/comment
22
- */
23
- create = (params: RequestParams = {}) =>
24
- this.request<IComment[], any>({
25
- path: `/comment`,
26
- method: 'POST',
27
- format: 'json',
28
- ...params,
29
- });
30
- /**
31
- * No description
32
- *
33
- * @tags Comment
34
- * @name findAll
35
- * @request GET:/comment
36
- */
37
- findAll = (params: RequestParams = {}) =>
38
- this.request<void, any>({
39
- path: `/comment`,
40
- method: 'GET',
41
- ...params,
42
- });
43
- /**
44
- * No description
45
- *
46
- * @tags Comment
47
- * @name findById
48
- * @request GET:/comment/{id}
49
- */
50
- findById = (id: string, params: RequestParams = {}) =>
51
- this.request<void, any>({
52
- path: `/comment/${id}`,
53
- method: 'GET',
54
- ...params,
55
- });
56
- /**
57
- * No description
58
- *
59
- * @tags Comment
60
- * @name updateById
61
- * @request PATCH:/comment/{id}
62
- */
63
- updateById = (id: string, params: RequestParams = {}) =>
64
- this.request<void, any>({
65
- path: `/comment/${id}`,
66
- method: 'PATCH',
67
- ...params,
68
- });
69
- /**
70
- * No description
71
- *
72
- * @tags Comment
73
- * @name deleteById
74
- * @request DELETE:/comment/{id}
75
- */
76
- deleteById = (id: string, params: RequestParams = {}) =>
77
- this.request<void, any>({
78
- path: `/comment/${id}`,
79
- method: 'DELETE',
80
- ...params,
81
- });
82
- /**
83
- * No description
84
- *
85
- * @tags Comment
86
- * @name CommentControllerGetArticleComments
87
- * @request GET:/comment/host/{hostId}
88
- */
89
- commentControllerGetArticleComments = (hostId: string, params: RequestParams = {}) =>
90
- this.request<void, any>({
91
- path: `/comment/host/${hostId}`,
92
- method: 'GET',
93
- ...params,
94
- });
95
- }
package/src/api/File.ts DELETED
@@ -1,69 +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 { IFile } from '../types/data-contracts';
13
- import { HttpClient, RequestParams } from './httpClient';
14
-
15
- export class File<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
16
- /**
17
- * No description
18
- *
19
- * @tags File
20
- * @name FileControllerUploadFile
21
- * @request POST:/file/upload
22
- */
23
- fileControllerUploadFile = (params: RequestParams = {}) =>
24
- this.request<IFile[], any>({
25
- path: `/file/upload`,
26
- method: 'POST',
27
- format: 'json',
28
- ...params,
29
- });
30
- /**
31
- * No description
32
- *
33
- * @tags File
34
- * @name findAll
35
- * @request GET:/file
36
- */
37
- findAll = (params: RequestParams = {}) =>
38
- this.request<void, any>({
39
- path: `/file`,
40
- method: 'GET',
41
- ...params,
42
- });
43
- /**
44
- * No description
45
- *
46
- * @tags File
47
- * @name findById
48
- * @request GET:/file/{id}
49
- */
50
- findById = (id: string, params: RequestParams = {}) =>
51
- this.request<void, any>({
52
- path: `/file/${id}`,
53
- method: 'GET',
54
- ...params,
55
- });
56
- /**
57
- * No description
58
- *
59
- * @tags File
60
- * @name deleteById
61
- * @request DELETE:/file/{id}
62
- */
63
- deleteById = (id: string, params: RequestParams = {}) =>
64
- this.request<void, any>({
65
- path: `/file/${id}`,
66
- method: 'DELETE',
67
- ...params,
68
- });
69
- }