swagger-typescript-api 13.2.7 → 13.2.8
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/CHANGELOG.md +30 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +8 -8
- package/dist/lib.d.ts +8 -8
- package/dist/lib.js +1 -1
- package/dist/{src-BgBqKQNC.js → src-4gUT3jPg.js} +11 -11
- package/dist/{src-BgBqKQNC.js.map → src-4gUT3jPg.js.map} +1 -1
- package/dist/{src-DYNtMxii.cjs → src-BtVFSrff.cjs} +11 -11
- package/dist/{src-DYNtMxii.cjs.map → src-BtVFSrff.cjs.map} +1 -1
- package/package.json +10 -10
- package/templates/base/http-clients/fetch-http-client.ejs +8 -3
- package/templates/base/route-type.ejs +2 -1
- package/templates/default/procedure-call.ejs +3 -1
- package/templates/modular/procedure-call.ejs +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# swagger-typescript-api
|
|
2
2
|
|
|
3
|
+
## 13.2.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1326](https://github.com/acacode/swagger-typescript-api/pull/1326) [`99b5f50`](https://github.com/acacode/swagger-typescript-api/commit/99b5f5055bfdf207d9dfe316ef8ff2490d474443) Thanks [@thejhh](https://github.com/thejhh)! - Fix TypeScript generation failure for operationIds starting with numbers
|
|
8
|
+
|
|
9
|
+
**What:** Fixed an issue where operationIds starting with numbers (e.g., "123getUser") would cause TypeScript generation to fail due to invalid identifier names.
|
|
10
|
+
|
|
11
|
+
**Why:** OperationIds that start with numbers are not valid JavaScript identifiers, causing syntax errors in the generated TypeScript code.
|
|
12
|
+
|
|
13
|
+
**How:** Modified the template logic to quote property names for invalid identifiers. OperationIds starting with numbers are now generated as quoted properties (e.g., `"123GetUser": ...`) instead of unquoted invalid identifiers.
|
|
14
|
+
|
|
15
|
+
This resolves GitHub issue #952.
|
|
16
|
+
|
|
17
|
+
- [#1008](https://github.com/acacode/swagger-typescript-api/pull/1008) [`c2d3e6a`](https://github.com/acacode/swagger-typescript-api/commit/c2d3e6aab97d57a8cd7788c8e2adc909bcf26e1f) Thanks [@frazar](https://github.com/frazar)! - Fix handling of FormData inputs in Fetch HTTP client
|
|
18
|
+
|
|
19
|
+
Previously, when users passed a `FormData` object directly to the Fetch
|
|
20
|
+
client's `multipart/form-data` formatter, it would incorrectly attempt to use
|
|
21
|
+
`Object.keys()` on the FormData instance, which returns an empty array. This
|
|
22
|
+
caused the FormData to be processed incorrectly.
|
|
23
|
+
|
|
24
|
+
The fix adds a type check to return FormData instances unchanged, allowing
|
|
25
|
+
users to have full control over FormData construction when needed whilst
|
|
26
|
+
maintaining backwards compatibility for object inputs. This aligns the Fetch
|
|
27
|
+
client behaviour with the existing Axios client implementation.
|
|
28
|
+
|
|
29
|
+
This resolves issues where users needed to send multipart requests with
|
|
30
|
+
multiple entries for the same key, which is only possible with direct FormData
|
|
31
|
+
manipulation.
|
|
32
|
+
|
|
3
33
|
## 13.2.7
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_src = require('./src-
|
|
2
|
+
const require_src = require('./src-BtVFSrff.cjs');
|
|
3
3
|
const node_path = require_src.__toESM(require("node:path"));
|
|
4
4
|
const c12 = require_src.__toESM(require("c12"));
|
|
5
5
|
const citty = require_src.__toESM(require("citty"));
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { CodeGenConfig, HTTP_CLIENT, TemplatesGenConfig, generateApi, generateTemplates, package_default } from "./src-
|
|
2
|
+
import { CodeGenConfig, HTTP_CLIENT, TemplatesGenConfig, generateApi, generateTemplates, package_default } from "./src-4gUT3jPg.js";
|
|
3
3
|
import * as path$1 from "node:path";
|
|
4
4
|
import { loadConfig } from "c12";
|
|
5
5
|
import { defineCommand, runMain } from "citty";
|
package/dist/lib.cjs
CHANGED
package/dist/lib.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { OpenAPI } from "openapi-types";
|
|
2
2
|
import * as typescript$1 from "typescript";
|
|
3
3
|
import * as typescript from "typescript";
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
4
|
+
import * as lodash0$1 from "lodash";
|
|
5
|
+
import * as lodash0 from "lodash";
|
|
6
6
|
import lodash from "lodash";
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
7
|
+
import * as swagger_schema_official0 from "swagger-schema-official";
|
|
8
|
+
import * as eta0 from "eta";
|
|
9
9
|
|
|
10
10
|
//#region rolldown:runtime
|
|
11
11
|
//#endregion
|
|
@@ -911,7 +911,7 @@ type RawRouteInfo = {
|
|
|
911
911
|
description?: string;
|
|
912
912
|
tags?: string[];
|
|
913
913
|
summary?: string;
|
|
914
|
-
responses?:
|
|
914
|
+
responses?: swagger_schema_official0.Spec["responses"];
|
|
915
915
|
produces?: string[];
|
|
916
916
|
requestBody?: object;
|
|
917
917
|
consumes?: string[];
|
|
@@ -1144,7 +1144,7 @@ interface GenerateApiConfiguration {
|
|
|
1144
1144
|
fmtToJSDocLine: (line: string, params?: {
|
|
1145
1145
|
eol?: boolean;
|
|
1146
1146
|
}) => string;
|
|
1147
|
-
_:
|
|
1147
|
+
_: lodash0$1.LoDashStatic;
|
|
1148
1148
|
require: (path: string) => unknown;
|
|
1149
1149
|
};
|
|
1150
1150
|
}
|
|
@@ -1165,7 +1165,7 @@ interface GenerateApiOutput {
|
|
|
1165
1165
|
content: string;
|
|
1166
1166
|
withPrefix: boolean;
|
|
1167
1167
|
}) => void;
|
|
1168
|
-
renderTemplate: (templateContent: string, data: Record<string, unknown>, etaOptions?: Partial<
|
|
1168
|
+
renderTemplate: (templateContent: string, data: Record<string, unknown>, etaOptions?: Partial<eta0.EtaConfig>) => Promise<string> | string;
|
|
1169
1169
|
getTemplate: (params: {
|
|
1170
1170
|
fileName?: string;
|
|
1171
1171
|
name?: string;
|
|
@@ -1587,7 +1587,7 @@ declare function generateApi(config: Partial<GenerateApiConfiguration["config"]>
|
|
|
1587
1587
|
eol?: boolean | undefined;
|
|
1588
1588
|
}) => string;
|
|
1589
1589
|
NameResolver: typeof NameResolver;
|
|
1590
|
-
_:
|
|
1590
|
+
_: lodash0.LoDashStatic;
|
|
1591
1591
|
require: (packageOrPath: string) => Promise<any>;
|
|
1592
1592
|
};
|
|
1593
1593
|
};
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as lodash0$1 from "lodash";
|
|
2
|
+
import * as lodash0 from "lodash";
|
|
3
3
|
import lodash from "lodash";
|
|
4
4
|
import * as typescript$1 from "typescript";
|
|
5
5
|
import * as typescript from "typescript";
|
|
6
|
-
import * as
|
|
6
|
+
import * as eta0 from "eta";
|
|
7
7
|
import { OpenAPI } from "openapi-types";
|
|
8
|
-
import * as
|
|
8
|
+
import * as swagger_schema_official0 from "swagger-schema-official";
|
|
9
9
|
|
|
10
10
|
//#region src/schema-components-map.d.ts
|
|
11
11
|
declare class SchemaComponentsMap {
|
|
@@ -909,7 +909,7 @@ type RawRouteInfo = {
|
|
|
909
909
|
description?: string;
|
|
910
910
|
tags?: string[];
|
|
911
911
|
summary?: string;
|
|
912
|
-
responses?:
|
|
912
|
+
responses?: swagger_schema_official0.Spec["responses"];
|
|
913
913
|
produces?: string[];
|
|
914
914
|
requestBody?: object;
|
|
915
915
|
consumes?: string[];
|
|
@@ -1142,7 +1142,7 @@ interface GenerateApiConfiguration {
|
|
|
1142
1142
|
fmtToJSDocLine: (line: string, params?: {
|
|
1143
1143
|
eol?: boolean;
|
|
1144
1144
|
}) => string;
|
|
1145
|
-
_:
|
|
1145
|
+
_: lodash0$1.LoDashStatic;
|
|
1146
1146
|
require: (path: string) => unknown;
|
|
1147
1147
|
};
|
|
1148
1148
|
}
|
|
@@ -1163,7 +1163,7 @@ interface GenerateApiOutput {
|
|
|
1163
1163
|
content: string;
|
|
1164
1164
|
withPrefix: boolean;
|
|
1165
1165
|
}) => void;
|
|
1166
|
-
renderTemplate: (templateContent: string, data: Record<string, unknown>, etaOptions?: Partial<
|
|
1166
|
+
renderTemplate: (templateContent: string, data: Record<string, unknown>, etaOptions?: Partial<eta0.EtaConfig>) => Promise<string> | string;
|
|
1167
1167
|
getTemplate: (params: {
|
|
1168
1168
|
fileName?: string;
|
|
1169
1169
|
name?: string;
|
|
@@ -1585,7 +1585,7 @@ declare function generateApi(config: Partial<GenerateApiConfiguration["config"]>
|
|
|
1585
1585
|
eol?: boolean | undefined;
|
|
1586
1586
|
}) => string;
|
|
1587
1587
|
NameResolver: typeof NameResolver;
|
|
1588
|
-
_:
|
|
1588
|
+
_: lodash0.LoDashStatic;
|
|
1589
1589
|
require: (packageOrPath: string) => Promise<any>;
|
|
1590
1590
|
};
|
|
1591
1591
|
};
|
package/dist/lib.js
CHANGED
|
@@ -184,7 +184,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
|
|
|
184
184
|
//#endregion
|
|
185
185
|
//#region package.json
|
|
186
186
|
var name = "swagger-typescript-api";
|
|
187
|
-
var version = "13.2.
|
|
187
|
+
var version = "13.2.8";
|
|
188
188
|
var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
|
|
189
189
|
var homepage = "https://github.com/acacode/swagger-typescript-api";
|
|
190
190
|
var bugs = "https://github.com/acacode/swagger-typescript-api/issues";
|
|
@@ -224,8 +224,8 @@ var scripts = {
|
|
|
224
224
|
"typedoc": "typedoc"
|
|
225
225
|
};
|
|
226
226
|
var dependencies = {
|
|
227
|
-
"@biomejs/js-api": "
|
|
228
|
-
"@biomejs/wasm-nodejs": "2.
|
|
227
|
+
"@biomejs/js-api": "2.0.3",
|
|
228
|
+
"@biomejs/wasm-nodejs": "2.1.4",
|
|
229
229
|
"@types/swagger-schema-official": "^2.0.25",
|
|
230
230
|
"c12": "^3.0.4",
|
|
231
231
|
"citty": "^0.1.6",
|
|
@@ -236,22 +236,22 @@ var dependencies = {
|
|
|
236
236
|
"nanoid": "^5.1.5",
|
|
237
237
|
"swagger-schema-official": "2.0.0-bab6bed",
|
|
238
238
|
"swagger2openapi": "^7.0.8",
|
|
239
|
-
"typescript": "~5.
|
|
239
|
+
"typescript": "~5.9.2"
|
|
240
240
|
};
|
|
241
241
|
var devDependencies = {
|
|
242
|
-
"@biomejs/biome": "2.
|
|
242
|
+
"@biomejs/biome": "2.1.4",
|
|
243
243
|
"@changesets/changelog-github": "0.5.1",
|
|
244
244
|
"@changesets/cli": "2.29.5",
|
|
245
245
|
"@tsconfig/node18": "18.2.4",
|
|
246
246
|
"@tsconfig/strictest": "2.0.5",
|
|
247
247
|
"@types/js-yaml": "4.0.9",
|
|
248
|
-
"@types/lodash": "4.17.
|
|
249
|
-
"@types/node": "24.0
|
|
248
|
+
"@types/lodash": "4.17.20",
|
|
249
|
+
"@types/node": "24.2.0",
|
|
250
250
|
"@types/swagger2openapi": "7.0.4",
|
|
251
|
-
"axios": "1.
|
|
251
|
+
"axios": "1.11.0",
|
|
252
252
|
"openapi-types": "12.1.3",
|
|
253
|
-
"tsdown": "0.
|
|
254
|
-
"typedoc": "0.28.
|
|
253
|
+
"tsdown": "0.13.4",
|
|
254
|
+
"typedoc": "0.28.9",
|
|
255
255
|
"vitest": "3.2.4"
|
|
256
256
|
};
|
|
257
257
|
var packageManager = "yarn@4.9.2";
|
|
@@ -3170,4 +3170,4 @@ async function generateApi(config) {
|
|
|
3170
3170
|
|
|
3171
3171
|
//#endregion
|
|
3172
3172
|
export { CodeGenConfig, HTTP_CLIENT, TemplatesGenConfig, constants_exports, generateApi, generateTemplates, package_default };
|
|
3173
|
-
//# sourceMappingURL=src-
|
|
3173
|
+
//# sourceMappingURL=src-4gUT3jPg.js.map
|