@postman-cse/onboarding-repo-sync 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action.cjs +161 -73
- package/dist/cli.cjs +163 -75
- package/dist/index.cjs +161 -73
- package/package.json +6 -4
package/dist/cli.cjs
CHANGED
|
@@ -58522,10 +58522,10 @@ var require_internet = __commonJS({
|
|
|
58522
58522
|
}
|
|
58523
58523
|
}
|
|
58524
58524
|
};
|
|
58525
|
-
self2.mac = function(
|
|
58525
|
+
self2.mac = function(sep3) {
|
|
58526
58526
|
var i, mac = "", validSep = ":";
|
|
58527
|
-
if (["-", ""].indexOf(
|
|
58528
|
-
validSep =
|
|
58527
|
+
if (["-", ""].indexOf(sep3) !== -1) {
|
|
58528
|
+
validSep = sep3;
|
|
58529
58529
|
}
|
|
58530
58530
|
for (i = 0; i < 12; i++) {
|
|
58531
58531
|
mac += faker.datatype.number(15).toString(16);
|
|
@@ -104277,10 +104277,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
104277
104277
|
let offset = bm.offset;
|
|
104278
104278
|
let commentEnd = null;
|
|
104279
104279
|
for (const collItem of bm.items) {
|
|
104280
|
-
const { start, key, sep:
|
|
104280
|
+
const { start, key, sep: sep3, value } = collItem;
|
|
104281
104281
|
const keyProps = resolveProps.resolveProps(start, {
|
|
104282
104282
|
indicator: "explicit-key-ind",
|
|
104283
|
-
next: key ??
|
|
104283
|
+
next: key ?? sep3?.[0],
|
|
104284
104284
|
offset,
|
|
104285
104285
|
onError,
|
|
104286
104286
|
parentIndent: bm.indent,
|
|
@@ -104294,7 +104294,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
104294
104294
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
104295
104295
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
104296
104296
|
}
|
|
104297
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
104297
|
+
if (!keyProps.anchor && !keyProps.tag && !sep3) {
|
|
104298
104298
|
commentEnd = keyProps.end;
|
|
104299
104299
|
if (keyProps.comment) {
|
|
104300
104300
|
if (map.comment)
|
|
@@ -104318,7 +104318,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
104318
104318
|
ctx.atKey = false;
|
|
104319
104319
|
if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
|
|
104320
104320
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
104321
|
-
const valueProps = resolveProps.resolveProps(
|
|
104321
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
104322
104322
|
indicator: "map-value-ind",
|
|
104323
104323
|
next: value,
|
|
104324
104324
|
offset: keyNode.range[2],
|
|
@@ -104334,7 +104334,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
104334
104334
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
104335
104335
|
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
104336
104336
|
}
|
|
104337
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset,
|
|
104337
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep3, null, valueProps, onError);
|
|
104338
104338
|
if (ctx.schema.compat)
|
|
104339
104339
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
|
|
104340
104340
|
offset = valueNode.range[2];
|
|
@@ -104425,7 +104425,7 @@ var require_resolve_end = __commonJS({
|
|
|
104425
104425
|
let comment = "";
|
|
104426
104426
|
if (end) {
|
|
104427
104427
|
let hasSpace = false;
|
|
104428
|
-
let
|
|
104428
|
+
let sep3 = "";
|
|
104429
104429
|
for (const token of end) {
|
|
104430
104430
|
const { source, type } = token;
|
|
104431
104431
|
switch (type) {
|
|
@@ -104439,13 +104439,13 @@ var require_resolve_end = __commonJS({
|
|
|
104439
104439
|
if (!comment)
|
|
104440
104440
|
comment = cb;
|
|
104441
104441
|
else
|
|
104442
|
-
comment +=
|
|
104443
|
-
|
|
104442
|
+
comment += sep3 + cb;
|
|
104443
|
+
sep3 = "";
|
|
104444
104444
|
break;
|
|
104445
104445
|
}
|
|
104446
104446
|
case "newline":
|
|
104447
104447
|
if (comment)
|
|
104448
|
-
|
|
104448
|
+
sep3 += source;
|
|
104449
104449
|
hasSpace = true;
|
|
104450
104450
|
break;
|
|
104451
104451
|
default:
|
|
@@ -104488,18 +104488,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
104488
104488
|
let offset = fc.offset + fc.start.source.length;
|
|
104489
104489
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
104490
104490
|
const collItem = fc.items[i];
|
|
104491
|
-
const { start, key, sep:
|
|
104491
|
+
const { start, key, sep: sep3, value } = collItem;
|
|
104492
104492
|
const props = resolveProps.resolveProps(start, {
|
|
104493
104493
|
flow: fcName,
|
|
104494
104494
|
indicator: "explicit-key-ind",
|
|
104495
|
-
next: key ??
|
|
104495
|
+
next: key ?? sep3?.[0],
|
|
104496
104496
|
offset,
|
|
104497
104497
|
onError,
|
|
104498
104498
|
parentIndent: fc.indent,
|
|
104499
104499
|
startOnNewline: false
|
|
104500
104500
|
});
|
|
104501
104501
|
if (!props.found) {
|
|
104502
|
-
if (!props.anchor && !props.tag && !
|
|
104502
|
+
if (!props.anchor && !props.tag && !sep3 && !value) {
|
|
104503
104503
|
if (i === 0 && props.comma)
|
|
104504
104504
|
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
104505
104505
|
else if (i < fc.items.length - 1)
|
|
@@ -104553,8 +104553,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
104553
104553
|
}
|
|
104554
104554
|
}
|
|
104555
104555
|
}
|
|
104556
|
-
if (!isMap && !
|
|
104557
|
-
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end,
|
|
104556
|
+
if (!isMap && !sep3 && !props.found) {
|
|
104557
|
+
const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep3, null, props, onError);
|
|
104558
104558
|
coll.items.push(valueNode);
|
|
104559
104559
|
offset = valueNode.range[2];
|
|
104560
104560
|
if (isBlock(value))
|
|
@@ -104566,7 +104566,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
104566
104566
|
if (isBlock(key))
|
|
104567
104567
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
104568
104568
|
ctx.atKey = false;
|
|
104569
|
-
const valueProps = resolveProps.resolveProps(
|
|
104569
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
104570
104570
|
flow: fcName,
|
|
104571
104571
|
indicator: "map-value-ind",
|
|
104572
104572
|
next: value,
|
|
@@ -104577,8 +104577,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
104577
104577
|
});
|
|
104578
104578
|
if (valueProps.found) {
|
|
104579
104579
|
if (!isMap && !props.found && ctx.options.strict) {
|
|
104580
|
-
if (
|
|
104581
|
-
for (const st of
|
|
104580
|
+
if (sep3)
|
|
104581
|
+
for (const st of sep3) {
|
|
104582
104582
|
if (st === valueProps.found)
|
|
104583
104583
|
break;
|
|
104584
104584
|
if (st.type === "newline") {
|
|
@@ -104595,7 +104595,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
104595
104595
|
else
|
|
104596
104596
|
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
104597
104597
|
}
|
|
104598
|
-
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
104598
|
+
const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep3, null, valueProps, onError) : null;
|
|
104599
104599
|
if (valueNode) {
|
|
104600
104600
|
if (isBlock(value))
|
|
104601
104601
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -104775,7 +104775,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
104775
104775
|
chompStart = i + 1;
|
|
104776
104776
|
}
|
|
104777
104777
|
let value = "";
|
|
104778
|
-
let
|
|
104778
|
+
let sep3 = "";
|
|
104779
104779
|
let prevMoreIndented = false;
|
|
104780
104780
|
for (let i = 0; i < contentStart; ++i)
|
|
104781
104781
|
value += lines[i][0].slice(trimIndent) + "\n";
|
|
@@ -104792,24 +104792,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
104792
104792
|
indent = "";
|
|
104793
104793
|
}
|
|
104794
104794
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
104795
|
-
value +=
|
|
104796
|
-
|
|
104795
|
+
value += sep3 + indent.slice(trimIndent) + content;
|
|
104796
|
+
sep3 = "\n";
|
|
104797
104797
|
} else if (indent.length > trimIndent || content[0] === " ") {
|
|
104798
|
-
if (
|
|
104799
|
-
|
|
104800
|
-
else if (!prevMoreIndented &&
|
|
104801
|
-
|
|
104802
|
-
value +=
|
|
104803
|
-
|
|
104798
|
+
if (sep3 === " ")
|
|
104799
|
+
sep3 = "\n";
|
|
104800
|
+
else if (!prevMoreIndented && sep3 === "\n")
|
|
104801
|
+
sep3 = "\n\n";
|
|
104802
|
+
value += sep3 + indent.slice(trimIndent) + content;
|
|
104803
|
+
sep3 = "\n";
|
|
104804
104804
|
prevMoreIndented = true;
|
|
104805
104805
|
} else if (content === "") {
|
|
104806
|
-
if (
|
|
104806
|
+
if (sep3 === "\n")
|
|
104807
104807
|
value += "\n";
|
|
104808
104808
|
else
|
|
104809
|
-
|
|
104809
|
+
sep3 = "\n";
|
|
104810
104810
|
} else {
|
|
104811
|
-
value +=
|
|
104812
|
-
|
|
104811
|
+
value += sep3 + content;
|
|
104812
|
+
sep3 = " ";
|
|
104813
104813
|
prevMoreIndented = false;
|
|
104814
104814
|
}
|
|
104815
104815
|
}
|
|
@@ -104991,25 +104991,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
104991
104991
|
if (!match)
|
|
104992
104992
|
return source;
|
|
104993
104993
|
let res = match[1];
|
|
104994
|
-
let
|
|
104994
|
+
let sep3 = " ";
|
|
104995
104995
|
let pos = first.lastIndex;
|
|
104996
104996
|
line.lastIndex = pos;
|
|
104997
104997
|
while (match = line.exec(source)) {
|
|
104998
104998
|
if (match[1] === "") {
|
|
104999
|
-
if (
|
|
105000
|
-
res +=
|
|
104999
|
+
if (sep3 === "\n")
|
|
105000
|
+
res += sep3;
|
|
105001
105001
|
else
|
|
105002
|
-
|
|
105002
|
+
sep3 = "\n";
|
|
105003
105003
|
} else {
|
|
105004
|
-
res +=
|
|
105005
|
-
|
|
105004
|
+
res += sep3 + match[1];
|
|
105005
|
+
sep3 = " ";
|
|
105006
105006
|
}
|
|
105007
105007
|
pos = line.lastIndex;
|
|
105008
105008
|
}
|
|
105009
105009
|
const last = /[ \t]*(.*)/sy;
|
|
105010
105010
|
last.lastIndex = pos;
|
|
105011
105011
|
match = last.exec(source);
|
|
105012
|
-
return res +
|
|
105012
|
+
return res + sep3 + (match?.[1] ?? "");
|
|
105013
105013
|
}
|
|
105014
105014
|
function doubleQuotedValue(source, onError) {
|
|
105015
105015
|
let res = "";
|
|
@@ -105819,14 +105819,14 @@ var require_cst_stringify = __commonJS({
|
|
|
105819
105819
|
}
|
|
105820
105820
|
}
|
|
105821
105821
|
}
|
|
105822
|
-
function stringifyItem({ start, key, sep:
|
|
105822
|
+
function stringifyItem({ start, key, sep: sep3, value }) {
|
|
105823
105823
|
let res = "";
|
|
105824
105824
|
for (const st of start)
|
|
105825
105825
|
res += st.source;
|
|
105826
105826
|
if (key)
|
|
105827
105827
|
res += stringifyToken(key);
|
|
105828
|
-
if (
|
|
105829
|
-
for (const st of
|
|
105828
|
+
if (sep3)
|
|
105829
|
+
for (const st of sep3)
|
|
105830
105830
|
res += st.source;
|
|
105831
105831
|
if (value)
|
|
105832
105832
|
res += stringifyToken(value);
|
|
@@ -106993,18 +106993,18 @@ var require_parser2 = __commonJS({
|
|
|
106993
106993
|
if (this.type === "map-value-ind") {
|
|
106994
106994
|
const prev = getPrevProps(this.peek(2));
|
|
106995
106995
|
const start = getFirstKeyStartProps(prev);
|
|
106996
|
-
let
|
|
106996
|
+
let sep3;
|
|
106997
106997
|
if (scalar.end) {
|
|
106998
|
-
|
|
106999
|
-
|
|
106998
|
+
sep3 = scalar.end;
|
|
106999
|
+
sep3.push(this.sourceToken);
|
|
107000
107000
|
delete scalar.end;
|
|
107001
107001
|
} else
|
|
107002
|
-
|
|
107002
|
+
sep3 = [this.sourceToken];
|
|
107003
107003
|
const map = {
|
|
107004
107004
|
type: "block-map",
|
|
107005
107005
|
offset: scalar.offset,
|
|
107006
107006
|
indent: scalar.indent,
|
|
107007
|
-
items: [{ start, key: scalar, sep:
|
|
107007
|
+
items: [{ start, key: scalar, sep: sep3 }]
|
|
107008
107008
|
};
|
|
107009
107009
|
this.onKeyLine = true;
|
|
107010
107010
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -107157,15 +107157,15 @@ var require_parser2 = __commonJS({
|
|
|
107157
107157
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
107158
107158
|
const start2 = getFirstKeyStartProps(it.start);
|
|
107159
107159
|
const key = it.key;
|
|
107160
|
-
const
|
|
107161
|
-
|
|
107160
|
+
const sep3 = it.sep;
|
|
107161
|
+
sep3.push(this.sourceToken);
|
|
107162
107162
|
delete it.key;
|
|
107163
107163
|
delete it.sep;
|
|
107164
107164
|
this.stack.push({
|
|
107165
107165
|
type: "block-map",
|
|
107166
107166
|
offset: this.offset,
|
|
107167
107167
|
indent: this.indent,
|
|
107168
|
-
items: [{ start: start2, key, sep:
|
|
107168
|
+
items: [{ start: start2, key, sep: sep3 }]
|
|
107169
107169
|
});
|
|
107170
107170
|
} else if (start.length > 0) {
|
|
107171
107171
|
it.sep = it.sep.concat(start, this.sourceToken);
|
|
@@ -107359,13 +107359,13 @@ var require_parser2 = __commonJS({
|
|
|
107359
107359
|
const prev = getPrevProps(parent);
|
|
107360
107360
|
const start = getFirstKeyStartProps(prev);
|
|
107361
107361
|
fixFlowSeqItems(fc);
|
|
107362
|
-
const
|
|
107363
|
-
|
|
107362
|
+
const sep3 = fc.end.splice(1, fc.end.length);
|
|
107363
|
+
sep3.push(this.sourceToken);
|
|
107364
107364
|
const map = {
|
|
107365
107365
|
type: "block-map",
|
|
107366
107366
|
offset: fc.offset,
|
|
107367
107367
|
indent: fc.indent,
|
|
107368
|
-
items: [{ start, key: fc, sep:
|
|
107368
|
+
items: [{ start, key: fc, sep: sep3 }]
|
|
107369
107369
|
};
|
|
107370
107370
|
this.onKeyLine = true;
|
|
107371
107371
|
this.stack[this.stack.length - 1] = map;
|
|
@@ -122882,8 +122882,8 @@ function writeFlowMapping(state, level, node) {
|
|
|
122882
122882
|
if (explicitPair) pairBuffer += "? ";
|
|
122883
122883
|
else if (state.quoteFlowKeys) pairBuffer += '"';
|
|
122884
122884
|
const valueText = writeNode(state, level, value, {});
|
|
122885
|
-
const
|
|
122886
|
-
pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '"' : ""}:${
|
|
122885
|
+
const sep3 = state.flowSkipColonSpace || valueText === "" ? "" : " ";
|
|
122886
|
+
pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '"' : ""}:${sep3}${valueText}`;
|
|
122887
122887
|
result += pairBuffer;
|
|
122888
122888
|
}
|
|
122889
122889
|
const pad = state.flowBracketPadding && result !== "" ? " " : "";
|
|
@@ -122980,8 +122980,8 @@ function writeNode(state, level, node, ctx) {
|
|
|
122980
122980
|
if (anchor !== null) props.push(anchor);
|
|
122981
122981
|
if (tag !== null) props.push(tag);
|
|
122982
122982
|
}
|
|
122983
|
-
const
|
|
122984
|
-
body = `${props.join(" ")}${
|
|
122983
|
+
const sep3 = body === "" || body.charCodeAt(0) === CHAR_LINE_FEED ? "" : " ";
|
|
122984
|
+
body = `${props.join(" ")}${sep3}${body}`;
|
|
122985
122985
|
}
|
|
122986
122986
|
return body;
|
|
122987
122987
|
}
|
|
@@ -123026,8 +123026,8 @@ function present(documents, options) {
|
|
|
123026
123026
|
block: true,
|
|
123027
123027
|
compact: true
|
|
123028
123028
|
});
|
|
123029
|
-
const
|
|
123030
|
-
result += `---${
|
|
123029
|
+
const sep3 = body === "" ? "" : hasDirectives || rootStartsOwnLine(doc.contents) ? "\n" : " ";
|
|
123030
|
+
result += `---${sep3}${body}
|
|
123031
123031
|
`;
|
|
123032
123032
|
} else result += writeNode(state, 0, doc.contents, {
|
|
123033
123033
|
block: true,
|
|
@@ -123152,9 +123152,47 @@ function structuredCloneSafe(value) {
|
|
|
123152
123152
|
if (typeof structuredClone === "function") return structuredClone(value);
|
|
123153
123153
|
return JSON.parse(JSON.stringify(value));
|
|
123154
123154
|
}
|
|
123155
|
+
async function listFilesRelative(dir, base) {
|
|
123156
|
+
let entries;
|
|
123157
|
+
try {
|
|
123158
|
+
entries = await fs2.readdir(dir, { withFileTypes: true });
|
|
123159
|
+
} catch {
|
|
123160
|
+
return [];
|
|
123161
|
+
}
|
|
123162
|
+
const out = [];
|
|
123163
|
+
for (const entry of entries) {
|
|
123164
|
+
const abs = path.join(dir, entry.name);
|
|
123165
|
+
if (entry.isDirectory()) {
|
|
123166
|
+
out.push(...await listFilesRelative(abs, base));
|
|
123167
|
+
} else if (entry.isFile()) {
|
|
123168
|
+
out.push(path.relative(base, abs).split(path.sep).join("/"));
|
|
123169
|
+
}
|
|
123170
|
+
}
|
|
123171
|
+
return out;
|
|
123172
|
+
}
|
|
123173
|
+
async function pruneEmptyDirs(dir) {
|
|
123174
|
+
let entries;
|
|
123175
|
+
try {
|
|
123176
|
+
entries = await fs2.readdir(dir, { withFileTypes: true });
|
|
123177
|
+
} catch {
|
|
123178
|
+
return;
|
|
123179
|
+
}
|
|
123180
|
+
for (const entry of entries) {
|
|
123181
|
+
if (entry.isDirectory()) {
|
|
123182
|
+
const child = path.join(dir, entry.name);
|
|
123183
|
+
await pruneEmptyDirs(child);
|
|
123184
|
+
try {
|
|
123185
|
+
await fs2.rmdir(child);
|
|
123186
|
+
} catch {
|
|
123187
|
+
}
|
|
123188
|
+
}
|
|
123189
|
+
}
|
|
123190
|
+
}
|
|
123155
123191
|
async function writeSplitCollection(v32, outputDir) {
|
|
123156
123192
|
const { files, rootPath } = await (0, import_v32.splitCollection)(v32);
|
|
123157
123193
|
await fs2.mkdir(outputDir, { recursive: true });
|
|
123194
|
+
const preexisting = new Set(await listFilesRelative(outputDir, outputDir));
|
|
123195
|
+
const written = /* @__PURE__ */ new Set();
|
|
123158
123196
|
for (const file of files) {
|
|
123159
123197
|
let rel = file.path;
|
|
123160
123198
|
if (rootPath && rel.startsWith(rootPath)) {
|
|
@@ -123165,7 +123203,13 @@ async function writeSplitCollection(v32, outputDir) {
|
|
|
123165
123203
|
const dest = path.join(outputDir, rel);
|
|
123166
123204
|
await fs2.mkdir(path.dirname(dest), { recursive: true });
|
|
123167
123205
|
await fs2.writeFile(dest, file.content, "utf8");
|
|
123206
|
+
written.add(rel.split(path.sep).join("/"));
|
|
123207
|
+
}
|
|
123208
|
+
for (const rel of preexisting) {
|
|
123209
|
+
if (written.has(rel)) continue;
|
|
123210
|
+
await fs2.rm(path.join(outputDir, rel), { force: true });
|
|
123168
123211
|
}
|
|
123212
|
+
await pruneEmptyDirs(outputDir);
|
|
123169
123213
|
}
|
|
123170
123214
|
|
|
123171
123215
|
// src/lib/postman/base-urls.ts
|
|
@@ -126613,10 +126657,33 @@ function writeJsonFile(path5, content, normalize3 = false) {
|
|
|
126613
126657
|
const data = normalize3 ? stripVolatileFields(content) : content;
|
|
126614
126658
|
(0, import_node_fs3.writeFileSync)(path5, JSON.stringify(data, null, 2));
|
|
126615
126659
|
}
|
|
126616
|
-
function
|
|
126617
|
-
|
|
126618
|
-
|
|
126619
|
-
}
|
|
126660
|
+
function buildMappedSpecCloudKey(mappedSource, specSyncMode, releaseLabel) {
|
|
126661
|
+
if (specSyncMode !== "version") {
|
|
126662
|
+
return mappedSource;
|
|
126663
|
+
}
|
|
126664
|
+
const normalized = normalizeReleaseLabel(releaseLabel || "");
|
|
126665
|
+
if (!normalized) {
|
|
126666
|
+
return void 0;
|
|
126667
|
+
}
|
|
126668
|
+
return `${mappedSource}#release=${normalized}`;
|
|
126669
|
+
}
|
|
126670
|
+
function resolveDurableWorkspaceId(options) {
|
|
126671
|
+
const { candidateId, priorId, workspaceLinkEnabled, workspaceLinkStatus } = options;
|
|
126672
|
+
const candidate = candidateId.trim();
|
|
126673
|
+
const prior = priorId?.trim() || void 0;
|
|
126674
|
+
if (!workspaceLinkEnabled) {
|
|
126675
|
+
return candidate || prior;
|
|
126676
|
+
}
|
|
126677
|
+
if (workspaceLinkStatus === "success") {
|
|
126678
|
+
return candidate || void 0;
|
|
126679
|
+
}
|
|
126680
|
+
return prior === candidate ? prior : void 0;
|
|
126681
|
+
}
|
|
126682
|
+
function buildResourcesManifest(workspaceId, collectionMap, envMap, artifactDir, localSpecRefs, mappedSpecRef, specId, existingSpecs) {
|
|
126683
|
+
const manifest = {};
|
|
126684
|
+
if (workspaceId) {
|
|
126685
|
+
manifest.workspace = { id: workspaceId };
|
|
126686
|
+
}
|
|
126620
126687
|
const localResources = {};
|
|
126621
126688
|
const cloudResources = {};
|
|
126622
126689
|
const collectionKeys = Object.keys(collectionMap);
|
|
@@ -126637,8 +126704,12 @@ function buildResourcesManifest(workspaceId, collectionMap, envMap, artifactDir,
|
|
|
126637
126704
|
if (localSpecRefs.length > 0) {
|
|
126638
126705
|
localResources.specs = localSpecRefs;
|
|
126639
126706
|
}
|
|
126707
|
+
const specs = { ...existingSpecs || {} };
|
|
126640
126708
|
if (mappedSpecRef && specId) {
|
|
126641
|
-
|
|
126709
|
+
specs[mappedSpecRef] = specId;
|
|
126710
|
+
}
|
|
126711
|
+
if (Object.keys(specs).length > 0) {
|
|
126712
|
+
cloudResources.specs = specs;
|
|
126642
126713
|
}
|
|
126643
126714
|
if (Object.keys(localResources).length > 0) {
|
|
126644
126715
|
manifest.localResources = localResources;
|
|
@@ -126687,8 +126758,8 @@ function assertPathWithinCwd(targetPath, fieldName) {
|
|
|
126687
126758
|
}
|
|
126688
126759
|
const base = (0, import_node_fs3.realpathSync)(process.cwd());
|
|
126689
126760
|
const resolved = path3.resolve(base, rawPath);
|
|
126690
|
-
const
|
|
126691
|
-
if (
|
|
126761
|
+
const relative3 = path3.relative(base, resolved);
|
|
126762
|
+
if (relative3.startsWith("..") || path3.isAbsolute(relative3)) {
|
|
126692
126763
|
throw new Error(`${fieldName} must stay within the repository root; received ${targetPath}`);
|
|
126693
126764
|
}
|
|
126694
126765
|
let existingPath = resolved;
|
|
@@ -126705,7 +126776,7 @@ function assertPathWithinCwd(targetPath, fieldName) {
|
|
|
126705
126776
|
throw new Error(`${fieldName} must stay within the repository root; received ${targetPath}`);
|
|
126706
126777
|
}
|
|
126707
126778
|
}
|
|
126708
|
-
async function exportArtifacts(inputs, dependencies, envUids, assetProjectName) {
|
|
126779
|
+
async function exportArtifacts(inputs, dependencies, envUids, assetProjectName, options) {
|
|
126709
126780
|
if (!inputs.workspaceId) {
|
|
126710
126781
|
return;
|
|
126711
126782
|
}
|
|
@@ -126739,6 +126810,11 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName)
|
|
|
126739
126810
|
const manifestCollections = {};
|
|
126740
126811
|
const discoveredSpecs = scanLocalSpecReferences();
|
|
126741
126812
|
const mappedSpec = resolveMappedSpecReference(inputs.specPath, discoveredSpecs);
|
|
126813
|
+
const mappedSpecCloudKey = mappedSpec && inputs.specId ? buildMappedSpecCloudKey(
|
|
126814
|
+
mappedSpec.configRelativePath,
|
|
126815
|
+
inputs.specSyncMode,
|
|
126816
|
+
options.releaseLabel
|
|
126817
|
+
) : void 0;
|
|
126742
126818
|
if (inputs.baselineCollectionId) {
|
|
126743
126819
|
const col = await dependencies.postman.getCollection(inputs.baselineCollectionId);
|
|
126744
126820
|
const dirName = getCollectionDirectoryName("Baseline", assetProjectName);
|
|
@@ -126764,14 +126840,21 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName)
|
|
|
126764
126840
|
true
|
|
126765
126841
|
);
|
|
126766
126842
|
}
|
|
126843
|
+
const durableWorkspaceId = resolveDurableWorkspaceId({
|
|
126844
|
+
candidateId: inputs.workspaceId,
|
|
126845
|
+
priorId: options.priorWorkspaceId,
|
|
126846
|
+
workspaceLinkEnabled: inputs.workspaceLinkEnabled,
|
|
126847
|
+
workspaceLinkStatus: options.workspaceLinkStatus
|
|
126848
|
+
});
|
|
126767
126849
|
(0, import_node_fs3.writeFileSync)(".postman/resources.yaml", buildResourcesManifest(
|
|
126768
|
-
|
|
126850
|
+
durableWorkspaceId,
|
|
126769
126851
|
manifestCollections,
|
|
126770
126852
|
envUids,
|
|
126771
126853
|
inputs.artifactDir,
|
|
126772
126854
|
discoveredSpecs.map((spec) => spec.configRelativePath),
|
|
126773
|
-
|
|
126774
|
-
inputs.specId || void 0
|
|
126855
|
+
mappedSpecCloudKey,
|
|
126856
|
+
inputs.specId || void 0,
|
|
126857
|
+
options.existingSpecs
|
|
126775
126858
|
));
|
|
126776
126859
|
if (mappedSpec && Object.keys(manifestCollections).length > 0) {
|
|
126777
126860
|
(0, import_node_fs3.writeFileSync)(
|
|
@@ -127030,7 +127113,12 @@ async function runRepoSyncInner(inputs, dependencies) {
|
|
|
127030
127113
|
);
|
|
127031
127114
|
}
|
|
127032
127115
|
}
|
|
127033
|
-
await exportArtifacts(inputs, dependencies, envUids, assetProjectName
|
|
127116
|
+
await exportArtifacts(inputs, dependencies, envUids, assetProjectName, {
|
|
127117
|
+
workspaceLinkStatus: outputs["workspace-link-status"],
|
|
127118
|
+
priorWorkspaceId: resourcesState?.workspace?.id,
|
|
127119
|
+
existingSpecs: resourcesState?.cloudResources?.specs,
|
|
127120
|
+
releaseLabel
|
|
127121
|
+
});
|
|
127034
127122
|
const commit = await commitAndPushGeneratedFiles(inputs, dependencies);
|
|
127035
127123
|
outputs["commit-sha"] = commit.commitSha;
|
|
127036
127124
|
if (commit.resolvedCurrentRef) {
|
|
@@ -127530,8 +127618,8 @@ async function writeOptionalFile(filePath, content) {
|
|
|
127530
127618
|
}
|
|
127531
127619
|
const workspaceRoot = import_node_path3.default.resolve(process.cwd());
|
|
127532
127620
|
const resolved = import_node_path3.default.resolve(workspaceRoot, filePath);
|
|
127533
|
-
const
|
|
127534
|
-
if (
|
|
127621
|
+
const relative3 = import_node_path3.default.relative(workspaceRoot, resolved);
|
|
127622
|
+
if (relative3.startsWith("..") || import_node_path3.default.isAbsolute(relative3)) {
|
|
127535
127623
|
throw new Error(`Output path must stay within workspace: ${filePath}`);
|
|
127536
127624
|
}
|
|
127537
127625
|
await (0, import_promises.mkdir)(import_node_path3.default.dirname(resolved), { recursive: true });
|