@spec2ts/openapi-client 3.0.0 → 3.1.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.
@@ -1,5 +1,5 @@
1
1
  import * as ts from "typescript";
2
- import type { OpenAPIObject } from "openapi3-ts/oas30";
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;
@@ -42,7 +42,8 @@ function generateDefaults(file, context) {
42
42
  }
43
43
  exports.generateDefaults = generateDefaults;
44
44
  function generateFunctions(file, spec, context) {
45
- const paths = Object.fromEntries(Object.entries(spec.paths)
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);
@@ -1,5 +1,5 @@
1
1
  import * as ts from "typescript";
2
- import type { PathItemObject, OperationObject, ParameterObject } from "openapi3-ts/oas30";
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/oas30";
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;
@@ -9,7 +9,7 @@ const core_parser_1 = require("@spec2ts/jsonschema/lib/core-parser");
9
9
  const core_parser_2 = require("@spec2ts/openapi/lib/core-parser");
10
10
  const core_generator_1 = require("./core-generator");
11
11
  async function generateClientFromFile(file, options = {}) {
12
- const schema = await (0, json_schema_ref_parser_1.parse)(file);
12
+ const schema = await json_schema_ref_parser_1.default.parse(file);
13
13
  return generateClient(schema, {
14
14
  cwd: path.resolve(path.dirname(file)) + "/",
15
15
  ...options
@@ -1,4 +1,4 @@
1
1
  import * as ts from "typescript";
2
- import type { ServerObject } from "openapi3-ts/oas30";
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.0.0",
3
+ "version": "3.1.0",
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,9 +40,9 @@
40
40
  "prepublishOnly": "npm test && npm run build"
41
41
  },
42
42
  "dependencies": {
43
- "@spec2ts/core": "^3.0.0",
44
- "@spec2ts/jsonschema": "^3.0.0",
45
- "@spec2ts/openapi": "^3.0.0",
43
+ "@spec2ts/core": "^3.0.1",
44
+ "@spec2ts/jsonschema": "^3.0.2",
45
+ "@spec2ts/openapi": "^3.1.0",
46
46
  "openapi3-ts": "^4.1.2",
47
47
  "yargs": "^17.7.2"
48
48
  },
@@ -70,5 +70,5 @@
70
70
  "spec2ts",
71
71
  "share"
72
72
  ],
73
- "gitHead": "4a0c2fc9068a9ca8cc0d8924c4b1998528b48052"
73
+ "gitHead": "b81a6210adc1d1a0c978187d253ff0c16e42c6d4"
74
74
  }