@fern-api/fern-api-dev 5.51.0 → 5.51.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 +30 -21
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -153498,6 +153498,9 @@ function convertSchemaObject(schema, wrapAsOptional, wrapAsNullable, context3, b
|
|
|
153498
153498
|
let groupName = (typeof mixedGroupName === "string" ? [mixedGroupName] : mixedGroupName) ?? [];
|
|
153499
153499
|
groupName = context3.resolveGroupName(groupName);
|
|
153500
153500
|
const generatedName = getGeneratedTypeName(breadcrumbs, context3.options.preserveSchemaIds);
|
|
153501
|
+
if (nameOverride != null) {
|
|
153502
|
+
breadcrumbs = [nameOverride];
|
|
153503
|
+
}
|
|
153501
153504
|
const title2 = schema.title;
|
|
153502
153505
|
const description = schema.description;
|
|
153503
153506
|
const availability = convertAvailability2(schema);
|
|
@@ -562574,9 +562577,9 @@ var require_VersionUtils = __commonJS({
|
|
|
562574
562577
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
562575
562578
|
exports2.VersionBump = exports2.MAX_RAW_DIFF_BYTES = exports2.MAX_CHUNKS = exports2.MAX_AI_DIFF_BYTES = exports2.MAGIC_VERSION_PYTHON = exports2.MAGIC_VERSION = exports2.AUTO_VERSION = void 0;
|
|
562576
562579
|
exports2.extractLanguageFromGeneratorName = extractLanguageFromGeneratorName2;
|
|
562577
|
-
exports2.mapMagicVersionForLanguage =
|
|
562580
|
+
exports2.mapMagicVersionForLanguage = mapMagicVersionForLanguage3;
|
|
562578
562581
|
exports2.maxVersionBump = maxVersionBump3;
|
|
562579
|
-
exports2.isAutoVersion =
|
|
562582
|
+
exports2.isAutoVersion = isAutoVersion5;
|
|
562580
562583
|
exports2.isValidSemver = isValidSemver;
|
|
562581
562584
|
exports2.incrementVersion = incrementVersion;
|
|
562582
562585
|
exports2.extractPreviousVersionFromDiffLine = extractPreviousVersionFromDiffLine;
|
|
@@ -562619,7 +562622,7 @@ var require_VersionUtils = __commonJS({
|
|
|
562619
562622
|
exports2.AUTO_VERSION = "AUTO";
|
|
562620
562623
|
exports2.MAGIC_VERSION = "0.0.0-fern-placeholder";
|
|
562621
562624
|
exports2.MAGIC_VERSION_PYTHON = "0.0.0.dev0";
|
|
562622
|
-
function
|
|
562625
|
+
function mapMagicVersionForLanguage3(magicVersion, language) {
|
|
562623
562626
|
if (magicVersion !== exports2.MAGIC_VERSION) {
|
|
562624
562627
|
return magicVersion;
|
|
562625
562628
|
}
|
|
@@ -562651,7 +562654,7 @@ var require_VersionUtils = __commonJS({
|
|
|
562651
562654
|
return (VERSION_BUMP_RANK[a3] ?? 0) >= (VERSION_BUMP_RANK[b5] ?? 0) ? a3 : b5;
|
|
562652
562655
|
}
|
|
562653
562656
|
var SEMVER_PATTERN = /^(v)?(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+([\w.-]+))?$/;
|
|
562654
|
-
function
|
|
562657
|
+
function isAutoVersion5(version7) {
|
|
562655
562658
|
return exports2.AUTO_VERSION.toLowerCase() === version7.toLowerCase();
|
|
562656
562659
|
}
|
|
562657
562660
|
function isValidSemver(version7) {
|
|
@@ -686381,7 +686384,7 @@ var AccessTokenPosthogManager = class {
|
|
|
686381
686384
|
properties: {
|
|
686382
686385
|
...event,
|
|
686383
686386
|
...event.properties,
|
|
686384
|
-
version: "5.51.
|
|
686387
|
+
version: "5.51.2",
|
|
686385
686388
|
usingAccessToken: true,
|
|
686386
686389
|
...getRunIdProperties()
|
|
686387
686390
|
}
|
|
@@ -686447,7 +686450,7 @@ var UserPosthogManager = class {
|
|
|
686447
686450
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
686448
686451
|
event: "CLI",
|
|
686449
686452
|
properties: {
|
|
686450
|
-
version: "5.51.
|
|
686453
|
+
version: "5.51.2",
|
|
686451
686454
|
...event,
|
|
686452
686455
|
...event.properties,
|
|
686453
686456
|
usingAccessToken: false,
|
|
@@ -867509,7 +867512,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
867509
867512
|
var LOGS_FOLDER_NAME = "logs";
|
|
867510
867513
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
867511
867514
|
function getCliSource() {
|
|
867512
|
-
const version7 = "5.51.
|
|
867515
|
+
const version7 = "5.51.2";
|
|
867513
867516
|
return `cli@${version7}`;
|
|
867514
867517
|
}
|
|
867515
867518
|
var DebugLogger = class {
|
|
@@ -899697,7 +899700,7 @@ var LegacyDocsPublisher = class {
|
|
|
899697
899700
|
previewId,
|
|
899698
899701
|
disableTemplates: void 0,
|
|
899699
899702
|
skipUpload,
|
|
899700
|
-
cliVersion: "5.51.
|
|
899703
|
+
cliVersion: "5.51.2",
|
|
899701
899704
|
loginCommand: "fern auth login"
|
|
899702
899705
|
});
|
|
899703
899706
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -952529,7 +952532,8 @@ var LocalTaskHandler = class {
|
|
|
952529
952532
|
autoVersioningVersionBumpReason: void 0
|
|
952530
952533
|
};
|
|
952531
952534
|
}
|
|
952532
|
-
|
|
952535
|
+
const mappedMagicVersion = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
|
|
952536
|
+
await autoVersioningService.replaceMagicVersion(this.absolutePathToLocalOutput, mappedMagicVersion, autoVersionResult.version);
|
|
952533
952537
|
if (this.generatorLanguage === "go") {
|
|
952534
952538
|
this.context.logger.info("Adding Go major version suffix to module paths");
|
|
952535
952539
|
await autoVersioningService.addGoMajorVersionSuffix(this.absolutePathToLocalOutput, autoVersionResult.version);
|
|
@@ -952554,6 +952558,7 @@ var LocalTaskHandler = class {
|
|
|
952554
952558
|
async handleAutoVersioning(priorChangelog) {
|
|
952555
952559
|
const autoVersioningService = new import_autoversion2.AutoVersioningService({ logger: this.context.logger });
|
|
952556
952560
|
let diffFile;
|
|
952561
|
+
const mappedMagicVersion = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
|
|
952557
952562
|
try {
|
|
952558
952563
|
this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
|
|
952559
952564
|
diffFile = await this.generateDiffFile();
|
|
@@ -952570,7 +952575,7 @@ var LocalTaskHandler = class {
|
|
|
952570
952575
|
}
|
|
952571
952576
|
let previousVersion;
|
|
952572
952577
|
try {
|
|
952573
|
-
previousVersion = autoVersioningService.extractPreviousVersion(diffContent,
|
|
952578
|
+
previousVersion = autoVersioningService.extractPreviousVersion(diffContent, mappedMagicVersion);
|
|
952574
952579
|
} catch (e2) {
|
|
952575
952580
|
if (!(e2 instanceof import_autoversion2.AutoVersioningException) || !e2.magicVersionAbsent) {
|
|
952576
952581
|
throw e2;
|
|
@@ -952583,7 +952588,7 @@ var LocalTaskHandler = class {
|
|
|
952583
952588
|
}
|
|
952584
952589
|
if (previousVersion == null) {
|
|
952585
952590
|
this.context.logger.info("No git tags found \u2014 treating as new SDK repository");
|
|
952586
|
-
const initialVersion =
|
|
952591
|
+
const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
952587
952592
|
const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
952588
952593
|
return {
|
|
952589
952594
|
version: initialVersion,
|
|
@@ -952592,7 +952597,7 @@ var LocalTaskHandler = class {
|
|
|
952592
952597
|
}
|
|
952593
952598
|
this.context.logger.debug(`Previous version from fallback: ${previousVersion}`);
|
|
952594
952599
|
}
|
|
952595
|
-
const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent,
|
|
952600
|
+
const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent, mappedMagicVersion);
|
|
952596
952601
|
const rawDiffSizeKB = (0, import_autoversion2.formatSizeKB)(diffContent.length);
|
|
952597
952602
|
const cleanedDiffSizeKB = (0, import_autoversion2.formatSizeKB)(cleanedDiff.length);
|
|
952598
952603
|
const rawFileCount = (0, import_autoversion2.countFilesInDiff)(diffContent);
|
|
@@ -952611,7 +952616,7 @@ var LocalTaskHandler = class {
|
|
|
952611
952616
|
}
|
|
952612
952617
|
if (previousVersion == null) {
|
|
952613
952618
|
this.context.logger.info("No previous version found (new SDK repository). Using 0.0.1 as initial version.");
|
|
952614
|
-
const initialVersion =
|
|
952619
|
+
const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
952615
952620
|
const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
952616
952621
|
return {
|
|
952617
952622
|
version: initialVersion,
|
|
@@ -952747,7 +952752,7 @@ var LocalTaskHandler = class {
|
|
|
952747
952752
|
} catch (error50) {
|
|
952748
952753
|
if (error50 instanceof import_autoversion2.AutoVersioningException) {
|
|
952749
952754
|
this.context.logger.warn(`AUTO versioning could not extract previous version: ${error50.message}. Falling back to initial version 0.0.1.`);
|
|
952750
|
-
const initialVersion =
|
|
952755
|
+
const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
952751
952756
|
const commitMessage = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
952752
952757
|
return {
|
|
952753
952758
|
version: initialVersion,
|
|
@@ -952874,8 +952879,8 @@ var LocalTaskHandler = class {
|
|
|
952874
952879
|
}
|
|
952875
952880
|
/**
|
|
952876
952881
|
* Normalizes a version string's `v` prefix to match the convention used by
|
|
952877
|
-
* the magic version
|
|
952878
|
-
* magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
|
|
952882
|
+
* the magic version for this generator's language. Git tags may use `v1.2.3`
|
|
952883
|
+
* while the magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
|
|
952879
952884
|
* Without normalization the mismatch propagates into `replaceMagicVersion`
|
|
952880
952885
|
* and can produce invalid versions in package manifests (e.g. `v1.3.0` in
|
|
952881
952886
|
* a `package.json` that expects bare semver).
|
|
@@ -952884,8 +952889,9 @@ var LocalTaskHandler = class {
|
|
|
952884
952889
|
if (version7 == null) {
|
|
952885
952890
|
return void 0;
|
|
952886
952891
|
}
|
|
952892
|
+
const mapped = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
|
|
952887
952893
|
const stripped = version7.startsWith("v") ? version7.slice(1) : version7;
|
|
952888
|
-
if (
|
|
952894
|
+
if (mapped.startsWith("v")) {
|
|
952889
952895
|
return `v${stripped}`;
|
|
952890
952896
|
}
|
|
952891
952897
|
return stripped;
|
|
@@ -953453,6 +953459,8 @@ function extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig) {
|
|
|
953453
953459
|
return void 0;
|
|
953454
953460
|
}
|
|
953455
953461
|
async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFernConfig, workspace, generatorInvocation, absolutePathToLocalOutput, absolutePathToLocalSnippetJSON, absolutePathToLocalSnippetTemplateJSON, audiences, version: version7, workspaceTempDir, keepDocker, context: context3, irVersionOverride, outputVersionOverride, writeUnitTests, generateOauthClients, generatePaginatedClients, includeOptionalRequestPropertyExamples, inspect: inspect6, executionEnvironment, runner, whiteLabel, publishToRegistry, ir: ir3, ai: ai2, autoVersioningCache, absolutePathToSpecRepo, skipFernignore, disableTelemetry, rawApiSpecs }) {
|
|
953462
|
+
const irVersion = version7 ?? outputVersionOverride;
|
|
953463
|
+
const effectiveIrVersion = irVersion != null && (0, import_autoversion3.isAutoVersion)(irVersion) ? import_autoversion3.MAGIC_VERSION : irVersion;
|
|
953456
953464
|
const { latest: latest2, migrated } = await getIntermediateRepresentation({
|
|
953457
953465
|
workspace,
|
|
953458
953466
|
audiences,
|
|
@@ -953460,7 +953468,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
953460
953468
|
context: context3,
|
|
953461
953469
|
irVersionOverride,
|
|
953462
953470
|
packageName: generators_yml_exports.getPackageName({ generatorInvocation }),
|
|
953463
|
-
version:
|
|
953471
|
+
version: effectiveIrVersion,
|
|
953464
953472
|
sourceConfig: getSourceConfig(workspace, executionEnvironment?.usesContainerPaths ?? true),
|
|
953465
953473
|
includeOptionalRequestPropertyExamples,
|
|
953466
953474
|
ir: ir3
|
|
@@ -953515,7 +953523,8 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
953515
953523
|
};
|
|
953516
953524
|
const generatorLanguage = generatorInvocation.language ?? (0, import_autoversion3.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
953517
953525
|
const mappedVersion = version7 != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(version7, generatorLanguage) : version7;
|
|
953518
|
-
const
|
|
953526
|
+
const effectiveOutputVersion = outputVersionOverride != null && (0, import_autoversion3.isAutoVersion)(outputVersionOverride) ? import_autoversion3.MAGIC_VERSION : outputVersionOverride;
|
|
953527
|
+
const mappedOutputVersionOverride = effectiveOutputVersion != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(effectiveOutputVersion, generatorLanguage) : effectiveOutputVersion;
|
|
953519
953528
|
const config5 = getGeneratorConfig({
|
|
953520
953529
|
generatorInvocation,
|
|
953521
953530
|
customConfig: generatorInvocation.config,
|
|
@@ -965832,7 +965841,7 @@ function getAutomationContextFromEnv() {
|
|
|
965832
965841
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
965833
965842
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
965834
965843
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
965835
|
-
cli_version: "5.51.
|
|
965844
|
+
cli_version: "5.51.2"
|
|
965836
965845
|
};
|
|
965837
965846
|
}
|
|
965838
965847
|
function isAutomationMode() {
|
|
@@ -966664,7 +966673,7 @@ var CliContext = class _CliContext {
|
|
|
966664
966673
|
if (false) {
|
|
966665
966674
|
this.logger.error("CLI_VERSION is not defined");
|
|
966666
966675
|
}
|
|
966667
|
-
return "5.51.
|
|
966676
|
+
return "5.51.2";
|
|
966668
966677
|
}
|
|
966669
966678
|
getCliName() {
|
|
966670
966679
|
if (false) {
|
package/package.json
CHANGED