@povio/openapi-codegen-cli 2.0.8-rc.19 → 2.0.8-rc.20

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.
@@ -1,4 +1,4 @@
1
- import { t as GenerateOptions } from "./options-DmUw8IYE.mjs";
1
+ import { t as GenerateOptions } from "./options-BNqkO_OS.mjs";
2
2
 
3
3
  //#region src/generators/types/config.d.ts
4
4
  type OpenAPICodegenConfig = Partial<GenerateOptions>;
@@ -1,4 +1,4 @@
1
- import { a as deepMerge, p as DEFAULT_GENERATE_OPTIONS, r as writeGenerateFileData, t as generateCodeFromOpenAPIDoc, x as Profiler } from "./generateCodeFromOpenAPIDoc-BP7F6YJP.mjs";
1
+ import { a as deepMerge, p as DEFAULT_GENERATE_OPTIONS, r as writeGenerateFileData, t as generateCodeFromOpenAPIDoc, x as Profiler } from "./generateCodeFromOpenAPIDoc-DZ5swy4U.mjs";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
4
  import SwaggerParser from "@apidevtools/swagger-parser";
@@ -640,6 +640,7 @@ const DEFAULT_GENERATE_OPTIONS = {
640
640
  axiosRequestConfig: false,
641
641
  mutationEffects: true,
642
642
  workspaceContext: false,
643
+ prefetchQueries: true,
643
644
  infiniteQueries: false,
644
645
  infiniteQueryParamNames: { page: "page" },
645
646
  infiniteQueryResponseParamNames: {
@@ -733,6 +734,10 @@ const getQueryName = (endpoint, mutation) => {
733
734
  return `use${capitalize(snakeToCamel(endpoint.operationName))}${addMutationSuffix ? "Mutation" : ""}`;
734
735
  };
735
736
  const getInfiniteQueryName = (endpoint) => `use${capitalize(snakeToCamel(endpoint.operationName))}Infinite`;
737
+ const getQueryOptionsName = (endpoint) => `${snakeToCamel(endpoint.operationName)}QueryOptions`;
738
+ const getInfiniteQueryOptionsName = (endpoint) => `${snakeToCamel(endpoint.operationName)}InfiniteQueryOptions`;
739
+ const getPrefetchQueryName = (endpoint) => `prefetch${capitalize(snakeToCamel(endpoint.operationName))}`;
740
+ const getPrefetchInfiniteQueryName = (endpoint) => `prefetch${capitalize(snakeToCamel(endpoint.operationName))}Infinite`;
736
741
  const getImportedQueryName = (endpoint, options) => {
737
742
  return `${options.tsNamespaces ? `${getNamespaceName({
738
743
  type: GenerateType.Queries,
@@ -3726,6 +3731,7 @@ function generateQueries(params) {
3726
3731
  const { queryEndpoints, infiniteQueryEndpoints, mutationEndpoints, aclEndpoints } = endpointGroups;
3727
3732
  const queryImport = {
3728
3733
  bindings: [
3734
+ ...resolver.options.prefetchQueries && queryEndpoints.length > 0 ? ["QueryClient"] : [],
3729
3735
  ...queryEndpoints.length > 0 ? [QUERY_HOOKS.query] : [],
3730
3736
  ...resolver.options.infiniteQueries && infiniteQueryEndpoints.length > 0 ? [QUERY_HOOKS.infiniteQuery] : [],
3731
3737
  ...mutationEndpoints.length > 0 ? [QUERY_HOOKS.mutation] : []
@@ -3834,12 +3840,25 @@ function generateQueries(params) {
3834
3840
  for (const endpoint of endpoints) {
3835
3841
  const endpointInfo = endpointGroups.infoByEndpoint.get(endpoint);
3836
3842
  if (endpointInfo?.query) {
3843
+ lines.push(renderQueryOptions({
3844
+ resolver,
3845
+ endpoint,
3846
+ inlineEndpoints
3847
+ }));
3848
+ lines.push("");
3837
3849
  lines.push(renderQuery({
3838
3850
  resolver,
3839
3851
  endpoint,
3840
3852
  inlineEndpoints
3841
3853
  }));
3842
3854
  lines.push("");
3855
+ if (resolver.options.prefetchQueries) {
3856
+ lines.push(renderPrefetchQuery({
3857
+ resolver,
3858
+ endpoint
3859
+ }));
3860
+ lines.push("");
3861
+ }
3843
3862
  }
3844
3863
  if (endpointInfo?.mutation) {
3845
3864
  lines.push(renderMutation({
@@ -3851,12 +3870,25 @@ function generateQueries(params) {
3851
3870
  lines.push("");
3852
3871
  }
3853
3872
  if (endpointInfo?.infiniteQuery) {
3873
+ lines.push(renderInfiniteQueryOptions({
3874
+ resolver,
3875
+ endpoint,
3876
+ inlineEndpoints
3877
+ }));
3878
+ lines.push("");
3854
3879
  lines.push(renderInfiniteQuery({
3855
3880
  resolver,
3856
3881
  endpoint,
3857
3882
  inlineEndpoints
3858
3883
  }));
3859
3884
  lines.push("");
3885
+ if (resolver.options.prefetchQueries) {
3886
+ lines.push(renderPrefetchInfiniteQuery({
3887
+ resolver,
3888
+ endpoint
3889
+ }));
3890
+ lines.push("");
3891
+ }
3860
3892
  }
3861
3893
  }
3862
3894
  if (resolver.options.tsNamespaces) lines.push("}");
@@ -4032,6 +4064,62 @@ function renderInlineEndpointConfig(resolver, endpoint, modelNamespaceTag) {
4032
4064
  lines.push(" }");
4033
4065
  return lines.join("\n");
4034
4066
  }
4067
+ function renderQueryOptions({ resolver, endpoint, inlineEndpoints }) {
4068
+ const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
4069
+ const endpointParams = renderEndpointParams(resolver, endpoint, { modelNamespaceTag: getEndpointTag(endpoint, resolver.options) });
4070
+ const endpointArgs = renderEndpointArgs(resolver, endpoint, {});
4071
+ const endpointFunction = inlineEndpoints ? getEndpointName(endpoint) : getImportedEndpointName(endpoint, resolver.options);
4072
+ const lines = [];
4073
+ lines.push(`export const ${getQueryOptionsName(endpoint)} = (${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => ({`);
4074
+ lines.push(` queryKey: keys.${getEndpointName(endpoint)}(${endpointArgs}),`);
4075
+ lines.push(` queryFn: () => ${endpointFunction}(${endpointArgs}${hasAxiosRequestConfig ? `${endpointArgs ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}),`);
4076
+ lines.push("});");
4077
+ return lines.join("\n");
4078
+ }
4079
+ function renderInfiniteQueryOptions({ resolver, endpoint, inlineEndpoints }) {
4080
+ const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
4081
+ const endpointParams = renderEndpointParams(resolver, endpoint, {
4082
+ excludePageParam: true,
4083
+ modelNamespaceTag: getEndpointTag(endpoint, resolver.options)
4084
+ });
4085
+ const endpointArgsWithoutPage = renderEndpointArgs(resolver, endpoint, { excludePageParam: true });
4086
+ const endpointArgsWithPage = renderEndpointArgs(resolver, endpoint, { replacePageParam: true });
4087
+ const endpointFunction = inlineEndpoints ? getEndpointName(endpoint) : getImportedEndpointName(endpoint, resolver.options);
4088
+ const lines = [];
4089
+ lines.push(`export const ${getInfiniteQueryOptionsName(endpoint)} = (${endpointParams ? `{ ${endpointArgsWithoutPage} }: { ${endpointParams} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => ({`);
4090
+ lines.push(` queryKey: keys.${getEndpointName(endpoint)}Infinite(${endpointArgsWithoutPage}),`);
4091
+ lines.push(` queryFn: ({ pageParam }: { pageParam: number }) => ${endpointFunction}(${endpointArgsWithPage}${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}` : ""}),`);
4092
+ lines.push(" initialPageParam: 1,");
4093
+ lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }) => {`);
4094
+ lines.push(` const pageParam = ${resolver.options.infiniteQueryResponseParamNames.page} ?? 1;`);
4095
+ lines.push(` return pageParam * limitParam < ${resolver.options.infiniteQueryResponseParamNames.totalItems} ? pageParam + 1 : null;`);
4096
+ lines.push(" },");
4097
+ lines.push("});");
4098
+ return lines.join("\n");
4099
+ }
4100
+ function renderPrefetchQuery({ resolver, endpoint }) {
4101
+ const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
4102
+ const endpointParams = renderEndpointParams(resolver, endpoint, { modelNamespaceTag: getEndpointTag(endpoint, resolver.options) });
4103
+ const endpointArgs = renderEndpointArgs(resolver, endpoint, {});
4104
+ const lines = [];
4105
+ lines.push(`export const ${getPrefetchQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchQuery"]>[0], "queryKey" | "queryFn">) => {`);
4106
+ lines.push(` return queryClient.prefetchQuery({ ...${getQueryOptionsName(endpoint)}(${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}), ...options });`);
4107
+ lines.push("};");
4108
+ return lines.join("\n");
4109
+ }
4110
+ function renderPrefetchInfiniteQuery({ resolver, endpoint }) {
4111
+ const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
4112
+ const endpointParams = renderEndpointParams(resolver, endpoint, {
4113
+ excludePageParam: true,
4114
+ modelNamespaceTag: getEndpointTag(endpoint, resolver.options)
4115
+ });
4116
+ const endpointArgs = renderEndpointArgs(resolver, endpoint, { excludePageParam: true });
4117
+ const lines = [];
4118
+ lines.push(`export const ${getPrefetchInfiniteQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchInfiniteQuery"]>[0], "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">) => {`);
4119
+ lines.push(` return queryClient.prefetchInfiniteQuery({ ...${getInfiniteQueryOptionsName(endpoint)}(${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}), ...options });`);
4120
+ lines.push("};");
4121
+ return lines.join("\n");
4122
+ }
4035
4123
  function renderQuery({ resolver, endpoint, inlineEndpoints }) {
4036
4124
  const hasAxiosRequestConfig = resolver.options.axiosRequestConfig;
4037
4125
  const hasAclCheck = resolver.options.checkAcl && endpoint.acl;
@@ -4043,9 +4131,9 @@ function renderQuery({ resolver, endpoint, inlineEndpoints }) {
4043
4131
  optionalPathParams: resolver.options.workspaceContext,
4044
4132
  modelNamespaceTag: tag
4045
4133
  });
4046
- const hasQueryFn = endpointArgs.length > 0 || hasAxiosRequestConfig || hasAclCheck;
4047
- const hasQueryFnBody = Boolean(hasAclCheck) || Object.keys(workspaceParamReplacements).length > 0;
4048
- const importedEndpoint = inlineEndpoints ? getEndpointName(endpoint) : getImportedEndpointName(endpoint, resolver.options);
4134
+ const queryOptionsName = getQueryOptionsName(endpoint);
4135
+ const hasQueryFnOverride = hasAclCheck;
4136
+ const queryOptionsArgs = `${resolvedEndpointArgs ? `{ ${resolvedEndpointArgs} }` : ""}${hasAxiosRequestConfig ? `${resolvedEndpointArgs ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
4049
4137
  const lines = [];
4050
4138
  lines.push(renderQueryJsDocs({
4051
4139
  resolver,
@@ -4053,7 +4141,8 @@ function renderQuery({ resolver, endpoint, inlineEndpoints }) {
4053
4141
  mode: "query",
4054
4142
  tag
4055
4143
  }));
4056
- lines.push(`export const ${getQueryName(endpoint)} = <TData>(${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}options?: AppQueryOptions<typeof ${importedEndpoint}, TData>${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
4144
+ lines.push(`export const ${getQueryName(endpoint)} = <TData>(${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}options?: AppQueryOptions<typeof ${inlineEndpoints ? getEndpointName(endpoint) : getImportedEndpointName(endpoint, resolver.options)}, TData>${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
4145
+ lines.push(" const queryConfig = OpenApiQueryConfig.useConfig();");
4057
4146
  if (hasAclCheck) lines.push(` const { checkAcl } = ${ACL_CHECK_HOOK}();`);
4058
4147
  lines.push(...renderWorkspaceParamResolutions({
4059
4148
  replacements: workspaceParamReplacements,
@@ -4061,13 +4150,15 @@ function renderQuery({ resolver, endpoint, inlineEndpoints }) {
4061
4150
  }));
4062
4151
  lines.push(" ");
4063
4152
  lines.push(` return ${QUERY_HOOKS.query}({`);
4064
- lines.push(` queryKey: keys.${getEndpointName(endpoint)}(${resolvedEndpointArgs}),`);
4065
- if (hasQueryFn) {
4066
- lines.push(` queryFn: () => ${hasQueryFnBody ? "{ " : ""}`);
4153
+ lines.push(` ...${queryOptionsName}(${queryOptionsArgs}),`);
4154
+ if (hasQueryFnOverride) {
4155
+ lines.push(" queryFn: async () => {");
4067
4156
  if (hasAclCheck) lines.push(renderAclCheckCall(resolver, endpoint, workspaceParamReplacements, " "));
4068
- lines.push(` ${hasQueryFnBody ? "return " : ""}${importedEndpoint}(${resolvedEndpointArgs}${hasAxiosRequestConfig ? `${resolvedEndpointArgs ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""})${hasQueryFnBody ? " }" : ""},`);
4069
- } else lines.push(` queryFn: ${importedEndpoint},`);
4157
+ lines.push(` return ${queryOptionsName}(${queryOptionsArgs}).queryFn();`);
4158
+ lines.push(" },");
4159
+ }
4070
4160
  lines.push(" ...options,");
4161
+ lines.push(" onError: options?.onError ?? queryConfig.onError,");
4071
4162
  lines.push(" });");
4072
4163
  lines.push("};");
4073
4164
  return lines.join("\n");
@@ -4204,9 +4295,9 @@ function renderInfiniteQuery({ resolver, endpoint, inlineEndpoints }) {
4204
4295
  });
4205
4296
  const endpointArgsWithoutPage = renderEndpointArgs(resolver, endpoint, { excludePageParam: true });
4206
4297
  const resolvedEndpointArgsWithoutPage = renderEndpointArgs(resolver, endpoint, { excludePageParam: true }, workspaceParamReplacements);
4207
- const resolvedEndpointArgsWithPage = renderEndpointArgs(resolver, endpoint, { replacePageParam: true }, workspaceParamReplacements);
4208
- const endpointFunction = inlineEndpoints ? getEndpointName(endpoint) : getImportedEndpointName(endpoint, resolver.options);
4209
- const hasQueryFnBody = Boolean(hasAclCheck) || Object.keys(workspaceParamReplacements).length > 0;
4298
+ const queryOptionsName = getInfiniteQueryOptionsName(endpoint);
4299
+ const queryOptionsArgs = `${resolvedEndpointArgsWithoutPage ? `{ ${resolvedEndpointArgsWithoutPage} }` : ""}${hasAxiosRequestConfig ? `${resolvedEndpointArgsWithoutPage ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
4300
+ const hasQueryFnOverride = hasAclCheck;
4210
4301
  const lines = [];
4211
4302
  lines.push(renderQueryJsDocs({
4212
4303
  resolver,
@@ -4214,7 +4305,8 @@ function renderInfiniteQuery({ resolver, endpoint, inlineEndpoints }) {
4214
4305
  mode: "infiniteQuery",
4215
4306
  tag
4216
4307
  }));
4217
- lines.push(`export const ${getInfiniteQueryName(endpoint)} = <TData>(${endpointParams ? `{ ${endpointArgsWithoutPage} }: { ${endpointParams} }, ` : ""}options?: AppInfiniteQueryOptions<typeof ${endpointFunction}, TData>${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
4308
+ lines.push(`export const ${getInfiniteQueryName(endpoint)} = <TData>(${endpointParams ? `{ ${endpointArgsWithoutPage} }: { ${endpointParams} }, ` : ""}options?: AppInfiniteQueryOptions<typeof ${inlineEndpoints ? getEndpointName(endpoint) : getImportedEndpointName(endpoint, resolver.options)}, TData>${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}?: ${AXIOS_REQUEST_CONFIG_TYPE}` : ""}) => {`);
4309
+ lines.push(" const queryConfig = OpenApiQueryConfig.useConfig();");
4218
4310
  if (hasAclCheck) lines.push(` const { checkAcl } = ${ACL_CHECK_HOOK}();`);
4219
4311
  lines.push(...renderWorkspaceParamResolutions({
4220
4312
  replacements: workspaceParamReplacements,
@@ -4222,16 +4314,15 @@ function renderInfiniteQuery({ resolver, endpoint, inlineEndpoints }) {
4222
4314
  }));
4223
4315
  lines.push("");
4224
4316
  lines.push(` return ${QUERY_HOOKS.infiniteQuery}({`);
4225
- lines.push(` queryKey: keys.${getEndpointName(endpoint)}Infinite(${resolvedEndpointArgsWithoutPage}),`);
4226
- lines.push(` queryFn: ({ pageParam }) => ${hasQueryFnBody ? "{ " : ""}`);
4227
- if (hasAclCheck) lines.push(renderAclCheckCall(resolver, endpoint, workspaceParamReplacements, " "));
4228
- lines.push(` ${hasQueryFnBody ? "return " : ""}${endpointFunction}(${resolvedEndpointArgsWithPage}${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}` : ""})${hasQueryFnBody ? " }" : ""},`);
4229
- lines.push(" initialPageParam: 1,");
4230
- lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }) => {`);
4231
- lines.push(` const pageParam = ${resolver.options.infiniteQueryResponseParamNames.page} ?? 1;`);
4232
- lines.push(` return pageParam * limitParam < ${resolver.options.infiniteQueryResponseParamNames.totalItems} ? pageParam + 1 : null;`);
4233
- lines.push(" },");
4317
+ lines.push(` ...${queryOptionsName}(${queryOptionsArgs}),`);
4318
+ if (hasQueryFnOverride) {
4319
+ lines.push(" queryFn: async ({ pageParam }) => {");
4320
+ lines.push(renderAclCheckCall(resolver, endpoint, workspaceParamReplacements, " "));
4321
+ lines.push(` return ${queryOptionsName}(${queryOptionsArgs}).queryFn({ pageParam });`);
4322
+ lines.push(" },");
4323
+ }
4234
4324
  lines.push(" ...options,");
4325
+ lines.push(" onError: options?.onError ?? queryConfig.onError,");
4235
4326
  lines.push(" });");
4236
4327
  lines.push("};");
4237
4328
  return lines.join("\n");
@@ -1,4 +1,4 @@
1
- import { n as GenerateFileData, t as GenerateOptions } from "./options-DmUw8IYE.mjs";
1
+ import { n as GenerateFileData, t as GenerateOptions } from "./options-BNqkO_OS.mjs";
2
2
  import { OpenAPIV3 } from "openapi-types";
3
3
 
4
4
  //#region src/generators/types/metadata.d.ts
@@ -1,4 +1,4 @@
1
- import { _ as isMediaTypeAllowed, b as formatTag, c as getSchemaTsMetaType, d as getTagImportPath, f as getQueryName, h as GenerateType, i as getDataFromOpenAPIDoc, l as getTsTypeBase, m as getNamespaceName, o as isMutation, p as DEFAULT_GENERATE_OPTIONS, s as isQuery, t as generateCodeFromOpenAPIDoc, v as isParamMediaTypeAllowed, y as invalidVariableNameCharactersToCamel } from "./generateCodeFromOpenAPIDoc-BP7F6YJP.mjs";
1
+ import { _ as isMediaTypeAllowed, b as formatTag, c as getSchemaTsMetaType, d as getTagImportPath, f as getQueryName, h as GenerateType, i as getDataFromOpenAPIDoc, l as getTsTypeBase, m as getNamespaceName, o as isMutation, p as DEFAULT_GENERATE_OPTIONS, s as isQuery, t as generateCodeFromOpenAPIDoc, v as isParamMediaTypeAllowed, y as invalidVariableNameCharactersToCamel } from "./generateCodeFromOpenAPIDoc-DZ5swy4U.mjs";
2
2
  import SwaggerParser from "@apidevtools/swagger-parser";
3
3
 
4
4
  //#region src/generators/core/getMetadataFromOpenAPIDoc.ts
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as GeneralErrorCodes, i as ErrorHandlerOptions, n as ErrorEntry, o as SharedErrorHandler, r as ErrorHandler, t as ApplicationException } from "./error-handling-CXeVTk1T.mjs";
2
- import "./options-DmUw8IYE.mjs";
3
- import { t as OpenAPICodegenConfig } from "./config-CDt7S_BM.mjs";
2
+ import "./options-BNqkO_OS.mjs";
3
+ import { t as OpenAPICodegenConfig } from "./config-BHkVxL6S.mjs";
4
4
  import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, CreateAxiosDefaults } from "axios";
5
5
  import { z } from "zod";
6
6
  import "i18next";
@@ -39,6 +39,7 @@ interface QueriesGenerateOptions {
39
39
  axiosRequestConfig?: boolean;
40
40
  mutationEffects?: boolean;
41
41
  workspaceContext?: boolean;
42
+ prefetchQueries?: boolean;
42
43
  }
43
44
  interface InfiniteQueriesGenerateOptions {
44
45
  infiniteQueries?: boolean;
package/dist/sh.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { S as VALIDATION_ERROR_TYPE_TITLE, g as groupByType, h as GenerateType, i as getDataFromOpenAPIDoc, n as getOutputFileName, u as getTagFileName, x as Profiler } from "./generateCodeFromOpenAPIDoc-BP7F6YJP.mjs";
3
- import { n as resolveConfig, t as runGenerate } from "./generate.runner-C93djZ78.mjs";
2
+ import { S as VALIDATION_ERROR_TYPE_TITLE, g as groupByType, h as GenerateType, i as getDataFromOpenAPIDoc, n as getOutputFileName, u as getTagFileName, x as Profiler } from "./generateCodeFromOpenAPIDoc-DZ5swy4U.mjs";
3
+ import { n as resolveConfig, t as runGenerate } from "./generate.runner-DmZ5LVHf.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import yargs from "yargs";
6
6
  import { hideBin } from "yargs/helpers";
@@ -39,7 +39,7 @@ function logBanner(message) {
39
39
  * Fetch the version from package.json
40
40
  */
41
41
  function getVersion() {
42
- return "2.0.8-rc.19";
42
+ return "2.0.8-rc.20";
43
43
  }
44
44
 
45
45
  //#endregion
package/dist/vite.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import "./options-DmUw8IYE.mjs";
2
- import { t as OpenAPICodegenConfig } from "./config-CDt7S_BM.mjs";
1
+ import "./options-BNqkO_OS.mjs";
2
+ import { t as OpenAPICodegenConfig } from "./config-BHkVxL6S.mjs";
3
3
  import { Plugin } from "vite";
4
4
 
5
5
  //#region src/vite/openapi-codegen.plugin.d.ts
package/dist/vite.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { x as Profiler } from "./generateCodeFromOpenAPIDoc-BP7F6YJP.mjs";
2
- import { t as runGenerate } from "./generate.runner-C93djZ78.mjs";
1
+ import { x as Profiler } from "./generateCodeFromOpenAPIDoc-DZ5swy4U.mjs";
2
+ import { t as runGenerate } from "./generate.runner-DmZ5LVHf.mjs";
3
3
  import path from "path";
4
4
 
5
5
  //#region src/vite/openapi-codegen.plugin.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "2.0.8-rc.19",
3
+ "version": "2.0.8-rc.20",
4
4
  "keywords": [
5
5
  "codegen",
6
6
  "openapi",