@fern-api/fern-api-dev 4.50.3 → 4.50.4-1-g8a6fed15293

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.
Files changed (2) hide show
  1. package/cli.cjs +581 -600
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -48657,8 +48657,8 @@ var require_graceful_fs = __commonJS({
48657
48657
  fs28.createReadStream = createReadStream5;
48658
48658
  fs28.createWriteStream = createWriteStream7;
48659
48659
  var fs$readFile = fs28.readFile;
48660
- fs28.readFile = readFile106;
48661
- function readFile106(path97, options2, cb2) {
48660
+ fs28.readFile = readFile102;
48661
+ function readFile102(path97, options2, cb2) {
48662
48662
  if (typeof options2 === "function")
48663
48663
  cb2 = options2, options2 = null;
48664
48664
  return go$readFile(path97, options2, cb2);
@@ -307062,8 +307062,8 @@ var require_graceful_fs2 = __commonJS({
307062
307062
  fs28.createReadStream = createReadStream5;
307063
307063
  fs28.createWriteStream = createWriteStream7;
307064
307064
  var fs$readFile = fs28.readFile;
307065
- fs28.readFile = readFile106;
307066
- function readFile106(path97, options2, cb2) {
307065
+ fs28.readFile = readFile102;
307066
+ function readFile102(path97, options2, cb2) {
307067
307067
  if (typeof options2 === "function")
307068
307068
  cb2 = options2, options2 = null;
307069
307069
  return go$readFile(path97, options2, cb2);
@@ -363995,7 +363995,7 @@ var require_dist11 = __commonJS({
363995
363995
  conflicts: conflicts2
363996
363996
  };
363997
363997
  }
363998
- var import_promises185 = require("fs/promises");
363998
+ var import_promises181 = require("fs/promises");
363999
363999
  var import_node_os15 = require("os");
364000
364000
  var import_node_path210 = require("path");
364001
364001
  var import_minimatch8 = require_commonjs3();
@@ -364087,7 +364087,7 @@ var require_dist11 = __commonJS({
364087
364087
  /** Populate accumulator after git apply succeeds. */
364088
364088
  async populateAccumulatorForPatch(patch5, baseGen, currentTreeHash) {
364089
364089
  if (!baseGen) return;
364090
- const tempDir2 = await (0, import_promises185.mkdtemp)((0, import_node_path210.join)((0, import_node_os15.tmpdir)(), "replay-acc-"));
364090
+ const tempDir2 = await (0, import_promises181.mkdtemp)((0, import_node_path210.join)((0, import_node_os15.tmpdir)(), "replay-acc-"));
364091
364091
  const { GitClient: GitClient22 } = await Promise.resolve().then(() => (init_GitClient(), GitClient_exports));
364092
364092
  const tempGit = new GitClient22(tempDir2);
364093
364093
  await tempGit.exec(["init"]);
@@ -364107,7 +364107,7 @@ var require_dist11 = __commonJS({
364107
364107
  }
364108
364108
  }
364109
364109
  } finally {
364110
- await (0, import_promises185.rm)(tempDir2, { recursive: true }).catch(() => {
364110
+ await (0, import_promises181.rm)(tempDir2, { recursive: true }).catch(() => {
364111
364111
  });
364112
364112
  }
364113
364113
  }
@@ -364132,7 +364132,7 @@ var require_dist11 = __commonJS({
364132
364132
  resolvedFiles[filePath] = resolvedPath;
364133
364133
  }
364134
364134
  const fullPath = (0, import_node_path210.join)(this.outputDir, resolvedPath);
364135
- snapshots.set(resolvedPath, await (0, import_promises185.readFile)(fullPath, "utf-8").catch(() => null));
364135
+ snapshots.set(resolvedPath, await (0, import_promises181.readFile)(fullPath, "utf-8").catch(() => null));
364136
364136
  }
364137
364137
  try {
364138
364138
  await this.git.execWithInput(["apply", "--3way"], patch5.patch_content);
@@ -364146,7 +364146,7 @@ var require_dist11 = __commonJS({
364146
364146
  } catch {
364147
364147
  for (const [resolvedPath, content5] of snapshots) {
364148
364148
  if (content5 != null) {
364149
- await (0, import_promises185.writeFile)((0, import_node_path210.join)(this.outputDir, resolvedPath), content5);
364149
+ await (0, import_promises181.writeFile)((0, import_node_path210.join)(this.outputDir, resolvedPath), content5);
364150
364150
  }
364151
364151
  }
364152
364152
  }
@@ -364156,7 +364156,7 @@ var require_dist11 = __commonJS({
364156
364156
  async applyWithThreeWayMerge(patch5) {
364157
364157
  const fileResults = [];
364158
364158
  const resolvedFiles = {};
364159
- const tempDir2 = await (0, import_promises185.mkdtemp)((0, import_node_path210.join)((0, import_node_os15.tmpdir)(), "replay-"));
364159
+ const tempDir2 = await (0, import_promises181.mkdtemp)((0, import_node_path210.join)((0, import_node_os15.tmpdir)(), "replay-"));
364160
364160
  const { GitClient: GitClient22 } = await Promise.resolve().then(() => (init_GitClient(), GitClient_exports));
364161
364161
  const tempGit = new GitClient22(tempDir2);
364162
364162
  await tempGit.exec(["init"]);
@@ -364179,7 +364179,7 @@ var require_dist11 = __commonJS({
364179
364179
  fileResults.push(result);
364180
364180
  }
364181
364181
  } finally {
364182
- await (0, import_promises185.rm)(tempDir2, { recursive: true }).catch(() => {
364182
+ await (0, import_promises181.rm)(tempDir2, { recursive: true }).catch(() => {
364183
364183
  });
364184
364184
  }
364185
364185
  const conflictFiles = fileResults.filter((r23) => r23.status === "conflict");
@@ -364220,7 +364220,7 @@ var require_dist11 = __commonJS({
364220
364220
  }
364221
364221
  }
364222
364222
  const oursPath = (0, import_node_path210.join)(this.outputDir, resolvedPath);
364223
- const ours = await (0, import_promises185.readFile)(oursPath, "utf-8").catch(() => null);
364223
+ const ours = await (0, import_promises181.readFile)(oursPath, "utf-8").catch(() => null);
364224
364224
  let theirs = await this.applyPatchToContent(
364225
364225
  base4,
364226
364226
  patch5.patch_content,
@@ -364263,15 +364263,15 @@ var require_dist11 = __commonJS({
364263
364263
  }
364264
364264
  if (!base4 && !ours && effective_theirs) {
364265
364265
  const outDir2 = (0, import_node_path210.dirname)(oursPath);
364266
- await (0, import_promises185.mkdir)(outDir2, { recursive: true });
364267
- await (0, import_promises185.writeFile)(oursPath, effective_theirs);
364266
+ await (0, import_promises181.mkdir)(outDir2, { recursive: true });
364267
+ await (0, import_promises181.writeFile)(oursPath, effective_theirs);
364268
364268
  return { file: resolvedPath, status: "merged", reason: "new-file" };
364269
364269
  }
364270
364270
  if (!base4 && ours && effective_theirs) {
364271
364271
  const merged2 = threeWayMerge("", ours, effective_theirs);
364272
364272
  const outDir2 = (0, import_node_path210.dirname)(oursPath);
364273
- await (0, import_promises185.mkdir)(outDir2, { recursive: true });
364274
- await (0, import_promises185.writeFile)(oursPath, merged2.content);
364273
+ await (0, import_promises181.mkdir)(outDir2, { recursive: true });
364274
+ await (0, import_promises181.writeFile)(oursPath, merged2.content);
364275
364275
  if (merged2.hasConflicts) {
364276
364276
  return {
364277
364277
  file: resolvedPath,
@@ -364300,8 +364300,8 @@ var require_dist11 = __commonJS({
364300
364300
  const mergeBase = useAccumulatorAsMergeBase && accumulatorEntry ? accumulatorEntry.content : base4;
364301
364301
  const merged = threeWayMerge(mergeBase, ours, effective_theirs);
364302
364302
  const outDir = (0, import_node_path210.dirname)(oursPath);
364303
- await (0, import_promises185.mkdir)(outDir, { recursive: true });
364304
- await (0, import_promises185.writeFile)(oursPath, merged.content);
364303
+ await (0, import_promises181.mkdir)(outDir, { recursive: true });
364304
+ await (0, import_promises181.writeFile)(oursPath, merged.content);
364305
364305
  if (effective_theirs && base4) {
364306
364306
  this.fileTheirsAccumulator.set(resolvedPath, {
364307
364307
  content: effective_theirs,
@@ -364368,8 +364368,8 @@ var require_dist11 = __commonJS({
364368
364368
  try {
364369
364369
  if (sourceFilePath) {
364370
364370
  const tempSourcePath = (0, import_node_path210.join)(tempDir2, sourceFilePath);
364371
- await (0, import_promises185.mkdir)((0, import_node_path210.dirname)(tempSourcePath), { recursive: true });
364372
- await (0, import_promises185.writeFile)(tempSourcePath, base4);
364371
+ await (0, import_promises181.mkdir)((0, import_node_path210.dirname)(tempSourcePath), { recursive: true });
364372
+ await (0, import_promises181.writeFile)(tempSourcePath, base4);
364373
364373
  await tempGit.exec(["add", sourceFilePath]);
364374
364374
  await tempGit.exec([
364375
364375
  "commit",
@@ -364379,15 +364379,15 @@ var require_dist11 = __commonJS({
364379
364379
  ]);
364380
364380
  await tempGit.execWithInput(["apply", "--allow-empty"], fileDiff);
364381
364381
  const tempTargetPath = (0, import_node_path210.join)(tempDir2, filePath);
364382
- return await (0, import_promises185.readFile)(tempTargetPath, "utf-8");
364382
+ return await (0, import_promises181.readFile)(tempTargetPath, "utf-8");
364383
364383
  }
364384
364384
  const tempFilePath = (0, import_node_path210.join)(tempDir2, filePath);
364385
- await (0, import_promises185.mkdir)((0, import_node_path210.dirname)(tempFilePath), { recursive: true });
364386
- await (0, import_promises185.writeFile)(tempFilePath, base4);
364385
+ await (0, import_promises181.mkdir)((0, import_node_path210.dirname)(tempFilePath), { recursive: true });
364386
+ await (0, import_promises181.writeFile)(tempFilePath, base4);
364387
364387
  await tempGit.exec(["add", filePath]);
364388
364388
  await tempGit.exec(["commit", "-m", `base for ${filePath}`, "--allow-empty"]);
364389
364389
  await tempGit.execWithInput(["apply", "--allow-empty"], fileDiff);
364390
- return await (0, import_promises185.readFile)(tempFilePath, "utf-8");
364390
+ return await (0, import_promises181.readFile)(tempFilePath, "utf-8");
364391
364391
  } catch {
364392
364392
  return null;
364393
364393
  }
@@ -367404,7 +367404,7 @@ var require_jsonfile = __commonJS({
367404
367404
  }
367405
367405
  return obj;
367406
367406
  }
367407
- var readFile106 = universalify.fromPromise(_readFile);
367407
+ var readFile102 = universalify.fromPromise(_readFile);
367408
367408
  function readFileSync19(file4, options2 = {}) {
367409
367409
  if (typeof options2 === "string") {
367410
367410
  options2 = { encoding: options2 };
@@ -367436,7 +367436,7 @@ var require_jsonfile = __commonJS({
367436
367436
  return fs27.writeFileSync(file4, str3, options2);
367437
367437
  }
367438
367438
  module4.exports = {
367439
- readFile: readFile106,
367439
+ readFile: readFile102,
367440
367440
  readFileSync: readFileSync19,
367441
367441
  writeFile: writeFile89,
367442
367442
  writeFileSync: writeFileSync7
@@ -430422,7 +430422,7 @@ async function unpackArchive(archivePath, folderPath) {
430422
430422
  } else if (archivePath.endsWith(".tar.bz2")) {
430423
430423
  await extractTar(archivePath, folderPath, "bzip2");
430424
430424
  } else if (archivePath.endsWith(".dmg")) {
430425
- await (0, import_promises122.mkdir)(folderPath);
430425
+ await (0, import_promises118.mkdir)(folderPath);
430426
430426
  await installDMG(archivePath, folderPath);
430427
430427
  } else if (archivePath.endsWith(".exe")) {
430428
430428
  const result = (0, import_node_child_process4.spawnSync)(archivePath, [`/ExtractDir=${folderPath}`], {
@@ -430511,7 +430511,7 @@ async function installDMG(dmgPath, folderPath) {
430511
430511
  }
430512
430512
  const mountPath = volumes[0];
430513
430513
  try {
430514
- const fileNames = await (0, import_promises122.readdir)(mountPath);
430514
+ const fileNames = await (0, import_promises118.readdir)(mountPath);
430515
430515
  const appName = fileNames.find((item) => {
430516
430516
  return typeof item === "string" && item.endsWith(".app");
430517
430517
  });
@@ -430524,13 +430524,13 @@ async function installDMG(dmgPath, folderPath) {
430524
430524
  (0, import_node_child_process4.spawnSync)("hdiutil", ["detach", mountPath, "-quiet"]);
430525
430525
  }
430526
430526
  }
430527
- var import_node_child_process4, import_node_fs24, import_promises122, path79, import_node_stream6, import_debug8, debugFileUtil, internalConstantsForTesting;
430527
+ var import_node_child_process4, import_node_fs24, import_promises118, path79, import_node_stream6, import_debug8, debugFileUtil, internalConstantsForTesting;
430528
430528
  var init_fileUtil = __esm({
430529
430529
  "../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/fileUtil.js"() {
430530
430530
  "use strict";
430531
430531
  import_node_child_process4 = require("child_process");
430532
430532
  import_node_fs24 = require("fs");
430533
- import_promises122 = require("fs/promises");
430533
+ import_promises118 = require("fs/promises");
430534
430534
  path79 = __toESM(require("path"), 1);
430535
430535
  import_node_stream6 = require("stream");
430536
430536
  import_debug8 = __toESM(require_src(), 1);
@@ -430593,7 +430593,7 @@ async function installWithProviders(options2) {
430593
430593
  }
430594
430594
  debugInstall(`Successfully got URL from ${provider.getName()}: ${url3}`);
430595
430595
  if (!(0, import_node_fs25.existsSync)(browserRoot)) {
430596
- await (0, import_promises123.mkdir)(browserRoot, { recursive: true });
430596
+ await (0, import_promises119.mkdir)(browserRoot, { recursive: true });
430597
430597
  }
430598
430598
  return await installUrl(url3, options2, provider);
430599
430599
  } catch (err) {
@@ -430666,7 +430666,7 @@ async function installUrl(url3, options2, provider) {
430666
430666
  const browserRoot = cache3.browserRoot(options2.browser);
430667
430667
  const archivePath = import_node_path33.default.join(browserRoot, `${options2.buildId}-${fileName}`);
430668
430668
  if (!(0, import_node_fs25.existsSync)(browserRoot)) {
430669
- await (0, import_promises123.mkdir)(browserRoot, { recursive: true });
430669
+ await (0, import_promises119.mkdir)(browserRoot, { recursive: true });
430670
430670
  }
430671
430671
  if (!options2.unpack) {
430672
430672
  if ((0, import_node_fs25.existsSync)(archivePath)) {
@@ -430730,7 +430730,7 @@ async function installUrl(url3, options2, provider) {
430730
430730
  return installedBrowser;
430731
430731
  } finally {
430732
430732
  if ((0, import_node_fs25.existsSync)(archivePath)) {
430733
- await (0, import_promises123.unlink)(archivePath);
430733
+ await (0, import_promises119.unlink)(archivePath);
430734
430734
  }
430735
430735
  }
430736
430736
  }
@@ -430810,14 +430810,14 @@ function toMegabytes(bytes) {
430810
430810
  const mb2 = bytes / 1e3 / 1e3;
430811
430811
  return `${Math.round(mb2 * 10) / 10} MB`;
430812
430812
  }
430813
- var import_node_assert3, import_node_child_process5, import_node_fs25, import_promises123, import_node_os9, import_node_path33, import_progress, debugInstall, times;
430813
+ var import_node_assert3, import_node_child_process5, import_node_fs25, import_promises119, import_node_os9, import_node_path33, import_progress, debugInstall, times;
430814
430814
  var init_install = __esm({
430815
430815
  "../../../node_modules/.pnpm/@puppeteer+browsers@2.13.0/node_modules/@puppeteer/browsers/lib/esm/install.js"() {
430816
430816
  "use strict";
430817
430817
  import_node_assert3 = __toESM(require("assert"), 1);
430818
430818
  import_node_child_process5 = require("child_process");
430819
430819
  import_node_fs25 = require("fs");
430820
- import_promises123 = require("fs/promises");
430820
+ import_promises119 = require("fs/promises");
430821
430821
  import_node_os9 = __toESM(require("os"), 1);
430822
430822
  import_node_path33 = __toESM(require("path"), 1);
430823
430823
  import_progress = __toESM(require_progress(), 1);
@@ -580500,7 +580500,7 @@ async function applyOverlays({ absoluteFilePathToOverlay, absoluteFilePathToOpen
580500
580500
  const outputFileName = `${import_path31.default.parse(originalFileName).name}.overlaid.json`;
580501
580501
  const outputPath = import_path31.default.join(dir, outputFileName);
580502
580502
  await (0, import_promises26.writeFile)(outputPath, JSON.stringify(result, null, 2), "utf8");
580503
- context3.logger.info(`Wrote overlaid OpenAPI spec to: ${outputPath}`);
580503
+ context3.logger.debug(`Wrote overlaid OpenAPI spec to: ${outputPath}`);
580504
580504
  return result;
580505
580505
  }
580506
580506
  async function parseOverlayFile(absoluteFilePathToOverlay, context3) {
@@ -593565,12 +593565,14 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
593565
593565
  }
593566
593566
  };
593567
593567
 
593568
+ // ../workspace/oss-validator/lib/validateOSSWorkspace.js
593569
+ var import_promises38 = require("fs/promises");
593570
+
593568
593571
  // ../workspace/oss-validator/lib/rules/no-component-schema-collisions/no-component-schema-collisions.js
593569
593572
  init_lib6();
593570
- var import_promises38 = require("fs/promises");
593571
593573
  var NoComponentSchemaCollisionsRule = {
593572
593574
  name: "no-component-schema-collisions",
593573
- run: async ({ workspace, specs, context: context3 }) => {
593575
+ run: async ({ workspace, specs, loadedDocuments }) => {
593574
593576
  const violations = [];
593575
593577
  const openapiSpecs = specs.filter((spec) => spec.type === "openapi");
593576
593578
  if (openapiSpecs.length < 2) {
@@ -593582,19 +593584,11 @@ var NoComponentSchemaCollisionsRule = {
593582
593584
  }
593583
593585
  const schemaIdRegistry = /* @__PURE__ */ new Map();
593584
593586
  for (const spec of openapiSpecs) {
593585
- const contents = (await (0, import_promises38.readFile)(spec.absoluteFilepath)).toString();
593586
- const isAsyncAPI = contents.includes("asyncapi:");
593587
- const isOpenAPI = contents.includes("openapi") || contents.includes("swagger");
593588
- if (!isOpenAPI && !isAsyncAPI) {
593587
+ const document4 = loadedDocuments.get(spec.absoluteFilepath);
593588
+ if (document4 == null) {
593589
593589
  continue;
593590
593590
  }
593591
593591
  const relativeFilepath = relative3(workspace.absoluteFilePath, spec.source.file);
593592
- const document4 = await loadOpenAPI({
593593
- absolutePathToOpenAPI: spec.absoluteFilepath,
593594
- context: context3,
593595
- absolutePathToOpenAPIOverrides: spec.absoluteFilepathToOverrides,
593596
- absolutePathToOpenAPIOverlays: spec.absoluteFilepathToOverlays
593597
- });
593598
593592
  const apiToValidate = isOpenAPIV2(document4) ? await convertOpenAPIV2ToV3(document4) : document4;
593599
593593
  const schemas = apiToValidate.components?.schemas ?? {};
593600
593594
  for (const schemaId of Object.keys(schemas)) {
@@ -593618,25 +593612,18 @@ var NoComponentSchemaCollisionsRule = {
593618
593612
 
593619
593613
  // ../workspace/oss-validator/lib/rules/no-duplicate-auth-header-parameters/no-duplicate-auth-header-parameters.js
593620
593614
  init_lib6();
593621
- var import_promises39 = require("fs/promises");
593622
593615
  var NoDuplicateAuthHeaderParametersRule = {
593623
593616
  name: "no-duplicate-auth-header-parameters",
593624
- run: async ({ workspace, specs, context: context3 }) => {
593617
+ run: async ({ workspace, specs, loadedDocuments }) => {
593625
593618
  const violations = [];
593626
593619
  for (const spec of specs) {
593627
593620
  if (spec.type !== "openapi") {
593628
593621
  continue;
593629
593622
  }
593630
- const contents = (await (0, import_promises39.readFile)(spec.absoluteFilepath)).toString();
593631
- if (!contents.includes("openapi") && !contents.includes("swagger")) {
593623
+ const openAPI = loadedDocuments.get(spec.absoluteFilepath);
593624
+ if (openAPI == null) {
593632
593625
  continue;
593633
593626
  }
593634
- const openAPI = await loadOpenAPI({
593635
- absolutePathToOpenAPI: spec.absoluteFilepath,
593636
- context: context3,
593637
- absolutePathToOpenAPIOverrides: spec.absoluteFilepathToOverrides,
593638
- absolutePathToOpenAPIOverlays: spec.absoluteFilepathToOverlays
593639
- });
593640
593627
  const apiToValidate = isOpenAPIV2(openAPI) ? await convertOpenAPIV2ToV3(openAPI) : openAPI;
593641
593628
  const authHeaderNames = getAuthHeaderNames(apiToValidate);
593642
593629
  if (authHeaderNames.size === 0) {
@@ -593745,21 +593732,14 @@ function isDuplicateAuthHeader(param, authHeaderNames) {
593745
593732
 
593746
593733
  // ../workspace/oss-validator/lib/rules/no-duplicate-overrides/no-duplicate-overrides.js
593747
593734
  init_lib6();
593748
- var import_promises40 = require("fs/promises");
593749
593735
  var NoDuplicateOverridesRule = {
593750
593736
  name: "no-duplicate-overrides",
593751
- run: async ({ workspace, specs, context: context3 }) => {
593737
+ run: async ({ workspace, specs, loadedDocuments }) => {
593752
593738
  const violations = [];
593753
593739
  const seenMethodsByAudience = /* @__PURE__ */ new Map();
593754
593740
  for (const spec of specs) {
593755
- const contents = (await (0, import_promises40.readFile)(spec.absoluteFilepath)).toString();
593756
- if (contents.includes("openapi") || contents.includes("swagger")) {
593757
- const openAPI = await loadOpenAPI({
593758
- absolutePathToOpenAPI: spec.absoluteFilepath,
593759
- context: context3,
593760
- absolutePathToOpenAPIOverrides: spec.absoluteFilepathToOverrides,
593761
- absolutePathToOpenAPIOverlays: spec.absoluteFilepathToOverlays
593762
- });
593741
+ const openAPI = loadedDocuments.get(spec.absoluteFilepath);
593742
+ if (openAPI != null) {
593763
593743
  const apiToValidate = isOpenAPIV2(openAPI) ? await convertOpenAPIV2ToV3(openAPI) : openAPI;
593764
593744
  for (const [path97, pathItem] of Object.entries(apiToValidate.paths ?? {})) {
593765
593745
  for (const [method8, operation] of Object.entries(pathItem ?? {})) {
@@ -593808,28 +593788,21 @@ function audiencesIntersect(a10, b19) {
593808
593788
 
593809
593789
  // ../workspace/oss-validator/lib/rules/no-invalid-tag-names-or-frontmatter/no-invalid-tag-names-or-frontmatter.js
593810
593790
  init_lib6();
593811
- var import_promises41 = require("fs/promises");
593812
593791
  var NON_ASCII_REGEX3 = new RegExp("[^\\x00-\\x7F]");
593813
593792
  var FRONTMATTER_REGEX = /(?:^|\n)\s*---\s*(?:\n|$)/;
593814
593793
  var HTTP_METHODS = ["get", "post", "put", "delete", "patch", "options", "head", "trace"];
593815
593794
  var NoInvalidTagNamesOrFrontmatterRule = {
593816
593795
  name: "no-invalid-tag-names-or-frontmatter",
593817
- run: async ({ workspace, specs, context: context3 }) => {
593796
+ run: async ({ workspace, specs, loadedDocuments }) => {
593818
593797
  const violations = [];
593819
593798
  for (const spec of specs) {
593820
593799
  if (spec.type !== "openapi") {
593821
593800
  continue;
593822
593801
  }
593823
- const contents = (await (0, import_promises41.readFile)(spec.absoluteFilepath)).toString();
593824
- if (!contents.includes("openapi") && !contents.includes("swagger")) {
593802
+ const openAPI = loadedDocuments.get(spec.absoluteFilepath);
593803
+ if (openAPI == null) {
593825
593804
  continue;
593826
593805
  }
593827
- const openAPI = await loadOpenAPI({
593828
- absolutePathToOpenAPI: spec.absoluteFilepath,
593829
- context: context3,
593830
- absolutePathToOpenAPIOverrides: spec.absoluteFilepathToOverrides,
593831
- absolutePathToOpenAPIOverlays: spec.absoluteFilepathToOverlays
593832
- });
593833
593806
  const apiToValidate = isOpenAPIV2(openAPI) ? await convertOpenAPIV2ToV3(openAPI) : openAPI;
593834
593807
  const relativeFilepath = relative3(workspace.absoluteFilePath, spec.source.file);
593835
593808
  const apiDoc = apiToValidate;
@@ -593896,10 +593869,9 @@ var NoInvalidTagNamesOrFrontmatterRule = {
593896
593869
 
593897
593870
  // ../workspace/oss-validator/lib/rules/no-schema-title-collisions/no-schema-title-collisions.js
593898
593871
  init_lib6();
593899
- var import_promises42 = require("fs/promises");
593900
593872
  var NoSchemaTitleCollisionsRule = {
593901
593873
  name: "no-schema-title-collisions",
593902
- run: async ({ workspace, specs, context: context3 }) => {
593874
+ run: async ({ workspace, specs, loadedDocuments }) => {
593903
593875
  const violations = [];
593904
593876
  const titleRegistry = /* @__PURE__ */ new Map();
593905
593877
  for (const spec of specs) {
@@ -593910,19 +593882,11 @@ var NoSchemaTitleCollisionsRule = {
593910
593882
  if (settings?.useTitlesAsName !== true || settings?.resolveSchemaCollisions === true) {
593911
593883
  continue;
593912
593884
  }
593913
- const contents = (await (0, import_promises42.readFile)(spec.absoluteFilepath)).toString();
593914
- const isAsyncAPI = contents.includes("asyncapi:");
593915
- const isOpenAPI = contents.includes("openapi") || contents.includes("swagger");
593916
- if (!isOpenAPI && !isAsyncAPI) {
593885
+ const document4 = loadedDocuments.get(spec.absoluteFilepath);
593886
+ if (document4 == null) {
593917
593887
  continue;
593918
593888
  }
593919
593889
  const relativeFilepath = relative3(workspace.absoluteFilePath, spec.source.file);
593920
- const document4 = await loadOpenAPI({
593921
- absolutePathToOpenAPI: spec.absoluteFilepath,
593922
- context: context3,
593923
- absolutePathToOpenAPIOverrides: spec.absoluteFilepathToOverrides,
593924
- absolutePathToOpenAPIOverlays: spec.absoluteFilepathToOverlays
593925
- });
593926
593890
  const apiToValidate = isOpenAPIV2(document4) ? await convertOpenAPIV2ToV3(document4) : document4;
593927
593891
  const schemas = apiToValidate.components?.schemas ?? {};
593928
593892
  for (const [schemaId, schema2] of Object.entries(schemas)) {
@@ -593966,10 +593930,28 @@ function getAllRules2() {
593966
593930
  async function validateOSSWorkspace(workspace, context3) {
593967
593931
  return await runRulesOnOSSWorkspace({ workspace, context: context3, rules: getAllRules2() });
593968
593932
  }
593933
+ async function preloadOpenAPIDocuments({ specs, context: context3 }) {
593934
+ const loadedDocuments = /* @__PURE__ */ new Map();
593935
+ for (const spec of specs) {
593936
+ const contents = (await (0, import_promises38.readFile)(spec.absoluteFilepath)).toString();
593937
+ if (!contents.includes("openapi") && !contents.includes("swagger")) {
593938
+ continue;
593939
+ }
593940
+ const document4 = await loadOpenAPI({
593941
+ absolutePathToOpenAPI: spec.absoluteFilepath,
593942
+ context: context3,
593943
+ absolutePathToOpenAPIOverrides: spec.absoluteFilepathToOverrides,
593944
+ absolutePathToOpenAPIOverlays: spec.absoluteFilepathToOverlays
593945
+ });
593946
+ loadedDocuments.set(spec.absoluteFilepath, document4);
593947
+ }
593948
+ return loadedDocuments;
593949
+ }
593969
593950
  async function runRulesOnOSSWorkspace({ workspace, context: context3, rules }) {
593970
593951
  const openApiSpecs = await workspace.getOpenAPISpecsCached({ context: context3 });
593952
+ const loadedDocuments = await preloadOpenAPIDocuments({ specs: openApiSpecs, context: context3 });
593971
593953
  const ruleResults = await Promise.all(rules.map(async (rule) => {
593972
- const violations = await rule.run({ workspace, specs: openApiSpecs, context: context3 });
593954
+ const violations = await rule.run({ workspace, specs: openApiSpecs, context: context3, loadedDocuments });
593973
593955
  return violations.map((violation) => ({ ...violation, name: violation.name ?? rule.name }));
593974
593956
  }));
593975
593957
  return ruleResults.flat();
@@ -594959,7 +594941,7 @@ function getPathToTokenFile() {
594959
594941
 
594960
594942
  // ../auth/lib/persistence/getToken.js
594961
594943
  init_lib6();
594962
- var import_promises43 = require("fs/promises");
594944
+ var import_promises39 = require("fs/promises");
594963
594945
  var FERN_TOKEN_ENV_VAR = "FERN_TOKEN";
594964
594946
  async function getToken2() {
594965
594947
  return await getAccessToken() ?? await getUserToken();
@@ -594980,7 +594962,7 @@ async function getUserToken() {
594980
594962
  if (!doesTokenFileExist) {
594981
594963
  return void 0;
594982
594964
  }
594983
- const tokenFileContents = await (0, import_promises43.readFile)(pathToTokenFile);
594965
+ const tokenFileContents = await (0, import_promises39.readFile)(pathToTokenFile);
594984
594966
  const tokenString = tokenFileContents.toString().trim();
594985
594967
  if (tokenString.length === 0) {
594986
594968
  return void 0;
@@ -594992,11 +594974,11 @@ async function getUserToken() {
594992
594974
  }
594993
594975
 
594994
594976
  // ../auth/lib/persistence/removeToken.js
594995
- var import_promises44 = require("fs/promises");
594977
+ var import_promises40 = require("fs/promises");
594996
594978
  async function removeToken() {
594997
594979
  const pathToTokenFile = getPathToTokenFile();
594998
594980
  try {
594999
- await (0, import_promises44.unlink)(pathToTokenFile);
594981
+ await (0, import_promises40.unlink)(pathToTokenFile);
595000
594982
  } catch (error50) {
595001
594983
  if (error50.code !== "ENOENT") {
595002
594984
  throw error50;
@@ -595005,12 +594987,12 @@ async function removeToken() {
595005
594987
  }
595006
594988
 
595007
594989
  // ../auth/lib/persistence/storeToken.js
595008
- var import_promises45 = require("fs/promises");
594990
+ var import_promises41 = require("fs/promises");
595009
594991
  var import_path39 = __toESM(require("path"), 1);
595010
594992
  async function storeToken(token) {
595011
594993
  const pathToTokenFile = getPathToTokenFile();
595012
- await (0, import_promises45.mkdir)(import_path39.default.dirname(pathToTokenFile), { recursive: true });
595013
- await (0, import_promises45.writeFile)(pathToTokenFile, token);
594994
+ await (0, import_promises41.mkdir)(import_path39.default.dirname(pathToTokenFile), { recursive: true });
594995
+ await (0, import_promises41.writeFile)(pathToTokenFile, token);
595014
594996
  }
595015
594997
 
595016
594998
  // ../auth/lib/users/getCurrentUser.js
@@ -602302,7 +602284,7 @@ var AccessTokenPosthogManager = class {
602302
602284
  properties: {
602303
602285
  ...event,
602304
602286
  ...event.properties,
602305
- version: "4.50.3",
602287
+ version: "4.50.4-1-g8a6fed15293",
602306
602288
  usingAccessToken: true
602307
602289
  }
602308
602290
  });
@@ -602325,7 +602307,7 @@ var NoopPosthogManager = class {
602325
602307
 
602326
602308
  // ../posthog-manager/lib/UserPosthogManager.js
602327
602309
  init_lib6();
602328
- var import_promises46 = require("fs/promises");
602310
+ var import_promises42 = require("fs/promises");
602329
602311
  var import_os5 = require("os");
602330
602312
  var import_path41 = require("path");
602331
602313
  var DISTINCT_ID_FILENAME = "id";
@@ -602353,7 +602335,7 @@ var UserPosthogManager = class {
602353
602335
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602354
602336
  event: "CLI",
602355
602337
  properties: {
602356
- version: "4.50.3",
602338
+ version: "4.50.4-1-g8a6fed15293",
602357
602339
  ...event,
602358
602340
  ...event.properties,
602359
602341
  usingAccessToken: false,
@@ -602392,10 +602374,10 @@ var UserPosthogManager = class {
602392
602374
  if (this.persistedDistinctId == null) {
602393
602375
  const pathToFile = join2(AbsoluteFilePath2.of((0, import_os5.homedir)()), RelativeFilePath2.of(LOCAL_STORAGE_FOLDER3), RelativeFilePath2.of(DISTINCT_ID_FILENAME));
602394
602376
  if (!await doesPathExist(pathToFile)) {
602395
- await (0, import_promises46.mkdir)((0, import_path41.dirname)(pathToFile), { recursive: true });
602396
- await (0, import_promises46.writeFile)(pathToFile, v4_default());
602377
+ await (0, import_promises42.mkdir)((0, import_path41.dirname)(pathToFile), { recursive: true });
602378
+ await (0, import_promises42.writeFile)(pathToFile, v4_default());
602397
602379
  }
602398
- this.persistedDistinctId = (await (0, import_promises46.readFile)(pathToFile)).toString();
602380
+ this.persistedDistinctId = (await (0, import_promises42.readFile)(pathToFile)).toString();
602399
602381
  }
602400
602382
  return this.persistedDistinctId;
602401
602383
  }
@@ -603927,7 +603909,7 @@ var FernRcAccountManager = class {
603927
603909
  // ../cli-v2/lib/config/fern-rc/FernRcSchemaLoader.js
603928
603910
  init_lib6();
603929
603911
  var import_fs18 = require("fs");
603930
- var import_promises47 = require("fs/promises");
603912
+ var import_promises43 = require("fs/promises");
603931
603913
  var import_os6 = require("os");
603932
603914
  var FILENAME = ".fernrc";
603933
603915
  var FernRcSchemaLoader = class {
@@ -603945,7 +603927,7 @@ var FernRcSchemaLoader = class {
603945
603927
  absoluteFilePath: this.absoluteFilePath
603946
603928
  };
603947
603929
  }
603948
- const contents = await (0, import_promises47.readFile)(this.absoluteFilePath, "utf-8");
603930
+ const contents = await (0, import_promises43.readFile)(this.absoluteFilePath, "utf-8");
603949
603931
  if (contents.trim().length === 0) {
603950
603932
  return {
603951
603933
  data: createEmptyFernRcSchema(),
@@ -604037,7 +604019,7 @@ var FernRcSchemaLoader = class {
604037
604019
  lineWidth: 120,
604038
604020
  noRefs: true
604039
604021
  });
604040
- await (0, import_promises47.writeFile)(this.absoluteFilePath, yamlContent, "utf-8");
604022
+ await (0, import_promises43.writeFile)(this.absoluteFilePath, yamlContent, "utf-8");
604041
604023
  }
604042
604024
  };
604043
604025
 
@@ -604071,7 +604053,7 @@ var FernRcTelemetryManager = class {
604071
604053
 
604072
604054
  // ../cli-v2/lib/config/fern-rc/LegacyTokenMigrator.js
604073
604055
  init_lib6();
604074
- var import_promises48 = require("fs/promises");
604056
+ var import_promises44 = require("fs/promises");
604075
604057
  var DEFAULT_USER = "default";
604076
604058
  var LegacyTokenMigrator = class {
604077
604059
  loader;
@@ -604090,7 +604072,7 @@ var LegacyTokenMigrator = class {
604090
604072
  if (config5.auth.accounts.length > 0) {
604091
604073
  return { migrated: false };
604092
604074
  }
604093
- const tokenContent = (await (0, import_promises48.readFile)(legacyPath, "utf-8")).trim();
604075
+ const tokenContent = (await (0, import_promises44.readFile)(legacyPath, "utf-8")).trim();
604094
604076
  if (tokenContent.length === 0) {
604095
604077
  return { migrated: false };
604096
604078
  }
@@ -604334,7 +604316,7 @@ var import_os7 = __toESM(require("os"), 1);
604334
604316
  // ../cli-v2/lib/cache/ir/IrCache.js
604335
604317
  init_lib6();
604336
604318
  var import_crypto7 = __toESM(require("crypto"), 1);
604337
- var import_promises49 = __toESM(require("fs/promises"), 1);
604319
+ var import_promises45 = __toESM(require("fs/promises"), 1);
604338
604320
  var IrCache = class {
604339
604321
  /** Absolute file path to the IR cache directory (e.g. ~/.cache/fern/v1/ir) */
604340
604322
  absoluteFilePath;
@@ -604364,7 +604346,7 @@ var IrCache = class {
604364
604346
  async lookup({ hash: hash5, irVersion }) {
604365
604347
  const entryPath = this.getEntryPath({ irVersion, hash: hash5 });
604366
604348
  try {
604367
- const stats = await import_promises49.default.stat(entryPath);
604349
+ const stats = await import_promises45.default.stat(entryPath);
604368
604350
  if (!stats.isFile()) {
604369
604351
  return void 0;
604370
604352
  }
@@ -604385,7 +604367,7 @@ var IrCache = class {
604385
604367
  * Read the content of a cached IR entry.
604386
604368
  */
604387
604369
  async read(entry) {
604388
- return await import_promises49.default.readFile(entry.absoluteFilePath, "utf-8");
604370
+ return await import_promises45.default.readFile(entry.absoluteFilePath, "utf-8");
604389
604371
  }
604390
604372
  /**
604391
604373
  * Store IR content in the cache with an atomic write.
@@ -604397,19 +604379,19 @@ var IrCache = class {
604397
604379
  const entryPath = this.getEntryPath({ irVersion, hash: hash5 });
604398
604380
  const entryDir = dirname4(entryPath);
604399
604381
  const tempFile = join2(this.tempPath, RelativeFilePath2.of(`${import_crypto7.default.randomUUID()}.json`));
604400
- await import_promises49.default.mkdir(entryDir, { recursive: true });
604401
- await import_promises49.default.mkdir(this.tempPath, { recursive: true });
604382
+ await import_promises45.default.mkdir(entryDir, { recursive: true });
604383
+ await import_promises45.default.mkdir(this.tempPath, { recursive: true });
604402
604384
  try {
604403
604385
  await streamObjectToFile(tempFile, content5, { pretty: true });
604404
- await import_promises49.default.rename(tempFile, entryPath);
604386
+ await import_promises45.default.rename(tempFile, entryPath);
604405
604387
  } catch (error50) {
604406
604388
  try {
604407
- await import_promises49.default.unlink(tempFile);
604389
+ await import_promises45.default.unlink(tempFile);
604408
604390
  } catch {
604409
604391
  }
604410
604392
  throw error50;
604411
604393
  }
604412
- const stats = await import_promises49.default.stat(entryPath);
604394
+ const stats = await import_promises45.default.stat(entryPath);
604413
604395
  return {
604414
604396
  hash: hash5,
604415
604397
  irVersion,
@@ -604462,7 +604444,7 @@ var IrCache = class {
604462
604444
  */
604463
604445
  async listVersionDirectories() {
604464
604446
  try {
604465
- const entries21 = await import_promises49.default.readdir(this.absoluteFilePath, { withFileTypes: true });
604447
+ const entries21 = await import_promises45.default.readdir(this.absoluteFilePath, { withFileTypes: true });
604466
604448
  return entries21.filter((e6) => e6.isDirectory()).map((e6) => e6.name);
604467
604449
  } catch {
604468
604450
  return [];
@@ -604476,7 +604458,7 @@ var IrCache = class {
604476
604458
  let totalSize = 0;
604477
604459
  const walk4 = async (dir) => {
604478
604460
  try {
604479
- const entries21 = await import_promises49.default.readdir(dir, { withFileTypes: true });
604461
+ const entries21 = await import_promises45.default.readdir(dir, { withFileTypes: true });
604480
604462
  for (const entry of entries21) {
604481
604463
  const fullPath = `${dir}/${entry.name}`;
604482
604464
  if (entry.isDirectory()) {
@@ -604486,7 +604468,7 @@ var IrCache = class {
604486
604468
  if (entry.isFile() && entry.name.endsWith(".json")) {
604487
604469
  entryCount++;
604488
604470
  try {
604489
- const stats = await import_promises49.default.stat(fullPath);
604471
+ const stats = await import_promises45.default.stat(fullPath);
604490
604472
  totalSize += stats.size;
604491
604473
  } catch {
604492
604474
  }
@@ -604509,14 +604491,14 @@ var IrCache = class {
604509
604491
  let freedSize = 0;
604510
604492
  const walk4 = async (dir) => {
604511
604493
  try {
604512
- const entries21 = await import_promises49.default.readdir(dir, { withFileTypes: true });
604494
+ const entries21 = await import_promises45.default.readdir(dir, { withFileTypes: true });
604513
604495
  for (const entry of entries21) {
604514
604496
  const fullPath = `${dir}/${entry.name}`;
604515
604497
  if (entry.isDirectory()) {
604516
604498
  await walk4(fullPath);
604517
604499
  if (!dryRun) {
604518
604500
  try {
604519
- await import_promises49.default.rmdir(fullPath);
604501
+ await import_promises45.default.rmdir(fullPath);
604520
604502
  } catch {
604521
604503
  }
604522
604504
  }
@@ -604524,11 +604506,11 @@ var IrCache = class {
604524
604506
  }
604525
604507
  if (entry.isFile() && entry.name.endsWith(".json")) {
604526
604508
  try {
604527
- const stats = await import_promises49.default.stat(fullPath);
604509
+ const stats = await import_promises45.default.stat(fullPath);
604528
604510
  deletedCount++;
604529
604511
  freedSize += stats.size;
604530
604512
  if (!dryRun) {
604531
- await import_promises49.default.unlink(fullPath);
604513
+ await import_promises45.default.unlink(fullPath);
604532
604514
  }
604533
604515
  } catch {
604534
604516
  }
@@ -604540,7 +604522,7 @@ var IrCache = class {
604540
604522
  await walk4(dirPath);
604541
604523
  if (!dryRun) {
604542
604524
  try {
604543
- await import_promises49.default.rmdir(dirPath);
604525
+ await import_promises45.default.rmdir(dirPath);
604544
604526
  } catch {
604545
604527
  }
604546
604528
  }
@@ -604549,7 +604531,7 @@ var IrCache = class {
604549
604531
  };
604550
604532
 
604551
604533
  // ../cli-v2/lib/cache/logs/LogsCache.js
604552
- var import_promises50 = __toESM(require("fs/promises"), 1);
604534
+ var import_promises46 = __toESM(require("fs/promises"), 1);
604553
604535
  var LogsCache = class {
604554
604536
  /** Absolute file path to the log cache directory (e.g. ~/.cache/fern/v1/logs) */
604555
604537
  absoluteFilePath;
@@ -604563,12 +604545,12 @@ var LogsCache = class {
604563
604545
  let fileCount = 0;
604564
604546
  let totalSize = 0;
604565
604547
  try {
604566
- const entries21 = await import_promises50.default.readdir(this.absoluteFilePath, { withFileTypes: true });
604548
+ const entries21 = await import_promises46.default.readdir(this.absoluteFilePath, { withFileTypes: true });
604567
604549
  for (const entry of entries21) {
604568
604550
  if (entry.isFile() && entry.name.endsWith(".log")) {
604569
604551
  fileCount++;
604570
604552
  try {
604571
- const stats = await import_promises50.default.stat(`${this.absoluteFilePath}/${entry.name}`);
604553
+ const stats = await import_promises46.default.stat(`${this.absoluteFilePath}/${entry.name}`);
604572
604554
  totalSize += stats.size;
604573
604555
  } catch {
604574
604556
  }
@@ -604585,16 +604567,16 @@ var LogsCache = class {
604585
604567
  let deletedCount = 0;
604586
604568
  let freedSize = 0;
604587
604569
  try {
604588
- const entries21 = await import_promises50.default.readdir(this.absoluteFilePath, { withFileTypes: true });
604570
+ const entries21 = await import_promises46.default.readdir(this.absoluteFilePath, { withFileTypes: true });
604589
604571
  for (const entry of entries21) {
604590
604572
  if (entry.isFile() && entry.name.endsWith(".log")) {
604591
604573
  const fullPath = `${this.absoluteFilePath}/${entry.name}`;
604592
604574
  try {
604593
- const stats = await import_promises50.default.stat(fullPath);
604575
+ const stats = await import_promises46.default.stat(fullPath);
604594
604576
  deletedCount++;
604595
604577
  freedSize += stats.size;
604596
604578
  if (!dryRun) {
604597
- await import_promises50.default.unlink(fullPath);
604579
+ await import_promises46.default.unlink(fullPath);
604598
604580
  }
604599
604581
  } catch {
604600
604582
  }
@@ -604938,7 +604920,7 @@ var SourceLocation = class _SourceLocation {
604938
604920
  };
604939
604921
 
604940
604922
  // ../yaml/loader/lib/ReferenceResolver.js
604941
- var import_promises51 = require("fs/promises");
604923
+ var import_promises47 = require("fs/promises");
604942
604924
  var import_yaml2 = __toESM(require_dist8(), 1);
604943
604925
 
604944
604926
  // ../yaml/loader/lib/ValidationIssue.js
@@ -605243,7 +605225,7 @@ var ReferenceResolver = class {
605243
605225
  }));
605244
605226
  return void 0;
605245
605227
  }
605246
- const content5 = await (0, import_promises51.readFile)(referencedFilePath, "utf-8");
605228
+ const content5 = await (0, import_promises47.readFile)(referencedFilePath, "utf-8");
605247
605229
  const parsedDocument = (0, import_yaml2.parseDocument)(content5);
605248
605230
  if (parsedDocument.errors.length > 0) {
605249
605231
  const errorMessages = parsedDocument.errors.map((e6) => e6.message).join("; ");
@@ -605394,7 +605376,7 @@ function deepStrictImpl(schema2, cache3) {
605394
605376
 
605395
605377
  // ../yaml/loader/lib/YamlParser.js
605396
605378
  init_lib5();
605397
- var import_promises52 = require("fs/promises");
605379
+ var import_promises48 = require("fs/promises");
605398
605380
  var import_yaml3 = __toESM(require_dist8(), 1);
605399
605381
  var YamlParser = class {
605400
605382
  /**
@@ -605405,7 +605387,7 @@ var YamlParser = class {
605405
605387
  * @throws Error if the file cannot be read or contains invalid YAML.
605406
605388
  */
605407
605389
  async parse(absoluteFilePath) {
605408
- const source2 = await (0, import_promises52.readFile)(absoluteFilePath, "utf-8");
605390
+ const source2 = await (0, import_promises48.readFile)(absoluteFilePath, "utf-8");
605409
605391
  return (0, import_yaml3.parse)(source2);
605410
605392
  }
605411
605393
  /**
@@ -605419,7 +605401,7 @@ var YamlParser = class {
605419
605401
  * @throws Error if the file cannot be read or contains invalid YAML.
605420
605402
  */
605421
605403
  async parseDocument({ absoluteFilePath, cwd: cwd2 }) {
605422
- const source2 = await (0, import_promises52.readFile)(absoluteFilePath, "utf-8");
605404
+ const source2 = await (0, import_promises48.readFile)(absoluteFilePath, "utf-8");
605423
605405
  const document4 = (0, import_yaml3.parseDocument)(source2);
605424
605406
  const relativeFilePath = RelativeFilePath.of(relative2(cwd2, absoluteFilePath));
605425
605407
  return new YamlDocument({
@@ -626266,7 +626248,7 @@ function _init2(options2 = {}, getDefaultIntegrationsImpl) {
626266
626248
  }
626267
626249
 
626268
626250
  // ../cli-v2/lib/telemetry/TelemetryClient.js
626269
- var import_promises53 = require("fs/promises");
626251
+ var import_promises49 = require("fs/promises");
626270
626252
  var import_is_ci2 = __toESM(require_is_ci(), 1);
626271
626253
  var os13 = __toESM(require("os"), 1);
626272
626254
  var import_os8 = require("os");
@@ -626386,14 +626368,14 @@ var TelemetryClient = class {
626386
626368
  const distinctIdFilepath = this.getDistinctIdFilepath();
626387
626369
  try {
626388
626370
  if (!await doesPathExist(distinctIdFilepath)) {
626389
- await (0, import_promises53.mkdir)((0, import_path46.dirname)(distinctIdFilepath), { recursive: true });
626390
- await (0, import_promises53.writeFile)(distinctIdFilepath, v4_default(), { flag: "wx" });
626371
+ await (0, import_promises49.mkdir)((0, import_path46.dirname)(distinctIdFilepath), { recursive: true });
626372
+ await (0, import_promises49.writeFile)(distinctIdFilepath, v4_default(), { flag: "wx" });
626391
626373
  }
626392
- const content5 = (await (0, import_promises53.readFile)(distinctIdFilepath)).toString().trim();
626374
+ const content5 = (await (0, import_promises49.readFile)(distinctIdFilepath)).toString().trim();
626393
626375
  this.cachedDistinctId = content5;
626394
626376
  if (!validate_default(content5)) {
626395
626377
  const newId = v4_default();
626396
- await (0, import_promises53.writeFile)(distinctIdFilepath, newId);
626378
+ await (0, import_promises49.writeFile)(distinctIdFilepath, newId);
626397
626379
  this.cachedDistinctId = newId;
626398
626380
  }
626399
626381
  } catch {
@@ -741334,7 +741316,7 @@ function addCompileCommand(cli) {
741334
741316
 
741335
741317
  // ../cli-v2/lib/commands/api/merge/command.js
741336
741318
  init_lib4();
741337
- var import_promises56 = require("fs/promises");
741319
+ var import_promises52 = require("fs/promises");
741338
741320
  var import_path48 = __toESM(require("path"), 1);
741339
741321
 
741340
741322
  // ../cli-v2/lib/config/fern-yml/constants.js
@@ -741343,7 +741325,7 @@ var REF_KEY2 = "$ref";
741343
741325
 
741344
741326
  // ../cli-v2/lib/config/fern-yml/FernYmlEditor.js
741345
741327
  init_lib6();
741346
- var import_promises54 = require("fs/promises");
741328
+ var import_promises50 = require("fs/promises");
741347
741329
  var import_path47 = __toESM(require("path"), 1);
741348
741330
  var import_yaml4 = __toESM(require_dist8(), 1);
741349
741331
  var FernYmlEditor = class _FernYmlEditor {
@@ -741366,7 +741348,7 @@ var FernYmlEditor = class _FernYmlEditor {
741366
741348
  * Sections (`sdks`, `api`) are resolved lazily on first method call.
741367
741349
  */
741368
741350
  static async load(config5) {
741369
- const content5 = await (0, import_promises54.readFile)(config5.fernYmlPath, "utf-8");
741351
+ const content5 = await (0, import_promises50.readFile)(config5.fernYmlPath, "utf-8");
741370
741352
  const document4 = (0, import_yaml4.parseDocument)(content5);
741371
741353
  const doc = document4.toJS();
741372
741354
  if (doc == null || typeof doc !== "object") {
@@ -741547,7 +741529,7 @@ var FernYmlEditor = class _FernYmlEditor {
741547
741529
  for (const section of this.sections.values()) {
741548
741530
  if (this.dirtyFiles.has(section.filePath) && !written.has(section.filePath)) {
741549
741531
  written.add(section.filePath);
741550
- writes.push((0, import_promises54.writeFile)(section.filePath, section.document.toString(), "utf-8"));
741532
+ writes.push((0, import_promises50.writeFile)(section.filePath, section.document.toString(), "utf-8"));
741551
741533
  }
741552
741534
  }
741553
741535
  await Promise.all(writes);
@@ -741576,7 +741558,7 @@ var FernYmlEditor = class _FernYmlEditor {
741576
741558
  message: `Referenced file '${refPath}' in ${FERN_YML_FILENAME} does not exist.`
741577
741559
  });
741578
741560
  }
741579
- const refContent = await (0, import_promises54.readFile)(resolvedPath, "utf-8");
741561
+ const refContent = await (0, import_promises50.readFile)(resolvedPath, "utf-8");
741580
741562
  const refDocument = (0, import_yaml4.parseDocument)(refContent);
741581
741563
  const section2 = {
741582
741564
  document: refDocument,
@@ -741921,11 +741903,11 @@ function isEnoentError(error50) {
741921
741903
  }
741922
741904
 
741923
741905
  // ../cli-v2/lib/commands/api/utils/loadSpec.js
741924
- var import_promises55 = require("fs/promises");
741906
+ var import_promises51 = require("fs/promises");
741925
741907
  async function loadSpec(filepath) {
741926
741908
  let contents;
741927
741909
  try {
741928
- contents = await (0, import_promises55.readFile)(filepath, "utf8");
741910
+ contents = await (0, import_promises51.readFile)(filepath, "utf8");
741929
741911
  } catch (error50) {
741930
741912
  if (isEnoentError(error50)) {
741931
741913
  throw new CliError({ message: `File does not exist: ${filepath}` });
@@ -741999,7 +741981,7 @@ var MergeCommand = class {
741999
741981
  }
742000
741982
  context3.stderr.info(`${Icons.success} Merged ${source_default.bold(String(overridePaths.length))} override(s) ${source_default.dim("\u2192")} ${source_default.cyan(entry.specFilePath)}`);
742001
741983
  }
742002
- await (0, import_promises56.writeFile)(entry.specFilePath, serializeSpec(merged, entry.specFilePath));
741984
+ await (0, import_promises52.writeFile)(entry.specFilePath, serializeSpec(merged, entry.specFilePath));
742003
741985
  mergedCount++;
742004
741986
  if (editor != null) {
742005
741987
  if (overridePaths != null) {
@@ -742039,7 +742021,7 @@ var MergeCommand = class {
742039
742021
  async cleanupFiles(context3, filePaths) {
742040
742022
  await Promise.all(filePaths.map(async (filePath) => {
742041
742023
  try {
742042
- await (0, import_promises56.unlink)(filePath);
742024
+ await (0, import_promises52.unlink)(filePath);
742043
742025
  context3.stderr.info(source_default.dim(`Deleted ${filePath}`));
742044
742026
  } catch (error50) {
742045
742027
  if (!isEnoentError(error50)) {
@@ -742064,7 +742046,7 @@ function addMergeCommand(cli) {
742064
742046
  // ../cli-v2/lib/commands/api/split/command.js
742065
742047
  init_lib4();
742066
742048
  var import_child_process5 = require("child_process");
742067
- var import_promises57 = require("fs/promises");
742049
+ var import_promises53 = require("fs/promises");
742068
742050
  var import_path49 = __toESM(require("path"), 1);
742069
742051
  var import_util17 = require("util");
742070
742052
 
@@ -742139,7 +742121,7 @@ var SplitCommand = class {
742139
742121
  } else {
742140
742122
  await this.splitAsOverrides(context3, editor, entry, originalContent, currentContent, args.output);
742141
742123
  }
742142
- await (0, import_promises57.writeFile)(entry.specFilePath, originalRaw);
742124
+ await (0, import_promises53.writeFile)(entry.specFilePath, originalRaw);
742143
742125
  context3.stderr.debug(source_default.dim(`Restored ${entry.specFilePath} to git HEAD`));
742144
742126
  splitCount++;
742145
742127
  }
@@ -742163,7 +742145,7 @@ var SplitCommand = class {
742163
742145
  if (await this.tryMergeOverlayIntoExistingFile(outputPath, overlay.actions)) {
742164
742146
  context3.stderr.info(`${Icons.success} Merged ${source_default.bold(String(overlay.actions.length))} action(s) into existing ${source_default.cyan(outputPath)}`);
742165
742147
  } else {
742166
- await (0, import_promises57.writeFile)(outputPath, serializeSpec(overlay, outputPath));
742148
+ await (0, import_promises53.writeFile)(outputPath, serializeSpec(overlay, outputPath));
742167
742149
  context3.stderr.info(`${Icons.success} Overlay written (${source_default.bold(String(overlay.actions.length))} action(s)) ${source_default.dim("\u2192")} ${source_default.cyan(outputPath)}`);
742168
742150
  }
742169
742151
  const edit = await editor.addOverlay(entry.specFilePath, outputPath);
@@ -742178,7 +742160,7 @@ var SplitCommand = class {
742178
742160
  if (await this.tryMergeIntoExistingFile(outputPath, overrides)) {
742179
742161
  context3.stderr.info(`${Icons.success} Merged diff into existing ${source_default.cyan(outputPath)}`);
742180
742162
  } else {
742181
- await (0, import_promises57.writeFile)(outputPath, serializeSpec(overrides, outputPath));
742163
+ await (0, import_promises53.writeFile)(outputPath, serializeSpec(overrides, outputPath));
742182
742164
  context3.stderr.info(`${Icons.success} Overrides written ${source_default.dim("\u2192")} ${source_default.cyan(outputPath)}`);
742183
742165
  }
742184
742166
  const edit = await editor.addOverride(entry.specFilePath, outputPath);
@@ -742194,7 +742176,7 @@ var SplitCommand = class {
742194
742176
  async tryMergeOverlayIntoExistingFile(outputPath, newActions) {
742195
742177
  let raw;
742196
742178
  try {
742197
- raw = await (0, import_promises57.readFile)(outputPath, "utf8");
742179
+ raw = await (0, import_promises53.readFile)(outputPath, "utf8");
742198
742180
  } catch (error50) {
742199
742181
  if (isEnoentError(error50)) {
742200
742182
  return false;
@@ -742204,7 +742186,7 @@ var SplitCommand = class {
742204
742186
  const existing = parseSpec(raw, outputPath);
742205
742187
  const existingActions = Array.isArray(existing.actions) ? existing.actions : [];
742206
742188
  existing.actions = [...existingActions, ...newActions];
742207
- await (0, import_promises57.writeFile)(outputPath, serializeSpec(existing, outputPath));
742189
+ await (0, import_promises53.writeFile)(outputPath, serializeSpec(existing, outputPath));
742208
742190
  return true;
742209
742191
  }
742210
742192
  /**
@@ -742214,7 +742196,7 @@ var SplitCommand = class {
742214
742196
  async tryMergeIntoExistingFile(outputPath, overrides) {
742215
742197
  let raw;
742216
742198
  try {
742217
- raw = await (0, import_promises57.readFile)(outputPath, "utf8");
742199
+ raw = await (0, import_promises53.readFile)(outputPath, "utf8");
742218
742200
  } catch (error50) {
742219
742201
  if (isEnoentError(error50)) {
742220
742202
  return false;
@@ -742223,7 +742205,7 @@ var SplitCommand = class {
742223
742205
  }
742224
742206
  const existing = parseSpec(raw, outputPath);
742225
742207
  const merged = mergeWithOverrides({ data: existing, overrides });
742226
- await (0, import_promises57.writeFile)(outputPath, serializeSpec(merged, outputPath));
742208
+ await (0, import_promises53.writeFile)(outputPath, serializeSpec(merged, outputPath));
742227
742209
  return true;
742228
742210
  }
742229
742211
  async getFileFromGitHead(repoRoot, absolutePath) {
@@ -777585,9 +777567,9 @@ function replaceFrontmatterImagesforLogo(data2, mapImage) {
777585
777567
 
777586
777568
  // ../docs-markdown-utils/lib/replaceReferencedCode.js
777587
777569
  init_lib6();
777588
- var import_promises58 = require("fs/promises");
777570
+ var import_promises54 = require("fs/promises");
777589
777571
  async function defaultFileLoader(filepath) {
777590
- const file4 = await (0, import_promises58.readFile)(filepath);
777572
+ const file4 = await (0, import_promises54.readFile)(filepath);
777591
777573
  return file4.toString();
777592
777574
  }
777593
777575
  function isUrl(src) {
@@ -777755,10 +777737,10 @@ ${replacement}
777755
777737
 
777756
777738
  // ../docs-markdown-utils/lib/replaceReferencedMarkdown.js
777757
777739
  init_lib6();
777758
- var import_promises59 = require("fs/promises");
777740
+ var import_promises55 = require("fs/promises");
777759
777741
  var import_gray_matter4 = __toESM(require_gray_matter(), 1);
777760
777742
  async function defaultMarkdownLoader(filepath) {
777761
- const { content: content5 } = (0, import_gray_matter4.default)(await (0, import_promises59.readFile)(filepath));
777743
+ const { content: content5 } = (0, import_gray_matter4.default)(await (0, import_promises55.readFile)(filepath));
777762
777744
  return content5;
777763
777745
  }
777764
777746
  function extractAttributes(markdownTag) {
@@ -777955,7 +777937,7 @@ init_lib10();
777955
777937
  var import_dayjs3 = __toESM(require_dayjs_min2(), 1);
777956
777938
  var import_utc3 = __toESM(require_utc2(), 1);
777957
777939
  var import_fs24 = require("fs");
777958
- var import_promises63 = require("fs/promises");
777940
+ var import_promises59 = require("fs/promises");
777959
777941
  var import_gray_matter5 = __toESM(require_gray_matter(), 1);
777960
777942
  init_lodash();
777961
777943
 
@@ -782414,7 +782396,7 @@ var OpenAPIPruner = class {
782414
782396
  };
782415
782397
 
782416
782398
  // ../register/lib/ai-example-enhancer/enhanceExamplesWithAI.js
782417
- var import_promises62 = require("fs/promises");
782399
+ var import_promises58 = require("fs/promises");
782418
782400
 
782419
782401
  // ../register/lib/ai-example-enhancer/filterHelpers.js
782420
782402
  function isFdrTypedValueWrapper(value) {
@@ -782768,12 +782750,12 @@ var SpinnerStatusCoordinator = class _SpinnerStatusCoordinator {
782768
782750
 
782769
782751
  // ../register/lib/ai-example-enhancer/validateAiExamples.js
782770
782752
  init_lib6();
782771
- var import_promises60 = require("fs/promises");
782753
+ var import_promises56 = require("fs/promises");
782772
782754
  async function parseAiExamplesOverride(sourceFilePath, context3) {
782773
782755
  const overrideFilePath = AbsoluteFilePath2.of(`${dirname4(sourceFilePath)}/ai_examples_override.yml`);
782774
782756
  const aiExamples = [];
782775
782757
  try {
782776
- const existingContent = await (0, import_promises60.readFile)(overrideFilePath, "utf-8");
782758
+ const existingContent = await (0, import_promises56.readFile)(overrideFilePath, "utf-8");
782777
782759
  const parsed = jsYaml.load(existingContent);
782778
782760
  if (parsed && typeof parsed === "object" && "paths" in parsed) {
782779
782761
  const paths = parsed.paths;
@@ -782822,7 +782804,7 @@ async function validateAiExamplesFromFile({ sourceFilePath, context: context3 })
782822
782804
  }
782823
782805
  let spec;
782824
782806
  try {
782825
- const specContent = await (0, import_promises60.readFile)(sourceFilePath, "utf-8");
782807
+ const specContent = await (0, import_promises56.readFile)(sourceFilePath, "utf-8");
782826
782808
  try {
782827
782809
  spec = JSON.parse(specContent);
782828
782810
  } catch {
@@ -782881,7 +782863,7 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
782881
782863
  }
782882
782864
  const overrideFilePath = AbsoluteFilePath2.of(`${dirname4(sourceFilePath)}/ai_examples_override.yml`);
782883
782865
  try {
782884
- const existingContent = await (0, import_promises60.readFile)(overrideFilePath, "utf-8");
782866
+ const existingContent = await (0, import_promises56.readFile)(overrideFilePath, "utf-8");
782885
782867
  const parsed = jsYaml.load(existingContent);
782886
782868
  if (!parsed || !parsed.paths) {
782887
782869
  return {
@@ -782926,12 +782908,12 @@ async function removeInvalidAiExamples({ sourceFilePath, context: context3 }) {
782926
782908
 
782927
782909
  // ../register/lib/ai-example-enhancer/writeAiExamplesOverride.js
782928
782910
  init_lib6();
782929
- var import_promises61 = require("fs/promises");
782911
+ var import_promises57 = require("fs/promises");
782930
782912
  async function loadExistingOverrideCoverage(sourceFilePath, context3) {
782931
782913
  const overrideFilePath = AbsoluteFilePath2.of(`${dirname4(sourceFilePath)}/ai_examples_override.yml`);
782932
782914
  const coveredEndpoints = /* @__PURE__ */ new Set();
782933
782915
  try {
782934
- const existingContent = await (0, import_promises61.readFile)(overrideFilePath, "utf-8");
782916
+ const existingContent = await (0, import_promises57.readFile)(overrideFilePath, "utf-8");
782935
782917
  const parsed = jsYaml.load(existingContent);
782936
782918
  if (parsed && typeof parsed === "object" && "paths" in parsed) {
782937
782919
  const paths = parsed.paths;
@@ -783057,7 +783039,7 @@ async function writeAiExamplesOverride({ enhancedExamples, sourceFilePath, conte
783057
783039
  try {
783058
783040
  let existingOverride = {};
783059
783041
  try {
783060
- const existingContent = await (0, import_promises61.readFile)(overrideFilePath, "utf-8");
783042
+ const existingContent = await (0, import_promises57.readFile)(overrideFilePath, "utf-8");
783061
783043
  const parsed = jsYaml.load(existingContent);
783062
783044
  if (parsed && typeof parsed === "object") {
783063
783045
  existingOverride = parsed;
@@ -783100,7 +783082,7 @@ async function writeAiExamplesOverride({ enhancedExamples, sourceFilePath, conte
783100
783082
  lineWidth: -1,
783101
783083
  noRefs: true
783102
783084
  });
783103
- await (0, import_promises61.writeFile)(overrideFilePath, yamlContent, "utf-8");
783085
+ await (0, import_promises57.writeFile)(overrideFilePath, yamlContent, "utf-8");
783104
783086
  context3.logger.debug(`AI enhanced examples written to: ${overrideFilePath}`);
783105
783087
  } catch (error50) {
783106
783088
  context3.logger.warn(`Failed to write AI examples override file: ${error50}`);
@@ -783390,7 +783372,7 @@ async function performAIEnhancement(apiDefinition, config5, context3, token, org
783390
783372
  const parsedSpecs = [];
783391
783373
  for (const sourceSpec of sourceSpecs) {
783392
783374
  try {
783393
- let specContent = await (0, import_promises62.readFile)(sourceSpec.absoluteFilePath, "utf-8");
783375
+ let specContent = await (0, import_promises58.readFile)(sourceSpec.absoluteFilePath, "utf-8");
783394
783376
  if (sourceSpec.absoluteFilePathToOverrides != null) {
783395
783377
  const overridesPaths = Array.isArray(sourceSpec.absoluteFilePathToOverrides) ? sourceSpec.absoluteFilePathToOverrides : [sourceSpec.absoluteFilePathToOverrides];
783396
783378
  try {
@@ -783401,7 +783383,7 @@ async function performAIEnhancement(apiDefinition, config5, context3, token, org
783401
783383
  parsedSpec = load(specContent, { json: true });
783402
783384
  }
783403
783385
  for (const overridesPath of overridesPaths) {
783404
- const overridesContent = await (0, import_promises62.readFile)(overridesPath, "utf-8");
783386
+ const overridesContent = await (0, import_promises58.readFile)(overridesPath, "utf-8");
783405
783387
  let parsedOverrides;
783406
783388
  try {
783407
783389
  parsedOverrides = JSON.parse(overridesContent);
@@ -786528,7 +786510,7 @@ var DocsDefinitionResolver = class {
786528
786510
  const jsFilePaths = /* @__PURE__ */ new Set();
786529
786511
  await Promise.all(this._parsedDocsConfig.experimental.mdxComponents.map(async (filepath) => {
786530
786512
  const absoluteFilePath = resolve5(this.docsWorkspace.absoluteFilePath, filepath);
786531
- const stats = await (0, import_promises63.stat)(absoluteFilePath);
786513
+ const stats = await (0, import_promises59.stat)(absoluteFilePath);
786532
786514
  if (stats.isDirectory()) {
786533
786515
  const files = await listFiles(absoluteFilePath, "{js,ts,jsx,tsx,md,mdx}");
786534
786516
  files.forEach((file4) => {
@@ -786540,7 +786522,7 @@ var DocsDefinitionResolver = class {
786540
786522
  }));
786541
786523
  jsFiles = Object.fromEntries(await Promise.all([...jsFilePaths].map(async (filePath) => {
786542
786524
  const relativeFilePath = this.toRelativeFilepath(filePath);
786543
- const contents = (await (0, import_promises63.readFile)(filePath)).toString();
786525
+ const contents = (await (0, import_promises59.readFile)(filePath)).toString();
786544
786526
  return [relativeFilePath, contents];
786545
786527
  })));
786546
786528
  const mdxTime = performance.now() - mdxStart;
@@ -786554,13 +786536,13 @@ var DocsDefinitionResolver = class {
786554
786536
  }
786555
786537
  if (this._parsedDocsConfig.header != null) {
786556
786538
  const relativeFilePath = this.toRelativeFilepath(this._parsedDocsConfig.header);
786557
- const contents = (await (0, import_promises63.readFile)(this._parsedDocsConfig.header)).toString();
786539
+ const contents = (await (0, import_promises59.readFile)(this._parsedDocsConfig.header)).toString();
786558
786540
  jsFiles[relativeFilePath] = contents;
786559
786541
  this.taskContext.logger.debug(`Added custom header component: ${relativeFilePath}`);
786560
786542
  }
786561
786543
  if (this._parsedDocsConfig.footer != null) {
786562
786544
  const relativeFilePath = this.toRelativeFilepath(this._parsedDocsConfig.footer);
786563
- const contents = (await (0, import_promises63.readFile)(this._parsedDocsConfig.footer)).toString();
786545
+ const contents = (await (0, import_promises59.readFile)(this._parsedDocsConfig.footer)).toString();
786564
786546
  jsFiles[relativeFilePath] = contents;
786565
786547
  this.taskContext.logger.debug(`Added custom footer component: ${relativeFilePath}`);
786566
786548
  }
@@ -787345,7 +787327,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
787345
787327
  this.taskContext.logger.warn(`No _navigation.yml found for library '${libraryName}' at ${navFilePath}. Run 'fern docs md generate' first.`);
787346
787328
  return null;
787347
787329
  }
787348
- const navContent = await (0, import_promises63.readFile)(navFilePath, "utf-8");
787330
+ const navContent = await (0, import_promises59.readFile)(navFilePath, "utf-8");
787349
787331
  const yamlBody = navContent.split("\n").filter((line) => !line.startsWith("#")).join("\n");
787350
787332
  try {
787351
787333
  return jsYaml.load(yamlBody) ?? [];
@@ -787365,7 +787347,7 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
787365
787347
  return void 0;
787366
787348
  }
787367
787349
  const relPath = relative3(this.docsWorkspace.absoluteFilePath, absolutePath);
787368
- const content5 = await (0, import_promises63.readFile)(absolutePath, "utf-8");
787350
+ const content5 = await (0, import_promises59.readFile)(absolutePath, "utf-8");
787369
787351
  this.parsedDocsConfig.pages[relPath] = content5;
787370
787352
  return navigation_exports2.PageId(relPath);
787371
787353
  }
@@ -796229,7 +796211,7 @@ async function validateVersionConfigFileSchema({ value }) {
796229
796211
  // ../yaml/docs-validator/lib/docsAst/visitDocsConfigFileYamlAst.js
796230
796212
  init_lib4();
796231
796213
  init_lib6();
796232
- var import_promises65 = require("fs/promises");
796214
+ var import_promises61 = require("fs/promises");
796233
796215
 
796234
796216
  // ../yaml/docs-validator/lib/docsAst/validateProductConfig.js
796235
796217
  init_lib4();
@@ -798307,7 +798289,7 @@ async function visitFilepath({ absoluteFilepathToConfiguration, rawUnresolvedFil
798307
798289
  // ../yaml/docs-validator/lib/docsAst/visitNavigationAst.js
798308
798290
  init_lib4();
798309
798291
  init_lib6();
798310
- var import_promises64 = require("fs/promises");
798292
+ var import_promises60 = require("fs/promises");
798311
798293
 
798312
798294
  // ../yaml/docs-validator/lib/utils/asyncPool.js
798313
798295
  async function asyncPool(limit, items, fn5) {
@@ -798459,13 +798441,13 @@ async function visitNavigationItem2({ absolutePathToFernFolder, navigationItem,
798459
798441
  if (markdownPath != null) {
798460
798442
  const absoluteFilepath = resolve5(dirname4(absoluteFilepathToConfiguration), markdownPath);
798461
798443
  if (await doesPathExist(absoluteFilepath)) {
798462
- const fileStats = await (0, import_promises64.stat)(absoluteFilepath);
798444
+ const fileStats = await (0, import_promises60.stat)(absoluteFilepath);
798463
798445
  const fileSizeMB = fileStats.size / (1024 * 1024);
798464
798446
  if (fileSizeMB > 1) {
798465
798447
  context3.logger.trace(`Processing large markdown file: ${markdownPath} (${fileSizeMB.toFixed(2)} MB)`);
798466
798448
  }
798467
798449
  const startTime = performance.now();
798468
- const content5 = (await (0, import_promises64.readFile)(absoluteFilepath, "utf8")).toString();
798450
+ const content5 = (await (0, import_promises60.readFile)(absoluteFilepath, "utf8")).toString();
798469
798451
  const readTime = performance.now() - startTime;
798470
798452
  if (readTime > 2e3) {
798471
798453
  context3.logger.debug(`Slow file read: ${markdownPath} took ${readTime.toFixed(0)}ms`);
@@ -798513,12 +798495,12 @@ async function visitNavigationItem2({ absolutePathToFernFolder, navigationItem,
798513
798495
  context3.logger.trace(`Starting changelog processing for directory: ${changelogDir}`);
798514
798496
  if (await doesPathExist(changelogDir)) {
798515
798497
  const startTime = performance.now();
798516
- const files = await (0, import_promises64.readdir)(changelogDir);
798498
+ const files = await (0, import_promises60.readdir)(changelogDir);
798517
798499
  const markdownFiles = files.filter((file4) => file4.endsWith(".md") || file4.endsWith(".mdx"));
798518
798500
  context3.logger.debug(`Processing ${markdownFiles.length} changelog files in ${changelogDir}`);
798519
798501
  await asyncPool(VALIDATION_CONCURRENCY, markdownFiles, async (file4) => {
798520
798502
  const absoluteFilepath = resolve5(changelogDir, file4);
798521
- const content5 = (await (0, import_promises64.readFile)(absoluteFilepath, "utf8")).toString();
798503
+ const content5 = (await (0, import_promises60.readFile)(absoluteFilepath, "utf8")).toString();
798522
798504
  context3.logger.trace(`Validating changelog file: ${file4}`);
798523
798505
  await visitor.markdownPage?.({
798524
798506
  title: file4,
@@ -798753,7 +798735,7 @@ async function visitDocsConfigFileYamlAst({ contents, visitor, absoluteFilepathT
798753
798735
  willBeUploaded: false
798754
798736
  });
798755
798737
  const absoluteFilepath = resolve5(dirname4(absoluteFilepathToConfiguration), product.path);
798756
- const content5 = jsYaml.load((await (0, import_promises65.readFile)(absoluteFilepath)).toString());
798738
+ const content5 = jsYaml.load((await (0, import_promises61.readFile)(absoluteFilepath)).toString());
798757
798739
  if (await doesPathExist(absoluteFilepath)) {
798758
798740
  await visitor.productFile?.({
798759
798741
  path: product.path,
@@ -798832,7 +798814,7 @@ async function visitDocsConfigFileYamlAst({ contents, visitor, absoluteFilepathT
798832
798814
  willBeUploaded: false
798833
798815
  });
798834
798816
  const absoluteFilepath = resolve5(dirname4(absoluteFilepathToConfiguration), version7.path);
798835
- const content5 = jsYaml.load((await (0, import_promises65.readFile)(absoluteFilepath)).toString());
798817
+ const content5 = jsYaml.load((await (0, import_promises61.readFile)(absoluteFilepath)).toString());
798836
798818
  if (await doesPathExist(absoluteFilepath)) {
798837
798819
  await visitor.versionFile?.({
798838
798820
  path: version7.path,
@@ -799268,11 +799250,11 @@ var import_chardet2 = __toESM(require_lib9(), 1);
799268
799250
  // ../../../node_modules/.pnpm/file-type@21.3.4/node_modules/file-type/index.js
799269
799251
  var import_web = require("stream/web");
799270
799252
  var import_node_stream5 = require("stream");
799271
- var import_promises68 = __toESM(require("fs/promises"), 1);
799253
+ var import_promises64 = __toESM(require("fs/promises"), 1);
799272
799254
  var import_node_fs13 = require("fs");
799273
799255
 
799274
799256
  // ../../../node_modules/.pnpm/strtok3@10.3.4/node_modules/strtok3/lib/index.js
799275
- var import_promises67 = require("fs/promises");
799257
+ var import_promises63 = require("fs/promises");
799276
799258
 
799277
799259
  // ../../../node_modules/.pnpm/strtok3@10.3.4/node_modules/strtok3/lib/stream/Errors.js
799278
799260
  var defaultMessages = "End-Of-Stream";
@@ -799795,14 +799777,14 @@ function fromBlob(blob, options2) {
799795
799777
  }
799796
799778
 
799797
799779
  // ../../../node_modules/.pnpm/strtok3@10.3.4/node_modules/strtok3/lib/FileTokenizer.js
799798
- var import_promises66 = require("fs/promises");
799780
+ var import_promises62 = require("fs/promises");
799799
799781
  var FileTokenizer = class _FileTokenizer extends AbstractTokenizer {
799800
799782
  /**
799801
799783
  * Create tokenizer from provided file path
799802
799784
  * @param sourceFilePath File path
799803
799785
  */
799804
799786
  static async fromFile(sourceFilePath) {
799805
- const fileHandle = await (0, import_promises66.open)(sourceFilePath, "r");
799787
+ const fileHandle = await (0, import_promises62.open)(sourceFilePath, "r");
799806
799788
  const stat6 = await fileHandle.stat();
799807
799789
  return new _FileTokenizer(fileHandle, { fileInfo: { path: sourceFilePath, size: stat6.size } });
799808
799790
  }
@@ -803043,7 +803025,7 @@ var supportedExtensions = new Set(extensions);
803043
803025
  var supportedMimeTypes = new Set(mimeTypes);
803044
803026
 
803045
803027
  // ../yaml/docs-validator/lib/rules/valid-file-types/valid-file-types.js
803046
- var import_promises69 = require("fs/promises");
803028
+ var import_promises65 = require("fs/promises");
803047
803029
  var import_path52 = __toESM(require("path"), 1);
803048
803030
  var ALLOWED_FILE_TYPES = /* @__PURE__ */ new Set([
803049
803031
  // image files
@@ -803172,7 +803154,7 @@ var ValidFileTypes = {
803172
803154
  }
803173
803155
  };
803174
803156
  var getViolationsForFile = async (absoluteFilepath) => {
803175
- const file4 = new Uint8Array(await (0, import_promises69.readFile)(absoluteFilepath));
803157
+ const file4 = new Uint8Array(await (0, import_promises65.readFile)(absoluteFilepath));
803176
803158
  const fileType = await fileTypeFromBuffer(file4);
803177
803159
  if (fileType != null) {
803178
803160
  if (ALLOWED_FILE_TYPES.has(fileType.mime)) {
@@ -803211,7 +803193,7 @@ var getViolationsForFile = async (absoluteFilepath) => {
803211
803193
  };
803212
803194
 
803213
803195
  // ../yaml/docs-validator/lib/rules/valid-frontmatter/valid-frontmatter.js
803214
- var import_promises70 = require("fs/promises");
803196
+ var import_promises66 = require("fs/promises");
803215
803197
  var import_gray_matter6 = __toESM(require_gray_matter(), 1);
803216
803198
  var ValidFrontmatter = {
803217
803199
  name: "valid-frontmatter",
@@ -803222,7 +803204,7 @@ var ValidFrontmatter = {
803222
803204
  return [];
803223
803205
  }
803224
803206
  try {
803225
- const fileContents = await (0, import_promises70.readFile)(absoluteFilepath, "utf-8");
803207
+ const fileContents = await (0, import_promises66.readFile)(absoluteFilepath, "utf-8");
803226
803208
  (0, import_gray_matter6.default)(fileContents);
803227
803209
  return [];
803228
803210
  } catch (error50) {
@@ -820664,7 +820646,7 @@ async function parseMarkdown({ markdown, absoluteFilepath, absolutePathToFernFol
820664
820646
 
820665
820647
  // ../yaml/docs-validator/lib/rules/valid-markdown-file-reference/valid-markdown-file-reference.js
820666
820648
  init_lib6();
820667
- var import_promises71 = require("fs/promises");
820649
+ var import_promises67 = require("fs/promises");
820668
820650
  var import_gray_matter7 = __toESM(require_gray_matter(), 1);
820669
820651
  var ValidMarkdownFileReferences = {
820670
820652
  name: "valid-markdown-file-references",
@@ -820675,7 +820657,7 @@ var ValidMarkdownFileReferences = {
820675
820657
  return [];
820676
820658
  }
820677
820659
  try {
820678
- const fileContents = await (0, import_promises71.readFile)(absoluteFilepath, "utf-8");
820660
+ const fileContents = await (0, import_promises67.readFile)(absoluteFilepath, "utf-8");
820679
820661
  const { content: content5 } = (0, import_gray_matter7.default)(fileContents, {});
820680
820662
  const tree = parseMarkdownToTree(content5);
820681
820663
  const errors4 = [];
@@ -821276,7 +821258,7 @@ var MDX_NODE_TYPES = [
821276
821258
  "mdxTextExpression",
821277
821259
  "mdxjsEsm"
821278
821260
  ];
821279
- function collectLinksAndSources({ readFile: readFile106 = (path97) => (0, import_node_fs14.readFileSync)(path97, "utf-8"), ...opts }) {
821261
+ function collectLinksAndSources({ readFile: readFile102 = (path97) => (0, import_node_fs14.readFileSync)(path97, "utf-8"), ...opts }) {
821280
821262
  const visitedAbsoluteFilepaths = /* @__PURE__ */ new Set();
821281
821263
  const contentQueue = [opts];
821282
821264
  const links = [];
@@ -821314,7 +821296,7 @@ function collectLinksAndSources({ readFile: readFile106 = (path97) => (0, import
821314
821296
  const resolvedImportPath = resolve5(dirname4(absoluteFilepath), importPath);
821315
821297
  if (resolvedImportPath.endsWith(".mdx") || resolvedImportPath.endsWith(".md")) {
821316
821298
  contentQueue.push({
821317
- content: readFile106(resolvedImportPath),
821299
+ content: readFile102(resolvedImportPath),
821318
821300
  absoluteFilepath: resolvedImportPath
821319
821301
  });
821320
821302
  }
@@ -821357,7 +821339,7 @@ function collectLinksAndSources({ readFile: readFile106 = (path97) => (0, import
821357
821339
  if (absoluteFilepath && typeof src === "string") {
821358
821340
  const resolvedImportPath = resolve5(dirname4(absoluteFilepath), src);
821359
821341
  contentQueue.push({
821360
- content: readFile106(resolvedImportPath),
821342
+ content: readFile102(resolvedImportPath),
821361
821343
  absoluteFilepath: resolvedImportPath
821362
821344
  });
821363
821345
  }
@@ -821754,7 +821736,7 @@ function createDocsConfigFileAstVisitorForRules({ relativeFilepath, allRulesWith
821754
821736
 
821755
821737
  // ../yaml/docs-validator/lib/rules/no-non-component-refs/no-non-component-refs.js
821756
821738
  init_lib6();
821757
- var import_promises72 = require("fs/promises");
821739
+ var import_promises68 = require("fs/promises");
821758
821740
  var NoNonComponentRefsRule = {
821759
821741
  name: "no-non-component-refs",
821760
821742
  create: ({ ossWorkspaces, logger: logger4, workspace: docsWorkspace }) => {
@@ -821768,7 +821750,7 @@ var NoNonComponentRefsRule = {
821768
821750
  if (!processedFiles.has(spec.absoluteFilepath)) {
821769
821751
  processedFiles.add(spec.absoluteFilepath);
821770
821752
  try {
821771
- const contents = (await (0, import_promises72.readFile)(spec.absoluteFilepath)).toString();
821753
+ const contents = (await (0, import_promises68.readFile)(spec.absoluteFilepath)).toString();
821772
821754
  const relativePath = relative3(docsWorkspace.absoluteFilePath, spec.absoluteFilepath);
821773
821755
  const isOpenApiV2Yaml = contents.includes("swagger:") && (contents.includes('swagger: "2.0"') || contents.includes("swagger: '2.0'") || contents.includes("swagger: 2.0"));
821774
821756
  const isOpenApiV2Json = contents.includes('"swagger":') && (contents.includes('"swagger":"2.0"') || contents.includes('"swagger": "2.0"'));
@@ -821810,7 +821792,7 @@ var NoNonComponentRefsRule = {
821810
821792
 
821811
821793
  // ../yaml/docs-validator/lib/rules/no-openapi-v2-in-docs/no-openapi-v2-in-docs.js
821812
821794
  init_lib6();
821813
- var import_promises73 = require("fs/promises");
821795
+ var import_promises69 = require("fs/promises");
821814
821796
  var NoOpenApiV2InDocsRule = {
821815
821797
  name: "no-openapi-v2-in-docs",
821816
821798
  create: ({ ossWorkspaces, logger: logger4, workspace: docsWorkspace }) => {
@@ -821823,7 +821805,7 @@ var NoOpenApiV2InDocsRule = {
821823
821805
  if (spec.type === "openapi" && !processedFiles.has(spec.absoluteFilepath)) {
821824
821806
  processedFiles.add(spec.absoluteFilepath);
821825
821807
  try {
821826
- const contents = (await (0, import_promises73.readFile)(spec.absoluteFilepath)).toString();
821808
+ const contents = (await (0, import_promises69.readFile)(spec.absoluteFilepath)).toString();
821827
821809
  const relativePath = relative3(docsWorkspace.absoluteFilePath, spec.absoluteFilepath);
821828
821810
  const isOpenApiV2Yaml = contents.includes("swagger:") && (contents.includes('swagger: "2.0"') || contents.includes("swagger: '2.0'") || contents.includes("swagger: 2.0"));
821829
821811
  const isOpenApiV2Json = contents.includes('"swagger":') && (contents.includes('"swagger":"2.0"') || contents.includes('"swagger": "2.0"'));
@@ -821949,7 +821931,7 @@ var ValidInstanceUrlRule = {
821949
821931
 
821950
821932
  // ../yaml/docs-validator/lib/rules/valid-local-references/valid-local-references.js
821951
821933
  init_lib6();
821952
- var import_promises74 = require("fs/promises");
821934
+ var import_promises70 = require("fs/promises");
821953
821935
  function validateReference(ref2, spec) {
821954
821936
  const pathParts = ref2.replace(/^#\//, "").split("/").map((part) => (
821955
821937
  // Decode JSON Pointer escapes: ~1 -> /, ~0 -> ~
@@ -822016,7 +821998,7 @@ var ValidLocalReferencesRule = {
822016
821998
  if (spec.type === "openapi" && !processedFiles.has(spec.absoluteFilepath)) {
822017
821999
  processedFiles.add(spec.absoluteFilepath);
822018
822000
  try {
822019
- const contents = (await (0, import_promises74.readFile)(spec.absoluteFilepath)).toString();
822001
+ const contents = (await (0, import_promises70.readFile)(spec.absoluteFilepath)).toString();
822020
822002
  const relativePath = relative3(docsWorkspace.absoluteFilePath, spec.absoluteFilepath);
822021
822003
  const isOpenApiV2Yaml = contents.includes("swagger:") && (contents.includes('swagger: "2.0"') || contents.includes("swagger: '2.0'") || contents.includes("swagger: 2.0"));
822022
822004
  const isOpenApiV2Json = contents.includes('"swagger":') && (contents.includes('"swagger":"2.0"') || contents.includes('"swagger": "2.0"'));
@@ -822071,7 +822053,7 @@ var ValidLocalReferencesRule = {
822071
822053
 
822072
822054
  // ../yaml/docs-validator/lib/rules/valid-openapi-examples/valid-openapi-examples.js
822073
822055
  init_lib6();
822074
- var import_promises75 = require("fs/promises");
822056
+ var import_promises71 = require("fs/promises");
822075
822057
  var ValidOpenApiExamples = {
822076
822058
  name: "valid-openapi-examples",
822077
822059
  create: ({ ossWorkspaces, logger: logger4, workspace: docsWorkspace }) => {
@@ -822169,7 +822151,7 @@ var ValidOpenApiExamples = {
822169
822151
  };
822170
822152
  async function validateOpenApiExamples({ specPath, logger: logger4 }) {
822171
822153
  try {
822172
- const specContent = await (0, import_promises75.readFile)(specPath, "utf-8");
822154
+ const specContent = await (0, import_promises71.readFile)(specPath, "utf-8");
822173
822155
  let spec;
822174
822156
  try {
822175
822157
  spec = JSON.parse(specContent);
@@ -822899,11 +822881,11 @@ function addCheckCommand2(cli) {
822899
822881
 
822900
822882
  // ../cli-v2/lib/migrator/Migrator.js
822901
822883
  init_lib6();
822902
- var import_promises79 = require("fs/promises");
822884
+ var import_promises75 = require("fs/promises");
822903
822885
 
822904
822886
  // ../cli-v2/lib/migrator/converters/convertApiSpecs.js
822905
822887
  init_lib6();
822906
- var import_promises76 = require("fs/promises");
822888
+ var import_promises72 = require("fs/promises");
822907
822889
 
822908
822890
  // ../cli-v2/lib/migrator/converters/convertSettings.js
822909
822891
  var SETTINGS_KEY_MAP = {
@@ -823037,7 +823019,7 @@ async function convertMultiApi(options2) {
823037
823019
  const { apisDir, generatorsYmlApis } = options2;
823038
823020
  const warnings = [];
823039
823021
  const apis = {};
823040
- const apiDirs = await (0, import_promises76.readdir)(apisDir, { withFileTypes: true });
823022
+ const apiDirs = await (0, import_promises72.readdir)(apisDir, { withFileTypes: true });
823041
823023
  const apiNames = apiDirs.filter((d14) => d14.isDirectory()).map((d14) => d14.name);
823042
823024
  for (const apiName of apiNames) {
823043
823025
  const apiDir = join2(apisDir, RelativeFilePath2.of(apiName));
@@ -823788,7 +823770,7 @@ function convertRawReadme(readme) {
823788
823770
  // ../cli-v2/lib/migrator/fern-config-json/FernConfigJsonMigrator.js
823789
823771
  init_lib4();
823790
823772
  init_lib6();
823791
- var import_promises77 = require("fs/promises");
823773
+ var import_promises73 = require("fs/promises");
823792
823774
  var FernConfigJsonMigrator = class {
823793
823775
  cwd;
823794
823776
  constructor({ cwd: cwd2 }) {
@@ -823821,7 +823803,7 @@ var FernConfigJsonMigrator = class {
823821
823803
  };
823822
823804
  }
823823
823805
  try {
823824
- const content5 = await (0, import_promises77.readFile)(absoluteFilePath, "utf-8");
823806
+ const content5 = await (0, import_promises73.readFile)(absoluteFilePath, "utf-8");
823825
823807
  const config5 = JSON.parse(content5);
823826
823808
  const org = typeof config5.organization === "string" ? config5.organization : void 0;
823827
823809
  const cliVersion = typeof config5.version === "string" ? config5.version : void 0;
@@ -823860,7 +823842,7 @@ var FernConfigJsonMigrator = class {
823860
823842
  // ../cli-v2/lib/migrator/generators-yml/GeneratorsYmlMigrator.js
823861
823843
  init_lib4();
823862
823844
  init_lib6();
823863
- var import_promises78 = require("fs/promises");
823845
+ var import_promises74 = require("fs/promises");
823864
823846
  var GeneratorsYmlMigrator = class {
823865
823847
  cwd;
823866
823848
  apiName;
@@ -823894,7 +823876,7 @@ var GeneratorsYmlMigrator = class {
823894
823876
  }
823895
823877
  let content5;
823896
823878
  try {
823897
- content5 = await (0, import_promises78.readFile)(absoluteFilePath, "utf-8");
823879
+ content5 = await (0, import_promises74.readFile)(absoluteFilePath, "utf-8");
823898
823880
  const config5 = jsYaml.load(content5);
823899
823881
  if (config5 == null || typeof config5 !== "object") {
823900
823882
  return {
@@ -824121,11 +824103,11 @@ var Migrator = class {
824121
824103
  }
824122
824104
  const fernYmlPath = join2(this.cwd, RelativeFilePath2.of(FERN_YML_FILENAME));
824123
824105
  const yamlContent = this.serializeFernYml(fernYml);
824124
- await (0, import_promises79.writeFile)(fernYmlPath, yamlContent, "utf-8");
824106
+ await (0, import_promises75.writeFile)(fernYmlPath, yamlContent, "utf-8");
824125
824107
  if (this.deleteOriginals) {
824126
824108
  for (const absoluteFilePath of migratedFiles) {
824127
824109
  try {
824128
- await (0, import_promises79.rm)(absoluteFilePath);
824110
+ await (0, import_promises75.rm)(absoluteFilePath);
824129
824111
  this.logger.debug(`Deleted ${absoluteFilePath}`);
824130
824112
  } catch {
824131
824113
  warnings.push({
@@ -824169,7 +824151,7 @@ var Migrator = class {
824169
824151
  }
824170
824152
  async migrateMultiApi(options2) {
824171
824153
  const { fernDir, apisDir, org, warnings, migratedFiles } = options2;
824172
- const apiDirs = await (0, import_promises79.readdir)(apisDir, { withFileTypes: true });
824154
+ const apiDirs = await (0, import_promises75.readdir)(apisDir, { withFileTypes: true });
824173
824155
  const apiNames = apiDirs.filter((d14) => d14.isDirectory()).map((d14) => d14.name);
824174
824156
  if (apiNames.length === 0) {
824175
824157
  warnings.push({
@@ -824529,7 +824511,7 @@ init_js();
824529
824511
  init_lib6();
824530
824512
  var import_cors = __toESM(require_lib14(), 1);
824531
824513
  var import_express2 = __toESM(require_express3(), 1);
824532
- var import_promises83 = require("fs/promises");
824514
+ var import_promises79 = require("fs/promises");
824533
824515
  var import_http9 = __toESM(require("http"), 1);
824534
824516
  var import_path55 = __toESM(require("path"), 1);
824535
824517
 
@@ -826202,13 +826184,13 @@ init_wrapper();
826202
826184
 
826203
826185
  // ../docs-preview/lib/DebugLogger.js
826204
826186
  init_lib6();
826205
- var import_promises80 = require("fs/promises");
826187
+ var import_promises76 = require("fs/promises");
826206
826188
  var import_os9 = require("os");
826207
826189
  var import_path54 = __toESM(require("path"), 1);
826208
826190
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
826209
826191
  var LOGS_FOLDER_NAME = "logs";
826210
826192
  function getCliSource() {
826211
- const version7 = "4.50.3";
826193
+ const version7 = "4.50.4-1-g8a6fed15293";
826212
826194
  return `cli@${version7}`;
826213
826195
  }
826214
826196
  var DebugLogger = class {
@@ -826228,7 +826210,7 @@ var DebugLogger = class {
826228
826210
  const localStorageFolder = join2(AbsoluteFilePath2.of((0, import_os9.homedir)()), RelativeFilePath2.of(LOCAL_STORAGE_FOLDER4));
826229
826211
  const logsDir = join2(localStorageFolder, RelativeFilePath2.of(LOGS_FOLDER_NAME));
826230
826212
  if (!await doesPathExist(logsDir)) {
826231
- await (0, import_promises80.mkdir)(logsDir, { recursive: true });
826213
+ await (0, import_promises76.mkdir)(logsDir, { recursive: true });
826232
826214
  }
826233
826215
  const timestamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
826234
826216
  const logFileName = `${timestamp2}.debug.log`;
@@ -826241,7 +826223,7 @@ var DebugLogger = class {
826241
826223
  "================================================================================",
826242
826224
  ""
826243
826225
  ].join("\n");
826244
- await (0, import_promises80.writeFile)(this.logFilePath, header, "utf-8");
826226
+ await (0, import_promises76.writeFile)(this.logFilePath, header, "utf-8");
826245
826227
  this.initialized = true;
826246
826228
  }
826247
826229
  /**
@@ -826259,7 +826241,7 @@ var DebugLogger = class {
826259
826241
  }
826260
826242
  const line = JSON.stringify(entry) + "\n";
826261
826243
  try {
826262
- await (0, import_promises80.appendFile)(this.logFilePath, line, "utf-8");
826244
+ await (0, import_promises76.appendFile)(this.logFilePath, line, "utf-8");
826263
826245
  } catch (error50) {
826264
826246
  }
826265
826247
  }
@@ -826494,7 +826476,7 @@ function getBun() {
826494
826476
  init_lib6();
826495
826477
  var import_cli_progress = __toESM(require_cli_progress(), 1);
826496
826478
  var import_decompress = __toESM(require_decompress(), 1);
826497
- var import_promises81 = require("fs/promises");
826479
+ var import_promises77 = require("fs/promises");
826498
826480
  var import_os10 = require("os");
826499
826481
  var import_tmp_promise8 = __toESM(require_tmp_promise(), 1);
826500
826482
  var import_xml2js = __toESM(require_xml2js(), 1);
@@ -826582,7 +826564,7 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
826582
826564
  let currentETag = void 0;
826583
826565
  if (currentETagExists) {
826584
826566
  logger4.debug("Reading existing ETag");
826585
- currentETag = (await (0, import_promises81.readFile)(eTagFilepath)).toString();
826567
+ currentETag = (await (0, import_promises77.readFile)(eTagFilepath)).toString();
826586
826568
  }
826587
826569
  if (currentETag != null && currentETag === eTag) {
826588
826570
  logger4.debug("ETag matches. Using already downloaded bundle");
@@ -826646,16 +826628,16 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
826646
826628
  }
826647
826629
  }
826648
826630
  const nodeBuffer = Buffer.concat(chunks);
826649
- await (0, import_promises81.writeFile)(outputZipPath, new Uint8Array(nodeBuffer));
826631
+ await (0, import_promises77.writeFile)(outputZipPath, new Uint8Array(nodeBuffer));
826650
826632
  logger4.debug(`Wrote ${tryTar ? "output.tar.gz" : "output.zip"} to ${outputZipPath}`);
826651
826633
  const absolutePathToPreviewFolder = getPathToPreviewFolder({ app });
826652
826634
  if (await doesPathExist(absolutePathToPreviewFolder)) {
826653
826635
  logger4.debug(`Removing previously cached bundle at: ${absolutePathToPreviewFolder}`);
826654
- await (0, import_promises81.rm)(absolutePathToPreviewFolder, { recursive: true });
826636
+ await (0, import_promises77.rm)(absolutePathToPreviewFolder, { recursive: true });
826655
826637
  }
826656
- await (0, import_promises81.mkdir)(absolutePathToPreviewFolder, { recursive: true });
826638
+ await (0, import_promises77.mkdir)(absolutePathToPreviewFolder, { recursive: true });
826657
826639
  const absolutePathToBundleFolder = getPathToBundleFolder({ app });
826658
- await (0, import_promises81.mkdir)(absolutePathToBundleFolder, { recursive: true });
826640
+ await (0, import_promises77.mkdir)(absolutePathToBundleFolder, { recursive: true });
826659
826641
  logger4.debug(`Decompressing bundle from ${outputZipPath} to ${absolutePathToBundleFolder}`);
826660
826642
  let unzipProgressBar;
826661
826643
  let unzipInterval;
@@ -826690,7 +826672,7 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
826690
826672
  unzipProgressBar.stop();
826691
826673
  }
826692
826674
  }
826693
- await (0, import_promises81.writeFile)(eTagFilepath, eTag);
826675
+ await (0, import_promises77.writeFile)(eTagFilepath, eTag);
826694
826676
  logger4.debug(`Downloaded bundle to ${absolutePathToBundleFolder}`);
826695
826677
  if (app) {
826696
826678
  logger4.debug("Checking if pnpm is installed");
@@ -826772,15 +826754,15 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
826772
826754
  }
826773
826755
  if (!pnpmfileExists) {
826774
826756
  logger4.debug(`Writing pnpmfile.cjs at ${pnpmfilePath}`);
826775
- await (0, import_promises81.writeFile)(pnpmfilePath, PNPMFILE_CJS_CONTENTS);
826757
+ await (0, import_promises77.writeFile)(pnpmfilePath, PNPMFILE_CJS_CONTENTS);
826776
826758
  }
826777
826759
  if (!npmrcExists) {
826778
826760
  logger4.debug(`Writing .npmrc at ${npmrcPath}`);
826779
- await (0, import_promises81.writeFile)(npmrcPath, NPMRC_CONTENTS);
826761
+ await (0, import_promises77.writeFile)(npmrcPath, NPMRC_CONTENTS);
826780
826762
  }
826781
826763
  if (instrumentationJsExists) {
826782
826764
  logger4.debug(`Removing instrumentation.js at ${absPathToInstrumentationJs}`);
826783
- await (0, import_promises81.rm)(absPathToInstrumentationJs);
826765
+ await (0, import_promises77.rm)(absPathToInstrumentationJs);
826784
826766
  }
826785
826767
  try {
826786
826768
  logger4.debug("Running pnpm install within standalone");
@@ -826800,7 +826782,7 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
826800
826782
  logger4.error(`Error: ${error50}`);
826801
826783
  const absolutePathToPreviewFolder = getPathToPreviewFolder({ app });
826802
826784
  if (await doesPathExist(absolutePathToPreviewFolder)) {
826803
- await (0, import_promises81.rm)(absolutePathToPreviewFolder, { recursive: true });
826785
+ await (0, import_promises77.rm)(absolutePathToPreviewFolder, { recursive: true });
826804
826786
  }
826805
826787
  logger4.debug(`Removing incomplete bundle: rm -rf ${absolutePathToPreviewFolder}`);
826806
826788
  return {
@@ -826813,7 +826795,7 @@ async function downloadBundle({ bucketUrl, logger: logger4, preferCached, app =
826813
826795
  init_lib4();
826814
826796
  init_js();
826815
826797
  init_lib6();
826816
- var import_promises82 = require("fs/promises");
826798
+ var import_promises78 = require("fs/promises");
826817
826799
  var import_gray_matter8 = __toESM(require_gray_matter(), 1);
826818
826800
  var frontmatterPositionCache = /* @__PURE__ */ new Map();
826819
826801
  var frontmatterSidebarTitleCache = /* @__PURE__ */ new Map();
@@ -826883,7 +826865,7 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
826883
826865
  navAffectingChange = true;
826884
826866
  continue;
826885
826867
  }
826886
- const markdown = (await (0, import_promises82.readFile)(absoluteFilePath)).toString();
826868
+ const markdown = (await (0, import_promises78.readFile)(absoluteFilePath)).toString();
826887
826869
  const isNewFile = previousValue == null;
826888
826870
  if (isNewFile) {
826889
826871
  navAffectingChange = true;
@@ -827287,7 +827269,7 @@ var SnippetDependencyTracker = class {
827287
827269
  const markdownFiles = await this.findMarkdownFiles(docsWorkspace.absoluteFilePath);
827288
827270
  for (const markdownFile of markdownFiles) {
827289
827271
  try {
827290
- const content5 = await (0, import_promises83.readFile)(markdownFile, "utf-8");
827272
+ const content5 = await (0, import_promises79.readFile)(markdownFile, "utf-8");
827291
827273
  const referencedFiles = this.extractReferences(content5, markdownFile, docsWorkspace.absoluteFilePath);
827292
827274
  this.pageToSnippets.set(markdownFile, referencedFiles);
827293
827275
  for (const referencedFile of referencedFiles) {
@@ -827369,7 +827351,7 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
827369
827351
  const appPreviewFolder = getPathToPreviewFolder({ app: true });
827370
827352
  if (await doesPathExist(appPreviewFolder)) {
827371
827353
  context3.logger.info("Force download requested. Deleting cached bundle...");
827372
- await (0, import_promises83.rm)(appPreviewFolder, { recursive: true });
827354
+ await (0, import_promises79.rm)(appPreviewFolder, { recursive: true });
827373
827355
  }
827374
827356
  }
827375
827357
  if (bundlePath != null) {
@@ -828864,7 +828846,7 @@ init_lib6();
828864
828846
 
828865
828847
  // ../workspace/loader/lib/listFernFiles.js
828866
828848
  init_lib6();
828867
- var import_promises84 = require("fs/promises");
828849
+ var import_promises80 = require("fs/promises");
828868
828850
  async function listFernFiles2(root6, extensionGlob) {
828869
828851
  const files = [];
828870
828852
  for (const absoluteFilepath of await listFiles(root6, extensionGlob)) {
@@ -828879,7 +828861,7 @@ async function createFernFile2({ relativeFilepath, absoluteFilepath }) {
828879
828861
  return {
828880
828862
  relativeFilepath,
828881
828863
  absoluteFilepath,
828882
- fileContents: (await (0, import_promises84.readFile)(absoluteFilepath)).toString()
828864
+ fileContents: (await (0, import_promises80.readFile)(absoluteFilepath)).toString()
828883
828865
  };
828884
828866
  }
828885
828867
 
@@ -829186,7 +829168,7 @@ async function loadAPIWorkspace({ absolutePathToWorkspace, context: context3, cl
829186
829168
  // ../workspace/loader/lib/loadDocsWorkspace.js
829187
829169
  init_lib4();
829188
829170
  init_lib6();
829189
- var import_promises85 = require("fs/promises");
829171
+ var import_promises81 = require("fs/promises");
829190
829172
 
829191
829173
  // ../workspace/loader/lib/docs-yml.schema.json
829192
829174
  var docs_yml_schema_exports = {};
@@ -835056,7 +835038,7 @@ async function loadDocsConfiguration({ absolutePathToDocsDefinition, context: co
835056
835038
  });
835057
835039
  }
835058
835040
  async function loadRawDocsConfiguration({ absolutePathOfConfiguration, context: context3 }) {
835059
- const contentsStr = await (0, import_promises85.readFile)(absolutePathOfConfiguration);
835041
+ const contentsStr = await (0, import_promises81.readFile)(absolutePathOfConfiguration);
835060
835042
  const contentsJson = jsYaml.load(contentsStr.toString());
835061
835043
  const result = validateAgainstJsonSchema(contentsJson, docs_yml_schema_exports, {
835062
835044
  filePath: absolutePathOfConfiguration
@@ -835090,8 +835072,8 @@ var import_fiddle_sdk5 = __toESM(require_fiddle_sdk(), 1);
835090
835072
  // ../generation/remote-generation/remote-workspace-runner/lib/downloadSnippetsForTask.js
835091
835073
  init_lib6();
835092
835074
  var import_fs25 = require("fs");
835093
- var import_promises86 = require("fs/promises");
835094
- var import_promises87 = require("stream/promises");
835075
+ var import_promises82 = require("fs/promises");
835076
+ var import_promises83 = require("stream/promises");
835095
835077
  async function downloadSnippetsForTask({ snippetsS3PreSignedReadUrl, absolutePathToLocalSnippetJSON, context: context3 }) {
835096
835078
  try {
835097
835079
  await downloadFileForTask({
@@ -835108,10 +835090,10 @@ async function downloadFileForTask({ s3PreSignedReadUrl, absolutePathToLocalOutp
835108
835090
  responseType: "stream"
835109
835091
  });
835110
835092
  if (await doesPathExist(absolutePathToLocalOutput)) {
835111
- await (0, import_promises86.rm)(absolutePathToLocalOutput, { recursive: true });
835093
+ await (0, import_promises82.rm)(absolutePathToLocalOutput, { recursive: true });
835112
835094
  }
835113
- await (0, import_promises86.mkdir)(dirname4(absolutePathToLocalOutput), { recursive: true });
835114
- await (0, import_promises87.pipeline)(request7.data, (0, import_fs25.createWriteStream)(absolutePathToLocalOutput));
835095
+ await (0, import_promises82.mkdir)(dirname4(absolutePathToLocalOutput), { recursive: true });
835096
+ await (0, import_promises83.pipeline)(request7.data, (0, import_fs25.createWriteStream)(absolutePathToLocalOutput));
835115
835097
  }
835116
835098
 
835117
835099
  // ../generation/remote-generation/remote-workspace-runner/lib/resolveAutoDiscoveredFernignorePath.js
@@ -835136,7 +835118,7 @@ init_js();
835136
835118
  init_lib6();
835137
835119
  var import_fiddle_sdk4 = __toESM(require_fiddle_sdk(), 1);
835138
835120
  var import_form_data4 = __toESM(require_form_data(), 1);
835139
- var import_promises88 = require("fs/promises");
835121
+ var import_promises84 = require("fs/promises");
835140
835122
  var import_url_join23 = __toESM(require_url_join(), 1);
835141
835123
  var import_util19 = require("util");
835142
835124
  var import_zlib5 = require("zlib");
@@ -835189,7 +835171,7 @@ async function createAndStartJob({ projectConfig, workspace, organization, inter
835189
835171
  fernignoreContents = "";
835190
835172
  } else if (fernignorePath != null) {
835191
835173
  try {
835192
- fernignoreContents = await (0, import_promises88.readFile)(fernignorePath, "utf-8");
835174
+ fernignoreContents = await (0, import_promises84.readFile)(fernignorePath, "utf-8");
835193
835175
  } catch (error50) {
835194
835176
  context3.failAndThrow(`Failed to read fernignore file at ${fernignorePath}: ${error50}`);
835195
835177
  }
@@ -835415,9 +835397,9 @@ function pollJobAndReportStatus({ job, taskId, taskHandler, context: context3 })
835415
835397
  init_lib4();
835416
835398
  init_lib6();
835417
835399
  var import_fs26 = require("fs");
835418
- var import_promises89 = require("fs/promises");
835400
+ var import_promises85 = require("fs/promises");
835419
835401
  var import_path57 = __toESM(require("path"), 1);
835420
- var import_promises90 = require("stream/promises");
835402
+ var import_promises86 = require("stream/promises");
835421
835403
 
835422
835404
  // ../../../node_modules/.pnpm/terminal-link@3.0.0/node_modules/terminal-link/index.js
835423
835405
  var import_supports_hyperlinks = __toESM(require_supports_hyperlinks(), 1);
@@ -835586,9 +835568,9 @@ async function downloadZipForTask({ s3PreSignedReadUrl, absolutePathToLocalOutpu
835586
835568
  });
835587
835569
  const tmpDir = await import_tmp_promise9.default.dir({ prefix: "fern", unsafeCleanup: true });
835588
835570
  const outputZipPath = import_path57.default.join(tmpDir.path, "output.zip");
835589
- await (0, import_promises90.pipeline)(request7.data, (0, import_fs26.createWriteStream)(outputZipPath));
835571
+ await (0, import_promises86.pipeline)(request7.data, (0, import_fs26.createWriteStream)(outputZipPath));
835590
835572
  await forceRemoveDirectory(absolutePathToLocalOutput);
835591
- await (0, import_promises89.mkdir)(absolutePathToLocalOutput, { recursive: true });
835573
+ await (0, import_promises85.mkdir)(absolutePathToLocalOutput, { recursive: true });
835592
835574
  await extractZipToDirectory(outputZipPath, absolutePathToLocalOutput);
835593
835575
  }
835594
835576
  async function forceRemoveDirectory(dirPath) {
@@ -835596,22 +835578,22 @@ async function forceRemoveDirectory(dirPath) {
835596
835578
  return;
835597
835579
  }
835598
835580
  await makeWritableRecursive(dirPath);
835599
- await (0, import_promises89.rm)(dirPath, { recursive: true, force: true });
835581
+ await (0, import_promises85.rm)(dirPath, { recursive: true, force: true });
835600
835582
  }
835601
835583
  async function makeWritableRecursive(dirPath) {
835602
835584
  try {
835603
- const entries21 = await (0, import_promises89.readdir)(dirPath, { withFileTypes: true });
835585
+ const entries21 = await (0, import_promises85.readdir)(dirPath, { withFileTypes: true });
835604
835586
  for (const entry of entries21) {
835605
835587
  const fullPath = AbsoluteFilePath2.of(import_path57.default.join(dirPath, entry.name));
835606
835588
  if (entry.isDirectory()) {
835607
835589
  await makeWritableRecursive(fullPath);
835608
835590
  }
835609
835591
  try {
835610
- await (0, import_promises89.chmod)(fullPath, 493);
835592
+ await (0, import_promises85.chmod)(fullPath, 493);
835611
835593
  } catch {
835612
835594
  }
835613
835595
  }
835614
- await (0, import_promises89.chmod)(dirPath, 493);
835596
+ await (0, import_promises85.chmod)(dirPath, 493);
835615
835597
  } catch {
835616
835598
  }
835617
835599
  }
@@ -835657,7 +835639,7 @@ async function downloadFilesWithFernIgnoreInTempRepo({ s3PreSignedReadUrl, absol
835657
835639
  const tmpOutputResolutionDir = AbsoluteFilePath2.of((await import_tmp_promise9.default.dir({})).path);
835658
835640
  const absolutePathToFernignore = join2(absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME));
835659
835641
  const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
835660
- await (0, import_promises89.cp)(absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
835642
+ await (0, import_promises85.cp)(absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
835661
835643
  await runGitCommand(["init"], tmpOutputResolutionDir, context3);
835662
835644
  await runGitCommand(["add", "."], tmpOutputResolutionDir, context3);
835663
835645
  await runGitCommand([
@@ -835680,7 +835662,7 @@ async function downloadFilesWithFernIgnoreInTempRepo({ s3PreSignedReadUrl, absol
835680
835662
  await runGitCommand(["restore", "."], tmpOutputResolutionDir, context3);
835681
835663
  await forceRemoveDirectory(join2(tmpOutputResolutionDir, RelativeFilePath2.of(".git")));
835682
835664
  await forceRemoveDirectory(absolutePathToLocalOutput);
835683
- await (0, import_promises89.cp)(tmpOutputResolutionDir, absolutePathToLocalOutput, { recursive: true });
835665
+ await (0, import_promises85.cp)(tmpOutputResolutionDir, absolutePathToLocalOutput, { recursive: true });
835684
835666
  }
835685
835667
  async function downloadAndExtractZipToDirectory({ s3PreSignedReadUrl, outputPath }) {
835686
835668
  const request7 = await axios_default.get(s3PreSignedReadUrl, {
@@ -835688,7 +835670,7 @@ async function downloadAndExtractZipToDirectory({ s3PreSignedReadUrl, outputPath
835688
835670
  });
835689
835671
  const tmpDir = await import_tmp_promise9.default.dir({ prefix: "fern", unsafeCleanup: true });
835690
835672
  const outputZipPath = import_path57.default.join(tmpDir.path, "output.zip");
835691
- await (0, import_promises90.pipeline)(request7.data, (0, import_fs26.createWriteStream)(outputZipPath));
835673
+ await (0, import_promises86.pipeline)(request7.data, (0, import_fs26.createWriteStream)(outputZipPath));
835692
835674
  await extractZipToDirectory(outputZipPath, outputPath);
835693
835675
  }
835694
835676
  async function extractZipToDirectory(zipPath, outputDir) {
@@ -835703,10 +835685,10 @@ async function extractZipToDirectory(zipPath, outputDir) {
835703
835685
  zipFile.on("entry", (entry) => {
835704
835686
  const outputPath = import_path57.default.join(outputDir, entry.fileName);
835705
835687
  if (entry.fileName.endsWith("/")) {
835706
- (0, import_promises89.mkdir)(outputPath, { recursive: true }).then(() => zipFile.readEntry()).catch(reject);
835688
+ (0, import_promises85.mkdir)(outputPath, { recursive: true }).then(() => zipFile.readEntry()).catch(reject);
835707
835689
  return;
835708
835690
  }
835709
- (0, import_promises89.mkdir)(import_path57.default.dirname(outputPath), { recursive: true }).then(() => {
835691
+ (0, import_promises85.mkdir)(import_path57.default.dirname(outputPath), { recursive: true }).then(() => {
835710
835692
  zipFile.openReadStream(entry, (streamErr, readStream2) => {
835711
835693
  if (streamErr || !readStream2) {
835712
835694
  reject(streamErr ?? new Error("Failed to open read stream"));
@@ -835723,7 +835705,7 @@ async function extractZipToDirectory(zipPath, outputDir) {
835723
835705
 
835724
835706
  // ../generation/remote-generation/remote-workspace-runner/lib/SourceUploader.js
835725
835707
  init_lib6();
835726
- var import_promises91 = require("fs/promises");
835708
+ var import_promises87 = require("fs/promises");
835727
835709
  var import_tmp_promise10 = __toESM(require_tmp_promise(), 1);
835728
835710
  var PROTOBUF_ZIP_FILENAME = "proto.zip";
835729
835711
  var SourceUploader = class {
@@ -835744,7 +835726,7 @@ var SourceUploader = class {
835744
835726
  }
835745
835727
  async uploadSource(source2, uploadURL) {
835746
835728
  const uploadCommand = await this.getUploadCommand(source2);
835747
- const fileData = await (0, import_promises91.readFile)(uploadCommand.absoluteFilePath);
835729
+ const fileData = await (0, import_promises87.readFile)(uploadCommand.absoluteFilePath);
835748
835730
  const response = await fetch(uploadURL, {
835749
835731
  method: "PUT",
835750
835732
  body: fileData,
@@ -835764,7 +835746,7 @@ var SourceUploader = class {
835764
835746
  absoluteFilePath,
835765
835747
  cleanup: async () => {
835766
835748
  this.context.logger.debug(`Removing ${absoluteFilePath}`);
835767
- await (0, import_promises91.unlink)(absoluteFilePath);
835749
+ await (0, import_promises87.unlink)(absoluteFilePath);
835768
835750
  }
835769
835751
  };
835770
835752
  }
@@ -836206,7 +836188,7 @@ init_lib4();
836206
836188
  init_js();
836207
836189
  init_lib6();
836208
836190
  var import_crypto10 = require("crypto");
836209
- var import_promises92 = require("fs/promises");
836191
+ var import_promises88 = require("fs/promises");
836210
836192
  init_lodash();
836211
836193
  var mime = __toESM(require_mime_types(), 1);
836212
836194
 
@@ -836285,7 +836267,7 @@ async function unlockDeploy({ fdrOrigin, token, domain: domain3, basepath }) {
836285
836267
  }
836286
836268
  }
836287
836269
  async function calculateFileHash(absoluteFilePath) {
836288
- const fileBuffer = await (0, import_promises92.readFile)(absoluteFilePath);
836270
+ const fileBuffer = await (0, import_promises88.readFile)(absoluteFilePath);
836289
836271
  return (0, import_crypto10.createHash)("sha256").update(new Uint8Array(fileBuffer)).digest("hex");
836290
836272
  }
836291
836273
  function sanitizeRelativePathForS3(relativeFilePath) {
@@ -836631,7 +836613,7 @@ async function uploadFiles(filesToUpload, docsWorkspacePath, context3, batchSize
836631
836613
  const absoluteFilePath = sanitizedToAbsoluteMap.get(key2) || resolve5(docsWorkspacePath, RelativeFilePath2.of(key2));
836632
836614
  try {
836633
836615
  const mimeType = mime.lookup(absoluteFilePath);
836634
- await axios_default.put(uploadUrl, await (0, import_promises92.readFile)(absoluteFilePath), {
836616
+ await axios_default.put(uploadUrl, await (0, import_promises88.readFile)(absoluteFilePath), {
836635
836617
  headers: {
836636
836618
  "Content-Type": mimeType === false ? "application/octet-stream" : mimeType,
836637
836619
  // Set max cache control for S3 uploads
@@ -837210,7 +837192,7 @@ var LegacyDocsPublisher = class {
837210
837192
  previewId: void 0,
837211
837193
  disableTemplates: void 0,
837212
837194
  skipUpload,
837213
- cliVersion: "4.50.3"
837195
+ cliVersion: "4.50.4-1-g8a6fed15293"
837214
837196
  });
837215
837197
  if (taskContext.getResult() === TaskResult.Failure) {
837216
837198
  return { success: false };
@@ -838086,7 +838068,7 @@ function addDocsCommand(cli) {
838086
838068
  // ../cli-v2/lib/commands/init/command.js
838087
838069
  init_lib4();
838088
838070
  init_lib6();
838089
- var import_promises93 = require("fs/promises");
838071
+ var import_promises89 = require("fs/promises");
838090
838072
  var import_path59 = __toESM(require("path"), 1);
838091
838073
 
838092
838074
  // ../cli-v2/lib/config/fern-yml/FernYmlBuilder.js
@@ -838961,7 +838943,7 @@ var InitCommand = class {
838961
838943
  apiPath,
838962
838944
  defaultGroup: result.defaultGroup
838963
838945
  });
838964
- await (0, import_promises93.writeFile)(fernYmlPath, fernYmlContent, "utf-8");
838946
+ await (0, import_promises89.writeFile)(fernYmlPath, fernYmlContent, "utf-8");
838965
838947
  context3.stderr.info(`
838966
838948
  ${Icons.success} Created ${FERN_YML_FILENAME}`);
838967
838949
  }
@@ -838983,9 +838965,9 @@ var InitCommand = class {
838983
838965
  }
838984
838966
  async writeSpecFile(cwd2, filename, content5) {
838985
838967
  const specsDir = join2(cwd2, RelativeFilePath2.of(SPECS_DIR));
838986
- await (0, import_promises93.mkdir)(specsDir, { recursive: true });
838968
+ await (0, import_promises89.mkdir)(specsDir, { recursive: true });
838987
838969
  const filePath = join2(specsDir, RelativeFilePath2.of(filename));
838988
- await (0, import_promises93.writeFile)(filePath, content5, "utf-8");
838970
+ await (0, import_promises89.writeFile)(filePath, content5, "utf-8");
838989
838971
  }
838990
838972
  resolveApiPath(apiSource) {
838991
838973
  switch (apiSource.type) {
@@ -839465,11 +839447,11 @@ function addCheckCommand4(cli) {
839465
839447
  // ../cli-v2/lib/commands/sdk/generate/command.js
839466
839448
  init_lib4();
839467
839449
  init_lib6();
839468
- var import_promises111 = require("fs/promises");
839450
+ var import_promises107 = require("fs/promises");
839469
839451
 
839470
839452
  // ../cli-v2/lib/api/resolver/ApiSpecResolver.js
839471
839453
  init_lib6();
839472
- var import_promises94 = require("fs/promises");
839454
+ var import_promises90 = require("fs/promises");
839473
839455
  var import_os11 = require("os");
839474
839456
  var import_path60 = __toESM(require("path"), 1);
839475
839457
 
@@ -839517,9 +839499,9 @@ var ApiSpecResolver = class {
839517
839499
  async resolveUrl({ reference: reference4 }) {
839518
839500
  const { content: content5, contentType } = await this.fetchContent({ url: reference4 });
839519
839501
  const extension5 = this.inferExtension({ url: reference4, contentType });
839520
- const tempDir2 = await (0, import_promises94.mkdtemp)(import_path60.default.join((0, import_os11.tmpdir)(), "fern-"));
839502
+ const tempDir2 = await (0, import_promises90.mkdtemp)(import_path60.default.join((0, import_os11.tmpdir)(), "fern-"));
839521
839503
  const absoluteFilePath = AbsoluteFilePath2.of(import_path60.default.join(tempDir2, `spec${extension5}`));
839522
- await (0, import_promises94.writeFile)(absoluteFilePath, content5, "utf-8");
839504
+ await (0, import_promises90.writeFile)(absoluteFilePath, content5, "utf-8");
839523
839505
  const specType = await this.detector.detect({ absoluteFilePath, content: content5, reference: reference4 });
839524
839506
  return {
839525
839507
  absoluteFilePath,
@@ -839532,7 +839514,7 @@ var ApiSpecResolver = class {
839532
839514
  if (!await doesPathExist(absoluteFilePath)) {
839533
839515
  throw new Error(`API spec file does not exist: ${reference4}`);
839534
839516
  }
839535
- const content5 = await (0, import_promises94.readFile)(absoluteFilePath, "utf-8");
839517
+ const content5 = await (0, import_promises90.readFile)(absoluteFilePath, "utf-8");
839536
839518
  const specType = await this.detector.detect({ absoluteFilePath, content: content5, reference: reference4 });
839537
839519
  return {
839538
839520
  absoluteFilePath,
@@ -839619,7 +839601,7 @@ var AutoVersioningCache = class {
839619
839601
 
839620
839602
  // ../generation/local-generation/local-workspace-runner/lib/AutoVersioningService.js
839621
839603
  var import_fs27 = require("fs");
839622
- var import_promises95 = require("fs/promises");
839604
+ var import_promises91 = require("fs/promises");
839623
839605
  var import_path61 = require("path");
839624
839606
  var AutoVersioningException = class extends Error {
839625
839607
  constructor(message, cause) {
@@ -840274,7 +840256,7 @@ var AutoVersioningService = class _AutoVersioningService {
840274
840256
  * Reads the module path from a go.mod file.
840275
840257
  */
840276
840258
  async readGoModulePath(goModPath) {
840277
- const content5 = await (0, import_promises95.readFile)(goModPath, "utf-8");
840259
+ const content5 = await (0, import_promises91.readFile)(goModPath, "utf-8");
840278
840260
  for (const line of content5.split("\n")) {
840279
840261
  const trimmed2 = line.trim();
840280
840262
  if (trimmed2.startsWith("module ")) {
@@ -840287,7 +840269,7 @@ var AutoVersioningService = class _AutoVersioningService {
840287
840269
  * Adds a version suffix to the module line in go.mod.
840288
840270
  */
840289
840271
  async addSuffixToGoMod(goModPath, modulePath, suffix) {
840290
- const content5 = await (0, import_promises95.readFile)(goModPath, "utf-8");
840272
+ const content5 = await (0, import_promises91.readFile)(goModPath, "utf-8");
840291
840273
  const lines = content5.split("\n");
840292
840274
  let changed = false;
840293
840275
  for (let i11 = 0; i11 < lines.length; i11++) {
@@ -840299,7 +840281,7 @@ var AutoVersioningService = class _AutoVersioningService {
840299
840281
  }
840300
840282
  }
840301
840283
  if (changed) {
840302
- await (0, import_promises95.writeFile)(goModPath, lines.join("\n"), "utf-8");
840284
+ await (0, import_promises91.writeFile)(goModPath, lines.join("\n"), "utf-8");
840303
840285
  this.logger.debug(`Updated go.mod: added ${suffix} to module path`);
840304
840286
  }
840305
840287
  }
@@ -840308,10 +840290,10 @@ var AutoVersioningService = class _AutoVersioningService {
840308
840290
  */
840309
840291
  async walkDirectory(dir, filter8) {
840310
840292
  const results = [];
840311
- const entries21 = await (0, import_promises95.readdir)(dir);
840293
+ const entries21 = await (0, import_promises91.readdir)(dir);
840312
840294
  for (const entry of entries21) {
840313
840295
  const fullPath = (0, import_path61.join)(dir, entry);
840314
- const entryStat = await (0, import_promises95.stat)(fullPath);
840296
+ const entryStat = await (0, import_promises91.stat)(fullPath);
840315
840297
  if (entryStat.isDirectory()) {
840316
840298
  if (entry === ".git" || entry === "vendor") {
840317
840299
  continue;
@@ -840338,7 +840320,7 @@ var AutoVersioningService = class _AutoVersioningService {
840338
840320
  * Replaces occurrences of the module path with modulePath + suffix in import statements.
840339
840321
  */
840340
840322
  async addSuffixToGoFile(filePath, modulePath, suffix) {
840341
- const content5 = await (0, import_promises95.readFile)(filePath, "utf-8");
840323
+ const content5 = await (0, import_promises91.readFile)(filePath, "utf-8");
840342
840324
  const lines = content5.split("\n");
840343
840325
  let changed = false;
840344
840326
  let inImportBlock = false;
@@ -840367,7 +840349,7 @@ var AutoVersioningService = class _AutoVersioningService {
840367
840349
  }
840368
840350
  }
840369
840351
  if (changed) {
840370
- await (0, import_promises95.writeFile)(filePath, lines.join("\n"), "utf-8");
840352
+ await (0, import_promises91.writeFile)(filePath, lines.join("\n"), "utf-8");
840371
840353
  this.logger.debug(`Updated Go imports in ${filePath}`);
840372
840354
  }
840373
840355
  }
@@ -840420,7 +840402,7 @@ var AutoVersioningService = class _AutoVersioningService {
840420
840402
  };
840421
840403
 
840422
840404
  // ../generation/local-generation/docker-utils/lib/runDocker.js
840423
- var import_promises96 = require("fs/promises");
840405
+ var import_promises92 = require("fs/promises");
840424
840406
  var import_tmp_promise11 = __toESM(require_tmp_promise(), 1);
840425
840407
  async function runContainer({ logger: logger4, imageName, args = [], binds = [], envVars = {}, ports = {}, writeLogsToFile = true, removeAfterCompletion = false, runner, signal }) {
840426
840408
  const tryRun = () => tryRunContainer({
@@ -840471,7 +840453,7 @@ async function tryRunContainer({ logger: logger4, imageName, args, binds, envVar
840471
840453
  const logs4 = stdout + stderr;
840472
840454
  if (writeLogsToFile) {
840473
840455
  const tmpFile = await import_tmp_promise11.default.file();
840474
- await (0, import_promises96.writeFile)(tmpFile.path, logs4);
840456
+ await (0, import_promises92.writeFile)(tmpFile.path, logs4);
840475
840457
  logger4.info(`Generator logs here: ${tmpFile.path}`);
840476
840458
  }
840477
840459
  if (exitCode == null) {
@@ -858696,7 +858678,7 @@ var DynamicSnippetsGenerator = class extends AbstractDynamicSnippetsGenerator {
858696
858678
 
858697
858679
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/csharp/DynamicSnippetsCsharpTestGenerator.js
858698
858680
  init_lib6();
858699
- var import_promises97 = require("fs/promises");
858681
+ var import_promises93 = require("fs/promises");
858700
858682
  var import_path63 = __toESM(require("path"), 1);
858701
858683
 
858702
858684
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/utils/convertEndpointSnippetRequest.js
@@ -858830,8 +858812,8 @@ var DynamicSnippetsCsharpTestGenerator = class {
858830
858812
  endpointId
858831
858813
  });
858832
858814
  const dynamicSnippetFilePath = this.getTestFilePath({ absolutePathToOutputDir, idx });
858833
- await (0, import_promises97.mkdir)(import_path63.default.dirname(dynamicSnippetFilePath), { recursive: true });
858834
- await (0, import_promises97.writeFile)(dynamicSnippetFilePath, response.snippet);
858815
+ await (0, import_promises93.mkdir)(import_path63.default.dirname(dynamicSnippetFilePath), { recursive: true });
858816
+ await (0, import_promises93.writeFile)(dynamicSnippetFilePath, response.snippet);
858835
858817
  } catch (error50) {
858836
858818
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
858837
858819
  }
@@ -858840,8 +858822,8 @@ var DynamicSnippetsCsharpTestGenerator = class {
858840
858822
  }
858841
858823
  async initializeProject(outputDir) {
858842
858824
  const absolutePathToOutputDir = join2(outputDir, RelativeFilePath2.of("src/SeedApi.DynamicSnippets"));
858843
- await (0, import_promises97.mkdir)(absolutePathToOutputDir, { recursive: true });
858844
- await (0, import_promises97.writeFile)(join2(absolutePathToOutputDir, RelativeFilePath2.of("SeedApi.DynamicSnippets.csproj")), PROJECT_FILE_CONTENT);
858825
+ await (0, import_promises93.mkdir)(absolutePathToOutputDir, { recursive: true });
858826
+ await (0, import_promises93.writeFile)(join2(absolutePathToOutputDir, RelativeFilePath2.of("SeedApi.DynamicSnippets.csproj")), PROJECT_FILE_CONTENT);
858845
858827
  return absolutePathToOutputDir;
858846
858828
  }
858847
858829
  getTestFilePath({ absolutePathToOutputDir, idx }) {
@@ -862237,7 +862219,7 @@ var DynamicSnippetsGenerator2 = class extends AbstractDynamicSnippetsGenerator {
862237
862219
  };
862238
862220
 
862239
862221
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/go/DynamicSnippetsGoTestGenerator.js
862240
- var import_promises98 = require("fs/promises");
862222
+ var import_promises94 = require("fs/promises");
862241
862223
  var import_path65 = __toESM(require("path"), 1);
862242
862224
  var DynamicSnippetsGoTestGenerator = class {
862243
862225
  context;
@@ -862266,8 +862248,8 @@ var DynamicSnippetsGoTestGenerator = class {
862266
862248
  endpointId
862267
862249
  });
862268
862250
  const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
862269
- await (0, import_promises98.mkdir)(import_path65.default.dirname(dynamicSnippetFilePath), { recursive: true });
862270
- await (0, import_promises98.writeFile)(dynamicSnippetFilePath, response.snippet);
862251
+ await (0, import_promises94.mkdir)(import_path65.default.dirname(dynamicSnippetFilePath), { recursive: true });
862252
+ await (0, import_promises94.writeFile)(dynamicSnippetFilePath, response.snippet);
862271
862253
  } catch (error50) {
862272
862254
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
862273
862255
  if (error50 instanceof Error && error50.stack) {
@@ -865635,7 +865617,7 @@ var DynamicSnippetsGenerator3 = class extends AbstractDynamicSnippetsGenerator {
865635
865617
  };
865636
865618
 
865637
865619
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/java/DynamicSnippetsJavaTestGenerator.js
865638
- var import_promises99 = require("fs/promises");
865620
+ var import_promises95 = require("fs/promises");
865639
865621
  var import_path66 = __toESM(require("path"), 1);
865640
865622
  var DynamicSnippetsJavaTestGenerator = class {
865641
865623
  context;
@@ -865670,8 +865652,8 @@ var DynamicSnippetsJavaTestGenerator = class {
865670
865652
  endpointId
865671
865653
  });
865672
865654
  const dynamicSnippetFilePath = this.getTestFilePath({ absolutePathToOutputDir, idx });
865673
- await (0, import_promises99.mkdir)(import_path66.default.dirname(dynamicSnippetFilePath), { recursive: true });
865674
- await (0, import_promises99.writeFile)(dynamicSnippetFilePath, response.snippet);
865655
+ await (0, import_promises95.mkdir)(import_path66.default.dirname(dynamicSnippetFilePath), { recursive: true });
865656
+ await (0, import_promises95.writeFile)(dynamicSnippetFilePath, response.snippet);
865675
865657
  } catch (error50) {
865676
865658
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
865677
865659
  }
@@ -865698,7 +865680,7 @@ var DynamicSnippetsJavaTestGenerator = class {
865698
865680
  const reportsPath = join2(outputDir, RelativeFilePath2.of("reports"));
865699
865681
  const buildReportsExists = await doesPathExist(buildReportsPath, "directory");
865700
865682
  if (buildReportsExists) {
865701
- await (0, import_promises99.cp)(buildReportsPath, reportsPath, { recursive: true });
865683
+ await (0, import_promises95.cp)(buildReportsPath, reportsPath, { recursive: true });
865702
865684
  this.context.logger.info("Gradle profiling report copied to reports/");
865703
865685
  } else {
865704
865686
  this.context.logger.info("No profiling report found in build/reports/");
@@ -865712,7 +865694,7 @@ var DynamicSnippetsJavaTestGenerator = class {
865712
865694
  }
865713
865695
  async initializeProject(outputDir) {
865714
865696
  const absolutePathToOutputDir = join2(outputDir, RelativeFilePath2.of("src/main/java/com/snippets"));
865715
- await (0, import_promises99.mkdir)(absolutePathToOutputDir, { recursive: true });
865697
+ await (0, import_promises95.mkdir)(absolutePathToOutputDir, { recursive: true });
865716
865698
  return absolutePathToOutputDir;
865717
865699
  }
865718
865700
  getTestFilePath({ absolutePathToOutputDir, idx }) {
@@ -869091,7 +869073,7 @@ var DynamicSnippetsGenerator4 = class extends AbstractDynamicSnippetsGenerator {
869091
869073
  };
869092
869074
 
869093
869075
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/php/DynamicSnippetsPhpTestGenerator.js
869094
- var import_promises100 = require("fs/promises");
869076
+ var import_promises96 = require("fs/promises");
869095
869077
  var import_path67 = __toESM(require("path"), 1);
869096
869078
  var DynamicSnippetsPhpTestGenerator = class {
869097
869079
  context;
@@ -869120,8 +869102,8 @@ var DynamicSnippetsPhpTestGenerator = class {
869120
869102
  endpointId
869121
869103
  });
869122
869104
  const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
869123
- await (0, import_promises100.mkdir)(import_path67.default.dirname(dynamicSnippetFilePath), { recursive: true });
869124
- await (0, import_promises100.writeFile)(dynamicSnippetFilePath, response.snippet);
869105
+ await (0, import_promises96.mkdir)(import_path67.default.dirname(dynamicSnippetFilePath), { recursive: true });
869106
+ await (0, import_promises96.writeFile)(dynamicSnippetFilePath, response.snippet);
869125
869107
  } catch (error50) {
869126
869108
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
869127
869109
  }
@@ -872289,7 +872271,7 @@ var DynamicSnippetsGenerator5 = class extends AbstractDynamicSnippetsGenerator {
872289
872271
  };
872290
872272
 
872291
872273
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/python/DynamicSnippetsPythonTestGenerator.js
872292
- var import_promises101 = require("fs/promises");
872274
+ var import_promises97 = require("fs/promises");
872293
872275
  var import_path68 = __toESM(require("path"), 1);
872294
872276
  var DynamicSnippetsPythonTestGenerator = class {
872295
872277
  context;
@@ -872318,8 +872300,8 @@ var DynamicSnippetsPythonTestGenerator = class {
872318
872300
  endpointId
872319
872301
  });
872320
872302
  const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
872321
- await (0, import_promises101.mkdir)(import_path68.default.dirname(dynamicSnippetFilePath), { recursive: true });
872322
- await (0, import_promises101.writeFile)(dynamicSnippetFilePath, response.snippet);
872303
+ await (0, import_promises97.mkdir)(import_path68.default.dirname(dynamicSnippetFilePath), { recursive: true });
872304
+ await (0, import_promises97.writeFile)(dynamicSnippetFilePath, response.snippet);
872323
872305
  } catch (error50) {
872324
872306
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
872325
872307
  }
@@ -874916,7 +874898,7 @@ var DynamicSnippetsGenerator6 = class extends AbstractDynamicSnippetsGenerator {
874916
874898
  };
874917
874899
 
874918
874900
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/ruby/DynamicSnippetsRubyTestGenerator.js
874919
- var import_promises102 = require("fs/promises");
874901
+ var import_promises98 = require("fs/promises");
874920
874902
  var import_path69 = __toESM(require("path"), 1);
874921
874903
  var DynamicSnippetsRubyTestGenerator = class {
874922
874904
  context;
@@ -874945,8 +874927,8 @@ var DynamicSnippetsRubyTestGenerator = class {
874945
874927
  endpointId
874946
874928
  });
874947
874929
  const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
874948
- await (0, import_promises102.mkdir)(import_path69.default.dirname(dynamicSnippetFilePath), { recursive: true });
874949
- await (0, import_promises102.writeFile)(dynamicSnippetFilePath, response.snippet);
874930
+ await (0, import_promises98.mkdir)(import_path69.default.dirname(dynamicSnippetFilePath), { recursive: true });
874931
+ await (0, import_promises98.writeFile)(dynamicSnippetFilePath, response.snippet);
874950
874932
  } catch (error50) {
874951
874933
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
874952
874934
  if (error50 instanceof Error && error50.stack) {
@@ -874962,7 +874944,7 @@ var DynamicSnippetsRubyTestGenerator = class {
874962
874944
  };
874963
874945
 
874964
874946
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/rust/DynamicSnippetsRustTestGenerator.js
874965
- var import_promises103 = require("fs/promises");
874947
+ var import_promises99 = require("fs/promises");
874966
874948
  var import_node_path24 = __toESM(require("path"), 1);
874967
874949
  init_lib6();
874968
874950
 
@@ -880170,8 +880152,8 @@ var DynamicSnippetsRustTestGenerator = class {
880170
880152
  absolutePathToOutputDir,
880171
880153
  idx
880172
880154
  });
880173
- await (0, import_promises103.mkdir)(import_node_path24.default.dirname(dynamicSnippetFilePath), { recursive: true });
880174
- await (0, import_promises103.writeFile)(dynamicSnippetFilePath, response.snippet);
880155
+ await (0, import_promises99.mkdir)(import_node_path24.default.dirname(dynamicSnippetFilePath), { recursive: true });
880156
+ await (0, import_promises99.writeFile)(dynamicSnippetFilePath, response.snippet);
880175
880157
  } catch (error50) {
880176
880158
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
880177
880159
  }
@@ -880180,7 +880162,7 @@ var DynamicSnippetsRustTestGenerator = class {
880180
880162
  }
880181
880163
  async initializeProject(outputDir) {
880182
880164
  const absolutePathToOutputDir = join2(outputDir, RelativeFilePath2.of("dynamic-snippets"));
880183
- await (0, import_promises103.mkdir)(absolutePathToOutputDir, { recursive: true });
880165
+ await (0, import_promises99.mkdir)(absolutePathToOutputDir, { recursive: true });
880184
880166
  return absolutePathToOutputDir;
880185
880167
  }
880186
880168
  getTestFilePath({ absolutePathToOutputDir, idx }) {
@@ -880189,7 +880171,7 @@ var DynamicSnippetsRustTestGenerator = class {
880189
880171
  };
880190
880172
 
880191
880173
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/swift/DynamicSnippetsSwiftTestGenerator.js
880192
- var import_promises104 = require("fs/promises");
880174
+ var import_promises100 = require("fs/promises");
880193
880175
  var import_node_path25 = __toESM(require("path"), 1);
880194
880176
  init_lib6();
880195
880177
 
@@ -884674,8 +884656,8 @@ var DynamicSnippetsSwiftTestGenerator = class {
884674
884656
  absolutePathToOutputDir,
884675
884657
  idx
884676
884658
  });
884677
- await (0, import_promises104.mkdir)(import_node_path25.default.dirname(dynamicSnippetFilePath), { recursive: true });
884678
- await (0, import_promises104.writeFile)(dynamicSnippetFilePath, response.snippet);
884659
+ await (0, import_promises100.mkdir)(import_node_path25.default.dirname(dynamicSnippetFilePath), { recursive: true });
884660
+ await (0, import_promises100.writeFile)(dynamicSnippetFilePath, response.snippet);
884679
884661
  } catch (error50) {
884680
884662
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
884681
884663
  }
@@ -884684,7 +884666,7 @@ var DynamicSnippetsSwiftTestGenerator = class {
884684
884666
  }
884685
884667
  async initializeProject(outputDir) {
884686
884668
  const absolutePathToOutputDir = join2(outputDir, RelativeFilePath2.of("Snippets"));
884687
- await (0, import_promises104.mkdir)(absolutePathToOutputDir, { recursive: true });
884669
+ await (0, import_promises100.mkdir)(absolutePathToOutputDir, { recursive: true });
884688
884670
  return absolutePathToOutputDir;
884689
884671
  }
884690
884672
  getTestFilePath({ absolutePathToOutputDir, idx }) {
@@ -887009,7 +886991,7 @@ var DynamicSnippetsGenerator9 = class extends AbstractDynamicSnippetsGenerator {
887009
886991
  };
887010
886992
 
887011
886993
  // ../generation/local-generation/local-workspace-runner/lib/dynamic-snippets/typescript/DynamicSnippetsTypeScriptTestGenerator.js
887012
- var import_promises105 = require("fs/promises");
886994
+ var import_promises101 = require("fs/promises");
887013
886995
  var import_path70 = __toESM(require("path"), 1);
887014
886996
  var DynamicSnippetsTypeScriptTestGenerator = class {
887015
886997
  context;
@@ -887038,8 +887020,8 @@ var DynamicSnippetsTypeScriptTestGenerator = class {
887038
887020
  endpointId
887039
887021
  });
887040
887022
  const dynamicSnippetFilePath = this.getTestFilePath({ outputDir, idx });
887041
- await (0, import_promises105.mkdir)(import_path70.default.dirname(dynamicSnippetFilePath), { recursive: true });
887042
- await (0, import_promises105.writeFile)(dynamicSnippetFilePath, response.snippet);
887023
+ await (0, import_promises101.mkdir)(import_path70.default.dirname(dynamicSnippetFilePath), { recursive: true });
887024
+ await (0, import_promises101.writeFile)(dynamicSnippetFilePath, response.snippet);
887043
887025
  } catch (error50) {
887044
887026
  this.context.logger.error(`Failed to generate dynamic snippet for endpoint ${JSON.stringify(request7.endpoint)}: ${error50}`);
887045
887027
  }
@@ -887138,7 +887120,7 @@ async function generateDynamicSnippetTests({ context: context3, ir: ir15, config
887138
887120
  // ../generation/local-generation/local-workspace-runner/lib/runGenerator.js
887139
887121
  init_lib6();
887140
887122
  var import_serialization = __toESM(require_serialization3(), 1);
887141
- var import_promises107 = require("fs/promises");
887123
+ var import_promises103 = require("fs/promises");
887142
887124
  var path70 = __toESM(require("path"), 1);
887143
887125
  var import_path72 = require("path");
887144
887126
  var import_tmp_promise13 = __toESM(require_tmp_promise(), 1);
@@ -887998,7 +887980,7 @@ function configureBamlClient(config5) {
887998
887980
  init_lib4();
887999
887981
  init_lib6();
888000
887982
  var import_decompress2 = __toESM(require_decompress(), 1);
888001
- var import_promises106 = require("fs/promises");
887983
+ var import_promises102 = require("fs/promises");
888002
887984
  var import_os12 = require("os");
888003
887985
  var import_path71 = require("path");
888004
887986
  var import_semver12 = __toESM(require_semver2(), 1);
@@ -888175,7 +888157,7 @@ var LocalTaskHandler = class {
888175
888157
  try {
888176
888158
  this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
888177
888159
  diffFile = await this.generateDiffFile();
888178
- const diffContent = await (0, import_promises106.readFile)(diffFile, "utf-8");
888160
+ const diffContent = await (0, import_promises102.readFile)(diffFile, "utf-8");
888179
888161
  if (diffContent.trim().length === 0) {
888180
888162
  this.context.logger.info("No changes detected in generated SDK");
888181
888163
  return null;
@@ -888336,7 +888318,7 @@ var LocalTaskHandler = class {
888336
888318
  } finally {
888337
888319
  if (diffFile) {
888338
888320
  try {
888339
- await (0, import_promises106.rm)(diffFile);
888321
+ await (0, import_promises102.rm)(diffFile);
888340
888322
  } catch (cleanupError) {
888341
888323
  this.context.logger.warn(`Failed to delete temp diff file: ${diffFile}`, String(cleanupError));
888342
888324
  }
@@ -888448,7 +888430,7 @@ var LocalTaskHandler = class {
888448
888430
  const absolutePathToFernignore = AbsoluteFilePath2.of(join2(this.absolutePathToLocalOutput, RelativeFilePath2.of(FERNIGNORE_FILENAME)));
888449
888431
  const fernIgnorePaths = await getFernIgnorePaths({ absolutePathToFernignore });
888450
888432
  const pathsToPreserve = await this.getPathsToPreserve(fernIgnorePaths);
888451
- await (0, import_promises106.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
888433
+ await (0, import_promises102.cp)(this.absolutePathToLocalOutput, tmpOutputResolutionDir, { recursive: true });
888452
888434
  await this.runGitCommand(["init"], tmpOutputResolutionDir);
888453
888435
  await this.runGitCommand(["add", "."], tmpOutputResolutionDir);
888454
888436
  await this.runGitCommand([
@@ -888470,17 +888452,17 @@ var LocalTaskHandler = class {
888470
888452
  await this.runGitCommand(["reset", "--", ...pathsToPreserve], tmpOutputResolutionDir);
888471
888453
  await this.runGitCommand(["clean", "-fd", "--", ...pathsToPreserve], tmpOutputResolutionDir);
888472
888454
  await this.runGitCommand(["restore", "."], tmpOutputResolutionDir);
888473
- await (0, import_promises106.rm)(join2(tmpOutputResolutionDir, RelativeFilePath2.of(".git")), { recursive: true });
888474
- await (0, import_promises106.rm)(this.absolutePathToLocalOutput, { recursive: true });
888475
- await (0, import_promises106.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
888455
+ await (0, import_promises102.rm)(join2(tmpOutputResolutionDir, RelativeFilePath2.of(".git")), { recursive: true });
888456
+ await (0, import_promises102.rm)(this.absolutePathToLocalOutput, { recursive: true });
888457
+ await (0, import_promises102.cp)(tmpOutputResolutionDir, this.absolutePathToLocalOutput, { recursive: true });
888476
888458
  }
888477
888459
  async copyGeneratedFilesNoFernIgnorePreservingGit() {
888478
- const contents = await (0, import_promises106.readdir)(this.absolutePathToLocalOutput);
888460
+ const contents = await (0, import_promises102.readdir)(this.absolutePathToLocalOutput);
888479
888461
  const itemsToPreserve = [".git"];
888480
888462
  if (await this.generatedOutputMissingReadme()) {
888481
888463
  itemsToPreserve.push("README.md");
888482
888464
  }
888483
- await Promise.all(contents.filter((item) => !itemsToPreserve.includes(item)).map((item) => (0, import_promises106.rm)(join2(this.absolutePathToLocalOutput, RelativeFilePath2.of(item)), {
888465
+ await Promise.all(contents.filter((item) => !itemsToPreserve.includes(item)).map((item) => (0, import_promises102.rm)(join2(this.absolutePathToLocalOutput, RelativeFilePath2.of(item)), {
888484
888466
  force: true,
888485
888467
  recursive: true
888486
888468
  })));
@@ -888488,11 +888470,11 @@ var LocalTaskHandler = class {
888488
888470
  }
888489
888471
  async copyGeneratedFilesNoFernIgnoreDeleteAll() {
888490
888472
  this.context.logger.debug(`rm -rf ${this.absolutePathToLocalOutput}`);
888491
- await (0, import_promises106.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
888473
+ await (0, import_promises102.rm)(this.absolutePathToLocalOutput, { force: true, recursive: true });
888492
888474
  await this.copyGeneratedFilesToDirectory(this.absolutePathToLocalOutput);
888493
888475
  }
888494
888476
  async copyGeneratedFilesToDirectory(outputPath) {
888495
- const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises106.readdir)(this.absolutePathToTmpOutputDirectory);
888477
+ const [firstLocalOutputItem, ...remaininglocalOutputItems] = await (0, import_promises102.readdir)(this.absolutePathToTmpOutputDirectory);
888496
888478
  if (firstLocalOutputItem == null) {
888497
888479
  return;
888498
888480
  }
@@ -888500,15 +888482,15 @@ var LocalTaskHandler = class {
888500
888482
  if (firstLocalOutputItem.endsWith(".zip")) {
888501
888483
  await (0, import_decompress2.default)(join2(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(firstLocalOutputItem)), outputPath);
888502
888484
  for (const localOutputItem of remaininglocalOutputItems) {
888503
- await (0, import_promises106.cp)(join2(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(localOutputItem)), join2(outputPath, RelativeFilePath2.of(localOutputItem)), { recursive: true });
888485
+ await (0, import_promises102.cp)(join2(this.absolutePathToTmpOutputDirectory, RelativeFilePath2.of(localOutputItem)), join2(outputPath, RelativeFilePath2.of(localOutputItem)), { recursive: true });
888504
888486
  }
888505
888487
  } else {
888506
- await (0, import_promises106.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
888488
+ await (0, import_promises102.cp)(this.absolutePathToTmpOutputDirectory, outputPath, { recursive: true });
888507
888489
  }
888508
888490
  }
888509
888491
  async copySnippetJSON({ absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON }) {
888510
888492
  this.context.logger.debug(`Copying generated snippets to ${absolutePathToLocalSnippetJSON}`);
888511
- await (0, import_promises106.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
888493
+ await (0, import_promises102.cp)(absolutePathToTmpSnippetJSON, absolutePathToLocalSnippetJSON);
888512
888494
  }
888513
888495
  /**
888514
888496
  * Checks whether the generated output is missing README.md.
@@ -888517,7 +888499,7 @@ var LocalTaskHandler = class {
888517
888499
  */
888518
888500
  async generatedOutputMissingReadme() {
888519
888501
  try {
888520
- const contents = await (0, import_promises106.readdir)(this.absolutePathToTmpOutputDirectory);
888502
+ const contents = await (0, import_promises102.readdir)(this.absolutePathToTmpOutputDirectory);
888521
888503
  if (contents.length === 1 && contents[0] != null && contents[0].endsWith(".zip")) {
888522
888504
  return false;
888523
888505
  }
@@ -888553,13 +888535,13 @@ var LocalTaskHandler = class {
888553
888535
  async readPriorChangelog(maxEntries) {
888554
888536
  const MAX_CHANGELOG_SIZE = 2048;
888555
888537
  try {
888556
- const files = await (0, import_promises106.readdir)(this.absolutePathToLocalOutput);
888538
+ const files = await (0, import_promises102.readdir)(this.absolutePathToLocalOutput);
888557
888539
  const changelogFile = files.find((f10) => f10.toLowerCase() === "changelog.md");
888558
888540
  if (!changelogFile) {
888559
888541
  return "";
888560
888542
  }
888561
888543
  const changelogPath = join2(this.absolutePathToLocalOutput, RelativeFilePath2.of(changelogFile));
888562
- const content5 = await (0, import_promises106.readFile)(changelogPath, "utf-8");
888544
+ const content5 = await (0, import_promises102.readFile)(changelogPath, "utf-8");
888563
888545
  if (content5.trim().length === 0) {
888564
888546
  return "";
888565
888547
  }
@@ -888669,24 +888651,24 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
888669
888651
  context3.logger.debug("Wrote IR to: " + absolutePathToIr);
888670
888652
  const configJsonFile = (0, import_path72.join)(workspaceTempDir.path, GENERATOR_CONFIG_FILENAME);
888671
888653
  const absolutePathToWriteConfigJson = AbsoluteFilePath2.of(configJsonFile);
888672
- await (0, import_promises107.writeFile)(configJsonFile, "");
888654
+ await (0, import_promises103.writeFile)(configJsonFile, "");
888673
888655
  context3.logger.debug("Will write config.json to: " + absolutePathToWriteConfigJson);
888674
888656
  const tmpOutputDirectory = (0, import_path72.join)(workspaceTempDir.path, CODEGEN_OUTPUT_DIRECTORY_NAME);
888675
888657
  const absolutePathToTmpOutputDirectory = AbsoluteFilePath2.of(tmpOutputDirectory);
888676
- await (0, import_promises107.mkdir)(tmpOutputDirectory, { recursive: true });
888658
+ await (0, import_promises103.mkdir)(tmpOutputDirectory, { recursive: true });
888677
888659
  context3.logger.debug("Will write output to: " + absolutePathToTmpOutputDirectory);
888678
888660
  let absolutePathToTmpSnippetJSON = void 0;
888679
888661
  if (absolutePathToLocalSnippetJSON != null) {
888680
888662
  const snippetJsonFile = (0, import_path72.join)(workspaceTempDir.path, "snippet.json");
888681
888663
  absolutePathToTmpSnippetJSON = AbsoluteFilePath2.of(snippetJsonFile);
888682
- await (0, import_promises107.writeFile)(snippetJsonFile, "");
888664
+ await (0, import_promises103.writeFile)(snippetJsonFile, "");
888683
888665
  context3.logger.debug("Will write snippet.json to: " + absolutePathToTmpSnippetJSON);
888684
888666
  }
888685
888667
  let absolutePathToTmpSnippetTemplatesJSON = void 0;
888686
888668
  if (absolutePathToLocalSnippetTemplateJSON != null) {
888687
888669
  const snippetTemplatesJsonFile = (0, import_path72.join)(workspaceTempDir.path, SNIPPET_TEMPLATES_JSON_FILENAME);
888688
888670
  absolutePathToTmpSnippetTemplatesJSON = AbsoluteFilePath2.of(snippetTemplatesJsonFile);
888689
- await (0, import_promises107.writeFile)(snippetTemplatesJsonFile, "");
888671
+ await (0, import_promises103.writeFile)(snippetTemplatesJsonFile, "");
888690
888672
  context3.logger.debug("Will write snippet-templates.json to: " + absolutePathToTmpSnippetTemplatesJSON);
888691
888673
  }
888692
888674
  const environment2 = executionEnvironment ?? new ContainerExecutionEnvironment({
@@ -888725,7 +888707,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
888725
888707
  publishToRegistry,
888726
888708
  paths
888727
888709
  });
888728
- await (0, import_promises107.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(await import_serialization.GeneratorConfig.jsonOrThrow(config5), void 0, 4));
888710
+ await (0, import_promises103.writeFile)(absolutePathToWriteConfigJson, JSON.stringify(await import_serialization.GeneratorConfig.jsonOrThrow(config5), void 0, 4));
888729
888711
  const absolutePathToLicenseFile = extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig);
888730
888712
  const sourceMounts = workspace.getSources().filter((source2) => source2.type === "protobuf").map((source2) => ({
888731
888713
  hostPath: source2.absoluteFilePath,
@@ -889326,14 +889308,14 @@ var GenerationRunner = class {
889326
889308
  };
889327
889309
 
889328
889310
  // ../cli-v2/lib/sdk/generator/LegacyLocalGenerationRunner.js
889329
- var import_promises109 = require("fs/promises");
889311
+ var import_promises105 = require("fs/promises");
889330
889312
 
889331
889313
  // ../cli-v2/lib/sdk/adapter/LegacyGeneratorInvocationAdapter.js
889332
889314
  init_lib4();
889333
889315
  init_lib6();
889334
889316
  init_lib7();
889335
889317
  var import_fiddle_sdk6 = __toESM(require_fiddle_sdk(), 1);
889336
- var import_promises108 = require("fs/promises");
889318
+ var import_promises104 = require("fs/promises");
889337
889319
  var LegacyGeneratorInvocationAdapter = class {
889338
889320
  context;
889339
889321
  constructor(config5) {
@@ -889566,7 +889548,7 @@ var LegacyGeneratorInvocationAdapter = class {
889566
889548
  if (!await doesPathExist(absolutePath, "file")) {
889567
889549
  throw new Error(`Custom license file "${absolutePath}" does not exist; did you mean to use either MIT or Apache-2.0?`);
889568
889550
  }
889569
- const contents = await (0, import_promises108.readFile)(absolutePath, "utf-8");
889551
+ const contents = await (0, import_promises104.readFile)(absolutePath, "utf-8");
889570
889552
  return import_fiddle_sdk6.FernFiddle.GithubLicense.custom({ contents });
889571
889553
  }
889572
889554
  buildReadme(target) {
@@ -889788,7 +889770,7 @@ var LegacyLocalGenerationRunner = class {
889788
889770
  });
889789
889771
  if (args.target.output.path != null && generatorInvocation.absolutePathToLocalOutput != null) {
889790
889772
  const snippetPath = join2(generatorInvocation.absolutePathToLocalOutput, RelativeFilePath2.of(SNIPPET_JSON_FILENAME));
889791
- await (0, import_promises109.rm)(snippetPath, { force: true });
889773
+ await (0, import_promises105.rm)(snippetPath, { force: true });
889792
889774
  }
889793
889775
  if (taskContext.getResult() === TaskResult.Failure) {
889794
889776
  return {
@@ -889805,7 +889787,7 @@ var LegacyLocalGenerationRunner = class {
889805
889787
  // ../cli-v2/lib/sdk/generator/LegacyRemoteGenerationRunner.js
889806
889788
  init_lib4();
889807
889789
  init_lib6();
889808
- var import_promises110 = require("fs/promises");
889790
+ var import_promises106 = require("fs/promises");
889809
889791
  var import_os14 = require("os");
889810
889792
  var LegacyRemoteGenerationRunner = class {
889811
889793
  context;
@@ -889860,13 +889842,13 @@ var LegacyRemoteGenerationRunner = class {
889860
889842
  const previewOutputDirectory = join2(absolutePathToPreview, RelativeFilePath2.of(generatorName));
889861
889843
  const targetOutputDirectory = generatorInvocation.absolutePathToLocalOutput;
889862
889844
  if (targetOutputDirectory != null) {
889863
- await (0, import_promises110.cp)(previewOutputDirectory, targetOutputDirectory, { recursive: true });
889864
- await (0, import_promises110.rm)(join2(targetOutputDirectory, RelativeFilePath2.of(".git")), {
889845
+ await (0, import_promises106.cp)(previewOutputDirectory, targetOutputDirectory, { recursive: true });
889846
+ await (0, import_promises106.rm)(join2(targetOutputDirectory, RelativeFilePath2.of(".git")), {
889865
889847
  recursive: true,
889866
889848
  force: true
889867
889849
  });
889868
889850
  }
889869
- await (0, import_promises110.rm)(absolutePathToPreview, { recursive: true, force: true });
889851
+ await (0, import_promises106.rm)(absolutePathToPreview, { recursive: true, force: true });
889870
889852
  }
889871
889853
  if (taskContext.getResult() === TaskResult.Failure) {
889872
889854
  return {
@@ -889895,7 +889877,7 @@ var LegacyRemoteGenerationRunner = class {
889895
889877
  }
889896
889878
  async getAbsolutePathToPreview(args) {
889897
889879
  if (this.isLocalGitCombo(args)) {
889898
- const tmpPreviewDirectory = await (0, import_promises110.mkdtemp)(join2(AbsoluteFilePath2.of((0, import_os14.tmpdir)()), RelativeFilePath2.of("fern-preview-")));
889880
+ const tmpPreviewDirectory = await (0, import_promises106.mkdtemp)(join2(AbsoluteFilePath2.of((0, import_os14.tmpdir)()), RelativeFilePath2.of("fern-preview-")));
889899
889881
  return AbsoluteFilePath2.of(tmpPreviewDirectory);
889900
889882
  }
889901
889883
  if (!args.preview) {
@@ -890531,7 +890513,7 @@ Example:
890531
890513
  if (!exists2) {
890532
890514
  return { shouldProceed: true };
890533
890515
  }
890534
- const files = await (0, import_promises111.readdir)(outputPath);
890516
+ const files = await (0, import_promises107.readdir)(outputPath);
890535
890517
  if (files.length === 0) {
890536
890518
  return { shouldProceed: true };
890537
890519
  }
@@ -890743,7 +890725,7 @@ init_lib4();
890743
890725
  // ../cli-v2/lib/sdk/updater/GeneratorMigrator.js
890744
890726
  init_lib4();
890745
890727
  var import_fs28 = require("fs");
890746
- var import_promises112 = require("fs/promises");
890728
+ var import_promises108 = require("fs/promises");
890747
890729
  var import_path75 = require("path");
890748
890730
  var import_semver13 = __toESM(require_semver2(), 1);
890749
890731
  var import_url8 = require("url");
@@ -890852,7 +890834,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
890852
890834
  }
890853
890835
  this.migrationsInstallPromise = (async () => {
890854
890836
  const cacheDir = this.cachePath;
890855
- await (0, import_promises112.mkdir)(cacheDir, { recursive: true });
890837
+ await (0, import_promises108.mkdir)(cacheDir, { recursive: true });
890856
890838
  const npmCacheDir = (0, import_path75.join)(cacheDir, ".npm-cache");
890857
890839
  const packageDir = (0, import_path75.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME);
890858
890840
  const packageJsonPath = (0, import_path75.join)(packageDir, "package.json");
@@ -890869,7 +890851,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
890869
890851
  "--no-audit",
890870
890852
  "--no-fund"
890871
890853
  ], { doNotPipeOutput: true });
890872
- const packageJsonContent = await (0, import_promises112.readFile)(packageJsonPath, "utf-8");
890854
+ const packageJsonContent = await (0, import_promises108.readFile)(packageJsonPath, "utf-8");
890873
890855
  const packageJson2 = JSON.parse(packageJsonContent);
890874
890856
  if (packageJson2.main == null) {
890875
890857
  throw new Error(`No main field found in package.json for ${MIGRATION_PACKAGE_NAME}`);
@@ -890911,7 +890893,7 @@ var GeneratorMigrator = class _GeneratorMigrator {
890911
890893
  const myPid = String(process.pid);
890912
890894
  while (true) {
890913
890895
  try {
890914
- const fh = await (0, import_promises112.open)(lockPath, "wx");
890896
+ const fh = await (0, import_promises108.open)(lockPath, "wx");
890915
890897
  await fh.writeFile(myPid);
890916
890898
  await fh.close();
890917
890899
  const exitHandler = () => {
@@ -890928,9 +890910,9 @@ var GeneratorMigrator = class _GeneratorMigrator {
890928
890910
  return async () => {
890929
890911
  process.removeListener("exit", exitHandler);
890930
890912
  try {
890931
- const currentContent = await (0, import_promises112.readFile)(lockPath, "utf-8");
890913
+ const currentContent = await (0, import_promises108.readFile)(lockPath, "utf-8");
890932
890914
  if (currentContent.trim() === myPid) {
890933
- await (0, import_promises112.unlink)(lockPath);
890915
+ await (0, import_promises108.unlink)(lockPath);
890934
890916
  } else {
890935
890917
  logger4.debug(`Lock file owned by another process (expected pid=${myPid}, found=${currentContent.trim()}); skipping release`);
890936
890918
  }
@@ -890944,14 +890926,14 @@ var GeneratorMigrator = class _GeneratorMigrator {
890944
890926
  throw err;
890945
890927
  }
890946
890928
  try {
890947
- const lockContent = await (0, import_promises112.readFile)(lockPath, "utf-8");
890929
+ const lockContent = await (0, import_promises108.readFile)(lockPath, "utf-8");
890948
890930
  const lockPid = Number(lockContent.trim());
890949
- const lockStat = await (0, import_promises112.stat)(lockPath);
890931
+ const lockStat = await (0, import_promises108.stat)(lockPath);
890950
890932
  const lockAge = Date.now() - lockStat.mtimeMs;
890951
890933
  if (lockAge > _GeneratorMigrator.LOCK_STALE_MS || Number.isFinite(lockPid) && lockPid > 0 && !_GeneratorMigrator.isProcessAlive(lockPid)) {
890952
890934
  logger4.debug(`Removing stale migration lock (pid=${lockContent.trim()}, age=${lockAge}ms)`);
890953
890935
  try {
890954
- await (0, import_promises112.unlink)(lockPath);
890936
+ await (0, import_promises108.unlink)(lockPath);
890955
890937
  } catch (unlinkErr) {
890956
890938
  logger4.debug(`Failed to remove stale lock: ${unlinkErr}`);
890957
890939
  }
@@ -891423,13 +891405,13 @@ var import_generator_cli2 = __toESM(require_api5(), 1);
891423
891405
 
891424
891406
  // ../init/lib/initializeAPI.js
891425
891407
  init_lib6();
891426
- var import_promises116 = require("fs/promises");
891408
+ var import_promises112 = require("fs/promises");
891427
891409
  var import_fs_extra = __toESM(require_lib19(), 1);
891428
891410
  var import_path76 = __toESM(require("path"), 1);
891429
891411
 
891430
891412
  // ../init/lib/createFernDirectoryAndOrganization.js
891431
891413
  init_lib6();
891432
- var import_promises113 = require("fs/promises");
891414
+ var import_promises109 = require("fs/promises");
891433
891415
  init_lodash();
891434
891416
  var GITIGNORE_CONTENT = "**/.preview\n**/.definition\n";
891435
891417
  async function createFernDirectoryAndWorkspace({ organization, taskContext, versionOfCli }) {
@@ -891459,7 +891441,7 @@ async function createFernDirectoryAndWorkspace({ organization, taskContext, vers
891459
891441
  }
891460
891442
  }
891461
891443
  }
891462
- await (0, import_promises113.mkdir)(FERN_DIRECTORY);
891444
+ await (0, import_promises109.mkdir)(FERN_DIRECTORY);
891463
891445
  await writeProjectConfig({
891464
891446
  filepath: join2(pathToFernDirectory, RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)),
891465
891447
  organization,
@@ -891483,11 +891465,11 @@ async function writeProjectConfig({ organization, filepath, versionOfCli }) {
891483
891465
  organization,
891484
891466
  version: versionOfCli
891485
891467
  };
891486
- await (0, import_promises113.writeFile)(filepath, JSON.stringify(projectConfig, void 0, 4));
891468
+ await (0, import_promises109.writeFile)(filepath, JSON.stringify(projectConfig, void 0, 4));
891487
891469
  }
891488
891470
  async function writeGitignore({ absolutePathToFernDirectory }) {
891489
891471
  const gitignorePath = join2(absolutePathToFernDirectory, RelativeFilePath2.of(".gitignore"));
891490
- await (0, import_promises113.writeFile)(gitignorePath, GITIGNORE_CONTENT);
891472
+ await (0, import_promises109.writeFile)(gitignorePath, GITIGNORE_CONTENT);
891491
891473
  }
891492
891474
 
891493
891475
  // ../fern-definition/formatter/lib/FernDefinitionFileFormatter.js
@@ -891676,7 +891658,7 @@ async function formatDefinitionFile({ fileContents }) {
891676
891658
 
891677
891659
  // ../fern-definition/formatter/lib/formatWorkspace.js
891678
891660
  init_lib4();
891679
- var import_promises114 = require("fs/promises");
891661
+ var import_promises110 = require("fs/promises");
891680
891662
  async function formatFernWorkspace({ workspace, context: context3, shouldFix }) {
891681
891663
  for (const [relativeFilepath, file4] of entries(workspace.definition.namedDefinitionFiles)) {
891682
891664
  const formatted = await formatDefinitionFile({
@@ -891684,7 +891666,7 @@ async function formatFernWorkspace({ workspace, context: context3, shouldFix })
891684
891666
  });
891685
891667
  if (formatted !== file4.rawContents) {
891686
891668
  if (shouldFix) {
891687
- await (0, import_promises114.writeFile)(file4.absoluteFilePath, formatted);
891669
+ await (0, import_promises110.writeFile)(file4.absoluteFilePath, formatted);
891688
891670
  context3.logger.info(source_default.green(`Formatted ${source_default.bold(relativeFilepath)}`));
891689
891671
  } else {
891690
891672
  context3.logger.info(source_default.red(`Invalid formatting: ${source_default.bold(relativeFilepath)}`));
@@ -891696,7 +891678,7 @@ async function formatFernWorkspace({ workspace, context: context3, shouldFix })
891696
891678
 
891697
891679
  // ../init/lib/createWorkspace.js
891698
891680
  init_lib6();
891699
- var import_promises115 = require("fs/promises");
891681
+ var import_promises111 = require("fs/promises");
891700
891682
 
891701
891683
  // ../init/lib/sampleImdbApi.js
891702
891684
  var SAMPLE_IMDB_API = `
@@ -891896,7 +891878,7 @@ components:
891896
891878
  // ../init/lib/createWorkspace.js
891897
891879
  async function createFernWorkspace({ directoryOfWorkspace, cliVersion, context: context3, apiName = "api" }) {
891898
891880
  if (!await doesPathExist(directoryOfWorkspace)) {
891899
- await (0, import_promises115.mkdir)(directoryOfWorkspace);
891881
+ await (0, import_promises111.mkdir)(directoryOfWorkspace);
891900
891882
  }
891901
891883
  await writeGeneratorsConfiguration({
891902
891884
  filepath: join2(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
@@ -891911,7 +891893,7 @@ async function createFernWorkspace({ directoryOfWorkspace, cliVersion, context:
891911
891893
  }
891912
891894
  async function createOpenAPIWorkspace({ directoryOfWorkspace, openAPIFilePath, cliVersion, context: context3 }) {
891913
891895
  if (!await doesPathExist(directoryOfWorkspace)) {
891914
- await (0, import_promises115.mkdir)(directoryOfWorkspace);
891896
+ await (0, import_promises111.mkdir)(directoryOfWorkspace);
891915
891897
  }
891916
891898
  await writeGeneratorsConfiguration({
891917
891899
  filepath: join2(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
@@ -891924,10 +891906,10 @@ async function createOpenAPIWorkspace({ directoryOfWorkspace, openAPIFilePath, c
891924
891906
  }
891925
891907
  async function createDefaultOpenAPIWorkspace({ directoryOfWorkspace, cliVersion, context: context3 }) {
891926
891908
  if (!await doesPathExist(directoryOfWorkspace)) {
891927
- await (0, import_promises115.mkdir)(directoryOfWorkspace, { recursive: true });
891909
+ await (0, import_promises111.mkdir)(directoryOfWorkspace, { recursive: true });
891928
891910
  }
891929
891911
  const openApiFilePath = join2(directoryOfWorkspace, RelativeFilePath2.of("openapi.yml"));
891930
- await (0, import_promises115.writeFile)(openApiFilePath, SAMPLE_OPENAPI);
891912
+ await (0, import_promises111.writeFile)(openApiFilePath, SAMPLE_OPENAPI);
891931
891913
  await writeGeneratorsConfiguration({
891932
891914
  filepath: join2(directoryOfWorkspace, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)),
891933
891915
  cliVersion,
@@ -891972,7 +891954,7 @@ async function getDefaultGeneratorsConfiguration({ cliVersion, context: context3
891972
891954
  return config5;
891973
891955
  }
891974
891956
  async function writeGeneratorsConfiguration({ filepath, cliVersion, context: context3, apiConfiguration }) {
891975
- await (0, import_promises115.writeFile)(filepath, "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + jsYaml.dump(await getDefaultGeneratorsConfiguration({ cliVersion, context: context3, apiConfiguration }), {
891957
+ await (0, import_promises111.writeFile)(filepath, "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + jsYaml.dump(await getDefaultGeneratorsConfiguration({ cliVersion, context: context3, apiConfiguration }), {
891976
891958
  sortKeys: (a10, b19) => {
891977
891959
  if (a10 === "api") {
891978
891960
  return -1;
@@ -891991,10 +891973,10 @@ async function writeSampleApiDefinition({ directoryOfDefinition, apiName }) {
891991
891973
  strategy: "status-code"
891992
891974
  }
891993
891975
  };
891994
- await (0, import_promises115.mkdir)(directoryOfDefinition);
891995
- await (0, import_promises115.writeFile)(join2(directoryOfDefinition, RelativeFilePath2.of(ROOT_API_FILENAME)), jsYaml.dump(rootApi));
891976
+ await (0, import_promises111.mkdir)(directoryOfDefinition);
891977
+ await (0, import_promises111.writeFile)(join2(directoryOfDefinition, RelativeFilePath2.of(ROOT_API_FILENAME)), jsYaml.dump(rootApi));
891996
891978
  const absoluteFilepathToImdbYaml = join2(directoryOfDefinition, RelativeFilePath2.of("imdb.yml"));
891997
- await (0, import_promises115.writeFile)(absoluteFilepathToImdbYaml, await formatDefinitionFile({
891979
+ await (0, import_promises111.writeFile)(absoluteFilepathToImdbYaml, await formatDefinitionFile({
891998
891980
  fileContents: SAMPLE_IMDB_API
891999
891981
  }));
892000
891982
  }
@@ -892047,7 +892029,7 @@ async function getDirectoryOfNewAPIWorkspace({ absolutePathToFernDirectory, task
892047
892029
  if (inlinedApiDefinition || inlinedOpenApiWorkspace) {
892048
892030
  taskContext.logger.info("Creating workspaces to support multiple API Definitions.");
892049
892031
  const apiWorkspaceDirectory = join2(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY), RelativeFilePath2.of("api"));
892050
- await (0, import_promises116.mkdir)(apiWorkspaceDirectory, { recursive: true });
892032
+ await (0, import_promises112.mkdir)(apiWorkspaceDirectory, { recursive: true });
892051
892033
  if (inlinedApiDefinition) {
892052
892034
  const inlinedDefinitionDirectory = join2(absolutePathToFernDirectory, RelativeFilePath2.of(DEFINITION_DIRECTORY));
892053
892035
  const workspaceDefinitionDirectory = join2(apiWorkspaceDirectory, RelativeFilePath2.of(DEFINITION_DIRECTORY));
@@ -892084,7 +892066,7 @@ async function hasInlinedOpenAPIWorkspace({ absolutePathToFernDirectory }) {
892084
892066
  // ../init/lib/initializeDocs.js
892085
892067
  init_lib4();
892086
892068
  init_lib6();
892087
- var import_promises117 = require("fs/promises");
892069
+ var import_promises113 = require("fs/promises");
892088
892070
  async function initializeDocs({ organization, taskContext, versionOfCli }) {
892089
892071
  const createDirectoryResponse = await createFernDirectoryAndWorkspace({
892090
892072
  organization,
@@ -892099,7 +892081,7 @@ async function initializeDocs({ organization, taskContext, versionOfCli }) {
892099
892081
  } else {
892100
892082
  try {
892101
892083
  const docsConfig = getDocsConfig(createDirectoryResponse.organization);
892102
- await (0, import_promises117.writeFile)(docsYmlPath, jsYaml.dump(docsConfig));
892084
+ await (0, import_promises113.writeFile)(docsYmlPath, jsYaml.dump(docsConfig));
892103
892085
  taskContext.logger.info(source_default.green("Created docs configuration"));
892104
892086
  return;
892105
892087
  } catch (writeError) {
@@ -892154,7 +892136,7 @@ var FernDocsBuilder = class {
892154
892136
 
892155
892137
  // ../docs-importers/commons/lib/FernDocsBuilderImpl.js
892156
892138
  init_lib6();
892157
- var import_promises118 = require("fs/promises");
892139
+ var import_promises114 = require("fs/promises");
892158
892140
  var FernDocsBuilderImpl = class extends FernDocsBuilder {
892159
892141
  openApiSpecs = {};
892160
892142
  nonTabbedNavigation = new NonTabbedNavigationBuilderImpl();
@@ -892213,7 +892195,7 @@ var FernDocsBuilderImpl = class extends FernDocsBuilder {
892213
892195
  }
892214
892196
  async build({ outputDirectory }) {
892215
892197
  const absolutePathToFernDirectory = join2(outputDirectory, RelativeFilePath2.of(FERN_DIRECTORY));
892216
- await (0, import_promises118.mkdir)(absolutePathToFernDirectory, { recursive: true });
892198
+ await (0, import_promises114.mkdir)(absolutePathToFernDirectory, { recursive: true });
892217
892199
  if (Object.keys(this.tabbedNavigation).length > 0) {
892218
892200
  this.docsYml.tabs = Object.fromEntries(Object.entries(this.tabbedNavigation).map(([key2, value]) => {
892219
892201
  return [value.tabId, value.tabConfig];
@@ -892238,27 +892220,27 @@ var FernDocsBuilderImpl = class extends FernDocsBuilder {
892238
892220
  }))
892239
892221
  };
892240
892222
  }
892241
- await (0, import_promises118.writeFile)(join2(absolutePathToFernDirectory, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)), jsYaml.dump(generators_yml_exports.serialization.GeneratorsConfigurationSchema.jsonOrThrow(this.generatorsYml)));
892223
+ await (0, import_promises114.writeFile)(join2(absolutePathToFernDirectory, RelativeFilePath2.of(GENERATORS_CONFIGURATION_FILENAME)), jsYaml.dump(generators_yml_exports.serialization.GeneratorsConfigurationSchema.jsonOrThrow(this.generatorsYml)));
892242
892224
  await Promise.all(Object.entries(this.openApiSpecs).map(async ([relativePath, absolutePath]) => {
892243
892225
  const absolutePathToOpenAPI = join2(absolutePathToFernDirectory, RelativeFilePath2.of(relativePath));
892244
- await (0, import_promises118.mkdir)(dirname4(absolutePathToOpenAPI), { recursive: true });
892245
- await (0, import_promises118.cp)(absolutePath, absolutePathToOpenAPI);
892226
+ await (0, import_promises114.mkdir)(dirname4(absolutePathToOpenAPI), { recursive: true });
892227
+ await (0, import_promises114.cp)(absolutePath, absolutePathToOpenAPI);
892246
892228
  }));
892247
892229
  }
892248
- await (0, import_promises118.writeFile)(join2(absolutePathToFernDirectory, RelativeFilePath2.of(DOCS_CONFIGURATION_FILENAME)), jsYaml.dump(docs_yml_exports.RawSchemas.Serializer.DocsConfiguration.jsonOrThrow(this.docsYml, { omitUndefined: true })));
892230
+ await (0, import_promises114.writeFile)(join2(absolutePathToFernDirectory, RelativeFilePath2.of(DOCS_CONFIGURATION_FILENAME)), jsYaml.dump(docs_yml_exports.RawSchemas.Serializer.DocsConfiguration.jsonOrThrow(this.docsYml, { omitUndefined: true })));
892249
892231
  await Promise.all(Object.entries(this.markdownPages).map(async ([filepath, page]) => {
892250
892232
  const absoluteFilepathToMarkdownPage = join2(absolutePathToFernDirectory, RelativeFilePath2.of(filepath));
892251
- await (0, import_promises118.mkdir)(dirname4(absoluteFilepathToMarkdownPage), { recursive: true });
892233
+ await (0, import_promises114.mkdir)(dirname4(absoluteFilepathToMarkdownPage), { recursive: true });
892252
892234
  const frontmatter = Object.keys(page.frontmatter).length > 0 ? `---
892253
892235
  ${jsYaml.dump(JSON.parse(JSON.stringify(page.frontmatter)))}---
892254
892236
 
892255
892237
  ` : "";
892256
- await (0, import_promises118.writeFile)(absoluteFilepathToMarkdownPage, `${frontmatter}${page.markdown}`);
892238
+ await (0, import_promises114.writeFile)(absoluteFilepathToMarkdownPage, `${frontmatter}${page.markdown}`);
892257
892239
  }));
892258
892240
  await Promise.all(Object.entries(this.assets).map(async ([filepath, asset]) => {
892259
892241
  const absolutePathToAsset = join2(absolutePathToFernDirectory, RelativeFilePath2.of(filepath));
892260
- await (0, import_promises118.mkdir)(dirname4(absolutePathToAsset), { recursive: true });
892261
- await (0, import_promises118.cp)(asset.absoluteFilePathToAsset, absolutePathToAsset);
892242
+ await (0, import_promises114.mkdir)(dirname4(absolutePathToAsset), { recursive: true });
892243
+ await (0, import_promises114.cp)(asset.absoluteFilePathToAsset, absolutePathToAsset);
892262
892244
  }));
892263
892245
  }
892264
892246
  setInstance({ companyName }) {
@@ -892291,7 +892273,7 @@ var NonTabbedNavigationBuilderImpl = class {
892291
892273
 
892292
892274
  // ../docs-importers/mintlify/lib/MintlifyImporter.js
892293
892275
  init_lib6();
892294
- var import_promises120 = require("fs/promises");
892276
+ var import_promises116 = require("fs/promises");
892295
892277
 
892296
892278
  // ../docs-importers/mintlify/lib/convertColors.js
892297
892279
  function convertColors(colors19) {
@@ -892352,10 +892334,10 @@ init_lib6();
892352
892334
 
892353
892335
  // ../docs-importers/mintlify/lib/convertMarkdown.js
892354
892336
  init_lib6();
892355
- var import_promises119 = require("fs/promises");
892337
+ var import_promises115 = require("fs/promises");
892356
892338
  var import_gray_matter9 = __toESM(require_gray_matter(), 1);
892357
892339
  async function convertMarkdown({ absolutePathToMintJson, absoluteFilepathToMarkdown, relativeFilepathFromRoot, builder }) {
892358
- const text9 = await (0, import_promises119.readFile)(absoluteFilepathToMarkdown, "utf-8");
892340
+ const text9 = await (0, import_promises115.readFile)(absoluteFilepathToMarkdown, "utf-8");
892359
892341
  const { data: data2, content: content5 } = parseMintlifyFrontmatter(text9);
892360
892342
  const slug = relativeFilepathFromRoot.replace(/\.(md|mdx)$/, "");
892361
892343
  const transformedContent = markReferencedAssets({
@@ -892518,7 +892500,7 @@ var MintlifyImporter = class extends DocsImporter {
892518
892500
  documentationTab = void 0;
892519
892501
  tabUrlToInfo = {};
892520
892502
  async import({ args, builder }) {
892521
- const mintJsonContent = await (0, import_promises120.readFile)(args.absolutePathToMintJson, "utf-8");
892503
+ const mintJsonContent = await (0, import_promises116.readFile)(args.absolutePathToMintJson, "utf-8");
892522
892504
  const mint = JSON.parse(mintJsonContent);
892523
892505
  builder.setTitle({ title: mint.name });
892524
892506
  const relativePathToFavicon = RelativeFilePath2.of(mint.favicon.substring(1));
@@ -892644,7 +892626,7 @@ var MintlifyImporter = class extends DocsImporter {
892644
892626
 
892645
892627
  // ../docs-importers/mintlify/lib/runMintlifyMigration.js
892646
892628
  init_lib6();
892647
- var import_promises121 = require("fs/promises");
892629
+ var import_promises117 = require("fs/promises");
892648
892630
  async function runMintlifyMigration({ absolutePathToMintJson, outputPath, taskContext, versionOfCli, organization }) {
892649
892631
  const mintlifyImporter = new MintlifyImporter({
892650
892632
  context: taskContext
@@ -892655,7 +892637,7 @@ async function runMintlifyMigration({ absolutePathToMintJson, outputPath, taskCo
892655
892637
  builder
892656
892638
  });
892657
892639
  await builder.build({ outputDirectory: outputPath });
892658
- await (0, import_promises121.writeFile)(join2(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
892640
+ await (0, import_promises117.writeFile)(join2(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
892659
892641
  version: versionOfCli,
892660
892642
  organization
892661
892643
  }, void 0, 4));
@@ -892709,7 +892691,7 @@ function assertIsStringArray(val) {
892709
892691
  // ../docs-importers/readme/lib/ReadmeImporter.js
892710
892692
  init_lib4();
892711
892693
  init_lib6();
892712
- var import_promises126 = require("fs/promises");
892694
+ var import_promises122 = require("fs/promises");
892713
892695
 
892714
892696
  // ../docs-importers/readme/lib/extract/favicon.js
892715
892697
  async function getFavicon(hast) {
@@ -904127,7 +904109,7 @@ init_disposable();
904127
904109
  init_incremental_id_generator();
904128
904110
 
904129
904111
  // ../../../node_modules/.pnpm/puppeteer-core@24.40.0/node_modules/puppeteer-core/lib/esm/puppeteer/node/ChromeLauncher.js
904130
- var import_promises124 = require("fs/promises");
904112
+ var import_promises120 = require("fs/promises");
904131
904113
  var import_node_os11 = __toESM(require("os"), 1);
904132
904114
  var import_node_path35 = __toESM(require("path"), 1);
904133
904115
  init_main();
@@ -904571,7 +904553,7 @@ var ChromeLauncher = class extends BrowserLauncher {
904571
904553
  });
904572
904554
  if (userDataDirIndex < 0) {
904573
904555
  isTempUserDataDir = true;
904574
- chromeArguments.push(`--user-data-dir=${await (0, import_promises124.mkdtemp)(this.getProfilePath())}`);
904556
+ chromeArguments.push(`--user-data-dir=${await (0, import_promises120.mkdtemp)(this.getProfilePath())}`);
904575
904557
  userDataDirIndex = chromeArguments.length - 1;
904576
904558
  }
904577
904559
  const userDataDir = chromeArguments[userDataDirIndex].split("=", 2)[1];
@@ -904728,7 +904710,7 @@ function removeMatchingFlags(array3, flag) {
904728
904710
 
904729
904711
  // ../../../node_modules/.pnpm/puppeteer-core@24.40.0/node_modules/puppeteer-core/lib/esm/puppeteer/node/FirefoxLauncher.js
904730
904712
  var import_node_fs28 = __toESM(require("fs"), 1);
904731
- var import_promises125 = require("fs/promises");
904713
+ var import_promises121 = require("fs/promises");
904732
904714
  var import_node_os12 = __toESM(require("os"), 1);
904733
904715
  var import_node_path36 = __toESM(require("path"), 1);
904734
904716
  init_main();
@@ -904782,7 +904764,7 @@ var FirefoxLauncher = class _FirefoxLauncher extends BrowserLauncher {
904782
904764
  }
904783
904765
  isTempUserDataDir = false;
904784
904766
  } else {
904785
- userDataDir = await (0, import_promises125.mkdtemp)(this.getProfilePath());
904767
+ userDataDir = await (0, import_promises121.mkdtemp)(this.getProfilePath());
904786
904768
  firefoxArguments.push("--profile");
904787
904769
  firefoxArguments.push(userDataDir);
904788
904770
  }
@@ -904823,8 +904805,8 @@ var FirefoxLauncher = class _FirefoxLauncher extends BrowserLauncher {
904823
904805
  const prefsBackupPath = import_node_path36.default.join(userDataDir, file4 + backupSuffix);
904824
904806
  if (import_node_fs28.default.existsSync(prefsBackupPath)) {
904825
904807
  const prefsPath = import_node_path36.default.join(userDataDir, file4);
904826
- await (0, import_promises125.unlink)(prefsPath);
904827
- await (0, import_promises125.rename)(prefsBackupPath, prefsPath);
904808
+ await (0, import_promises121.unlink)(prefsPath);
904809
+ await (0, import_promises121.rename)(prefsBackupPath, prefsPath);
904828
904810
  }
904829
904811
  }));
904830
904812
  for (const result of results) {
@@ -905857,7 +905839,7 @@ var ReadmeImporter = class extends DocsImporter {
905857
905839
  if (response.ok) {
905858
905840
  const imageBuffer = Buffer.from(await response.arrayBuffer());
905859
905841
  const faviconPath = join2(assetsDirectory, RelativeFilePath2.of("favicon"));
905860
- await (0, import_promises126.writeFile)(faviconPath, new Uint8Array(imageBuffer));
905842
+ await (0, import_promises122.writeFile)(faviconPath, new Uint8Array(imageBuffer));
905861
905843
  builder.setFavicon({ favicon: relativize(this.absolutePathToFernDirectory, faviconPath) });
905862
905844
  }
905863
905845
  }
@@ -905874,7 +905856,7 @@ var ReadmeImporter = class extends DocsImporter {
905874
905856
  */
905875
905857
  async getAndCreateAssetsDirectory() {
905876
905858
  const assetsDirectory = join2(this.absolutePathToFernDirectory, RelativeFilePath2.of("assets"));
905877
- await (0, import_promises126.mkdir)(assetsDirectory, { recursive: true });
905859
+ await (0, import_promises122.mkdir)(assetsDirectory, { recursive: true });
905878
905860
  return assetsDirectory;
905879
905861
  }
905880
905862
  /**
@@ -905924,7 +905906,7 @@ var ReadmeImporter = class extends DocsImporter {
905924
905906
  absolutePathToOutputDirectory,
905925
905907
  section
905926
905908
  });
905927
- await (0, import_promises126.mkdir)(absolutePathToOutputDirectoryForSection, { recursive: true });
905909
+ await (0, import_promises122.mkdir)(absolutePathToOutputDirectoryForSection, { recursive: true });
905928
905910
  await Promise.all(section.pages.filter((page) => page.type === "page").map(async (page) => {
905929
905911
  const url3 = new URL(page.slug.toString(), this.url);
905930
905912
  this.logger.debug(`Fetching page: ${url3.toString()}`);
@@ -905939,7 +905921,7 @@ var ReadmeImporter = class extends DocsImporter {
905939
905921
  absolutePathToOutputDirectoryForSection,
905940
905922
  page: page.slug
905941
905923
  });
905942
- await (0, import_promises126.writeFile)(absolutePathForPage, result.data.mdx);
905924
+ await (0, import_promises122.writeFile)(absolutePathForPage, result.data.mdx);
905943
905925
  if (result.data.images.imageURLs.length > 0) {
905944
905926
  this.logger.debug(`Found ${result.data.images.imageURLs.length} images to download for ${url3.toString()}`);
905945
905927
  await Promise.all(Object.entries(result.data.images.imageURLToFilename).map(async ([imageUrl, filename]) => {
@@ -905952,8 +905934,8 @@ var ReadmeImporter = class extends DocsImporter {
905952
905934
  const imageBuffer = Buffer.from(await response.arrayBuffer());
905953
905935
  const imagePath = join2(absolutePathToOutputDirectoryForSection, RelativeFilePath2.of(filename));
905954
905936
  const imageDir = dirname4(imagePath);
905955
- await (0, import_promises126.mkdir)(imageDir, { recursive: true });
905956
- await (0, import_promises126.writeFile)(imagePath, new Uint8Array(imageBuffer));
905937
+ await (0, import_promises122.mkdir)(imageDir, { recursive: true });
905938
+ await (0, import_promises122.writeFile)(imagePath, new Uint8Array(imageBuffer));
905957
905939
  this.logger.debug(`Saved image to ${imagePath}`);
905958
905940
  } catch (error50) {
905959
905941
  this.logger.warn(`Error downloading image ${imageUrl}: ${error50}`);
@@ -906036,7 +906018,7 @@ var ReadmeImporter = class extends DocsImporter {
906036
906018
 
906037
906019
  // ../docs-importers/readme/lib/runReadmeMigration.js
906038
906020
  init_lib6();
906039
- var import_promises127 = require("fs/promises");
906021
+ var import_promises123 = require("fs/promises");
906040
906022
  async function runReadmeMigration({ readmeUrl, outputPath, taskContext, versionOfCli, organization }) {
906041
906023
  const builder = new FernDocsBuilderImpl();
906042
906024
  builder.setInstance({ companyName: organization });
@@ -906051,7 +906033,7 @@ async function runReadmeMigration({ readmeUrl, outputPath, taskContext, versionO
906051
906033
  builder
906052
906034
  });
906053
906035
  await builder.build({ outputDirectory: outputPath });
906054
- await (0, import_promises127.writeFile)(join2(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
906036
+ await (0, import_promises123.writeFile)(join2(AbsoluteFilePath2.of(outputPath), RelativeFilePath2.of(FERN_DIRECTORY), RelativeFilePath2.of(PROJECT_CONFIG_FILENAME)), JSON.stringify({
906055
906037
  version: versionOfCli,
906056
906038
  organization
906057
906039
  }, void 0, 4));
@@ -906074,7 +906056,7 @@ var initializeWithReadme = async ({ readmeUrl, organization, taskContext, versio
906074
906056
  };
906075
906057
 
906076
906058
  // ../init/lib/utils/loadOpenApiFromUrl.js
906077
- var import_promises128 = require("fs/promises");
906059
+ var import_promises124 = require("fs/promises");
906078
906060
  var import_path77 = require("path");
906079
906061
  var import_tmp_promise15 = __toESM(require_tmp_promise(), 1);
906080
906062
  var LoadOpenAPIStatus;
@@ -906089,7 +906071,7 @@ async function loadOpenAPIFromUrl({ url: url3, logger: logger4 }) {
906089
906071
  const filePath = (0, import_path77.join)(tmpDir.path, url3.endsWith(".json") ? "openapi.json" : "openapi.yaml");
906090
906072
  logger4.debug("tmpDir", tmpDir.path);
906091
906073
  logger4.debug("filePath", filePath);
906092
- await (0, import_promises128.writeFile)(filePath, data2);
906074
+ await (0, import_promises124.writeFile)(filePath, data2);
906093
906075
  return {
906094
906076
  status: LoadOpenAPIStatus.Success,
906095
906077
  filePath
@@ -910329,7 +910311,7 @@ var CliContext = class {
910329
910311
  if (false) {
910330
910312
  this.logger.error("CLI_VERSION is not defined");
910331
910313
  }
910332
- return "4.50.3";
910314
+ return "4.50.4-1-g8a6fed15293";
910333
910315
  }
910334
910316
  getCliName() {
910335
910317
  if (false) {
@@ -910615,7 +910597,7 @@ function wrapWorkspaceNameForPrefix(workspaceName) {
910615
910597
 
910616
910598
  // ../project-loader/lib/loadProject.js
910617
910599
  init_lib6();
910618
- var import_promises129 = require("fs/promises");
910600
+ var import_promises125 = require("fs/promises");
910619
910601
  async function loadProject({ context: context3, nameOverride, ...args }) {
910620
910602
  const fernDirectory = await getFernDirectory(nameOverride);
910621
910603
  if (fernDirectory == null) {
@@ -910678,7 +910660,7 @@ async function loadApis({ cliName, fernDirectory, context: context3, cliVersion,
910678
910660
  const apisDirectory = join2(fernDirectory, RelativeFilePath2.of(APIS_DIRECTORY));
910679
910661
  const apisDirectoryExists = await doesPathExist(apisDirectory);
910680
910662
  if (apisDirectoryExists) {
910681
- const apiDirectoryContents = await (0, import_promises129.readdir)(apisDirectory, { withFileTypes: true });
910663
+ const apiDirectoryContents = await (0, import_promises125.readdir)(apisDirectory, { withFileTypes: true });
910682
910664
  const apiWorkspaceDirectoryNames = apiDirectoryContents.reduce((all9, item) => {
910683
910665
  if (item.isDirectory()) {
910684
910666
  all9.push(item.name);
@@ -910755,11 +910737,11 @@ async function loadProjectAndRegisterWorkspacesWithContext(cliContext, args, reg
910755
910737
 
910756
910738
  // src/cliV2.ts
910757
910739
  var import_generators_sdk5 = __toESM(require_generators_sdk(), 1);
910758
- var import_promises134 = require("fs/promises");
910740
+ var import_promises130 = require("fs/promises");
910759
910741
 
910760
910742
  // src/commands/generator-list/getGeneratorList.ts
910761
910743
  init_lib4();
910762
- var import_promises130 = require("fs/promises");
910744
+ var import_promises126 = require("fs/promises");
910763
910745
  var GenerationModeFilter = {
910764
910746
  GitHub: "github",
910765
910747
  Local: "local-file-system",
@@ -910819,7 +910801,7 @@ async function getGeneratorList({
910819
910801
  return;
910820
910802
  }
910821
910803
  try {
910822
- await (0, import_promises130.writeFile)(outputLocation, generatorsListYaml);
910804
+ await (0, import_promises126.writeFile)(outputLocation, generatorsListYaml);
910823
910805
  } catch (error50) {
910824
910806
  cliContext.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error50);
910825
910807
  }
@@ -910885,7 +910867,7 @@ async function getGeneratorMetadata({
910885
910867
  }
910886
910868
 
910887
910869
  // src/commands/organization/getOrganization.ts
910888
- var import_promises131 = require("fs/promises");
910870
+ var import_promises127 = require("fs/promises");
910889
910871
  async function getOrganization({
910890
910872
  project,
910891
910873
  outputLocation,
@@ -910897,7 +910879,7 @@ async function getOrganization({
910897
910879
  return;
910898
910880
  }
910899
910881
  try {
910900
- await (0, import_promises131.writeFile)(outputLocation, org);
910882
+ await (0, import_promises127.writeFile)(outputLocation, org);
910901
910883
  } catch (error50) {
910902
910884
  context3.failAndThrow(`Could not write file to the specified location: ${outputLocation}`, error50);
910903
910885
  }
@@ -910905,7 +910887,7 @@ async function getOrganization({
910905
910887
 
910906
910888
  // src/commands/upgrade/upgradeGenerator.ts
910907
910889
  init_lib6();
910908
- var import_promises133 = require("fs/promises");
910890
+ var import_promises129 = require("fs/promises");
910909
910891
  var import_path79 = __toESM(require("path"), 1);
910910
910892
  var import_semver16 = __toESM(require_semver2(), 1);
910911
910893
  var import_yaml6 = __toESM(require_dist8(), 1);
@@ -910913,7 +910895,7 @@ var import_yaml6 = __toESM(require_dist8(), 1);
910913
910895
  // src/commands/upgrade/migrations/loader.ts
910914
910896
  init_lib4();
910915
910897
  var import_fs31 = require("fs");
910916
- var import_promises132 = require("fs/promises");
910898
+ var import_promises128 = require("fs/promises");
910917
910899
  var import_os15 = require("os");
910918
910900
  var import_path78 = require("path");
910919
910901
  var import_semver15 = __toESM(require_semver2(), 1);
@@ -910941,7 +910923,7 @@ async function acquireLock3(logger4, cacheDir) {
910941
910923
  const myPid = String(process.pid);
910942
910924
  while (true) {
910943
910925
  try {
910944
- const fh = await (0, import_promises132.open)(lockPath, "wx");
910926
+ const fh = await (0, import_promises128.open)(lockPath, "wx");
910945
910927
  await fh.writeFile(myPid);
910946
910928
  await fh.close();
910947
910929
  const exitHandler = () => {
@@ -910958,9 +910940,9 @@ async function acquireLock3(logger4, cacheDir) {
910958
910940
  return async () => {
910959
910941
  process.removeListener("exit", exitHandler);
910960
910942
  try {
910961
- const currentContent = await (0, import_promises132.readFile)(lockPath, "utf-8");
910943
+ const currentContent = await (0, import_promises128.readFile)(lockPath, "utf-8");
910962
910944
  if (currentContent.trim() === myPid) {
910963
- await (0, import_promises132.unlink)(lockPath);
910945
+ await (0, import_promises128.unlink)(lockPath);
910964
910946
  } else {
910965
910947
  logger4.debug(
910966
910948
  `Lock file owned by another process (expected pid=${myPid}, found=${currentContent.trim()}); skipping release`
@@ -910976,14 +910958,14 @@ async function acquireLock3(logger4, cacheDir) {
910976
910958
  throw err;
910977
910959
  }
910978
910960
  try {
910979
- const lockContent = await (0, import_promises132.readFile)(lockPath, "utf-8");
910961
+ const lockContent = await (0, import_promises128.readFile)(lockPath, "utf-8");
910980
910962
  const lockPid = Number(lockContent.trim());
910981
- const lockStat = await (0, import_promises132.stat)(lockPath);
910963
+ const lockStat = await (0, import_promises128.stat)(lockPath);
910982
910964
  const lockAge = Date.now() - lockStat.mtimeMs;
910983
910965
  if (lockAge > LOCK_STALE_MS || Number.isFinite(lockPid) && lockPid > 0 && !isProcessAlive(lockPid)) {
910984
910966
  logger4.debug(`Removing stale migration lock (pid=${lockContent.trim()}, age=${lockAge}ms)`);
910985
910967
  try {
910986
- await (0, import_promises132.unlink)(lockPath);
910968
+ await (0, import_promises128.unlink)(lockPath);
910987
910969
  } catch (unlinkErr) {
910988
910970
  logger4.debug(`Failed to remove stale lock: ${unlinkErr}`);
910989
910971
  }
@@ -911007,7 +910989,7 @@ async function ensureMigrationsInstalled(logger4) {
911007
910989
  }
911008
910990
  migrationsInstallPromise = (async () => {
911009
910991
  const cacheDir = getMigrationCacheDir();
911010
- await (0, import_promises132.mkdir)(cacheDir, { recursive: true });
910992
+ await (0, import_promises128.mkdir)(cacheDir, { recursive: true });
911011
910993
  const npmCacheDir = (0, import_path78.join)(cacheDir, ".npm-cache");
911012
910994
  const packageDir = (0, import_path78.join)(cacheDir, "node_modules", MIGRATION_PACKAGE_NAME2);
911013
910995
  const packageJsonPath = (0, import_path78.join)(packageDir, "package.json");
@@ -911024,7 +911006,7 @@ async function ensureMigrationsInstalled(logger4) {
911024
911006
  "--no-audit",
911025
911007
  "--no-fund"
911026
911008
  ]);
911027
- const packageJsonContent = await (0, import_promises132.readFile)(packageJsonPath, "utf-8");
911009
+ const packageJsonContent = await (0, import_promises128.readFile)(packageJsonPath, "utf-8");
911028
911010
  const packageJson2 = JSON.parse(packageJsonContent);
911029
911011
  if (packageJson2.main == null) {
911030
911012
  throw new Error(`No main field found in package.json for ${MIGRATION_PACKAGE_NAME2}`);
@@ -911199,7 +911181,7 @@ async function loadAndUpdateGenerators({
911199
911181
  skippedAutoreleaseDisabled: []
911200
911182
  };
911201
911183
  }
911202
- const contents = await (0, import_promises133.readFile)(filepath);
911184
+ const contents = await (0, import_promises129.readFile)(filepath);
911203
911185
  context3.logger.debug(`Found generators: ${contents.toString()}`);
911204
911186
  const parsedDocument = import_yaml6.default.parseDocument(contents.toString());
911205
911187
  const generatorGroups = parsedDocument.get("groups");
@@ -911420,7 +911402,7 @@ async function upgradeGenerator({
911420
911402
  absolutePathToWorkspace: workspace.absoluteFilePath
911421
911403
  });
911422
911404
  if (absolutePathToGeneratorsConfiguration != null && result.updatedConfiguration != null) {
911423
- await (0, import_promises133.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
911405
+ await (0, import_promises129.writeFile)(absolutePathToGeneratorsConfiguration, result.updatedConfiguration);
911424
911406
  }
911425
911407
  allSkippedMajorUpgrades.push(...result.skippedMajorUpgrades);
911426
911408
  if (result.appliedUpgrades.length > 0) {
@@ -911818,7 +911800,7 @@ function addGeneratorCommands(cli, cliContext) {
911818
911800
  }
911819
911801
  if (argv.output) {
911820
911802
  try {
911821
- await (0, import_promises134.writeFile)(argv.output, JSON.stringify(generatorMetadata, null, 2));
911803
+ await (0, import_promises130.writeFile)(argv.output, JSON.stringify(generatorMetadata, null, 2));
911822
911804
  } catch (error50) {
911823
911805
  cliContext.failAndThrow(
911824
911806
  `Could not write file to the specified location: ${argv.output}`,
@@ -911832,7 +911814,7 @@ function addGeneratorCommands(cli, cliContext) {
911832
911814
  }
911833
911815
 
911834
911816
  // src/commands/add-generator/addGeneratorToWorkspaces.ts
911835
- var import_promises135 = require("fs/promises");
911817
+ var import_promises131 = require("fs/promises");
911836
911818
  async function addGeneratorToWorkspaces({
911837
911819
  project: { apiWorkspaces },
911838
911820
  generatorName,
@@ -911859,7 +911841,7 @@ async function addGeneratorToWorkspaces({
911859
911841
  if (absolutePathToGeneratorsConfiguration == null) {
911860
911842
  return;
911861
911843
  }
911862
- await (0, import_promises135.writeFile)(
911844
+ await (0, import_promises131.writeFile)(
911863
911845
  absolutePathToGeneratorsConfiguration,
911864
911846
  "# yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json\n" + jsYaml.dump(newConfiguration)
911865
911847
  );
@@ -912210,7 +912192,7 @@ async function previewDocsWorkspace({
912210
912192
 
912211
912193
  // src/commands/docs-diff/docsDiff.ts
912212
912194
  init_lib6();
912213
- var import_promises136 = require("fs/promises");
912195
+ var import_promises132 = require("fs/promises");
912214
912196
  var import_pngjs = __toESM(require_png2(), 1);
912215
912197
  async function getSlugForFiles({
912216
912198
  previewUrl,
@@ -912430,8 +912412,8 @@ async function generateComparisons({
912430
912412
  afterPath,
912431
912413
  comparisonBasePath
912432
912414
  }) {
912433
- const beforePng = import_pngjs.PNG.sync.read(await (0, import_promises136.readFile)(beforePath));
912434
- const afterPng = import_pngjs.PNG.sync.read(await (0, import_promises136.readFile)(afterPath));
912415
+ const beforePng = import_pngjs.PNG.sync.read(await (0, import_promises132.readFile)(beforePath));
912416
+ const afterPng = import_pngjs.PNG.sync.read(await (0, import_promises132.readFile)(afterPath));
912435
912417
  const beforeOriginalHeight = beforePng.height;
912436
912418
  const afterOriginalHeight = afterPng.height;
912437
912419
  const width = Math.max(beforePng.width, afterPng.width);
@@ -912469,7 +912451,7 @@ async function generateComparisons({
912469
912451
  const sideBySide = createSideBySideComparison(croppedBefore, croppedAfter, 20, true);
912470
912452
  const outPath = `${base4}-region-${i11 + 1}.png`;
912471
912453
  const pngBuffer = import_pngjs.PNG.sync.write(sideBySide);
912472
- await (0, import_promises136.writeFile)(outPath, new Uint8Array(pngBuffer));
912454
+ await (0, import_promises132.writeFile)(outPath, new Uint8Array(pngBuffer));
912473
912455
  results.push({ changePercent, boundingBox, comparisonPath: outPath });
912474
912456
  }
912475
912457
  return results;
@@ -912544,7 +912526,7 @@ async function docsDiff({
912544
912526
  outputDir.startsWith("/") ? outputDir : join2(cwd(), RelativeFilePath2.of(outputDir))
912545
912527
  );
912546
912528
  if (!await doesPathExist(outputPath)) {
912547
- await (0, import_promises136.mkdir)(outputPath, { recursive: true });
912529
+ await (0, import_promises132.mkdir)(outputPath, { recursive: true });
912548
912530
  }
912549
912531
  const results = [];
912550
912532
  await cliContext.runTask(async (context3) => {
@@ -916941,7 +916923,7 @@ function renderModuleTree(module4, ctx, writer2, parentPath) {
916941
916923
  }
916942
916924
 
916943
916925
  // src/commands/docs-md-generate/generateLibraryDocs.ts
916944
- var import_promises137 = require("fs/promises");
916926
+ var import_promises133 = require("fs/promises");
916945
916927
  function createLibraryDocsClient({ token }) {
916946
916928
  const defaultOrigin = "https://registry-dev2.buildwithfern.com";
916947
916929
  const baseUrl = process.env.FERN_FDR_ORIGIN ?? process.env.OVERRIDE_FDR_ORIGIN ?? defaultOrigin;
@@ -917055,7 +917037,7 @@ async function generateSingleLibrary({
917055
917037
  if (config5.lang === "cpp" && config5.config?.doxyfile != null) {
917056
917038
  const doxyfilePath = resolve5(docsWorkspace.absoluteFilePath, config5.config.doxyfile);
917057
917039
  try {
917058
- doxyfileContent = await (0, import_promises137.readFile)(doxyfilePath, "utf-8");
917040
+ doxyfileContent = await (0, import_promises133.readFile)(doxyfilePath, "utf-8");
917059
917041
  } catch {
917060
917042
  return interactiveTaskContext.failAndThrow(
917061
917043
  `Library '${name2}': Could not read Doxyfile at '${config5.config.doxyfile}' (resolved to ${doxyfilePath})`
@@ -917316,7 +917298,7 @@ Found ${previewDeployments.length} preview deployment(s):
917316
917298
  }
917317
917299
 
917318
917300
  // src/commands/downgrade/downgrade.ts
917319
- var import_promises138 = require("fs/promises");
917301
+ var import_promises134 = require("fs/promises");
917320
917302
 
917321
917303
  // ../../../node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.mjs
917322
917304
  var NOTHING = /* @__PURE__ */ Symbol.for("immer-nothing");
@@ -918063,13 +918045,13 @@ async function downgrade({
918063
918045
  const newProjectConfig = produce(projectConfig.rawConfig, (draft) => {
918064
918046
  draft.version = targetVersion;
918065
918047
  });
918066
- await (0, import_promises138.writeFile)(projectConfig._absolutePath, ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2)));
918048
+ await (0, import_promises134.writeFile)(projectConfig._absolutePath, ensureFinalNewline(JSON.stringify(newProjectConfig, void 0, 2)));
918067
918049
  cliContext.logger.info(`Updated ${PROJECT_CONFIG_FILENAME} to version ${targetVersion}`);
918068
918050
  }
918069
918051
 
918070
918052
  // src/commands/export/generateOpenAPIForWorkspaces.ts
918071
918053
  init_lib6();
918072
- var import_promises139 = require("fs/promises");
918054
+ var import_promises135 = require("fs/promises");
918073
918055
 
918074
918056
  // src/commands/export/converters/servicesConverter.ts
918075
918057
  init_lib4();
@@ -919400,8 +919382,8 @@ async function generateOpenAPIForWorkspaces({
919400
919382
  ir: ir15,
919401
919383
  mode: "openapi"
919402
919384
  });
919403
- await (0, import_promises139.mkdir)(dirname4(outputPath), { recursive: true });
919404
- await (0, import_promises139.writeFile)(
919385
+ await (0, import_promises135.mkdir)(dirname4(outputPath), { recursive: true });
919386
+ await (0, import_promises135.writeFile)(
919405
919387
  outputPath,
919406
919388
  outputPath.endsWith(".json") ? JSON.stringify(openapi, void 0, indent4) : jsYaml.dump(openapi, { indent: indent4 })
919407
919389
  );
@@ -919444,11 +919426,11 @@ var LOCAL_STORAGE_FOLDER6 = ".fern-dev";
919444
919426
 
919445
919427
  // src/commands/generate/checkOutputDirectory.ts
919446
919428
  init_lib6();
919447
- var import_promises142 = require("fs/promises");
919429
+ var import_promises138 = require("fs/promises");
919448
919430
 
919449
919431
  // src/persistence/output-directories/getOutputDirectories.ts
919450
919432
  init_lib6();
919451
- var import_promises140 = require("fs/promises");
919433
+ var import_promises136 = require("fs/promises");
919452
919434
 
919453
919435
  // src/persistence/output-directories/getPathToOutputDirectoriesFile.ts
919454
919436
  init_lib6();
@@ -919468,17 +919450,17 @@ async function getOutputDirectories() {
919468
919450
  if (!doesOutputDirectoriesFileExist) {
919469
919451
  return [];
919470
919452
  }
919471
- const outputDirectoriesFileContents = await (0, import_promises140.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
919453
+ const outputDirectoriesFileContents = await (0, import_promises136.readFile)(pathToOutputDirectoriesFile, { encoding: "utf-8" });
919472
919454
  const outputDirectories = JSON.parse(outputDirectoriesFileContents);
919473
919455
  return outputDirectories;
919474
919456
  }
919475
919457
 
919476
919458
  // src/persistence/output-directories/storeOutputDirectories.ts
919477
- var import_promises141 = require("fs/promises");
919459
+ var import_promises137 = require("fs/promises");
919478
919460
  var import_path82 = __toESM(require("path"), 1);
919479
919461
  async function storeOutputDirectories(outputDirectories) {
919480
- await (0, import_promises141.mkdir)(import_path82.default.dirname(getPathToOutputDirectoriesFile()), { recursive: true });
919481
- await (0, import_promises141.writeFile)(getPathToOutputDirectoriesFile(), JSON.stringify(outputDirectories, null, 2));
919462
+ await (0, import_promises137.mkdir)(import_path82.default.dirname(getPathToOutputDirectoriesFile()), { recursive: true });
919463
+ await (0, import_promises137.writeFile)(getPathToOutputDirectoriesFile(), JSON.stringify(outputDirectories, null, 2));
919482
919464
  }
919483
919465
 
919484
919466
  // src/commands/generate/checkOutputDirectory.ts
@@ -919500,7 +919482,7 @@ async function checkOutputDirectory(outputPath, cliContext, force) {
919500
919482
  shouldProceed: true
919501
919483
  };
919502
919484
  }
919503
- const files = await (0, import_promises142.readdir)(outputPath);
919485
+ const files = await (0, import_promises138.readdir)(outputPath);
919504
919486
  if (files.length === 0) {
919505
919487
  return {
919506
919488
  shouldProceed: true
@@ -919984,15 +919966,14 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
919984
919966
  }
919985
919967
  let token = null;
919986
919968
  if (hasFdrOriginOverride) {
919987
- const fernToken = process.env["FERN_TOKEN"];
919969
+ const fernToken = await getToken2();
919988
919970
  if (!fernToken) {
919989
- cliContext.failAndThrow("No token found. Please set the FERN_TOKEN environment variable.");
919971
+ cliContext.failAndThrow(
919972
+ "No token found. Please set the FERN_TOKEN environment variable or run `fern login`."
919973
+ );
919990
919974
  return;
919991
919975
  }
919992
- token = {
919993
- type: "organization",
919994
- value: fernToken
919995
- };
919976
+ token = fernToken;
919996
919977
  } else {
919997
919978
  token = await cliContext.runTask(async (context3) => {
919998
919979
  return askToLogin(context3);
@@ -920349,7 +920330,7 @@ async function generateOpenAPIIrForWorkspaces({
920349
920330
 
920350
920331
  // src/commands/generate-overrides/compareOpenAPISpecs.ts
920351
920332
  init_lib6();
920352
- var import_promises143 = require("fs/promises");
920333
+ var import_promises139 = require("fs/promises");
920353
920334
  async function compareOpenAPISpecs({
920354
920335
  originalPath,
920355
920336
  modifiedPath,
@@ -920386,12 +920367,12 @@ async function compareOpenAPISpecs({
920386
920367
  }
920387
920368
  outputPath = join2(dirname4(originalPath), RelativeFilePath2.of(overridesFilename));
920388
920369
  }
920389
- await (0, import_promises143.writeFile)(outputPath, jsYaml.dump(overrides, { lineWidth: -1, noRefs: true }));
920370
+ await (0, import_promises139.writeFile)(outputPath, jsYaml.dump(overrides, { lineWidth: -1, noRefs: true }));
920390
920371
  context3.logger.info(`Overrides written to ${outputPath}`);
920391
920372
  });
920392
920373
  }
920393
920374
  async function loadSpec2(filepath, context3) {
920394
- const contents = await (0, import_promises143.readFile)(filepath, "utf8");
920375
+ const contents = await (0, import_promises139.readFile)(filepath, "utf8");
920395
920376
  try {
920396
920377
  return JSON.parse(contents);
920397
920378
  } catch {
@@ -920493,7 +920474,7 @@ function deepEqual(a10, b19) {
920493
920474
 
920494
920475
  // src/commands/generate-overrides/writeOverridesForWorkspaces.ts
920495
920476
  init_lib6();
920496
- var import_promises144 = require("fs/promises");
920477
+ var import_promises140 = require("fs/promises");
920497
920478
  async function writeOverridesForWorkspaces({
920498
920479
  project,
920499
920480
  includeModels,
@@ -920518,7 +920499,7 @@ async function writeOverridesForWorkspaces({
920518
920499
  async function readExistingOverrides(overridesFilepath, context3) {
920519
920500
  let parsedOverrides = null;
920520
920501
  try {
920521
- const contents = (await (0, import_promises144.readFile)(overridesFilepath, "utf8")).toString();
920502
+ const contents = (await (0, import_promises140.readFile)(overridesFilepath, "utf8")).toString();
920522
920503
  try {
920523
920504
  parsedOverrides = JSON.parse(contents);
920524
920505
  } catch (err) {
@@ -920581,7 +920562,7 @@ async function writeDefinitionForOpenAPIWorkspace({
920581
920562
  for (const overridesPath of overridesPaths) {
920582
920563
  const existingOverrides = await readExistingOverrides(overridesPath, context3);
920583
920564
  const content5 = generateOverridesContent({ ir: ir15, existingOverrides, includeModels, context: context3 });
920584
- await (0, import_promises144.writeFile)(overridesPath, jsYaml.dump(content5));
920565
+ await (0, import_promises140.writeFile)(overridesPath, jsYaml.dump(content5));
920585
920566
  }
920586
920567
  } else {
920587
920568
  const content5 = generateOverridesContent({ ir: ir15, existingOverrides: {}, includeModels, context: context3 });
@@ -920595,7 +920576,7 @@ async function writeDefinitionForOpenAPIWorkspace({
920595
920576
  overridesFilename = `${nameWithoutExt}-overrides${extension5}`;
920596
920577
  }
920597
920578
  }
920598
- await (0, import_promises144.writeFile)(
920579
+ await (0, import_promises140.writeFile)(
920599
920580
  join2(dirname4(spec.absoluteFilepath), RelativeFilePath2.of(overridesFilename)),
920600
920581
  jsYaml.dump(content5)
920601
920582
  );
@@ -921009,7 +920990,7 @@ function convertIRtoJsonSchema(args) {
921009
920990
  }
921010
920991
 
921011
920992
  // src/commands/jsonschema/generateJsonschemaForWorkspace.ts
921012
- var import_promises145 = require("fs/promises");
920993
+ var import_promises141 = require("fs/promises");
921013
920994
  async function generateJsonschemaForWorkspaces({
921014
920995
  typeLocator,
921015
920996
  project,
@@ -921057,9 +921038,9 @@ async function generateJsonschemaForWorkspaces({
921057
921038
  context: context3
921058
921039
  });
921059
921040
  if (!await doesPathExist(dirname4(jsonschemaFilepath))) {
921060
- await (0, import_promises145.mkdir)(dirname4(jsonschemaFilepath), { recursive: true });
921041
+ await (0, import_promises141.mkdir)(dirname4(jsonschemaFilepath), { recursive: true });
921061
921042
  }
921062
- await (0, import_promises145.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
921043
+ await (0, import_promises141.writeFile)(jsonschemaFilepath, JSON.stringify(jsonSchema, null, 2));
921063
921044
  context3.logger.info(source_default.green(`Wrote JSON Schema to ${jsonschemaFilepath}`));
921064
921045
  });
921065
921046
  })
@@ -921068,7 +921049,7 @@ async function generateJsonschemaForWorkspaces({
921068
921049
 
921069
921050
  // src/commands/merge/mergeOpenAPIWithOverrides.ts
921070
921051
  init_lib6();
921071
- var import_promises146 = require("fs/promises");
921052
+ var import_promises142 = require("fs/promises");
921072
921053
  var HTTP_METHODS2 = /* @__PURE__ */ new Set(["get", "put", "post", "delete", "options", "head", "patch", "trace"]);
921073
921054
  async function mergeOpenAPIWithOverrides({
921074
921055
  openapiPath,
@@ -921089,12 +921070,12 @@ async function mergeOpenAPIWithOverrides({
921089
921070
  const merged = mergeExamplesIntoSpec(openapi, overrides, context3);
921090
921071
  const isJson = outputPath.endsWith(".json");
921091
921072
  const output2 = isJson ? JSON.stringify(merged, null, 2) : jsYaml.dump(merged, { lineWidth: -1, noRefs: true });
921092
- await (0, import_promises146.writeFile)(outputPath, output2);
921073
+ await (0, import_promises142.writeFile)(outputPath, output2);
921093
921074
  context3.logger.info(`Merged output written to ${outputPath}`);
921094
921075
  });
921095
921076
  }
921096
921077
  async function loadYamlOrJson(filepath, context3) {
921097
- const contents = await (0, import_promises146.readFile)(filepath, "utf8");
921078
+ const contents = await (0, import_promises142.readFile)(filepath, "utf8");
921098
921079
  try {
921099
921080
  return JSON.parse(contents);
921100
921081
  } catch {
@@ -921722,7 +921703,7 @@ async function mockServer({
921722
921703
 
921723
921704
  // src/commands/register/registerWorkspacesV1.ts
921724
921705
  var import_fiddle_sdk8 = __toESM(require_fiddle_sdk(), 1);
921725
- var import_promises147 = require("fs/promises");
921706
+ var import_promises143 = require("fs/promises");
921726
921707
  var import_path88 = __toESM(require("path"), 1);
921727
921708
  var import_tmp_promise16 = __toESM(require_tmp_promise(), 1);
921728
921709
  async function registerWorkspacesV1({
@@ -921771,7 +921752,7 @@ async function registerWorkspacesV1({
921771
921752
  context3.logger.debug(`Compressing definition at ${tmpDir.path}`);
921772
921753
  await Zn3({ file: tarPath, cwd: resolvedWorkspace.absoluteFilePath }, ["."]);
921773
921754
  context3.logger.info("Uploading definition...");
921774
- await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises147.readFile)(tarPath));
921755
+ await axios_default.put(registerApiResponse.body.definitionS3UploadUrl, await (0, import_promises143.readFile)(tarPath));
921775
921756
  context3.logger.info(
921776
921757
  `Registered @${project.config.organization}/${resolvedWorkspace.definition.rootApiFile.contents.name}:${registerApiResponse.body.version}`
921777
921758
  );
@@ -922228,7 +922209,7 @@ async function sdkPreview({
922228
922209
  }
922229
922210
 
922230
922211
  // src/commands/self-update/selfUpdate.ts
922231
- var import_promises148 = require("fs/promises");
922212
+ var import_promises144 = require("fs/promises");
922232
922213
  var import_path89 = require("path");
922233
922214
  async function getPackageManagerBinDir(logger4, pm) {
922234
922215
  let command3;
@@ -922274,7 +922255,7 @@ async function detectInstallationMethod(logger4) {
922274
922255
  logger4.debug(`Found fern at: ${fernPath}`);
922275
922256
  let resolvedPath;
922276
922257
  try {
922277
- resolvedPath = await (0, import_promises148.realpath)(fernPath);
922258
+ resolvedPath = await (0, import_promises144.realpath)(fernPath);
922278
922259
  logger4.debug(`Resolved to: ${resolvedPath}`);
922279
922260
  } catch (error50) {
922280
922261
  logger4.debug(`Failed to resolve symlink: ${error50}`);
@@ -922556,21 +922537,21 @@ async function generateToken({
922556
922537
  // src/commands/upgrade/updateApiSpec.ts
922557
922538
  init_lib6();
922558
922539
  var fs26 = __toESM(require("fs"), 1);
922559
- var import_promises149 = require("fs/promises");
922540
+ var import_promises145 = require("fs/promises");
922560
922541
  init_graphql();
922561
922542
  var import_stream16 = require("stream");
922562
- var import_promises150 = require("stream/promises");
922543
+ var import_promises146 = require("stream/promises");
922563
922544
  async function fetchAndWriteFile(url3, path97, logger4, indent4) {
922564
922545
  const resp = await fetch(url3);
922565
922546
  if (resp.ok && resp.body) {
922566
922547
  logger4.debug("Origin successfully fetched, writing to file");
922567
922548
  const fileStream = fs26.createWriteStream(path97);
922568
- await (0, import_promises150.finished)(import_stream16.Readable.fromWeb(resp.body).pipe(fileStream));
922569
- const fileContents = await (0, import_promises149.readFile)(path97, "utf8");
922549
+ await (0, import_promises146.finished)(import_stream16.Readable.fromWeb(resp.body).pipe(fileStream));
922550
+ const fileContents = await (0, import_promises145.readFile)(path97, "utf8");
922570
922551
  try {
922571
- await (0, import_promises149.writeFile)(path97, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
922552
+ await (0, import_promises145.writeFile)(path97, JSON.stringify(JSON.parse(fileContents), void 0, indent4), "utf8");
922572
922553
  } catch (e6) {
922573
- await (0, import_promises149.writeFile)(path97, jsYaml.dump(jsYaml.load(fileContents), { indent: indent4 }), "utf8");
922554
+ await (0, import_promises145.writeFile)(path97, jsYaml.dump(jsYaml.load(fileContents), { indent: indent4 }), "utf8");
922574
922555
  }
922575
922556
  logger4.debug("File written successfully");
922576
922557
  }
@@ -922720,14 +922701,14 @@ async function tryDirectJSONFetch(url3, logger4) {
922720
922701
  async function fetchGraphQLSchemaWithAutoDetection(url3, path97, logger4) {
922721
922702
  const postResult = await tryGraphQLIntrospection(url3, logger4);
922722
922703
  if (postResult.success) {
922723
- await (0, import_promises149.writeFile)(path97, postResult.result, "utf8");
922704
+ await (0, import_promises145.writeFile)(path97, postResult.result, "utf8");
922724
922705
  logger4.info("Successfully fetched GraphQL schema using POST introspection");
922725
922706
  return;
922726
922707
  }
922727
922708
  logger4.debug(`POST introspection failed: ${postResult.error}`);
922728
922709
  const getResult = await tryDirectJSONFetch(url3, logger4);
922729
922710
  if (getResult.success) {
922730
- await (0, import_promises149.writeFile)(path97, getResult.result, "utf8");
922711
+ await (0, import_promises145.writeFile)(path97, getResult.result, "utf8");
922731
922712
  logger4.info("Successfully fetched GraphQL schema using direct JSON fetch");
922732
922713
  return;
922733
922714
  }
@@ -922836,7 +922817,7 @@ async function processDefinitions({
922836
922817
  init_lib4();
922837
922818
 
922838
922819
  // ../cli-migrations/lib/migrations/0.0.191/discriminant/migration.js
922839
- var import_promises151 = require("fs/promises");
922820
+ var import_promises147 = require("fs/promises");
922840
922821
 
922841
922822
  // ../cli-migrations/lib/migrations/0.0.191/discriminant/getAllYamlFiles.js
922842
922823
  init_lib6();
@@ -922872,7 +922853,7 @@ var migration = {
922872
922853
  try {
922873
922854
  const fileContents = await getFileContents(yamlFilepath);
922874
922855
  const newContents = addDiscriminantToFile(fileContents);
922875
- await (0, import_promises151.writeFile)(yamlFilepath, newContents);
922856
+ await (0, import_promises147.writeFile)(yamlFilepath, newContents);
922876
922857
  } catch (error50) {
922877
922858
  context3.failAndThrow("Failed to migrate " + yamlFilepath, error50);
922878
922859
  }
@@ -922880,7 +922861,7 @@ var migration = {
922880
922861
  }
922881
922862
  };
922882
922863
  async function getFileContents(filepath) {
922883
- const buffer = await (0, import_promises151.readFile)(filepath);
922864
+ const buffer = await (0, import_promises147.readFile)(filepath);
922884
922865
  return buffer.toString();
922885
922866
  }
922886
922867
  var UNION_REGEX = /^(\s{2,})union:\s*$/gm;
@@ -922909,7 +922890,7 @@ var versionMigrations = {
922909
922890
  var __default = versionMigrations;
922910
922891
 
922911
922892
  // ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/migration.js
922912
- var import_promises152 = require("fs/promises");
922893
+ var import_promises148 = require("fs/promises");
922913
922894
  var import_yaml7 = __toESM(require_dist8(), 1);
922914
922895
 
922915
922896
  // ../cli-migrations/lib/migrations/0.0.203/union-single-property-key/getAllYamlFiles.js
@@ -922952,7 +922933,7 @@ var migration2 = {
922952
922933
  }
922953
922934
  };
922954
922935
  async function migrateFile(filepath, context3) {
922955
- const contents = await (0, import_promises152.readFile)(filepath);
922936
+ const contents = await (0, import_promises148.readFile)(filepath);
922956
922937
  const parsedDocument = import_yaml7.default.parseDocument(contents.toString());
922957
922938
  const types4 = parsedDocument.get("types");
922958
922939
  if (types4 == null) {
@@ -922984,7 +922965,7 @@ async function migrateFile(filepath, context3) {
922984
922965
  }
922985
922966
  }
922986
922967
  }
922987
- await (0, import_promises152.writeFile)(filepath, parsedDocument.toString());
922968
+ await (0, import_promises148.writeFile)(filepath, parsedDocument.toString());
922988
922969
  }
922989
922970
 
922990
922971
  // ../cli-migrations/lib/migrations/0.0.203/index.js
@@ -922995,7 +922976,7 @@ var versionMigrations2 = {
922995
922976
  var __default2 = versionMigrations2;
922996
922977
 
922997
922978
  // ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/migration.js
922998
- var import_promises153 = require("fs/promises");
922979
+ var import_promises149 = require("fs/promises");
922999
922980
  var import_yaml8 = __toESM(require_dist8(), 1);
923000
922981
 
923001
922982
  // ../cli-migrations/lib/migrations/0.0.207/add-mode-to-draft-generators/getAllGeneratorYamlFiles.js
@@ -923038,7 +923019,7 @@ var migration3 = {
923038
923019
  }
923039
923020
  };
923040
923021
  async function migrateGeneratorsYml(filepath, context3) {
923041
- const contents = await (0, import_promises153.readFile)(filepath);
923022
+ const contents = await (0, import_promises149.readFile)(filepath);
923042
923023
  const parsedDocument = import_yaml8.default.parseDocument(contents.toString());
923043
923024
  const draftGenerators = parsedDocument.get("draft");
923044
923025
  if (draftGenerators == null) {
@@ -923065,7 +923046,7 @@ async function migrateGeneratorsYml(filepath, context3) {
923065
923046
  draftGenerator.set("output-path", name2.value.includes("openapi") ? "./generated-openapi" : name2.value.includes("postman") ? "./generated-postman" : localOutput);
923066
923047
  }
923067
923048
  });
923068
- await (0, import_promises153.writeFile)(filepath, parsedDocument.toString());
923049
+ await (0, import_promises149.writeFile)(filepath, parsedDocument.toString());
923069
923050
  }
923070
923051
 
923071
923052
  // ../cli-migrations/lib/migrations/0.0.207/index.js
@@ -923076,7 +923057,7 @@ var versionMigrations3 = {
923076
923057
  var __default3 = versionMigrations3;
923077
923058
 
923078
923059
  // ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/migration.js
923079
- var import_promises154 = require("fs/promises");
923060
+ var import_promises150 = require("fs/promises");
923080
923061
  var import_yaml9 = __toESM(require_dist8(), 1);
923081
923062
 
923082
923063
  // ../cli-migrations/lib/migrations/0.0.210/remove-inline-error-declarations/getAllYamlFiles.js
@@ -923119,7 +923100,7 @@ var migration4 = {
923119
923100
  }
923120
923101
  };
923121
923102
  async function migrateFile2(filepath, context3) {
923122
- const contents = await (0, import_promises154.readFile)(filepath);
923103
+ const contents = await (0, import_promises150.readFile)(filepath);
923123
923104
  const parsedDocument = import_yaml9.default.parseDocument(contents.toString());
923124
923105
  const addType = (typeName, typeDeclaration2) => {
923125
923106
  const types4 = parsedDocument.get("types");
@@ -923163,7 +923144,7 @@ async function migrateFile2(filepath, context3) {
923163
923144
  }
923164
923145
  }
923165
923146
  }
923166
- await (0, import_promises154.writeFile)(filepath, parsedDocument.toString());
923147
+ await (0, import_promises150.writeFile)(filepath, parsedDocument.toString());
923167
923148
  }
923168
923149
 
923169
923150
  // ../cli-migrations/lib/migrations/0.0.210/index.js
@@ -923174,7 +923155,7 @@ var versionMigrations4 = {
923174
923155
  var __default4 = versionMigrations4;
923175
923156
 
923176
923157
  // ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/migration.js
923177
- var import_promises155 = require("fs/promises");
923158
+ var import_promises151 = require("fs/promises");
923178
923159
  var import_yaml10 = __toESM(require_dist8(), 1);
923179
923160
 
923180
923161
  // ../cli-migrations/lib/migrations/0.0.212/add-publishing-to-release-generators/getAllGeneratorYamlFiles.js
@@ -923217,7 +923198,7 @@ var migration5 = {
923217
923198
  }
923218
923199
  };
923219
923200
  async function migrateGeneratorsYml2(filepath, context3) {
923220
- const contents = await (0, import_promises155.readFile)(filepath);
923201
+ const contents = await (0, import_promises151.readFile)(filepath);
923221
923202
  const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
923222
923203
  const releaseGenerators = parsedDocument.get("release");
923223
923204
  if (releaseGenerators == null) {
@@ -923255,7 +923236,7 @@ async function migrateGeneratorsYml2(filepath, context3) {
923255
923236
  }
923256
923237
  releaseGenerator.delete("outputs");
923257
923238
  });
923258
- await (0, import_promises155.writeFile)(filepath, parsedDocument.toString());
923239
+ await (0, import_promises151.writeFile)(filepath, parsedDocument.toString());
923259
923240
  }
923260
923241
 
923261
923242
  // ../cli-migrations/lib/migrations/0.0.212/index.js
@@ -923266,7 +923247,7 @@ var versionMigrations5 = {
923266
923247
  var __default5 = versionMigrations5;
923267
923248
 
923268
923249
  // ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/migration.js
923269
- var import_promises156 = require("fs/promises");
923250
+ var import_promises152 = require("fs/promises");
923270
923251
 
923271
923252
  // ../cli-migrations/lib/migrations/0.0.220/rename-alias-key-to-type/getAllYamlFiles.js
923272
923253
  init_lib6();
@@ -923299,9 +923280,9 @@ var migration6 = {
923299
923280
  run: async ({ context: context3 }) => {
923300
923281
  const yamlFiles = await getAllYamlFiles4(context3);
923301
923282
  for (const filepath of yamlFiles) {
923302
- const contents = await (0, import_promises156.readFile)(filepath);
923283
+ const contents = await (0, import_promises152.readFile)(filepath);
923303
923284
  const newContents = contents.toString().replaceAll(" alias:", " type:");
923304
- await (0, import_promises156.writeFile)(filepath, newContents);
923285
+ await (0, import_promises152.writeFile)(filepath, newContents);
923305
923286
  }
923306
923287
  }
923307
923288
  };
@@ -923314,7 +923295,7 @@ var versionMigrations6 = {
923314
923295
  var __default6 = versionMigrations6;
923315
923296
 
923316
923297
  // ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/migration.js
923317
- var import_promises157 = require("fs/promises");
923298
+ var import_promises153 = require("fs/promises");
923318
923299
 
923319
923300
  // ../cli-migrations/lib/migrations/0.0.221/add-error-discriminant/getAllRootApiYamlFiles.js
923320
923301
  init_lib6();
@@ -923347,9 +923328,9 @@ var migration7 = {
923347
923328
  run: async ({ context: context3 }) => {
923348
923329
  const yamlFiles = await getAllRootApiYamlFiles(context3);
923349
923330
  for (const filepath of yamlFiles) {
923350
- const contents = await (0, import_promises157.readFile)(filepath);
923331
+ const contents = await (0, import_promises153.readFile)(filepath);
923351
923332
  const newContents = contents.toString() + "\nerror-discriminant: error";
923352
- await (0, import_promises157.writeFile)(filepath, newContents);
923333
+ await (0, import_promises153.writeFile)(filepath, newContents);
923353
923334
  }
923354
923335
  }
923355
923336
  };
@@ -923363,7 +923344,7 @@ var __default7 = versionMigrations7;
923363
923344
 
923364
923345
  // ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/migration.js
923365
923346
  init_lib4();
923366
- var import_promises158 = require("fs/promises");
923347
+ var import_promises154 = require("fs/promises");
923367
923348
 
923368
923349
  // ../cli-migrations/lib/migrations/0.0.241/add-generator-groups/getAllGeneratorYamlFiles.js
923369
923350
  init_lib6();
@@ -923472,7 +923453,7 @@ var migration8 = {
923472
923453
  }
923473
923454
  };
923474
923455
  async function migrateGeneratorsYml3(filepath) {
923475
- const contentsStr = await (0, import_promises158.readFile)(filepath);
923456
+ const contentsStr = await (0, import_promises154.readFile)(filepath);
923476
923457
  const contents = jsYaml.load(contentsStr.toString());
923477
923458
  const oldGeneratorsConfiguration = GeneratorsConfigurationSchema2.parse(contents);
923478
923459
  let newGeneratorsConfiguration = {};
@@ -923490,7 +923471,7 @@ async function migrateGeneratorsYml3(filepath) {
923490
923471
  generators: oldGeneratorsConfiguration.release.map((releaseGeneratorInvocation) => convertReleaseGeneratorInvocation(releaseGeneratorInvocation))
923491
923472
  };
923492
923473
  }
923493
- await (0, import_promises158.writeFile)(filepath, jsYaml.dump(newGeneratorsConfiguration));
923474
+ await (0, import_promises154.writeFile)(filepath, jsYaml.dump(newGeneratorsConfiguration));
923494
923475
  }
923495
923476
  function convertDraftGeneratorInvocation(draftGeneratorInvocation) {
923496
923477
  const newSchema = {
@@ -923565,7 +923546,7 @@ var versionMigrations8 = {
923565
923546
  var __default8 = versionMigrations8;
923566
923547
 
923567
923548
  // ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/migration.js
923568
- var import_promises159 = require("fs/promises");
923549
+ var import_promises155 = require("fs/promises");
923569
923550
  var import_yaml11 = __toESM(require_dist8(), 1);
923570
923551
 
923571
923552
  // ../cli-migrations/lib/migrations/0.0.248/add-error-discrimination-config/getAllRootApiYamlFiles.js
@@ -923608,7 +923589,7 @@ var migration9 = {
923608
923589
  }
923609
923590
  };
923610
923591
  async function migrateRootApiFile(filepath) {
923611
- const contents = await (0, import_promises159.readFile)(filepath);
923592
+ const contents = await (0, import_promises155.readFile)(filepath);
923612
923593
  const parsedDocument = import_yaml11.default.parseDocument(contents.toString());
923613
923594
  const errorDiscriminant = parsedDocument.get("error-discriminant", true);
923614
923595
  if (errorDiscriminant == null || !import_yaml11.default.isScalar(errorDiscriminant) || typeof errorDiscriminant.value !== "string") {
@@ -923619,7 +923600,7 @@ async function migrateRootApiFile(filepath) {
923619
923600
  "property-name": errorDiscriminant.value
923620
923601
  });
923621
923602
  parsedDocument.delete("error-discriminant");
923622
- await (0, import_promises159.writeFile)(filepath, parsedDocument.toString());
923603
+ await (0, import_promises155.writeFile)(filepath, parsedDocument.toString());
923623
923604
  }
923624
923605
 
923625
923606
  // ../cli-migrations/lib/migrations/0.0.248/index.js
@@ -923630,7 +923611,7 @@ var versionMigrations9 = {
923630
923611
  var __default9 = versionMigrations9;
923631
923612
 
923632
923613
  // ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/migration.js
923633
- var import_promises160 = require("fs/promises");
923614
+ var import_promises156 = require("fs/promises");
923634
923615
  var import_yaml12 = __toESM(require_dist8(), 1);
923635
923616
 
923636
923617
  // ../cli-migrations/lib/migrations/0.1.3-rc3/add-inline-requests/getAllYamlFiles.js
@@ -923673,7 +923654,7 @@ var migration10 = {
923673
923654
  }
923674
923655
  };
923675
923656
  async function migrateYamlFile(filepath, context3) {
923676
- const contents = await (0, import_promises160.readFile)(filepath);
923657
+ const contents = await (0, import_promises156.readFile)(filepath);
923677
923658
  const parsedDocument = import_yaml12.default.parseDocument(contents.toString());
923678
923659
  const services = parsedDocument.get("services");
923679
923660
  if (services == null) {
@@ -923713,7 +923694,7 @@ async function migrateYamlFile(filepath, context3) {
923713
923694
  context3.failWithoutThrowing("Failed to convert endpoint", e6);
923714
923695
  }
923715
923696
  }
923716
- await (0, import_promises160.writeFile)(filepath, parsedDocument.toString());
923697
+ await (0, import_promises156.writeFile)(filepath, parsedDocument.toString());
923717
923698
  }
923718
923699
  }
923719
923700
  function convertEndpoint4({ document: document4, endpoint: endpoint3 }) {
@@ -923792,7 +923773,7 @@ var versionMigrations10 = {
923792
923773
  var __default10 = versionMigrations10;
923793
923774
 
923794
923775
  // ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/migration.js
923795
- var import_promises161 = require("fs/promises");
923776
+ var import_promises157 = require("fs/promises");
923796
923777
  var import_yaml13 = __toESM(require_dist8(), 1);
923797
923778
 
923798
923779
  // ../cli-migrations/lib/migrations/0.3.0-rc12/add-value-key-to-type-examples/getAllYamlFiles.js
@@ -923835,7 +923816,7 @@ var migration11 = {
923835
923816
  }
923836
923817
  };
923837
923818
  async function migrateYamlFile2(filepath, context3) {
923838
- const contents = await (0, import_promises161.readFile)(filepath);
923819
+ const contents = await (0, import_promises157.readFile)(filepath);
923839
923820
  const parsedDocument = import_yaml13.default.parseDocument(contents.toString());
923840
923821
  const types4 = parsedDocument.get("types");
923841
923822
  if (types4 == null) {
@@ -923861,7 +923842,7 @@ async function migrateYamlFile2(filepath, context3) {
923861
923842
  examples.set(i11, { value });
923862
923843
  }
923863
923844
  }
923864
- await (0, import_promises161.writeFile)(filepath, parsedDocument.toString());
923845
+ await (0, import_promises157.writeFile)(filepath, parsedDocument.toString());
923865
923846
  }
923866
923847
 
923867
923848
  // ../cli-migrations/lib/migrations/0.3.0-rc12/index.js
@@ -923872,7 +923853,7 @@ var versionMigrations11 = {
923872
923853
  var __default11 = versionMigrations11;
923873
923854
 
923874
923855
  // ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/migration.js
923875
- var import_promises162 = require("fs/promises");
923856
+ var import_promises158 = require("fs/promises");
923876
923857
  var import_yaml14 = __toESM(require_dist8(), 1);
923877
923858
 
923878
923859
  // ../cli-migrations/lib/migrations/0.3.23/change-services-key-to-service/getAllYamlFiles.js
@@ -923915,7 +923896,7 @@ var migration12 = {
923915
923896
  }
923916
923897
  };
923917
923898
  async function migrateYamlFile3(filepath, context3) {
923918
- const contents = await (0, import_promises162.readFile)(filepath);
923899
+ const contents = await (0, import_promises158.readFile)(filepath);
923919
923900
  const parsedDocument = import_yaml14.default.parseDocument(contents.toString());
923920
923901
  if (!import_yaml14.default.isMap(parsedDocument.contents)) {
923921
923902
  return context3.failAndThrow("File is not a map");
@@ -923945,7 +923926,7 @@ async function migrateYamlFile3(filepath, context3) {
923945
923926
  pair.value = firstService.value;
923946
923927
  }
923947
923928
  }
923948
- await (0, import_promises162.writeFile)(filepath, parsedDocument.toString());
923929
+ await (0, import_promises158.writeFile)(filepath, parsedDocument.toString());
923949
923930
  }
923950
923931
 
923951
923932
  // ../cli-migrations/lib/migrations/0.3.23/index.js
@@ -923956,7 +923937,7 @@ var versionMigrations12 = {
923956
923937
  var __default12 = versionMigrations12;
923957
923938
 
923958
923939
  // ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/migration.js
923959
- var import_promises163 = require("fs/promises");
923940
+ var import_promises159 = require("fs/promises");
923960
923941
  var import_yaml15 = __toESM(require_dist8(), 1);
923961
923942
 
923962
923943
  // ../cli-migrations/lib/migrations/0.5.4/move-service-docs-to-top-level/getAllYamlFiles.js
@@ -923999,7 +923980,7 @@ var migration13 = {
923999
923980
  }
924000
923981
  };
924001
923982
  async function migrateYamlFile4(filepath, context3) {
924002
- const contents = await (0, import_promises163.readFile)(filepath);
923983
+ const contents = await (0, import_promises159.readFile)(filepath);
924003
923984
  const parsedDocument = import_yaml15.default.parseDocument(contents.toString());
924004
923985
  if (!import_yaml15.default.isMap(parsedDocument.contents)) {
924005
923986
  return context3.failAndThrow("File is not a map");
@@ -924018,7 +923999,7 @@ async function migrateYamlFile4(filepath, context3) {
924018
923999
  }
924019
924000
  service.items.splice(indexOfServiceDocsPair, 1);
924020
924001
  parsedDocument.contents.items.unshift(docsPair);
924021
- await (0, import_promises163.writeFile)(filepath, parsedDocument.toString());
924002
+ await (0, import_promises159.writeFile)(filepath, parsedDocument.toString());
924022
924003
  }
924023
924004
 
924024
924005
  // ../cli-migrations/lib/migrations/0.5.4/index.js
@@ -924029,7 +924010,7 @@ var versionMigrations13 = {
924029
924010
  var __default13 = versionMigrations13;
924030
924011
 
924031
924012
  // ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/migration.js
924032
- var import_promises164 = require("fs/promises");
924013
+ var import_promises160 = require("fs/promises");
924033
924014
 
924034
924015
  // ../cli-migrations/lib/migrations/0.9.10/add-suffix-to-docs-domain/getAllGeneratorYamlFiles.js
924035
924016
  init_lib6();
@@ -924071,14 +924052,14 @@ var migration14 = {
924071
924052
  }
924072
924053
  };
924073
924054
  async function migrateYamlFile5(filepath) {
924074
- const contents = await (0, import_promises164.readFile)(filepath);
924055
+ const contents = await (0, import_promises160.readFile)(filepath);
924075
924056
  const domainSuffix = process.env.DOMAIN_SUFFIX ?? "docs.buildwithfern.com";
924076
924057
  const regex6 = /(docs:\s*domain:\s*)"([^"]*)"/g;
924077
924058
  const updatedSnapshot = contents.toString().replace(regex6, (_match, _prefix, domain3) => {
924078
924059
  return `docs:
924079
924060
  domain: "${domain3}.${domainSuffix}"`;
924080
924061
  });
924081
- await (0, import_promises164.writeFile)(filepath, updatedSnapshot.toString());
924062
+ await (0, import_promises160.writeFile)(filepath, updatedSnapshot.toString());
924082
924063
  }
924083
924064
 
924084
924065
  // ../cli-migrations/lib/migrations/0.9.10/index.js
@@ -924098,10 +924079,10 @@ var LegacyDocsSerializers = __toESM(require_serialization5(), 1);
924098
924079
 
924099
924080
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/loadRawDocsConfiguration.js
924100
924081
  init_lib6();
924101
- var import_promises165 = require("fs/promises");
924082
+ var import_promises161 = require("fs/promises");
924102
924083
  async function loadRawDocsConfiguration2({ absolutePathToWorkspace }) {
924103
924084
  const filepath = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
924104
- const contentsStr = await (0, import_promises165.readFile)(filepath);
924085
+ const contentsStr = await (0, import_promises161.readFile)(filepath);
924105
924086
  const contentsParsed = jsYaml.load(contentsStr.toString());
924106
924087
  const result = await LegacyDocsSerializers.DocsConfiguration.parse(contentsParsed);
924107
924088
  if (result.ok) {
@@ -924120,7 +924101,7 @@ function getAbsolutePathToDocsFolder({ absolutePathToWorkspace }) {
924120
924101
 
924121
924102
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndMultipleAPIs.js
924122
924103
  init_lib6();
924123
- var import_promises167 = require("fs/promises");
924104
+ var import_promises163 = require("fs/promises");
924124
924105
 
924125
924106
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/docs-config/convertLegacyDocsConfig.js
924126
924107
  function convertLegacyDocsConfig({ docsConfiguration, docsURLs, apiName }) {
@@ -924303,10 +924284,10 @@ __export(legacy_exports, {
924303
924284
 
924304
924285
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/generators-configuration/loadRawGeneratorsConfiguration.js
924305
924286
  init_lib6();
924306
- var import_promises166 = require("fs/promises");
924287
+ var import_promises162 = require("fs/promises");
924307
924288
  async function loadRawGeneratorsConfiguration2({ absolutePathToWorkspace }) {
924308
924289
  const filepath = getAbsolutePathToGeneratorsConfiguration({ absolutePathToWorkspace });
924309
- const contentsStr = await (0, import_promises166.readFile)(filepath);
924290
+ const contentsStr = await (0, import_promises162.readFile)(filepath);
924310
924291
  const contentsParsed = jsYaml.load(contentsStr.toString());
924311
924292
  const result = await legacy_exports.GeneratorsConfigurationSchema.safeParseAsync(contentsParsed);
924312
924293
  if (result.success) {
@@ -924336,7 +924317,7 @@ function migrateDocsInstances(docsURLs) {
924336
924317
  var APIS_DIRECTORY2 = "apis";
924337
924318
  async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspaces, workspaceContainingDocs }) {
924338
924319
  const absolutePathToApisDirectory = join2(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY2));
924339
- await (0, import_promises167.mkdir)(absolutePathToApisDirectory);
924320
+ await (0, import_promises163.mkdir)(absolutePathToApisDirectory);
924340
924321
  for (const workspace of workspaces) {
924341
924322
  const absolutePathToWorkspace = join2(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
924342
924323
  const docsURLs = await migrateAndWriteGeneratorsYml({ absolutePathToWorkspace });
@@ -924344,11 +924325,11 @@ async function migrateDocsAndMultipleAPIs({ absolutePathToFernDirectory, workspa
924344
924325
  await migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName: workspaceContainingDocs });
924345
924326
  const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
924346
924327
  await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
924347
- await (0, import_promises167.rm)(absolutePathToDocsFolder, { recursive: true });
924328
+ await (0, import_promises163.rm)(absolutePathToDocsFolder, { recursive: true });
924348
924329
  }
924349
924330
  const absolutePathToNestedWorkspace = join2(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
924350
924331
  await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
924351
- await (0, import_promises167.rm)(absolutePathToWorkspace, { recursive: true });
924332
+ await (0, import_promises163.rm)(absolutePathToWorkspace, { recursive: true });
924352
924333
  }
924353
924334
  }
924354
924335
  async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
@@ -924361,7 +924342,7 @@ async function migrateAndWriteGeneratorsYml({ absolutePathToWorkspace }) {
924361
924342
  generatorsConfiguration,
924362
924343
  pathModificationStrategy: PathModificationStrategy.Nest
924363
924344
  });
924364
- await (0, import_promises167.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924345
+ await (0, import_promises163.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924365
924346
  return convertedResponse.docsURLs;
924366
924347
  }
924367
924348
  async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiName }) {
@@ -924375,20 +924356,20 @@ async function migrateAndWriteDocsYml({ absolutePathToWorkspace, docsURLs, apiNa
924375
924356
  apiName
924376
924357
  });
924377
924358
  const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
924378
- await (0, import_promises167.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
924359
+ await (0, import_promises163.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
924379
924360
  }
924380
924361
 
924381
924362
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateDocsAndSingleAPI.js
924382
924363
  init_lib6();
924383
- var import_promises168 = require("fs/promises");
924364
+ var import_promises164 = require("fs/promises");
924384
924365
  async function migrateDocsAndSingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
924385
924366
  const docsURLs = await migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace });
924386
924367
  await migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs });
924387
924368
  const absolutePathToDocsFolder = getAbsolutePathToDocsFolder({ absolutePathToWorkspace });
924388
924369
  await moveFolder({ src: absolutePathToDocsFolder, dest: absolutePathToFernDirectory });
924389
924370
  await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
924390
- await (0, import_promises168.rm)(absolutePathToDocsFolder, { recursive: true });
924391
- await (0, import_promises168.rm)(absolutePathToWorkspace, { recursive: true });
924371
+ await (0, import_promises164.rm)(absolutePathToDocsFolder, { recursive: true });
924372
+ await (0, import_promises164.rm)(absolutePathToWorkspace, { recursive: true });
924392
924373
  }
924393
924374
  async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
924394
924375
  const docsConfiguration = await loadRawDocsConfiguration2({ absolutePathToWorkspace });
@@ -924401,7 +924382,7 @@ async function migrateAndWriteDocsYml2({ absolutePathToWorkspace, docsURLs }) {
924401
924382
  apiName: void 0
924402
924383
  });
924403
924384
  const absolutePathToDocsConfig = getAbsolutePathToDocsYaml({ absolutePathToWorkspace });
924404
- await (0, import_promises168.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
924385
+ await (0, import_promises164.writeFile)(absolutePathToDocsConfig, jsYaml.dump(convertedDocsConfig));
924405
924386
  }
924406
924387
  async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
924407
924388
  const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
@@ -924413,23 +924394,23 @@ async function migrateAndWriteGeneratorsYml2({ absolutePathToWorkspace }) {
924413
924394
  generatorsConfiguration,
924414
924395
  pathModificationStrategy: "MoveUp"
924415
924396
  });
924416
- await (0, import_promises168.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924397
+ await (0, import_promises164.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924417
924398
  return convertedResponse.docsURLs;
924418
924399
  }
924419
924400
 
924420
924401
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlyMultipleAPIs.js
924421
924402
  init_lib6();
924422
- var import_promises169 = require("fs/promises");
924403
+ var import_promises165 = require("fs/promises");
924423
924404
  var APIS_DIRECTORY3 = "apis";
924424
924405
  async function migrateOnlyMultipleAPIs({ absolutePathToFernDirectory, workspaces }) {
924425
924406
  const absolutePathToApisDirectory = join2(absolutePathToFernDirectory, RelativeFilePath2.of(APIS_DIRECTORY3));
924426
- await (0, import_promises169.mkdir)(absolutePathToApisDirectory);
924407
+ await (0, import_promises165.mkdir)(absolutePathToApisDirectory);
924427
924408
  for (const workspace of workspaces) {
924428
924409
  const absolutePathToWorkspace = join2(absolutePathToFernDirectory, RelativeFilePath2.of(workspace));
924429
924410
  await migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace });
924430
924411
  const absolutePathToNestedWorkspace = join2(absolutePathToApisDirectory, RelativeFilePath2.of(workspace));
924431
924412
  await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToNestedWorkspace });
924432
- await (0, import_promises169.rm)(absolutePathToWorkspace, { recursive: true });
924413
+ await (0, import_promises165.rm)(absolutePathToWorkspace, { recursive: true });
924433
924414
  }
924434
924415
  }
924435
924416
  async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
@@ -924442,16 +924423,16 @@ async function migrateAndWriteGeneratorsYml3({ absolutePathToWorkspace }) {
924442
924423
  generatorsConfiguration,
924443
924424
  pathModificationStrategy: PathModificationStrategy.Nest
924444
924425
  });
924445
- await (0, import_promises169.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924426
+ await (0, import_promises165.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924446
924427
  }
924447
924428
 
924448
924429
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migrateOnlySingleAPI.js
924449
924430
  init_lib6();
924450
- var import_promises170 = require("fs/promises");
924431
+ var import_promises166 = require("fs/promises");
924451
924432
  async function migrateOnlySingleAPI({ absolutePathToFernDirectory, absolutePathToWorkspace }) {
924452
924433
  await migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace });
924453
924434
  await moveFolder({ src: absolutePathToWorkspace, dest: absolutePathToFernDirectory });
924454
- await (0, import_promises170.rm)(absolutePathToWorkspace, { recursive: true });
924435
+ await (0, import_promises166.rm)(absolutePathToWorkspace, { recursive: true });
924455
924436
  }
924456
924437
  async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
924457
924438
  const generatorsConfiguration = await loadRawGeneratorsConfiguration2({ absolutePathToWorkspace });
@@ -924463,7 +924444,7 @@ async function migrateAndWriteGeneratorsYml4({ absolutePathToWorkspace }) {
924463
924444
  generatorsConfiguration,
924464
924445
  pathModificationStrategy: "MoveUp"
924465
924446
  });
924466
- await (0, import_promises170.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924447
+ await (0, import_promises166.writeFile)(absolutePathToGeneratorsConfiguration, jsYaml.dump(convertedResponse.value));
924467
924448
  }
924468
924449
 
924469
924450
  // ../cli-migrations/lib/migrations/0.15.0-rc0/update-directory-structure/migration.js
@@ -924541,7 +924522,7 @@ var __default15 = versionMigrations15;
924541
924522
 
924542
924523
  // ../cli-migrations/lib/migrations/0.41.0-rc0/require-generators-yml/migration.js
924543
924524
  init_lib6();
924544
- var import_promises171 = require("fs/promises");
924525
+ var import_promises167 = require("fs/promises");
924545
924526
  var import_yaml16 = __toESM(require_dist8(), 1);
924546
924527
  var migration16 = {
924547
924528
  name: "require-generators-yml",
@@ -924584,7 +924565,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
924584
924565
  if (existingGeneratorsYml == null) {
924585
924566
  if (openapiDirectory != null && openapiDirectory.contents[0] != null) {
924586
924567
  const absolutePathToGeneratorsYml = join2(absoluteFilepathToWorkspace, RelativeFilePath2.of("generators.yml"));
924587
- await (0, import_promises171.writeFile)(absolutePathToGeneratorsYml, jsYaml.dump({
924568
+ await (0, import_promises167.writeFile)(absolutePathToGeneratorsYml, jsYaml.dump({
924588
924569
  api: {
924589
924570
  path: join2(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
924590
924571
  }
@@ -924599,7 +924580,7 @@ async function addApiConfigurationToSingleWorkspace({ absolutePathToFernDirector
924599
924580
  parsedDocument.set("api", {
924600
924581
  path: join2(relativize(absolutePathToFernDirectory, absoluteFilepathToWorkspace), RelativeFilePath2.of(openapiDirectory.name), RelativeFilePath2.of(openapiDirectory.contents[0]?.name))
924601
924582
  });
924602
- await (0, import_promises171.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
924583
+ await (0, import_promises167.writeFile)(existingGeneratorsYml.absolutePath, parsedDocument.toString());
924603
924584
  context3.logger.info(source_default.green(`Updated ${existingGeneratorsYml.absolutePath}`));
924604
924585
  }
924605
924586
  }
@@ -924627,7 +924608,7 @@ var __default16 = versionMigrations16;
924627
924608
 
924628
924609
  // ../cli-migrations/lib/migrations/0.54.0-rc0/use-generators-yml-specs/migration.js
924629
924610
  init_lib6();
924630
- var import_promises172 = require("fs/promises");
924611
+ var import_promises168 = require("fs/promises");
924631
924612
  var import_yaml17 = __toESM(require_dist8(), 1);
924632
924613
  var migration17 = {
924633
924614
  name: "generators-yml-use-api-specs",
@@ -924807,7 +924788,7 @@ async function addApiConfigurationToSingleWorkspace2({ absoluteFilepathToWorkspa
924807
924788
  if (schemaComment && documentToWrite.indexOf(schemaComment) === -1) {
924808
924789
  documentToWrite = `${schemaComment}${documentToWrite}`;
924809
924790
  }
924810
- await (0, import_promises172.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
924791
+ await (0, import_promises168.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
924811
924792
  context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
924812
924793
  }
924813
924794
  async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, directories, context: context3, namespace }) {
@@ -924854,7 +924835,7 @@ async function parseApiSpec({ oldSpec, absoluteFilepathToWorkspace, files, direc
924854
924835
  }
924855
924836
  let specContent;
924856
924837
  try {
924857
- const fileContents = await (0, import_promises172.readFile)(absoluteSpecPath, { encoding: "utf-8" });
924838
+ const fileContents = await (0, import_promises168.readFile)(absoluteSpecPath, { encoding: "utf-8" });
924858
924839
  specContent = jsYaml.load(fileContents);
924859
924840
  } catch (e6) {
924860
924841
  context3.logger.warn(`Failed to read API spec file ${spec.path}. Error: ${e6}. Skipping...`);
@@ -924958,7 +924939,7 @@ var __default17 = versionMigrations17;
924958
924939
 
924959
924940
  // ../cli-migrations/lib/migrations/0.82.1/add-path-parameter-order-setting/migration.js
924960
924941
  init_lib6();
924961
- var import_promises173 = require("fs/promises");
924942
+ var import_promises169 = require("fs/promises");
924962
924943
  var migration18 = {
924963
924944
  name: "add-path-parameter-order-setting",
924964
924945
  summary: `Adds the 'path-parameter-order' setting to existing API configurations to maintain backwards compatibility.
@@ -925046,7 +925027,7 @@ async function updateGeneratorsYml({ context: context3, files }) {
925046
925027
  documentToWrite = `${schemaComment}
925047
925028
  ${documentToWrite}`;
925048
925029
  }
925049
- await (0, import_promises173.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925030
+ await (0, import_promises169.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925050
925031
  context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
925051
925032
  }
925052
925033
  async function getFilesAndDirectories3(absoluteFilepath) {
@@ -925083,7 +925064,7 @@ var __default18 = versionMigrations18;
925083
925064
 
925084
925065
  // ../cli-migrations/lib/migrations/1.0.0/update-settings-defaults/migration.js
925085
925066
  init_lib6();
925086
- var import_promises174 = require("fs/promises");
925067
+ var import_promises170 = require("fs/promises");
925087
925068
  var migration19 = {
925088
925069
  name: "update-1_0_0-defaults",
925089
925070
  summary: `The defaults of the API spec settings have changed.
@@ -925258,7 +925239,7 @@ async function updateGeneratorsYml2({ context: context3, files }) {
925258
925239
  documentToWrite = `${schemaComment}
925259
925240
  ${documentToWrite}`;
925260
925241
  }
925261
- await (0, import_promises174.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925242
+ await (0, import_promises170.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925262
925243
  context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
925263
925244
  }
925264
925245
  async function getFilesAndDirectories4(absoluteFilepath) {
@@ -925328,7 +925309,7 @@ var __default19 = versionMigrations19;
925328
925309
 
925329
925310
  // ../cli-migrations/lib/migrations/2.0.0-rc0/update-settings-defaults/migration.js
925330
925311
  init_lib6();
925331
- var import_promises175 = require("fs/promises");
925312
+ var import_promises171 = require("fs/promises");
925332
925313
  var migration20 = {
925333
925314
  name: "update-2_0_0-defaults",
925334
925315
  summary: `The default of 'coerce-enums-to-literals' has changed from true to false.
@@ -925503,7 +925484,7 @@ async function updateGeneratorsYml3({ context: context3, files }) {
925503
925484
  documentToWrite = `${schemaComment}
925504
925485
  ${documentToWrite}`;
925505
925486
  }
925506
- await (0, import_promises175.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925487
+ await (0, import_promises171.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925507
925488
  context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
925508
925489
  }
925509
925490
  async function getFilesAndDirectories5(absoluteFilepath) {
@@ -925550,7 +925531,7 @@ var __default20 = versionMigrations20;
925550
925531
 
925551
925532
  // ../cli-migrations/lib/migrations/2.13.0/migrate-deprecated-generator-api-settings/migration.js
925552
925533
  init_lib6();
925553
- var import_promises176 = require("fs/promises");
925534
+ var import_promises172 = require("fs/promises");
925554
925535
  var migration21 = {
925555
925536
  name: "migrate-deprecated-generator-api-settings",
925556
925537
  summary: `Migrates deprecated generator-level API settings keys to their new equivalents:
@@ -925641,7 +925622,7 @@ async function updateGeneratorsYml4({ context: context3, files }) {
925641
925622
  documentToWrite = `${schemaComment}
925642
925623
  ${documentToWrite}`;
925643
925624
  }
925644
- await (0, import_promises176.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925625
+ await (0, import_promises172.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925645
925626
  context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
925646
925627
  }
925647
925628
  function migrateDeprecatedSettings(settings, context3) {
@@ -925688,7 +925669,7 @@ var __default21 = versionMigrations21;
925688
925669
 
925689
925670
  // ../cli-migrations/lib/migrations/3.0.0/enable-smart-casing/migration.js
925690
925671
  init_lib6();
925691
- var import_promises177 = require("fs/promises");
925672
+ var import_promises173 = require("fs/promises");
925692
925673
  var migration22 = {
925693
925674
  name: "enable-smart-casing",
925694
925675
  summary: `Sets 'smart-casing: false' for existing generators to preserve backwards compatibility.
@@ -925772,7 +925753,7 @@ async function updateGeneratorsYml5({ context: context3, files }) {
925772
925753
  documentToWrite = `${schemaComment}
925773
925754
  ${documentToWrite}`;
925774
925755
  }
925775
- await (0, import_promises177.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925756
+ await (0, import_promises173.writeFile)(generatorsYmlFile.absolutePath, documentToWrite);
925776
925757
  context3.logger.info(source_default.green(`Updated ${generatorsYmlFile.absolutePath}`));
925777
925758
  }
925778
925759
  function setSmartCasingFalseIfNotConfigured(generator, context3) {
@@ -925913,7 +925894,7 @@ ${source_default.dim(migration23.summary)}`
925913
925894
  }
925914
925895
 
925915
925896
  // src/commands/upgrade/upgrade.ts
925916
- var import_promises178 = require("fs/promises");
925897
+ var import_promises174 = require("fs/promises");
925917
925898
 
925918
925899
  // src/cwd.ts
925919
925900
  var FERN_CWD_ENV_VAR = "FERN_CWD";
@@ -926234,7 +926215,7 @@ async function upgrade({
926234
926215
  const newProjectConfig = produce(projectConfig2.rawConfig, (draft) => {
926235
926216
  draft.version = resolvedTargetVersion;
926236
926217
  });
926237
- await (0, import_promises178.writeFile)(
926218
+ await (0, import_promises174.writeFile)(
926238
926219
  projectConfig2._absolutePath,
926239
926220
  ensureFinalNewline2(JSON.stringify(newProjectConfig, void 0, 2))
926240
926221
  );
@@ -926850,7 +926831,7 @@ async function validateWorkspaces({
926850
926831
 
926851
926832
  // src/commands/write-definition/writeDefinitionForWorkspaces.ts
926852
926833
  init_lib6();
926853
- var import_promises179 = require("fs/promises");
926834
+ var import_promises175 = require("fs/promises");
926854
926835
  var import_path91 = __toESM(require("path"), 1);
926855
926836
  async function writeDefinitionForWorkspaces({
926856
926837
  project,
@@ -926931,28 +926912,28 @@ async function writeFernDefinition({
926931
926912
  return a10.localeCompare(b19);
926932
926913
  };
926933
926914
  if (await doesPathExist(absolutePathToOutputDirectory)) {
926934
- await (0, import_promises179.rm)(absolutePathToOutputDirectory, { recursive: true });
926915
+ await (0, import_promises175.rm)(absolutePathToOutputDirectory, { recursive: true });
926935
926916
  }
926936
- await (0, import_promises179.mkdir)(absolutePathToOutputDirectory, { recursive: true });
926937
- await (0, import_promises179.writeFile)(
926917
+ await (0, import_promises175.mkdir)(absolutePathToOutputDirectory, { recursive: true });
926918
+ await (0, import_promises175.writeFile)(
926938
926919
  join2(absolutePathToOutputDirectory, RelativeFilePath2.of(ROOT_API_FILENAME)),
926939
926920
  jsYaml.dump(definition3.rootApiFile.contents, { sortKeys })
926940
926921
  );
926941
926922
  for (const [relativePath, packageMarker] of Object.entries(definition3.packageMarkers)) {
926942
926923
  const absoluteFilepath = join2(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
926943
- await (0, import_promises179.mkdir)(dirname4(absoluteFilepath), { recursive: true });
926944
- await (0, import_promises179.writeFile)(absoluteFilepath, jsYaml.dump(packageMarker.contents, { sortKeys }));
926924
+ await (0, import_promises175.mkdir)(dirname4(absoluteFilepath), { recursive: true });
926925
+ await (0, import_promises175.writeFile)(absoluteFilepath, jsYaml.dump(packageMarker.contents, { sortKeys }));
926945
926926
  }
926946
926927
  for (const [relativePath, definitionFile] of Object.entries(definition3.namedDefinitionFiles)) {
926947
926928
  const absoluteFilepath = join2(absolutePathToOutputDirectory, RelativeFilePath2.of(relativePath));
926948
- await (0, import_promises179.mkdir)(dirname4(absoluteFilepath), { recursive: true });
926949
- await (0, import_promises179.writeFile)(absoluteFilepath, jsYaml.dump(definitionFile.contents, { sortKeys }));
926929
+ await (0, import_promises175.mkdir)(dirname4(absoluteFilepath), { recursive: true });
926930
+ await (0, import_promises175.writeFile)(absoluteFilepath, jsYaml.dump(definitionFile.contents, { sortKeys }));
926950
926931
  }
926951
926932
  }
926952
926933
 
926953
926934
  // src/commands/write-docs-definition/writeDocsDefinitionForProject.ts
926954
926935
  init_lib6();
926955
- var import_promises180 = require("fs/promises");
926936
+ var import_promises176 = require("fs/promises");
926956
926937
  async function writeDocsDefinitionForProject({
926957
926938
  project,
926958
926939
  outputPath,
@@ -926984,7 +926965,7 @@ async function writeDocsDefinitionForProject({
926984
926965
  targetAudiences: docsWorkspace.config.instances[0]?.audiences ? Array.isArray(docsWorkspace.config.instances[0].audiences) ? docsWorkspace.config.instances[0].audiences : [docsWorkspace.config.instances[0].audiences] : void 0
926985
926966
  });
926986
926967
  const docsDefinition = await docsResolver.resolve();
926987
- await (0, import_promises180.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
926968
+ await (0, import_promises176.writeFile)(AbsoluteFilePath2.of(outputPath), JSON.stringify(docsDefinition, null, 2));
926988
926969
  context3.logger.info(source_default.green(`Docs definition written to ${outputPath}`));
926989
926970
  });
926990
926971
  }
@@ -926993,7 +926974,7 @@ async function writeDocsDefinitionForProject({
926993
926974
  init_lib6();
926994
926975
  var import_cli_progress2 = __toESM(require_cli_progress(), 1);
926995
926976
  var import_fs37 = require("fs");
926996
- var import_promises184 = require("fs/promises");
926977
+ var import_promises180 = require("fs/promises");
926997
926978
  var import_is_ci3 = __toESM(require_is_ci(), 1);
926998
926979
  var import_path94 = __toESM(require("path"), 1);
926999
926980
 
@@ -927483,7 +927464,7 @@ function shouldProcessFile(filePath, stub) {
927483
927464
 
927484
927465
  // src/commands/write-translation/docs-config-utils.ts
927485
927466
  init_lib6();
927486
- var import_promises181 = require("fs/promises");
927467
+ var import_promises177 = require("fs/promises");
927487
927468
 
927488
927469
  // src/commands/write-translation/url-utils.ts
927489
927470
  function addLanguageSuffixToUrl(url3, language) {
@@ -927640,7 +927621,7 @@ async function createLanguageSpecificDocsConfig({
927640
927621
  stub = false
927641
927622
  }) {
927642
927623
  try {
927643
- const originalConfigContent = await (0, import_promises181.readFile)(originalDocsConfigPath, "utf-8");
927624
+ const originalConfigContent = await (0, import_promises177.readFile)(originalDocsConfigPath, "utf-8");
927644
927625
  const transformation = {
927645
927626
  filePath: DOCS_CONFIGURATION_FILENAME,
927646
927627
  language,
@@ -927654,7 +927635,7 @@ async function createLanguageSpecificDocsConfig({
927654
927635
  const modifiedConfigContent = jsYaml.dump(modifiedConfig, {
927655
927636
  sortKeys: false
927656
927637
  });
927657
- await (0, import_promises181.writeFile)(modifiedConfigPath, modifiedConfigContent, "utf-8");
927638
+ await (0, import_promises177.writeFile)(modifiedConfigPath, modifiedConfigContent, "utf-8");
927658
927639
  context3.logger.debug(`Created language-specific docs config: ${modifiedConfigPath}`);
927659
927640
  } catch (error50) {
927660
927641
  if (error50 instanceof Error && error50.message.includes("403")) {
@@ -927667,11 +927648,11 @@ async function createLanguageSpecificDocsConfig({
927667
927648
  // src/commands/write-translation/file-collection-utils.ts
927668
927649
  init_lib6();
927669
927650
  var import_fs35 = require("fs");
927670
- var import_promises182 = require("fs/promises");
927651
+ var import_promises178 = require("fs/promises");
927671
927652
  var import_path92 = __toESM(require("path"), 1);
927672
927653
  async function collectFiles(baseDirectory, relativeBase) {
927673
927654
  const discoveredFiles = {};
927674
- const entries21 = await (0, import_promises182.readdir)(baseDirectory);
927655
+ const entries21 = await (0, import_promises178.readdir)(baseDirectory);
927675
927656
  for (const entry of entries21) {
927676
927657
  if (entry === "translations") {
927677
927658
  continue;
@@ -927694,7 +927675,7 @@ async function collectFiles(baseDirectory, relativeBase) {
927694
927675
  // src/commands/write-translation/hash-utils.ts
927695
927676
  var import_crypto13 = require("crypto");
927696
927677
  var import_fs36 = require("fs");
927697
- var import_promises183 = require("fs/promises");
927678
+ var import_promises179 = require("fs/promises");
927698
927679
  var import_path93 = __toESM(require("path"), 1);
927699
927680
  function calculateContentHash(content5) {
927700
927681
  return (0, import_crypto13.createHash)("sha256").update(content5, "utf-8").digest("hex");
@@ -927705,7 +927686,7 @@ async function loadHashMappings(translationsDirectory) {
927705
927686
  return {};
927706
927687
  }
927707
927688
  try {
927708
- const hashesContent = await (0, import_promises183.readFile)(hashesFilePath, "utf-8");
927689
+ const hashesContent = await (0, import_promises179.readFile)(hashesFilePath, "utf-8");
927709
927690
  const parsed = JSON.parse(hashesContent);
927710
927691
  const { _comment, ...hashMappings } = parsed;
927711
927692
  return hashMappings;
@@ -927726,11 +927707,11 @@ async function saveHashMappings(translationsDirectory, hashMappings) {
927726
927707
  _comment: "This file is auto-generated by Fern to track source file changes for translation purposes. Do not edit manually - it will be overwritten on the next translation update.",
927727
927708
  ...sortedMappings
927728
927709
  };
927729
- await (0, import_promises183.writeFile)(hashesFilePath, JSON.stringify(fileContent, null, 2), "utf-8");
927710
+ await (0, import_promises179.writeFile)(hashesFilePath, JSON.stringify(fileContent, null, 2), "utf-8");
927730
927711
  }
927731
927712
  async function hasFileChanged(filePath, relativePath, previousHashes) {
927732
927713
  try {
927733
- const content5 = await (0, import_promises183.readFile)(filePath, "utf-8");
927714
+ const content5 = await (0, import_promises179.readFile)(filePath, "utf-8");
927734
927715
  const currentHash = calculateContentHash(content5);
927735
927716
  const previousHash = previousHashes[relativePath];
927736
927717
  return currentHash !== previousHash;
@@ -927783,7 +927764,7 @@ async function writeTranslationForProject({
927783
927764
  }
927784
927765
  if (!(0, import_fs37.existsSync)(translationsDirectory)) {
927785
927766
  context3.logger.debug(`Creating translations directory at: ${translationsDirectory}`);
927786
- await (0, import_promises184.mkdir)(translationsDirectory, { recursive: true });
927767
+ await (0, import_promises180.mkdir)(translationsDirectory, { recursive: true });
927787
927768
  }
927788
927769
  const languageStats = {};
927789
927770
  const targetLanguages = languages.filter((lang) => lang !== sourceLanguage);
@@ -927796,7 +927777,7 @@ async function writeTranslationForProject({
927796
927777
  RelativeFilePath2.of("fern")
927797
927778
  );
927798
927779
  if (!(0, import_fs37.existsSync)(languageDirectory)) {
927799
- await (0, import_promises184.mkdir)(languageDirectory, { recursive: true });
927780
+ await (0, import_promises180.mkdir)(languageDirectory, { recursive: true });
927800
927781
  }
927801
927782
  languageStats[language] = {
927802
927783
  filesProcessed: 0,
@@ -927898,7 +927879,7 @@ async function writeTranslationForProject({
927898
927879
  `[COMPLETED] ${DOCS_CONFIGURATION_FILENAME} -> ${language}/${DOCS_CONFIGURATION_FILENAME}`
927899
927880
  );
927900
927881
  }
927901
- const originalConfigContent = await (0, import_promises184.readFile)(originalDocsConfigPath, "utf-8");
927882
+ const originalConfigContent = await (0, import_promises180.readFile)(originalDocsConfigPath, "utf-8");
927902
927883
  await updateAndSaveHashForFile(
927903
927884
  translationsDirectory,
927904
927885
  hashMappings,
@@ -927943,7 +927924,7 @@ async function writeTranslationForProject({
927943
927924
  continue;
927944
927925
  }
927945
927926
  cliContext.logger.debug(`[PROCESSING] ${relativePath} (detected changes)`);
927946
- const originalContent = await (0, import_promises184.readFile)(filePath, "utf-8");
927927
+ const originalContent = await (0, import_promises180.readFile)(filePath, "utf-8");
927947
927928
  await updateAndSaveHashForFile(translationsDirectory, hashMappings, relativePath, originalContent);
927948
927929
  const sourceStats = languageStats[sourceLanguage];
927949
927930
  if (sourceStats) {
@@ -927968,7 +927949,7 @@ async function writeTranslationForProject({
927968
927949
  const destPath = join2(languageDirectory, relativePath);
927969
927950
  const destDir = import_path94.default.dirname(destPath);
927970
927951
  if (!(0, import_fs37.existsSync)(destDir)) {
927971
- await (0, import_promises184.mkdir)(destDir, { recursive: true });
927952
+ await (0, import_promises180.mkdir)(destDir, { recursive: true });
927972
927953
  }
927973
927954
  const transformation = {
927974
927955
  filePath: relativePath,
@@ -927981,7 +927962,7 @@ async function writeTranslationForProject({
927981
927962
  cliContext,
927982
927963
  stub
927983
927964
  });
927984
- await (0, import_promises184.writeFile)(destPath, transformedContent, "utf-8");
927965
+ await (0, import_promises180.writeFile)(destPath, transformedContent, "utf-8");
927985
927966
  const languageStatsForLang = languageStats[language];
927986
927967
  if (languageStatsForLang) {
927987
927968
  languageStatsForLang.filesProcessed++;
@@ -928012,9 +927993,9 @@ async function writeTranslationForProject({
928012
927993
  const destPath = join2(languageDirectory, relativePath);
928013
927994
  const destDir = import_path94.default.dirname(destPath);
928014
927995
  if (!(0, import_fs37.existsSync)(destDir)) {
928015
- await (0, import_promises184.mkdir)(destDir, { recursive: true });
927996
+ await (0, import_promises180.mkdir)(destDir, { recursive: true });
928016
927997
  }
928017
- await (0, import_promises184.copyFile)(filePath, destPath);
927998
+ await (0, import_promises180.copyFile)(filePath, destPath);
928018
927999
  assetsCopied++;
928019
928000
  cliContext.logger.debug(`[ASSET COPIED] ${relativePath} -> ${language}/${relativePath}`);
928020
928001
  }