@fern-api/fern-api-dev 4.52.1-5-g7288f6e1b02 → 4.52.2-1-gd66aa5eb620

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 +44 -7
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -593336,7 +593336,10 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
593336
593336
  const protobufIRResultsPromise = this.generateAllProtobufIRs({ context: context3 });
593337
593337
  const specs = await this.getOpenAPISpecsCached({ context: context3 });
593338
593338
  const documents = await this.loader.loadDocuments({ context: context3, specs });
593339
- const authOverrides = this.generatorsConfiguration?.api?.auth != null ? { ...this.generatorsConfiguration?.api } : void 0;
593339
+ let authOverrides = this.generatorsConfiguration?.api?.auth != null ? { ...this.generatorsConfiguration?.api } : void 0;
593340
+ if (authOverrides == null) {
593341
+ authOverrides = await getAuthFromOverrideFiles(specs);
593342
+ }
593340
593343
  const environmentOverrides = this.generatorsConfiguration?.api?.environments != null ? { ...this.generatorsConfiguration?.api } : void 0;
593341
593344
  if (environmentOverrides) {
593342
593345
  context3.logger.trace("Using environment overrides from generators configuration");
@@ -593513,7 +593516,19 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
593513
593516
  if (specsOverride != null) {
593514
593517
  return this.createWorkspaceWithSpecsOverride({ context: context3 }, specsOverride, settings);
593515
593518
  }
593516
- const definition3 = await this.getDefinition({ context: context3 }, settings);
593519
+ let effectiveSettings = settings;
593520
+ if (this.generatorsConfiguration?.api?.auth == null && settings?.auth == null) {
593521
+ const specs = await this.getOpenAPISpecsCached({ context: context3 });
593522
+ const authFromOverrides = await getAuthFromOverrideFiles(specs);
593523
+ if (authFromOverrides != null) {
593524
+ effectiveSettings = {
593525
+ ...settings,
593526
+ auth: authFromOverrides.auth,
593527
+ authSchemes: authFromOverrides["auth-schemes"]
593528
+ };
593529
+ }
593530
+ }
593531
+ const definition3 = await this.getDefinition({ context: context3 }, effectiveSettings);
593517
593532
  return new FernWorkspace({
593518
593533
  absoluteFilePath: this.absoluteFilePath,
593519
593534
  workspaceName: this.workspaceName,
@@ -593623,6 +593638,28 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
593623
593638
  }, result);
593624
593639
  }
593625
593640
  };
593641
+ async function getAuthFromOverrideFiles(specs) {
593642
+ for (const spec of specs) {
593643
+ if (spec.type !== "openapi") {
593644
+ continue;
593645
+ }
593646
+ const overridePaths = spec.absoluteFilepathToOverrides == null ? [] : Array.isArray(spec.absoluteFilepathToOverrides) ? spec.absoluteFilepathToOverrides : [spec.absoluteFilepathToOverrides];
593647
+ for (const overridePath of overridePaths) {
593648
+ try {
593649
+ const contents = (await (0, import_promises37.readFile)(overridePath)).toString();
593650
+ const parsed = jsYaml.load(contents);
593651
+ if (parsed != null && parsed["auth"] != null) {
593652
+ return {
593653
+ auth: parsed["auth"],
593654
+ ...parsed["auth-schemes"] != null ? { "auth-schemes": parsed["auth-schemes"] } : {}
593655
+ };
593656
+ }
593657
+ } catch {
593658
+ }
593659
+ }
593660
+ }
593661
+ return void 0;
593662
+ }
593626
593663
 
593627
593664
  // ../workspace/oss-validator/lib/validateOSSWorkspace.js
593628
593665
  var import_promises38 = require("fs/promises");
@@ -602343,7 +602380,7 @@ var AccessTokenPosthogManager = class {
602343
602380
  properties: {
602344
602381
  ...event,
602345
602382
  ...event.properties,
602346
- version: "4.52.1-5-g7288f6e1b02",
602383
+ version: "4.52.2-1-gd66aa5eb620",
602347
602384
  usingAccessToken: true
602348
602385
  }
602349
602386
  });
@@ -602394,7 +602431,7 @@ var UserPosthogManager = class {
602394
602431
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602395
602432
  event: "CLI",
602396
602433
  properties: {
602397
- version: "4.52.1-5-g7288f6e1b02",
602434
+ version: "4.52.2-1-gd66aa5eb620",
602398
602435
  ...event,
602399
602436
  ...event.properties,
602400
602437
  usingAccessToken: false,
@@ -826267,7 +826304,7 @@ var import_path54 = __toESM(require("path"), 1);
826267
826304
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
826268
826305
  var LOGS_FOLDER_NAME = "logs";
826269
826306
  function getCliSource() {
826270
- const version7 = "4.52.1-5-g7288f6e1b02";
826307
+ const version7 = "4.52.2-1-gd66aa5eb620";
826271
826308
  return `cli@${version7}`;
826272
826309
  }
826273
826310
  var DebugLogger = class {
@@ -837279,7 +837316,7 @@ var LegacyDocsPublisher = class {
837279
837316
  previewId: void 0,
837280
837317
  disableTemplates: void 0,
837281
837318
  skipUpload,
837282
- cliVersion: "4.52.1-5-g7288f6e1b02"
837319
+ cliVersion: "4.52.2-1-gd66aa5eb620"
837283
837320
  });
837284
837321
  if (taskContext.getResult() === TaskResult.Failure) {
837285
837322
  return { success: false };
@@ -910399,7 +910436,7 @@ var CliContext = class {
910399
910436
  if (false) {
910400
910437
  this.logger.error("CLI_VERSION is not defined");
910401
910438
  }
910402
- return "4.52.1-5-g7288f6e1b02";
910439
+ return "4.52.2-1-gd66aa5eb620";
910403
910440
  }
910404
910441
  getCliName() {
910405
910442
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.52.1-5-g7288f6e1b02",
2
+ "version": "4.52.2-1-gd66aa5eb620",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",