@fern-api/fern-api-dev 5.60.0 → 5.61.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.
- package/cli.cjs +49 -12
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -83624,6 +83624,15 @@ function getPackageNameFromGeneratorConfig(generatorInvocation) {
|
|
|
83624
83624
|
}
|
|
83625
83625
|
return void 0;
|
|
83626
83626
|
}
|
|
83627
|
+
function getUserAgentTemplateFromGeneratorConfig(generatorInvocation) {
|
|
83628
|
+
if (typeof generatorInvocation.raw?.config === "object" && generatorInvocation.raw?.config !== null) {
|
|
83629
|
+
const template = generatorInvocation.raw.config["user-agent"];
|
|
83630
|
+
if (template != null) {
|
|
83631
|
+
return template;
|
|
83632
|
+
}
|
|
83633
|
+
}
|
|
83634
|
+
return void 0;
|
|
83635
|
+
}
|
|
83627
83636
|
async function checkVersionDoesNotAlreadyExist({ version: version7, packageName, generatorInvocation, context: context3 }) {
|
|
83628
83637
|
if (version7 == null) {
|
|
83629
83638
|
return;
|
|
@@ -275752,7 +275761,7 @@ var init_getIrGenerationSettings = __esm({
|
|
|
275752
275761
|
});
|
|
275753
275762
|
|
|
275754
275763
|
// ../generation/ir-generator/lib/generateIntermediateRepresentation.js
|
|
275755
|
-
function generateIntermediateRepresentation({ workspace, generationLanguage, keywords: keywords3, smartCasing, exampleGeneration, audiences, readme, packageName, version: version7, fdrApiDefinitionId, sourceResolver, disableDynamicExamples, dynamicGeneratorConfig, generationMetadata }) {
|
|
275764
|
+
function generateIntermediateRepresentation({ workspace, generationLanguage, keywords: keywords3, smartCasing, exampleGeneration, audiences, readme, packageName, userAgentTemplate, organization, version: version7, fdrApiDefinitionId, sourceResolver, disableDynamicExamples, dynamicGeneratorConfig, generationMetadata }) {
|
|
275756
275765
|
const irSettings = getIrGenerationSettings({ workspace });
|
|
275757
275766
|
const casingsGenerator = constructCasingsGenerator({ generationLanguage, keywords: keywords3, smartCasing });
|
|
275758
275767
|
const irGraph = new IrGraph(audiences);
|
|
@@ -276087,10 +276096,27 @@ function generateIntermediateRepresentation({ workspace, generationLanguage, key
|
|
|
276087
276096
|
language: "X-Fern-Language",
|
|
276088
276097
|
sdkName: "X-Fern-SDK-Name",
|
|
276089
276098
|
sdkVersion: "X-Fern-SDK-Version",
|
|
276090
|
-
userAgent:
|
|
276091
|
-
|
|
276092
|
-
|
|
276093
|
-
|
|
276099
|
+
userAgent: (() => {
|
|
276100
|
+
if (hasCustomUserAgentHeader) {
|
|
276101
|
+
return void 0;
|
|
276102
|
+
}
|
|
276103
|
+
if (userAgentTemplate != null && version7 != null) {
|
|
276104
|
+
const vars = {
|
|
276105
|
+
version: version7,
|
|
276106
|
+
packageName: packageName ?? "",
|
|
276107
|
+
language: generationLanguage ?? "",
|
|
276108
|
+
generatorVersion: generationMetadata?.generatorVersion ?? "",
|
|
276109
|
+
organization: organization ?? "",
|
|
276110
|
+
apiName: workspace.definition.rootApiFile.contents.name ?? ""
|
|
276111
|
+
};
|
|
276112
|
+
const value2 = userAgentTemplate.replace(/\{(\w+)\}/g, (_5, key2) => vars[key2] ?? "");
|
|
276113
|
+
return { header: "User-Agent", value: value2 };
|
|
276114
|
+
}
|
|
276115
|
+
if (version7 != null && packageName != null) {
|
|
276116
|
+
return { header: "User-Agent", value: `${packageName}/${version7}` };
|
|
276117
|
+
}
|
|
276118
|
+
return void 0;
|
|
276119
|
+
})()
|
|
276094
276120
|
}
|
|
276095
276121
|
};
|
|
276096
276122
|
const resolvedReadme = readme ?? workspace.generatorsConfiguration?.rawConfiguration.readme;
|
|
@@ -687123,7 +687149,7 @@ var AccessTokenPosthogManager = class {
|
|
|
687123
687149
|
properties: {
|
|
687124
687150
|
...event,
|
|
687125
687151
|
...event.properties,
|
|
687126
|
-
version: "5.
|
|
687152
|
+
version: "5.61.0",
|
|
687127
687153
|
usingAccessToken: true,
|
|
687128
687154
|
...getRunIdProperties()
|
|
687129
687155
|
}
|
|
@@ -687189,7 +687215,7 @@ var UserPosthogManager = class {
|
|
|
687189
687215
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
687190
687216
|
event: "CLI",
|
|
687191
687217
|
properties: {
|
|
687192
|
-
version: "5.
|
|
687218
|
+
version: "5.61.0",
|
|
687193
687219
|
...event,
|
|
687194
687220
|
...event.properties,
|
|
687195
687221
|
usingAccessToken: false,
|
|
@@ -868284,7 +868310,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
868284
868310
|
var LOGS_FOLDER_NAME = "logs";
|
|
868285
868311
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
868286
868312
|
function getCliSource() {
|
|
868287
|
-
const version7 = "5.
|
|
868313
|
+
const version7 = "5.61.0";
|
|
868288
868314
|
return `cli@${version7}`;
|
|
868289
868315
|
}
|
|
868290
868316
|
var DebugLogger = class {
|
|
@@ -898033,6 +898059,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
898033
898059
|
});
|
|
898034
898060
|
}
|
|
898035
898061
|
}
|
|
898062
|
+
const userAgentTemplate = getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
|
|
898036
898063
|
const ir3 = generateIntermediateRepresentation({
|
|
898037
898064
|
workspace,
|
|
898038
898065
|
generationLanguage: generatorInvocation.language,
|
|
@@ -898046,6 +898073,8 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
898046
898073
|
audiences,
|
|
898047
898074
|
readme,
|
|
898048
898075
|
packageName,
|
|
898076
|
+
userAgentTemplate,
|
|
898077
|
+
organization,
|
|
898049
898078
|
version: resolvedVersion,
|
|
898050
898079
|
context: interactiveTaskContext,
|
|
898051
898080
|
sourceResolver: new SourceResolverImpl(interactiveTaskContext, workspace),
|
|
@@ -900776,7 +900805,7 @@ var LegacyDocsPublisher = class {
|
|
|
900776
900805
|
previewId,
|
|
900777
900806
|
disableTemplates: void 0,
|
|
900778
900807
|
skipUpload,
|
|
900779
|
-
cliVersion: "5.
|
|
900808
|
+
cliVersion: "5.61.0",
|
|
900780
900809
|
loginCommand: "fern auth login"
|
|
900781
900810
|
});
|
|
900782
900811
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -953579,7 +953608,8 @@ init_lib17();
|
|
|
953579
953608
|
init_lib36();
|
|
953580
953609
|
init_lib26();
|
|
953581
953610
|
init_lib22();
|
|
953582
|
-
async function getIntermediateRepresentation({ workspace, audiences, generatorInvocation, context: context3, irVersionOverride, version: version7, packageName, sourceConfig, includeOptionalRequestPropertyExamples, ir: ir3 }) {
|
|
953611
|
+
async function getIntermediateRepresentation({ workspace, audiences, generatorInvocation, context: context3, irVersionOverride, version: version7, packageName, userAgentTemplate, organization, sourceConfig, includeOptionalRequestPropertyExamples, ir: ir3 }) {
|
|
953612
|
+
const resolvedUserAgentTemplate = userAgentTemplate ?? getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
|
|
953583
953613
|
const intermediateRepresentation = ir3 ?? generateIntermediateRepresentation({
|
|
953584
953614
|
workspace,
|
|
953585
953615
|
audiences,
|
|
@@ -953593,6 +953623,8 @@ async function getIntermediateRepresentation({ workspace, audiences, generatorIn
|
|
|
953593
953623
|
readme: generatorInvocation.readme,
|
|
953594
953624
|
version: version7,
|
|
953595
953625
|
packageName,
|
|
953626
|
+
userAgentTemplate: resolvedUserAgentTemplate,
|
|
953627
|
+
organization,
|
|
953596
953628
|
context: context3,
|
|
953597
953629
|
sourceResolver: new SourceResolverImpl(context3, workspace),
|
|
953598
953630
|
generationMetadata: {
|
|
@@ -954915,6 +954947,7 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
954915
954947
|
generatorInvocation
|
|
954916
954948
|
});
|
|
954917
954949
|
const packageName = getPackageNameFromGeneratorConfig(generatorInvocation);
|
|
954950
|
+
const userAgentTemplate = getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
|
|
954918
954951
|
version7 = version7 ?? await computeSemanticVersion({ packageName, generatorInvocation });
|
|
954919
954952
|
const intermediateRepresentation = generateIntermediateRepresentation({
|
|
954920
954953
|
workspace: fernWorkspace,
|
|
@@ -954929,6 +954962,8 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
954929
954962
|
readme: generatorInvocation.readme,
|
|
954930
954963
|
version: version7 ?? await computeSemanticVersion({ packageName, generatorInvocation }),
|
|
954931
954964
|
packageName,
|
|
954965
|
+
userAgentTemplate,
|
|
954966
|
+
organization: projectConfig.organization,
|
|
954932
954967
|
context: context3,
|
|
954933
954968
|
sourceResolver: new SourceResolverImpl(context3, fernWorkspace),
|
|
954934
954969
|
dynamicGeneratorConfig,
|
|
@@ -955460,6 +955495,8 @@ var GenerationRunner = class {
|
|
|
955460
955495
|
readme: generatorInvocation.readme,
|
|
955461
955496
|
version: outputVersionOverride,
|
|
955462
955497
|
packageName: generators_yml_exports.getPackageName({ generatorInvocation }),
|
|
955498
|
+
userAgentTemplate: getUserAgentTemplateFromGeneratorConfig(generatorInvocation),
|
|
955499
|
+
organization,
|
|
955463
955500
|
context: context3,
|
|
955464
955501
|
sourceResolver: new SourceResolverImpl(context3, workspace),
|
|
955465
955502
|
generationMetadata: {
|
|
@@ -967046,7 +967083,7 @@ function getAutomationContextFromEnv() {
|
|
|
967046
967083
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
967047
967084
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
967048
967085
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
967049
|
-
cli_version: "5.
|
|
967086
|
+
cli_version: "5.61.0"
|
|
967050
967087
|
};
|
|
967051
967088
|
}
|
|
967052
967089
|
function isAutomationMode() {
|
|
@@ -967878,7 +967915,7 @@ var CliContext = class _CliContext {
|
|
|
967878
967915
|
if (false) {
|
|
967879
967916
|
this.logger.error("CLI_VERSION is not defined");
|
|
967880
967917
|
}
|
|
967881
|
-
return "5.
|
|
967918
|
+
return "5.61.0";
|
|
967882
967919
|
}
|
|
967883
967920
|
getCliName() {
|
|
967884
967921
|
if (false) {
|
package/package.json
CHANGED