@fern-api/fern-api-dev 5.92.2 → 5.92.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.cjs +69 -40
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -453774,6 +453774,47 @@ function findInlineCodeEnd(content5, start2) {
453774
453774
  }
453775
453775
  return null;
453776
453776
  }
453777
+ function findLabelEnd(content5, start2) {
453778
+ const limit = findScanLimit(content5, start2);
453779
+ let depth = 0;
453780
+ let i5 = start2;
453781
+ while (i5 < limit) {
453782
+ if (content5[i5] === "\\") {
453783
+ i5 += 2;
453784
+ continue;
453785
+ }
453786
+ if (content5[i5] === "[") {
453787
+ depth++;
453788
+ } else if (content5[i5] === "]") {
453789
+ depth--;
453790
+ if (depth === 0) {
453791
+ if (content5[i5 + 1] === "(") {
453792
+ return i5;
453793
+ }
453794
+ return findLabelEndBeforeNextBracket(content5, i5 + 1, limit);
453795
+ }
453796
+ }
453797
+ i5++;
453798
+ }
453799
+ return null;
453800
+ }
453801
+ function findLabelEndBeforeNextBracket(content5, start2, limit) {
453802
+ let i5 = start2;
453803
+ while (i5 < limit) {
453804
+ if (content5[i5] === "\\") {
453805
+ i5 += 2;
453806
+ continue;
453807
+ }
453808
+ if (content5[i5] === "[") {
453809
+ return null;
453810
+ }
453811
+ if (content5[i5] === "]" && content5[i5 + 1] === "(") {
453812
+ return i5;
453813
+ }
453814
+ i5++;
453815
+ }
453816
+ return null;
453817
+ }
453777
453818
  function streamingScanForImages(content5, metadata) {
453778
453819
  const filepaths = /* @__PURE__ */ new Set();
453779
453820
  const edits = [];
@@ -453822,19 +453863,12 @@ function streamingScanForImages(content5, metadata) {
453822
453863
  return { filepaths, edits };
453823
453864
  }
453824
453865
  function parseMarkdownImage(content5, start2, metadata) {
453825
- let i5 = start2 + 2;
453826
453866
  const len = content5.length;
453827
- while (i5 < len && content5[i5] !== "]") {
453828
- if (content5[i5] === "\\") {
453829
- i5 += 2;
453830
- } else {
453831
- i5++;
453832
- }
453833
- }
453834
- if (i5 >= len || content5[i5] !== "]" || content5[i5 + 1] !== "(") {
453867
+ const labelEnd2 = findLabelEnd(content5, start2 + 1);
453868
+ if (labelEnd2 == null || content5[labelEnd2 + 1] !== "(") {
453835
453869
  return null;
453836
453870
  }
453837
- i5 += 2;
453871
+ let i5 = labelEnd2 + 2;
453838
453872
  const urlStart = i5;
453839
453873
  let parenDepth = 1;
453840
453874
  while (i5 < len && parenDepth > 0) {
@@ -453855,7 +453889,7 @@ function parseMarkdownImage(content5, start2, metadata) {
453855
453889
  }
453856
453890
  const urlEnd = i5 - 1;
453857
453891
  const url3 = content5.slice(urlStart, urlEnd).trim();
453858
- const rawSrc = trimAnchor(splitDestinationAndTitle(url3));
453892
+ const rawSrc = trimAnchor(unwrapDelimitedDestination(splitDestinationAndTitle(url3)).path);
453859
453893
  const src = rawSrc != null ? unescapeMarkdownUrl(rawSrc) : void 0;
453860
453894
  const resolvedPath = resolvePath5(src, metadata);
453861
453895
  if (rawSrc && src && resolvedPath) {
@@ -453892,20 +453926,19 @@ function splitDestinationAndTitle(url3) {
453892
453926
  const isTitle = title2.length >= 2 && (title2.startsWith('"') && title2.endsWith('"') || title2.startsWith("'") && title2.endsWith("'") || title2.startsWith("(") && title2.endsWith(")"));
453893
453927
  return isTitle ? url3.slice(0, i5) : url3;
453894
453928
  }
453929
+ function unwrapDelimitedDestination(destination) {
453930
+ if (destination.length >= 2 && destination.startsWith("<") && destination.endsWith(">")) {
453931
+ return { path: destination.slice(1, -1), wrapped: true };
453932
+ }
453933
+ return { path: destination, wrapped: false };
453934
+ }
453895
453935
  function parseMarkdownLink(content5, start2, metadata) {
453896
- let i5 = start2 + 1;
453897
453936
  const len = content5.length;
453898
- while (i5 < len && content5[i5] !== "]") {
453899
- if (content5[i5] === "\\") {
453900
- i5 += 2;
453901
- } else {
453902
- i5++;
453903
- }
453904
- }
453905
- if (i5 >= len || content5[i5] !== "]" || content5[i5 + 1] !== "(") {
453937
+ const labelEnd2 = findLabelEnd(content5, start2);
453938
+ if (labelEnd2 == null || content5[labelEnd2 + 1] !== "(") {
453906
453939
  return null;
453907
453940
  }
453908
- i5 += 2;
453941
+ let i5 = labelEnd2 + 2;
453909
453942
  let parenDepth = 1;
453910
453943
  while (i5 < len && parenDepth > 0) {
453911
453944
  if (content5[i5] === "\\") {
@@ -454316,16 +454349,10 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
454316
454349
  continue;
454317
454350
  }
454318
454351
  } else if (content5[i5] === "[" && content5[i5 - 1] !== "!") {
454319
- let j5 = i5 + 1;
454320
- while (j5 < len && content5[j5] !== "]") {
454321
- if (content5[j5] === "\\") {
454322
- j5 += 2;
454323
- } else {
454324
- j5++;
454325
- }
454326
- }
454327
- if (j5 < len && content5[j5] === "]" && content5[j5 + 1] === "(") {
454328
- j5 += 2;
454352
+ const labelEnd2 = findLabelEnd(content5, i5);
454353
+ let j5 = labelEnd2 ?? len;
454354
+ if (labelEnd2 != null && content5[labelEnd2 + 1] === "(") {
454355
+ j5 = labelEnd2 + 2;
454329
454356
  const urlStart = j5;
454330
454357
  let parenDepth = 1;
454331
454358
  while (j5 < len && parenDepth > 0) {
@@ -454349,18 +454376,20 @@ function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName,
454349
454376
  const href = content5.slice(urlStart, urlEnd).trim();
454350
454377
  const destination = splitDestinationAndTitle(href);
454351
454378
  const hrefTitle = href.slice(destination.length);
454352
- const trimmedHref = trimAnchor(destination) ?? destination;
454353
- const hrefAnchor = trimmedHref !== destination ? destination.slice(trimmedHref.length) : "";
454379
+ const { path: hrefPath, wrapped } = unwrapDelimitedDestination(destination);
454380
+ const trimmedHref = trimAnchor(hrefPath) ?? hrefPath;
454381
+ const hrefAnchor = trimmedHref !== hrefPath ? hrefPath.slice(trimmedHref.length) : "";
454354
454382
  const replacedHref = getReplacedHref({
454355
454383
  href: trimmedHref,
454356
454384
  markdownFilesToPathName,
454357
454385
  metadata
454358
454386
  });
454359
454387
  if (replacedHref && replacedHref.type === "replace") {
454388
+ const slug = replacedHref.slug + hrefAnchor;
454360
454389
  edits.push({
454361
454390
  start: urlStart,
454362
454391
  end: urlEnd,
454363
- replacement: replacedHref.slug + hrefAnchor + hrefTitle
454392
+ replacement: (wrapped ? `<${slug}>` : slug) + hrefTitle
454364
454393
  });
454365
454394
  }
454366
454395
  i5 = j5;
@@ -702729,7 +702758,7 @@ var AccessTokenPosthogManager = class {
702729
702758
  properties: {
702730
702759
  ...event,
702731
702760
  ...event.properties,
702732
- version: "5.92.2",
702761
+ version: "5.92.4",
702733
702762
  usingAccessToken: true,
702734
702763
  ...getRunIdProperties()
702735
702764
  }
@@ -702795,7 +702824,7 @@ var UserPosthogManager = class {
702795
702824
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
702796
702825
  event: "CLI",
702797
702826
  properties: {
702798
- version: "5.92.2",
702827
+ version: "5.92.4",
702799
702828
  ...event,
702800
702829
  ...event.properties,
702801
702830
  usingAccessToken: false,
@@ -883961,7 +883990,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
883961
883990
  var LOGS_FOLDER_NAME = "logs";
883962
883991
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
883963
883992
  function getCliSource() {
883964
- const version7 = "5.92.2";
883993
+ const version7 = "5.92.4";
883965
883994
  return `cli@${version7}`;
883966
883995
  }
883967
883996
  var DebugLogger = class {
@@ -909277,7 +909306,7 @@ var LegacyDocsPublisher = class {
909277
909306
  previewId,
909278
909307
  disableTemplates: void 0,
909279
909308
  skipUpload,
909280
- cliVersion: "5.92.2",
909309
+ cliVersion: "5.92.4",
909281
909310
  loginCommand: "fern auth login"
909282
909311
  });
909283
909312
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -976193,7 +976222,7 @@ function getAutomationContextFromEnv() {
976193
976222
  config_branch: process.env.FERN_CONFIG_BRANCH,
976194
976223
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
976195
976224
  trigger: process.env.GITHUB_EVENT_NAME,
976196
- cli_version: "5.92.2"
976225
+ cli_version: "5.92.4"
976197
976226
  };
976198
976227
  }
976199
976228
  function isAutomationMode() {
@@ -977025,7 +977054,7 @@ var CliContext = class _CliContext {
977025
977054
  if (false) {
977026
977055
  this.logger.error("CLI_VERSION is not defined");
977027
977056
  }
977028
- return "5.92.2";
977057
+ return "5.92.4";
977029
977058
  }
977030
977059
  getCliName() {
977031
977060
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.92.2",
2
+ "version": "5.92.4",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",