@postman-cse/onboarding-bootstrap 0.13.1 → 0.14.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/README.md +42 -0
- package/action.yml +26 -0
- package/dist/action.cjs +1218 -531
- package/dist/cli.cjs +1244 -557
- package/dist/index.cjs +1218 -531
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1069,14 +1069,14 @@ var require_util = __commonJS({
|
|
|
1069
1069
|
}
|
|
1070
1070
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
1071
1071
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
1072
|
-
let
|
|
1072
|
+
let path8 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
1073
1073
|
if (origin[origin.length - 1] === "/") {
|
|
1074
1074
|
origin = origin.slice(0, origin.length - 1);
|
|
1075
1075
|
}
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1076
|
+
if (path8 && path8[0] !== "/") {
|
|
1077
|
+
path8 = `/${path8}`;
|
|
1078
1078
|
}
|
|
1079
|
-
return new URL(`${origin}${
|
|
1079
|
+
return new URL(`${origin}${path8}`);
|
|
1080
1080
|
}
|
|
1081
1081
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
1082
1082
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -1527,39 +1527,39 @@ var require_diagnostics = __commonJS({
|
|
|
1527
1527
|
});
|
|
1528
1528
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
|
1529
1529
|
const {
|
|
1530
|
-
request: { method, path:
|
|
1530
|
+
request: { method, path: path8, origin }
|
|
1531
1531
|
} = evt;
|
|
1532
|
-
debuglog("sending request to %s %s/%s", method, origin,
|
|
1532
|
+
debuglog("sending request to %s %s/%s", method, origin, path8);
|
|
1533
1533
|
});
|
|
1534
1534
|
diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => {
|
|
1535
1535
|
const {
|
|
1536
|
-
request: { method, path:
|
|
1536
|
+
request: { method, path: path8, origin },
|
|
1537
1537
|
response: { statusCode }
|
|
1538
1538
|
} = evt;
|
|
1539
1539
|
debuglog(
|
|
1540
1540
|
"received response to %s %s/%s - HTTP %d",
|
|
1541
1541
|
method,
|
|
1542
1542
|
origin,
|
|
1543
|
-
|
|
1543
|
+
path8,
|
|
1544
1544
|
statusCode
|
|
1545
1545
|
);
|
|
1546
1546
|
});
|
|
1547
1547
|
diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => {
|
|
1548
1548
|
const {
|
|
1549
|
-
request: { method, path:
|
|
1549
|
+
request: { method, path: path8, origin }
|
|
1550
1550
|
} = evt;
|
|
1551
|
-
debuglog("trailers received from %s %s/%s", method, origin,
|
|
1551
|
+
debuglog("trailers received from %s %s/%s", method, origin, path8);
|
|
1552
1552
|
});
|
|
1553
1553
|
diagnosticsChannel.channel("undici:request:error").subscribe((evt) => {
|
|
1554
1554
|
const {
|
|
1555
|
-
request: { method, path:
|
|
1555
|
+
request: { method, path: path8, origin },
|
|
1556
1556
|
error: error2
|
|
1557
1557
|
} = evt;
|
|
1558
1558
|
debuglog(
|
|
1559
1559
|
"request to %s %s/%s errored - %s",
|
|
1560
1560
|
method,
|
|
1561
1561
|
origin,
|
|
1562
|
-
|
|
1562
|
+
path8,
|
|
1563
1563
|
error2.message
|
|
1564
1564
|
);
|
|
1565
1565
|
});
|
|
@@ -1608,9 +1608,9 @@ var require_diagnostics = __commonJS({
|
|
|
1608
1608
|
});
|
|
1609
1609
|
diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => {
|
|
1610
1610
|
const {
|
|
1611
|
-
request: { method, path:
|
|
1611
|
+
request: { method, path: path8, origin }
|
|
1612
1612
|
} = evt;
|
|
1613
|
-
debuglog("sending request to %s %s/%s", method, origin,
|
|
1613
|
+
debuglog("sending request to %s %s/%s", method, origin, path8);
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => {
|
|
@@ -1673,7 +1673,7 @@ var require_request = __commonJS({
|
|
|
1673
1673
|
var kHandler = /* @__PURE__ */ Symbol("handler");
|
|
1674
1674
|
var Request = class {
|
|
1675
1675
|
constructor(origin, {
|
|
1676
|
-
path:
|
|
1676
|
+
path: path8,
|
|
1677
1677
|
method,
|
|
1678
1678
|
body,
|
|
1679
1679
|
headers,
|
|
@@ -1688,11 +1688,11 @@ var require_request = __commonJS({
|
|
|
1688
1688
|
expectContinue,
|
|
1689
1689
|
servername
|
|
1690
1690
|
}, handler) {
|
|
1691
|
-
if (typeof
|
|
1691
|
+
if (typeof path8 !== "string") {
|
|
1692
1692
|
throw new InvalidArgumentError("path must be a string");
|
|
1693
|
-
} else if (
|
|
1693
|
+
} else if (path8[0] !== "/" && !(path8.startsWith("http://") || path8.startsWith("https://")) && method !== "CONNECT") {
|
|
1694
1694
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
1695
|
-
} else if (invalidPathRegex.test(
|
|
1695
|
+
} else if (invalidPathRegex.test(path8)) {
|
|
1696
1696
|
throw new InvalidArgumentError("invalid request path");
|
|
1697
1697
|
}
|
|
1698
1698
|
if (typeof method !== "string") {
|
|
@@ -1758,7 +1758,7 @@ var require_request = __commonJS({
|
|
|
1758
1758
|
this.completed = false;
|
|
1759
1759
|
this.aborted = false;
|
|
1760
1760
|
this.upgrade = upgrade || null;
|
|
1761
|
-
this.path = query ? buildURL(
|
|
1761
|
+
this.path = query ? buildURL(path8, query) : path8;
|
|
1762
1762
|
this.origin = origin;
|
|
1763
1763
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
1764
1764
|
this.blocking = blocking == null ? false : blocking;
|
|
@@ -6322,7 +6322,7 @@ var require_client_h1 = __commonJS({
|
|
|
6322
6322
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
6323
6323
|
}
|
|
6324
6324
|
function writeH1(client, request) {
|
|
6325
|
-
const { method, path:
|
|
6325
|
+
const { method, path: path8, host, upgrade, blocking, reset } = request;
|
|
6326
6326
|
let { body, headers, contentLength } = request;
|
|
6327
6327
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
6328
6328
|
if (util.isFormDataLike(body)) {
|
|
@@ -6388,7 +6388,7 @@ var require_client_h1 = __commonJS({
|
|
|
6388
6388
|
if (blocking) {
|
|
6389
6389
|
socket[kBlocking] = true;
|
|
6390
6390
|
}
|
|
6391
|
-
let header = `${method} ${
|
|
6391
|
+
let header = `${method} ${path8} HTTP/1.1\r
|
|
6392
6392
|
`;
|
|
6393
6393
|
if (typeof host === "string") {
|
|
6394
6394
|
header += `host: ${host}\r
|
|
@@ -6914,7 +6914,7 @@ var require_client_h2 = __commonJS({
|
|
|
6914
6914
|
}
|
|
6915
6915
|
function writeH2(client, request) {
|
|
6916
6916
|
const session = client[kHTTP2Session];
|
|
6917
|
-
const { method, path:
|
|
6917
|
+
const { method, path: path8, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
|
|
6918
6918
|
let { body } = request;
|
|
6919
6919
|
if (upgrade) {
|
|
6920
6920
|
util.errorRequest(client, request, new Error("Upgrade not supported for H2"));
|
|
@@ -6981,7 +6981,7 @@ var require_client_h2 = __commonJS({
|
|
|
6981
6981
|
});
|
|
6982
6982
|
return true;
|
|
6983
6983
|
}
|
|
6984
|
-
headers[HTTP2_HEADER_PATH] =
|
|
6984
|
+
headers[HTTP2_HEADER_PATH] = path8;
|
|
6985
6985
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
6986
6986
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
6987
6987
|
if (body && typeof body.read === "function") {
|
|
@@ -7334,9 +7334,9 @@ var require_redirect_handler = __commonJS({
|
|
|
7334
7334
|
return this.handler.onHeaders(statusCode, headers, resume, statusText);
|
|
7335
7335
|
}
|
|
7336
7336
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
7337
|
-
const
|
|
7337
|
+
const path8 = search ? `${pathname}${search}` : pathname;
|
|
7338
7338
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
7339
|
-
this.opts.path =
|
|
7339
|
+
this.opts.path = path8;
|
|
7340
7340
|
this.opts.origin = origin;
|
|
7341
7341
|
this.opts.maxRedirections = 0;
|
|
7342
7342
|
this.opts.query = null;
|
|
@@ -8571,10 +8571,10 @@ var require_proxy_agent = __commonJS({
|
|
|
8571
8571
|
};
|
|
8572
8572
|
const {
|
|
8573
8573
|
origin,
|
|
8574
|
-
path:
|
|
8574
|
+
path: path8 = "/",
|
|
8575
8575
|
headers = {}
|
|
8576
8576
|
} = opts;
|
|
8577
|
-
opts.path = origin +
|
|
8577
|
+
opts.path = origin + path8;
|
|
8578
8578
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
8579
8579
|
const { host } = new URL3(origin);
|
|
8580
8580
|
headers.host = host;
|
|
@@ -10495,20 +10495,20 @@ var require_mock_utils = __commonJS({
|
|
|
10495
10495
|
}
|
|
10496
10496
|
return true;
|
|
10497
10497
|
}
|
|
10498
|
-
function safeUrl(
|
|
10499
|
-
if (typeof
|
|
10500
|
-
return
|
|
10498
|
+
function safeUrl(path8) {
|
|
10499
|
+
if (typeof path8 !== "string") {
|
|
10500
|
+
return path8;
|
|
10501
10501
|
}
|
|
10502
|
-
const pathSegments =
|
|
10502
|
+
const pathSegments = path8.split("?");
|
|
10503
10503
|
if (pathSegments.length !== 2) {
|
|
10504
|
-
return
|
|
10504
|
+
return path8;
|
|
10505
10505
|
}
|
|
10506
10506
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
10507
10507
|
qp.sort();
|
|
10508
10508
|
return [...pathSegments, qp.toString()].join("?");
|
|
10509
10509
|
}
|
|
10510
|
-
function matchKey(mockDispatch2, { path:
|
|
10511
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
10510
|
+
function matchKey(mockDispatch2, { path: path8, method, body, headers }) {
|
|
10511
|
+
const pathMatch = matchValue(mockDispatch2.path, path8);
|
|
10512
10512
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
10513
10513
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
10514
10514
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -10530,7 +10530,7 @@ var require_mock_utils = __commonJS({
|
|
|
10530
10530
|
function getMockDispatch(mockDispatches, key) {
|
|
10531
10531
|
const basePath = key.query ? buildURL(key.path, key.query) : key.path;
|
|
10532
10532
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
10533
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
10533
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path8 }) => matchValue(safeUrl(path8), resolvedPath));
|
|
10534
10534
|
if (matchedMockDispatches.length === 0) {
|
|
10535
10535
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
10536
10536
|
}
|
|
@@ -10568,9 +10568,9 @@ var require_mock_utils = __commonJS({
|
|
|
10568
10568
|
}
|
|
10569
10569
|
}
|
|
10570
10570
|
function buildKey(opts) {
|
|
10571
|
-
const { path:
|
|
10571
|
+
const { path: path8, method, body, headers, query } = opts;
|
|
10572
10572
|
return {
|
|
10573
|
-
path:
|
|
10573
|
+
path: path8,
|
|
10574
10574
|
method,
|
|
10575
10575
|
body,
|
|
10576
10576
|
headers,
|
|
@@ -11033,10 +11033,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
11033
11033
|
}
|
|
11034
11034
|
format(pendingInterceptors) {
|
|
11035
11035
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
11036
|
-
({ method, path:
|
|
11036
|
+
({ method, path: path8, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
11037
11037
|
Method: method,
|
|
11038
11038
|
Origin: origin,
|
|
11039
|
-
Path:
|
|
11039
|
+
Path: path8,
|
|
11040
11040
|
"Status code": statusCode,
|
|
11041
11041
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
11042
11042
|
Invocations: timesInvoked,
|
|
@@ -11888,9 +11888,9 @@ var require_headers = __commonJS({
|
|
|
11888
11888
|
return array;
|
|
11889
11889
|
}
|
|
11890
11890
|
const iterator = this[kHeadersMap][Symbol.iterator]();
|
|
11891
|
-
const
|
|
11892
|
-
array[0] = [
|
|
11893
|
-
assert(
|
|
11891
|
+
const firstValue2 = iterator.next().value;
|
|
11892
|
+
array[0] = [firstValue2[0], firstValue2[1].value];
|
|
11893
|
+
assert(firstValue2[1].value !== null);
|
|
11894
11894
|
for (let i = 1, j = 0, right = 0, left = 0, pivot = 0, x, value; i < size; ++i) {
|
|
11895
11895
|
value = iterator.next().value;
|
|
11896
11896
|
x = array[i] = [value[0], value[1].value];
|
|
@@ -15917,9 +15917,9 @@ var require_util6 = __commonJS({
|
|
|
15917
15917
|
}
|
|
15918
15918
|
}
|
|
15919
15919
|
}
|
|
15920
|
-
function validateCookiePath(
|
|
15921
|
-
for (let i = 0; i <
|
|
15922
|
-
const code =
|
|
15920
|
+
function validateCookiePath(path8) {
|
|
15921
|
+
for (let i = 0; i < path8.length; ++i) {
|
|
15922
|
+
const code = path8.charCodeAt(i);
|
|
15923
15923
|
if (code < 32 || // exclude CTLs (0-31)
|
|
15924
15924
|
code === 127 || // DEL
|
|
15925
15925
|
code === 59) {
|
|
@@ -18596,11 +18596,11 @@ var require_undici = __commonJS({
|
|
|
18596
18596
|
if (typeof opts.path !== "string") {
|
|
18597
18597
|
throw new InvalidArgumentError("invalid opts.path");
|
|
18598
18598
|
}
|
|
18599
|
-
let
|
|
18599
|
+
let path8 = opts.path;
|
|
18600
18600
|
if (!opts.path.startsWith("/")) {
|
|
18601
|
-
|
|
18601
|
+
path8 = `/${path8}`;
|
|
18602
18602
|
}
|
|
18603
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
18603
|
+
url = new URL(util.parseOrigin(url).origin + path8);
|
|
18604
18604
|
} else {
|
|
18605
18605
|
if (!opts) {
|
|
18606
18606
|
opts = typeof url === "object" ? url : {};
|
|
@@ -18748,17 +18748,17 @@ var require_visit = __commonJS({
|
|
|
18748
18748
|
visit.BREAK = BREAK;
|
|
18749
18749
|
visit.SKIP = SKIP;
|
|
18750
18750
|
visit.REMOVE = REMOVE;
|
|
18751
|
-
function visit_(key, node, visitor,
|
|
18752
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
18751
|
+
function visit_(key, node, visitor, path8) {
|
|
18752
|
+
const ctrl = callVisitor(key, node, visitor, path8);
|
|
18753
18753
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
18754
|
-
replaceNode(key,
|
|
18755
|
-
return visit_(key, ctrl, visitor,
|
|
18754
|
+
replaceNode(key, path8, ctrl);
|
|
18755
|
+
return visit_(key, ctrl, visitor, path8);
|
|
18756
18756
|
}
|
|
18757
18757
|
if (typeof ctrl !== "symbol") {
|
|
18758
18758
|
if (identity.isCollection(node)) {
|
|
18759
|
-
|
|
18759
|
+
path8 = Object.freeze(path8.concat(node));
|
|
18760
18760
|
for (let i = 0; i < node.items.length; ++i) {
|
|
18761
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
18761
|
+
const ci = visit_(i, node.items[i], visitor, path8);
|
|
18762
18762
|
if (typeof ci === "number")
|
|
18763
18763
|
i = ci - 1;
|
|
18764
18764
|
else if (ci === BREAK)
|
|
@@ -18769,13 +18769,13 @@ var require_visit = __commonJS({
|
|
|
18769
18769
|
}
|
|
18770
18770
|
}
|
|
18771
18771
|
} else if (identity.isPair(node)) {
|
|
18772
|
-
|
|
18773
|
-
const ck = visit_("key", node.key, visitor,
|
|
18772
|
+
path8 = Object.freeze(path8.concat(node));
|
|
18773
|
+
const ck = visit_("key", node.key, visitor, path8);
|
|
18774
18774
|
if (ck === BREAK)
|
|
18775
18775
|
return BREAK;
|
|
18776
18776
|
else if (ck === REMOVE)
|
|
18777
18777
|
node.key = null;
|
|
18778
|
-
const cv = visit_("value", node.value, visitor,
|
|
18778
|
+
const cv = visit_("value", node.value, visitor, path8);
|
|
18779
18779
|
if (cv === BREAK)
|
|
18780
18780
|
return BREAK;
|
|
18781
18781
|
else if (cv === REMOVE)
|
|
@@ -18796,17 +18796,17 @@ var require_visit = __commonJS({
|
|
|
18796
18796
|
visitAsync.BREAK = BREAK;
|
|
18797
18797
|
visitAsync.SKIP = SKIP;
|
|
18798
18798
|
visitAsync.REMOVE = REMOVE;
|
|
18799
|
-
async function visitAsync_(key, node, visitor,
|
|
18800
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
18799
|
+
async function visitAsync_(key, node, visitor, path8) {
|
|
18800
|
+
const ctrl = await callVisitor(key, node, visitor, path8);
|
|
18801
18801
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
18802
|
-
replaceNode(key,
|
|
18803
|
-
return visitAsync_(key, ctrl, visitor,
|
|
18802
|
+
replaceNode(key, path8, ctrl);
|
|
18803
|
+
return visitAsync_(key, ctrl, visitor, path8);
|
|
18804
18804
|
}
|
|
18805
18805
|
if (typeof ctrl !== "symbol") {
|
|
18806
18806
|
if (identity.isCollection(node)) {
|
|
18807
|
-
|
|
18807
|
+
path8 = Object.freeze(path8.concat(node));
|
|
18808
18808
|
for (let i = 0; i < node.items.length; ++i) {
|
|
18809
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
18809
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path8);
|
|
18810
18810
|
if (typeof ci === "number")
|
|
18811
18811
|
i = ci - 1;
|
|
18812
18812
|
else if (ci === BREAK)
|
|
@@ -18817,13 +18817,13 @@ var require_visit = __commonJS({
|
|
|
18817
18817
|
}
|
|
18818
18818
|
}
|
|
18819
18819
|
} else if (identity.isPair(node)) {
|
|
18820
|
-
|
|
18821
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
18820
|
+
path8 = Object.freeze(path8.concat(node));
|
|
18821
|
+
const ck = await visitAsync_("key", node.key, visitor, path8);
|
|
18822
18822
|
if (ck === BREAK)
|
|
18823
18823
|
return BREAK;
|
|
18824
18824
|
else if (ck === REMOVE)
|
|
18825
18825
|
node.key = null;
|
|
18826
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
18826
|
+
const cv = await visitAsync_("value", node.value, visitor, path8);
|
|
18827
18827
|
if (cv === BREAK)
|
|
18828
18828
|
return BREAK;
|
|
18829
18829
|
else if (cv === REMOVE)
|
|
@@ -18850,23 +18850,23 @@ var require_visit = __commonJS({
|
|
|
18850
18850
|
}
|
|
18851
18851
|
return visitor;
|
|
18852
18852
|
}
|
|
18853
|
-
function callVisitor(key, node, visitor,
|
|
18853
|
+
function callVisitor(key, node, visitor, path8) {
|
|
18854
18854
|
if (typeof visitor === "function")
|
|
18855
|
-
return visitor(key, node,
|
|
18855
|
+
return visitor(key, node, path8);
|
|
18856
18856
|
if (identity.isMap(node))
|
|
18857
|
-
return visitor.Map?.(key, node,
|
|
18857
|
+
return visitor.Map?.(key, node, path8);
|
|
18858
18858
|
if (identity.isSeq(node))
|
|
18859
|
-
return visitor.Seq?.(key, node,
|
|
18859
|
+
return visitor.Seq?.(key, node, path8);
|
|
18860
18860
|
if (identity.isPair(node))
|
|
18861
|
-
return visitor.Pair?.(key, node,
|
|
18861
|
+
return visitor.Pair?.(key, node, path8);
|
|
18862
18862
|
if (identity.isScalar(node))
|
|
18863
|
-
return visitor.Scalar?.(key, node,
|
|
18863
|
+
return visitor.Scalar?.(key, node, path8);
|
|
18864
18864
|
if (identity.isAlias(node))
|
|
18865
|
-
return visitor.Alias?.(key, node,
|
|
18865
|
+
return visitor.Alias?.(key, node, path8);
|
|
18866
18866
|
return void 0;
|
|
18867
18867
|
}
|
|
18868
|
-
function replaceNode(key,
|
|
18869
|
-
const parent =
|
|
18868
|
+
function replaceNode(key, path8, node) {
|
|
18869
|
+
const parent = path8[path8.length - 1];
|
|
18870
18870
|
if (identity.isCollection(parent)) {
|
|
18871
18871
|
parent.items[key] = node;
|
|
18872
18872
|
} else if (identity.isPair(parent)) {
|
|
@@ -19476,10 +19476,10 @@ var require_Collection = __commonJS({
|
|
|
19476
19476
|
var createNode = require_createNode();
|
|
19477
19477
|
var identity = require_identity();
|
|
19478
19478
|
var Node = require_Node();
|
|
19479
|
-
function collectionFromPath(schema2,
|
|
19479
|
+
function collectionFromPath(schema2, path8, value) {
|
|
19480
19480
|
let v = value;
|
|
19481
|
-
for (let i =
|
|
19482
|
-
const k =
|
|
19481
|
+
for (let i = path8.length - 1; i >= 0; --i) {
|
|
19482
|
+
const k = path8[i];
|
|
19483
19483
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
19484
19484
|
const a = [];
|
|
19485
19485
|
a[k] = v;
|
|
@@ -19498,7 +19498,7 @@ var require_Collection = __commonJS({
|
|
|
19498
19498
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
19499
19499
|
});
|
|
19500
19500
|
}
|
|
19501
|
-
var isEmptyPath = (
|
|
19501
|
+
var isEmptyPath = (path8) => path8 == null || typeof path8 === "object" && !!path8[Symbol.iterator]().next().done;
|
|
19502
19502
|
var Collection = class extends Node.NodeBase {
|
|
19503
19503
|
constructor(type2, schema2) {
|
|
19504
19504
|
super(type2);
|
|
@@ -19528,11 +19528,11 @@ var require_Collection = __commonJS({
|
|
|
19528
19528
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
19529
19529
|
* that already exists in the map.
|
|
19530
19530
|
*/
|
|
19531
|
-
addIn(
|
|
19532
|
-
if (isEmptyPath(
|
|
19531
|
+
addIn(path8, value) {
|
|
19532
|
+
if (isEmptyPath(path8))
|
|
19533
19533
|
this.add(value);
|
|
19534
19534
|
else {
|
|
19535
|
-
const [key, ...rest] =
|
|
19535
|
+
const [key, ...rest] = path8;
|
|
19536
19536
|
const node = this.get(key, true);
|
|
19537
19537
|
if (identity.isCollection(node))
|
|
19538
19538
|
node.addIn(rest, value);
|
|
@@ -19546,8 +19546,8 @@ var require_Collection = __commonJS({
|
|
|
19546
19546
|
* Removes a value from the collection.
|
|
19547
19547
|
* @returns `true` if the item was found and removed.
|
|
19548
19548
|
*/
|
|
19549
|
-
deleteIn(
|
|
19550
|
-
const [key, ...rest] =
|
|
19549
|
+
deleteIn(path8) {
|
|
19550
|
+
const [key, ...rest] = path8;
|
|
19551
19551
|
if (rest.length === 0)
|
|
19552
19552
|
return this.delete(key);
|
|
19553
19553
|
const node = this.get(key, true);
|
|
@@ -19561,8 +19561,8 @@ var require_Collection = __commonJS({
|
|
|
19561
19561
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
19562
19562
|
* `true` (collections are always returned intact).
|
|
19563
19563
|
*/
|
|
19564
|
-
getIn(
|
|
19565
|
-
const [key, ...rest] =
|
|
19564
|
+
getIn(path8, keepScalar) {
|
|
19565
|
+
const [key, ...rest] = path8;
|
|
19566
19566
|
const node = this.get(key, true);
|
|
19567
19567
|
if (rest.length === 0)
|
|
19568
19568
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -19580,8 +19580,8 @@ var require_Collection = __commonJS({
|
|
|
19580
19580
|
/**
|
|
19581
19581
|
* Checks if the collection includes a value with the key `key`.
|
|
19582
19582
|
*/
|
|
19583
|
-
hasIn(
|
|
19584
|
-
const [key, ...rest] =
|
|
19583
|
+
hasIn(path8) {
|
|
19584
|
+
const [key, ...rest] = path8;
|
|
19585
19585
|
if (rest.length === 0)
|
|
19586
19586
|
return this.has(key);
|
|
19587
19587
|
const node = this.get(key, true);
|
|
@@ -19591,8 +19591,8 @@ var require_Collection = __commonJS({
|
|
|
19591
19591
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
19592
19592
|
* boolean to add/remove the item from the set.
|
|
19593
19593
|
*/
|
|
19594
|
-
setIn(
|
|
19595
|
-
const [key, ...rest] =
|
|
19594
|
+
setIn(path8, value) {
|
|
19595
|
+
const [key, ...rest] = path8;
|
|
19596
19596
|
if (rest.length === 0) {
|
|
19597
19597
|
this.set(key, value);
|
|
19598
19598
|
} else {
|
|
@@ -22107,9 +22107,9 @@ var require_Document = __commonJS({
|
|
|
22107
22107
|
this.contents.add(value);
|
|
22108
22108
|
}
|
|
22109
22109
|
/** Adds a value to the document. */
|
|
22110
|
-
addIn(
|
|
22110
|
+
addIn(path8, value) {
|
|
22111
22111
|
if (assertCollection(this.contents))
|
|
22112
|
-
this.contents.addIn(
|
|
22112
|
+
this.contents.addIn(path8, value);
|
|
22113
22113
|
}
|
|
22114
22114
|
/**
|
|
22115
22115
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -22184,14 +22184,14 @@ var require_Document = __commonJS({
|
|
|
22184
22184
|
* Removes a value from the document.
|
|
22185
22185
|
* @returns `true` if the item was found and removed.
|
|
22186
22186
|
*/
|
|
22187
|
-
deleteIn(
|
|
22188
|
-
if (Collection.isEmptyPath(
|
|
22187
|
+
deleteIn(path8) {
|
|
22188
|
+
if (Collection.isEmptyPath(path8)) {
|
|
22189
22189
|
if (this.contents == null)
|
|
22190
22190
|
return false;
|
|
22191
22191
|
this.contents = null;
|
|
22192
22192
|
return true;
|
|
22193
22193
|
}
|
|
22194
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
22194
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path8) : false;
|
|
22195
22195
|
}
|
|
22196
22196
|
/**
|
|
22197
22197
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -22206,10 +22206,10 @@ var require_Document = __commonJS({
|
|
|
22206
22206
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
22207
22207
|
* `true` (collections are always returned intact).
|
|
22208
22208
|
*/
|
|
22209
|
-
getIn(
|
|
22210
|
-
if (Collection.isEmptyPath(
|
|
22209
|
+
getIn(path8, keepScalar) {
|
|
22210
|
+
if (Collection.isEmptyPath(path8))
|
|
22211
22211
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
22212
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
22212
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path8, keepScalar) : void 0;
|
|
22213
22213
|
}
|
|
22214
22214
|
/**
|
|
22215
22215
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -22220,10 +22220,10 @@ var require_Document = __commonJS({
|
|
|
22220
22220
|
/**
|
|
22221
22221
|
* Checks if the document includes a value at `path`.
|
|
22222
22222
|
*/
|
|
22223
|
-
hasIn(
|
|
22224
|
-
if (Collection.isEmptyPath(
|
|
22223
|
+
hasIn(path8) {
|
|
22224
|
+
if (Collection.isEmptyPath(path8))
|
|
22225
22225
|
return this.contents !== void 0;
|
|
22226
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
22226
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path8) : false;
|
|
22227
22227
|
}
|
|
22228
22228
|
/**
|
|
22229
22229
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -22240,13 +22240,13 @@ var require_Document = __commonJS({
|
|
|
22240
22240
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
22241
22241
|
* boolean to add/remove the item from the set.
|
|
22242
22242
|
*/
|
|
22243
|
-
setIn(
|
|
22244
|
-
if (Collection.isEmptyPath(
|
|
22243
|
+
setIn(path8, value) {
|
|
22244
|
+
if (Collection.isEmptyPath(path8)) {
|
|
22245
22245
|
this.contents = value;
|
|
22246
22246
|
} else if (this.contents == null) {
|
|
22247
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
22247
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path8), value);
|
|
22248
22248
|
} else if (assertCollection(this.contents)) {
|
|
22249
|
-
this.contents.setIn(
|
|
22249
|
+
this.contents.setIn(path8, value);
|
|
22250
22250
|
}
|
|
22251
22251
|
}
|
|
22252
22252
|
/**
|
|
@@ -24206,9 +24206,9 @@ var require_cst_visit = __commonJS({
|
|
|
24206
24206
|
visit.BREAK = BREAK;
|
|
24207
24207
|
visit.SKIP = SKIP;
|
|
24208
24208
|
visit.REMOVE = REMOVE;
|
|
24209
|
-
visit.itemAtPath = (cst,
|
|
24209
|
+
visit.itemAtPath = (cst, path8) => {
|
|
24210
24210
|
let item = cst;
|
|
24211
|
-
for (const [field, index] of
|
|
24211
|
+
for (const [field, index] of path8) {
|
|
24212
24212
|
const tok = item?.[field];
|
|
24213
24213
|
if (tok && "items" in tok) {
|
|
24214
24214
|
item = tok.items[index];
|
|
@@ -24217,23 +24217,23 @@ var require_cst_visit = __commonJS({
|
|
|
24217
24217
|
}
|
|
24218
24218
|
return item;
|
|
24219
24219
|
};
|
|
24220
|
-
visit.parentCollection = (cst,
|
|
24221
|
-
const parent = visit.itemAtPath(cst,
|
|
24222
|
-
const field =
|
|
24220
|
+
visit.parentCollection = (cst, path8) => {
|
|
24221
|
+
const parent = visit.itemAtPath(cst, path8.slice(0, -1));
|
|
24222
|
+
const field = path8[path8.length - 1][0];
|
|
24223
24223
|
const coll = parent?.[field];
|
|
24224
24224
|
if (coll && "items" in coll)
|
|
24225
24225
|
return coll;
|
|
24226
24226
|
throw new Error("Parent collection not found");
|
|
24227
24227
|
};
|
|
24228
|
-
function _visit(
|
|
24229
|
-
let ctrl = visitor(item,
|
|
24228
|
+
function _visit(path8, item, visitor) {
|
|
24229
|
+
let ctrl = visitor(item, path8);
|
|
24230
24230
|
if (typeof ctrl === "symbol")
|
|
24231
24231
|
return ctrl;
|
|
24232
24232
|
for (const field of ["key", "value"]) {
|
|
24233
24233
|
const token = item[field];
|
|
24234
24234
|
if (token && "items" in token) {
|
|
24235
24235
|
for (let i = 0; i < token.items.length; ++i) {
|
|
24236
|
-
const ci = _visit(Object.freeze(
|
|
24236
|
+
const ci = _visit(Object.freeze(path8.concat([[field, i]])), token.items[i], visitor);
|
|
24237
24237
|
if (typeof ci === "number")
|
|
24238
24238
|
i = ci - 1;
|
|
24239
24239
|
else if (ci === BREAK)
|
|
@@ -24244,10 +24244,10 @@ var require_cst_visit = __commonJS({
|
|
|
24244
24244
|
}
|
|
24245
24245
|
}
|
|
24246
24246
|
if (typeof ctrl === "function" && field === "key")
|
|
24247
|
-
ctrl = ctrl(item,
|
|
24247
|
+
ctrl = ctrl(item, path8);
|
|
24248
24248
|
}
|
|
24249
24249
|
}
|
|
24250
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
24250
|
+
return typeof ctrl === "function" ? ctrl(item, path8) : ctrl;
|
|
24251
24251
|
}
|
|
24252
24252
|
exports2.visit = visit;
|
|
24253
24253
|
}
|
|
@@ -26187,7 +26187,7 @@ var require_scope_functions = __commonJS({
|
|
|
26187
26187
|
var hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
26188
26188
|
hasOwn[/* @__PURE__ */ Symbol.for("toJayString")] = "Function.prototype.call.bind(Object.prototype.hasOwnProperty)";
|
|
26189
26189
|
var pointerPart = (s) => /~\//.test(s) ? `${s}`.replace(/~/g, "~0").replace(/\//g, "~1") : s;
|
|
26190
|
-
var toPointer = (
|
|
26190
|
+
var toPointer = (path8) => path8.length === 0 ? "#" : `#/${path8.map(pointerPart).join("/")}`;
|
|
26191
26191
|
var errorMerge = ({ keywordLocation, instanceLocation }, schemaBase, dataBase) => ({
|
|
26192
26192
|
keywordLocation: `${schemaBase}${keywordLocation.slice(1)}`,
|
|
26193
26193
|
instanceLocation: `${dataBase}${instanceLocation.slice(1)}`
|
|
@@ -26524,7 +26524,7 @@ var require_pointer = __commonJS({
|
|
|
26524
26524
|
throw new Error("Unreachable");
|
|
26525
26525
|
});
|
|
26526
26526
|
}
|
|
26527
|
-
function
|
|
26527
|
+
function get3(obj, pointer, objpath) {
|
|
26528
26528
|
if (typeof obj !== "object") throw new Error("Invalid input object");
|
|
26529
26529
|
if (typeof pointer !== "string") throw new Error("Invalid JSON pointer");
|
|
26530
26530
|
const parts = pointer.split("/");
|
|
@@ -26581,14 +26581,14 @@ var require_pointer = __commonJS({
|
|
|
26581
26581
|
const visit = (sub, oldPath, specialChilds = false, dynamic = false) => {
|
|
26582
26582
|
if (!sub || typeof sub !== "object") return;
|
|
26583
26583
|
const id = sub.$id || sub.id;
|
|
26584
|
-
let
|
|
26584
|
+
let path8 = oldPath;
|
|
26585
26585
|
if (id && typeof id === "string") {
|
|
26586
|
-
|
|
26587
|
-
if (
|
|
26586
|
+
path8 = joinPath(path8, id);
|
|
26587
|
+
if (path8 === ptr || path8 === main && local === "") {
|
|
26588
26588
|
results.push([sub, root, oldPath]);
|
|
26589
|
-
} else if (
|
|
26589
|
+
} else if (path8 === main && local[0] === "/") {
|
|
26590
26590
|
const objpath = [];
|
|
26591
|
-
const res =
|
|
26591
|
+
const res = get3(sub, local, objpath);
|
|
26592
26592
|
if (res !== void 0) results.push([res, root, joinPath(oldPath, objpath2path(objpath))]);
|
|
26593
26593
|
}
|
|
26594
26594
|
}
|
|
@@ -26596,20 +26596,20 @@ var require_pointer = __commonJS({
|
|
|
26596
26596
|
if (anchor && typeof anchor === "string") {
|
|
26597
26597
|
if (anchor.includes("#")) throw new Error("$anchor can't include '#'");
|
|
26598
26598
|
if (anchor.startsWith("/")) throw new Error("$anchor can't start with '/'");
|
|
26599
|
-
|
|
26600
|
-
if (
|
|
26599
|
+
path8 = joinPath(path8, `#${anchor}`);
|
|
26600
|
+
if (path8 === ptr) results.push([sub, root, oldPath]);
|
|
26601
26601
|
}
|
|
26602
26602
|
for (const k of Object.keys(sub)) {
|
|
26603
26603
|
if (!specialChilds && !Array.isArray(sub) && !knownKeywords.includes(k)) continue;
|
|
26604
26604
|
if (!specialChilds && skipChilds.includes(k)) continue;
|
|
26605
|
-
visit(sub[k],
|
|
26605
|
+
visit(sub[k], path8, !specialChilds && withSpecialChilds.includes(k));
|
|
26606
26606
|
}
|
|
26607
26607
|
if (!dynamic && sub.$dynamicAnchor) visit(sub, oldPath, specialChilds, true);
|
|
26608
26608
|
};
|
|
26609
26609
|
visit(root, main);
|
|
26610
26610
|
if (main === base.replace(/#$/, "") && (local[0] === "/" || local === "")) {
|
|
26611
26611
|
const objpath = [];
|
|
26612
|
-
const res =
|
|
26612
|
+
const res = get3(root, local, objpath);
|
|
26613
26613
|
if (res !== void 0) results.push([res, root, objpath2path(objpath)]);
|
|
26614
26614
|
}
|
|
26615
26615
|
if (schemas.has(main) && schemas.get(main) !== root) {
|
|
@@ -26662,7 +26662,7 @@ var require_pointer = __commonJS({
|
|
|
26662
26662
|
}
|
|
26663
26663
|
throw new Error("Unexpected value for 'schemas' option");
|
|
26664
26664
|
};
|
|
26665
|
-
module2.exports = { get:
|
|
26665
|
+
module2.exports = { get: get3, joinPath, resolveReference, getDynamicAnchors, hasKeywords, buildSchemas };
|
|
26666
26666
|
}
|
|
26667
26667
|
});
|
|
26668
26668
|
|
|
@@ -27048,14 +27048,14 @@ var require_compile = __commonJS({
|
|
|
27048
27048
|
}
|
|
27049
27049
|
const { gensym, getref, genref, genformat } = scopeMethods(scope);
|
|
27050
27050
|
const buildPath = (prop) => {
|
|
27051
|
-
const
|
|
27051
|
+
const path8 = [];
|
|
27052
27052
|
let curr = prop;
|
|
27053
27053
|
while (curr) {
|
|
27054
|
-
if (!curr.name)
|
|
27054
|
+
if (!curr.name) path8.unshift(curr);
|
|
27055
27055
|
curr = curr.parent || curr.errorParent;
|
|
27056
27056
|
}
|
|
27057
|
-
if (
|
|
27058
|
-
return format("%j", toPointer(
|
|
27057
|
+
if (path8.every((part) => part.keyval !== void 0))
|
|
27058
|
+
return format("%j", toPointer(path8.map((part) => part.keyval)));
|
|
27059
27059
|
const stringParts = ["#"];
|
|
27060
27060
|
const stringJoined = () => {
|
|
27061
27061
|
const value = stringParts.map(functions.pointerPart).join("/");
|
|
@@ -27063,7 +27063,7 @@ var require_compile = __commonJS({
|
|
|
27063
27063
|
return value;
|
|
27064
27064
|
};
|
|
27065
27065
|
let res = null;
|
|
27066
|
-
for (const { keyname, keyval, number } of
|
|
27066
|
+
for (const { keyname, keyval, number } of path8) {
|
|
27067
27067
|
if (keyname) {
|
|
27068
27068
|
if (!number) scope.pointerPart = functions.pointerPart;
|
|
27069
27069
|
const value = number ? keyname : format("pointerPart(%s)", keyname);
|
|
@@ -27109,8 +27109,8 @@ var require_compile = __commonJS({
|
|
|
27109
27109
|
const definitelyPresent = !current.parent || current.checked || current.inKeys && isJSON || queryCurrent().length > 0;
|
|
27110
27110
|
const name = buildName(current);
|
|
27111
27111
|
const currPropImm = (...args) => propimm(current, ...args);
|
|
27112
|
-
const error2 = ({ path:
|
|
27113
|
-
const schemaP = toPointer([...schemaPath, ...
|
|
27112
|
+
const error2 = ({ path: path8 = [], prop = current, source, suberr }) => {
|
|
27113
|
+
const schemaP = toPointer([...schemaPath, ...path8]);
|
|
27114
27114
|
const dataP = includeErrors ? buildPath(prop) : null;
|
|
27115
27115
|
if (includeErrors === true && errors && source) {
|
|
27116
27116
|
scope.errorMerge = functions.errorMerge;
|
|
@@ -27182,7 +27182,7 @@ var require_compile = __commonJS({
|
|
|
27182
27182
|
enforce(ruleTypes.some((t) => schemaTypes.get(t)(node[prop])), "Unexpected type for", prop);
|
|
27183
27183
|
unused.delete(prop);
|
|
27184
27184
|
};
|
|
27185
|
-
const
|
|
27185
|
+
const get3 = (prop, ...ruleTypes) => {
|
|
27186
27186
|
if (node[prop] !== void 0) consume(prop, ...ruleTypes);
|
|
27187
27187
|
return node[prop];
|
|
27188
27188
|
};
|
|
@@ -27204,7 +27204,7 @@ var require_compile = __commonJS({
|
|
|
27204
27204
|
return true;
|
|
27205
27205
|
};
|
|
27206
27206
|
if (node === root) {
|
|
27207
|
-
saveMeta(
|
|
27207
|
+
saveMeta(get3("$schema", "string"));
|
|
27208
27208
|
handle("$vocabulary", ["object"], ($vocabulary) => {
|
|
27209
27209
|
for (const [vocab, flag] of Object.entries($vocabulary)) {
|
|
27210
27210
|
if (flag === false) continue;
|
|
@@ -27221,7 +27221,7 @@ var require_compile = __commonJS({
|
|
|
27221
27221
|
for (const ignore of ["title", "description", "$comment"]) handle(ignore, ["string"], null);
|
|
27222
27222
|
for (const ignore of ["deprecated", "readOnly", "writeOnly"]) handle(ignore, ["boolean"], null);
|
|
27223
27223
|
handle("$defs", ["object"], null) || handle("definitions", ["object"], null);
|
|
27224
|
-
const compileSub = (sub, subR,
|
|
27224
|
+
const compileSub = (sub, subR, path8) => sub === schema2 ? safe("validate") : getref(sub) || compileSchema(sub, subR, opts, scope, path8);
|
|
27225
27225
|
const basePath = () => basePathStack.length > 0 ? basePathStack[basePathStack.length - 1] : "";
|
|
27226
27226
|
const basePathStackLength = basePathStack.length;
|
|
27227
27227
|
const setId = ($id) => {
|
|
@@ -27245,9 +27245,9 @@ var require_compile = __commonJS({
|
|
|
27245
27245
|
if (node !== schema2) fun.write("dynLocal.unshift({})");
|
|
27246
27246
|
for (const [key, subcheck] of allDynamic) {
|
|
27247
27247
|
const resolved = resolveReference(root, schemas, `#${key}`, basePath());
|
|
27248
|
-
const [sub, subRoot,
|
|
27248
|
+
const [sub, subRoot, path8] = resolved[0] || [];
|
|
27249
27249
|
enforce(sub === subcheck, `Unexpected $dynamicAnchor resolution: ${key}`);
|
|
27250
|
-
const n = compileSub(sub, subRoot,
|
|
27250
|
+
const n = compileSub(sub, subRoot, path8);
|
|
27251
27251
|
fun.write("dynLocal[0][%j] = %s", `#${key}`, n);
|
|
27252
27252
|
}
|
|
27253
27253
|
}
|
|
@@ -27953,12 +27953,12 @@ var require_compile = __commonJS({
|
|
|
27953
27953
|
if (local2.props) fun.write("const %s = [[], []]", local2.props);
|
|
27954
27954
|
handle("$ref", ["string"], ($ref) => {
|
|
27955
27955
|
const resolved = resolveReference(root, schemas, $ref, basePath());
|
|
27956
|
-
const [sub, subRoot,
|
|
27956
|
+
const [sub, subRoot, path8] = resolved[0] || [];
|
|
27957
27957
|
if (!sub && sub !== false) {
|
|
27958
27958
|
fail2("failed to resolve $ref:", $ref);
|
|
27959
27959
|
if (lintOnly) return null;
|
|
27960
27960
|
}
|
|
27961
|
-
const n = compileSub(sub, subRoot,
|
|
27961
|
+
const n = compileSub(sub, subRoot, path8);
|
|
27962
27962
|
const rn = sub === schema2 ? funname : n;
|
|
27963
27963
|
if (!scope[rn]) throw new Error("Unexpected: coherence check failed");
|
|
27964
27964
|
if (!scope[rn][evaluatedStatic] && sub.type) {
|
|
@@ -27984,9 +27984,9 @@ var require_compile = __commonJS({
|
|
|
27984
27984
|
if (!opts[optRecAnchors]) throw new Error("[opt] Recursive anchors are not enabled");
|
|
27985
27985
|
enforce($recursiveRef === "#", 'Behavior of $recursiveRef is defined only for "#"');
|
|
27986
27986
|
const resolved = resolveReference(root, schemas, "#", basePath());
|
|
27987
|
-
const [sub, subRoot,
|
|
27987
|
+
const [sub, subRoot, path8] = resolved[0];
|
|
27988
27988
|
laxMode(sub.$recursiveAnchor, "$recursiveRef without $recursiveAnchor");
|
|
27989
|
-
const n = compileSub(sub, subRoot,
|
|
27989
|
+
const n = compileSub(sub, subRoot, path8);
|
|
27990
27990
|
const nrec = sub.$recursiveAnchor ? format("(recursive || %s)", n) : n;
|
|
27991
27991
|
return applyRef(nrec, { path: ["$recursiveRef"] });
|
|
27992
27992
|
});
|
|
@@ -28002,10 +28002,10 @@ var require_compile = __commonJS({
|
|
|
28002
28002
|
return applyRef(nrec2, { path: ["$dynamicRef"] });
|
|
28003
28003
|
}
|
|
28004
28004
|
enforce(resolved[0], "$dynamicRef bookending resolution failed", $dynamicRef);
|
|
28005
|
-
const [sub, subRoot,
|
|
28005
|
+
const [sub, subRoot, path8] = resolved[0];
|
|
28006
28006
|
const ok2 = sub.$dynamicAnchor && `#${sub.$dynamicAnchor}` === dynamicTail;
|
|
28007
28007
|
laxMode(ok2, "$dynamicRef without $dynamicAnchor in the same scope");
|
|
28008
|
-
const n = compileSub(sub, subRoot,
|
|
28008
|
+
const n = compileSub(sub, subRoot, path8);
|
|
28009
28009
|
scope.dynamicResolve = functions.dynamicResolve;
|
|
28010
28010
|
const nrec = ok2 ? format("(dynamicResolve(dynAnchors || [], %j) || %s)", dynamicTail, n) : n;
|
|
28011
28011
|
return applyRef(nrec, { path: ["$dynamicRef"] });
|
|
@@ -28036,7 +28036,7 @@ var require_compile = __commonJS({
|
|
|
28036
28036
|
};
|
|
28037
28037
|
if (node.default !== void 0 && useDefaults) {
|
|
28038
28038
|
if (definitelyPresent) fail2("Can not apply default value here (e.g. at root)");
|
|
28039
|
-
const defvalue =
|
|
28039
|
+
const defvalue = get3("default", "jsonval");
|
|
28040
28040
|
fun.if(present(current), writeMain, () => fun.write("%s = %j", name, defvalue));
|
|
28041
28041
|
} else {
|
|
28042
28042
|
handle("default", ["jsonval"], null);
|
|
@@ -28340,59 +28340,59 @@ var require_url = __commonJS({
|
|
|
28340
28340
|
return href;
|
|
28341
28341
|
}
|
|
28342
28342
|
if (typeof process !== "undefined" && process.cwd) {
|
|
28343
|
-
const
|
|
28344
|
-
const lastChar =
|
|
28343
|
+
const path8 = process.cwd();
|
|
28344
|
+
const lastChar = path8.slice(-1);
|
|
28345
28345
|
if (lastChar === "/" || lastChar === "\\") {
|
|
28346
|
-
return
|
|
28346
|
+
return path8;
|
|
28347
28347
|
} else {
|
|
28348
|
-
return
|
|
28348
|
+
return path8 + "/";
|
|
28349
28349
|
}
|
|
28350
28350
|
}
|
|
28351
28351
|
return "/";
|
|
28352
28352
|
}
|
|
28353
|
-
function getProtocol2(
|
|
28354
|
-
const match = protocolPattern2.exec(
|
|
28353
|
+
function getProtocol2(path8) {
|
|
28354
|
+
const match = protocolPattern2.exec(path8 || "");
|
|
28355
28355
|
if (match) {
|
|
28356
28356
|
return match[1].toLowerCase();
|
|
28357
28357
|
}
|
|
28358
28358
|
return void 0;
|
|
28359
28359
|
}
|
|
28360
|
-
function getExtension2(
|
|
28361
|
-
const lastDot =
|
|
28360
|
+
function getExtension2(path8) {
|
|
28361
|
+
const lastDot = path8.lastIndexOf(".");
|
|
28362
28362
|
if (lastDot >= 0) {
|
|
28363
|
-
return stripQuery2(
|
|
28363
|
+
return stripQuery2(path8.substring(lastDot).toLowerCase());
|
|
28364
28364
|
}
|
|
28365
28365
|
return "";
|
|
28366
28366
|
}
|
|
28367
|
-
function stripQuery2(
|
|
28368
|
-
const queryIndex =
|
|
28367
|
+
function stripQuery2(path8) {
|
|
28368
|
+
const queryIndex = path8.indexOf("?");
|
|
28369
28369
|
if (queryIndex >= 0) {
|
|
28370
|
-
|
|
28370
|
+
path8 = path8.substring(0, queryIndex);
|
|
28371
28371
|
}
|
|
28372
|
-
return
|
|
28372
|
+
return path8;
|
|
28373
28373
|
}
|
|
28374
|
-
function getHash2(
|
|
28375
|
-
if (!
|
|
28374
|
+
function getHash2(path8) {
|
|
28375
|
+
if (!path8) {
|
|
28376
28376
|
return "#";
|
|
28377
28377
|
}
|
|
28378
|
-
const hashIndex =
|
|
28378
|
+
const hashIndex = path8.indexOf("#");
|
|
28379
28379
|
if (hashIndex >= 0) {
|
|
28380
|
-
return
|
|
28380
|
+
return path8.substring(hashIndex);
|
|
28381
28381
|
}
|
|
28382
28382
|
return "#";
|
|
28383
28383
|
}
|
|
28384
|
-
function stripHash2(
|
|
28385
|
-
if (!
|
|
28384
|
+
function stripHash2(path8) {
|
|
28385
|
+
if (!path8) {
|
|
28386
28386
|
return "";
|
|
28387
28387
|
}
|
|
28388
|
-
const hashIndex =
|
|
28388
|
+
const hashIndex = path8.indexOf("#");
|
|
28389
28389
|
if (hashIndex >= 0) {
|
|
28390
|
-
|
|
28390
|
+
path8 = path8.substring(0, hashIndex);
|
|
28391
28391
|
}
|
|
28392
|
-
return
|
|
28392
|
+
return path8;
|
|
28393
28393
|
}
|
|
28394
|
-
function isHttp2(
|
|
28395
|
-
const protocol = getProtocol2(
|
|
28394
|
+
function isHttp2(path8) {
|
|
28395
|
+
const protocol = getProtocol2(path8);
|
|
28396
28396
|
if (protocol === "http" || protocol === "https") {
|
|
28397
28397
|
return true;
|
|
28398
28398
|
} else if (protocol === void 0) {
|
|
@@ -28401,11 +28401,11 @@ var require_url = __commonJS({
|
|
|
28401
28401
|
return false;
|
|
28402
28402
|
}
|
|
28403
28403
|
}
|
|
28404
|
-
function isUnsafeUrl2(
|
|
28405
|
-
if (!
|
|
28404
|
+
function isUnsafeUrl2(path8) {
|
|
28405
|
+
if (!path8 || typeof path8 !== "string") {
|
|
28406
28406
|
return true;
|
|
28407
28407
|
}
|
|
28408
|
-
const normalizedPath =
|
|
28408
|
+
const normalizedPath = path8.trim().toLowerCase();
|
|
28409
28409
|
if (!normalizedPath) {
|
|
28410
28410
|
return true;
|
|
28411
28411
|
}
|
|
@@ -28536,58 +28536,58 @@ var require_url = __commonJS({
|
|
|
28536
28536
|
];
|
|
28537
28537
|
return internalPorts.includes(port);
|
|
28538
28538
|
}
|
|
28539
|
-
function isFileSystemPath2(
|
|
28539
|
+
function isFileSystemPath2(path8) {
|
|
28540
28540
|
if (typeof window !== "undefined" || typeof process !== "undefined" && process.browser) {
|
|
28541
28541
|
return false;
|
|
28542
28542
|
}
|
|
28543
|
-
const protocol = getProtocol2(
|
|
28543
|
+
const protocol = getProtocol2(path8);
|
|
28544
28544
|
return protocol === void 0 || protocol === "file";
|
|
28545
28545
|
}
|
|
28546
|
-
function fromFileSystemPath2(
|
|
28546
|
+
function fromFileSystemPath2(path8) {
|
|
28547
28547
|
if ((0, is_windows_1.isWindows)()) {
|
|
28548
28548
|
const projectDir = cwd2();
|
|
28549
|
-
const upperPath =
|
|
28549
|
+
const upperPath = path8.toUpperCase();
|
|
28550
28550
|
const projectDirPosixPath = (0, convert_path_to_posix_1.default)(projectDir);
|
|
28551
28551
|
const posixUpper = projectDirPosixPath.toUpperCase();
|
|
28552
28552
|
const hasProjectDir = upperPath.includes(posixUpper);
|
|
28553
28553
|
const hasProjectUri = upperPath.includes(posixUpper);
|
|
28554
|
-
const isAbsolutePath = path_1.win32?.isAbsolute(
|
|
28554
|
+
const isAbsolutePath = path_1.win32?.isAbsolute(path8) || path8.startsWith("http://") || path8.startsWith("https://") || path8.startsWith("file://");
|
|
28555
28555
|
if (!(hasProjectDir || hasProjectUri || isAbsolutePath) && !projectDir.startsWith("http")) {
|
|
28556
|
-
|
|
28556
|
+
path8 = (0, path_2.join)(projectDir, path8);
|
|
28557
28557
|
}
|
|
28558
|
-
|
|
28558
|
+
path8 = (0, convert_path_to_posix_1.default)(path8);
|
|
28559
28559
|
}
|
|
28560
|
-
|
|
28560
|
+
path8 = encodeURI(path8);
|
|
28561
28561
|
for (const pattern of urlEncodePatterns2) {
|
|
28562
|
-
|
|
28562
|
+
path8 = path8.replace(pattern[0], pattern[1]);
|
|
28563
28563
|
}
|
|
28564
|
-
return
|
|
28564
|
+
return path8;
|
|
28565
28565
|
}
|
|
28566
|
-
function toFileSystemPath2(
|
|
28567
|
-
|
|
28566
|
+
function toFileSystemPath2(path8, keepFileProtocol) {
|
|
28567
|
+
path8 = decodeURI(path8);
|
|
28568
28568
|
for (let i = 0; i < urlDecodePatterns2.length; i += 2) {
|
|
28569
|
-
|
|
28569
|
+
path8 = path8.replace(urlDecodePatterns2[i], urlDecodePatterns2[i + 1]);
|
|
28570
28570
|
}
|
|
28571
|
-
let isFileUrl =
|
|
28571
|
+
let isFileUrl = path8.toLowerCase().startsWith("file://");
|
|
28572
28572
|
if (isFileUrl) {
|
|
28573
|
-
|
|
28574
|
-
if ((0, is_windows_1.isWindows)() &&
|
|
28575
|
-
|
|
28573
|
+
path8 = path8.replace(/^file:\/\//, "").replace(/^\//, "");
|
|
28574
|
+
if ((0, is_windows_1.isWindows)() && path8[1] === "/") {
|
|
28575
|
+
path8 = `${path8[0]}:${path8.substring(1)}`;
|
|
28576
28576
|
}
|
|
28577
28577
|
if (keepFileProtocol) {
|
|
28578
|
-
|
|
28578
|
+
path8 = "file:///" + path8;
|
|
28579
28579
|
} else {
|
|
28580
28580
|
isFileUrl = false;
|
|
28581
|
-
|
|
28581
|
+
path8 = (0, is_windows_1.isWindows)() ? path8 : "/" + path8;
|
|
28582
28582
|
}
|
|
28583
28583
|
}
|
|
28584
28584
|
if ((0, is_windows_1.isWindows)() && !isFileUrl) {
|
|
28585
|
-
|
|
28586
|
-
if (
|
|
28587
|
-
|
|
28585
|
+
path8 = path8.replace(forwardSlashPattern2, "\\");
|
|
28586
|
+
if (path8.match(/^[a-z]:\\/i)) {
|
|
28587
|
+
path8 = path8[0].toUpperCase() + path8.substring(1);
|
|
28588
28588
|
}
|
|
28589
28589
|
}
|
|
28590
|
-
return
|
|
28590
|
+
return path8;
|
|
28591
28591
|
}
|
|
28592
28592
|
function safePointerToPath2(pointer) {
|
|
28593
28593
|
if (pointer.length <= 1 || pointer[0] !== "#" || pointer[1] !== "/") {
|
|
@@ -28735,8 +28735,8 @@ var require_errors3 = __commonJS({
|
|
|
28735
28735
|
targetRef;
|
|
28736
28736
|
targetFound;
|
|
28737
28737
|
parentPath;
|
|
28738
|
-
constructor(token,
|
|
28739
|
-
super(`Missing $ref pointer "${(0, url_js_1.getHash)(
|
|
28738
|
+
constructor(token, path8, targetRef, targetFound, parentPath) {
|
|
28739
|
+
super(`Missing $ref pointer "${(0, url_js_1.getHash)(path8)}". Token "${token}" does not exist.`, (0, url_js_1.stripHash)(path8));
|
|
28740
28740
|
this.targetToken = token;
|
|
28741
28741
|
this.targetRef = targetRef;
|
|
28742
28742
|
this.targetFound = targetFound;
|
|
@@ -28755,8 +28755,8 @@ var require_errors3 = __commonJS({
|
|
|
28755
28755
|
var InvalidPointerError2 = class extends JSONParserError2 {
|
|
28756
28756
|
code = "EUNMATCHEDRESOLVER";
|
|
28757
28757
|
name = "InvalidPointerError";
|
|
28758
|
-
constructor(pointer,
|
|
28759
|
-
super(`Invalid $ref pointer "${pointer}". Pointers must begin with "#/"`, (0, url_js_1.stripHash)(
|
|
28758
|
+
constructor(pointer, path8) {
|
|
28759
|
+
super(`Invalid $ref pointer "${pointer}". Pointers must begin with "#/"`, (0, url_js_1.stripHash)(path8));
|
|
28760
28760
|
}
|
|
28761
28761
|
};
|
|
28762
28762
|
exports2.InvalidPointerError = InvalidPointerError2;
|
|
@@ -28861,10 +28861,10 @@ var require_pointer2 = __commonJS({
|
|
|
28861
28861
|
* Resolving a single pointer may require resolving multiple $Refs.
|
|
28862
28862
|
*/
|
|
28863
28863
|
indirections;
|
|
28864
|
-
constructor($ref,
|
|
28864
|
+
constructor($ref, path8, friendlyPath) {
|
|
28865
28865
|
this.$ref = $ref;
|
|
28866
|
-
this.path =
|
|
28867
|
-
this.originalPath = friendlyPath ||
|
|
28866
|
+
this.path = path8;
|
|
28867
|
+
this.originalPath = friendlyPath || path8;
|
|
28868
28868
|
this.value = void 0;
|
|
28869
28869
|
this.circular = false;
|
|
28870
28870
|
this.indirections = 0;
|
|
@@ -28910,10 +28910,10 @@ var require_pointer2 = __commonJS({
|
|
|
28910
28910
|
continue;
|
|
28911
28911
|
}
|
|
28912
28912
|
this.value = null;
|
|
28913
|
-
const
|
|
28914
|
-
const targetRef = this.path.replace(
|
|
28913
|
+
const path8 = this.$ref.path || "";
|
|
28914
|
+
const targetRef = this.path.replace(path8, "");
|
|
28915
28915
|
const targetFound = _Pointer.join("", found);
|
|
28916
|
-
const parentPath = pathFromRoot?.replace(
|
|
28916
|
+
const parentPath = pathFromRoot?.replace(path8, "");
|
|
28917
28917
|
throw new errors_js_1.MissingPointerError(token, decodeURI(this.originalPath), targetRef, targetFound, parentPath);
|
|
28918
28918
|
} else {
|
|
28919
28919
|
this.value = this.value[token];
|
|
@@ -28969,8 +28969,8 @@ var require_pointer2 = __commonJS({
|
|
|
28969
28969
|
* @param [originalPath]
|
|
28970
28970
|
* @returns
|
|
28971
28971
|
*/
|
|
28972
|
-
static parse(
|
|
28973
|
-
const pointer = url.getHash(
|
|
28972
|
+
static parse(path8, originalPath) {
|
|
28973
|
+
const pointer = url.getHash(path8).substring(1);
|
|
28974
28974
|
if (!pointer) {
|
|
28975
28975
|
return [];
|
|
28976
28976
|
}
|
|
@@ -28979,7 +28979,7 @@ var require_pointer2 = __commonJS({
|
|
|
28979
28979
|
split[i] = safeDecodeURIComponent(split[i].replace(escapedSlash2, "/").replace(escapedTilde2, "~"));
|
|
28980
28980
|
}
|
|
28981
28981
|
if (split[0] !== "") {
|
|
28982
|
-
throw new errors_js_1.InvalidPointerError(pointer, originalPath === void 0 ?
|
|
28982
|
+
throw new errors_js_1.InvalidPointerError(pointer, originalPath === void 0 ? path8 : originalPath);
|
|
28983
28983
|
}
|
|
28984
28984
|
return split.slice(1);
|
|
28985
28985
|
}
|
|
@@ -29157,9 +29157,9 @@ var require_ref = __commonJS({
|
|
|
29157
29157
|
* @param options
|
|
29158
29158
|
* @returns
|
|
29159
29159
|
*/
|
|
29160
|
-
exists(
|
|
29160
|
+
exists(path8, options) {
|
|
29161
29161
|
try {
|
|
29162
|
-
this.resolve(
|
|
29162
|
+
this.resolve(path8, options);
|
|
29163
29163
|
return true;
|
|
29164
29164
|
} catch {
|
|
29165
29165
|
return false;
|
|
@@ -29172,8 +29172,8 @@ var require_ref = __commonJS({
|
|
|
29172
29172
|
* @param options
|
|
29173
29173
|
* @returns - Returns the resolved value
|
|
29174
29174
|
*/
|
|
29175
|
-
get(
|
|
29176
|
-
return this.resolve(
|
|
29175
|
+
get(path8, options) {
|
|
29176
|
+
return this.resolve(path8, options)?.value;
|
|
29177
29177
|
}
|
|
29178
29178
|
/**
|
|
29179
29179
|
* Resolves the given JSON reference within this {@link $Ref#value}.
|
|
@@ -29184,8 +29184,8 @@ var require_ref = __commonJS({
|
|
|
29184
29184
|
* @param pathFromRoot - The path of `obj` from the schema root
|
|
29185
29185
|
* @returns
|
|
29186
29186
|
*/
|
|
29187
|
-
resolve(
|
|
29188
|
-
const pointer = new pointer_js_1.default(this,
|
|
29187
|
+
resolve(path8, options, friendlyPath, pathFromRoot) {
|
|
29188
|
+
const pointer = new pointer_js_1.default(this, path8, friendlyPath);
|
|
29189
29189
|
try {
|
|
29190
29190
|
const resolved = pointer.resolve(this.value, options, pathFromRoot);
|
|
29191
29191
|
if (resolved.value === pointer_js_1.nullSymbol) {
|
|
@@ -29213,8 +29213,8 @@ var require_ref = __commonJS({
|
|
|
29213
29213
|
* @param path - The full path of the property to set, optionally with a JSON pointer in the hash
|
|
29214
29214
|
* @param value - The value to assign
|
|
29215
29215
|
*/
|
|
29216
|
-
set(
|
|
29217
|
-
const pointer = new pointer_js_1.default(this,
|
|
29216
|
+
set(path8, value) {
|
|
29217
|
+
const pointer = new pointer_js_1.default(this, path8);
|
|
29218
29218
|
this.value = pointer.set(this.value, value);
|
|
29219
29219
|
if (this.value === pointer_js_1.nullSymbol) {
|
|
29220
29220
|
this.value = null;
|
|
@@ -29411,8 +29411,8 @@ var require_refs = __commonJS({
|
|
|
29411
29411
|
*/
|
|
29412
29412
|
paths(...types2) {
|
|
29413
29413
|
const paths = getPaths2(this._$refs, types2.flat());
|
|
29414
|
-
return paths.map((
|
|
29415
|
-
return (0, convert_path_to_posix_1.default)(
|
|
29414
|
+
return paths.map((path8) => {
|
|
29415
|
+
return (0, convert_path_to_posix_1.default)(path8.decoded);
|
|
29416
29416
|
});
|
|
29417
29417
|
}
|
|
29418
29418
|
/**
|
|
@@ -29425,8 +29425,8 @@ var require_refs = __commonJS({
|
|
|
29425
29425
|
values(...types2) {
|
|
29426
29426
|
const $refs = this._$refs;
|
|
29427
29427
|
const paths = getPaths2($refs, types2.flat());
|
|
29428
|
-
return paths.reduce((obj,
|
|
29429
|
-
obj[(0, convert_path_to_posix_1.default)(
|
|
29428
|
+
return paths.reduce((obj, path8) => {
|
|
29429
|
+
obj[(0, convert_path_to_posix_1.default)(path8.decoded)] = $refs[path8.encoded].value;
|
|
29430
29430
|
return obj;
|
|
29431
29431
|
}, {});
|
|
29432
29432
|
}
|
|
@@ -29444,9 +29444,9 @@ var require_refs = __commonJS({
|
|
|
29444
29444
|
* @param [options]
|
|
29445
29445
|
* @returns
|
|
29446
29446
|
*/
|
|
29447
|
-
exists(
|
|
29447
|
+
exists(path8, options) {
|
|
29448
29448
|
try {
|
|
29449
|
-
this._resolve(
|
|
29449
|
+
this._resolve(path8, "", options);
|
|
29450
29450
|
return true;
|
|
29451
29451
|
} catch {
|
|
29452
29452
|
return false;
|
|
@@ -29459,8 +29459,8 @@ var require_refs = __commonJS({
|
|
|
29459
29459
|
* @param [options]
|
|
29460
29460
|
* @returns - Returns the resolved value
|
|
29461
29461
|
*/
|
|
29462
|
-
get(
|
|
29463
|
-
return this._resolve(
|
|
29462
|
+
get(path8, options) {
|
|
29463
|
+
return this._resolve(path8, "", options).value;
|
|
29464
29464
|
}
|
|
29465
29465
|
/**
|
|
29466
29466
|
* Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created.
|
|
@@ -29468,12 +29468,12 @@ var require_refs = __commonJS({
|
|
|
29468
29468
|
* @param path The JSON Reference path, optionally with a JSON Pointer in the hash
|
|
29469
29469
|
* @param value The value to assign. Can be anything (object, string, number, etc.)
|
|
29470
29470
|
*/
|
|
29471
|
-
set(
|
|
29472
|
-
const absPath = url.resolve(this._root$Ref.path,
|
|
29471
|
+
set(path8, value) {
|
|
29472
|
+
const absPath = url.resolve(this._root$Ref.path, path8);
|
|
29473
29473
|
const withoutHash = url.stripHash(absPath);
|
|
29474
29474
|
const $ref = this._$refs[withoutHash];
|
|
29475
29475
|
if (!$ref) {
|
|
29476
|
-
throw new Error(`Error resolving $ref pointer "${
|
|
29476
|
+
throw new Error(`Error resolving $ref pointer "${path8}".
|
|
29477
29477
|
"${withoutHash}" not found.`);
|
|
29478
29478
|
}
|
|
29479
29479
|
$ref.set(absPath, value);
|
|
@@ -29485,9 +29485,9 @@ var require_refs = __commonJS({
|
|
|
29485
29485
|
* @returns
|
|
29486
29486
|
* @protected
|
|
29487
29487
|
*/
|
|
29488
|
-
_get$Ref(
|
|
29489
|
-
|
|
29490
|
-
const withoutHash = url.stripHash(
|
|
29488
|
+
_get$Ref(path8) {
|
|
29489
|
+
path8 = url.resolve(this._root$Ref.path, path8);
|
|
29490
|
+
const withoutHash = url.stripHash(path8);
|
|
29491
29491
|
return this._$refs[withoutHash];
|
|
29492
29492
|
}
|
|
29493
29493
|
/**
|
|
@@ -29495,8 +29495,8 @@ var require_refs = __commonJS({
|
|
|
29495
29495
|
*
|
|
29496
29496
|
* @param path - The file path or URL of the referenced file
|
|
29497
29497
|
*/
|
|
29498
|
-
_add(
|
|
29499
|
-
const withoutHash = url.stripHash(
|
|
29498
|
+
_add(path8) {
|
|
29499
|
+
const withoutHash = url.stripHash(path8);
|
|
29500
29500
|
const $ref = new ref_js_1.default(this);
|
|
29501
29501
|
$ref.path = withoutHash;
|
|
29502
29502
|
this._$refs[withoutHash] = $ref;
|
|
@@ -29512,15 +29512,15 @@ var require_refs = __commonJS({
|
|
|
29512
29512
|
* @returns
|
|
29513
29513
|
* @protected
|
|
29514
29514
|
*/
|
|
29515
|
-
_resolve(
|
|
29516
|
-
const absPath = url.resolve(this._root$Ref.path,
|
|
29515
|
+
_resolve(path8, pathFromRoot, options) {
|
|
29516
|
+
const absPath = url.resolve(this._root$Ref.path, path8);
|
|
29517
29517
|
const withoutHash = url.stripHash(absPath);
|
|
29518
29518
|
const $ref = this._$refs[withoutHash];
|
|
29519
29519
|
if (!$ref) {
|
|
29520
|
-
throw new Error(`Error resolving $ref pointer "${
|
|
29520
|
+
throw new Error(`Error resolving $ref pointer "${path8}".
|
|
29521
29521
|
"${withoutHash}" not found.`);
|
|
29522
29522
|
}
|
|
29523
|
-
return $ref.resolve(absPath, options,
|
|
29523
|
+
return $ref.resolve(absPath, options, path8, pathFromRoot);
|
|
29524
29524
|
}
|
|
29525
29525
|
/**
|
|
29526
29526
|
* A map of paths/urls to {@link $Ref} objects
|
|
@@ -29570,10 +29570,10 @@ var require_refs = __commonJS({
|
|
|
29570
29570
|
return types2.includes($refs[key].pathType);
|
|
29571
29571
|
});
|
|
29572
29572
|
}
|
|
29573
|
-
return paths.map((
|
|
29573
|
+
return paths.map((path8) => {
|
|
29574
29574
|
return {
|
|
29575
|
-
encoded:
|
|
29576
|
-
decoded: $refs[
|
|
29575
|
+
encoded: path8,
|
|
29576
|
+
decoded: $refs[path8].pathType === "file" ? url.toFileSystemPath(path8, true) : path8
|
|
29577
29577
|
};
|
|
29578
29578
|
});
|
|
29579
29579
|
}
|
|
@@ -29720,18 +29720,18 @@ var require_parse2 = __commonJS({
|
|
|
29720
29720
|
var url = __importStar(require_url());
|
|
29721
29721
|
var plugins = __importStar(require_plugins());
|
|
29722
29722
|
var errors_js_1 = require_errors3();
|
|
29723
|
-
async function parse6(
|
|
29724
|
-
const hashIndex =
|
|
29723
|
+
async function parse6(path8, $refs, options) {
|
|
29724
|
+
const hashIndex = path8.indexOf("#");
|
|
29725
29725
|
let hash = "";
|
|
29726
29726
|
if (hashIndex >= 0) {
|
|
29727
|
-
hash =
|
|
29728
|
-
|
|
29727
|
+
hash = path8.substring(hashIndex);
|
|
29728
|
+
path8 = path8.substring(0, hashIndex);
|
|
29729
29729
|
}
|
|
29730
|
-
const $ref = $refs._add(
|
|
29730
|
+
const $ref = $refs._add(path8);
|
|
29731
29731
|
const file = {
|
|
29732
|
-
url:
|
|
29732
|
+
url: path8,
|
|
29733
29733
|
hash,
|
|
29734
|
-
extension: url.getExtension(
|
|
29734
|
+
extension: url.getExtension(path8)
|
|
29735
29735
|
};
|
|
29736
29736
|
try {
|
|
29737
29737
|
const resolver = await readFile3(file, options, $refs);
|
|
@@ -32864,23 +32864,23 @@ var require_file2 = __commonJS({
|
|
|
32864
32864
|
* Reads the given file and returns its raw contents as a Buffer.
|
|
32865
32865
|
*/
|
|
32866
32866
|
async read(file) {
|
|
32867
|
-
let
|
|
32867
|
+
let path8;
|
|
32868
32868
|
try {
|
|
32869
|
-
|
|
32869
|
+
path8 = url.toFileSystemPath(file.url);
|
|
32870
32870
|
} catch (err) {
|
|
32871
32871
|
const e = err;
|
|
32872
32872
|
e.message = `Malformed URI: ${file.url}: ${e.message}`;
|
|
32873
32873
|
throw new errors_js_1.ResolverError(e, file.url);
|
|
32874
32874
|
}
|
|
32875
|
-
if (
|
|
32876
|
-
|
|
32875
|
+
if (path8.endsWith("/") || path8.endsWith("\\")) {
|
|
32876
|
+
path8 = path8.slice(0, -1);
|
|
32877
32877
|
}
|
|
32878
32878
|
try {
|
|
32879
|
-
return await fs_1.default.promises.readFile(
|
|
32879
|
+
return await fs_1.default.promises.readFile(path8);
|
|
32880
32880
|
} catch (err) {
|
|
32881
32881
|
const e = err;
|
|
32882
|
-
e.message = `Error opening file ${
|
|
32883
|
-
throw new errors_js_1.ResolverError(e,
|
|
32882
|
+
e.message = `Error opening file ${path8}: ${e.message}`;
|
|
32883
|
+
throw new errors_js_1.ResolverError(e, path8);
|
|
32884
32884
|
}
|
|
32885
32885
|
}
|
|
32886
32886
|
};
|
|
@@ -32989,7 +32989,7 @@ var require_http = __commonJS({
|
|
|
32989
32989
|
const redirects = _redirects || [];
|
|
32990
32990
|
redirects.push(u.href);
|
|
32991
32991
|
try {
|
|
32992
|
-
const res = await
|
|
32992
|
+
const res = await get3(u, httpOptions);
|
|
32993
32993
|
if (res.status >= 400) {
|
|
32994
32994
|
const error2 = new Error(`HTTP ERROR ${res.status}`);
|
|
32995
32995
|
error2.status = res.status;
|
|
@@ -33022,7 +33022,7 @@ Too many redirects:
|
|
|
33022
33022
|
throw new errors_js_1.ResolverError(e, u.href);
|
|
33023
33023
|
}
|
|
33024
33024
|
}
|
|
33025
|
-
async function
|
|
33025
|
+
async function get3(u, httpOptions) {
|
|
33026
33026
|
let controller;
|
|
33027
33027
|
let timeoutId;
|
|
33028
33028
|
if (httpOptions.timeout) {
|
|
@@ -33174,7 +33174,7 @@ var require_normalize_args = __commonJS({
|
|
|
33174
33174
|
exports2.normalizeArgs = normalizeArgs2;
|
|
33175
33175
|
var options_js_1 = require_options();
|
|
33176
33176
|
function normalizeArgs2(_args) {
|
|
33177
|
-
let
|
|
33177
|
+
let path8;
|
|
33178
33178
|
let schema2;
|
|
33179
33179
|
let options;
|
|
33180
33180
|
let callback;
|
|
@@ -33183,7 +33183,7 @@ var require_normalize_args = __commonJS({
|
|
|
33183
33183
|
callback = args.pop();
|
|
33184
33184
|
}
|
|
33185
33185
|
if (typeof args[0] === "string") {
|
|
33186
|
-
|
|
33186
|
+
path8 = args[0];
|
|
33187
33187
|
if (typeof args[2] === "object") {
|
|
33188
33188
|
schema2 = args[1];
|
|
33189
33189
|
options = args[2];
|
|
@@ -33192,7 +33192,7 @@ var require_normalize_args = __commonJS({
|
|
|
33192
33192
|
options = args[1];
|
|
33193
33193
|
}
|
|
33194
33194
|
} else {
|
|
33195
|
-
|
|
33195
|
+
path8 = "";
|
|
33196
33196
|
schema2 = args[0];
|
|
33197
33197
|
options = args[1];
|
|
33198
33198
|
}
|
|
@@ -33205,7 +33205,7 @@ var require_normalize_args = __commonJS({
|
|
|
33205
33205
|
schema2 = JSON.parse(JSON.stringify(schema2));
|
|
33206
33206
|
}
|
|
33207
33207
|
return {
|
|
33208
|
-
path:
|
|
33208
|
+
path: path8,
|
|
33209
33209
|
schema: schema2,
|
|
33210
33210
|
options,
|
|
33211
33211
|
callback
|
|
@@ -33276,26 +33276,26 @@ var require_resolve_external = __commonJS({
|
|
|
33276
33276
|
return Promise.reject(e);
|
|
33277
33277
|
}
|
|
33278
33278
|
}
|
|
33279
|
-
function crawl4(obj,
|
|
33279
|
+
function crawl4(obj, path8, $refs, options, seen, external) {
|
|
33280
33280
|
seen ||= /* @__PURE__ */ new Set();
|
|
33281
33281
|
let promises3 = [];
|
|
33282
33282
|
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !seen.has(obj)) {
|
|
33283
33283
|
seen.add(obj);
|
|
33284
33284
|
if (ref_js_1.default.isExternal$Ref(obj)) {
|
|
33285
|
-
promises3.push(resolve$Ref2(obj,
|
|
33285
|
+
promises3.push(resolve$Ref2(obj, path8, $refs, options));
|
|
33286
33286
|
}
|
|
33287
33287
|
const keys = Object.keys(obj);
|
|
33288
33288
|
for (const key of keys) {
|
|
33289
|
-
const keyPath = pointer_js_1.default.join(
|
|
33289
|
+
const keyPath = pointer_js_1.default.join(path8, key);
|
|
33290
33290
|
const value = obj[key];
|
|
33291
33291
|
promises3 = promises3.concat(crawl4(value, keyPath, $refs, options, seen, external));
|
|
33292
33292
|
}
|
|
33293
33293
|
}
|
|
33294
33294
|
return promises3;
|
|
33295
33295
|
}
|
|
33296
|
-
async function resolve$Ref2($ref,
|
|
33296
|
+
async function resolve$Ref2($ref, path8, $refs, options) {
|
|
33297
33297
|
const shouldResolveOnCwd = options.dereference?.externalReferenceResolution === "root";
|
|
33298
|
-
const resolvedPath = url.resolve(shouldResolveOnCwd ? url.cwd() :
|
|
33298
|
+
const resolvedPath = url.resolve(shouldResolveOnCwd ? url.cwd() : path8, $ref.$ref);
|
|
33299
33299
|
const withoutHash = url.stripHash(resolvedPath);
|
|
33300
33300
|
const ref = $refs._$refs[withoutHash];
|
|
33301
33301
|
if (ref) {
|
|
@@ -33310,8 +33310,8 @@ var require_resolve_external = __commonJS({
|
|
|
33310
33310
|
throw err;
|
|
33311
33311
|
}
|
|
33312
33312
|
if ($refs._$refs[withoutHash]) {
|
|
33313
|
-
err.source = decodeURI(url.stripHash(
|
|
33314
|
-
err.path = url.safePointerToPath(url.getHash(
|
|
33313
|
+
err.source = decodeURI(url.stripHash(path8));
|
|
33314
|
+
err.path = url.safePointerToPath(url.getHash(path8));
|
|
33315
33315
|
}
|
|
33316
33316
|
return [];
|
|
33317
33317
|
}
|
|
@@ -33373,13 +33373,13 @@ var require_bundle = __commonJS({
|
|
|
33373
33373
|
crawl4(parser, "schema", parser.$refs._root$Ref.path + "#", "#", 0, inventory, parser.$refs, options);
|
|
33374
33374
|
remap2(inventory);
|
|
33375
33375
|
}
|
|
33376
|
-
function crawl4(parent, key,
|
|
33376
|
+
function crawl4(parent, key, path8, pathFromRoot, indirections, inventory, $refs, options) {
|
|
33377
33377
|
const obj = key === null ? parent : parent[key];
|
|
33378
33378
|
const bundleOptions = options.bundle || {};
|
|
33379
33379
|
const isExcludedPath = bundleOptions.excludedPathMatcher || (() => false);
|
|
33380
33380
|
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !isExcludedPath(pathFromRoot)) {
|
|
33381
33381
|
if (ref_js_1.default.isAllowed$Ref(obj)) {
|
|
33382
|
-
inventory$Ref2(parent, key,
|
|
33382
|
+
inventory$Ref2(parent, key, path8, pathFromRoot, indirections, inventory, $refs, options);
|
|
33383
33383
|
} else {
|
|
33384
33384
|
const keys = Object.keys(obj).sort((a, b) => {
|
|
33385
33385
|
if (a === "definitions" || a === "$defs") {
|
|
@@ -33391,11 +33391,11 @@ var require_bundle = __commonJS({
|
|
|
33391
33391
|
}
|
|
33392
33392
|
});
|
|
33393
33393
|
for (const key2 of keys) {
|
|
33394
|
-
const keyPath = pointer_js_1.default.join(
|
|
33394
|
+
const keyPath = pointer_js_1.default.join(path8, key2);
|
|
33395
33395
|
const keyPathFromRoot = pointer_js_1.default.join(pathFromRoot, key2);
|
|
33396
33396
|
const value = obj[key2];
|
|
33397
33397
|
if (ref_js_1.default.isAllowed$Ref(value)) {
|
|
33398
|
-
inventory$Ref2(obj, key2,
|
|
33398
|
+
inventory$Ref2(obj, key2, path8, keyPathFromRoot, indirections, inventory, $refs, options);
|
|
33399
33399
|
} else {
|
|
33400
33400
|
crawl4(obj, key2, keyPath, keyPathFromRoot, indirections, inventory, $refs, options);
|
|
33401
33401
|
}
|
|
@@ -33408,9 +33408,9 @@ var require_bundle = __commonJS({
|
|
|
33408
33408
|
}
|
|
33409
33409
|
}
|
|
33410
33410
|
}
|
|
33411
|
-
function inventory$Ref2($refParent, $refKey,
|
|
33411
|
+
function inventory$Ref2($refParent, $refKey, path8, pathFromRoot, indirections, inventory, $refs, options) {
|
|
33412
33412
|
const $ref = $refKey === null ? $refParent : $refParent[$refKey];
|
|
33413
|
-
const $refPath = url.resolve(
|
|
33413
|
+
const $refPath = url.resolve(path8, $ref.$ref);
|
|
33414
33414
|
const pointer = $refs._resolve($refPath, pathFromRoot, options);
|
|
33415
33415
|
if (pointer === null) {
|
|
33416
33416
|
return;
|
|
@@ -33575,7 +33575,7 @@ var require_dereference = __commonJS({
|
|
|
33575
33575
|
parser.$refs.circular = dereferenced.circular;
|
|
33576
33576
|
parser.schema = dereferenced.value;
|
|
33577
33577
|
}
|
|
33578
|
-
function crawl4(obj,
|
|
33578
|
+
function crawl4(obj, path8, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime) {
|
|
33579
33579
|
let dereferenced;
|
|
33580
33580
|
const result = {
|
|
33581
33581
|
value: obj,
|
|
@@ -33589,13 +33589,13 @@ var require_dereference = __commonJS({
|
|
|
33589
33589
|
parents.add(obj);
|
|
33590
33590
|
processedObjects.add(obj);
|
|
33591
33591
|
if (ref_js_1.default.isAllowed$Ref(obj, options)) {
|
|
33592
|
-
dereferenced = dereference$Ref2(obj,
|
|
33592
|
+
dereferenced = dereference$Ref2(obj, path8, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime);
|
|
33593
33593
|
result.circular = dereferenced.circular;
|
|
33594
33594
|
result.value = dereferenced.value;
|
|
33595
33595
|
} else {
|
|
33596
33596
|
for (const key of Object.keys(obj)) {
|
|
33597
33597
|
checkDereferenceTimeout2(startTime, options);
|
|
33598
|
-
const keyPath = pointer_js_1.default.join(
|
|
33598
|
+
const keyPath = pointer_js_1.default.join(path8, key);
|
|
33599
33599
|
const keyPathFromRoot = pointer_js_1.default.join(pathFromRoot, key);
|
|
33600
33600
|
if (isExcludedPath(keyPathFromRoot)) {
|
|
33601
33601
|
continue;
|
|
@@ -33645,10 +33645,10 @@ var require_dereference = __commonJS({
|
|
|
33645
33645
|
}
|
|
33646
33646
|
return result;
|
|
33647
33647
|
}
|
|
33648
|
-
function dereference$Ref2($ref,
|
|
33648
|
+
function dereference$Ref2($ref, path8, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime) {
|
|
33649
33649
|
const isExternalRef = ref_js_1.default.isExternal$Ref($ref);
|
|
33650
33650
|
const shouldResolveOnCwd = isExternalRef && options?.dereference?.externalReferenceResolution === "root";
|
|
33651
|
-
const $refPath = url.resolve(shouldResolveOnCwd ? url.cwd() :
|
|
33651
|
+
const $refPath = url.resolve(shouldResolveOnCwd ? url.cwd() : path8, $ref.$ref);
|
|
33652
33652
|
const cache = dereferencedCache.get($refPath);
|
|
33653
33653
|
if (cache) {
|
|
33654
33654
|
if (!cache.circular) {
|
|
@@ -33676,7 +33676,7 @@ var require_dereference = __commonJS({
|
|
|
33676
33676
|
return cache;
|
|
33677
33677
|
}
|
|
33678
33678
|
}
|
|
33679
|
-
const pointer = $refs._resolve($refPath,
|
|
33679
|
+
const pointer = $refs._resolve($refPath, path8, options);
|
|
33680
33680
|
if (pointer === null) {
|
|
33681
33681
|
return {
|
|
33682
33682
|
circular: false,
|
|
@@ -33686,7 +33686,7 @@ var require_dereference = __commonJS({
|
|
|
33686
33686
|
const directCircular = pointer.circular;
|
|
33687
33687
|
let circular = directCircular || parents.has(pointer.value);
|
|
33688
33688
|
if (circular) {
|
|
33689
|
-
foundCircularReference2(
|
|
33689
|
+
foundCircularReference2(path8, $refs, options);
|
|
33690
33690
|
}
|
|
33691
33691
|
let dereferencedValue = ref_js_1.default.dereference($ref, pointer.value);
|
|
33692
33692
|
if (!circular) {
|
|
@@ -35662,13 +35662,13 @@ var require_json3 = __commonJS({
|
|
|
35662
35662
|
});
|
|
35663
35663
|
Object.defineProperty(exports2, "getDecoratedDataPath", {
|
|
35664
35664
|
enumerable: true,
|
|
35665
|
-
get: function
|
|
35665
|
+
get: function get3() {
|
|
35666
35666
|
return _getDecoratedDataPath["default"];
|
|
35667
35667
|
}
|
|
35668
35668
|
});
|
|
35669
35669
|
Object.defineProperty(exports2, "getMetaFromPath", {
|
|
35670
35670
|
enumerable: true,
|
|
35671
|
-
get: function
|
|
35671
|
+
get: function get3() {
|
|
35672
35672
|
return _getMetaFromPath["default"];
|
|
35673
35673
|
}
|
|
35674
35674
|
});
|
|
@@ -35713,7 +35713,7 @@ var require_base = __commonJS({
|
|
|
35713
35713
|
// creating an empty proxy that'll just return the arguments of any color functions we
|
|
35714
35714
|
// invoke, sans any colorization.
|
|
35715
35715
|
new Proxy({}, {
|
|
35716
|
-
get: function
|
|
35716
|
+
get: function get3() {
|
|
35717
35717
|
return function(arg) {
|
|
35718
35718
|
return arg;
|
|
35719
35719
|
};
|
|
@@ -35764,7 +35764,7 @@ var require_base = __commonJS({
|
|
|
35764
35764
|
*/
|
|
35765
35765
|
}, {
|
|
35766
35766
|
key: "instancePath",
|
|
35767
|
-
get: function
|
|
35767
|
+
get: function get3() {
|
|
35768
35768
|
return typeof this.options.instancePath !== "undefined" ? this.options.instancePath : this.options.dataPath;
|
|
35769
35769
|
}
|
|
35770
35770
|
}, {
|
|
@@ -36012,7 +36012,7 @@ var require_jsonpointer = __commonJS({
|
|
|
36012
36012
|
}
|
|
36013
36013
|
throw new Error("Invalid JSON pointer.");
|
|
36014
36014
|
}
|
|
36015
|
-
function
|
|
36015
|
+
function get3(obj, pointer) {
|
|
36016
36016
|
if (typeof obj !== "object") throw new Error("Invalid input object.");
|
|
36017
36017
|
pointer = compilePointer(pointer);
|
|
36018
36018
|
var len = pointer.length;
|
|
@@ -36033,14 +36033,14 @@ var require_jsonpointer = __commonJS({
|
|
|
36033
36033
|
var compiled = compilePointer(pointer);
|
|
36034
36034
|
return {
|
|
36035
36035
|
get: function(object) {
|
|
36036
|
-
return
|
|
36036
|
+
return get3(object, compiled);
|
|
36037
36037
|
},
|
|
36038
36038
|
set: function(object, value) {
|
|
36039
36039
|
return set2(object, compiled, value);
|
|
36040
36040
|
}
|
|
36041
36041
|
};
|
|
36042
36042
|
}
|
|
36043
|
-
exports2.get =
|
|
36043
|
+
exports2.get = get3;
|
|
36044
36044
|
exports2.set = set2;
|
|
36045
36045
|
exports2.compile = compile;
|
|
36046
36046
|
}
|
|
@@ -36527,37 +36527,37 @@ var require_validation_errors = __commonJS({
|
|
|
36527
36527
|
});
|
|
36528
36528
|
Object.defineProperty(exports2, "AdditionalPropValidationError", {
|
|
36529
36529
|
enumerable: true,
|
|
36530
|
-
get: function
|
|
36530
|
+
get: function get3() {
|
|
36531
36531
|
return _additionalProp["default"];
|
|
36532
36532
|
}
|
|
36533
36533
|
});
|
|
36534
36534
|
Object.defineProperty(exports2, "DefaultValidationError", {
|
|
36535
36535
|
enumerable: true,
|
|
36536
|
-
get: function
|
|
36536
|
+
get: function get3() {
|
|
36537
36537
|
return _default2["default"];
|
|
36538
36538
|
}
|
|
36539
36539
|
});
|
|
36540
36540
|
Object.defineProperty(exports2, "EnumValidationError", {
|
|
36541
36541
|
enumerable: true,
|
|
36542
|
-
get: function
|
|
36542
|
+
get: function get3() {
|
|
36543
36543
|
return _enum["default"];
|
|
36544
36544
|
}
|
|
36545
36545
|
});
|
|
36546
36546
|
Object.defineProperty(exports2, "PatternValidationError", {
|
|
36547
36547
|
enumerable: true,
|
|
36548
|
-
get: function
|
|
36548
|
+
get: function get3() {
|
|
36549
36549
|
return _pattern["default"];
|
|
36550
36550
|
}
|
|
36551
36551
|
});
|
|
36552
36552
|
Object.defineProperty(exports2, "RequiredValidationError", {
|
|
36553
36553
|
enumerable: true,
|
|
36554
|
-
get: function
|
|
36554
|
+
get: function get3() {
|
|
36555
36555
|
return _required["default"];
|
|
36556
36556
|
}
|
|
36557
36557
|
});
|
|
36558
36558
|
Object.defineProperty(exports2, "UnevaluatedPropValidationError", {
|
|
36559
36559
|
enumerable: true,
|
|
36560
|
-
get: function
|
|
36560
|
+
get: function get3() {
|
|
36561
36561
|
return _unevaluatedProp["default"];
|
|
36562
36562
|
}
|
|
36563
36563
|
});
|
|
@@ -36618,15 +36618,15 @@ var require_helpers = __commonJS({
|
|
|
36618
36618
|
var instancePath = typeof ajvError.instancePath !== "undefined" ? ajvError.instancePath : ajvError.dataPath;
|
|
36619
36619
|
var paths = instancePath === "" ? [""] : instancePath.match(JSON_POINTERS_REGEX);
|
|
36620
36620
|
if (paths) {
|
|
36621
|
-
paths.reduce(function(obj,
|
|
36622
|
-
obj.children[
|
|
36621
|
+
paths.reduce(function(obj, path8, i) {
|
|
36622
|
+
obj.children[path8] = obj.children[path8] || {
|
|
36623
36623
|
children: {},
|
|
36624
36624
|
errors: []
|
|
36625
36625
|
};
|
|
36626
36626
|
if (i === paths.length - 1) {
|
|
36627
|
-
obj.children[
|
|
36627
|
+
obj.children[path8].errors.push(ajvError);
|
|
36628
36628
|
}
|
|
36629
|
-
return obj.children[
|
|
36629
|
+
return obj.children[path8];
|
|
36630
36630
|
}, root);
|
|
36631
36631
|
}
|
|
36632
36632
|
});
|
|
@@ -39934,8 +39934,8 @@ var require_utils4 = __commonJS({
|
|
|
39934
39934
|
}
|
|
39935
39935
|
return ind;
|
|
39936
39936
|
}
|
|
39937
|
-
function removeDotSegments(
|
|
39938
|
-
let input =
|
|
39937
|
+
function removeDotSegments(path8) {
|
|
39938
|
+
let input = path8;
|
|
39939
39939
|
const output = [];
|
|
39940
39940
|
let nextSlash = -1;
|
|
39941
39941
|
let len = 0;
|
|
@@ -40187,8 +40187,8 @@ var require_schemes = __commonJS({
|
|
|
40187
40187
|
wsComponent.secure = void 0;
|
|
40188
40188
|
}
|
|
40189
40189
|
if (wsComponent.resourceName) {
|
|
40190
|
-
const [
|
|
40191
|
-
wsComponent.path =
|
|
40190
|
+
const [path8, query] = wsComponent.resourceName.split("?");
|
|
40191
|
+
wsComponent.path = path8 && path8 !== "/" ? path8 : void 0;
|
|
40192
40192
|
wsComponent.query = query;
|
|
40193
40193
|
wsComponent.resourceName = void 0;
|
|
40194
40194
|
}
|
|
@@ -46649,8 +46649,8 @@ function getIDToken(aud) {
|
|
|
46649
46649
|
}
|
|
46650
46650
|
|
|
46651
46651
|
// src/index.ts
|
|
46652
|
-
var
|
|
46653
|
-
var
|
|
46652
|
+
var import_node_crypto2 = require("node:crypto");
|
|
46653
|
+
var import_node_fs3 = require("node:fs");
|
|
46654
46654
|
var import_yaml3 = __toESM(require_dist(), 1);
|
|
46655
46655
|
|
|
46656
46656
|
// src/contracts.ts
|
|
@@ -46742,6 +46742,35 @@ var customerPreviewActionContract = {
|
|
|
46742
46742
|
default: "",
|
|
46743
46743
|
allowedValues: ["3.0", "3.1"]
|
|
46744
46744
|
},
|
|
46745
|
+
"breaking-change-mode": {
|
|
46746
|
+
description: "OpenAPI breaking-change comparison mode.",
|
|
46747
|
+
required: false,
|
|
46748
|
+
default: "off",
|
|
46749
|
+
allowedValues: ["off", "pr-native", "baseline-only", "previous-spec"]
|
|
46750
|
+
},
|
|
46751
|
+
"breaking-baseline-spec-path": {
|
|
46752
|
+
description: "Workspace-relative baseline OpenAPI spec path used by baseline-only mode and pr-native fallback.",
|
|
46753
|
+
required: false
|
|
46754
|
+
},
|
|
46755
|
+
"breaking-rules-path": {
|
|
46756
|
+
description: "Workspace-relative openapi-changes rules file. Missing files are ignored.",
|
|
46757
|
+
required: false,
|
|
46758
|
+
default: "changes-rules.yaml"
|
|
46759
|
+
},
|
|
46760
|
+
"breaking-target-ref": {
|
|
46761
|
+
description: "Optional target branch or git ref override for pr-native breaking-change comparisons.",
|
|
46762
|
+
required: false
|
|
46763
|
+
},
|
|
46764
|
+
"breaking-summary-path": {
|
|
46765
|
+
description: "Optional markdown report output path. Defaults to a runner-temp file.",
|
|
46766
|
+
required: false,
|
|
46767
|
+
default: ""
|
|
46768
|
+
},
|
|
46769
|
+
"breaking-log-path": {
|
|
46770
|
+
description: "Optional raw command log output path. Defaults to a runner-temp file.",
|
|
46771
|
+
required: false,
|
|
46772
|
+
default: ""
|
|
46773
|
+
},
|
|
46745
46774
|
"governance-mapping-json": {
|
|
46746
46775
|
description: "Legacy JSON map of business domain to governance group name. Prefer governance-group or the postman-governance-group repository custom property.",
|
|
46747
46776
|
required: false,
|
|
@@ -46820,6 +46849,12 @@ var customerPreviewActionContract = {
|
|
|
46820
46849
|
},
|
|
46821
46850
|
"lint-summary-json": {
|
|
46822
46851
|
description: "JSON summary of lint errors and warnings."
|
|
46852
|
+
},
|
|
46853
|
+
"breaking-change-status": {
|
|
46854
|
+
description: "OpenAPI breaking-change check status."
|
|
46855
|
+
},
|
|
46856
|
+
"breaking-change-summary-json": {
|
|
46857
|
+
description: "JSON summary of the OpenAPI breaking-change check."
|
|
46823
46858
|
}
|
|
46824
46859
|
},
|
|
46825
46860
|
retainedBehavior: [
|
|
@@ -46829,6 +46864,7 @@ var customerPreviewActionContract = {
|
|
|
46829
46864
|
"workspace admin assignment",
|
|
46830
46865
|
"spec upload to Spec Hub",
|
|
46831
46866
|
"OpenAPI operation summary normalization before upload (missing or oversized summaries)",
|
|
46867
|
+
"optional OpenAPI breaking-change detection before Postman mutations",
|
|
46832
46868
|
"spec linting by UID",
|
|
46833
46869
|
"baseline, smoke, and contract collection generation",
|
|
46834
46870
|
"collection refresh and versioning policies",
|
|
@@ -46924,10 +46960,10 @@ function sanitizeHeaders(headers, secretValues) {
|
|
|
46924
46960
|
}
|
|
46925
46961
|
|
|
46926
46962
|
// src/lib/github/github-api-client.ts
|
|
46927
|
-
function buildErrorMessage(method,
|
|
46963
|
+
function buildErrorMessage(method, path8, response, body, masker) {
|
|
46928
46964
|
const status = `${response.status}${response.statusText ? ` ${response.statusText}` : ""}`;
|
|
46929
46965
|
const sanitizedBody = masker(body || "");
|
|
46930
|
-
return sanitizedBody ? masker(`${method} ${
|
|
46966
|
+
return sanitizedBody ? masker(`${method} ${path8} failed with ${status} - ${sanitizedBody}`) : masker(`${method} ${path8} failed with ${status} - [REDACTED]`);
|
|
46931
46967
|
}
|
|
46932
46968
|
var GitHubApiClient = class {
|
|
46933
46969
|
apiBase;
|
|
@@ -46977,11 +47013,11 @@ var GitHubApiClient = class {
|
|
|
46977
47013
|
}
|
|
46978
47014
|
return ordered;
|
|
46979
47015
|
}
|
|
46980
|
-
isVariablesEndpoint(
|
|
46981
|
-
return
|
|
47016
|
+
isVariablesEndpoint(path8) {
|
|
47017
|
+
return path8.startsWith(`/repos/${this.owner}/${this.repo}/actions/variables`);
|
|
46982
47018
|
}
|
|
46983
|
-
canUseFallback(
|
|
46984
|
-
return this.isVariablesEndpoint(
|
|
47019
|
+
canUseFallback(path8) {
|
|
47020
|
+
return this.isVariablesEndpoint(path8) || path8 === `/repos/${this.owner}/${this.repo}/properties/values` || path8.includes(`/repos/${this.owner}/${this.repo}/contents`) || path8.includes("/dispatches");
|
|
46985
47021
|
}
|
|
46986
47022
|
rateLimitDelayMs(response, attempt) {
|
|
46987
47023
|
const retryAfter = Number(response.headers.get("retry-after") || "");
|
|
@@ -46999,14 +47035,14 @@ var GitHubApiClient = class {
|
|
|
46999
47035
|
const jitter = Math.floor(Math.random() * 250);
|
|
47000
47036
|
return Math.min(base + jitter, 12e4);
|
|
47001
47037
|
}
|
|
47002
|
-
async requestWithToken(
|
|
47038
|
+
async requestWithToken(path8, init, token) {
|
|
47003
47039
|
const MAX_RETRIES = 5;
|
|
47004
47040
|
const normalizedToken = String(token || "").trim();
|
|
47005
47041
|
if (!normalizedToken) {
|
|
47006
|
-
throw new Error(`Missing GitHub auth token for request ${
|
|
47042
|
+
throw new Error(`Missing GitHub auth token for request ${path8}`);
|
|
47007
47043
|
}
|
|
47008
47044
|
for (let attempt = 0; ; attempt++) {
|
|
47009
|
-
const response = await this.fetchImpl(`${this.apiBase}${
|
|
47045
|
+
const response = await this.fetchImpl(`${this.apiBase}${path8}`, {
|
|
47010
47046
|
...init,
|
|
47011
47047
|
headers: {
|
|
47012
47048
|
Accept: "application/vnd.github+json",
|
|
@@ -47029,28 +47065,28 @@ var GitHubApiClient = class {
|
|
|
47029
47065
|
return response;
|
|
47030
47066
|
}
|
|
47031
47067
|
}
|
|
47032
|
-
async request(
|
|
47068
|
+
async request(path8, init = {}) {
|
|
47033
47069
|
const orderedTokens = this.getTokenOrder();
|
|
47034
47070
|
if (orderedTokens.length === 0) {
|
|
47035
47071
|
throw new Error("No GitHub auth token configured");
|
|
47036
47072
|
}
|
|
47037
|
-
const first = await this.requestWithToken(
|
|
47038
|
-
if (orderedTokens.length < 2 || !this.canUseFallback(
|
|
47073
|
+
const first = await this.requestWithToken(path8, init, orderedTokens[0]);
|
|
47074
|
+
if (orderedTokens.length < 2 || !this.canUseFallback(path8)) {
|
|
47039
47075
|
return first;
|
|
47040
47076
|
}
|
|
47041
|
-
const isVariableGet404 = first.status === 404 && (!init.method || init.method === "GET") && this.isVariablesEndpoint(
|
|
47077
|
+
const isVariableGet404 = first.status === 404 && (!init.method || init.method === "GET") && this.isVariablesEndpoint(path8);
|
|
47042
47078
|
if (first.status !== 403 && !isVariableGet404) {
|
|
47043
47079
|
return first;
|
|
47044
47080
|
}
|
|
47045
|
-
return this.requestWithToken(
|
|
47081
|
+
return this.requestWithToken(path8, init, orderedTokens[1]);
|
|
47046
47082
|
}
|
|
47047
47083
|
async setRepositoryVariable(name, value) {
|
|
47048
47084
|
if (!value) {
|
|
47049
47085
|
throw new Error(`Repo variable ${name} is empty`);
|
|
47050
47086
|
}
|
|
47051
|
-
const
|
|
47087
|
+
const path8 = `/repos/${this.repository}/actions/variables`;
|
|
47052
47088
|
const body = JSON.stringify({ name, value: String(value) });
|
|
47053
|
-
const createResponse = await this.request(
|
|
47089
|
+
const createResponse = await this.request(path8, {
|
|
47054
47090
|
method: "POST",
|
|
47055
47091
|
body
|
|
47056
47092
|
});
|
|
@@ -47073,12 +47109,12 @@ var GitHubApiClient = class {
|
|
|
47073
47109
|
}
|
|
47074
47110
|
const text = await createResponse.text().catch(() => "");
|
|
47075
47111
|
throw new Error(
|
|
47076
|
-
buildErrorMessage("POST",
|
|
47112
|
+
buildErrorMessage("POST", path8, createResponse, text, this.secretMasker)
|
|
47077
47113
|
);
|
|
47078
47114
|
}
|
|
47079
47115
|
async getRepositoryVariable(name) {
|
|
47080
|
-
const
|
|
47081
|
-
const response = await this.request(
|
|
47116
|
+
const path8 = `/repos/${this.repository}/actions/variables/${name}`;
|
|
47117
|
+
const response = await this.request(path8, {
|
|
47082
47118
|
method: "GET"
|
|
47083
47119
|
});
|
|
47084
47120
|
if (response.status === 404) {
|
|
@@ -47087,15 +47123,15 @@ var GitHubApiClient = class {
|
|
|
47087
47123
|
if (!response.ok) {
|
|
47088
47124
|
const text = await response.text().catch(() => "");
|
|
47089
47125
|
throw new Error(
|
|
47090
|
-
buildErrorMessage("GET",
|
|
47126
|
+
buildErrorMessage("GET", path8, response, text, this.secretMasker)
|
|
47091
47127
|
);
|
|
47092
47128
|
}
|
|
47093
47129
|
const data = await response.json();
|
|
47094
47130
|
return String(data.value || "");
|
|
47095
47131
|
}
|
|
47096
47132
|
async getRepositoryCustomProperty(name) {
|
|
47097
|
-
const
|
|
47098
|
-
const response = await this.request(
|
|
47133
|
+
const path8 = `/repos/${this.repository}/properties/values`;
|
|
47134
|
+
const response = await this.request(path8, {
|
|
47099
47135
|
method: "GET"
|
|
47100
47136
|
});
|
|
47101
47137
|
if (response.status === 404) {
|
|
@@ -47104,7 +47140,7 @@ var GitHubApiClient = class {
|
|
|
47104
47140
|
if (!response.ok) {
|
|
47105
47141
|
const text = await response.text().catch(() => "");
|
|
47106
47142
|
throw new Error(
|
|
47107
|
-
buildErrorMessage("GET",
|
|
47143
|
+
buildErrorMessage("GET", path8, response, text, this.secretMasker)
|
|
47108
47144
|
);
|
|
47109
47145
|
}
|
|
47110
47146
|
const values = await response.json();
|
|
@@ -47186,6 +47222,593 @@ var HttpError = class _HttpError extends Error {
|
|
|
47186
47222
|
}
|
|
47187
47223
|
};
|
|
47188
47224
|
|
|
47225
|
+
// src/lib/openapi-changes.ts
|
|
47226
|
+
var import_node_crypto = require("node:crypto");
|
|
47227
|
+
var import_node_fs = require("node:fs");
|
|
47228
|
+
var import_promises = require("node:fs/promises");
|
|
47229
|
+
var import_node_https = require("node:https");
|
|
47230
|
+
var import_node_os = __toESM(require("node:os"), 1);
|
|
47231
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
47232
|
+
var TOOL_NAME = "openapi-changes";
|
|
47233
|
+
var OPENAPI_CHANGES_VERSION = "0.2.7";
|
|
47234
|
+
var RELEASE_BASE_URL = `https://github.com/pb33f/openapi-changes/releases/download/v${OPENAPI_CHANGES_VERSION}`;
|
|
47235
|
+
var CHECKSUMS = {
|
|
47236
|
+
"0.2.7": {
|
|
47237
|
+
"openapi-changes_0.2.7_darwin_arm64.tar.gz": "03e65e0d16c51fb8d43a93318409027bd9cd7c7c3355061d23c084c1ac9c0f7b",
|
|
47238
|
+
"openapi-changes_0.2.7_darwin_x86_64.tar.gz": "c064dab16fac342926126d060efd157ff283e18548ccf6081a7a71a8d3c5bc04",
|
|
47239
|
+
"openapi-changes_0.2.7_linux_arm64.tar.gz": "698b29336699fd4ec61e52585f140a6450d112c1eb1c637bbe34c13b4203fecc",
|
|
47240
|
+
"openapi-changes_0.2.7_linux_i386.tar.gz": "bb95699989ef67d0fd9d8644e56b1e183dea4dc439e59d051fe6964b87636f8c",
|
|
47241
|
+
"openapi-changes_0.2.7_linux_x86_64.tar.gz": "333742ea369c90437fbda47a814cf2393cb65eaa3867268a4c86281e74f614bf",
|
|
47242
|
+
"openapi-changes_0.2.7_windows_arm64.tar.gz": "3dfc29f88fb4332a3bf2d6d45fb9ab02ef907e7bc45fb8e8630ad943c4b9d814",
|
|
47243
|
+
"openapi-changes_0.2.7_windows_i386.tar.gz": "78e868e15d0e15f358f7f350af3c9532f6720a140bbb9241dbb947d49c6ec20c",
|
|
47244
|
+
"openapi-changes_0.2.7_windows_x86_64.tar.gz": "fff5a68713b9093ad8ab547d214b5a3b9139ad71e90ee9e1347b3f9bd6e1e191"
|
|
47245
|
+
}
|
|
47246
|
+
};
|
|
47247
|
+
function firstValue(...values) {
|
|
47248
|
+
return values.find((value) => String(value ?? "").trim())?.trim();
|
|
47249
|
+
}
|
|
47250
|
+
function getWorkspaceRoot(env = process.env) {
|
|
47251
|
+
return (0, import_node_fs.realpathSync)(import_node_path.default.resolve(env.GITHUB_WORKSPACE || process.cwd()));
|
|
47252
|
+
}
|
|
47253
|
+
function getTempRoot(env = process.env) {
|
|
47254
|
+
return (0, import_node_fs.realpathSync)(import_node_path.default.resolve(env.RUNNER_TEMP || import_node_os.default.tmpdir()));
|
|
47255
|
+
}
|
|
47256
|
+
function ensureInsideRoot(root, candidate, message) {
|
|
47257
|
+
const relative2 = import_node_path.default.relative(root, candidate);
|
|
47258
|
+
if (relative2.startsWith("..") || import_node_path.default.isAbsolute(relative2)) {
|
|
47259
|
+
throw new Error(message);
|
|
47260
|
+
}
|
|
47261
|
+
}
|
|
47262
|
+
function nearestExistingPath(candidate) {
|
|
47263
|
+
let current = candidate;
|
|
47264
|
+
while (!(0, import_node_fs.existsSync)(current)) {
|
|
47265
|
+
const parent = import_node_path.default.dirname(current);
|
|
47266
|
+
if (parent === current) {
|
|
47267
|
+
return current;
|
|
47268
|
+
}
|
|
47269
|
+
current = parent;
|
|
47270
|
+
}
|
|
47271
|
+
return current;
|
|
47272
|
+
}
|
|
47273
|
+
function isInsideAnyRoot(roots, candidate) {
|
|
47274
|
+
return roots.some((root) => {
|
|
47275
|
+
const relative2 = import_node_path.default.relative(root, candidate);
|
|
47276
|
+
return !relative2.startsWith("..") && !import_node_path.default.isAbsolute(relative2);
|
|
47277
|
+
});
|
|
47278
|
+
}
|
|
47279
|
+
function assertOutputFileAllowed(filePath, workspaceRoot, tempRoot) {
|
|
47280
|
+
const workspaceRealPath = (0, import_node_fs.realpathSync)(workspaceRoot);
|
|
47281
|
+
const tempRealPath = (0, import_node_fs.realpathSync)(tempRoot);
|
|
47282
|
+
const resolved = import_node_path.default.resolve(filePath);
|
|
47283
|
+
const existingPath = nearestExistingPath(resolved);
|
|
47284
|
+
const existingRealPath = (0, import_node_fs.realpathSync)(existingPath);
|
|
47285
|
+
if (!isInsideAnyRoot([workspaceRealPath, tempRealPath], existingRealPath)) {
|
|
47286
|
+
throw new Error("Breaking-change output path must stay within the workspace or runner temp directory");
|
|
47287
|
+
}
|
|
47288
|
+
return resolved;
|
|
47289
|
+
}
|
|
47290
|
+
function resolveConfiguredOutputPath(configuredPath, defaultFileName, workspaceRoot, tempRoot) {
|
|
47291
|
+
const defaultPath = import_node_path.default.join(tempRoot, "postman-bootstrap", defaultFileName);
|
|
47292
|
+
if (!configuredPath) {
|
|
47293
|
+
return defaultPath;
|
|
47294
|
+
}
|
|
47295
|
+
const resolved = import_node_path.default.isAbsolute(configuredPath) ? configuredPath : import_node_path.default.join(workspaceRoot, configuredPath);
|
|
47296
|
+
return assertOutputFileAllowed(resolved, workspaceRoot, tempRoot);
|
|
47297
|
+
}
|
|
47298
|
+
function resolveWorkspaceFilePath(configuredPath, workspaceRoot) {
|
|
47299
|
+
if (!configuredPath) {
|
|
47300
|
+
return void 0;
|
|
47301
|
+
}
|
|
47302
|
+
const workspaceRealPath = (0, import_node_fs.realpathSync)(workspaceRoot);
|
|
47303
|
+
const resolved = import_node_path.default.isAbsolute(configuredPath) ? import_node_path.default.resolve(configuredPath) : import_node_path.default.resolve(workspaceRoot, configuredPath);
|
|
47304
|
+
ensureInsideRoot(workspaceRealPath, resolved, "Breaking-change input path must stay within the workspace");
|
|
47305
|
+
if (!(0, import_node_fs.existsSync)(resolved)) {
|
|
47306
|
+
return void 0;
|
|
47307
|
+
}
|
|
47308
|
+
const realResolved = (0, import_node_fs.realpathSync)(resolved);
|
|
47309
|
+
ensureInsideRoot(
|
|
47310
|
+
workspaceRealPath,
|
|
47311
|
+
realResolved,
|
|
47312
|
+
"Breaking-change input path must stay within the workspace"
|
|
47313
|
+
);
|
|
47314
|
+
return realResolved;
|
|
47315
|
+
}
|
|
47316
|
+
function workspaceRelativePath(filePath, workspaceRoot) {
|
|
47317
|
+
const resolved = import_node_path.default.isAbsolute(filePath) ? import_node_path.default.resolve(filePath) : import_node_path.default.resolve(workspaceRoot, filePath);
|
|
47318
|
+
const realResolved = (0, import_node_fs.existsSync)(resolved) ? (0, import_node_fs.realpathSync)(resolved) : resolved;
|
|
47319
|
+
ensureInsideRoot(workspaceRoot, realResolved, "spec-path must stay within the workspace");
|
|
47320
|
+
const relative2 = import_node_path.default.relative(workspaceRoot, realResolved);
|
|
47321
|
+
return relative2.split(import_node_path.default.sep).join("/");
|
|
47322
|
+
}
|
|
47323
|
+
function normalizeBranch(value) {
|
|
47324
|
+
let branchName = String(value || "main").trim();
|
|
47325
|
+
branchName = branchName.replace(/^refs\/remotes\/origin\//, "").replace(/^refs\/heads\//, "").replace(/^origin\//, "");
|
|
47326
|
+
if (!branchName) {
|
|
47327
|
+
branchName = "main";
|
|
47328
|
+
}
|
|
47329
|
+
if (!/^[A-Za-z0-9._/-]+$/.test(branchName)) {
|
|
47330
|
+
throw new Error(`Unsupported target branch name: ${branchName}`);
|
|
47331
|
+
}
|
|
47332
|
+
return branchName;
|
|
47333
|
+
}
|
|
47334
|
+
async function gitObjectExists(dependencies, refSpec, cwd2) {
|
|
47335
|
+
const result = await dependencies.exec.getExecOutput("git", ["cat-file", "-e", refSpec], {
|
|
47336
|
+
cwd: cwd2,
|
|
47337
|
+
ignoreReturnCode: true
|
|
47338
|
+
});
|
|
47339
|
+
return result.exitCode === 0;
|
|
47340
|
+
}
|
|
47341
|
+
function targetBranchCandidates(configuredTargetRef, env) {
|
|
47342
|
+
const targetBranch = normalizeBranch(firstValue(
|
|
47343
|
+
configuredTargetRef,
|
|
47344
|
+
env.GITHUB_BASE_REF,
|
|
47345
|
+
env.CHANGE_TARGET,
|
|
47346
|
+
env.BITBUCKET_TARGET_BRANCH,
|
|
47347
|
+
env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME,
|
|
47348
|
+
env.SYSTEM_PULLREQUEST_TARGETBRANCH,
|
|
47349
|
+
"main"
|
|
47350
|
+
));
|
|
47351
|
+
return Array.from(/* @__PURE__ */ new Set([`origin/${targetBranch}`, targetBranch]));
|
|
47352
|
+
}
|
|
47353
|
+
async function writeTempSpecFile(tempRoot, name, content) {
|
|
47354
|
+
const tempDir = import_node_path.default.join(tempRoot, "postman-bootstrap", `openapi-changes-${process.pid}-${Date.now()}`);
|
|
47355
|
+
await (0, import_promises.mkdir)(tempDir, { recursive: true });
|
|
47356
|
+
const filePath = import_node_path.default.join(tempDir, name);
|
|
47357
|
+
await (0, import_promises.writeFile)(filePath, content, "utf8");
|
|
47358
|
+
return filePath;
|
|
47359
|
+
}
|
|
47360
|
+
async function removeTempSpecFile(filePath) {
|
|
47361
|
+
const parent = import_node_path.default.dirname(filePath);
|
|
47362
|
+
if (parent.includes(`${import_node_path.default.sep}openapi-changes-`)) {
|
|
47363
|
+
await (0, import_promises.rm)(parent, { recursive: true, force: true });
|
|
47364
|
+
}
|
|
47365
|
+
}
|
|
47366
|
+
async function resolveComparisonSource(inputs, dependencies, workspaceRoot, tempRoot) {
|
|
47367
|
+
if (inputs.mode === "previous-spec") {
|
|
47368
|
+
if (!inputs.previousSpecContent) {
|
|
47369
|
+
return {
|
|
47370
|
+
skipped: true,
|
|
47371
|
+
reason: "No existing Spec Hub content was available for comparison."
|
|
47372
|
+
};
|
|
47373
|
+
}
|
|
47374
|
+
const previous = await writeTempSpecFile(tempRoot, "previous-openapi.json", inputs.previousSpecContent);
|
|
47375
|
+
const current = await writeTempSpecFile(tempRoot, "current-openapi.json", inputs.currentUploadContent);
|
|
47376
|
+
return {
|
|
47377
|
+
current,
|
|
47378
|
+
label: "Spec Hub previous version -> incoming spec",
|
|
47379
|
+
previous,
|
|
47380
|
+
tempFiles: [previous, current]
|
|
47381
|
+
};
|
|
47382
|
+
}
|
|
47383
|
+
const currentPath = inputs.specPath ? resolveWorkspaceFilePath(inputs.specPath, workspaceRoot) : void 0;
|
|
47384
|
+
if (inputs.mode === "pr-native" && inputs.specPath && currentPath) {
|
|
47385
|
+
const gitSpecPath = workspaceRelativePath(inputs.specPath, workspaceRoot);
|
|
47386
|
+
for (const targetRef of targetBranchCandidates(inputs.targetRef, dependencies.env ?? process.env)) {
|
|
47387
|
+
const targetRefSpec = `${targetRef}:${gitSpecPath}`;
|
|
47388
|
+
if (await gitObjectExists(dependencies, targetRefSpec, workspaceRoot)) {
|
|
47389
|
+
return {
|
|
47390
|
+
current: gitSpecPath,
|
|
47391
|
+
label: `${targetRefSpec} -> ${gitSpecPath}`,
|
|
47392
|
+
previous: targetRefSpec,
|
|
47393
|
+
tempFiles: []
|
|
47394
|
+
};
|
|
47395
|
+
}
|
|
47396
|
+
}
|
|
47397
|
+
}
|
|
47398
|
+
const baselinePath = resolveWorkspaceFilePath(inputs.baselineSpecPath, workspaceRoot);
|
|
47399
|
+
if (baselinePath) {
|
|
47400
|
+
const current = currentPath ?? await writeTempSpecFile(
|
|
47401
|
+
tempRoot,
|
|
47402
|
+
"current-openapi.json",
|
|
47403
|
+
inputs.currentUploadContent
|
|
47404
|
+
);
|
|
47405
|
+
return {
|
|
47406
|
+
current,
|
|
47407
|
+
label: `${inputs.baselineSpecPath} -> ${inputs.specPath || "incoming spec"}`,
|
|
47408
|
+
previous: baselinePath,
|
|
47409
|
+
tempFiles: currentPath ? [] : [current]
|
|
47410
|
+
};
|
|
47411
|
+
}
|
|
47412
|
+
return {
|
|
47413
|
+
skipped: true,
|
|
47414
|
+
reason: inputs.mode === "baseline-only" ? `No baseline spec found at ${inputs.baselineSpecPath || "(empty)"}.` : "No target-branch spec or baseline spec was available for comparison."
|
|
47415
|
+
};
|
|
47416
|
+
}
|
|
47417
|
+
var ANSI_ESCAPE_PATTERN = new RegExp(String.raw`\u001B\[[0-?]*[ -/]*[@-~]`, "g");
|
|
47418
|
+
function stripAnsi(value) {
|
|
47419
|
+
return String(value || "").replace(ANSI_ESCAPE_PATTERN, "");
|
|
47420
|
+
}
|
|
47421
|
+
function sanitizeOpenApiChangesSummary(value) {
|
|
47422
|
+
return String(value || "").split(/\r?\n/).filter((line) => {
|
|
47423
|
+
const normalized = line.trim().replace(/\*\*/g, "");
|
|
47424
|
+
return !/^Date:\s.*\|\s*Commit:\s*Original:\s.*,\s*Modified:\s.*$/.test(normalized);
|
|
47425
|
+
}).join("\n").trim();
|
|
47426
|
+
}
|
|
47427
|
+
function breakingChangeCount(value) {
|
|
47428
|
+
if (Array.isArray(value)) {
|
|
47429
|
+
return value.reduce((total2, entry) => total2 + breakingChangeCount(entry), 0);
|
|
47430
|
+
}
|
|
47431
|
+
if (!value || typeof value !== "object") {
|
|
47432
|
+
return 0;
|
|
47433
|
+
}
|
|
47434
|
+
let total = 0;
|
|
47435
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
47436
|
+
const normalizedKey = key.toLowerCase().replace(/[^a-z]/g, "");
|
|
47437
|
+
if (entry === true && ["breaking", "breakingchange", "isbreaking", "isbreakingchange"].includes(normalizedKey)) {
|
|
47438
|
+
total += 1;
|
|
47439
|
+
continue;
|
|
47440
|
+
}
|
|
47441
|
+
total += breakingChangeCount(entry);
|
|
47442
|
+
}
|
|
47443
|
+
return total;
|
|
47444
|
+
}
|
|
47445
|
+
function formatReport(options) {
|
|
47446
|
+
const lines = [
|
|
47447
|
+
"# OpenAPI Breaking Change Check",
|
|
47448
|
+
"",
|
|
47449
|
+
`Status: ${options.status}`
|
|
47450
|
+
];
|
|
47451
|
+
if (options.comparison) {
|
|
47452
|
+
lines.push(`Comparison: ${options.comparison}`);
|
|
47453
|
+
}
|
|
47454
|
+
if (options.message) {
|
|
47455
|
+
lines.push("", options.message);
|
|
47456
|
+
}
|
|
47457
|
+
if (options.body?.trim()) {
|
|
47458
|
+
lines.push("", options.body.trim());
|
|
47459
|
+
}
|
|
47460
|
+
return `${lines.join("\n")}
|
|
47461
|
+
`;
|
|
47462
|
+
}
|
|
47463
|
+
async function writeReportFiles(summaryPath, logPath, report, log, env) {
|
|
47464
|
+
await (0, import_promises.mkdir)(import_node_path.default.dirname(summaryPath), { recursive: true });
|
|
47465
|
+
await (0, import_promises.mkdir)(import_node_path.default.dirname(logPath), { recursive: true });
|
|
47466
|
+
await (0, import_promises.writeFile)(summaryPath, report, "utf8");
|
|
47467
|
+
await (0, import_promises.writeFile)(logPath, log, "utf8");
|
|
47468
|
+
if (env.GITHUB_STEP_SUMMARY) {
|
|
47469
|
+
await (0, import_promises.appendFile)(env.GITHUB_STEP_SUMMARY, `
|
|
47470
|
+
${report}
|
|
47471
|
+
`, "utf8");
|
|
47472
|
+
}
|
|
47473
|
+
}
|
|
47474
|
+
function buildResultJson(result) {
|
|
47475
|
+
return JSON.stringify({
|
|
47476
|
+
breakingChanges: result.breakingChanges,
|
|
47477
|
+
comparison: result.comparison,
|
|
47478
|
+
exitCode: result.exitCode,
|
|
47479
|
+
logPath: result.logPath,
|
|
47480
|
+
message: result.message,
|
|
47481
|
+
mode: result.mode,
|
|
47482
|
+
status: result.status,
|
|
47483
|
+
summaryPath: result.summaryPath
|
|
47484
|
+
});
|
|
47485
|
+
}
|
|
47486
|
+
function createBreakingChangeSummaryJson(result) {
|
|
47487
|
+
return buildResultJson(result);
|
|
47488
|
+
}
|
|
47489
|
+
function mapPlatform() {
|
|
47490
|
+
const platforms = {
|
|
47491
|
+
aix: void 0,
|
|
47492
|
+
android: void 0,
|
|
47493
|
+
darwin: "darwin",
|
|
47494
|
+
freebsd: void 0,
|
|
47495
|
+
haiku: void 0,
|
|
47496
|
+
linux: "linux",
|
|
47497
|
+
openbsd: void 0,
|
|
47498
|
+
sunos: void 0,
|
|
47499
|
+
win32: "windows",
|
|
47500
|
+
cygwin: void 0,
|
|
47501
|
+
netbsd: void 0
|
|
47502
|
+
};
|
|
47503
|
+
const platform2 = platforms[process.platform];
|
|
47504
|
+
if (!platform2) {
|
|
47505
|
+
throw new Error(`Unsupported openapi-changes platform: ${process.platform}`);
|
|
47506
|
+
}
|
|
47507
|
+
return platform2;
|
|
47508
|
+
}
|
|
47509
|
+
function mapArch() {
|
|
47510
|
+
const architectures = {
|
|
47511
|
+
arm: void 0,
|
|
47512
|
+
arm64: "arm64",
|
|
47513
|
+
ia32: "i386",
|
|
47514
|
+
loong64: void 0,
|
|
47515
|
+
mips: void 0,
|
|
47516
|
+
mipsel: void 0,
|
|
47517
|
+
ppc: void 0,
|
|
47518
|
+
ppc64: void 0,
|
|
47519
|
+
riscv64: void 0,
|
|
47520
|
+
s390: void 0,
|
|
47521
|
+
s390x: void 0,
|
|
47522
|
+
x64: "x86_64"
|
|
47523
|
+
};
|
|
47524
|
+
const arch2 = architectures[process.arch];
|
|
47525
|
+
if (!arch2) {
|
|
47526
|
+
throw new Error(`Unsupported openapi-changes architecture: ${process.arch}`);
|
|
47527
|
+
}
|
|
47528
|
+
return arch2;
|
|
47529
|
+
}
|
|
47530
|
+
function sha256(filePath) {
|
|
47531
|
+
return (0, import_node_crypto.createHash)("sha256").update((0, import_node_fs.readFileSync)(filePath)).digest("hex");
|
|
47532
|
+
}
|
|
47533
|
+
function validatePinnedOpenApiChangesChecksums() {
|
|
47534
|
+
for (const [version, checksums] of Object.entries(CHECKSUMS)) {
|
|
47535
|
+
for (const [assetName, checksum] of Object.entries(checksums)) {
|
|
47536
|
+
if (!/^[a-f0-9]{64}$/.test(checksum)) {
|
|
47537
|
+
throw new Error(
|
|
47538
|
+
`Pinned checksum for ${assetName} in openapi-changes ${version} must be a 64-character lowercase SHA-256 hex digest`
|
|
47539
|
+
);
|
|
47540
|
+
}
|
|
47541
|
+
}
|
|
47542
|
+
}
|
|
47543
|
+
}
|
|
47544
|
+
function downloadFile(url, destination, redirectsRemaining = 5) {
|
|
47545
|
+
return new Promise((resolve4, reject) => {
|
|
47546
|
+
(0, import_node_https.get)(url, (response) => {
|
|
47547
|
+
const statusCode = response.statusCode || 0;
|
|
47548
|
+
const location2 = response.headers.location;
|
|
47549
|
+
if ([301, 302, 303, 307, 308].includes(statusCode) && location2) {
|
|
47550
|
+
response.resume();
|
|
47551
|
+
if (redirectsRemaining <= 0) {
|
|
47552
|
+
reject(new Error(`Too many redirects while downloading ${url}`));
|
|
47553
|
+
return;
|
|
47554
|
+
}
|
|
47555
|
+
const redirectedUrl = new URL(location2, url);
|
|
47556
|
+
if (redirectedUrl.protocol !== "https:") {
|
|
47557
|
+
reject(new Error(`Refusing non-HTTPS redirect for ${url}`));
|
|
47558
|
+
return;
|
|
47559
|
+
}
|
|
47560
|
+
downloadFile(redirectedUrl.toString(), destination, redirectsRemaining - 1).then(resolve4, reject);
|
|
47561
|
+
return;
|
|
47562
|
+
}
|
|
47563
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
47564
|
+
response.resume();
|
|
47565
|
+
reject(new Error(`Download failed for ${url}: HTTP ${statusCode}`));
|
|
47566
|
+
return;
|
|
47567
|
+
}
|
|
47568
|
+
const output = (0, import_node_fs.createWriteStream)(destination, { flags: "w" });
|
|
47569
|
+
response.pipe(output);
|
|
47570
|
+
output.on("finish", () => output.close(() => resolve4()));
|
|
47571
|
+
output.on("error", reject);
|
|
47572
|
+
}).on("error", reject);
|
|
47573
|
+
});
|
|
47574
|
+
}
|
|
47575
|
+
async function assertBinaryWorks(binaryPath, dependencies) {
|
|
47576
|
+
const result = await dependencies.exec.getExecOutput(binaryPath, ["version"], {
|
|
47577
|
+
ignoreReturnCode: true,
|
|
47578
|
+
silent: true
|
|
47579
|
+
});
|
|
47580
|
+
const installedVersion = result.stdout.trim();
|
|
47581
|
+
if (result.exitCode !== 0 || installedVersion !== OPENAPI_CHANGES_VERSION) {
|
|
47582
|
+
throw new Error(
|
|
47583
|
+
`Expected ${TOOL_NAME} ${OPENAPI_CHANGES_VERSION}, found ${installedVersion || "(unknown)"}.`
|
|
47584
|
+
);
|
|
47585
|
+
}
|
|
47586
|
+
}
|
|
47587
|
+
async function assertSafeTarEntries(archivePath, dependencies) {
|
|
47588
|
+
const listing = await dependencies.exec.getExecOutput("tar", ["-tzf", archivePath], {
|
|
47589
|
+
ignoreReturnCode: true,
|
|
47590
|
+
silent: true
|
|
47591
|
+
});
|
|
47592
|
+
if (listing.exitCode !== 0) {
|
|
47593
|
+
throw new Error(`Could not inspect ${TOOL_NAME} archive: ${listing.stderr}`);
|
|
47594
|
+
}
|
|
47595
|
+
for (const rawEntry of listing.stdout.split(/\r?\n/)) {
|
|
47596
|
+
const entry = rawEntry.trim();
|
|
47597
|
+
if (!entry) {
|
|
47598
|
+
continue;
|
|
47599
|
+
}
|
|
47600
|
+
if (entry.startsWith("/") || entry.startsWith("\\") || entry.includes("..")) {
|
|
47601
|
+
throw new Error(`Refusing unsafe archive entry: ${entry}`);
|
|
47602
|
+
}
|
|
47603
|
+
}
|
|
47604
|
+
}
|
|
47605
|
+
function findBinary(searchRoot, binaryName) {
|
|
47606
|
+
const entries = (0, import_node_fs.readdirSync)(searchRoot, { withFileTypes: true });
|
|
47607
|
+
for (const entry of entries) {
|
|
47608
|
+
const entryPath = import_node_path.default.join(searchRoot, entry.name);
|
|
47609
|
+
if (entry.isDirectory()) {
|
|
47610
|
+
const nested = findBinary(entryPath, binaryName);
|
|
47611
|
+
if (nested) {
|
|
47612
|
+
return nested;
|
|
47613
|
+
}
|
|
47614
|
+
} else if (entry.name === binaryName || entry.name === TOOL_NAME) {
|
|
47615
|
+
return entryPath;
|
|
47616
|
+
}
|
|
47617
|
+
}
|
|
47618
|
+
return "";
|
|
47619
|
+
}
|
|
47620
|
+
async function installOpenApiChanges(dependencies) {
|
|
47621
|
+
validatePinnedOpenApiChangesChecksums();
|
|
47622
|
+
const env = dependencies.env ?? process.env;
|
|
47623
|
+
const tempRoot = getTempRoot(env);
|
|
47624
|
+
const platform2 = mapPlatform();
|
|
47625
|
+
const arch2 = mapArch();
|
|
47626
|
+
const binaryName = process.platform === "win32" ? `${TOOL_NAME}.exe` : TOOL_NAME;
|
|
47627
|
+
const toolRoot = import_node_path.default.join(tempRoot, "postman-bootstrap-tools", TOOL_NAME, OPENAPI_CHANGES_VERSION, `${platform2}-${arch2}`);
|
|
47628
|
+
const binDir = import_node_path.default.join(toolRoot, "bin");
|
|
47629
|
+
const downloadsDir = import_node_path.default.join(toolRoot, "downloads");
|
|
47630
|
+
const extractDir = import_node_path.default.join(toolRoot, `extract-${Date.now()}`);
|
|
47631
|
+
const binaryPath = import_node_path.default.join(binDir, binaryName);
|
|
47632
|
+
if ((0, import_node_fs.existsSync)(binaryPath)) {
|
|
47633
|
+
try {
|
|
47634
|
+
await assertBinaryWorks(binaryPath, dependencies);
|
|
47635
|
+
dependencies.core.info(`${TOOL_NAME} ${OPENAPI_CHANGES_VERSION} already installed at ${binaryPath}`);
|
|
47636
|
+
return binaryPath;
|
|
47637
|
+
} catch (error2) {
|
|
47638
|
+
dependencies.core.warning(
|
|
47639
|
+
`Reinstalling ${TOOL_NAME}: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
47640
|
+
);
|
|
47641
|
+
(0, import_node_fs.rmSync)(binaryPath, { force: true });
|
|
47642
|
+
}
|
|
47643
|
+
}
|
|
47644
|
+
const assetName = `${TOOL_NAME}_${OPENAPI_CHANGES_VERSION}_${platform2}_${arch2}.tar.gz`;
|
|
47645
|
+
const expectedChecksum = CHECKSUMS[OPENAPI_CHANGES_VERSION]?.[assetName];
|
|
47646
|
+
if (!expectedChecksum) {
|
|
47647
|
+
throw new Error(`No pinned checksum is configured for ${assetName}.`);
|
|
47648
|
+
}
|
|
47649
|
+
(0, import_node_fs.mkdirSync)(binDir, { recursive: true });
|
|
47650
|
+
(0, import_node_fs.mkdirSync)(downloadsDir, { recursive: true });
|
|
47651
|
+
(0, import_node_fs.mkdirSync)(extractDir, { recursive: true });
|
|
47652
|
+
const archivePath = import_node_path.default.join(downloadsDir, assetName);
|
|
47653
|
+
await downloadFile(`${RELEASE_BASE_URL}/${assetName}`, archivePath);
|
|
47654
|
+
const actualChecksum = sha256(archivePath);
|
|
47655
|
+
if (actualChecksum !== expectedChecksum) {
|
|
47656
|
+
throw new Error(`Checksum mismatch for ${assetName}: expected ${expectedChecksum}, got ${actualChecksum}`);
|
|
47657
|
+
}
|
|
47658
|
+
await assertSafeTarEntries(archivePath, dependencies);
|
|
47659
|
+
await dependencies.exec.exec("tar", ["-xzf", archivePath, "-C", extractDir], {
|
|
47660
|
+
silent: true
|
|
47661
|
+
});
|
|
47662
|
+
const extractedBinary = findBinary(extractDir, binaryName);
|
|
47663
|
+
if (!extractedBinary) {
|
|
47664
|
+
throw new Error(`Could not find ${binaryName} in ${assetName}.`);
|
|
47665
|
+
}
|
|
47666
|
+
(0, import_node_fs.rmSync)(binaryPath, { force: true });
|
|
47667
|
+
(0, import_node_fs.copyFileSync)(extractedBinary, binaryPath);
|
|
47668
|
+
if (process.platform !== "win32") {
|
|
47669
|
+
(0, import_node_fs.chmodSync)(binaryPath, 493);
|
|
47670
|
+
}
|
|
47671
|
+
(0, import_node_fs.rmSync)(extractDir, { recursive: true, force: true });
|
|
47672
|
+
await assertBinaryWorks(binaryPath, dependencies);
|
|
47673
|
+
dependencies.core.info(`Installed ${TOOL_NAME} ${OPENAPI_CHANGES_VERSION} at ${binaryPath}`);
|
|
47674
|
+
return binaryPath;
|
|
47675
|
+
}
|
|
47676
|
+
function rulesArgs(rulesPath, workspaceRoot, tempRoot) {
|
|
47677
|
+
const resolved = resolveWorkspaceFilePath(rulesPath, workspaceRoot);
|
|
47678
|
+
if (resolved) {
|
|
47679
|
+
return ["--config", resolved];
|
|
47680
|
+
}
|
|
47681
|
+
const defaultRulesPath = import_node_path.default.join(tempRoot, "postman-bootstrap", "openapi-changes-default-rules.yaml");
|
|
47682
|
+
(0, import_node_fs.mkdirSync)(import_node_path.default.dirname(defaultRulesPath), { recursive: true });
|
|
47683
|
+
(0, import_node_fs.writeFileSync)(defaultRulesPath, "{}\n", "utf8");
|
|
47684
|
+
return ["--config", defaultRulesPath];
|
|
47685
|
+
}
|
|
47686
|
+
var runOpenApiBreakingChangeCheck = async (inputs, dependencies) => {
|
|
47687
|
+
const env = dependencies.env ?? process.env;
|
|
47688
|
+
const workspaceRoot = getWorkspaceRoot(env);
|
|
47689
|
+
const tempRoot = getTempRoot(env);
|
|
47690
|
+
if (inputs.mode === "off") {
|
|
47691
|
+
return {
|
|
47692
|
+
breakingChanges: 0,
|
|
47693
|
+
comparison: "",
|
|
47694
|
+
exitCode: 0,
|
|
47695
|
+
logPath: "",
|
|
47696
|
+
message: "Breaking-change check is disabled.",
|
|
47697
|
+
mode: inputs.mode,
|
|
47698
|
+
status: "skipped",
|
|
47699
|
+
summaryPath: ""
|
|
47700
|
+
};
|
|
47701
|
+
}
|
|
47702
|
+
const summaryPath = resolveConfiguredOutputPath(
|
|
47703
|
+
inputs.summaryPath,
|
|
47704
|
+
"openapi-changes-summary.md",
|
|
47705
|
+
workspaceRoot,
|
|
47706
|
+
tempRoot
|
|
47707
|
+
);
|
|
47708
|
+
const logPath = resolveConfiguredOutputPath(
|
|
47709
|
+
inputs.logPath,
|
|
47710
|
+
"openapi-changes.log",
|
|
47711
|
+
workspaceRoot,
|
|
47712
|
+
tempRoot
|
|
47713
|
+
);
|
|
47714
|
+
const source = await resolveComparisonSource(inputs, dependencies, workspaceRoot, tempRoot);
|
|
47715
|
+
if ("skipped" in source) {
|
|
47716
|
+
const report = formatReport({
|
|
47717
|
+
message: source.reason,
|
|
47718
|
+
status: "skipped"
|
|
47719
|
+
});
|
|
47720
|
+
await writeReportFiles(summaryPath, logPath, report, source.reason, env);
|
|
47721
|
+
return {
|
|
47722
|
+
breakingChanges: 0,
|
|
47723
|
+
comparison: "",
|
|
47724
|
+
exitCode: 0,
|
|
47725
|
+
logPath,
|
|
47726
|
+
message: source.reason,
|
|
47727
|
+
mode: inputs.mode,
|
|
47728
|
+
status: "skipped",
|
|
47729
|
+
summaryPath
|
|
47730
|
+
};
|
|
47731
|
+
}
|
|
47732
|
+
try {
|
|
47733
|
+
const binaryPath = await installOpenApiChanges(dependencies);
|
|
47734
|
+
const configArgs = rulesArgs(inputs.rulesPath, workspaceRoot, tempRoot);
|
|
47735
|
+
const reportArgs = [
|
|
47736
|
+
"report",
|
|
47737
|
+
"--reproducible",
|
|
47738
|
+
"--no-color",
|
|
47739
|
+
...configArgs,
|
|
47740
|
+
source.previous,
|
|
47741
|
+
source.current
|
|
47742
|
+
];
|
|
47743
|
+
const reportResult = await dependencies.exec.getExecOutput(binaryPath, reportArgs, {
|
|
47744
|
+
cwd: workspaceRoot,
|
|
47745
|
+
ignoreReturnCode: true,
|
|
47746
|
+
silent: true
|
|
47747
|
+
});
|
|
47748
|
+
const reportStdout = stripAnsi(reportResult.stdout);
|
|
47749
|
+
const reportStderr = stripAnsi(reportResult.stderr);
|
|
47750
|
+
let breakingChanges = 0;
|
|
47751
|
+
let parsedReport = false;
|
|
47752
|
+
if (reportStdout.trim()) {
|
|
47753
|
+
try {
|
|
47754
|
+
breakingChanges = breakingChangeCount(JSON.parse(reportStdout));
|
|
47755
|
+
parsedReport = true;
|
|
47756
|
+
} catch (error2) {
|
|
47757
|
+
dependencies.core.warning(
|
|
47758
|
+
`Could not parse openapi-changes JSON report: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
47759
|
+
);
|
|
47760
|
+
}
|
|
47761
|
+
}
|
|
47762
|
+
const summaryArgs = [
|
|
47763
|
+
"summary",
|
|
47764
|
+
"--markdown",
|
|
47765
|
+
"--no-logo",
|
|
47766
|
+
"--no-color",
|
|
47767
|
+
"--with-lines",
|
|
47768
|
+
...configArgs,
|
|
47769
|
+
source.previous,
|
|
47770
|
+
source.current
|
|
47771
|
+
];
|
|
47772
|
+
const summaryResult = await dependencies.exec.getExecOutput(binaryPath, summaryArgs, {
|
|
47773
|
+
cwd: workspaceRoot,
|
|
47774
|
+
ignoreReturnCode: true,
|
|
47775
|
+
silent: true
|
|
47776
|
+
});
|
|
47777
|
+
const summaryStdout = sanitizeOpenApiChangesSummary(stripAnsi(summaryResult.stdout));
|
|
47778
|
+
const summaryStderr = stripAnsi(summaryResult.stderr);
|
|
47779
|
+
const commandFailed = reportResult.exitCode !== 0 && !parsedReport || summaryResult.exitCode !== 0 && !summaryStdout.trim() && breakingChanges === 0;
|
|
47780
|
+
const status = commandFailed || breakingChanges > 0 ? "failed" : "passed";
|
|
47781
|
+
const message = commandFailed ? "openapi-changes failed while comparing specifications." : breakingChanges > 0 ? `${breakingChanges} breaking change marker${breakingChanges === 1 ? "" : "s"} detected.` : "No breaking changes detected.";
|
|
47782
|
+
const report = formatReport({
|
|
47783
|
+
body: summaryStdout || message,
|
|
47784
|
+
comparison: source.label,
|
|
47785
|
+
message,
|
|
47786
|
+
status
|
|
47787
|
+
});
|
|
47788
|
+
const log = [
|
|
47789
|
+
`report exit code: ${reportResult.exitCode}`,
|
|
47790
|
+
reportStderr.trim(),
|
|
47791
|
+
`summary exit code: ${summaryResult.exitCode}`,
|
|
47792
|
+
summaryStderr.trim()
|
|
47793
|
+
].filter(Boolean).join("\n\n");
|
|
47794
|
+
await writeReportFiles(summaryPath, logPath, report, log, env);
|
|
47795
|
+
return {
|
|
47796
|
+
breakingChanges,
|
|
47797
|
+
comparison: source.label,
|
|
47798
|
+
exitCode: status === "failed" ? 1 : 0,
|
|
47799
|
+
logPath,
|
|
47800
|
+
message,
|
|
47801
|
+
mode: inputs.mode,
|
|
47802
|
+
status,
|
|
47803
|
+
summaryPath
|
|
47804
|
+
};
|
|
47805
|
+
} finally {
|
|
47806
|
+
for (const tempFile of source.tempFiles) {
|
|
47807
|
+
await removeTempSpecFile(tempFile);
|
|
47808
|
+
}
|
|
47809
|
+
}
|
|
47810
|
+
};
|
|
47811
|
+
|
|
47189
47812
|
// src/lib/postman/base-urls.ts
|
|
47190
47813
|
var POSTMAN_ENDPOINT_PROFILES = {
|
|
47191
47814
|
prod: {
|
|
@@ -47368,8 +47991,8 @@ var PostmanAssetsClient = class {
|
|
|
47368
47991
|
...team.organizationId != null ? { organizationId: Number(team.organizationId) } : {}
|
|
47369
47992
|
})) : [];
|
|
47370
47993
|
}
|
|
47371
|
-
async request(
|
|
47372
|
-
const url =
|
|
47994
|
+
async request(path8, init = {}) {
|
|
47995
|
+
const url = path8.startsWith("http") ? path8 : `${this.baseUrl}${path8}`;
|
|
47373
47996
|
const response = await this.fetchImpl(url, {
|
|
47374
47997
|
...init,
|
|
47375
47998
|
headers: {
|
|
@@ -48154,8 +48777,8 @@ function createInternalIntegrationAdapter(options) {
|
|
|
48154
48777
|
}
|
|
48155
48778
|
|
|
48156
48779
|
// src/lib/spec/safe-spec-fetch.ts
|
|
48157
|
-
var
|
|
48158
|
-
var
|
|
48780
|
+
var import_promises2 = require("node:dns/promises");
|
|
48781
|
+
var import_node_https2 = require("node:https");
|
|
48159
48782
|
var import_node_net = require("node:net");
|
|
48160
48783
|
var import_node_url = require("node:url");
|
|
48161
48784
|
var SAFE_FETCH_LIMITS = {
|
|
@@ -48288,7 +48911,7 @@ function validateSafeHttpsUrl(input) {
|
|
|
48288
48911
|
return url;
|
|
48289
48912
|
}
|
|
48290
48913
|
async function defaultLookup(hostname) {
|
|
48291
|
-
const results = await (0,
|
|
48914
|
+
const results = await (0, import_promises2.lookup)(hostname, { all: true, verbatim: true });
|
|
48292
48915
|
return results.map((entry) => ({ address: entry.address, family: entry.family }));
|
|
48293
48916
|
}
|
|
48294
48917
|
function createPinnedLookup(pinnedAddress, family) {
|
|
@@ -48325,7 +48948,7 @@ async function defaultTransport(url, options) {
|
|
|
48325
48948
|
timeout: options.timeoutMs,
|
|
48326
48949
|
lookup: createPinnedLookup(options.pinnedAddress, options.family)
|
|
48327
48950
|
};
|
|
48328
|
-
const req = (0,
|
|
48951
|
+
const req = (0, import_node_https2.request)(requestOptions, (res) => {
|
|
48329
48952
|
const remoteAddress = res.socket?.remoteAddress;
|
|
48330
48953
|
const chunks = [];
|
|
48331
48954
|
let bytes = 0;
|
|
@@ -48575,8 +49198,8 @@ function normalizeRepoUrl(url) {
|
|
|
48575
49198
|
const sshMatch = raw.match(/^git@([^:]+):(.+?)(?:\.git)?$/);
|
|
48576
49199
|
if (sshMatch) {
|
|
48577
49200
|
const host = sshMatch[1];
|
|
48578
|
-
const
|
|
48579
|
-
return `https://${host}/${
|
|
49201
|
+
const path8 = sshMatch[2];
|
|
49202
|
+
return `https://${host}/${path8}`;
|
|
48580
49203
|
}
|
|
48581
49204
|
return raw.replace(/\.git$/, "");
|
|
48582
49205
|
}
|
|
@@ -48896,8 +49519,8 @@ function safeDecodeSegment(segment) {
|
|
|
48896
49519
|
return segment;
|
|
48897
49520
|
}
|
|
48898
49521
|
}
|
|
48899
|
-
function normalizePath(
|
|
48900
|
-
const raw = String(
|
|
49522
|
+
function normalizePath(path8) {
|
|
49523
|
+
const raw = String(path8 || "").split(/[?#]/, 1)[0] || "/";
|
|
48901
49524
|
const withSlash = raw.startsWith("/") ? raw : `/${raw}`;
|
|
48902
49525
|
const normalized = withSlash.replace(/\/+/g, "/");
|
|
48903
49526
|
const trimmed = normalized.length > 1 ? normalized.replace(/\/+$/g, "") : normalized;
|
|
@@ -48921,8 +49544,8 @@ function serverPathPrefix(url) {
|
|
|
48921
49544
|
return normalizePath(noProtocol).replace(/__server_variable__/g, "{serverVariable}");
|
|
48922
49545
|
}
|
|
48923
49546
|
}
|
|
48924
|
-
function joinPaths(prefix,
|
|
48925
|
-
return normalizePath(`${prefix}/${
|
|
49547
|
+
function joinPaths(prefix, path8) {
|
|
49548
|
+
return normalizePath(`${prefix}/${path8}`.replace(/\/+/g, "/"));
|
|
48926
49549
|
}
|
|
48927
49550
|
function normalizeResponseKey(status) {
|
|
48928
49551
|
const raw = String(status);
|
|
@@ -49026,7 +49649,7 @@ function buildContractIndex(root) {
|
|
|
49026
49649
|
const warnings = [];
|
|
49027
49650
|
if (asRecord3(root.webhooks)) warnings.push("CONTRACT_WEBHOOKS_NOT_VALIDATED: OpenAPI webhooks are not validated by dynamic contract tests");
|
|
49028
49651
|
if (paths) {
|
|
49029
|
-
for (const [
|
|
49652
|
+
for (const [path8, rawPathItem] of Object.entries(paths)) {
|
|
49030
49653
|
const pathItem = resolveInternalRef(root, rawPathItem);
|
|
49031
49654
|
if (!pathItem) continue;
|
|
49032
49655
|
for (const [method, rawOperation] of Object.entries(pathItem)) {
|
|
@@ -49034,10 +49657,10 @@ function buildContractIndex(root) {
|
|
|
49034
49657
|
if (!HTTP_METHODS.has(lowerMethod)) continue;
|
|
49035
49658
|
const operation = resolveInternalRef(root, rawOperation);
|
|
49036
49659
|
if (!operation) continue;
|
|
49037
|
-
if (operation.callbacks) warnings.push(`CONTRACT_CALLBACKS_NOT_VALIDATED: callbacks are not validated for ${lowerMethod.toUpperCase()} ${
|
|
49660
|
+
if (operation.callbacks) warnings.push(`CONTRACT_CALLBACKS_NOT_VALIDATED: callbacks are not validated for ${lowerMethod.toUpperCase()} ${path8}`);
|
|
49038
49661
|
const responses = asRecord3(operation.responses);
|
|
49039
49662
|
if (!responses || Object.keys(responses).length === 0) {
|
|
49040
|
-
throw new Error(`CONTRACT_OPERATION_NO_RESPONSES: ${lowerMethod.toUpperCase()} ${
|
|
49663
|
+
throw new Error(`CONTRACT_OPERATION_NO_RESPONSES: ${lowerMethod.toUpperCase()} ${path8} must define at least one response`);
|
|
49041
49664
|
}
|
|
49042
49665
|
const contractResponses = {};
|
|
49043
49666
|
for (const [status, rawResponse] of Object.entries(responses)) {
|
|
@@ -49052,8 +49675,8 @@ function buildContractIndex(root) {
|
|
|
49052
49675
|
};
|
|
49053
49676
|
}
|
|
49054
49677
|
const candidates = [...new Set([
|
|
49055
|
-
|
|
49056
|
-
...operationServers(root, pathItem, operation).map((server) => joinPaths(serverPathPrefix(server),
|
|
49678
|
+
path8,
|
|
49679
|
+
...operationServers(root, pathItem, operation).map((server) => joinPaths(serverPathPrefix(server), path8))
|
|
49057
49680
|
].map(normalizePath))];
|
|
49058
49681
|
const opWarnings = [];
|
|
49059
49682
|
opWarnings.push(...collectSecuritySchemeWarnings(root, operation));
|
|
@@ -49062,10 +49685,10 @@ function buildContractIndex(root) {
|
|
|
49062
49685
|
opWarnings.push(`CONTRACT_SECURITY_NOT_VALIDATED: security parameter ${parameter.in}:${parameter.name} is not statically required in generated requests`);
|
|
49063
49686
|
}
|
|
49064
49687
|
operations.push({
|
|
49065
|
-
id: `${lowerMethod.toUpperCase()} ${
|
|
49688
|
+
id: `${lowerMethod.toUpperCase()} ${path8}`,
|
|
49066
49689
|
method: lowerMethod.toUpperCase(),
|
|
49067
|
-
path:
|
|
49068
|
-
pointer: `/paths/${
|
|
49690
|
+
path: path8,
|
|
49691
|
+
pointer: `/paths/${path8.replace(/~/g, "~0").replace(/\//g, "~1")}/${lowerMethod}`,
|
|
49069
49692
|
candidates,
|
|
49070
49693
|
responses: contractResponses,
|
|
49071
49694
|
requiredParameters,
|
|
@@ -49162,8 +49785,8 @@ function requestPath(request) {
|
|
|
49162
49785
|
if (typeof urlRecord.raw === "string") return pathFromRaw(urlRecord.raw);
|
|
49163
49786
|
return "/";
|
|
49164
49787
|
}
|
|
49165
|
-
function segments(
|
|
49166
|
-
return normalizePath(
|
|
49788
|
+
function segments(path8) {
|
|
49789
|
+
return normalizePath(path8).split("/").filter(Boolean);
|
|
49167
49790
|
}
|
|
49168
49791
|
function isTemplateSegment(segment) {
|
|
49169
49792
|
return /^\{[^}]+\}$/.test(segment) || /^:[^/]+$/.test(segment) || /^\{\{[^}]+\}\}$/.test(segment) || /^<[^>]+>$/.test(segment);
|
|
@@ -49189,8 +49812,8 @@ function matchCandidate(candidate, request) {
|
|
|
49189
49812
|
function matchOperation(index, request) {
|
|
49190
49813
|
const record = asRecord4(request);
|
|
49191
49814
|
const method = String(record?.method || "").toUpperCase();
|
|
49192
|
-
const
|
|
49193
|
-
const candidates = index.operations.filter((operation) => operation.method === method).flatMap((operation) => operation.candidates.map((candidate) => ({ operation, score: matchCandidate(candidate,
|
|
49815
|
+
const path8 = requestPath(request);
|
|
49816
|
+
const candidates = index.operations.filter((operation) => operation.method === method).flatMap((operation) => operation.candidates.map((candidate) => ({ operation, score: matchCandidate(candidate, path8), serverFull: candidate !== normalizePath(operation.path) }))).filter((entry) => entry.score.matched).map((entry) => ({ operation: entry.operation, score: [entry.score.staticCount, entry.serverFull ? 2 : 1, -entry.score.templateCount] })).sort((a, b) => {
|
|
49194
49817
|
for (let index2 = 0; index2 < a.score.length; index2 += 1) {
|
|
49195
49818
|
const delta = b.score[index2] - a.score[index2];
|
|
49196
49819
|
if (delta !== 0) return delta;
|
|
@@ -49198,11 +49821,11 @@ function matchOperation(index, request) {
|
|
|
49198
49821
|
return a.operation.id.localeCompare(b.operation.id);
|
|
49199
49822
|
});
|
|
49200
49823
|
const best = candidates[0];
|
|
49201
|
-
if (!best) return { path:
|
|
49824
|
+
if (!best) return { path: path8, method };
|
|
49202
49825
|
const tied = candidates.filter((entry) => entry.score.every((value, index2) => value === best.score[index2]));
|
|
49203
49826
|
const uniqueTied = [...new Map(tied.map((entry) => [entry.operation.id, entry.operation])).values()];
|
|
49204
|
-
if (uniqueTied.length > 1) return { path:
|
|
49205
|
-
return { path:
|
|
49827
|
+
if (uniqueTied.length > 1) return { path: path8, method, ambiguous: uniqueTied };
|
|
49828
|
+
return { path: path8, method, operation: best.operation };
|
|
49206
49829
|
}
|
|
49207
49830
|
function assignValidator(lines, target, source) {
|
|
49208
49831
|
lines.push(`${target} = ${source};`);
|
|
@@ -49487,10 +50110,10 @@ function instrumentContractCollection(collection, index) {
|
|
|
49487
50110
|
}
|
|
49488
50111
|
|
|
49489
50112
|
// src/lib/spec/openapi-loader.ts
|
|
49490
|
-
var
|
|
49491
|
-
var
|
|
50113
|
+
var import_node_fs2 = require("node:fs");
|
|
50114
|
+
var import_promises3 = require("node:fs/promises");
|
|
49492
50115
|
var import_node_url2 = require("node:url");
|
|
49493
|
-
var
|
|
50116
|
+
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
49494
50117
|
|
|
49495
50118
|
// node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js
|
|
49496
50119
|
var win32Sep = "\\";
|
|
@@ -49547,59 +50170,59 @@ function cwd() {
|
|
|
49547
50170
|
return href;
|
|
49548
50171
|
}
|
|
49549
50172
|
if (typeof process !== "undefined" && process.cwd) {
|
|
49550
|
-
const
|
|
49551
|
-
const lastChar =
|
|
50173
|
+
const path8 = process.cwd();
|
|
50174
|
+
const lastChar = path8.slice(-1);
|
|
49552
50175
|
if (lastChar === "/" || lastChar === "\\") {
|
|
49553
|
-
return
|
|
50176
|
+
return path8;
|
|
49554
50177
|
} else {
|
|
49555
|
-
return
|
|
50178
|
+
return path8 + "/";
|
|
49556
50179
|
}
|
|
49557
50180
|
}
|
|
49558
50181
|
return "/";
|
|
49559
50182
|
}
|
|
49560
|
-
function getProtocol(
|
|
49561
|
-
const match = protocolPattern.exec(
|
|
50183
|
+
function getProtocol(path8) {
|
|
50184
|
+
const match = protocolPattern.exec(path8 || "");
|
|
49562
50185
|
if (match) {
|
|
49563
50186
|
return match[1].toLowerCase();
|
|
49564
50187
|
}
|
|
49565
50188
|
return void 0;
|
|
49566
50189
|
}
|
|
49567
|
-
function getExtension(
|
|
49568
|
-
const lastDot =
|
|
50190
|
+
function getExtension(path8) {
|
|
50191
|
+
const lastDot = path8.lastIndexOf(".");
|
|
49569
50192
|
if (lastDot >= 0) {
|
|
49570
|
-
return stripQuery(
|
|
50193
|
+
return stripQuery(path8.substring(lastDot).toLowerCase());
|
|
49571
50194
|
}
|
|
49572
50195
|
return "";
|
|
49573
50196
|
}
|
|
49574
|
-
function stripQuery(
|
|
49575
|
-
const queryIndex =
|
|
50197
|
+
function stripQuery(path8) {
|
|
50198
|
+
const queryIndex = path8.indexOf("?");
|
|
49576
50199
|
if (queryIndex >= 0) {
|
|
49577
|
-
|
|
50200
|
+
path8 = path8.substring(0, queryIndex);
|
|
49578
50201
|
}
|
|
49579
|
-
return
|
|
50202
|
+
return path8;
|
|
49580
50203
|
}
|
|
49581
|
-
function getHash(
|
|
49582
|
-
if (!
|
|
50204
|
+
function getHash(path8) {
|
|
50205
|
+
if (!path8) {
|
|
49583
50206
|
return "#";
|
|
49584
50207
|
}
|
|
49585
|
-
const hashIndex =
|
|
50208
|
+
const hashIndex = path8.indexOf("#");
|
|
49586
50209
|
if (hashIndex >= 0) {
|
|
49587
|
-
return
|
|
50210
|
+
return path8.substring(hashIndex);
|
|
49588
50211
|
}
|
|
49589
50212
|
return "#";
|
|
49590
50213
|
}
|
|
49591
|
-
function stripHash(
|
|
49592
|
-
if (!
|
|
50214
|
+
function stripHash(path8) {
|
|
50215
|
+
if (!path8) {
|
|
49593
50216
|
return "";
|
|
49594
50217
|
}
|
|
49595
|
-
const hashIndex =
|
|
50218
|
+
const hashIndex = path8.indexOf("#");
|
|
49596
50219
|
if (hashIndex >= 0) {
|
|
49597
|
-
|
|
50220
|
+
path8 = path8.substring(0, hashIndex);
|
|
49598
50221
|
}
|
|
49599
|
-
return
|
|
50222
|
+
return path8;
|
|
49600
50223
|
}
|
|
49601
|
-
function isHttp(
|
|
49602
|
-
const protocol = getProtocol(
|
|
50224
|
+
function isHttp(path8) {
|
|
50225
|
+
const protocol = getProtocol(path8);
|
|
49603
50226
|
if (protocol === "http" || protocol === "https") {
|
|
49604
50227
|
return true;
|
|
49605
50228
|
} else if (protocol === void 0) {
|
|
@@ -49608,11 +50231,11 @@ function isHttp(path7) {
|
|
|
49608
50231
|
return false;
|
|
49609
50232
|
}
|
|
49610
50233
|
}
|
|
49611
|
-
function isUnsafeUrl(
|
|
49612
|
-
if (!
|
|
50234
|
+
function isUnsafeUrl(path8) {
|
|
50235
|
+
if (!path8 || typeof path8 !== "string") {
|
|
49613
50236
|
return true;
|
|
49614
50237
|
}
|
|
49615
|
-
const normalizedPath =
|
|
50238
|
+
const normalizedPath = path8.trim().toLowerCase();
|
|
49616
50239
|
if (!normalizedPath) {
|
|
49617
50240
|
return true;
|
|
49618
50241
|
}
|
|
@@ -49743,22 +50366,22 @@ function isInternalPort(port) {
|
|
|
49743
50366
|
];
|
|
49744
50367
|
return internalPorts.includes(port);
|
|
49745
50368
|
}
|
|
49746
|
-
function isFileSystemPath(
|
|
50369
|
+
function isFileSystemPath(path8) {
|
|
49747
50370
|
if (typeof window !== "undefined" || typeof process !== "undefined" && process.browser) {
|
|
49748
50371
|
return false;
|
|
49749
50372
|
}
|
|
49750
|
-
const protocol = getProtocol(
|
|
50373
|
+
const protocol = getProtocol(path8);
|
|
49751
50374
|
return protocol === void 0 || protocol === "file";
|
|
49752
50375
|
}
|
|
49753
|
-
function fromFileSystemPath(
|
|
50376
|
+
function fromFileSystemPath(path8) {
|
|
49754
50377
|
if (isWindows2()) {
|
|
49755
50378
|
const projectDir = cwd();
|
|
49756
|
-
const upperPath =
|
|
50379
|
+
const upperPath = path8.toUpperCase();
|
|
49757
50380
|
const projectDirPosixPath = convertPathToPosix(projectDir);
|
|
49758
50381
|
const posixUpper = projectDirPosixPath.toUpperCase();
|
|
49759
50382
|
const hasProjectDir = upperPath.includes(posixUpper);
|
|
49760
50383
|
const hasProjectUri = upperPath.includes(posixUpper);
|
|
49761
|
-
const isAbsolutePath = isAbsoluteWin32Path.test(
|
|
50384
|
+
const isAbsolutePath = isAbsoluteWin32Path.test(path8) || path8.startsWith("http://") || path8.startsWith("https://") || path8.startsWith("file://");
|
|
49762
50385
|
if (!(hasProjectDir || hasProjectUri || isAbsolutePath) && !projectDir.startsWith("http")) {
|
|
49763
50386
|
const join3 = (a, b) => {
|
|
49764
50387
|
if (a.endsWith("/") || a.endsWith("\\")) {
|
|
@@ -49767,42 +50390,42 @@ function fromFileSystemPath(path7) {
|
|
|
49767
50390
|
return a + "/" + b;
|
|
49768
50391
|
}
|
|
49769
50392
|
};
|
|
49770
|
-
|
|
50393
|
+
path8 = join3(projectDir, path8);
|
|
49771
50394
|
}
|
|
49772
|
-
|
|
50395
|
+
path8 = convertPathToPosix(path8);
|
|
49773
50396
|
}
|
|
49774
|
-
|
|
50397
|
+
path8 = encodeURI(path8);
|
|
49775
50398
|
for (const pattern of urlEncodePatterns) {
|
|
49776
|
-
|
|
50399
|
+
path8 = path8.replace(pattern[0], pattern[1]);
|
|
49777
50400
|
}
|
|
49778
|
-
return
|
|
50401
|
+
return path8;
|
|
49779
50402
|
}
|
|
49780
|
-
function toFileSystemPath(
|
|
49781
|
-
|
|
49782
|
-
|
|
50403
|
+
function toFileSystemPath(path8, keepFileProtocol) {
|
|
50404
|
+
path8 = path8.replace(/%(?![0-9A-Fa-f]{2})/g, "%25");
|
|
50405
|
+
path8 = decodeURI(path8);
|
|
49783
50406
|
for (let i = 0; i < urlDecodePatterns.length; i += 2) {
|
|
49784
|
-
|
|
50407
|
+
path8 = path8.replace(urlDecodePatterns[i], urlDecodePatterns[i + 1]);
|
|
49785
50408
|
}
|
|
49786
|
-
let isFileUrl =
|
|
50409
|
+
let isFileUrl = path8.toLowerCase().startsWith("file://");
|
|
49787
50410
|
if (isFileUrl) {
|
|
49788
|
-
|
|
49789
|
-
if (isWindows2() &&
|
|
49790
|
-
|
|
50411
|
+
path8 = path8.replace(/^file:\/\//, "").replace(/^\//, "");
|
|
50412
|
+
if (isWindows2() && path8[1] === "/") {
|
|
50413
|
+
path8 = `${path8[0]}:${path8.substring(1)}`;
|
|
49791
50414
|
}
|
|
49792
50415
|
if (keepFileProtocol) {
|
|
49793
|
-
|
|
50416
|
+
path8 = "file:///" + path8;
|
|
49794
50417
|
} else {
|
|
49795
50418
|
isFileUrl = false;
|
|
49796
|
-
|
|
50419
|
+
path8 = isWindows2() ? path8 : "/" + path8;
|
|
49797
50420
|
}
|
|
49798
50421
|
}
|
|
49799
50422
|
if (isWindows2() && !isFileUrl) {
|
|
49800
|
-
|
|
49801
|
-
if (
|
|
49802
|
-
|
|
50423
|
+
path8 = path8.replace(forwardSlashPattern, "\\");
|
|
50424
|
+
if (path8.match(/^[a-z]:\\/i)) {
|
|
50425
|
+
path8 = path8[0].toUpperCase() + path8.substring(1);
|
|
49803
50426
|
}
|
|
49804
50427
|
}
|
|
49805
|
-
return
|
|
50428
|
+
return path8;
|
|
49806
50429
|
}
|
|
49807
50430
|
function safePointerToPath(pointer) {
|
|
49808
50431
|
if (pointer.length <= 1 || pointer[0] !== "#" || pointer[1] !== "/") {
|
|
@@ -49923,8 +50546,8 @@ var MissingPointerError = class extends JSONParserError {
|
|
|
49923
50546
|
targetRef;
|
|
49924
50547
|
targetFound;
|
|
49925
50548
|
parentPath;
|
|
49926
|
-
constructor(token,
|
|
49927
|
-
super(`Missing $ref pointer "${getHash(
|
|
50549
|
+
constructor(token, path8, targetRef, targetFound, parentPath) {
|
|
50550
|
+
super(`Missing $ref pointer "${getHash(path8)}". Token "${token}" does not exist.`, stripHash(path8));
|
|
49928
50551
|
this.targetToken = token;
|
|
49929
50552
|
this.targetRef = targetRef;
|
|
49930
50553
|
this.targetFound = targetFound;
|
|
@@ -49941,8 +50564,8 @@ var TimeoutError = class extends JSONParserError {
|
|
|
49941
50564
|
var InvalidPointerError = class extends JSONParserError {
|
|
49942
50565
|
code = "EUNMATCHEDRESOLVER";
|
|
49943
50566
|
name = "InvalidPointerError";
|
|
49944
|
-
constructor(pointer,
|
|
49945
|
-
super(`Invalid $ref pointer "${pointer}". Pointers must begin with "#/"`, stripHash(
|
|
50567
|
+
constructor(pointer, path8) {
|
|
50568
|
+
super(`Invalid $ref pointer "${pointer}". Pointers must begin with "#/"`, stripHash(path8));
|
|
49946
50569
|
}
|
|
49947
50570
|
};
|
|
49948
50571
|
function isHandledError(err) {
|
|
@@ -50036,11 +50659,11 @@ var Pointer = class _Pointer {
|
|
|
50036
50659
|
* Resolving a single pointer may require resolving multiple $Refs.
|
|
50037
50660
|
*/
|
|
50038
50661
|
indirections;
|
|
50039
|
-
constructor($ref,
|
|
50662
|
+
constructor($ref, path8, friendlyPath) {
|
|
50040
50663
|
this.$ref = $ref;
|
|
50041
|
-
this.path =
|
|
50042
|
-
this.originalPath = friendlyPath ||
|
|
50043
|
-
this.scopeBase = $ref.path || stripHash(
|
|
50664
|
+
this.path = path8;
|
|
50665
|
+
this.originalPath = friendlyPath || path8;
|
|
50666
|
+
this.scopeBase = $ref.path || stripHash(path8);
|
|
50044
50667
|
this.value = void 0;
|
|
50045
50668
|
this.circular = false;
|
|
50046
50669
|
this.indirections = 0;
|
|
@@ -50093,10 +50716,10 @@ var Pointer = class _Pointer {
|
|
|
50093
50716
|
continue;
|
|
50094
50717
|
}
|
|
50095
50718
|
this.value = null;
|
|
50096
|
-
const
|
|
50097
|
-
const targetRef = this.path.replace(
|
|
50719
|
+
const path8 = this.$ref.path || "";
|
|
50720
|
+
const targetRef = this.path.replace(path8, "");
|
|
50098
50721
|
const targetFound = _Pointer.join("", found);
|
|
50099
|
-
const parentPath = pathFromRoot?.replace(
|
|
50722
|
+
const parentPath = pathFromRoot?.replace(path8, "");
|
|
50100
50723
|
throw new MissingPointerError(token, decodeURI(this.originalPath), targetRef, targetFound, parentPath);
|
|
50101
50724
|
} else {
|
|
50102
50725
|
this.value = this.value[token];
|
|
@@ -50162,8 +50785,8 @@ var Pointer = class _Pointer {
|
|
|
50162
50785
|
* @param [originalPath]
|
|
50163
50786
|
* @returns
|
|
50164
50787
|
*/
|
|
50165
|
-
static parse(
|
|
50166
|
-
const pointer = getHash(
|
|
50788
|
+
static parse(path8, originalPath) {
|
|
50789
|
+
const pointer = getHash(path8).substring(1);
|
|
50167
50790
|
if (!pointer) {
|
|
50168
50791
|
return [];
|
|
50169
50792
|
}
|
|
@@ -50172,7 +50795,7 @@ var Pointer = class _Pointer {
|
|
|
50172
50795
|
split[i] = split[i].replace(escapedSlash, "/").replace(escapedTilde, "~");
|
|
50173
50796
|
}
|
|
50174
50797
|
if (split[0] !== "") {
|
|
50175
|
-
throw new InvalidPointerError(pointer, originalPath === void 0 ?
|
|
50798
|
+
throw new InvalidPointerError(pointer, originalPath === void 0 ? path8 : originalPath);
|
|
50176
50799
|
}
|
|
50177
50800
|
return split.slice(1);
|
|
50178
50801
|
}
|
|
@@ -50313,9 +50936,9 @@ var $Ref = class _$Ref {
|
|
|
50313
50936
|
* @param options
|
|
50314
50937
|
* @returns
|
|
50315
50938
|
*/
|
|
50316
|
-
exists(
|
|
50939
|
+
exists(path8, options) {
|
|
50317
50940
|
try {
|
|
50318
|
-
this.resolve(
|
|
50941
|
+
this.resolve(path8, options);
|
|
50319
50942
|
return true;
|
|
50320
50943
|
} catch {
|
|
50321
50944
|
return false;
|
|
@@ -50328,8 +50951,8 @@ var $Ref = class _$Ref {
|
|
|
50328
50951
|
* @param options
|
|
50329
50952
|
* @returns - Returns the resolved value
|
|
50330
50953
|
*/
|
|
50331
|
-
get(
|
|
50332
|
-
return this.resolve(
|
|
50954
|
+
get(path8, options) {
|
|
50955
|
+
return this.resolve(path8, options)?.value;
|
|
50333
50956
|
}
|
|
50334
50957
|
/**
|
|
50335
50958
|
* Resolves the given JSON reference within this {@link $Ref#value}.
|
|
@@ -50340,8 +50963,8 @@ var $Ref = class _$Ref {
|
|
|
50340
50963
|
* @param pathFromRoot - The path of `obj` from the schema root
|
|
50341
50964
|
* @returns
|
|
50342
50965
|
*/
|
|
50343
|
-
resolve(
|
|
50344
|
-
const pointer = new pointer_default(this,
|
|
50966
|
+
resolve(path8, options, friendlyPath, pathFromRoot) {
|
|
50967
|
+
const pointer = new pointer_default(this, path8, friendlyPath);
|
|
50345
50968
|
try {
|
|
50346
50969
|
const resolved = pointer.resolve(this.value, options, pathFromRoot);
|
|
50347
50970
|
if (resolved.value === nullSymbol) {
|
|
@@ -50369,8 +50992,8 @@ var $Ref = class _$Ref {
|
|
|
50369
50992
|
* @param path - The full path of the property to set, optionally with a JSON pointer in the hash
|
|
50370
50993
|
* @param value - The value to assign
|
|
50371
50994
|
*/
|
|
50372
|
-
set(
|
|
50373
|
-
const pointer = new pointer_default(this,
|
|
50995
|
+
set(path8, value) {
|
|
50996
|
+
const pointer = new pointer_default(this, path8);
|
|
50374
50997
|
this.value = pointer.set(this.value, value);
|
|
50375
50998
|
if (this.value === nullSymbol) {
|
|
50376
50999
|
this.value = null;
|
|
@@ -50544,8 +51167,8 @@ var $Refs = class {
|
|
|
50544
51167
|
*/
|
|
50545
51168
|
paths(...types2) {
|
|
50546
51169
|
const paths = getPaths(this._$refs, types2.flat());
|
|
50547
|
-
return paths.map((
|
|
50548
|
-
return convertPathToPosix(
|
|
51170
|
+
return paths.map((path8) => {
|
|
51171
|
+
return convertPathToPosix(path8.decoded);
|
|
50549
51172
|
});
|
|
50550
51173
|
}
|
|
50551
51174
|
/**
|
|
@@ -50558,8 +51181,8 @@ var $Refs = class {
|
|
|
50558
51181
|
values(...types2) {
|
|
50559
51182
|
const $refs = this._$refs;
|
|
50560
51183
|
const paths = getPaths($refs, types2.flat());
|
|
50561
|
-
return paths.reduce((obj,
|
|
50562
|
-
obj[convertPathToPosix(
|
|
51184
|
+
return paths.reduce((obj, path8) => {
|
|
51185
|
+
obj[convertPathToPosix(path8.decoded)] = $refs[path8.encoded].value;
|
|
50563
51186
|
return obj;
|
|
50564
51187
|
}, {});
|
|
50565
51188
|
}
|
|
@@ -50577,9 +51200,9 @@ var $Refs = class {
|
|
|
50577
51200
|
* @param [options]
|
|
50578
51201
|
* @returns
|
|
50579
51202
|
*/
|
|
50580
|
-
exists(
|
|
51203
|
+
exists(path8, options) {
|
|
50581
51204
|
try {
|
|
50582
|
-
this._resolve(
|
|
51205
|
+
this._resolve(path8, "", options);
|
|
50583
51206
|
return true;
|
|
50584
51207
|
} catch {
|
|
50585
51208
|
return false;
|
|
@@ -50592,8 +51215,8 @@ var $Refs = class {
|
|
|
50592
51215
|
* @param [options]
|
|
50593
51216
|
* @returns - Returns the resolved value
|
|
50594
51217
|
*/
|
|
50595
|
-
get(
|
|
50596
|
-
return this._resolve(
|
|
51218
|
+
get(path8, options) {
|
|
51219
|
+
return this._resolve(path8, "", options).value;
|
|
50597
51220
|
}
|
|
50598
51221
|
/**
|
|
50599
51222
|
* Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created.
|
|
@@ -50601,11 +51224,11 @@ var $Refs = class {
|
|
|
50601
51224
|
* @param path The JSON Reference path, optionally with a JSON Pointer in the hash
|
|
50602
51225
|
* @param value The value to assign. Can be anything (object, string, number, etc.)
|
|
50603
51226
|
*/
|
|
50604
|
-
set(
|
|
50605
|
-
const absPath = resolve2(this._root$Ref.path,
|
|
51227
|
+
set(path8, value) {
|
|
51228
|
+
const absPath = resolve2(this._root$Ref.path, path8);
|
|
50606
51229
|
const $ref = this._getRef(absPath);
|
|
50607
51230
|
if (!$ref) {
|
|
50608
|
-
throw new Error(`Error resolving $ref pointer "${
|
|
51231
|
+
throw new Error(`Error resolving $ref pointer "${path8}".
|
|
50609
51232
|
"${stripHash(absPath)}" not found.`);
|
|
50610
51233
|
}
|
|
50611
51234
|
$ref.set(absPath, value);
|
|
@@ -50617,25 +51240,25 @@ var $Refs = class {
|
|
|
50617
51240
|
* @returns
|
|
50618
51241
|
* @protected
|
|
50619
51242
|
*/
|
|
50620
|
-
_get$Ref(
|
|
50621
|
-
|
|
50622
|
-
return this._getRef(
|
|
51243
|
+
_get$Ref(path8) {
|
|
51244
|
+
path8 = resolve2(this._root$Ref.path, path8);
|
|
51245
|
+
return this._getRef(path8);
|
|
50623
51246
|
}
|
|
50624
51247
|
/**
|
|
50625
51248
|
* Creates a new {@link $Ref} object and adds it to this {@link $Refs} object.
|
|
50626
51249
|
*
|
|
50627
51250
|
* @param path - The file path or URL of the referenced file
|
|
50628
51251
|
*/
|
|
50629
|
-
_add(
|
|
50630
|
-
const withoutHash = stripHash(
|
|
51252
|
+
_add(path8) {
|
|
51253
|
+
const withoutHash = stripHash(path8);
|
|
50631
51254
|
const $ref = new ref_default(this);
|
|
50632
51255
|
$ref.path = withoutHash;
|
|
50633
51256
|
this._$refs[withoutHash] = $ref;
|
|
50634
51257
|
this._root$Ref = this._root$Ref || $ref;
|
|
50635
51258
|
return $ref;
|
|
50636
51259
|
}
|
|
50637
|
-
_addAlias(
|
|
50638
|
-
const withoutHash = stripHash(
|
|
51260
|
+
_addAlias(path8, value, pathType, dynamicIdScope = false) {
|
|
51261
|
+
const withoutHash = stripHash(path8);
|
|
50639
51262
|
if (!withoutHash || this._$refs[withoutHash] || this._aliases[withoutHash]) {
|
|
50640
51263
|
return this._$refs[withoutHash] || this._aliases[withoutHash];
|
|
50641
51264
|
}
|
|
@@ -50656,14 +51279,14 @@ var $Refs = class {
|
|
|
50656
51279
|
* @returns
|
|
50657
51280
|
* @protected
|
|
50658
51281
|
*/
|
|
50659
|
-
_resolve(
|
|
50660
|
-
const absPath = resolve2(this._root$Ref.path,
|
|
51282
|
+
_resolve(path8, pathFromRoot, options) {
|
|
51283
|
+
const absPath = resolve2(this._root$Ref.path, path8);
|
|
50661
51284
|
const $ref = this._getRef(absPath);
|
|
50662
51285
|
if (!$ref) {
|
|
50663
|
-
throw new Error(`Error resolving $ref pointer "${
|
|
51286
|
+
throw new Error(`Error resolving $ref pointer "${path8}".
|
|
50664
51287
|
"${stripHash(absPath)}" not found.`);
|
|
50665
51288
|
}
|
|
50666
|
-
return $ref.resolve(absPath, options,
|
|
51289
|
+
return $ref.resolve(absPath, options, path8, pathFromRoot);
|
|
50667
51290
|
}
|
|
50668
51291
|
/**
|
|
50669
51292
|
* A map of paths/urls to {@link $Ref} objects
|
|
@@ -50705,8 +51328,8 @@ var $Refs = class {
|
|
|
50705
51328
|
* @returns {object}
|
|
50706
51329
|
*/
|
|
50707
51330
|
toJSON = this.values;
|
|
50708
|
-
_getRef(
|
|
50709
|
-
const withoutHash = stripHash(
|
|
51331
|
+
_getRef(path8) {
|
|
51332
|
+
const withoutHash = stripHash(path8);
|
|
50710
51333
|
return this._$refs[withoutHash] || this._aliases[withoutHash];
|
|
50711
51334
|
}
|
|
50712
51335
|
};
|
|
@@ -50718,10 +51341,10 @@ function getPaths($refs, types2) {
|
|
|
50718
51341
|
return types2.includes($refs[key].pathType);
|
|
50719
51342
|
});
|
|
50720
51343
|
}
|
|
50721
|
-
return paths.map((
|
|
51344
|
+
return paths.map((path8) => {
|
|
50722
51345
|
return {
|
|
50723
|
-
encoded:
|
|
50724
|
-
decoded: $refs[
|
|
51346
|
+
encoded: path8,
|
|
51347
|
+
decoded: $refs[path8].pathType === "file" ? toFileSystemPath(path8, true) : path8
|
|
50725
51348
|
};
|
|
50726
51349
|
});
|
|
50727
51350
|
}
|
|
@@ -50813,14 +51436,14 @@ function getResult(obj, prop, file, callback, $refs) {
|
|
|
50813
51436
|
|
|
50814
51437
|
// node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js
|
|
50815
51438
|
async function parse2(target, $refs, options) {
|
|
50816
|
-
let
|
|
51439
|
+
let path8 = typeof target === "string" ? target : target.url;
|
|
50817
51440
|
const baseUrl = typeof target === "string" ? void 0 : target.baseUrl;
|
|
50818
51441
|
let reference = typeof target === "string" ? void 0 : target.reference;
|
|
50819
|
-
const hashIndex =
|
|
51442
|
+
const hashIndex = path8.indexOf("#");
|
|
50820
51443
|
let hash = "";
|
|
50821
51444
|
if (hashIndex >= 0) {
|
|
50822
|
-
hash =
|
|
50823
|
-
|
|
51445
|
+
hash = path8.substring(hashIndex);
|
|
51446
|
+
path8 = path8.substring(0, hashIndex);
|
|
50824
51447
|
}
|
|
50825
51448
|
if (reference) {
|
|
50826
51449
|
const referenceHashIndex = reference.indexOf("#");
|
|
@@ -50828,11 +51451,11 @@ async function parse2(target, $refs, options) {
|
|
|
50828
51451
|
reference = reference.substring(0, referenceHashIndex);
|
|
50829
51452
|
}
|
|
50830
51453
|
}
|
|
50831
|
-
const $ref = $refs._add(
|
|
51454
|
+
const $ref = $refs._add(path8);
|
|
50832
51455
|
const file = {
|
|
50833
|
-
url:
|
|
51456
|
+
url: path8,
|
|
50834
51457
|
hash,
|
|
50835
|
-
extension: getExtension(
|
|
51458
|
+
extension: getExtension(path8),
|
|
50836
51459
|
...reference !== void 0 ? { reference } : {},
|
|
50837
51460
|
...baseUrl !== void 0 ? { baseUrl } : {}
|
|
50838
51461
|
};
|
|
@@ -53717,24 +54340,24 @@ var file_default = {
|
|
|
53717
54340
|
* Reads the given file and returns its raw contents as a Buffer.
|
|
53718
54341
|
*/
|
|
53719
54342
|
async read(file) {
|
|
53720
|
-
let
|
|
54343
|
+
let path8;
|
|
53721
54344
|
const fs3 = await import("fs");
|
|
53722
54345
|
try {
|
|
53723
|
-
|
|
54346
|
+
path8 = toFileSystemPath(file.url);
|
|
53724
54347
|
} catch (err) {
|
|
53725
54348
|
const e = err;
|
|
53726
54349
|
e.message = `Malformed URI: ${file.url}: ${e.message}`;
|
|
53727
54350
|
throw new ResolverError(e, file.url);
|
|
53728
54351
|
}
|
|
53729
|
-
if (
|
|
53730
|
-
|
|
54352
|
+
if (path8.endsWith("/") || path8.endsWith("\\")) {
|
|
54353
|
+
path8 = path8.slice(0, -1);
|
|
53731
54354
|
}
|
|
53732
54355
|
try {
|
|
53733
|
-
return await fs3.promises.readFile(
|
|
54356
|
+
return await fs3.promises.readFile(path8);
|
|
53734
54357
|
} catch (err) {
|
|
53735
54358
|
const e = err;
|
|
53736
|
-
e.message = `Error opening file ${
|
|
53737
|
-
throw new ResolverError(e,
|
|
54359
|
+
e.message = `Error opening file ${path8}: ${e.message}`;
|
|
54360
|
+
throw new ResolverError(e, path8);
|
|
53738
54361
|
}
|
|
53739
54362
|
}
|
|
53740
54363
|
};
|
|
@@ -53798,7 +54421,7 @@ async function download(u, httpOptions, _redirects) {
|
|
|
53798
54421
|
const redirects = _redirects || [];
|
|
53799
54422
|
redirects.push(u.href);
|
|
53800
54423
|
try {
|
|
53801
|
-
const res = await
|
|
54424
|
+
const res = await get2(u, httpOptions);
|
|
53802
54425
|
if (res.status >= 400) {
|
|
53803
54426
|
const error2 = new Error(`HTTP ERROR ${res.status}`);
|
|
53804
54427
|
error2.status = res.status;
|
|
@@ -53831,7 +54454,7 @@ Too many redirects:
|
|
|
53831
54454
|
throw new ResolverError(e, u.href);
|
|
53832
54455
|
}
|
|
53833
54456
|
}
|
|
53834
|
-
async function
|
|
54457
|
+
async function get2(u, httpOptions) {
|
|
53835
54458
|
let controller;
|
|
53836
54459
|
let timeoutId;
|
|
53837
54460
|
if (httpOptions.timeout && typeof AbortController !== "undefined") {
|
|
@@ -53958,7 +54581,7 @@ function isMergeable(val) {
|
|
|
53958
54581
|
|
|
53959
54582
|
// node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js
|
|
53960
54583
|
function normalizeArgs(_args) {
|
|
53961
|
-
let
|
|
54584
|
+
let path8;
|
|
53962
54585
|
let schema2;
|
|
53963
54586
|
let options;
|
|
53964
54587
|
let callback;
|
|
@@ -53967,7 +54590,7 @@ function normalizeArgs(_args) {
|
|
|
53967
54590
|
callback = args.pop();
|
|
53968
54591
|
}
|
|
53969
54592
|
if (typeof args[0] === "string") {
|
|
53970
|
-
|
|
54593
|
+
path8 = args[0];
|
|
53971
54594
|
if (typeof args[2] === "object") {
|
|
53972
54595
|
schema2 = args[1];
|
|
53973
54596
|
options = args[2];
|
|
@@ -53976,7 +54599,7 @@ function normalizeArgs(_args) {
|
|
|
53976
54599
|
options = args[1];
|
|
53977
54600
|
}
|
|
53978
54601
|
} else {
|
|
53979
|
-
|
|
54602
|
+
path8 = "";
|
|
53980
54603
|
schema2 = args[0];
|
|
53981
54604
|
options = args[1];
|
|
53982
54605
|
}
|
|
@@ -53989,7 +54612,7 @@ function normalizeArgs(_args) {
|
|
|
53989
54612
|
schema2 = JSON.parse(JSON.stringify(schema2));
|
|
53990
54613
|
}
|
|
53991
54614
|
return {
|
|
53992
|
-
path:
|
|
54615
|
+
path: path8,
|
|
53993
54616
|
schema: schema2,
|
|
53994
54617
|
options,
|
|
53995
54618
|
callback
|
|
@@ -54010,18 +54633,18 @@ function resolveExternal(parser, options) {
|
|
|
54010
54633
|
return Promise.reject(e);
|
|
54011
54634
|
}
|
|
54012
54635
|
}
|
|
54013
|
-
function crawl(obj,
|
|
54636
|
+
function crawl(obj, path8, scopeBase, dynamicIdScope, $refs, options, seen, external) {
|
|
54014
54637
|
seen ||= /* @__PURE__ */ new Set();
|
|
54015
54638
|
let promises3 = [];
|
|
54016
54639
|
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !seen.has(obj)) {
|
|
54017
54640
|
seen.add(obj);
|
|
54018
54641
|
const currentScopeBase = scopeBase;
|
|
54019
54642
|
if (ref_default.isExternal$Ref(obj)) {
|
|
54020
|
-
promises3.push(resolve$Ref(obj,
|
|
54643
|
+
promises3.push(resolve$Ref(obj, path8, currentScopeBase, dynamicIdScope, $refs, options));
|
|
54021
54644
|
}
|
|
54022
54645
|
const keys = Object.keys(obj);
|
|
54023
54646
|
for (const key of keys) {
|
|
54024
|
-
const keyPath = pointer_default.join(
|
|
54647
|
+
const keyPath = pointer_default.join(path8, key);
|
|
54025
54648
|
const value = obj[key];
|
|
54026
54649
|
const childScopeBase = dynamicIdScope && value && typeof value === "object" && !ArrayBuffer.isView(value) ? getSchemaBasePath(currentScopeBase, value) : currentScopeBase;
|
|
54027
54650
|
promises3 = promises3.concat(crawl(value, keyPath, childScopeBase, dynamicIdScope, $refs, options, seen, external));
|
|
@@ -54029,9 +54652,9 @@ function crawl(obj, path7, scopeBase, dynamicIdScope, $refs, options, seen, exte
|
|
|
54029
54652
|
}
|
|
54030
54653
|
return promises3;
|
|
54031
54654
|
}
|
|
54032
|
-
async function resolve$Ref($ref,
|
|
54655
|
+
async function resolve$Ref($ref, path8, scopeBase, dynamicIdScope, $refs, options) {
|
|
54033
54656
|
const shouldResolveOnCwd = options.dereference?.externalReferenceResolution === "root";
|
|
54034
|
-
const resolutionBase = shouldResolveOnCwd ? cwd() : dynamicIdScope ? scopeBase :
|
|
54657
|
+
const resolutionBase = shouldResolveOnCwd ? cwd() : dynamicIdScope ? scopeBase : path8;
|
|
54035
54658
|
const resolvedPath = resolve2(resolutionBase, $ref.$ref);
|
|
54036
54659
|
const withoutHash = stripHash(resolvedPath);
|
|
54037
54660
|
const ref = $refs._get$Ref(withoutHash);
|
|
@@ -54056,8 +54679,8 @@ async function resolve$Ref($ref, path7, scopeBase, dynamicIdScope, $refs, option
|
|
|
54056
54679
|
throw err;
|
|
54057
54680
|
}
|
|
54058
54681
|
if ($refs._$refs[withoutHash]) {
|
|
54059
|
-
err.source = decodeURI(stripHash(
|
|
54060
|
-
err.path = safePointerToPath(getHash(
|
|
54682
|
+
err.source = decodeURI(stripHash(path8));
|
|
54683
|
+
err.path = safePointerToPath(getHash(path8));
|
|
54061
54684
|
}
|
|
54062
54685
|
return [];
|
|
54063
54686
|
}
|
|
@@ -54076,14 +54699,14 @@ function bundle(parser, options) {
|
|
|
54076
54699
|
fixRefsThroughRefs(inventory, parser.schema);
|
|
54077
54700
|
}
|
|
54078
54701
|
}
|
|
54079
|
-
function crawl2(parent, key,
|
|
54702
|
+
function crawl2(parent, key, path8, scopeBase, dynamicIdScope, pathFromRoot, indirections, inventory, $refs, options) {
|
|
54080
54703
|
const obj = key === null ? parent : parent[key];
|
|
54081
54704
|
const bundleOptions = options.bundle || {};
|
|
54082
54705
|
const isExcludedPath = bundleOptions.excludedPathMatcher || (() => false);
|
|
54083
54706
|
if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj) && !isExcludedPath(pathFromRoot)) {
|
|
54084
54707
|
const currentScopeBase = scopeBase;
|
|
54085
54708
|
if (ref_default.isAllowed$Ref(obj)) {
|
|
54086
|
-
inventory$Ref(parent, key,
|
|
54709
|
+
inventory$Ref(parent, key, path8, currentScopeBase, dynamicIdScope, pathFromRoot, indirections, inventory, $refs, options);
|
|
54087
54710
|
} else {
|
|
54088
54711
|
const keys = Object.keys(obj).sort((a, b) => {
|
|
54089
54712
|
if (a === "definitions" || a === "$defs") {
|
|
@@ -54095,7 +54718,7 @@ function crawl2(parent, key, path7, scopeBase, dynamicIdScope, pathFromRoot, ind
|
|
|
54095
54718
|
}
|
|
54096
54719
|
});
|
|
54097
54720
|
for (const key2 of keys) {
|
|
54098
|
-
const keyPath = pointer_default.join(
|
|
54721
|
+
const keyPath = pointer_default.join(path8, key2);
|
|
54099
54722
|
const keyPathFromRoot = pointer_default.join(pathFromRoot, key2);
|
|
54100
54723
|
const value = obj[key2];
|
|
54101
54724
|
const childScopeBase = dynamicIdScope && value && typeof value === "object" && !ArrayBuffer.isView(value) ? getSchemaBasePath(currentScopeBase, value) : currentScopeBase;
|
|
@@ -54113,9 +54736,9 @@ function crawl2(parent, key, path7, scopeBase, dynamicIdScope, pathFromRoot, ind
|
|
|
54113
54736
|
}
|
|
54114
54737
|
}
|
|
54115
54738
|
}
|
|
54116
|
-
function inventory$Ref($refParent, $refKey,
|
|
54739
|
+
function inventory$Ref($refParent, $refKey, path8, scopeBase, dynamicIdScope, pathFromRoot, indirections, inventory, $refs, options) {
|
|
54117
54740
|
const $ref = $refKey === null ? $refParent : $refParent[$refKey];
|
|
54118
|
-
const $refPath = resolve2(dynamicIdScope ? scopeBase :
|
|
54741
|
+
const $refPath = resolve2(dynamicIdScope ? scopeBase : path8, $ref.$ref);
|
|
54119
54742
|
const pointer = $refs._resolve($refPath, pathFromRoot, options);
|
|
54120
54743
|
if (pointer === null) {
|
|
54121
54744
|
return;
|
|
@@ -54275,11 +54898,11 @@ function resolvePathThroughRefs(schema2, refPath) {
|
|
|
54275
54898
|
const result = "#/" + resolvedSegments.join("/");
|
|
54276
54899
|
return result;
|
|
54277
54900
|
}
|
|
54278
|
-
function walkPath(schema2,
|
|
54279
|
-
if (!
|
|
54901
|
+
function walkPath(schema2, path8) {
|
|
54902
|
+
if (!path8.startsWith("#/")) {
|
|
54280
54903
|
return void 0;
|
|
54281
54904
|
}
|
|
54282
|
-
const segments2 =
|
|
54905
|
+
const segments2 = path8.slice(2).split("/");
|
|
54283
54906
|
let current = schema2;
|
|
54284
54907
|
for (const seg of segments2) {
|
|
54285
54908
|
if (current === null || current === void 0 || typeof current !== "object") {
|
|
@@ -54315,7 +54938,7 @@ function dereference(parser, options) {
|
|
|
54315
54938
|
parser.$refs.circular = dereferenced.circular;
|
|
54316
54939
|
parser.schema = dereferenced.value;
|
|
54317
54940
|
}
|
|
54318
|
-
function crawl3(obj,
|
|
54941
|
+
function crawl3(obj, path8, scopeBase, dynamicIdScope, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime, depth) {
|
|
54319
54942
|
let dereferenced;
|
|
54320
54943
|
const result = {
|
|
54321
54944
|
value: obj,
|
|
@@ -54334,13 +54957,13 @@ function crawl3(obj, path7, scopeBase, dynamicIdScope, pathFromRoot, parents, pr
|
|
|
54334
54957
|
processedObjects.add(obj);
|
|
54335
54958
|
const currentScopeBase = scopeBase;
|
|
54336
54959
|
if (ref_default.isAllowed$Ref(obj, options)) {
|
|
54337
|
-
dereferenced = dereference$Ref(obj,
|
|
54960
|
+
dereferenced = dereference$Ref(obj, path8, currentScopeBase, dynamicIdScope, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime, depth);
|
|
54338
54961
|
result.circular = dereferenced.circular;
|
|
54339
54962
|
result.value = dereferenced.value;
|
|
54340
54963
|
} else {
|
|
54341
54964
|
for (const key of Object.keys(obj)) {
|
|
54342
54965
|
checkDereferenceTimeout(startTime, options);
|
|
54343
|
-
const keyPath = pointer_default.join(
|
|
54966
|
+
const keyPath = pointer_default.join(path8, key);
|
|
54344
54967
|
const keyPathFromRoot = pointer_default.join(pathFromRoot, key);
|
|
54345
54968
|
if (isExcludedPath(keyPathFromRoot)) {
|
|
54346
54969
|
continue;
|
|
@@ -54395,10 +55018,10 @@ function crawl3(obj, path7, scopeBase, dynamicIdScope, pathFromRoot, parents, pr
|
|
|
54395
55018
|
}
|
|
54396
55019
|
return result;
|
|
54397
55020
|
}
|
|
54398
|
-
function dereference$Ref($ref,
|
|
55021
|
+
function dereference$Ref($ref, path8, scopeBase, dynamicIdScope, pathFromRoot, parents, processedObjects, dereferencedCache, $refs, options, startTime, depth) {
|
|
54399
55022
|
const isExternalRef = ref_default.isExternal$Ref($ref);
|
|
54400
55023
|
const shouldResolveOnCwd = isExternalRef && options?.dereference?.externalReferenceResolution === "root";
|
|
54401
|
-
const resolutionBase = shouldResolveOnCwd ? cwd() : dynamicIdScope ? scopeBase :
|
|
55024
|
+
const resolutionBase = shouldResolveOnCwd ? cwd() : dynamicIdScope ? scopeBase : path8;
|
|
54402
55025
|
const $refPath = resolve2(resolutionBase, $ref.$ref);
|
|
54403
55026
|
const cache = dereferencedCache.get($refPath);
|
|
54404
55027
|
if (cache) {
|
|
@@ -54420,16 +55043,16 @@ function dereference$Ref($ref, path7, scopeBase, dynamicIdScope, pathFromRoot, p
|
|
|
54420
55043
|
}
|
|
54421
55044
|
if (typeof cache.value === "object" && "$ref" in cache.value && "$ref" in $ref) {
|
|
54422
55045
|
if (cache.value.$ref === $ref.$ref) {
|
|
54423
|
-
foundCircularReference(
|
|
55046
|
+
foundCircularReference(path8, $refs, options);
|
|
54424
55047
|
return cache;
|
|
54425
55048
|
} else {
|
|
54426
55049
|
}
|
|
54427
55050
|
} else {
|
|
54428
|
-
foundCircularReference(
|
|
55051
|
+
foundCircularReference(path8, $refs, options);
|
|
54429
55052
|
return cache;
|
|
54430
55053
|
}
|
|
54431
55054
|
}
|
|
54432
|
-
const pointer = $refs._resolve($refPath,
|
|
55055
|
+
const pointer = $refs._resolve($refPath, path8, options);
|
|
54433
55056
|
if (pointer === null) {
|
|
54434
55057
|
return {
|
|
54435
55058
|
circular: false,
|
|
@@ -54439,7 +55062,7 @@ function dereference$Ref($ref, path7, scopeBase, dynamicIdScope, pathFromRoot, p
|
|
|
54439
55062
|
const directCircular = pointer.circular;
|
|
54440
55063
|
let circular = directCircular || parents.has(pointer.value);
|
|
54441
55064
|
if (circular) {
|
|
54442
|
-
foundCircularReference(
|
|
55065
|
+
foundCircularReference(path8, $refs, options);
|
|
54443
55066
|
}
|
|
54444
55067
|
let dereferencedValue = ref_default.dereference($ref, pointer.value, options);
|
|
54445
55068
|
if (!circular) {
|
|
@@ -60847,7 +61470,7 @@ function hasInvalidPaths(api) {
|
|
|
60847
61470
|
if (!api.paths || typeof api.paths !== "object" || Array.isArray(api.paths)) {
|
|
60848
61471
|
return false;
|
|
60849
61472
|
}
|
|
60850
|
-
return Object.keys(api.paths).some((
|
|
61473
|
+
return Object.keys(api.paths).some((path8) => !path8.startsWith("/"));
|
|
60851
61474
|
}
|
|
60852
61475
|
function reduceAjvErrors(errors) {
|
|
60853
61476
|
const flattened = /* @__PURE__ */ new Map();
|
|
@@ -60932,7 +61555,7 @@ function validateSchema(api, options = {}, suppressedInstancePaths = []) {
|
|
|
60932
61555
|
}
|
|
60933
61556
|
let additionalErrors = 0;
|
|
60934
61557
|
let reducedErrors = reduceAjvErrors(ajv.errors).filter((err) => {
|
|
60935
|
-
return !suppressedInstancePaths.some((
|
|
61558
|
+
return !suppressedInstancePaths.some((path8) => err.instancePath === path8 || err.instancePath.startsWith(`${path8}/`));
|
|
60936
61559
|
});
|
|
60937
61560
|
if (!reducedErrors.length) {
|
|
60938
61561
|
return { valid: true, warnings: [], specification: specificationName };
|
|
@@ -60983,9 +61606,9 @@ var SpecificationValidator = class {
|
|
|
60983
61606
|
reportWarning(message) {
|
|
60984
61607
|
this.warnings.push({ message });
|
|
60985
61608
|
}
|
|
60986
|
-
flagInstancePath(
|
|
60987
|
-
if (!this.flaggedInstancePaths.includes(
|
|
60988
|
-
this.flaggedInstancePaths.push(
|
|
61609
|
+
flagInstancePath(path8) {
|
|
61610
|
+
if (!this.flaggedInstancePaths.includes(path8)) {
|
|
61611
|
+
this.flaggedInstancePaths.push(path8);
|
|
60989
61612
|
}
|
|
60990
61613
|
}
|
|
60991
61614
|
};
|
|
@@ -61003,10 +61626,10 @@ var OpenAPISpecificationValidator = class extends SpecificationValidator {
|
|
|
61003
61626
|
run() {
|
|
61004
61627
|
const operationIds = [];
|
|
61005
61628
|
Object.keys(this.api.paths || {}).forEach((pathName) => {
|
|
61006
|
-
const
|
|
61629
|
+
const path8 = this.api.paths[pathName];
|
|
61007
61630
|
const pathId = `/paths${pathName}`;
|
|
61008
|
-
if (
|
|
61009
|
-
this.validatePath(
|
|
61631
|
+
if (path8 && pathName.startsWith("/")) {
|
|
61632
|
+
this.validatePath(path8, pathId, operationIds);
|
|
61010
61633
|
}
|
|
61011
61634
|
});
|
|
61012
61635
|
if (isOpenAPI30(this.api)) {
|
|
@@ -61035,9 +61658,9 @@ var OpenAPISpecificationValidator = class extends SpecificationValidator {
|
|
|
61035
61658
|
* Validates the given path.
|
|
61036
61659
|
*
|
|
61037
61660
|
*/
|
|
61038
|
-
validatePath(
|
|
61661
|
+
validatePath(path8, pathId, operationIds) {
|
|
61039
61662
|
supportedHTTPMethods.forEach((operationName) => {
|
|
61040
|
-
const operation =
|
|
61663
|
+
const operation = path8[operationName];
|
|
61041
61664
|
const operationId = `${pathId}/${operationName}`;
|
|
61042
61665
|
if (operation) {
|
|
61043
61666
|
const declaredOperationId = operation.operationId;
|
|
@@ -61050,7 +61673,7 @@ var OpenAPISpecificationValidator = class extends SpecificationValidator {
|
|
|
61050
61673
|
this.reportError(`The operationId \`${declaredOperationId}\` is duplicated and must be made unique.`);
|
|
61051
61674
|
}
|
|
61052
61675
|
}
|
|
61053
|
-
this.validateParameters(
|
|
61676
|
+
this.validateParameters(path8, pathId, operation, operationId);
|
|
61054
61677
|
Object.keys(operation.responses || {}).forEach((responseCode) => {
|
|
61055
61678
|
const response = operation.responses[responseCode];
|
|
61056
61679
|
const responseId = `${operationId}/responses/${responseCode}`;
|
|
@@ -61065,8 +61688,8 @@ var OpenAPISpecificationValidator = class extends SpecificationValidator {
|
|
|
61065
61688
|
* Validates the parameters for the given operation.
|
|
61066
61689
|
*
|
|
61067
61690
|
*/
|
|
61068
|
-
validateParameters(
|
|
61069
|
-
const pathParams =
|
|
61691
|
+
validateParameters(path8, pathId, operation, operationId) {
|
|
61692
|
+
const pathParams = path8.parameters || [];
|
|
61070
61693
|
const operationParams = operation.parameters || [];
|
|
61071
61694
|
this.checkForDuplicates(pathParams, pathId);
|
|
61072
61695
|
this.checkForDuplicates(operationParams, operationId);
|
|
@@ -61365,10 +61988,10 @@ var SwaggerSpecificationValidator = class extends SpecificationValidator {
|
|
|
61365
61988
|
run() {
|
|
61366
61989
|
const operationIds = [];
|
|
61367
61990
|
Object.keys(this.api.paths || {}).forEach((pathName) => {
|
|
61368
|
-
const
|
|
61991
|
+
const path8 = this.api.paths[pathName];
|
|
61369
61992
|
const pathId = `/paths${pathName}`;
|
|
61370
|
-
if (
|
|
61371
|
-
this.validatePath(
|
|
61993
|
+
if (path8 && pathName.startsWith("/")) {
|
|
61994
|
+
this.validatePath(path8, pathId, operationIds);
|
|
61372
61995
|
}
|
|
61373
61996
|
});
|
|
61374
61997
|
Object.keys(this.api.definitions || {}).forEach((definitionName) => {
|
|
@@ -61386,9 +62009,9 @@ var SwaggerSpecificationValidator = class extends SpecificationValidator {
|
|
|
61386
62009
|
* Validates the given path.
|
|
61387
62010
|
*
|
|
61388
62011
|
*/
|
|
61389
|
-
validatePath(
|
|
62012
|
+
validatePath(path8, pathId, operationIds) {
|
|
61390
62013
|
swaggerHTTPMethods.forEach((operationName) => {
|
|
61391
|
-
const operation =
|
|
62014
|
+
const operation = path8[operationName];
|
|
61392
62015
|
const operationId = `${pathId}/${operationName}`;
|
|
61393
62016
|
if (operation) {
|
|
61394
62017
|
const declaredOperationId = operation.operationId;
|
|
@@ -61401,7 +62024,7 @@ var SwaggerSpecificationValidator = class extends SpecificationValidator {
|
|
|
61401
62024
|
this.reportError(`The operationId \`${declaredOperationId}\` is duplicated and must be made unique.`);
|
|
61402
62025
|
}
|
|
61403
62026
|
}
|
|
61404
|
-
this.validateParameters(
|
|
62027
|
+
this.validateParameters(path8, pathId, operation, operationId);
|
|
61405
62028
|
Object.keys(operation.responses || {}).forEach((responseName) => {
|
|
61406
62029
|
const response = operation.responses[responseName];
|
|
61407
62030
|
if ("$ref" in response || !response) {
|
|
@@ -61417,8 +62040,8 @@ var SwaggerSpecificationValidator = class extends SpecificationValidator {
|
|
|
61417
62040
|
* Validates the parameters for the given operation.
|
|
61418
62041
|
*
|
|
61419
62042
|
*/
|
|
61420
|
-
validateParameters(
|
|
61421
|
-
const pathParams = (
|
|
62043
|
+
validateParameters(path8, pathId, operation, operationId) {
|
|
62044
|
+
const pathParams = (path8.parameters || []).filter((param) => !("$ref" in param));
|
|
61422
62045
|
const operationParams = (operation.parameters || []).filter(
|
|
61423
62046
|
(param) => !("$ref" in param)
|
|
61424
62047
|
);
|
|
@@ -61997,29 +62620,29 @@ async function loadOpenApiContractSpec(specUrl, options = {}) {
|
|
|
61997
62620
|
async function loadOpenApiContractSpecFromPath(specPath, options = {}) {
|
|
61998
62621
|
if (!specPath) throw new Error("CONTRACT_SPEC_READ_FAILED: spec-path must not be empty");
|
|
61999
62622
|
const workspaceRoot = (() => {
|
|
62000
|
-
const root =
|
|
62623
|
+
const root = import_node_path2.default.resolve(process.env.GITHUB_WORKSPACE ?? process.cwd());
|
|
62001
62624
|
try {
|
|
62002
|
-
return (0,
|
|
62625
|
+
return (0, import_node_fs2.realpathSync)(root);
|
|
62003
62626
|
} catch {
|
|
62004
62627
|
return root;
|
|
62005
62628
|
}
|
|
62006
62629
|
})();
|
|
62007
|
-
const resolved =
|
|
62630
|
+
const resolved = import_node_path2.default.resolve(workspaceRoot, specPath);
|
|
62008
62631
|
let absolutePath;
|
|
62009
62632
|
try {
|
|
62010
|
-
absolutePath = (0,
|
|
62633
|
+
absolutePath = (0, import_node_fs2.realpathSync)(resolved);
|
|
62011
62634
|
} catch (error2) {
|
|
62012
62635
|
throw new Error(`CONTRACT_SPEC_READ_FAILED: Unable to read spec at ${specPath}`, { cause: error2 });
|
|
62013
62636
|
}
|
|
62014
|
-
const rel =
|
|
62015
|
-
if (!rel || rel.startsWith("..") ||
|
|
62637
|
+
const rel = import_node_path2.default.relative(workspaceRoot, absolutePath);
|
|
62638
|
+
if (!rel || rel.startsWith("..") || import_node_path2.default.isAbsolute(rel)) {
|
|
62016
62639
|
throw new Error(`CONTRACT_SPEC_READ_FAILED: spec-path must resolve inside ${workspaceRoot}, got: ${specPath}`);
|
|
62017
62640
|
}
|
|
62018
62641
|
const maxBytes = options.maxBytesPerResource ?? SAFE_FETCH_LIMITS.maxBytesPerResource;
|
|
62019
62642
|
const maxTotalBytes = options.maxTotalBytes ?? SAFE_FETCH_LIMITS.maxTotalBytes;
|
|
62020
62643
|
let onDiskBytes;
|
|
62021
62644
|
try {
|
|
62022
|
-
onDiskBytes = (await (0,
|
|
62645
|
+
onDiskBytes = (await (0, import_promises3.stat)(absolutePath)).size;
|
|
62023
62646
|
} catch (error2) {
|
|
62024
62647
|
throw new Error(`CONTRACT_SPEC_READ_FAILED: Unable to read spec at ${specPath}`, { cause: error2 });
|
|
62025
62648
|
}
|
|
@@ -62032,7 +62655,7 @@ async function loadOpenApiContractSpecFromPath(specPath, options = {}) {
|
|
|
62032
62655
|
}
|
|
62033
62656
|
let content;
|
|
62034
62657
|
try {
|
|
62035
|
-
content = await (0,
|
|
62658
|
+
content = await (0, import_promises3.readFile)(absolutePath, "utf8");
|
|
62036
62659
|
} catch (error2) {
|
|
62037
62660
|
throw new Error(`CONTRACT_SPEC_READ_FAILED: Unable to read spec at ${specPath}`, { cause: error2 });
|
|
62038
62661
|
}
|
|
@@ -62094,6 +62717,13 @@ function parseSpecSyncMode(value) {
|
|
|
62094
62717
|
}
|
|
62095
62718
|
throw new Error(`Unsupported spec-sync-mode "${v}". Supported values: ${allowed.join(", ")}`);
|
|
62096
62719
|
}
|
|
62720
|
+
function parseBreakingChangeMode(value) {
|
|
62721
|
+
return parseEnumInput(
|
|
62722
|
+
"breaking-change-mode",
|
|
62723
|
+
value,
|
|
62724
|
+
customerPreviewActionContract.inputs["breaking-change-mode"].default ?? "off"
|
|
62725
|
+
);
|
|
62726
|
+
}
|
|
62097
62727
|
function parseEnumInput(name, value, defaultValue) {
|
|
62098
62728
|
const allowed = customerPreviewActionContract.inputs[name].allowedValues ?? [];
|
|
62099
62729
|
const v = value?.trim() || defaultValue;
|
|
@@ -62199,6 +62829,12 @@ function resolveInputs(env = process.env) {
|
|
|
62199
62829
|
specUrl,
|
|
62200
62830
|
specPath,
|
|
62201
62831
|
openapiVersion: resolveOpenapiVersion(getInput2("openapi-version", env)),
|
|
62832
|
+
breakingChangeMode: parseBreakingChangeMode(getInput2("breaking-change-mode", env)),
|
|
62833
|
+
breakingBaselineSpecPath: getInput2("breaking-baseline-spec-path", env),
|
|
62834
|
+
breakingRulesPath: getInput2("breaking-rules-path", env) ?? customerPreviewActionContract.inputs["breaking-rules-path"].default,
|
|
62835
|
+
breakingTargetRef: getInput2("breaking-target-ref", env),
|
|
62836
|
+
breakingSummaryPath: getInput2("breaking-summary-path", env),
|
|
62837
|
+
breakingLogPath: getInput2("breaking-log-path", env),
|
|
62202
62838
|
governanceMappingJson: parseGovernanceMappingJson(getInput2("governance-mapping-json", env)),
|
|
62203
62839
|
postmanApiKey: getInput2("postman-api-key", env) ?? "",
|
|
62204
62840
|
postmanAccessToken: getInput2("postman-access-token", env),
|
|
@@ -62239,6 +62875,17 @@ function createPlannedOutputs(inputs) {
|
|
|
62239
62875
|
total: 0,
|
|
62240
62876
|
violations: [],
|
|
62241
62877
|
warnings: 0
|
|
62878
|
+
}),
|
|
62879
|
+
"breaking-change-status": "skipped",
|
|
62880
|
+
"breaking-change-summary-json": JSON.stringify({
|
|
62881
|
+
breakingChanges: 0,
|
|
62882
|
+
comparison: "",
|
|
62883
|
+
exitCode: 0,
|
|
62884
|
+
logPath: "",
|
|
62885
|
+
message: "Breaking-change check is disabled.",
|
|
62886
|
+
mode: inputs.breakingChangeMode,
|
|
62887
|
+
status: "skipped",
|
|
62888
|
+
summaryPath: ""
|
|
62242
62889
|
})
|
|
62243
62890
|
};
|
|
62244
62891
|
}
|
|
@@ -62293,6 +62940,12 @@ function readActionInputs(actionCore) {
|
|
|
62293
62940
|
INPUT_NESTED_FOLDER_HIERARCHY: optionalInput(actionCore, "nested-folder-hierarchy") ?? customerPreviewActionContract.inputs["nested-folder-hierarchy"].default,
|
|
62294
62941
|
INPUT_REQUEST_NAME_SOURCE: optionalInput(actionCore, "request-name-source") ?? customerPreviewActionContract.inputs["request-name-source"].default,
|
|
62295
62942
|
INPUT_OPENAPI_VERSION: optionalInput(actionCore, "openapi-version") ?? "",
|
|
62943
|
+
INPUT_BREAKING_CHANGE_MODE: optionalInput(actionCore, "breaking-change-mode") ?? customerPreviewActionContract.inputs["breaking-change-mode"].default,
|
|
62944
|
+
INPUT_BREAKING_BASELINE_SPEC_PATH: optionalInput(actionCore, "breaking-baseline-spec-path"),
|
|
62945
|
+
INPUT_BREAKING_RULES_PATH: optionalInput(actionCore, "breaking-rules-path") ?? customerPreviewActionContract.inputs["breaking-rules-path"].default,
|
|
62946
|
+
INPUT_BREAKING_TARGET_REF: optionalInput(actionCore, "breaking-target-ref"),
|
|
62947
|
+
INPUT_BREAKING_SUMMARY_PATH: optionalInput(actionCore, "breaking-summary-path"),
|
|
62948
|
+
INPUT_BREAKING_LOG_PATH: optionalInput(actionCore, "breaking-log-path"),
|
|
62296
62949
|
INPUT_POSTMAN_STACK: optionalInput(actionCore, "postman-stack") ?? customerPreviewActionContract.inputs["postman-stack"].default,
|
|
62297
62950
|
INPUT_GITHUB_TOKEN: githubToken,
|
|
62298
62951
|
INPUT_GH_FALLBACK_TOKEN: ghFallbackToken
|
|
@@ -62439,7 +63092,7 @@ function createAssetProjectName(inputs, releaseLabel) {
|
|
|
62439
63092
|
}
|
|
62440
63093
|
function readResourcesState() {
|
|
62441
63094
|
try {
|
|
62442
|
-
return (0, import_yaml3.parse)((0,
|
|
63095
|
+
return (0, import_yaml3.parse)((0, import_node_fs3.readFileSync)(".postman/resources.yaml", "utf8"));
|
|
62443
63096
|
} catch {
|
|
62444
63097
|
return null;
|
|
62445
63098
|
}
|
|
@@ -62585,6 +63238,7 @@ async function runBootstrap(inputs, dependencies) {
|
|
|
62585
63238
|
let previousSpecRollbackHash;
|
|
62586
63239
|
let detectedOpenapiVersion = "3.0";
|
|
62587
63240
|
let contractIndex;
|
|
63241
|
+
let sourceSpecContent = "";
|
|
62588
63242
|
const specContent = await runGroup(
|
|
62589
63243
|
dependencies.core,
|
|
62590
63244
|
"Preflight OpenAPI Contract",
|
|
@@ -62593,6 +63247,7 @@ async function runBootstrap(inputs, dependencies) {
|
|
|
62593
63247
|
fetchText: dependencies.specFetcher === fetch ? void 0 : async (url) => fetchSpecDocument(url, dependencies.specFetcher)
|
|
62594
63248
|
};
|
|
62595
63249
|
const loaded = inputs.specPath ? await loadOpenApiContractSpecFromPath(inputs.specPath, loaderOptions) : await loadOpenApiContractSpec(inputs.specUrl, loaderOptions);
|
|
63250
|
+
sourceSpecContent = loaded.content;
|
|
62596
63251
|
const document = normalizeSpecDocument(
|
|
62597
63252
|
loaded.bundledContent,
|
|
62598
63253
|
(msg) => dependencies.core.warning(msg)
|
|
@@ -62619,7 +63274,7 @@ async function runBootstrap(inputs, dependencies) {
|
|
|
62619
63274
|
previousRaw,
|
|
62620
63275
|
(msg) => dependencies.core.warning(`Previous spec normalization: ${msg}`)
|
|
62621
63276
|
);
|
|
62622
|
-
previousSpecRollbackHash = (0,
|
|
63277
|
+
previousSpecRollbackHash = (0, import_node_crypto2.createHash)("sha256").update(previousSpecContent).digest("hex");
|
|
62623
63278
|
const existingSpecType = normalizeSpecTypeFromContent(previousSpecContent);
|
|
62624
63279
|
if (existingSpecType !== incomingSpecType) {
|
|
62625
63280
|
throw new Error(
|
|
@@ -62633,6 +63288,38 @@ async function runBootstrap(inputs, dependencies) {
|
|
|
62633
63288
|
return document;
|
|
62634
63289
|
}
|
|
62635
63290
|
);
|
|
63291
|
+
const breakingChangeResult = await runGroup(
|
|
63292
|
+
dependencies.core,
|
|
63293
|
+
"OpenAPI Breaking Change Check",
|
|
63294
|
+
async () => (dependencies.openApiChanges ?? runOpenApiBreakingChangeCheck)(
|
|
63295
|
+
{
|
|
63296
|
+
baselineSpecPath: inputs.breakingBaselineSpecPath,
|
|
63297
|
+
currentSourceContent: sourceSpecContent,
|
|
63298
|
+
currentUploadContent: specContent,
|
|
63299
|
+
logPath: inputs.breakingLogPath,
|
|
63300
|
+
mode: inputs.breakingChangeMode,
|
|
63301
|
+
previousSpecContent,
|
|
63302
|
+
rulesPath: inputs.breakingRulesPath,
|
|
63303
|
+
specPath: inputs.specPath,
|
|
63304
|
+
summaryPath: inputs.breakingSummaryPath,
|
|
63305
|
+
targetRef: inputs.breakingTargetRef
|
|
63306
|
+
},
|
|
63307
|
+
{
|
|
63308
|
+
core: dependencies.core,
|
|
63309
|
+
env: process.env,
|
|
63310
|
+
exec: dependencies.exec
|
|
63311
|
+
}
|
|
63312
|
+
)
|
|
63313
|
+
);
|
|
63314
|
+
outputs["breaking-change-status"] = breakingChangeResult.status;
|
|
63315
|
+
outputs["breaking-change-summary-json"] = createBreakingChangeSummaryJson(breakingChangeResult);
|
|
63316
|
+
if (breakingChangeResult.status === "failed") {
|
|
63317
|
+
dependencies.core.setOutput("breaking-change-status", outputs["breaking-change-status"]);
|
|
63318
|
+
dependencies.core.setOutput("breaking-change-summary-json", outputs["breaking-change-summary-json"]);
|
|
63319
|
+
throw new Error(
|
|
63320
|
+
`OpenAPI breaking-change check failed: ${breakingChangeResult.message || "breaking changes detected"}`
|
|
63321
|
+
);
|
|
63322
|
+
}
|
|
62636
63323
|
let explicitWorkspaceId = inputs.workspaceId;
|
|
62637
63324
|
if (!explicitWorkspaceId && resourcesState?.workspace?.id) {
|
|
62638
63325
|
explicitWorkspaceId = resourcesState.workspace.id;
|