@povio/openapi-codegen-cli 0.1.2 → 0.2.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.
- package/dist/generators/const/endpoints.const.d.ts +1 -3
- package/dist/generators/const/template.const.d.ts +10 -0
- package/dist/generators/types/generate.d.ts +5 -0
- package/dist/generators/types/metadata.d.ts +2 -0
- package/dist/generators/utils/generate/generate.endpoints.utils.d.ts +1 -0
- package/dist/generators/utils/generate/generate.imports.utils.d.ts +1 -0
- package/dist/index.js +35 -35
- package/dist/sh.js +57 -57
- package/package.json +2 -2
- package/src/generators/templates/partials/query-use-mutation.hbs +3 -2
- package/src/generators/templates/partials/query-use-query.hbs +3 -2
- package/src/generators/templates/queries.hbs +2 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@povio/openapi-codegen-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"bin": {
|
|
6
6
|
"openapi-codegen": "./dist/sh.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"start": "node --import tsx
|
|
9
|
+
"start": "node --import tsx ./src/sh.ts",
|
|
10
10
|
"test": "vitest run",
|
|
11
11
|
"test:watch": "vitest",
|
|
12
12
|
"build:clean": "rm -rf ./dist",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export const {{queryName endpoint}} = () => {
|
|
1
|
+
export const {{queryName endpoint}} = (options?: AppMutationOptions<typeof {{importedEndpointName endpoint}}, { {{{genEndpointParams endpoint}}} }>) => {
|
|
2
2
|
return {{queryHook}}({
|
|
3
|
-
mutationFn:
|
|
3
|
+
mutationFn: ({ {{{endpointArgs endpoint}}} }) => {{importedEndpointName endpoint}}({{{endpointArgs endpoint}}}),
|
|
4
|
+
...options,
|
|
4
5
|
});
|
|
5
6
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export const {{queryName endpoint}} = ({{{genEndpointParams endpoint}}}) => {
|
|
1
|
+
export const {{queryName endpoint}} = <TData>({{#if (endpointParams endpoint)}}{ {{{endpointArgs endpoint}}} }: { {{{genEndpointParams endpoint}}} }, {{/if}}options?: AppQueryOptions<typeof {{importedEndpointName endpoint}}, TData>) => {
|
|
2
2
|
return {{queryHook}}({
|
|
3
|
-
queryKey: keys.{{endpointName endpoint}}({{{endpointArgs endpoint}}}),
|
|
3
|
+
queryKey: keys.{{endpointName endpoint}}({{#if (endpointParams endpoint)}}{{{endpointArgs endpoint}}}{{/if}}),
|
|
4
4
|
queryFn: {{#if (endpointParams endpoint)}}() => {{importedEndpointName endpoint}}({{{endpointArgs endpoint}}}){{else}}{{importedEndpointName endpoint}}{{/if}},
|
|
5
|
+
...options,
|
|
5
6
|
});
|
|
6
7
|
};
|