@sebspark/openapi-typegen 2.1.0 → 2.2.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.
- package/dist/index.js +5 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -409,11 +409,15 @@ var generateResponses = (path) => Object.entries(path.responses).filter(([code])
|
|
|
409
409
|
// src/generator/server.ts
|
|
410
410
|
var generateServer = (name, paths) => {
|
|
411
411
|
const tokens = [];
|
|
412
|
-
tokens.push(`export type ${name}
|
|
412
|
+
tokens.push(`export type ${name}ServerPaths = {`);
|
|
413
413
|
for (const [url, methods] of Object.entries(groupPathsByUrl(paths))) {
|
|
414
414
|
tokens.push(generatePath(url, methods));
|
|
415
415
|
}
|
|
416
416
|
tokens.push("}");
|
|
417
|
+
tokens.push("\n");
|
|
418
|
+
tokens.push(
|
|
419
|
+
`export type ${name}Server = APIServerDefinition & ${name}ServerPaths`
|
|
420
|
+
);
|
|
417
421
|
return tokens.join("\n");
|
|
418
422
|
};
|
|
419
423
|
var groupPathsByUrl = (paths) => paths.reduce(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebspark/openapi-typegen",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/yargs": "17.0.33",
|
|
21
|
-
"tsconfig": "*"
|
|
21
|
+
"tsconfig": "*",
|
|
22
|
+
"vitest": "3.1.2"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@sebspark/openapi-core": "*",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"chalk": "<5",
|
|
27
28
|
"change-case": "4.1.2",
|
|
28
29
|
"prettier": "3.5.3",
|
|
29
|
-
"yaml": "2.7.
|
|
30
|
+
"yaml": "2.7.1",
|
|
30
31
|
"yargs": "17.7.2"
|
|
31
32
|
}
|
|
32
33
|
}
|