@acrool/rtk-query-codegen-openapi 1.4.0-alpha.4 → 1.4.0-alpha.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrool/rtk-query-codegen-openapi",
3
- "version": "1.4.0-alpha.4",
3
+ "version": "1.4.0-alpha.5",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "lib/index.mjs",
@@ -14,34 +14,13 @@ export function generateRtkEnhanceEndpointsFile(endpointInfos: Array<{
14
14
  summary: string;
15
15
  }>, options: GenerationOptions) {
16
16
 
17
- // 生成端點配置
18
- const endpointConfigs = endpointInfos.map(info => {
19
- // 為 query 類型的端點添加 providesTags,為 mutation 類型的添加 invalidatesTags
20
- if (info.isQuery) {
21
- // Query 端點提供 tags
22
- return ` ${info.operationName}: {
23
- providesTags: (result, error, arg) => [],
24
- },`;
25
- } else {
26
- // Mutation 端點使 tags 失效
27
- return ` ${info.operationName}: {
28
- invalidatesTags: (result, error, arg) => [],
29
- },`;
30
- }
31
- }).join('\n');
32
-
33
- // 生成 import 語句
34
- const importStatements = `/* eslint-disable */
17
+ return `/* eslint-disable */
35
18
  // [Warning] Generated automatically - do not edit manually
36
19
 
37
20
  import api from "./query.generated";
38
- `;
39
21
 
40
- return `${importStatements}
41
22
  const enhancedApi = api.enhanceEndpoints({
42
- endpoints: {
43
- ${endpointConfigs}
44
- },
23
+ endpoints: {},
45
24
  });
46
25
 
47
26
  export default enhancedApi;