@spec2ts/openapi-client 3.0.1 → 3.1.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.
package/lib/core-generator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "typescript";
|
|
2
|
-
import type { OpenAPIObject } from "openapi3-ts/
|
|
2
|
+
import type { OpenAPIObject } from "openapi3-ts/oas31";
|
|
3
3
|
import { OApiGeneratorContext } from "./core-parser";
|
|
4
4
|
export type Formatter = "space" | "pipe" | "deep" | "explode" | "form";
|
|
5
5
|
export declare function generateServers(file: ts.SourceFile, { servers }: OpenAPIObject, context: OApiGeneratorContext): ts.SourceFile;
|
package/lib/core-generator.js
CHANGED
|
@@ -42,7 +42,8 @@ function generateDefaults(file, context) {
|
|
|
42
42
|
}
|
|
43
43
|
exports.generateDefaults = generateDefaults;
|
|
44
44
|
function generateFunctions(file, spec, context) {
|
|
45
|
-
|
|
45
|
+
var _a;
|
|
46
|
+
const paths = Object.fromEntries(Object.entries((_a = spec.paths) !== null && _a !== void 0 ? _a : {})
|
|
46
47
|
.filter(([path]) => !context.options.prefix || path.startsWith(context.options.prefix)));
|
|
47
48
|
const functions = Object.entries(paths).map(([path, pathSpec]) => {
|
|
48
49
|
const item = (0, core_parser_1.resolveReference)(pathSpec, context);
|
package/lib/core-parser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "typescript";
|
|
2
|
-
import type { PathItemObject, OperationObject, ParameterObject } from "openapi3-ts/
|
|
2
|
+
import type { PathItemObject, OperationObject, ParameterObject } from "openapi3-ts/oas31";
|
|
3
3
|
import { ParserContext } from "@spec2ts/jsonschema/lib/core-parser";
|
|
4
4
|
import type { OApiGeneratorOptions } from "./openapi-generator";
|
|
5
5
|
export type Method = "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD" | "PATCH" | "TRACE";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from "typescript";
|
|
2
|
-
import type { OpenAPIObject } from "openapi3-ts/
|
|
2
|
+
import type { OpenAPIObject } from "openapi3-ts/oas31";
|
|
3
3
|
import { ParserOptions } from "@spec2ts/jsonschema/lib/core-parser";
|
|
4
4
|
export interface OApiGeneratorOptions extends ParserOptions {
|
|
5
5
|
inlineRequired?: boolean;
|
package/lib/server-parser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as ts from "typescript";
|
|
2
|
-
import type { ServerObject } from "openapi3-ts/
|
|
2
|
+
import type { ServerObject } from "openapi3-ts/oas31";
|
|
3
3
|
export declare function parseServers(servers: ServerObject[]): ts.ObjectLiteralExpression;
|
|
4
4
|
export declare function defaultBaseUrl(servers: ServerObject[]): ts.StringLiteral;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spec2ts/openapi-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Utility to convert OpenAPI v3 specifications to Typescript HTTP client using TypeScript native compiler",
|
|
5
5
|
"author": "Touchify <dev@touchify.co>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,17 +40,17 @@
|
|
|
40
40
|
"prepublishOnly": "npm test && npm run build"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@spec2ts/core": "^3.0.
|
|
44
|
-
"@spec2ts/jsonschema": "^3.0.
|
|
45
|
-
"@spec2ts/openapi": "^3.
|
|
43
|
+
"@spec2ts/core": "^3.0.2",
|
|
44
|
+
"@spec2ts/jsonschema": "^3.0.3",
|
|
45
|
+
"@spec2ts/openapi": "^3.1.1",
|
|
46
46
|
"openapi3-ts": "^4.1.2",
|
|
47
|
+
"typescript": "^5.0.0",
|
|
47
48
|
"yargs": "^17.7.2"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"del-cli": "^5.1.0",
|
|
51
52
|
"eslint": "^8.49.0",
|
|
52
|
-
"jest": "^29.6.4"
|
|
53
|
-
"typescript": "^5.2.2"
|
|
53
|
+
"jest": "^29.6.4"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"openapi",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"spec2ts",
|
|
71
71
|
"share"
|
|
72
72
|
],
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "e61cd1d9b535f823d090d81c514e15688af4cef3"
|
|
74
74
|
}
|