@fecommunity/reactpress-toolkit 1.0.0-beta.1

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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/demos/simple.ts +65 -0
  3. package/dist/api/Admin.d.ts +14 -0
  4. package/dist/api/Admin.js +32 -0
  5. package/dist/api/All.d.ts +14 -0
  6. package/dist/api/All.js +32 -0
  7. package/dist/api/Archives.d.ts +14 -0
  8. package/dist/api/Archives.js +32 -0
  9. package/dist/api/Article.d.ts +108 -0
  10. package/dist/api/Article.js +177 -0
  11. package/dist/api/Auth.d.ts +27 -0
  12. package/dist/api/Auth.js +56 -0
  13. package/dist/api/Book.d.ts +15 -0
  14. package/dist/api/Book.js +33 -0
  15. package/dist/api/Category.d.ts +44 -0
  16. package/dist/api/Category.js +81 -0
  17. package/dist/api/Chapter.d.ts +15 -0
  18. package/dist/api/Chapter.js +33 -0
  19. package/dist/api/Comment.d.ts +52 -0
  20. package/dist/api/Comment.js +93 -0
  21. package/dist/api/File.d.ts +36 -0
  22. package/dist/api/File.js +69 -0
  23. package/dist/api/Get.d.ts +14 -0
  24. package/dist/api/Get.js +32 -0
  25. package/dist/api/Github.d.ts +14 -0
  26. package/dist/api/Github.js +32 -0
  27. package/dist/api/Host.d.ts +14 -0
  28. package/dist/api/Host.js +32 -0
  29. package/dist/api/Id.d.ts +284 -0
  30. package/dist/api/Id.js +422 -0
  31. package/dist/api/Knowledge.d.ts +68 -0
  32. package/dist/api/Knowledge.js +118 -0
  33. package/dist/api/Login.d.ts +14 -0
  34. package/dist/api/Login.js +32 -0
  35. package/dist/api/Page.d.ts +52 -0
  36. package/dist/api/Page.js +93 -0
  37. package/dist/api/Password.d.ts +15 -0
  38. package/dist/api/Password.js +33 -0
  39. package/dist/api/Recommend.d.ts +14 -0
  40. package/dist/api/Recommend.js +32 -0
  41. package/dist/api/Register.d.ts +15 -0
  42. package/dist/api/Register.js +33 -0
  43. package/dist/api/Search.d.ts +27 -0
  44. package/dist/api/Search.js +56 -0
  45. package/dist/api/Setting.d.ts +20 -0
  46. package/dist/api/Setting.js +45 -0
  47. package/dist/api/Smtp.d.ts +28 -0
  48. package/dist/api/Smtp.js +57 -0
  49. package/dist/api/Tag.d.ts +52 -0
  50. package/dist/api/Tag.js +93 -0
  51. package/dist/api/Update.d.ts +15 -0
  52. package/dist/api/Update.js +33 -0
  53. package/dist/api/Upload.d.ts +15 -0
  54. package/dist/api/Upload.js +33 -0
  55. package/dist/api/Url.d.ts +14 -0
  56. package/dist/api/Url.js +32 -0
  57. package/dist/api/User.d.ts +36 -0
  58. package/dist/api/User.js +72 -0
  59. package/dist/api/View.d.ts +44 -0
  60. package/dist/api/View.js +81 -0
  61. package/dist/api/api-instance.d.ts +39 -0
  62. package/dist/api/api-instance.js +46 -0
  63. package/dist/api/http-client.d.ts +41 -0
  64. package/dist/api/http-client.js +94 -0
  65. package/dist/api/httpClient.d.ts +41 -0
  66. package/dist/api/httpClient.js +94 -0
  67. package/dist/api/index.d.ts +18 -0
  68. package/dist/api/index.js +43 -0
  69. package/dist/index.d.ts +9 -0
  70. package/dist/index.js +46 -0
  71. package/dist/types/data-contracts.d.ts +177 -0
  72. package/dist/types/data-contracts.js +12 -0
  73. package/dist/types/index.d.ts +1 -0
  74. package/dist/types/index.js +19 -0
  75. package/dist/utils/common.d.ts +23 -0
  76. package/dist/utils/common.js +78 -0
  77. package/dist/utils/http.d.ts +3 -0
  78. package/dist/utils/http.js +47 -0
  79. package/dist/utils/index.d.ts +2 -0
  80. package/dist/utils/index.js +20 -0
  81. package/package.json +19 -0
  82. package/scripts/generate-api-types.js +571 -0
  83. package/scripts/generate-swagger.js +47 -0
  84. package/scripts/organize-api.js +136 -0
  85. package/src/api/Article.ts +186 -0
  86. package/src/api/Auth.ts +54 -0
  87. package/src/api/Category.ts +82 -0
  88. package/src/api/Comment.ts +95 -0
  89. package/src/api/File.ts +69 -0
  90. package/src/api/Knowledge.ts +122 -0
  91. package/src/api/Page.ts +95 -0
  92. package/src/api/Search.ts +54 -0
  93. package/src/api/Setting.ts +43 -0
  94. package/src/api/Smtp.ts +56 -0
  95. package/src/api/Tag.ts +95 -0
  96. package/src/api/User.ts +72 -0
  97. package/src/api/View.ts +82 -0
  98. package/src/api/api-instance.ts +69 -0
  99. package/src/api/httpClient.ts +140 -0
  100. package/src/api/index.ts +25 -0
  101. package/src/index.ts +18 -0
  102. package/src/types/data-contracts.ts +198 -0
  103. package/src/types/index.ts +4 -0
  104. package/src/utils/common.ts +108 -0
  105. package/src/utils/http.ts +52 -0
  106. package/src/utils/index.ts +5 -0
  107. package/test-final.js +56 -0
  108. package/test-import.js +34 -0
  109. package/tsconfig.json +20 -0
@@ -0,0 +1,122 @@
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
+ }
@@ -0,0 +1,95 @@
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
+ }
@@ -0,0 +1,54 @@
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
+ }
@@ -0,0 +1,43 @@
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
+ }
@@ -0,0 +1,56 @@
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 ADDED
@@ -0,0 +1,95 @@
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
+ }
@@ -0,0 +1,72 @@
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
+ }
@@ -0,0 +1,82 @@
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
+ }
@@ -0,0 +1,69 @@
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;