@povio/openapi-codegen-cli 0.5.3 → 0.5.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": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"
@@ -9,9 +9,11 @@
9
9
  export namespace {{namespace}} {
10
10
  {{/if}}
11
11
  {{#each zodSchemasData as | zodSchema |}}
12
+ {{! Js docs }}
13
+ {{{genModelJsDocs @key zodSchema ../tag}}}
12
14
  {{! Zod schema export }}
13
- {{#if zodSchema.isCircular}}// TODO: Fix type inference {{/if}}
14
- export const {{@key}}{{#if zodSchema.isCircular}}: z.ZodType<unknown>{{/if}} = {{{zodSchema.code}}};
15
+ export const {{@key}}{{#if zodSchema.isCircular}}: z.ZodType<unknown> // TODO: Fix type inference {{/if}}
16
+ = {{{zodSchema.code}}};
15
17
  {{! Zod schema infered type export }}
16
18
  export type {{zodInferedType @key}} = z.infer<typeof {{@key}}>;
17
19
  {{#if zodSchema.isEnum}}export const {{zodInferedType @key}} = {{@key}}.enum;{{/if}}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * {{name}}
3
+ * @type { {{zodSchemaType zodSchema}} }{{#if (zodSchemaDescription zodSchema)}}
4
+ * @description {{{zodSchemaDescription zodSchema}}}{{/if}}
5
+ {{#if (zodSchemaPropertyDescriptions zodSchema tag)}}{{#each (zodSchemaPropertyDescriptions zodSchema tag) as | property |}} * @property { {{property.type}} } {{@key}} {{{addAsteriskAfterNewLine property.description}}}
6
+ {{/each}}{{/if}} */
@@ -1,4 +1,6 @@
1
+ {{! Js docs }}
1
2
  {{{genQueryJsDocs endpoint}}}
3
+ {{! Mutation definition}}
2
4
  export const {{queryName endpoint}} = (options?: AppMutationOptions<typeof {{importedEndpointName endpoint}}, { {{{genEndpointParams endpoint}}} }>) => {
3
5
  {{#if queryEndpoints}} const queryClient = useQueryClient();{{/if}}
4
6
 
@@ -6,6 +8,7 @@ export const {{queryName endpoint}} = (options?: AppMutationOptions<typeof {{imp
6
8
  mutationFn: ({{#if (endpointParams endpoint)}} { {{{endpointArgs endpoint}}} } {{/if}}) => {{importedEndpointName endpoint}}({{{endpointArgs endpoint}}}),
7
9
  ...options, {{#if queryEndpoints}}
8
10
  onSuccess: (...args) => {
11
+ {{! Invalidation }}
9
12
  if (options?.enableInvalidateAll) {
10
13
  queryClient.invalidateQueries({ queryKey: keys.all });
11
14
  }
@@ -1,4 +1,6 @@
1
+ {{! Js docs }}
1
2
  {{{genQueryJsDocs endpoint}}}
3
+ {{! Query definition}}
2
4
  export const {{queryName endpoint}} = <TData>({{#if (endpointParams endpoint)}}{ {{{endpointArgs endpoint}}} }: { {{{genEndpointParams endpoint}}} }, {{/if}}options?: AppQueryOptions<typeof {{importedEndpointName endpoint}}, TData>) => {
3
5
  return {{queryHook}}({
4
6
  queryKey: keys.{{endpointName endpoint}}({{#if (endpointParams endpoint)}}{{{endpointArgs endpoint}}}{{/if}}),