@povio/openapi-codegen-cli 0.5.2 → 0.5.3
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/utils/generate/generate.utils.d.ts +2 -0
- package/dist/index.js +36 -36
- package/dist/sh.js +53 -53
- package/package.json +1 -1
- package/src/generators/templates/partials/query-js-docs.hbs +10 -0
- package/src/generators/templates/partials/query-use-mutation.hbs +1 -9
- package/src/generators/templates/partials/query-use-query.hbs +1 -9
- package/dist/generators/utils/deps.utils.d.ts +0 -3
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* {{#if (isQuery endpoint)}}Query{{else}}Mutation{{/if}} `{{queryName endpoint}}`{{#if endpoint.summary}}
|
|
3
|
+
* @summary {{addAsteriskAfterNewLine endpoint.summary}}{{/if}}{{#if endpoint.description}}
|
|
4
|
+
* @description {{addAsteriskAfterNewLine endpoint.description}}{{/if}}{{#if endpoint.acl}}
|
|
5
|
+
* @permission Requires `{{abilityFunctionName endpoint}}` ability {{/if}}
|
|
6
|
+
{{#if (endpointParams endpoint)}}{{#each (endpointParams endpoint) as | endpointParam |}} * @param { {{endpointParam.type}} } {{#if (isQuery ../endpoint)}}object{{else}}mutation{{/if}}.{{endpointParam.name}} {{{endpointParamDescription endpointParam}}}
|
|
7
|
+
{{/each}}{{/if}} * @param {{#if (isQuery endpoint)}}{ AppQueryOptions } options Query options{{else}}{ AppMutationOptions } options Mutation options{{/if}}
|
|
8
|
+
* @returns { {{#if (isQuery endpoint)}}UseQueryResult{{else}}UseMutationResult{{/if}}<{{{importedZodSchemaInferedType endpoint.response}}}> } {{endpoint.responseDescription}}
|
|
9
|
+
* @statusCodes [{{commaSeparated endpoint.responseStatusCodes}}]
|
|
10
|
+
*/
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Mutation `{{queryName endpoint}}`{{#if endpoint.summary}}
|
|
3
|
-
* @summary {{addAsteriskAfterNewLine endpoint.summary}}{{/if}}{{#if endpoint.description}}
|
|
4
|
-
* @description {{addAsteriskAfterNewLine endpoint.description}}{{/if}}{{#if endpoint.acl}}
|
|
5
|
-
* @permission Requires `{{abilityFunctionName endpoint}}` ability {{/if}}
|
|
6
|
-
{{#if (endpointParams endpoint)}}{{#each (endpointParams endpoint) as | endpointParam |}} * @param { {{endpointParam.type}} } mutation.{{endpointParam.name}} {{{endpointParamDescription endpointParam}}}
|
|
7
|
-
{{/each}}{{/if}} * @param { AppMutationOptions } options Mutation options
|
|
8
|
-
* @statusCodes [{{commaSeparated endpoint.responseStatusCodes}}]
|
|
9
|
-
*/
|
|
1
|
+
{{{genQueryJsDocs endpoint}}}
|
|
10
2
|
export const {{queryName endpoint}} = (options?: AppMutationOptions<typeof {{importedEndpointName endpoint}}, { {{{genEndpointParams endpoint}}} }>) => {
|
|
11
3
|
{{#if queryEndpoints}} const queryClient = useQueryClient();{{/if}}
|
|
12
4
|
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Query `{{queryName endpoint}}`{{#if endpoint.summary}}
|
|
3
|
-
* @summary {{addAsteriskAfterNewLine endpoint.summary}}{{/if}}{{#if endpoint.description}}
|
|
4
|
-
* @description {{addAsteriskAfterNewLine endpoint.description}}{{/if}}{{#if endpoint.acl}}
|
|
5
|
-
* @permission Requires `{{abilityFunctionName endpoint}}` ability {{/if}}
|
|
6
|
-
{{#if (endpointParams endpoint)}}{{#each (endpointParams endpoint) as | endpointParam |}} * @param { {{endpointParam.type}} } object.{{endpointParam.name}} {{{endpointParamDescription endpointParam}}}
|
|
7
|
-
{{/each}}{{/if}} * @param { AppQueryOptions } options Query options
|
|
8
|
-
* @statusCodes [{{commaSeparated endpoint.responseStatusCodes}}]
|
|
9
|
-
*/
|
|
1
|
+
{{{genQueryJsDocs endpoint}}}
|
|
10
2
|
export const {{queryName endpoint}} = <TData>({{#if (endpointParams endpoint)}}{ {{{endpointArgs endpoint}}} }: { {{{genEndpointParams endpoint}}} }, {{/if}}options?: AppQueryOptions<typeof {{importedEndpointName endpoint}}, TData>) => {
|
|
11
3
|
return {{queryHook}}({
|
|
12
4
|
queryKey: keys.{{endpointName endpoint}}({{#if (endpointParams endpoint)}}{{{endpointArgs endpoint}}}{{/if}}),
|