swagger-typescript-api 13.7.0 → 13.7.2
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/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-DTdmNLxQ.cjs → src-UwNroIF-.cjs} +14 -12
- package/dist/src-UwNroIF-.cjs.map +1 -0
- package/dist/{src-Bcgp_AKY.mjs → src-m02XHGVc.mjs} +14 -12
- package/dist/src-m02XHGVc.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/src-Bcgp_AKY.mjs.map +0 -1
- package/dist/src-DTdmNLxQ.cjs.map +0 -1
|
@@ -169,7 +169,7 @@ var ComponentTypeNameResolver = class extends NameResolver {
|
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region package.json
|
|
171
171
|
var name = "swagger-typescript-api";
|
|
172
|
-
var version = "13.7.
|
|
172
|
+
var version = "13.7.2";
|
|
173
173
|
var description = "Generate the API client for Fetch or Axios from an OpenAPI Specification";
|
|
174
174
|
//#endregion
|
|
175
175
|
//#region src/constants.ts
|
|
@@ -2469,12 +2469,12 @@ function mergeBrokenDoubleQuotedMapLines(content) {
|
|
|
2469
2469
|
function tryRepairSplitDoubleQuotedMapValue(line, nextLine) {
|
|
2470
2470
|
const unterminated = matchMapKeyOpeningDoubleQuotedScalar(line);
|
|
2471
2471
|
if (!unterminated) return null;
|
|
2472
|
-
const closing =
|
|
2472
|
+
const closing = matchClosingQuoteLine(nextLine);
|
|
2473
2473
|
if (!closing) return null;
|
|
2474
2474
|
const { keyPrefixAndQuote, valueBeforeBreak } = unterminated;
|
|
2475
|
-
const {
|
|
2475
|
+
const { lineBeforeClosingQuote } = closing;
|
|
2476
2476
|
if (valueBeforeBreak.endsWith("\\")) return null;
|
|
2477
|
-
return `${keyPrefixAndQuote}${valueBeforeBreak}\\n${
|
|
2477
|
+
return `${keyPrefixAndQuote}${valueBeforeBreak}\\n${lineBeforeClosingQuote}"`;
|
|
2478
2478
|
}
|
|
2479
2479
|
/** ` foo: "text` with no `"` before end of line (value may be empty). */
|
|
2480
2480
|
function matchMapKeyOpeningDoubleQuotedScalar(line) {
|
|
@@ -2485,11 +2485,11 @@ function matchMapKeyOpeningDoubleQuotedScalar(line) {
|
|
|
2485
2485
|
valueBeforeBreak: match[2]
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
|
-
/** `
|
|
2489
|
-
function
|
|
2490
|
-
const match = /^(\s
|
|
2488
|
+
/** ` any text here"` — indented continuation that closes the quote. */
|
|
2489
|
+
function matchClosingQuoteLine(line) {
|
|
2490
|
+
const match = /^(\s+)([^"]+?)"\s*$/.exec(line);
|
|
2491
2491
|
if (!match?.[2]) return null;
|
|
2492
|
-
return {
|
|
2492
|
+
return { lineBeforeClosingQuote: match[2].trim() };
|
|
2493
2493
|
}
|
|
2494
2494
|
function normalizeYamlEscapedLineBreaks(content) {
|
|
2495
2495
|
let normalized = "";
|
|
@@ -2808,16 +2808,18 @@ var ResolvedSwaggerSchema = class ResolvedSwaggerSchema {
|
|
|
2808
2808
|
}
|
|
2809
2809
|
collectExternalRefCandidates(externalPath) {
|
|
2810
2810
|
const candidates = /* @__PURE__ */ new Set();
|
|
2811
|
-
|
|
2811
|
+
const isRemote = /^https?:\/\//i.test(externalPath);
|
|
2812
|
+
const normalizedExternalPath = externalPath.startsWith("/") ? externalPath.replace(/^\/+/, "") : externalPath;
|
|
2813
|
+
if (isRemote) return [];
|
|
2812
2814
|
if (path.isAbsolute(externalPath)) candidates.add(externalPath);
|
|
2813
2815
|
const inputPath = this.config.input;
|
|
2814
|
-
if (typeof inputPath === "string" && inputPath) candidates.add(path.resolve(path.dirname(inputPath),
|
|
2816
|
+
if (typeof inputPath === "string" && inputPath) candidates.add(path.resolve(path.dirname(inputPath), normalizedExternalPath));
|
|
2815
2817
|
for (const resolver of this.resolvers) try {
|
|
2816
2818
|
const resolverPaths = typeof resolver.paths === "function" ? resolver.paths() : [];
|
|
2817
2819
|
for (const resolverPath of resolverPaths) {
|
|
2818
2820
|
if (typeof resolverPath !== "string") continue;
|
|
2819
2821
|
if (/^https?:\/\//i.test(resolverPath)) continue;
|
|
2820
|
-
candidates.add(path.resolve(path.dirname(resolverPath),
|
|
2822
|
+
candidates.add(path.resolve(path.dirname(resolverPath), normalizedExternalPath));
|
|
2821
2823
|
}
|
|
2822
2824
|
} catch (e) {
|
|
2823
2825
|
consola.debug(e);
|
|
@@ -3791,4 +3793,4 @@ async function generateApi(config) {
|
|
|
3791
3793
|
//#endregion
|
|
3792
3794
|
export { SCHEMA_TYPES as a, constants_exports as c, version as d, RequestContentKind as i, description as l, generateTemplates as n, CodeGenConfig as o, TemplatesGenConfig as r, HTTP_CLIENT as s, generateApi as t, name as u };
|
|
3793
3795
|
|
|
3794
|
-
//# sourceMappingURL=src-
|
|
3796
|
+
//# sourceMappingURL=src-m02XHGVc.mjs.map
|