@fern-api/fern-api-dev 5.109.2 → 5.110.0

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 +85 -12
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -34611,12 +34611,31 @@ var init_removeSuffix = __esm({
34611
34611
  });
34612
34612
 
34613
34613
  // ../../commons/core-utils/lib/replaceEnvVars.js
34614
+ function getDeferredEnvVars() {
34615
+ const raw = process.env[DEFERRED_ENV_VARS_ENV_VAR];
34616
+ if (raw == null) {
34617
+ return /* @__PURE__ */ new Set();
34618
+ }
34619
+ return new Set(raw.split(/[,\s]+/).filter((name2) => /^\w+$/.test(name2)));
34620
+ }
34621
+ function deferredPlaceholder(name2, before, after) {
34622
+ const placeholder = `${DEFERRED_PLACEHOLDER_PREFIX}${name2}`;
34623
+ if (/:\/\/$/.test(before)) {
34624
+ return placeholder;
34625
+ }
34626
+ const isUrl3 = URL_POSITION_REGEX.test(before) || before === "" && (after === "" || after.startsWith("/"));
34627
+ return isUrl3 ? `https://${placeholder}` : placeholder;
34628
+ }
34614
34629
  function replaceEnvVariables(content5, context3, options2 = {}) {
34615
34630
  if (typeof content5 === "string") {
34631
+ const deferred2 = getDeferredEnvVars();
34616
34632
  let transformed2 = content5.replace(ESCAPED_ENV_VAR_REGEX, (_substring, varName) => {
34617
34633
  return `${PLACEHOLDER_PREFIX}${varName}\0`;
34618
34634
  });
34619
- transformed2 = transformed2.replace(ENV_VAR_REGEX, (_substring, envVarName) => {
34635
+ transformed2 = transformed2.replace(ENV_VAR_REGEX, (substring, envVarName, offset2, whole) => {
34636
+ if (deferred2.has(envVarName)) {
34637
+ return deferredPlaceholder(envVarName, whole.slice(0, offset2), whole.slice(offset2 + substring.length));
34638
+ }
34620
34639
  if (options2.substituteAsEmpty) {
34621
34640
  return "";
34622
34641
  }
@@ -34638,7 +34657,7 @@ function replaceEnvVariables(content5, context3, options2 = {}) {
34638
34657
  const transformed = mapValues2(content5, (value2) => replaceEnvVariables(value2, context3, options2));
34639
34658
  return transformed;
34640
34659
  }
34641
- var ENV_VAR_REGEX, ESCAPED_ENV_VAR_REGEX, PLACEHOLDER_PREFIX;
34660
+ var ENV_VAR_REGEX, ESCAPED_ENV_VAR_REGEX, PLACEHOLDER_PREFIX, DEFERRED_ENV_VARS_ENV_VAR, DEFERRED_PLACEHOLDER_PREFIX, URL_POSITION_REGEX;
34642
34661
  var init_replaceEnvVars = __esm({
34643
34662
  "../../commons/core-utils/lib/replaceEnvVars.js"() {
34644
34663
  "use strict";
@@ -34647,6 +34666,9 @@ var init_replaceEnvVars = __esm({
34647
34666
  ENV_VAR_REGEX = /\$\{(\w+)\}/g;
34648
34667
  ESCAPED_ENV_VAR_REGEX = /\\\$\\\{(\w+)\\}/g;
34649
34668
  PLACEHOLDER_PREFIX = "\0ESCAPED_ENV_VAR\0";
34669
+ DEFERRED_ENV_VARS_ENV_VAR = "FERN_RUNTIME_ENV_VARS";
34670
+ DEFERRED_PLACEHOLDER_PREFIX = "FERN_SELF_HOSTED_ENV_";
34671
+ URL_POSITION_REGEX = /(\]\(|\b(?:href|src|url|action|content)\s*[=:]\s*["']?)$/i;
34650
34672
  }
34651
34673
  });
34652
34674
 
@@ -347311,6 +347333,9 @@ var init_ErrorCollector = __esm({
347311
347333
  });
347312
347334
 
347313
347335
  // ../api-importers/v3-importer-commons/lib/AbstractConverterContext.js
347336
+ function isMarkedDeprecated(node4) {
347337
+ return "deprecated" in node4 && node4.deprecated === true;
347338
+ }
347314
347339
  var AbstractConverterContext;
347315
347340
  var init_AbstractConverterContext = __esm({
347316
347341
  "../api-importers/v3-importer-commons/lib/AbstractConverterContext.js"() {
@@ -347733,13 +347758,30 @@ var init_AbstractConverterContext = __esm({
347733
347758
  return converted.audiences;
347734
347759
  }
347735
347760
  getAvailability({ node: node4, breadcrumbs }) {
347761
+ const visitedReferences = /* @__PURE__ */ new Set();
347736
347762
  while (this.isReferenceObject(node4)) {
347763
+ const declared = this.getDeclaredAvailability({ node: node4, breadcrumbs });
347764
+ if (declared != null) {
347765
+ return declared;
347766
+ }
347767
+ if (visitedReferences.has(node4.$ref)) {
347768
+ return void 0;
347769
+ }
347770
+ visitedReferences.add(node4.$ref);
347737
347771
  const resolved = this.resolveReference({ reference: node4 });
347738
347772
  if (!resolved.resolved) {
347739
347773
  return void 0;
347740
347774
  }
347741
347775
  node4 = resolved.value;
347742
347776
  }
347777
+ return this.getDeclaredAvailability({ node: node4, breadcrumbs });
347778
+ }
347779
+ /**
347780
+ * Reads the availability declared directly on a node, without resolving references.
347781
+ * Annotations written alongside a `$ref` describe that particular usage, so callers
347782
+ * consult them before falling back to the referenced schema.
347783
+ */
347784
+ getDeclaredAvailability({ node: node4, breadcrumbs }) {
347743
347785
  const availabilityExtension = new extensions_exports.FernAvailabilityExtension({
347744
347786
  node: node4,
347745
347787
  breadcrumbs,
@@ -347752,7 +347794,7 @@ var init_AbstractConverterContext = __esm({
347752
347794
  message: void 0
347753
347795
  };
347754
347796
  }
347755
- if (node4.deprecated === true) {
347797
+ if (isMarkedDeprecated(node4)) {
347756
347798
  return {
347757
347799
  status: AvailabilityStatus.Deprecated,
347758
347800
  message: void 0
@@ -352364,7 +352406,11 @@ var init_SchemaOrReferenceConverter = __esm({
352364
352406
  if (response.ok) {
352365
352407
  return {
352366
352408
  type: this.wrapTypeReference(response.reference),
352367
- inlinedTypes: response.inlinedTypes ?? {}
352409
+ inlinedTypes: response.inlinedTypes ?? {},
352410
+ availability: this.context.getAvailability({
352411
+ node: schemaOrReference,
352412
+ breadcrumbs: this.breadcrumbs
352413
+ })
352368
352414
  };
352369
352415
  }
352370
352416
  }
@@ -352384,7 +352430,8 @@ var init_SchemaOrReferenceConverter = __esm({
352384
352430
  if (response.ok) {
352385
352431
  return {
352386
352432
  type: this.wrapTypeReference(response.reference),
352387
- inlinedTypes: response.inlinedTypes ?? {}
352433
+ inlinedTypes: response.inlinedTypes ?? {},
352434
+ availability: this.getAvailabilityOfSelfOrReference(allOfReference)
352388
352435
  };
352389
352436
  }
352390
352437
  }
@@ -352406,13 +352453,39 @@ var init_SchemaOrReferenceConverter = __esm({
352406
352453
  if (response.ok) {
352407
352454
  return {
352408
352455
  type: this.wrapTypeReference(response.reference),
352409
- inlinedTypes: response.inlinedTypes ?? {}
352456
+ inlinedTypes: response.inlinedTypes ?? {},
352457
+ availability: this.getAvailabilityOfSelfOrReference(singleRef)
352410
352458
  };
352411
352459
  }
352412
352460
  }
352413
352461
  }
352414
352462
  return void 0;
352415
352463
  }
352464
+ /**
352465
+ * Availability declared alongside the `allOf` takes precedence over the availability
352466
+ * of the referenced schema, since the outer schema is the more specific declaration.
352467
+ * Inline `allOf` siblings are consulted next: when the sibling carries nothing but
352468
+ * metadata we short-circuit to the `$ref`, so a `deprecated` written there would
352469
+ * otherwise be dropped.
352470
+ */
352471
+ getAvailabilityOfSelfOrReference(reference4) {
352472
+ for (const node4 of [...this.getSelfAndInlineAllOfElements(), reference4]) {
352473
+ const availability = this.context.getAvailability({ node: node4, breadcrumbs: this.breadcrumbs });
352474
+ if (availability != null) {
352475
+ return availability;
352476
+ }
352477
+ }
352478
+ return void 0;
352479
+ }
352480
+ getSelfAndInlineAllOfElements() {
352481
+ if (this.context.isReferenceObject(this.schemaOrReference) || this.schemaOrReference.allOf == null) {
352482
+ return [this.schemaOrReference];
352483
+ }
352484
+ return [
352485
+ this.schemaOrReference,
352486
+ ...this.schemaOrReference.allOf.filter((element4) => !this.context.isReferenceObject(element4))
352487
+ ];
352488
+ }
352416
352489
  convertSchemaObject({ schema }) {
352417
352490
  const schemaId = this.schemaIdOverride ?? this.context.convertBreadcrumbsToName(this.breadcrumbs);
352418
352491
  const namespacedSchemaId = this.context.getNamespacedSchemaId(schemaId);
@@ -705228,7 +705301,7 @@ var AccessTokenPosthogManager = class {
705228
705301
  properties: {
705229
705302
  ...event,
705230
705303
  ...event.properties,
705231
- version: "5.109.2",
705304
+ version: "5.110.0",
705232
705305
  usingAccessToken: true,
705233
705306
  ...getRunIdProperties()
705234
705307
  }
@@ -705294,7 +705367,7 @@ var UserPosthogManager = class {
705294
705367
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
705295
705368
  event: "CLI",
705296
705369
  properties: {
705297
- version: "5.109.2",
705370
+ version: "5.110.0",
705298
705371
  ...event,
705299
705372
  ...event.properties,
705300
705373
  usingAccessToken: false,
@@ -886968,7 +887041,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
886968
887041
  var LOGS_FOLDER_NAME = "logs";
886969
887042
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
886970
887043
  function getCliSource() {
886971
- const version7 = "5.109.2";
887044
+ const version7 = "5.110.0";
886972
887045
  return `cli@${version7}`;
886973
887046
  }
886974
887047
  var DebugLogger = class {
@@ -913932,7 +914005,7 @@ var LegacyDocsPublisher = class {
913932
914005
  previewId,
913933
914006
  disableTemplates: void 0,
913934
914007
  skipUpload,
913935
- cliVersion: "5.109.2",
914008
+ cliVersion: "5.110.0",
913936
914009
  loginCommand: "fern auth login"
913937
914010
  });
913938
914011
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -980852,7 +980925,7 @@ function getAutomationContextFromEnv() {
980852
980925
  config_branch: process.env.FERN_CONFIG_BRANCH,
980853
980926
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
980854
980927
  trigger: process.env.GITHUB_EVENT_NAME,
980855
- cli_version: "5.109.2"
980928
+ cli_version: "5.110.0"
980856
980929
  };
980857
980930
  }
980858
980931
  function isAutomationMode() {
@@ -981684,7 +981757,7 @@ var CliContext = class _CliContext {
981684
981757
  if (false) {
981685
981758
  this.logger.error("CLI_VERSION is not defined");
981686
981759
  }
981687
- return "5.109.2";
981760
+ return "5.110.0";
981688
981761
  }
981689
981762
  getCliName() {
981690
981763
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.109.2",
2
+ "version": "5.110.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",