@fern-api/fern-api-dev 5.65.2 → 5.65.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 +65 -72
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -145267,7 +145267,6 @@ function buildEndpoint({ endpoint: endpoint3, declarationFile, context: context3
145267
145267
  fileContainingReference: declarationFile,
145268
145268
  namespace: maybeEndpointNamespace
145269
145269
  });
145270
- names2.add(pathParameter.name);
145271
145270
  }
145272
145271
  const queryParameters = {};
145273
145272
  for (const queryParameter of endpoint3.queryParameters) {
@@ -460376,6 +460375,7 @@ var init_DocsDefinitionResolver = __esm({
460376
460375
  registerApi;
460377
460376
  targetAudiences;
460378
460377
  buildTranslatedApiDefinitions;
460378
+ markdownFilesToPathName = {};
460379
460379
  constructor({ domain: domain3, docsWorkspace, ossWorkspaces, apiWorkspaces, taskContext, editThisPage, uploadFiles: uploadFiles2 = defaultUploadFiles, registerApi: registerApi2 = defaultRegisterApi, targetAudiences, buildTranslatedApiDefinitions = false }) {
460380
460380
  this.domain = domain3;
460381
460381
  this.docsWorkspace = docsWorkspace;
@@ -460503,6 +460503,14 @@ var init_DocsDefinitionResolver = __esm({
460503
460503
  getTranslatedApiSpecs() {
460504
460504
  return this.translatedApiSpecs;
460505
460505
  }
460506
+ /**
460507
+ * Returns the map of absolute file paths to their fully qualified slug pathnames.
460508
+ * Used by translation processing to resolve relative .md/.mdx links.
460509
+ * Must be called after `resolve()`.
460510
+ */
460511
+ getMarkdownFilesToPathName() {
460512
+ return this.markdownFilesToPathName;
460513
+ }
460506
460514
  getDocsTranslationsConfig() {
460507
460515
  const translations = this.parsedDocsConfig.translations;
460508
460516
  if (translations == null || translations.length === 0) {
@@ -460678,6 +460686,7 @@ var init_DocsDefinitionResolver = __esm({
460678
460686
  this.taskContext.logger.debug("Getting fully qualified path names...");
460679
460687
  const pathNameStart = performance.now();
460680
460688
  const markdownFilesToPathName = await this.getMarkdownFilesToFullyQualifiedPathNames(root6);
460689
+ this.markdownFilesToPathName = markdownFilesToPathName;
460681
460690
  const pathNameTime = performance.now() - pathNameStart;
460682
460691
  this.taskContext.logger.debug(`Got path names in ${pathNameTime.toFixed(0)}ms`);
460683
460692
  if (this.pendingApiRegistrations.length > 0) {
@@ -590253,6 +590262,7 @@ __export(buildTranslatedDocsDefinition_exports, {
590253
590262
  async function buildTranslatedDocsDefinition({ docsDefinition, locale, localePages, translationNavigationOverlays, resolver: resolver2, context: context3 }) {
590254
590263
  const collectedFileIds = resolver2.getCollectedFileIds();
590255
590264
  const docsWorkspacePath = resolver2.getDocsWorkspacePath();
590265
+ const markdownFilesToPathName = resolver2.getMarkdownFilesToPathName();
590256
590266
  const resolveLocalePath = async (filepath) => {
590257
590267
  const relPath = relative4(docsWorkspacePath, filepath);
590258
590268
  const translatedPath = resolve6(docsWorkspacePath, RelativeFilePath2.of(`translations/${locale}/${relPath}`));
@@ -590292,7 +590302,7 @@ async function buildTranslatedDocsDefinition({ docsDefinition, locale, localePag
590292
590302
  absolutePathToMarkdownFile
590293
590303
  });
590294
590304
  let processedMarkdown = stripMdxComments(importsResolved);
590295
- processedMarkdown = replaceImagePathsAndUrls(processedMarkdown, collectedFileIds, {}, {
590305
+ processedMarkdown = replaceImagePathsAndUrls(processedMarkdown, collectedFileIds, markdownFilesToPathName, {
590296
590306
  absolutePathToMarkdownFile,
590297
590307
  absolutePathToFernFolder: docsWorkspacePath
590298
590308
  }, context3);
@@ -674551,7 +674561,7 @@ var NoConflictingRequestWrapperPropertiesRule = {
674551
674561
  }
674552
674562
  violations.push({
674553
674563
  severity: "fatal",
674554
- message: `Multiple request properties have the name ${source_default.bold(name2)}. This is not suitable for code generation. Use the "name" property to deconflict.
674564
+ message: `Multiple request properties have the name ${source_default.bold(name2)}. This is not suitable for code generation. Use the "name" property (or "x-fern-parameter-name" in OpenAPI) to deconflict.
674555
674565
  ` + propertiesWithName.map((property24) => ` - ${convertRequestWrapperPropertyToString(property24)}`).join("\n")
674556
674566
  });
674557
674567
  }
@@ -674587,6 +674597,26 @@ function getRequestWrapperPropertiesByName({ endpoint: endpoint3, service, relat
674587
674597
  });
674588
674598
  }
674589
674599
  }
674600
+ if (service["path-parameters"] != null) {
674601
+ for (const [pathParameterKey, pathParameter] of Object.entries(service["path-parameters"])) {
674602
+ if (isVariablePathParameter(pathParameter)) {
674603
+ continue;
674604
+ }
674605
+ addProperty3(pathParameterKey, {
674606
+ type: "service-path-parameter",
674607
+ pathParameterKey
674608
+ });
674609
+ }
674610
+ }
674611
+ for (const [pathParameterKey, pathParameter] of Object.entries(getEndpointPathParameters(endpoint3))) {
674612
+ if (isVariablePathParameter(pathParameter)) {
674613
+ continue;
674614
+ }
674615
+ addProperty3(pathParameterKey, {
674616
+ type: "endpoint-path-parameter",
674617
+ pathParameterKey
674618
+ });
674619
+ }
674590
674620
  if (service.headers != null) {
674591
674621
  for (const [headerKey, header] of Object.entries(service.headers)) {
674592
674622
  addProperty3(getHeaderName3({ headerKey, header }).name, {
@@ -674642,6 +674672,10 @@ function convertRequestWrapperPropertyToString(property24) {
674642
674672
  switch (property24.type) {
674643
674673
  case "service-header":
674644
674674
  return `Service header "${property24.headerKey}"`;
674675
+ case "service-path-parameter":
674676
+ return `Service path parameter "${property24.pathParameterKey}"`;
674677
+ case "endpoint-path-parameter":
674678
+ return `Path parameter "${property24.pathParameterKey}"`;
674645
674679
  case "endpoint-header":
674646
674680
  return `Endpoint header "${property24.headerKey}"`;
674647
674681
  case "endpoint-query-parameter":
@@ -674677,7 +674711,7 @@ function getCamelCaseNormalizedCollisions(nameToProperties) {
674677
674711
  }
674678
674712
  violations.push({
674679
674713
  severity: "fatal",
674680
- message: `Multiple request properties resolve to the same generated name ${source_default.bold(normalizedName)} after camelCase normalization. This causes broken generated code. Use the "name" property to disambiguate.
674714
+ message: `Multiple request properties resolve to the same generated name ${source_default.bold(normalizedName)} after camelCase normalization. This causes broken generated code. Use the "name" property (or "x-fern-parameter-name" in OpenAPI) to disambiguate.
674681
674715
  ` + entries24.map((entry) => ` - ${convertRequestWrapperPropertyToString(entry.property)} (name: "${entry.rawName}")`).join("\n")
674682
674716
  });
674683
674717
  }
@@ -688404,7 +688438,7 @@ var AccessTokenPosthogManager = class {
688404
688438
  properties: {
688405
688439
  ...event,
688406
688440
  ...event.properties,
688407
- version: "5.65.2",
688441
+ version: "5.65.4",
688408
688442
  usingAccessToken: true,
688409
688443
  ...getRunIdProperties()
688410
688444
  }
@@ -688470,7 +688504,7 @@ var UserPosthogManager = class {
688470
688504
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
688471
688505
  event: "CLI",
688472
688506
  properties: {
688473
- version: "5.65.2",
688507
+ version: "5.65.4",
688474
688508
  ...event,
688475
688509
  ...event.properties,
688476
688510
  usingAccessToken: false,
@@ -869566,7 +869600,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
869566
869600
  var LOGS_FOLDER_NAME = "logs";
869567
869601
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
869568
869602
  function getCliSource() {
869569
- const version7 = "5.65.2";
869603
+ const version7 = "5.65.4";
869570
869604
  return `cli@${version7}`;
869571
869605
  }
869572
869606
  var DebugLogger = class {
@@ -872445,6 +872479,7 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
872445
872479
  translationNavigationOverlays: previousPreviewResult.translationNavigationOverlays,
872446
872480
  collectedFileIds: previousPreviewResult.collectedFileIds,
872447
872481
  docsWorkspacePath: previousPreviewResult.docsWorkspacePath,
872482
+ markdownFilesToPathName: previousPreviewResult.markdownFilesToPathName,
872448
872483
  translatedApiDefinitions: previousPreviewResult.translatedApiDefinitions
872449
872484
  };
872450
872485
  }
@@ -872518,6 +872553,7 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
872518
872553
  const translationPages = resolver2.getTranslationPages();
872519
872554
  const translationNavigationOverlays = resolver2.getTranslationNavigationOverlays();
872520
872555
  const collectedFileIds = resolver2.getCollectedFileIds();
872556
+ const markdownFilesToPathName = resolver2.getMarkdownFilesToPathName();
872521
872557
  const translatedApiSpecs = resolver2.getTranslatedApiSpecs();
872522
872558
  let translatedApiDefinitions;
872523
872559
  if (translatedApiSpecs.size > 0) {
@@ -872545,6 +872581,7 @@ async function getPreviewDocsDefinition({ domain: domain3, project, context: con
872545
872581
  translationNavigationOverlays,
872546
872582
  collectedFileIds,
872547
872583
  docsWorkspacePath: docsWorkspace.absoluteFilePath,
872584
+ markdownFilesToPathName,
872548
872585
  translatedApiDefinitions
872549
872586
  };
872550
872587
  }
@@ -873190,7 +873227,7 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
873190
873227
  const RELOAD_DEBOUNCE_MS = 500;
873191
873228
  async function computeTranslatedDefinitions(result) {
873192
873229
  const translations = /* @__PURE__ */ new Map();
873193
- const { docsDefinition, translationPages, translationNavigationOverlays, translatedApiDefinitions, collectedFileIds, docsWorkspacePath } = result;
873230
+ const { docsDefinition, translationPages, translationNavigationOverlays, translatedApiDefinitions, collectedFileIds, docsWorkspacePath, markdownFilesToPathName } = result;
873194
873231
  const hasTranslatedPages = translationPages != null && Object.keys(translationPages).length > 0;
873195
873232
  const hasTranslatedApis = translatedApiDefinitions != null && Object.keys(translatedApiDefinitions).length > 0;
873196
873233
  if (!hasTranslatedPages && !hasTranslatedApis) {
@@ -873252,17 +873289,10 @@ async function runAppPreviewServer({ initialProject, reloadProject, validateProj
873252
873289
  absolutePathToMarkdownFile
873253
873290
  });
873254
873291
  let processedMarkdown = stripMdxComments(importsResolved);
873255
- processedMarkdown = replaceImagePathsAndUrls(
873256
- processedMarkdown,
873257
- collectedFileIds,
873258
- {},
873259
- // markdownFilesToPathName not needed for translations
873260
- {
873261
- absolutePathToMarkdownFile,
873262
- absolutePathToFernFolder: docsWorkspacePath
873263
- },
873264
- context3
873265
- );
873292
+ processedMarkdown = replaceImagePathsAndUrls(processedMarkdown, collectedFileIds, markdownFilesToPathName, {
873293
+ absolutePathToMarkdownFile,
873294
+ absolutePathToFernFolder: docsWorkspacePath
873295
+ }, context3);
873266
873296
  translatedPages[pagePath] = {
873267
873297
  markdown: processedMarkdown,
873268
873298
  rawMarkdown: processedMarkdown,
@@ -873827,7 +873857,7 @@ async function runPreviewServer({ initialProject, reloadProject, validateProject
873827
873857
  const RELOAD_DEBOUNCE_MS = 1e3;
873828
873858
  async function computeTranslatedDefinitions(result) {
873829
873859
  const translations = /* @__PURE__ */ new Map();
873830
- const { docsDefinition, translationPages, translationNavigationOverlays, collectedFileIds, docsWorkspacePath } = result;
873860
+ const { docsDefinition, translationPages, translationNavigationOverlays, collectedFileIds, docsWorkspacePath, markdownFilesToPathName } = result;
873831
873861
  if (translationPages == null || Object.keys(translationPages).length === 0) {
873832
873862
  return translations;
873833
873863
  }
@@ -873882,17 +873912,10 @@ async function runPreviewServer({ initialProject, reloadProject, validateProject
873882
873912
  absolutePathToMarkdownFile
873883
873913
  });
873884
873914
  let processedMarkdown = stripMdxComments(importsResolved);
873885
- processedMarkdown = replaceImagePathsAndUrls(
873886
- processedMarkdown,
873887
- collectedFileIds,
873888
- {},
873889
- // markdownFilesToPathName not needed for translations
873890
- {
873891
- absolutePathToMarkdownFile,
873892
- absolutePathToFernFolder: docsWorkspacePath
873893
- },
873894
- context3
873895
- );
873915
+ processedMarkdown = replaceImagePathsAndUrls(processedMarkdown, collectedFileIds, markdownFilesToPathName, {
873916
+ absolutePathToMarkdownFile,
873917
+ absolutePathToFernFolder: docsWorkspacePath
873918
+ }, context3);
873896
873919
  translatedPages[pagePath] = {
873897
873920
  markdown: processedMarkdown,
873898
873921
  rawMarkdown: processedMarkdown,
@@ -901287,6 +901310,7 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
901287
901310
  try {
901288
901311
  const collectedFileIds = resolver2.getCollectedFileIds();
901289
901312
  const docsWorkspacePath = resolver2.getDocsWorkspacePath();
901313
+ const markdownFilesToPathName = resolver2.getMarkdownFilesToPathName();
901290
901314
  const resolveLocalePath = async (filepath) => {
901291
901315
  const relPath = relative4(docsWorkspacePath, filepath);
901292
901316
  const translatedPath = resolve6(docsWorkspacePath, RelativeFilePath2.of(`translations/${locale}/${relPath}`));
@@ -901326,17 +901350,10 @@ ${JSON.stringify(errorDetails, void 0, 2)}`);
901326
901350
  absolutePathToMarkdownFile
901327
901351
  });
901328
901352
  let processedMarkdown = stripMdxComments(importsResolved);
901329
- processedMarkdown = replaceImagePathsAndUrls(
901330
- processedMarkdown,
901331
- collectedFileIds,
901332
- {},
901333
- // markdownFilesToPathName not needed for translations
901334
- {
901335
- absolutePathToMarkdownFile,
901336
- absolutePathToFernFolder: docsWorkspacePath
901337
- },
901338
- context3
901339
- );
901353
+ processedMarkdown = replaceImagePathsAndUrls(processedMarkdown, collectedFileIds, markdownFilesToPathName, {
901354
+ absolutePathToMarkdownFile,
901355
+ absolutePathToFernFolder: docsWorkspacePath
901356
+ }, context3);
901340
901357
  let editThisPageUrl = basePage?.editThisPageUrl;
901341
901358
  if (editThisPageUrl != null) {
901342
901359
  const fernPathPattern = `/fern/${path119}`;
@@ -902145,7 +902162,7 @@ var LegacyDocsPublisher = class {
902145
902162
  previewId,
902146
902163
  disableTemplates: void 0,
902147
902164
  skipUpload,
902148
- cliVersion: "5.65.2",
902165
+ cliVersion: "5.65.4",
902149
902166
  loginCommand: "fern auth login"
902150
902167
  });
902151
902168
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -941521,8 +941538,7 @@ var EndpointSnippetGenerator6 = class {
941521
941538
  args.push(...this.getNamedParameterArgs({
941522
941539
  kind: "PathParameters",
941523
941540
  namedParameters: pathParameters,
941524
- values: snippet.pathParameters,
941525
- reservedNames: this.getInlinedBodyPropertyNames({ request: request7 })
941541
+ values: snippet.pathParameters
941526
941542
  }));
941527
941543
  args.push(...this.getNamedParameterArgs({
941528
941544
  kind: "QueryParameters",
@@ -941585,23 +941601,7 @@ var EndpointSnippetGenerator6 = class {
941585
941601
  }
941586
941602
  return args;
941587
941603
  }
941588
- /**
941589
- * Property names of an inlined request body (both Ruby names and wire values). Path
941590
- * parameters that collide with these are renamed in the generated SDK, so snippets
941591
- * must rename them the same way.
941592
- */
941593
- getInlinedBodyPropertyNames({ request: request7 }) {
941594
- const names2 = /* @__PURE__ */ new Set();
941595
- if (request7.body?.type !== "properties") {
941596
- return names2;
941597
- }
941598
- for (const property24 of request7.body.value) {
941599
- names2.add(this.context.getPropertyName(property24.name.name));
941600
- names2.add(property24.name.wireValue);
941601
- }
941602
- return names2;
941603
- }
941604
- getNamedParameterArgs({ kind, namedParameters, values: values2, reservedNames }) {
941604
+ getNamedParameterArgs({ kind, namedParameters, values: values2 }) {
941605
941605
  const args = [];
941606
941606
  this.context.errors.scope(kind);
941607
941607
  if (namedParameters != null) {
@@ -941615,15 +941615,8 @@ var EndpointSnippetGenerator6 = class {
941615
941615
  if (ruby_exports.TypeLiteral.isNop(value2)) {
941616
941616
  continue;
941617
941617
  }
941618
- let name2 = this.context.getPropertyName(parameter6.name.name);
941619
- if (reservedNames != null && reservedNames.has(name2)) {
941620
- name2 = `${name2}_path_param`;
941621
- while (reservedNames.has(name2)) {
941622
- name2 = `${name2}_`;
941623
- }
941624
- }
941625
941618
  args.push(ruby_exports.keywordArgument({
941626
- name: name2,
941619
+ name: this.context.getPropertyName(parameter6.name.name),
941627
941620
  value: value2
941628
941621
  }));
941629
941622
  }
@@ -968479,7 +968472,7 @@ function getAutomationContextFromEnv() {
968479
968472
  config_branch: process.env.FERN_CONFIG_BRANCH,
968480
968473
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
968481
968474
  trigger: process.env.GITHUB_EVENT_NAME,
968482
- cli_version: "5.65.2"
968475
+ cli_version: "5.65.4"
968483
968476
  };
968484
968477
  }
968485
968478
  function isAutomationMode() {
@@ -969311,7 +969304,7 @@ var CliContext = class _CliContext {
969311
969304
  if (false) {
969312
969305
  this.logger.error("CLI_VERSION is not defined");
969313
969306
  }
969314
- return "5.65.2";
969307
+ return "5.65.4";
969315
969308
  }
969316
969309
  getCliName() {
969317
969310
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.65.2",
2
+ "version": "5.65.4",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",