@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/index.cjs CHANGED
@@ -58521,10 +58521,10 @@ var require_internet = __commonJS({
58521
58521
  }
58522
58522
  }
58523
58523
  };
58524
- self2.mac = function(sep4) {
58524
+ self2.mac = function(sep5) {
58525
58525
  var i, mac = "", validSep = ":";
58526
- if (["-", ""].indexOf(sep4) !== -1) {
58527
- validSep = sep4;
58526
+ if (["-", ""].indexOf(sep5) !== -1) {
58527
+ validSep = sep5;
58528
58528
  }
58529
58529
  for (i = 0; i < 12; i++) {
58530
58530
  mac += faker.datatype.number(15).toString(16);
@@ -104276,10 +104276,10 @@ var require_resolve_block_map = __commonJS({
104276
104276
  let offset = bm.offset;
104277
104277
  let commentEnd = null;
104278
104278
  for (const collItem of bm.items) {
104279
- const { start, key, sep: sep4, value } = collItem;
104279
+ const { start, key, sep: sep5, value } = collItem;
104280
104280
  const keyProps = resolveProps.resolveProps(start, {
104281
104281
  indicator: "explicit-key-ind",
104282
- next: key ?? sep4?.[0],
104282
+ next: key ?? sep5?.[0],
104283
104283
  offset,
104284
104284
  onError,
104285
104285
  parentIndent: bm.indent,
@@ -104293,7 +104293,7 @@ var require_resolve_block_map = __commonJS({
104293
104293
  else if ("indent" in key && key.indent !== bm.indent)
104294
104294
  onError(offset, "BAD_INDENT", startColMsg);
104295
104295
  }
104296
- if (!keyProps.anchor && !keyProps.tag && !sep4) {
104296
+ if (!keyProps.anchor && !keyProps.tag && !sep5) {
104297
104297
  commentEnd = keyProps.end;
104298
104298
  if (keyProps.comment) {
104299
104299
  if (map.comment)
@@ -104317,7 +104317,7 @@ var require_resolve_block_map = __commonJS({
104317
104317
  ctx.atKey = false;
104318
104318
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
104319
104319
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
104320
- const valueProps = resolveProps.resolveProps(sep4 ?? [], {
104320
+ const valueProps = resolveProps.resolveProps(sep5 ?? [], {
104321
104321
  indicator: "map-value-ind",
104322
104322
  next: value,
104323
104323
  offset: keyNode.range[2],
@@ -104333,7 +104333,7 @@ var require_resolve_block_map = __commonJS({
104333
104333
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
104334
104334
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
104335
104335
  }
104336
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep4, null, valueProps, onError);
104336
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep5, null, valueProps, onError);
104337
104337
  if (ctx.schema.compat)
104338
104338
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
104339
104339
  offset = valueNode.range[2];
@@ -104424,7 +104424,7 @@ var require_resolve_end = __commonJS({
104424
104424
  let comment = "";
104425
104425
  if (end) {
104426
104426
  let hasSpace = false;
104427
- let sep4 = "";
104427
+ let sep5 = "";
104428
104428
  for (const token of end) {
104429
104429
  const { source, type } = token;
104430
104430
  switch (type) {
@@ -104438,13 +104438,13 @@ var require_resolve_end = __commonJS({
104438
104438
  if (!comment)
104439
104439
  comment = cb;
104440
104440
  else
104441
- comment += sep4 + cb;
104442
- sep4 = "";
104441
+ comment += sep5 + cb;
104442
+ sep5 = "";
104443
104443
  break;
104444
104444
  }
104445
104445
  case "newline":
104446
104446
  if (comment)
104447
- sep4 += source;
104447
+ sep5 += source;
104448
104448
  hasSpace = true;
104449
104449
  break;
104450
104450
  default:
@@ -104487,18 +104487,18 @@ var require_resolve_flow_collection = __commonJS({
104487
104487
  let offset = fc.offset + fc.start.source.length;
104488
104488
  for (let i = 0; i < fc.items.length; ++i) {
104489
104489
  const collItem = fc.items[i];
104490
- const { start, key, sep: sep4, value } = collItem;
104490
+ const { start, key, sep: sep5, value } = collItem;
104491
104491
  const props = resolveProps.resolveProps(start, {
104492
104492
  flow: fcName,
104493
104493
  indicator: "explicit-key-ind",
104494
- next: key ?? sep4?.[0],
104494
+ next: key ?? sep5?.[0],
104495
104495
  offset,
104496
104496
  onError,
104497
104497
  parentIndent: fc.indent,
104498
104498
  startOnNewline: false
104499
104499
  });
104500
104500
  if (!props.found) {
104501
- if (!props.anchor && !props.tag && !sep4 && !value) {
104501
+ if (!props.anchor && !props.tag && !sep5 && !value) {
104502
104502
  if (i === 0 && props.comma)
104503
104503
  onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
104504
104504
  else if (i < fc.items.length - 1)
@@ -104552,8 +104552,8 @@ var require_resolve_flow_collection = __commonJS({
104552
104552
  }
104553
104553
  }
104554
104554
  }
104555
- if (!isMap && !sep4 && !props.found) {
104556
- const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep4, null, props, onError);
104555
+ if (!isMap && !sep5 && !props.found) {
104556
+ const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep5, null, props, onError);
104557
104557
  coll.items.push(valueNode);
104558
104558
  offset = valueNode.range[2];
104559
104559
  if (isBlock(value))
@@ -104565,7 +104565,7 @@ var require_resolve_flow_collection = __commonJS({
104565
104565
  if (isBlock(key))
104566
104566
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
104567
104567
  ctx.atKey = false;
104568
- const valueProps = resolveProps.resolveProps(sep4 ?? [], {
104568
+ const valueProps = resolveProps.resolveProps(sep5 ?? [], {
104569
104569
  flow: fcName,
104570
104570
  indicator: "map-value-ind",
104571
104571
  next: value,
@@ -104576,8 +104576,8 @@ var require_resolve_flow_collection = __commonJS({
104576
104576
  });
104577
104577
  if (valueProps.found) {
104578
104578
  if (!isMap && !props.found && ctx.options.strict) {
104579
- if (sep4)
104580
- for (const st of sep4) {
104579
+ if (sep5)
104580
+ for (const st of sep5) {
104581
104581
  if (st === valueProps.found)
104582
104582
  break;
104583
104583
  if (st.type === "newline") {
@@ -104594,7 +104594,7 @@ var require_resolve_flow_collection = __commonJS({
104594
104594
  else
104595
104595
  onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
104596
104596
  }
104597
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep4, null, valueProps, onError) : null;
104597
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep5, null, valueProps, onError) : null;
104598
104598
  if (valueNode) {
104599
104599
  if (isBlock(value))
104600
104600
  onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -104774,7 +104774,7 @@ var require_resolve_block_scalar = __commonJS({
104774
104774
  chompStart = i + 1;
104775
104775
  }
104776
104776
  let value = "";
104777
- let sep4 = "";
104777
+ let sep5 = "";
104778
104778
  let prevMoreIndented = false;
104779
104779
  for (let i = 0; i < contentStart; ++i)
104780
104780
  value += lines[i][0].slice(trimIndent) + "\n";
@@ -104791,24 +104791,24 @@ var require_resolve_block_scalar = __commonJS({
104791
104791
  indent = "";
104792
104792
  }
104793
104793
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
104794
- value += sep4 + indent.slice(trimIndent) + content;
104795
- sep4 = "\n";
104794
+ value += sep5 + indent.slice(trimIndent) + content;
104795
+ sep5 = "\n";
104796
104796
  } else if (indent.length > trimIndent || content[0] === " ") {
104797
- if (sep4 === " ")
104798
- sep4 = "\n";
104799
- else if (!prevMoreIndented && sep4 === "\n")
104800
- sep4 = "\n\n";
104801
- value += sep4 + indent.slice(trimIndent) + content;
104802
- sep4 = "\n";
104797
+ if (sep5 === " ")
104798
+ sep5 = "\n";
104799
+ else if (!prevMoreIndented && sep5 === "\n")
104800
+ sep5 = "\n\n";
104801
+ value += sep5 + indent.slice(trimIndent) + content;
104802
+ sep5 = "\n";
104803
104803
  prevMoreIndented = true;
104804
104804
  } else if (content === "") {
104805
- if (sep4 === "\n")
104805
+ if (sep5 === "\n")
104806
104806
  value += "\n";
104807
104807
  else
104808
- sep4 = "\n";
104808
+ sep5 = "\n";
104809
104809
  } else {
104810
- value += sep4 + content;
104811
- sep4 = " ";
104810
+ value += sep5 + content;
104811
+ sep5 = " ";
104812
104812
  prevMoreIndented = false;
104813
104813
  }
104814
104814
  }
@@ -104990,25 +104990,25 @@ var require_resolve_flow_scalar = __commonJS({
104990
104990
  if (!match)
104991
104991
  return source;
104992
104992
  let res = match[1];
104993
- let sep4 = " ";
104993
+ let sep5 = " ";
104994
104994
  let pos = first.lastIndex;
104995
104995
  line.lastIndex = pos;
104996
104996
  while (match = line.exec(source)) {
104997
104997
  if (match[1] === "") {
104998
- if (sep4 === "\n")
104999
- res += sep4;
104998
+ if (sep5 === "\n")
104999
+ res += sep5;
105000
105000
  else
105001
- sep4 = "\n";
105001
+ sep5 = "\n";
105002
105002
  } else {
105003
- res += sep4 + match[1];
105004
- sep4 = " ";
105003
+ res += sep5 + match[1];
105004
+ sep5 = " ";
105005
105005
  }
105006
105006
  pos = line.lastIndex;
105007
105007
  }
105008
105008
  const last = /[ \t]*(.*)/sy;
105009
105009
  last.lastIndex = pos;
105010
105010
  match = last.exec(source);
105011
- return res + sep4 + (match?.[1] ?? "");
105011
+ return res + sep5 + (match?.[1] ?? "");
105012
105012
  }
105013
105013
  function doubleQuotedValue(source, onError) {
105014
105014
  let res = "";
@@ -105818,14 +105818,14 @@ var require_cst_stringify = __commonJS({
105818
105818
  }
105819
105819
  }
105820
105820
  }
105821
- function stringifyItem({ start, key, sep: sep4, value }) {
105821
+ function stringifyItem({ start, key, sep: sep5, value }) {
105822
105822
  let res = "";
105823
105823
  for (const st of start)
105824
105824
  res += st.source;
105825
105825
  if (key)
105826
105826
  res += stringifyToken(key);
105827
- if (sep4)
105828
- for (const st of sep4)
105827
+ if (sep5)
105828
+ for (const st of sep5)
105829
105829
  res += st.source;
105830
105830
  if (value)
105831
105831
  res += stringifyToken(value);
@@ -106992,18 +106992,18 @@ var require_parser2 = __commonJS({
106992
106992
  if (this.type === "map-value-ind") {
106993
106993
  const prev = getPrevProps(this.peek(2));
106994
106994
  const start = getFirstKeyStartProps(prev);
106995
- let sep4;
106995
+ let sep5;
106996
106996
  if (scalar.end) {
106997
- sep4 = scalar.end;
106998
- sep4.push(this.sourceToken);
106997
+ sep5 = scalar.end;
106998
+ sep5.push(this.sourceToken);
106999
106999
  delete scalar.end;
107000
107000
  } else
107001
- sep4 = [this.sourceToken];
107001
+ sep5 = [this.sourceToken];
107002
107002
  const map = {
107003
107003
  type: "block-map",
107004
107004
  offset: scalar.offset,
107005
107005
  indent: scalar.indent,
107006
- items: [{ start, key: scalar, sep: sep4 }]
107006
+ items: [{ start, key: scalar, sep: sep5 }]
107007
107007
  };
107008
107008
  this.onKeyLine = true;
107009
107009
  this.stack[this.stack.length - 1] = map;
@@ -107156,15 +107156,15 @@ var require_parser2 = __commonJS({
107156
107156
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
107157
107157
  const start2 = getFirstKeyStartProps(it.start);
107158
107158
  const key = it.key;
107159
- const sep4 = it.sep;
107160
- sep4.push(this.sourceToken);
107159
+ const sep5 = it.sep;
107160
+ sep5.push(this.sourceToken);
107161
107161
  delete it.key;
107162
107162
  delete it.sep;
107163
107163
  this.stack.push({
107164
107164
  type: "block-map",
107165
107165
  offset: this.offset,
107166
107166
  indent: this.indent,
107167
- items: [{ start: start2, key, sep: sep4 }]
107167
+ items: [{ start: start2, key, sep: sep5 }]
107168
107168
  });
107169
107169
  } else if (start.length > 0) {
107170
107170
  it.sep = it.sep.concat(start, this.sourceToken);
@@ -107358,13 +107358,13 @@ var require_parser2 = __commonJS({
107358
107358
  const prev = getPrevProps(parent);
107359
107359
  const start = getFirstKeyStartProps(prev);
107360
107360
  fixFlowSeqItems(fc);
107361
- const sep4 = fc.end.splice(1, fc.end.length);
107362
- sep4.push(this.sourceToken);
107361
+ const sep5 = fc.end.splice(1, fc.end.length);
107362
+ sep5.push(this.sourceToken);
107363
107363
  const map = {
107364
107364
  type: "block-map",
107365
107365
  offset: fc.offset,
107366
107366
  indent: fc.indent,
107367
- items: [{ start, key: fc, sep: sep4 }]
107367
+ items: [{ start, key: fc, sep: sep5 }]
107368
107368
  };
107369
107369
  this.onKeyLine = true;
107370
107370
  this.stack[this.stack.length - 1] = map;
@@ -124794,8 +124794,8 @@ function writeFlowMapping(state, level, node) {
124794
124794
  if (explicitPair) pairBuffer += "? ";
124795
124795
  else if (state.quoteFlowKeys) pairBuffer += '"';
124796
124796
  const valueText = writeNode(state, level, value, {});
124797
- const sep4 = state.flowSkipColonSpace || valueText === "" ? "" : " ";
124798
- pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '"' : ""}:${sep4}${valueText}`;
124797
+ const sep5 = state.flowSkipColonSpace || valueText === "" ? "" : " ";
124798
+ pairBuffer += `${keyText}${state.quoteFlowKeys && !explicitPair ? '"' : ""}:${sep5}${valueText}`;
124799
124799
  result += pairBuffer;
124800
124800
  }
124801
124801
  const pad = state.flowBracketPadding && result !== "" ? " " : "";
@@ -124892,8 +124892,8 @@ function writeNode(state, level, node, ctx) {
124892
124892
  if (anchor !== null) props.push(anchor);
124893
124893
  if (tag !== null) props.push(tag);
124894
124894
  }
124895
- const sep4 = body === "" || body.charCodeAt(0) === CHAR_LINE_FEED ? "" : " ";
124896
- body = `${props.join(" ")}${sep4}${body}`;
124895
+ const sep5 = body === "" || body.charCodeAt(0) === CHAR_LINE_FEED ? "" : " ";
124896
+ body = `${props.join(" ")}${sep5}${body}`;
124897
124897
  }
124898
124898
  return body;
124899
124899
  }
@@ -124938,8 +124938,8 @@ function present(documents, options) {
124938
124938
  block: true,
124939
124939
  compact: true
124940
124940
  });
124941
- const sep4 = body === "" ? "" : hasDirectives || rootStartsOwnLine(doc.contents) ? "\n" : " ";
124942
- result += `---${sep4}${body}
124941
+ const sep5 = body === "" ? "" : hasDirectives || rootStartsOwnLine(doc.contents) ? "\n" : " ";
124942
+ result += `---${sep5}${body}
124943
124943
  `;
124944
124944
  } else result += writeNode(state, 0, doc.contents, {
124945
124945
  block: true,
@@ -125064,9 +125064,47 @@ function structuredCloneSafe(value) {
125064
125064
  if (typeof structuredClone === "function") return structuredClone(value);
125065
125065
  return JSON.parse(JSON.stringify(value));
125066
125066
  }
125067
+ async function listFilesRelative(dir, base) {
125068
+ let entries;
125069
+ try {
125070
+ entries = await fs3.readdir(dir, { withFileTypes: true });
125071
+ } catch {
125072
+ return [];
125073
+ }
125074
+ const out = [];
125075
+ for (const entry of entries) {
125076
+ const abs = path6.join(dir, entry.name);
125077
+ if (entry.isDirectory()) {
125078
+ out.push(...await listFilesRelative(abs, base));
125079
+ } else if (entry.isFile()) {
125080
+ out.push(path6.relative(base, abs).split(path6.sep).join("/"));
125081
+ }
125082
+ }
125083
+ return out;
125084
+ }
125085
+ async function pruneEmptyDirs(dir) {
125086
+ let entries;
125087
+ try {
125088
+ entries = await fs3.readdir(dir, { withFileTypes: true });
125089
+ } catch {
125090
+ return;
125091
+ }
125092
+ for (const entry of entries) {
125093
+ if (entry.isDirectory()) {
125094
+ const child2 = path6.join(dir, entry.name);
125095
+ await pruneEmptyDirs(child2);
125096
+ try {
125097
+ await fs3.rmdir(child2);
125098
+ } catch {
125099
+ }
125100
+ }
125101
+ }
125102
+ }
125067
125103
  async function writeSplitCollection(v32, outputDir) {
125068
125104
  const { files, rootPath } = await (0, import_v32.splitCollection)(v32);
125069
125105
  await fs3.mkdir(outputDir, { recursive: true });
125106
+ const preexisting = new Set(await listFilesRelative(outputDir, outputDir));
125107
+ const written = /* @__PURE__ */ new Set();
125070
125108
  for (const file of files) {
125071
125109
  let rel = file.path;
125072
125110
  if (rootPath && rel.startsWith(rootPath)) {
@@ -125077,7 +125115,13 @@ async function writeSplitCollection(v32, outputDir) {
125077
125115
  const dest = path6.join(outputDir, rel);
125078
125116
  await fs3.mkdir(path6.dirname(dest), { recursive: true });
125079
125117
  await fs3.writeFile(dest, file.content, "utf8");
125118
+ written.add(rel.split(path6.sep).join("/"));
125119
+ }
125120
+ for (const rel of preexisting) {
125121
+ if (written.has(rel)) continue;
125122
+ await fs3.rm(path6.join(outputDir, rel), { force: true });
125080
125123
  }
125124
+ await pruneEmptyDirs(outputDir);
125081
125125
  }
125082
125126
 
125083
125127
  // src/lib/postman/base-urls.ts
@@ -128714,10 +128758,33 @@ function writeJsonFile(path9, content, normalize3 = false) {
128714
128758
  const data = normalize3 ? stripVolatileFields(content) : content;
128715
128759
  (0, import_node_fs3.writeFileSync)(path9, JSON.stringify(data, null, 2));
128716
128760
  }
128717
- function buildResourcesManifest(workspaceId, collectionMap, envMap, artifactDir, localSpecRefs, mappedSpecRef, specId) {
128718
- const manifest = {
128719
- workspace: { id: workspaceId }
128720
- };
128761
+ function buildMappedSpecCloudKey(mappedSource, specSyncMode, releaseLabel) {
128762
+ if (specSyncMode !== "version") {
128763
+ return mappedSource;
128764
+ }
128765
+ const normalized = normalizeReleaseLabel(releaseLabel || "");
128766
+ if (!normalized) {
128767
+ return void 0;
128768
+ }
128769
+ return `${mappedSource}#release=${normalized}`;
128770
+ }
128771
+ function resolveDurableWorkspaceId(options) {
128772
+ const { candidateId, priorId, workspaceLinkEnabled, workspaceLinkStatus } = options;
128773
+ const candidate = candidateId.trim();
128774
+ const prior = priorId?.trim() || void 0;
128775
+ if (!workspaceLinkEnabled) {
128776
+ return candidate || prior;
128777
+ }
128778
+ if (workspaceLinkStatus === "success") {
128779
+ return candidate || void 0;
128780
+ }
128781
+ return prior === candidate ? prior : void 0;
128782
+ }
128783
+ function buildResourcesManifest(workspaceId, collectionMap, envMap, artifactDir, localSpecRefs, mappedSpecRef, specId, existingSpecs) {
128784
+ const manifest = {};
128785
+ if (workspaceId) {
128786
+ manifest.workspace = { id: workspaceId };
128787
+ }
128721
128788
  const localResources = {};
128722
128789
  const cloudResources = {};
128723
128790
  const collectionKeys = Object.keys(collectionMap);
@@ -128738,8 +128805,12 @@ function buildResourcesManifest(workspaceId, collectionMap, envMap, artifactDir,
128738
128805
  if (localSpecRefs.length > 0) {
128739
128806
  localResources.specs = localSpecRefs;
128740
128807
  }
128808
+ const specs = { ...existingSpecs || {} };
128741
128809
  if (mappedSpecRef && specId) {
128742
- cloudResources.specs = { [mappedSpecRef]: specId };
128810
+ specs[mappedSpecRef] = specId;
128811
+ }
128812
+ if (Object.keys(specs).length > 0) {
128813
+ cloudResources.specs = specs;
128743
128814
  }
128744
128815
  if (Object.keys(localResources).length > 0) {
128745
128816
  manifest.localResources = localResources;
@@ -128788,8 +128859,8 @@ function assertPathWithinCwd(targetPath, fieldName) {
128788
128859
  }
128789
128860
  const base = (0, import_node_fs3.realpathSync)(process.cwd());
128790
128861
  const resolved = path8.resolve(base, rawPath);
128791
- const relative3 = path8.relative(base, resolved);
128792
- if (relative3.startsWith("..") || path8.isAbsolute(relative3)) {
128862
+ const relative4 = path8.relative(base, resolved);
128863
+ if (relative4.startsWith("..") || path8.isAbsolute(relative4)) {
128793
128864
  throw new Error(`${fieldName} must stay within the repository root; received ${targetPath}`);
128794
128865
  }
128795
128866
  let existingPath = resolved;
@@ -128806,7 +128877,7 @@ function assertPathWithinCwd(targetPath, fieldName) {
128806
128877
  throw new Error(`${fieldName} must stay within the repository root; received ${targetPath}`);
128807
128878
  }
128808
128879
  }
128809
- async function exportArtifacts(inputs, dependencies, envUids, assetProjectName) {
128880
+ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName, options) {
128810
128881
  if (!inputs.workspaceId) {
128811
128882
  return;
128812
128883
  }
@@ -128840,6 +128911,11 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName)
128840
128911
  const manifestCollections = {};
128841
128912
  const discoveredSpecs = scanLocalSpecReferences();
128842
128913
  const mappedSpec = resolveMappedSpecReference(inputs.specPath, discoveredSpecs);
128914
+ const mappedSpecCloudKey = mappedSpec && inputs.specId ? buildMappedSpecCloudKey(
128915
+ mappedSpec.configRelativePath,
128916
+ inputs.specSyncMode,
128917
+ options.releaseLabel
128918
+ ) : void 0;
128843
128919
  if (inputs.baselineCollectionId) {
128844
128920
  const col = await dependencies.postman.getCollection(inputs.baselineCollectionId);
128845
128921
  const dirName = getCollectionDirectoryName("Baseline", assetProjectName);
@@ -128865,14 +128941,21 @@ async function exportArtifacts(inputs, dependencies, envUids, assetProjectName)
128865
128941
  true
128866
128942
  );
128867
128943
  }
128944
+ const durableWorkspaceId = resolveDurableWorkspaceId({
128945
+ candidateId: inputs.workspaceId,
128946
+ priorId: options.priorWorkspaceId,
128947
+ workspaceLinkEnabled: inputs.workspaceLinkEnabled,
128948
+ workspaceLinkStatus: options.workspaceLinkStatus
128949
+ });
128868
128950
  (0, import_node_fs3.writeFileSync)(".postman/resources.yaml", buildResourcesManifest(
128869
- inputs.workspaceId,
128951
+ durableWorkspaceId,
128870
128952
  manifestCollections,
128871
128953
  envUids,
128872
128954
  inputs.artifactDir,
128873
128955
  discoveredSpecs.map((spec) => spec.configRelativePath),
128874
- mappedSpec?.configRelativePath,
128875
- inputs.specId || void 0
128956
+ mappedSpecCloudKey,
128957
+ inputs.specId || void 0,
128958
+ options.existingSpecs
128876
128959
  ));
128877
128960
  if (mappedSpec && Object.keys(manifestCollections).length > 0) {
128878
128961
  (0, import_node_fs3.writeFileSync)(
@@ -129131,7 +129214,12 @@ async function runRepoSyncInner(inputs, dependencies) {
129131
129214
  );
129132
129215
  }
129133
129216
  }
129134
- await exportArtifacts(inputs, dependencies, envUids, assetProjectName);
129217
+ await exportArtifacts(inputs, dependencies, envUids, assetProjectName, {
129218
+ workspaceLinkStatus: outputs["workspace-link-status"],
129219
+ priorWorkspaceId: resourcesState?.workspace?.id,
129220
+ existingSpecs: resourcesState?.cloudResources?.specs,
129221
+ releaseLabel
129222
+ });
129135
129223
  const commit = await commitAndPushGeneratedFiles(inputs, dependencies);
129136
129224
  outputs["commit-sha"] = commit.commitSha;
129137
129225
  if (commit.resolvedCurrentRef) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-cse/onboarding-repo-sync",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Postman repo sync GitHub Action.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -16,12 +16,14 @@
16
16
  },
17
17
  "scripts": {
18
18
  "prepare": "git config core.hooksPath .githooks",
19
- "build": "npm run typecheck && rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node24 --format=cjs --outfile=dist/index.cjs && esbuild src/main.ts --bundle --platform=node --target=node24 --format=cjs --outfile=dist/action.cjs && esbuild src/cli.ts --bundle --platform=node --target=node24 --format=cjs --outfile=dist/cli.cjs",
20
- "verify:dist": "npm run build && node -e \"const fs=require('fs');const p='dist/cli.cjs';const s=fs.readFileSync(p,'utf8');if(!s.startsWith('#!/usr/bin/env node\\n')){console.error('dist/cli.cjs missing Node shebang');process.exit(1)}if(!(fs.statSync(p).mode&0o111)){console.error('dist/cli.cjs is not executable');process.exit(1)}\" && git diff --ignore-space-at-eol --text --exit-code -- dist",
19
+ "bundle": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node24 --format=cjs --outfile=dist/index.cjs && esbuild src/main.ts --bundle --platform=node --target=node24 --format=cjs --outfile=dist/action.cjs && esbuild src/cli.ts --bundle --platform=node --target=node24 --format=cjs --banner:js='#!/usr/bin/env node' --outfile=dist/cli.cjs && chmod 755 dist/cli.cjs",
20
+ "build": "npm run typecheck && npm run bundle",
21
+ "verify:dist:assert": "git diff --ignore-space-at-eol --text --exit-code -- dist && node scripts/verify-dist-artifact.mjs",
22
+ "verify:dist": "npm run build && npm run verify:dist:assert",
21
23
  "docs:tables": "node scripts/render-action-tables.mjs",
22
24
  "lint": "eslint .",
23
25
  "lint:fix": "eslint . --fix",
24
- "test": "vitest run",
26
+ "test": "vitest run && node --test .github/scripts/wait-for-e2e-gate.test.mjs",
25
27
  "typecheck": "tsc --noEmit -p tsconfig.json"
26
28
  },
27
29
  "keywords": [