react-query-lightbase-codegen 2.2.1 → 2.3.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.
@@ -134,9 +134,10 @@ function generateAxiosMethod(operation, spec) {
134
134
  .filter(Boolean)
135
135
  .join("\n ");
136
136
  const requestParms = hasData
137
- ? `props: ${dataType} & { axiosConfig?: AxiosRequestConfig; }`
137
+ ? `props: ${(0, utils_1.pascalCase)(operationId)}Params & { axiosConfig?: AxiosRequestConfig; }`
138
138
  : "props?: { axiosConfig?: AxiosRequestConfig }";
139
139
  return `
140
+ ${hasData ? `export type ${(0, utils_1.pascalCase)(operationId)}Params = ${dataType};` : ""}
140
141
  ${jsDocLines.join("\n ")}
141
142
  export async function ${(0, utils_1.camelCase)(operationId)}(${requestParms}): Promise<${responseType}> {
142
143
  ${methodBody}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-query-lightbase-codegen",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "license": "MIT",
5
5
  "description": "Generate Axios API clients and React Query options from OpenAPI specifications",
6
6
  "exports": "./dist/index.js",
@@ -167,10 +167,11 @@ function generateAxiosMethod(operation: OperationInfo, spec: OpenAPIV3.Document)
167
167
  .join("\n ");
168
168
 
169
169
  const requestParms = hasData
170
- ? `props: ${dataType} & { axiosConfig?: AxiosRequestConfig; }`
170
+ ? `props: ${pascalCase(operationId)}Params & { axiosConfig?: AxiosRequestConfig; }`
171
171
  : "props?: { axiosConfig?: AxiosRequestConfig }";
172
172
 
173
173
  return `
174
+ ${hasData ? `export type ${pascalCase(operationId)}Params = ${dataType};` : ""}
174
175
  ${jsDocLines.join("\n ")}
175
176
  export async function ${camelCase(operationId)}(${requestParms}): Promise<${responseType}> {
176
177
  ${methodBody}