@povio/openapi-codegen-cli 2.0.2-rc.3 → 2.0.2-rc.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": "@povio/openapi-codegen-cli",
|
|
3
|
-
"version": "2.0.2-rc.
|
|
3
|
+
"version": "2.0.2-rc.5",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@casl/ability": "^6.7.3",
|
|
67
67
|
"@casl/react": "^5.0.0",
|
|
68
|
-
"@tanstack/react-query": "^5.
|
|
68
|
+
"@tanstack/react-query": "^5.89.0",
|
|
69
69
|
"axios": "^1.13.1",
|
|
70
70
|
"react": "^19.1.0",
|
|
71
71
|
"zod": "^4.1.12"
|
|
@@ -10,8 +10,8 @@ export const {{queryName endpoint mutation=true}} = (options?: AppMutationOption
|
|
|
10
10
|
return {{queryHook}}({
|
|
11
11
|
mutationFn: {{#if endpoint.mediaUpload}}async {{/if}}({{#if (endpointParams endpoint includeFileParam=true)}} { {{{endpointArgs endpoint includeFileParam=true}}}{{#if endpoint.mediaUpload}}, abortController, onUploadProgress{{/if}} } {{/if}}) => {{#if hasMutationFnBody}} { {{/if}}
|
|
12
12
|
{{#if hasAclCheck}}{{{genAclCheckCall endpoint}}}{{/if}}
|
|
13
|
-
{{#if endpoint.mediaUpload}}const uploadInstructions = await {{importedEndpointName endpoint}}({{{endpointArgs endpoint}}}{{#if hasAxiosRequestConfig}}{{#if (endpointArgs endpoint)}}, {{/if}}{{axiosRequestConfigName}}{{/if}});
|
|
14
|
-
|
|
13
|
+
{{#if endpoint.mediaUpload}}const uploadInstructions = await {{importedEndpointName endpoint}}({{{endpointArgs endpoint}}}{{#if hasAxiosRequestConfig}}{{#if (endpointArgs endpoint)}}, {{/if}}{{axiosRequestConfigName}}{{/if}});
|
|
14
|
+
|
|
15
15
|
if (file && uploadInstructions.url) {
|
|
16
16
|
const method = (data?.method?.toLowerCase() ?? "put") as 'put' | 'post';
|
|
17
17
|
let dataToSend: File | FormData = file;
|
|
@@ -34,21 +34,21 @@ export const {{queryName endpoint mutation=true}} = (options?: AppMutationOption
|
|
|
34
34
|
: undefined,
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
|
|
38
38
|
return uploadInstructions;
|
|
39
39
|
{{else}}
|
|
40
40
|
{{#if hasMutationFnBody}}return {{/if}}{{importedEndpointName endpoint}}({{{endpointArgs endpoint}}}{{#if hasAxiosRequestConfig}}{{#if (endpointArgs endpoint)}}, {{/if}}{{axiosRequestConfigName}}{{/if}})
|
|
41
41
|
{{/if}}
|
|
42
42
|
{{#if hasMutationFnBody}} }{{/if}},
|
|
43
43
|
...options, {{#if hasMutationEffects}}
|
|
44
|
-
onSuccess: async (resData, variables, context) => {
|
|
44
|
+
onSuccess: async (resData, variables, onMutateResult, context) => {
|
|
45
45
|
{{! Mutation effects }}
|
|
46
46
|
{{#if updateQueryEndpoints}}
|
|
47
47
|
{{#if destructuredVariables}}const { {{commaSeparated destructuredVariables }} } = variables;{{/if}}
|
|
48
48
|
const updateKeys = [{{#each updateQueryEndpoints as | endpoint |}}keys.{{endpointName endpoint}}({{{endpointArgs endpoint includeOnlyRequiredParams=true}}}), {{/each}}];
|
|
49
49
|
{{/if}}
|
|
50
50
|
await runMutationEffects(resData, options{{#if updateQueryEndpoints}}, updateKeys{{/if}});
|
|
51
|
-
options?.onSuccess?.(resData, variables, context);
|
|
51
|
+
options?.onSuccess?.(resData, variables, onMutateResult, context);
|
|
52
52
|
},{{/if}}
|
|
53
53
|
});
|
|
54
|
-
};
|
|
54
|
+
};
|