@fern-api/fern-api-dev 3.50.1-8-gdcfe0d6f971 → 3.50.2-1-g492c5a39eb4

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 +103 -35
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1430941,7 +1430941,7 @@ var AccessTokenPosthogManager = class {
1430941
1430941
  properties: {
1430942
1430942
  ...event,
1430943
1430943
  ...event.properties,
1430944
- version: "3.50.1-8-gdcfe0d6f971",
1430944
+ version: "3.50.2-1-g492c5a39eb4",
1430945
1430945
  usingAccessToken: true
1430946
1430946
  }
1430947
1430947
  });
@@ -1431040,7 +1431040,7 @@ var UserPosthogManager = class {
1431040
1431040
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1431041
1431041
  event: "CLI",
1431042
1431042
  properties: {
1431043
- version: "3.50.1-8-gdcfe0d6f971",
1431043
+ version: "3.50.2-1-g492c5a39eb4",
1431044
1431044
  ...event,
1431045
1431045
  ...event.properties,
1431046
1431046
  usingAccessToken: false,
@@ -1510475,7 +1510475,7 @@ var CliContext = class {
1510475
1510475
  if (false) {
1510476
1510476
  this.logger.error("CLI_VERSION is not defined");
1510477
1510477
  }
1510478
- return "3.50.1-8-gdcfe0d6f971";
1510478
+ return "3.50.2-1-g492c5a39eb4";
1510479
1510479
  }
1510480
1510480
  getCliName() {
1510481
1510481
  if (false) {
@@ -1611573,7 +1611573,7 @@ var import_path40 = __toESM(require("path"), 1);
1611573
1611573
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1611574
1611574
  var LOGS_FOLDER_NAME = "logs";
1611575
1611575
  function getCliSource() {
1611576
- const version7 = "3.50.1-8-gdcfe0d6f971";
1611576
+ const version7 = "3.50.2-1-g492c5a39eb4";
1611577
1611577
  return `cli@${version7}`;
1611578
1611578
  }
1611579
1611579
  var DebugLogger = class {
@@ -1646915,7 +1646915,7 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
1646915
1646915
  return context2.failAndThrow("Failed to publish docs.", "Docs registration ID is missing.");
1646916
1646916
  }
1646917
1646917
  let libraryDocsConfig;
1646918
- const pythonDocsSection = extractPythonDocsSectionFromConfig(docsWorkspace.config);
1646918
+ const pythonDocsSection = await extractPythonDocsSectionFromConfig(docsWorkspace.config, docsWorkspace.absoluteFilePath);
1646919
1646919
  if (pythonDocsSection != null) {
1646920
1646920
  const githubUrl = pythonDocsSection.pythonDocs;
1646921
1646921
  context2.logger.info(`Generating Python documentation from ${githubUrl}...`);
@@ -1647458,13 +1647458,30 @@ function extractErrorDetails(error49) {
1647458
1647458
  rawError: error49
1647459
1647459
  };
1647460
1647460
  }
1647461
- function extractPythonDocsSectionFromConfig(config3) {
1647462
- const navigation = config3.navigation;
1647463
- if (navigation == null) {
1647464
- return void 0;
1647465
- }
1647461
+ async function extractPythonDocsSectionFromConfig(config3, absolutePathToFernFolder) {
1647466
1647462
  const isPythonDocsConfig = (item) => {
1647467
- return item != null && typeof item === "object" && "pythonDocs" in item && typeof item.pythonDocs === "string";
1647463
+ if (item == null || typeof item !== "object") {
1647464
+ return false;
1647465
+ }
1647466
+ const obj = item;
1647467
+ return typeof obj.pythonDocs === "string" || typeof obj["python-docs"] === "string";
1647468
+ };
1647469
+ const normalizePythonDocsConfig = (item) => {
1647470
+ if (item == null || typeof item !== "object") {
1647471
+ return void 0;
1647472
+ }
1647473
+ const obj = item;
1647474
+ if (typeof obj.pythonDocs === "string") {
1647475
+ return item;
1647476
+ }
1647477
+ if (typeof obj["python-docs"] === "string") {
1647478
+ return {
1647479
+ pythonDocs: obj["python-docs"],
1647480
+ title: typeof obj.title === "string" ? obj.title : void 0,
1647481
+ slug: typeof obj.slug === "string" ? obj.slug : void 0
1647482
+ };
1647483
+ }
1647484
+ return void 0;
1647468
1647485
  };
1647469
1647486
  const findPythonDocsSectionInItems = (items) => {
1647470
1647487
  if (items == null) {
@@ -1647472,7 +1647489,7 @@ function extractPythonDocsSectionFromConfig(config3) {
1647472
1647489
  }
1647473
1647490
  for (const item of items) {
1647474
1647491
  if (isPythonDocsConfig(item)) {
1647475
- return item;
1647492
+ return normalizePythonDocsConfig(item);
1647476
1647493
  }
1647477
1647494
  if (item != null && typeof item === "object" && "section" in item) {
1647478
1647495
  const sectionItem = item;
@@ -1647495,37 +1647512,88 @@ function extractPythonDocsSectionFromConfig(config3) {
1647495
1647512
  }
1647496
1647513
  return void 0;
1647497
1647514
  };
1647498
- const nav = navigation;
1647499
- if (Array.isArray(nav)) {
1647500
- return findPythonDocsSectionInItems(nav);
1647501
- }
1647502
- if (nav != null && typeof nav === "object") {
1647503
- const navObj = nav;
1647504
- if (Array.isArray(navObj.tabs)) {
1647505
- for (const tab2 of navObj.tabs) {
1647506
- if (tab2 != null && typeof tab2 === "object") {
1647507
- const tabObj = tab2;
1647508
- if (Array.isArray(tabObj.layout)) {
1647509
- const found = findPythonDocsSectionInItems(tabObj.layout);
1647510
- if (found) {
1647511
- return found;
1647515
+ const findInNavigationConfig = (navigation) => {
1647516
+ if (navigation == null) {
1647517
+ return void 0;
1647518
+ }
1647519
+ if (Array.isArray(navigation)) {
1647520
+ return findPythonDocsSectionInItems(navigation);
1647521
+ }
1647522
+ if (navigation != null && typeof navigation === "object") {
1647523
+ const navObj = navigation;
1647524
+ if (Array.isArray(navObj.tabs)) {
1647525
+ for (const tab2 of navObj.tabs) {
1647526
+ if (tab2 != null && typeof tab2 === "object") {
1647527
+ const tabObj = tab2;
1647528
+ if (Array.isArray(tabObj.layout)) {
1647529
+ const found = findPythonDocsSectionInItems(tabObj.layout);
1647530
+ if (found) {
1647531
+ return found;
1647532
+ }
1647512
1647533
  }
1647513
1647534
  }
1647514
1647535
  }
1647515
1647536
  }
1647516
1647537
  }
1647517
- if (Array.isArray(navObj.versions)) {
1647518
- for (const version7 of navObj.versions) {
1647519
- if (version7 != null && typeof version7 === "object") {
1647520
- const versionObj = version7;
1647521
- if (Array.isArray(versionObj.navigation)) {
1647522
- const found = findPythonDocsSectionInItems(versionObj.navigation);
1647523
- if (found) {
1647524
- return found;
1647525
- }
1647538
+ return void 0;
1647539
+ };
1647540
+ const searchVersionFile = async (versionPath) => {
1647541
+ try {
1647542
+ const absoluteFilepathToVersionFile = resolve5(absolutePathToFernFolder, RelativeFilePath2.of(versionPath));
1647543
+ const content5 = jsYaml.load((await (0, import_promises99.readFile)(absoluteFilepathToVersionFile)).toString());
1647544
+ if (content5 != null && typeof content5 === "object") {
1647545
+ const versionContent = content5;
1647546
+ return findInNavigationConfig(versionContent.navigation);
1647547
+ }
1647548
+ } catch {
1647549
+ }
1647550
+ return void 0;
1647551
+ };
1647552
+ const searchProductFile = async (productPath, productVersions) => {
1647553
+ try {
1647554
+ const absoluteFilepathToProductFile = resolve5(absolutePathToFernFolder, RelativeFilePath2.of(productPath));
1647555
+ const content5 = jsYaml.load((await (0, import_promises99.readFile)(absoluteFilepathToProductFile)).toString());
1647556
+ if (content5 != null && typeof content5 === "object") {
1647557
+ const productContent = content5;
1647558
+ const found = findInNavigationConfig(productContent.navigation);
1647559
+ if (found) {
1647560
+ return found;
1647561
+ }
1647562
+ }
1647563
+ if (productVersions != null && productVersions.length > 0) {
1647564
+ for (const version7 of productVersions) {
1647565
+ const found = await searchVersionFile(version7.path);
1647566
+ if (found) {
1647567
+ return found;
1647526
1647568
  }
1647527
1647569
  }
1647528
1647570
  }
1647571
+ } catch {
1647572
+ }
1647573
+ return void 0;
1647574
+ };
1647575
+ if (config3.navigation != null) {
1647576
+ const found = findInNavigationConfig(config3.navigation);
1647577
+ if (found) {
1647578
+ return found;
1647579
+ }
1647580
+ }
1647581
+ if (config3.versions != null && config3.versions.length > 0) {
1647582
+ for (const version7 of config3.versions) {
1647583
+ const found = await searchVersionFile(version7.path);
1647584
+ if (found) {
1647585
+ return found;
1647586
+ }
1647587
+ }
1647588
+ }
1647589
+ if (config3.products != null && config3.products.length > 0) {
1647590
+ for (const product of config3.products) {
1647591
+ if ("path" in product && product.path != null) {
1647592
+ const found = await searchProductFile(product.path, product.versions);
1647593
+ if (found) {
1647594
+ return found;
1647595
+ }
1647596
+ }
1647529
1647597
  }
1647530
1647598
  }
1647531
1647599
  return void 0;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.50.1-8-gdcfe0d6f971",
2
+ "version": "3.50.2-1-g492c5a39eb4",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",