swgto-ts 3.0.0 → 3.0.1

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.
@@ -461,15 +461,13 @@ ${queryLine}${bodyLine} ...config,
461
461
  }`;
462
462
  }
463
463
  function generateTsRequestFile(operation, httpClientPath, typeImportPath, mergeParams = false) {
464
- const importTypes = [
465
- ...operation.requestImportTypes,
466
- operation.responseTypeName,
467
- "RequestConfig"
468
- ].filter((value, index, array) => Boolean(value) && array.indexOf(value) === index);
464
+ const importTypes = [...operation.requestImportTypes, operation.responseTypeName, "RequestConfig"].filter(
465
+ (value, index, array) => Boolean(value) && array.indexOf(value) === index
466
+ );
469
467
  const importLine = importTypes.length ? `import type { ${importTypes.join(", ")} } from ${JSON.stringify(typeImportPath)};
470
468
  ` : "";
471
469
  const buildUrlHelper = operation.pathParams.length ? `
472
- function buildUrl(path?: Record<string, unknown>): string {
470
+ function buildUrl(path?: Record<string, any>): string {
473
471
  return ${JSON.stringify(operation.requestPath)}.replace(/\\{([^}]+)\\}/g, (_, key) => String(path?.[key] ?? ''));
474
472
  }
475
473
  ` : "";
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  generateFromConfig
4
- } from "./chunk-OU5BJNJI.js";
4
+ } from "./chunk-OMXGXES2.js";
5
5
  import "./chunk-HBBM5HFP.js";
6
6
 
7
7
  // src/cli.ts
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateFromConfig
3
- } from "./chunk-OU5BJNJI.js";
3
+ } from "./chunk-OMXGXES2.js";
4
4
  import "./chunk-HBBM5HFP.js";
5
5
  export {
6
6
  generateFromConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swgto-ts",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Generate API request files from OpenAPI 3.x documents.",
5
5
  "license": "MIT",
6
6
  "type": "module",