@fern-api/fern-api-dev 5.50.6 → 5.51.1
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 +40 -23
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -81214,6 +81214,7 @@ var init_IntermediateRepresentation2 = __esm({
|
|
|
81214
81214
|
IntermediateRepresentation = schemas_exports3.objectWithoutOptionalProperties({
|
|
81215
81215
|
fdrApiDefinitionId: schemas_exports3.string().optional(),
|
|
81216
81216
|
apiVersion: ApiVersionScheme2.optional(),
|
|
81217
|
+
specVersion: schemas_exports3.string().optional(),
|
|
81217
81218
|
apiName: NameOrString,
|
|
81218
81219
|
apiDisplayName: schemas_exports3.string().optional(),
|
|
81219
81220
|
apiDocs: schemas_exports3.string().optional(),
|
|
@@ -139019,6 +139020,7 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
|
|
|
139019
139020
|
init_WebsocketChannel2();
|
|
139020
139021
|
OpenApiIntermediateRepresentation = schemas_exports9.objectWithoutOptionalProperties({
|
|
139021
139022
|
apiVersion: schemas_exports9.unknown().optional(),
|
|
139023
|
+
specVersion: schemas_exports9.string().optional(),
|
|
139022
139024
|
title: schemas_exports9.string().optional(),
|
|
139023
139025
|
description: schemas_exports9.string().optional(),
|
|
139024
139026
|
basePath: schemas_exports9.string().optional(),
|
|
@@ -149711,7 +149713,8 @@ var init_FernDefinitionConverter = __esm({
|
|
|
149711
149713
|
}
|
|
149712
149714
|
},
|
|
149713
149715
|
packageMarkers: {},
|
|
149714
|
-
importedDefinitions: {}
|
|
149716
|
+
importedDefinitions: {},
|
|
149717
|
+
specVersion: ir3.specVersion ?? void 0
|
|
149715
149718
|
};
|
|
149716
149719
|
}
|
|
149717
149720
|
};
|
|
@@ -166399,6 +166402,7 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
166399
166402
|
context: context3,
|
|
166400
166403
|
document: openApi
|
|
166401
166404
|
}),
|
|
166405
|
+
specVersion: openApi.info.version != null && openApi.info.version.length > 0 ? openApi.info.version : void 0,
|
|
166402
166406
|
basePath: (() => {
|
|
166403
166407
|
const parsed = getFernBasePath(openApi);
|
|
166404
166408
|
return parsed?.basePath;
|
|
@@ -166633,6 +166637,7 @@ var init_generateIr = __esm({
|
|
|
166633
166637
|
function parse8({ context: context3, documents, options: options2 }) {
|
|
166634
166638
|
let ir3 = {
|
|
166635
166639
|
apiVersion: void 0,
|
|
166640
|
+
specVersion: void 0,
|
|
166636
166641
|
title: void 0,
|
|
166637
166642
|
description: void 0,
|
|
166638
166643
|
basePath: void 0,
|
|
@@ -166849,6 +166854,7 @@ function merge6(ir1, ir22, options2) {
|
|
|
166849
166854
|
if (!shouldGroupEnvironments) {
|
|
166850
166855
|
return {
|
|
166851
166856
|
apiVersion: ir1.apiVersion ?? ir22.apiVersion,
|
|
166857
|
+
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
166852
166858
|
title: ir1.title ?? ir22.title,
|
|
166853
166859
|
description: ir1.description ?? ir22.description,
|
|
166854
166860
|
basePath: ir1.basePath ?? ir22.basePath,
|
|
@@ -166980,6 +166986,7 @@ function merge6(ir1, ir22, options2) {
|
|
|
166980
166986
|
mergedEndpoints = [...ir1EndpointsWithApiTag, ...ir2EndpointsWithApiTag];
|
|
166981
166987
|
return {
|
|
166982
166988
|
apiVersion: ir1.apiVersion ?? ir22.apiVersion,
|
|
166989
|
+
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
166983
166990
|
title: ir1.title ?? ir22.title,
|
|
166984
166991
|
description: ir1.description ?? ir22.description,
|
|
166985
166992
|
basePath: ir1.basePath ?? ir22.basePath,
|
|
@@ -167033,6 +167040,7 @@ function merge6(ir1, ir22, options2) {
|
|
|
167033
167040
|
}
|
|
167034
167041
|
return {
|
|
167035
167042
|
apiVersion: ir1.apiVersion ?? ir22.apiVersion,
|
|
167043
|
+
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
167036
167044
|
title: ir1.title ?? ir22.title,
|
|
167037
167045
|
description: ir1.description ?? ir22.description,
|
|
167038
167046
|
basePath: ir1.basePath ?? ir22.basePath,
|
|
@@ -266375,6 +266383,7 @@ function mergeIntermediateRepresentation(ir1, ir22, casingsGenerator) {
|
|
|
266375
266383
|
apiName: ir1.apiName,
|
|
266376
266384
|
basePath: ir1.basePath,
|
|
266377
266385
|
selfHosted: ir1.selfHosted && ir22.selfHosted,
|
|
266386
|
+
specVersion: ir1.specVersion ?? ir22.specVersion,
|
|
266378
266387
|
apiDisplayName: ir1.apiDisplayName ?? ir22.apiDisplayName,
|
|
266379
266388
|
apiDocs: ir1.apiDocs ?? ir22.apiDocs,
|
|
266380
266389
|
auth: {
|
|
@@ -275614,6 +275623,7 @@ function generateIntermediateRepresentation({ workspace, generationLanguage, key
|
|
|
275614
275623
|
file: rootApiFileContext,
|
|
275615
275624
|
rawApiFileSchema: workspace.definition.rootApiFile.contents
|
|
275616
275625
|
}),
|
|
275626
|
+
specVersion: workspace.definition.specVersion,
|
|
275617
275627
|
apiName: casingsGenerator.generateName(workspace.definition.rootApiFile.contents.name),
|
|
275618
275628
|
apiDisplayName: workspace.definition.rootApiFile.contents["display-name"],
|
|
275619
275629
|
apiDocs: formatDocs(workspace.definition.rootApiFile.contents.docs),
|
|
@@ -341170,7 +341180,8 @@ var init_AbstractSpecConverter = __esm({
|
|
|
341170
341180
|
audiences: void 0,
|
|
341171
341181
|
generationMetadata: void 0,
|
|
341172
341182
|
apiPlayground: void 0,
|
|
341173
|
-
casingsConfig: void 0
|
|
341183
|
+
casingsConfig: void 0,
|
|
341184
|
+
specVersion: void 0
|
|
341174
341185
|
};
|
|
341175
341186
|
}
|
|
341176
341187
|
removeXFernIgnores({ document: document4, breadcrumbs = [] }) {
|
|
@@ -562563,9 +562574,9 @@ var require_VersionUtils = __commonJS({
|
|
|
562563
562574
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
562564
562575
|
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;
|
|
562565
562576
|
exports2.extractLanguageFromGeneratorName = extractLanguageFromGeneratorName2;
|
|
562566
|
-
exports2.mapMagicVersionForLanguage =
|
|
562577
|
+
exports2.mapMagicVersionForLanguage = mapMagicVersionForLanguage3;
|
|
562567
562578
|
exports2.maxVersionBump = maxVersionBump3;
|
|
562568
|
-
exports2.isAutoVersion =
|
|
562579
|
+
exports2.isAutoVersion = isAutoVersion5;
|
|
562569
562580
|
exports2.isValidSemver = isValidSemver;
|
|
562570
562581
|
exports2.incrementVersion = incrementVersion;
|
|
562571
562582
|
exports2.extractPreviousVersionFromDiffLine = extractPreviousVersionFromDiffLine;
|
|
@@ -562608,7 +562619,7 @@ var require_VersionUtils = __commonJS({
|
|
|
562608
562619
|
exports2.AUTO_VERSION = "AUTO";
|
|
562609
562620
|
exports2.MAGIC_VERSION = "0.0.0-fern-placeholder";
|
|
562610
562621
|
exports2.MAGIC_VERSION_PYTHON = "0.0.0.dev0";
|
|
562611
|
-
function
|
|
562622
|
+
function mapMagicVersionForLanguage3(magicVersion, language) {
|
|
562612
562623
|
if (magicVersion !== exports2.MAGIC_VERSION) {
|
|
562613
562624
|
return magicVersion;
|
|
562614
562625
|
}
|
|
@@ -562640,7 +562651,7 @@ var require_VersionUtils = __commonJS({
|
|
|
562640
562651
|
return (VERSION_BUMP_RANK[a3] ?? 0) >= (VERSION_BUMP_RANK[b5] ?? 0) ? a3 : b5;
|
|
562641
562652
|
}
|
|
562642
562653
|
var SEMVER_PATTERN = /^(v)?(\d+)\.(\d+)\.(\d+)(?:-([\w.-]+))?(?:\+([\w.-]+))?$/;
|
|
562643
|
-
function
|
|
562654
|
+
function isAutoVersion5(version7) {
|
|
562644
562655
|
return exports2.AUTO_VERSION.toLowerCase() === version7.toLowerCase();
|
|
562645
562656
|
}
|
|
562646
562657
|
function isValidSemver(version7) {
|
|
@@ -686370,7 +686381,7 @@ var AccessTokenPosthogManager = class {
|
|
|
686370
686381
|
properties: {
|
|
686371
686382
|
...event,
|
|
686372
686383
|
...event.properties,
|
|
686373
|
-
version: "5.
|
|
686384
|
+
version: "5.51.1",
|
|
686374
686385
|
usingAccessToken: true,
|
|
686375
686386
|
...getRunIdProperties()
|
|
686376
686387
|
}
|
|
@@ -686436,7 +686447,7 @@ var UserPosthogManager = class {
|
|
|
686436
686447
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
686437
686448
|
event: "CLI",
|
|
686438
686449
|
properties: {
|
|
686439
|
-
version: "5.
|
|
686450
|
+
version: "5.51.1",
|
|
686440
686451
|
...event,
|
|
686441
686452
|
...event.properties,
|
|
686442
686453
|
usingAccessToken: false,
|
|
@@ -867498,7 +867509,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
867498
867509
|
var LOGS_FOLDER_NAME = "logs";
|
|
867499
867510
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
867500
867511
|
function getCliSource() {
|
|
867501
|
-
const version7 = "5.
|
|
867512
|
+
const version7 = "5.51.1";
|
|
867502
867513
|
return `cli@${version7}`;
|
|
867503
867514
|
}
|
|
867504
867515
|
var DebugLogger = class {
|
|
@@ -899686,7 +899697,7 @@ var LegacyDocsPublisher = class {
|
|
|
899686
899697
|
previewId,
|
|
899687
899698
|
disableTemplates: void 0,
|
|
899688
899699
|
skipUpload,
|
|
899689
|
-
cliVersion: "5.
|
|
899700
|
+
cliVersion: "5.51.1",
|
|
899690
899701
|
loginCommand: "fern auth login"
|
|
899691
899702
|
});
|
|
899692
899703
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -952518,7 +952529,8 @@ var LocalTaskHandler = class {
|
|
|
952518
952529
|
autoVersioningVersionBumpReason: void 0
|
|
952519
952530
|
};
|
|
952520
952531
|
}
|
|
952521
|
-
|
|
952532
|
+
const mappedMagicVersion = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
|
|
952533
|
+
await autoVersioningService.replaceMagicVersion(this.absolutePathToLocalOutput, mappedMagicVersion, autoVersionResult.version);
|
|
952522
952534
|
if (this.generatorLanguage === "go") {
|
|
952523
952535
|
this.context.logger.info("Adding Go major version suffix to module paths");
|
|
952524
952536
|
await autoVersioningService.addGoMajorVersionSuffix(this.absolutePathToLocalOutput, autoVersionResult.version);
|
|
@@ -952543,6 +952555,7 @@ var LocalTaskHandler = class {
|
|
|
952543
952555
|
async handleAutoVersioning(priorChangelog) {
|
|
952544
952556
|
const autoVersioningService = new import_autoversion2.AutoVersioningService({ logger: this.context.logger });
|
|
952545
952557
|
let diffFile;
|
|
952558
|
+
const mappedMagicVersion = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
|
|
952546
952559
|
try {
|
|
952547
952560
|
this.context.logger.info("Analyzing SDK changes for automatic semantic versioning");
|
|
952548
952561
|
diffFile = await this.generateDiffFile();
|
|
@@ -952559,7 +952572,7 @@ var LocalTaskHandler = class {
|
|
|
952559
952572
|
}
|
|
952560
952573
|
let previousVersion;
|
|
952561
952574
|
try {
|
|
952562
|
-
previousVersion = autoVersioningService.extractPreviousVersion(diffContent,
|
|
952575
|
+
previousVersion = autoVersioningService.extractPreviousVersion(diffContent, mappedMagicVersion);
|
|
952563
952576
|
} catch (e2) {
|
|
952564
952577
|
if (!(e2 instanceof import_autoversion2.AutoVersioningException) || !e2.magicVersionAbsent) {
|
|
952565
952578
|
throw e2;
|
|
@@ -952572,7 +952585,7 @@ var LocalTaskHandler = class {
|
|
|
952572
952585
|
}
|
|
952573
952586
|
if (previousVersion == null) {
|
|
952574
952587
|
this.context.logger.info("No git tags found \u2014 treating as new SDK repository");
|
|
952575
|
-
const initialVersion =
|
|
952588
|
+
const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
952576
952589
|
const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
952577
952590
|
return {
|
|
952578
952591
|
version: initialVersion,
|
|
@@ -952581,7 +952594,7 @@ var LocalTaskHandler = class {
|
|
|
952581
952594
|
}
|
|
952582
952595
|
this.context.logger.debug(`Previous version from fallback: ${previousVersion}`);
|
|
952583
952596
|
}
|
|
952584
|
-
const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent,
|
|
952597
|
+
const cleanedDiff = autoVersioningService.cleanDiffForAI(diffContent, mappedMagicVersion);
|
|
952585
952598
|
const rawDiffSizeKB = (0, import_autoversion2.formatSizeKB)(diffContent.length);
|
|
952586
952599
|
const cleanedDiffSizeKB = (0, import_autoversion2.formatSizeKB)(cleanedDiff.length);
|
|
952587
952600
|
const rawFileCount = (0, import_autoversion2.countFilesInDiff)(diffContent);
|
|
@@ -952600,7 +952613,7 @@ var LocalTaskHandler = class {
|
|
|
952600
952613
|
}
|
|
952601
952614
|
if (previousVersion == null) {
|
|
952602
952615
|
this.context.logger.info("No previous version found (new SDK repository). Using 0.0.1 as initial version.");
|
|
952603
|
-
const initialVersion =
|
|
952616
|
+
const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
952604
952617
|
const commitMessage2 = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
952605
952618
|
return {
|
|
952606
952619
|
version: initialVersion,
|
|
@@ -952736,7 +952749,7 @@ var LocalTaskHandler = class {
|
|
|
952736
952749
|
} catch (error50) {
|
|
952737
952750
|
if (error50 instanceof import_autoversion2.AutoVersioningException) {
|
|
952738
952751
|
this.context.logger.warn(`AUTO versioning could not extract previous version: ${error50.message}. Falling back to initial version 0.0.1.`);
|
|
952739
|
-
const initialVersion =
|
|
952752
|
+
const initialVersion = mappedMagicVersion.startsWith("v") ? "v0.0.1" : "0.0.1";
|
|
952740
952753
|
const commitMessage = this.isWhitelabel ? "Initial SDK generation" : "Initial SDK generation\n\n\u{1F33F} Generated with Fern";
|
|
952741
952754
|
return {
|
|
952742
952755
|
version: initialVersion,
|
|
@@ -952863,8 +952876,8 @@ var LocalTaskHandler = class {
|
|
|
952863
952876
|
}
|
|
952864
952877
|
/**
|
|
952865
952878
|
* Normalizes a version string's `v` prefix to match the convention used by
|
|
952866
|
-
* the magic version
|
|
952867
|
-
* magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
|
|
952879
|
+
* the magic version for this generator's language. Git tags may use `v1.2.3`
|
|
952880
|
+
* while the magic version is `0.0.0-fern-placeholder` (no prefix) or vice-versa.
|
|
952868
952881
|
* Without normalization the mismatch propagates into `replaceMagicVersion`
|
|
952869
952882
|
* and can produce invalid versions in package manifests (e.g. `v1.3.0` in
|
|
952870
952883
|
* a `package.json` that expects bare semver).
|
|
@@ -952873,8 +952886,9 @@ var LocalTaskHandler = class {
|
|
|
952873
952886
|
if (version7 == null) {
|
|
952874
952887
|
return void 0;
|
|
952875
952888
|
}
|
|
952889
|
+
const mapped = (0, import_autoversion2.mapMagicVersionForLanguage)(import_autoversion2.MAGIC_VERSION, this.generatorLanguage ?? "");
|
|
952876
952890
|
const stripped = version7.startsWith("v") ? version7.slice(1) : version7;
|
|
952877
|
-
if (
|
|
952891
|
+
if (mapped.startsWith("v")) {
|
|
952878
952892
|
return `v${stripped}`;
|
|
952879
952893
|
}
|
|
952880
952894
|
return stripped;
|
|
@@ -953442,6 +953456,8 @@ function extractLicenseFilePath(generatorInvocation, absolutePathToFernConfig) {
|
|
|
953442
953456
|
return void 0;
|
|
953443
953457
|
}
|
|
953444
953458
|
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 }) {
|
|
953459
|
+
const irVersion = version7 ?? outputVersionOverride;
|
|
953460
|
+
const effectiveIrVersion = irVersion != null && (0, import_autoversion3.isAutoVersion)(irVersion) ? import_autoversion3.MAGIC_VERSION : irVersion;
|
|
953445
953461
|
const { latest: latest2, migrated } = await getIntermediateRepresentation({
|
|
953446
953462
|
workspace,
|
|
953447
953463
|
audiences,
|
|
@@ -953449,7 +953465,7 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
953449
953465
|
context: context3,
|
|
953450
953466
|
irVersionOverride,
|
|
953451
953467
|
packageName: generators_yml_exports.getPackageName({ generatorInvocation }),
|
|
953452
|
-
version:
|
|
953468
|
+
version: effectiveIrVersion,
|
|
953453
953469
|
sourceConfig: getSourceConfig(workspace, executionEnvironment?.usesContainerPaths ?? true),
|
|
953454
953470
|
includeOptionalRequestPropertyExamples,
|
|
953455
953471
|
ir: ir3
|
|
@@ -953504,7 +953520,8 @@ async function writeFilesToDiskAndRunGenerator({ organization, absolutePathToFer
|
|
|
953504
953520
|
};
|
|
953505
953521
|
const generatorLanguage = generatorInvocation.language ?? (0, import_autoversion3.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
953506
953522
|
const mappedVersion = version7 != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(version7, generatorLanguage) : version7;
|
|
953507
|
-
const
|
|
953523
|
+
const effectiveOutputVersion = outputVersionOverride != null && (0, import_autoversion3.isAutoVersion)(outputVersionOverride) ? import_autoversion3.MAGIC_VERSION : outputVersionOverride;
|
|
953524
|
+
const mappedOutputVersionOverride = effectiveOutputVersion != null ? (0, import_autoversion3.mapMagicVersionForLanguage)(effectiveOutputVersion, generatorLanguage) : effectiveOutputVersion;
|
|
953508
953525
|
const config5 = getGeneratorConfig({
|
|
953509
953526
|
generatorInvocation,
|
|
953510
953527
|
customConfig: generatorInvocation.config,
|
|
@@ -965821,7 +965838,7 @@ function getAutomationContextFromEnv() {
|
|
|
965821
965838
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
965822
965839
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
965823
965840
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
965824
|
-
cli_version: "5.
|
|
965841
|
+
cli_version: "5.51.1"
|
|
965825
965842
|
};
|
|
965826
965843
|
}
|
|
965827
965844
|
function isAutomationMode() {
|
|
@@ -966653,7 +966670,7 @@ var CliContext = class _CliContext {
|
|
|
966653
966670
|
if (false) {
|
|
966654
966671
|
this.logger.error("CLI_VERSION is not defined");
|
|
966655
966672
|
}
|
|
966656
|
-
return "5.
|
|
966673
|
+
return "5.51.1";
|
|
966657
966674
|
}
|
|
966658
966675
|
getCliName() {
|
|
966659
966676
|
if (false) {
|
package/package.json
CHANGED