@fern-api/fern-api-dev 4.52.1 → 4.52.2
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.
- package/cli.cjs +50 -11
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -542898,6 +542898,7 @@ var RESERVED_KEYWORDS = {
|
|
|
542898
542898
|
"if",
|
|
542899
542899
|
"import",
|
|
542900
542900
|
"interface",
|
|
542901
|
+
"internal",
|
|
542901
542902
|
"map",
|
|
542902
542903
|
"package",
|
|
542903
542904
|
"range",
|
|
@@ -593335,7 +593336,10 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
|
|
|
593335
593336
|
const protobufIRResultsPromise = this.generateAllProtobufIRs({ context: context3 });
|
|
593336
593337
|
const specs = await this.getOpenAPISpecsCached({ context: context3 });
|
|
593337
593338
|
const documents = await this.loader.loadDocuments({ context: context3, specs });
|
|
593338
|
-
|
|
593339
|
+
let authOverrides = this.generatorsConfiguration?.api?.auth != null ? { ...this.generatorsConfiguration?.api } : void 0;
|
|
593340
|
+
if (authOverrides == null) {
|
|
593341
|
+
authOverrides = await getAuthFromOverrideFiles(specs);
|
|
593342
|
+
}
|
|
593339
593343
|
const environmentOverrides = this.generatorsConfiguration?.api?.environments != null ? { ...this.generatorsConfiguration?.api } : void 0;
|
|
593340
593344
|
if (environmentOverrides) {
|
|
593341
593345
|
context3.logger.trace("Using environment overrides from generators configuration");
|
|
@@ -593512,7 +593516,19 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
|
|
|
593512
593516
|
if (specsOverride != null) {
|
|
593513
593517
|
return this.createWorkspaceWithSpecsOverride({ context: context3 }, specsOverride, settings);
|
|
593514
593518
|
}
|
|
593515
|
-
|
|
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);
|
|
593516
593532
|
return new FernWorkspace({
|
|
593517
593533
|
absoluteFilePath: this.absoluteFilePath,
|
|
593518
593534
|
workspaceName: this.workspaceName,
|
|
@@ -593622,6 +593638,28 @@ var OSSWorkspace = class _OSSWorkspace extends BaseOpenAPIWorkspace {
|
|
|
593622
593638
|
}, result);
|
|
593623
593639
|
}
|
|
593624
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
|
+
}
|
|
593625
593663
|
|
|
593626
593664
|
// ../workspace/oss-validator/lib/validateOSSWorkspace.js
|
|
593627
593665
|
var import_promises38 = require("fs/promises");
|
|
@@ -602342,7 +602380,7 @@ var AccessTokenPosthogManager = class {
|
|
|
602342
602380
|
properties: {
|
|
602343
602381
|
...event,
|
|
602344
602382
|
...event.properties,
|
|
602345
|
-
version: "4.52.
|
|
602383
|
+
version: "4.52.2",
|
|
602346
602384
|
usingAccessToken: true
|
|
602347
602385
|
}
|
|
602348
602386
|
});
|
|
@@ -602393,7 +602431,7 @@ var UserPosthogManager = class {
|
|
|
602393
602431
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
602394
602432
|
event: "CLI",
|
|
602395
602433
|
properties: {
|
|
602396
|
-
version: "4.52.
|
|
602434
|
+
version: "4.52.2",
|
|
602397
602435
|
...event,
|
|
602398
602436
|
...event.properties,
|
|
602399
602437
|
usingAccessToken: false,
|
|
@@ -826266,7 +826304,7 @@ var import_path54 = __toESM(require("path"), 1);
|
|
|
826266
826304
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
826267
826305
|
var LOGS_FOLDER_NAME = "logs";
|
|
826268
826306
|
function getCliSource() {
|
|
826269
|
-
const version7 = "4.52.
|
|
826307
|
+
const version7 = "4.52.2";
|
|
826270
826308
|
return `cli@${version7}`;
|
|
826271
826309
|
}
|
|
826272
826310
|
var DebugLogger = class {
|
|
@@ -837278,7 +837316,7 @@ var LegacyDocsPublisher = class {
|
|
|
837278
837316
|
previewId: void 0,
|
|
837279
837317
|
disableTemplates: void 0,
|
|
837280
837318
|
skipUpload,
|
|
837281
|
-
cliVersion: "4.52.
|
|
837319
|
+
cliVersion: "4.52.2"
|
|
837282
837320
|
});
|
|
837283
837321
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
837284
837322
|
return { success: false };
|
|
@@ -861441,7 +861479,7 @@ var DynamicSnippetsGeneratorContext2 = class _DynamicSnippetsGeneratorContext ex
|
|
|
861441
861479
|
return goExportedFieldName(name2.pascalCase.unsafeName);
|
|
861442
861480
|
}
|
|
861443
861481
|
getImportPath(fernFilepath) {
|
|
861444
|
-
const parts = fernFilepath.packagePath.map((path97) => path97.
|
|
861482
|
+
const parts = fernFilepath.packagePath.map((path97) => path97.camelCase.safeName.toLowerCase());
|
|
861445
861483
|
return [this.rootImportPath, ...parts].join("/");
|
|
861446
861484
|
}
|
|
861447
861485
|
getImportPathForRequest(fernFilepath) {
|
|
@@ -864672,10 +864710,10 @@ var DynamicSnippetsGeneratorContext3 = class _DynamicSnippetsGeneratorContext ex
|
|
|
864672
864710
|
dynamicTypeMapper;
|
|
864673
864711
|
dynamicTypeLiteralMapper;
|
|
864674
864712
|
filePropertyMapper;
|
|
864675
|
-
constructor({ ir: ir15, config: config5, options: options2 }) {
|
|
864713
|
+
constructor({ ir: ir15, config: config5, options: options2, sharedCustomConfig }) {
|
|
864676
864714
|
super({ ir: ir15, config: config5, options: options2 });
|
|
864677
864715
|
this.ir = ir15;
|
|
864678
|
-
this.customConfig = BaseJavaCustomConfigSchema.parse(config5.customConfig ?? {});
|
|
864716
|
+
this.customConfig = sharedCustomConfig ?? BaseJavaCustomConfigSchema.parse(config5.customConfig ?? {});
|
|
864679
864717
|
this.dynamicTypeMapper = new DynamicTypeMapper3({ context: this });
|
|
864680
864718
|
this.dynamicTypeLiteralMapper = new DynamicTypeLiteralMapper({ context: this });
|
|
864681
864719
|
this.filePropertyMapper = new FilePropertyMapper3({ context: this });
|
|
@@ -864684,7 +864722,8 @@ var DynamicSnippetsGeneratorContext3 = class _DynamicSnippetsGeneratorContext ex
|
|
|
864684
864722
|
return new _DynamicSnippetsGeneratorContext({
|
|
864685
864723
|
ir: this.ir,
|
|
864686
864724
|
config: this.config,
|
|
864687
|
-
options: this.options
|
|
864725
|
+
options: this.options,
|
|
864726
|
+
sharedCustomConfig: this.customConfig
|
|
864688
864727
|
});
|
|
864689
864728
|
}
|
|
864690
864729
|
getClassName(name2) {
|
|
@@ -910397,7 +910436,7 @@ var CliContext = class {
|
|
|
910397
910436
|
if (false) {
|
|
910398
910437
|
this.logger.error("CLI_VERSION is not defined");
|
|
910399
910438
|
}
|
|
910400
|
-
return "4.52.
|
|
910439
|
+
return "4.52.2";
|
|
910401
910440
|
}
|
|
910402
910441
|
getCliName() {
|
|
910403
910442
|
if (false) {
|
package/package.json
CHANGED