@acrool/rtk-query-codegen-openapi 1.4.0-alpha.3 → 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/lib/bin/cli.mjs +18 -25
- package/lib/bin/cli.mjs.map +1 -1
- package/lib/index.js +4 -18
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +4 -18
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/generators/common-types-generator.ts +1 -1
- package/src/generators/rtk-enhance-endpoints-generator.ts +2 -23
package/lib/index.mjs
CHANGED
|
@@ -516,7 +516,7 @@ export type SimpleLazyQueryHook<TData, TArg> = () => readonly [
|
|
|
516
516
|
];
|
|
517
517
|
|
|
518
518
|
export type UseSimpleMutation<TRes, TArg = void> = () => readonly [
|
|
519
|
-
(arg: TArg) => Promise<TRes
|
|
519
|
+
(arg: TArg) => Promise<TRes> & { unwrap: () => Promise<TRes> },
|
|
520
520
|
{
|
|
521
521
|
data: TRes | undefined;
|
|
522
522
|
isLoading: boolean;
|
|
@@ -1193,27 +1193,13 @@ export default injectedRtkApi;
|
|
|
1193
1193
|
// src/generators/rtk-enhance-endpoints-generator.ts
|
|
1194
1194
|
init_esm_shims();
|
|
1195
1195
|
function generateRtkEnhanceEndpointsFile(endpointInfos, options) {
|
|
1196
|
-
|
|
1197
|
-
if (info.isQuery) {
|
|
1198
|
-
return ` ${info.operationName}: {
|
|
1199
|
-
providesTags: (result, error, arg) => [],
|
|
1200
|
-
},`;
|
|
1201
|
-
} else {
|
|
1202
|
-
return ` ${info.operationName}: {
|
|
1203
|
-
invalidatesTags: (result, error, arg) => [],
|
|
1204
|
-
},`;
|
|
1205
|
-
}
|
|
1206
|
-
}).join("\n");
|
|
1207
|
-
const importStatements = `/* eslint-disable */
|
|
1196
|
+
return `/* eslint-disable */
|
|
1208
1197
|
// [Warning] Generated automatically - do not edit manually
|
|
1209
1198
|
|
|
1210
1199
|
import api from "./query.generated";
|
|
1211
|
-
|
|
1212
|
-
return `${importStatements}
|
|
1200
|
+
|
|
1213
1201
|
const enhancedApi = api.enhanceEndpoints({
|
|
1214
|
-
endpoints: {
|
|
1215
|
-
${endpointConfigs}
|
|
1216
|
-
},
|
|
1202
|
+
endpoints: {},
|
|
1217
1203
|
});
|
|
1218
1204
|
|
|
1219
1205
|
export default enhancedApi;
|