@fern-api/fern-api-dev 5.67.1 → 5.69.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 +201 -21
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -67272,6 +67272,13 @@ var init_HeaderApiVersionScheme = __esm({
|
|
|
67272
67272
|
}
|
|
67273
67273
|
});
|
|
67274
67274
|
|
|
67275
|
+
// ../../ir-sdk/lib/sdk/api/resources/ir/types/IdempotencyKeyGeneration.js
|
|
67276
|
+
var init_IdempotencyKeyGeneration = __esm({
|
|
67277
|
+
"../../ir-sdk/lib/sdk/api/resources/ir/types/IdempotencyKeyGeneration.js"() {
|
|
67278
|
+
"use strict";
|
|
67279
|
+
}
|
|
67280
|
+
});
|
|
67281
|
+
|
|
67275
67282
|
// ../../ir-sdk/lib/sdk/api/resources/ir/types/IntermediateRepresentation.js
|
|
67276
67283
|
var init_IntermediateRepresentation = __esm({
|
|
67277
67284
|
"../../ir-sdk/lib/sdk/api/resources/ir/types/IntermediateRepresentation.js"() {
|
|
@@ -67400,6 +67407,7 @@ var init_types63 = __esm({
|
|
|
67400
67407
|
init_ExampleStyle();
|
|
67401
67408
|
init_GenerationMetadata();
|
|
67402
67409
|
init_HeaderApiVersionScheme();
|
|
67410
|
+
init_IdempotencyKeyGeneration();
|
|
67403
67411
|
init_IntermediateRepresentation();
|
|
67404
67412
|
init_InvocationSource();
|
|
67405
67413
|
init_Package();
|
|
@@ -79542,6 +79550,20 @@ var init_GenerationMetadata2 = __esm({
|
|
|
79542
79550
|
}
|
|
79543
79551
|
});
|
|
79544
79552
|
|
|
79553
|
+
// ../../ir-sdk/lib/sdk/serialization/resources/ir/types/IdempotencyKeyGeneration.js
|
|
79554
|
+
var IdempotencyKeyGeneration;
|
|
79555
|
+
var init_IdempotencyKeyGeneration2 = __esm({
|
|
79556
|
+
"../../ir-sdk/lib/sdk/serialization/resources/ir/types/IdempotencyKeyGeneration.js"() {
|
|
79557
|
+
"use strict";
|
|
79558
|
+
init_core2();
|
|
79559
|
+
init_HttpMethod4();
|
|
79560
|
+
IdempotencyKeyGeneration = schemas_exports3.objectWithoutOptionalProperties({
|
|
79561
|
+
headerName: schemas_exports3.string(),
|
|
79562
|
+
methods: schemas_exports3.list(HttpMethod4)
|
|
79563
|
+
});
|
|
79564
|
+
}
|
|
79565
|
+
});
|
|
79566
|
+
|
|
79545
79567
|
// ../../ir-sdk/lib/sdk/serialization/resources/publish/types/CratesPublishTarget.js
|
|
79546
79568
|
var CratesPublishTarget;
|
|
79547
79569
|
var init_CratesPublishTarget2 = __esm({
|
|
@@ -81375,13 +81397,15 @@ var init_SdkConfig2 = __esm({
|
|
|
81375
81397
|
"../../ir-sdk/lib/sdk/serialization/resources/ir/types/SdkConfig.js"() {
|
|
81376
81398
|
"use strict";
|
|
81377
81399
|
init_core2();
|
|
81400
|
+
init_IdempotencyKeyGeneration2();
|
|
81378
81401
|
init_PlatformHeaders2();
|
|
81379
81402
|
SdkConfig = schemas_exports3.objectWithoutOptionalProperties({
|
|
81380
81403
|
isAuthMandatory: schemas_exports3.boolean(),
|
|
81381
81404
|
hasStreamingEndpoints: schemas_exports3.boolean(),
|
|
81382
81405
|
hasPaginatedEndpoints: schemas_exports3.boolean(),
|
|
81383
81406
|
hasFileDownloadEndpoints: schemas_exports3.boolean(),
|
|
81384
|
-
platformHeaders: PlatformHeaders
|
|
81407
|
+
platformHeaders: PlatformHeaders,
|
|
81408
|
+
idempotencyKeyGeneration: IdempotencyKeyGeneration.optional()
|
|
81385
81409
|
});
|
|
81386
81410
|
}
|
|
81387
81411
|
});
|
|
@@ -81521,6 +81545,7 @@ var init_types92 = __esm({
|
|
|
81521
81545
|
init_ExampleStyle2();
|
|
81522
81546
|
init_GenerationMetadata2();
|
|
81523
81547
|
init_HeaderApiVersionScheme2();
|
|
81548
|
+
init_IdempotencyKeyGeneration2();
|
|
81524
81549
|
init_IntermediateRepresentation2();
|
|
81525
81550
|
init_InvocationSource2();
|
|
81526
81551
|
init_Package2();
|
|
@@ -81549,6 +81574,7 @@ __export(ir_exports4, {
|
|
|
81549
81574
|
ExampleStyle: () => ExampleStyle2,
|
|
81550
81575
|
GenerationMetadata: () => GenerationMetadata,
|
|
81551
81576
|
HeaderApiVersionScheme: () => HeaderApiVersionScheme,
|
|
81577
|
+
IdempotencyKeyGeneration: () => IdempotencyKeyGeneration,
|
|
81552
81578
|
IntermediateRepresentation: () => IntermediateRepresentation,
|
|
81553
81579
|
InvocationSource: () => InvocationSource2,
|
|
81554
81580
|
Package: () => Package,
|
|
@@ -82851,6 +82877,7 @@ __export(serialization_exports2, {
|
|
|
82851
82877
|
HttpResponse: () => HttpResponse,
|
|
82852
82878
|
HttpResponseBody: () => HttpResponseBody2,
|
|
82853
82879
|
HttpService: () => HttpService,
|
|
82880
|
+
IdempotencyKeyGeneration: () => IdempotencyKeyGeneration,
|
|
82854
82881
|
InferredAuthScheme: () => InferredAuthScheme,
|
|
82855
82882
|
InferredAuthSchemeTokenEndpoint: () => InferredAuthSchemeTokenEndpoint,
|
|
82856
82883
|
InferredAuthenticatedRequestHeader: () => InferredAuthenticatedRequestHeader2,
|
|
@@ -83903,6 +83930,36 @@ function getUserAgentTemplateFromGeneratorConfig(generatorInvocation) {
|
|
|
83903
83930
|
}
|
|
83904
83931
|
return void 0;
|
|
83905
83932
|
}
|
|
83933
|
+
function parseIdempotencyKeyMethods(value2) {
|
|
83934
|
+
if (!Array.isArray(value2)) {
|
|
83935
|
+
return DEFAULT_IDEMPOTENCY_KEY_METHODS;
|
|
83936
|
+
}
|
|
83937
|
+
const methods = value2.filter((entry) => typeof entry === "string").map((entry) => entry.toUpperCase()).filter((entry) => ALL_HTTP_METHODS.has(entry));
|
|
83938
|
+
return methods.length > 0 ? methods : DEFAULT_IDEMPOTENCY_KEY_METHODS;
|
|
83939
|
+
}
|
|
83940
|
+
function getIdempotencyKeyGenerationFromGeneratorConfig(generatorInvocation) {
|
|
83941
|
+
const value2 = generatorInvocation.idempotencyKeyGenerationConfig ?? getRawPerGeneratorIdempotencyKeyConfig(generatorInvocation);
|
|
83942
|
+
return resolveIdempotencyKeyGeneration(value2);
|
|
83943
|
+
}
|
|
83944
|
+
function getRawPerGeneratorIdempotencyKeyConfig(generatorInvocation) {
|
|
83945
|
+
if (typeof generatorInvocation.raw?.config !== "object" || generatorInvocation.raw?.config === null) {
|
|
83946
|
+
return void 0;
|
|
83947
|
+
}
|
|
83948
|
+
return generatorInvocation.raw.config["auto-generate-idempotency-key"];
|
|
83949
|
+
}
|
|
83950
|
+
function resolveIdempotencyKeyGeneration(value2) {
|
|
83951
|
+
if (value2 === true) {
|
|
83952
|
+
return { headerName: DEFAULT_IDEMPOTENCY_KEY_HEADER, methods: DEFAULT_IDEMPOTENCY_KEY_METHODS };
|
|
83953
|
+
}
|
|
83954
|
+
if (typeof value2 === "object" && value2 !== null) {
|
|
83955
|
+
const headerName = value2["header-name"];
|
|
83956
|
+
return {
|
|
83957
|
+
headerName: typeof headerName === "string" ? headerName : DEFAULT_IDEMPOTENCY_KEY_HEADER,
|
|
83958
|
+
methods: parseIdempotencyKeyMethods(value2["methods"])
|
|
83959
|
+
};
|
|
83960
|
+
}
|
|
83961
|
+
return void 0;
|
|
83962
|
+
}
|
|
83906
83963
|
function stripCliConfigKeys(config5) {
|
|
83907
83964
|
if (typeof config5 !== "object" || config5 === null) {
|
|
83908
83965
|
return config5;
|
|
@@ -84068,13 +84125,16 @@ function getRegistryName(language) {
|
|
|
84068
84125
|
return language;
|
|
84069
84126
|
}
|
|
84070
84127
|
}
|
|
84071
|
-
var CLI_ONLY_CONFIG_KEYS, REGISTRY_TIMEOUT_MS;
|
|
84128
|
+
var DEFAULT_IDEMPOTENCY_KEY_HEADER, DEFAULT_IDEMPOTENCY_KEY_METHODS, ALL_HTTP_METHODS, CLI_ONLY_CONFIG_KEYS, REGISTRY_TIMEOUT_MS;
|
|
84072
84129
|
var init_checkVersionExists = __esm({
|
|
84073
84130
|
"../../commons/api-workspace-commons/lib/checkVersionExists.js"() {
|
|
84074
84131
|
"use strict";
|
|
84075
84132
|
init_lib4();
|
|
84076
84133
|
init_lib6();
|
|
84077
|
-
|
|
84134
|
+
DEFAULT_IDEMPOTENCY_KEY_HEADER = "Idempotency-Key";
|
|
84135
|
+
DEFAULT_IDEMPOTENCY_KEY_METHODS = ["POST", "PUT"];
|
|
84136
|
+
ALL_HTTP_METHODS = /* @__PURE__ */ new Set(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]);
|
|
84137
|
+
CLI_ONLY_CONFIG_KEYS = /* @__PURE__ */ new Set(["user-agent", "auto-generate-idempotency-key"]);
|
|
84078
84138
|
REGISTRY_TIMEOUT_MS = 5e3;
|
|
84079
84139
|
}
|
|
84080
84140
|
});
|
|
@@ -129705,7 +129765,9 @@ var init_ApiConfigurationV2SettingsSchema2 = __esm({
|
|
|
129705
129765
|
init_core6();
|
|
129706
129766
|
init_AsyncApiSettingsSchema2();
|
|
129707
129767
|
init_OpenApiSettingsSchema2();
|
|
129708
|
-
ApiConfigurationV2SettingsSchema = schemas_exports8.object({
|
|
129768
|
+
ApiConfigurationV2SettingsSchema = schemas_exports8.object({
|
|
129769
|
+
"auto-generate-idempotency-key": schemas_exports8.unknown().optional()
|
|
129770
|
+
}).extend(OpenApiSettingsSchema).extend(AsyncApiSettingsSchema);
|
|
129709
129771
|
}
|
|
129710
129772
|
});
|
|
129711
129773
|
|
|
@@ -259592,6 +259654,8 @@ async function convertGeneratorsConfiguration({ absolutePathToGeneratorsConfigur
|
|
|
259592
259654
|
const readme = rawGeneratorsConfiguration.readme;
|
|
259593
259655
|
warnForDeprecatedConfiguration(context3, rawGeneratorsConfiguration);
|
|
259594
259656
|
const parsedApiConfiguration = await parseAPIConfiguration(rawGeneratorsConfiguration);
|
|
259657
|
+
const apiConfiguration = rawGeneratorsConfiguration.api;
|
|
259658
|
+
const globalIdempotencyKeyGeneration = apiConfiguration != null && generators_yml_exports.isApiConfigurationV2Schema(apiConfiguration) ? apiConfiguration.settings?.["auto-generate-idempotency-key"] : void 0;
|
|
259595
259659
|
return {
|
|
259596
259660
|
absolutePathToConfiguration: absolutePathToGeneratorsConfiguration,
|
|
259597
259661
|
api: parsedApiConfiguration,
|
|
@@ -259606,6 +259670,7 @@ async function convertGeneratorsConfiguration({ absolutePathToGeneratorsConfigur
|
|
|
259606
259670
|
maybeTopLevelMetadata,
|
|
259607
259671
|
maybeTopLevelReviewers: rawGeneratorsConfiguration.reviewers,
|
|
259608
259672
|
maybeRootAutomation: rawGeneratorsConfiguration.automation,
|
|
259673
|
+
globalIdempotencyKeyGeneration,
|
|
259609
259674
|
readme,
|
|
259610
259675
|
context: context3
|
|
259611
259676
|
}))) : [],
|
|
@@ -259990,7 +260055,7 @@ async function parseAPIConfiguration(rawGeneratorsConfiguration) {
|
|
|
259990
260055
|
definitions: await parseAPIConfigurationToApiLocations(apiConfiguration, rawGeneratorsConfiguration, emptySettings)
|
|
259991
260056
|
};
|
|
259992
260057
|
}
|
|
259993
|
-
async function convertGroup({ absolutePathToGeneratorsConfiguration, groupName, group, maybeTopLevelMetadata, maybeTopLevelReviewers, maybeRootAutomation, readme, context: context3 }) {
|
|
260058
|
+
async function convertGroup({ absolutePathToGeneratorsConfiguration, groupName, group, maybeTopLevelMetadata, maybeTopLevelReviewers, maybeRootAutomation, globalIdempotencyKeyGeneration, readme, context: context3 }) {
|
|
259994
260059
|
const maybeGroupLevelMetadata = getOutputMetadata(group.metadata);
|
|
259995
260060
|
return {
|
|
259996
260061
|
groupName,
|
|
@@ -260005,6 +260070,7 @@ async function convertGroup({ absolutePathToGeneratorsConfiguration, groupName,
|
|
|
260005
260070
|
maybeGroupLevelReviewers: group.reviewers,
|
|
260006
260071
|
maybeRootAutomation,
|
|
260007
260072
|
maybeGroupAutomation: group.automation,
|
|
260073
|
+
globalIdempotencyKeyGeneration,
|
|
260008
260074
|
readme,
|
|
260009
260075
|
context: context3
|
|
260010
260076
|
})))
|
|
@@ -260026,10 +260092,12 @@ function getGeneratorNameAndImage(generator, context3) {
|
|
|
260026
260092
|
containerImage: void 0
|
|
260027
260093
|
};
|
|
260028
260094
|
}
|
|
260029
|
-
async function convertGenerator({ absolutePathToGeneratorsConfiguration, generator, maybeGroupLevelMetadata, maybeTopLevelMetadata, maybeGroupLevelReviewers, maybeTopLevelReviewers, maybeRootAutomation, maybeGroupAutomation, readme, context: context3 }) {
|
|
260095
|
+
async function convertGenerator({ absolutePathToGeneratorsConfiguration, generator, maybeGroupLevelMetadata, maybeTopLevelMetadata, maybeGroupLevelReviewers, maybeTopLevelReviewers, maybeRootAutomation, maybeGroupAutomation, globalIdempotencyKeyGeneration, readme, context: context3 }) {
|
|
260030
260096
|
const { normalizedName, containerImage } = getGeneratorNameAndImage(generator, context3);
|
|
260097
|
+
const perGeneratorIdempotencyKeyGeneration = typeof generator.config === "object" && generator.config !== null ? generator.config["auto-generate-idempotency-key"] : void 0;
|
|
260031
260098
|
return {
|
|
260032
260099
|
raw: generator,
|
|
260100
|
+
idempotencyKeyGenerationConfig: perGeneratorIdempotencyKeyGeneration ?? globalIdempotencyKeyGeneration,
|
|
260033
260101
|
automation: generators_yml_exports.resolveAutomationConfig({
|
|
260034
260102
|
rootAutomation: maybeRootAutomation,
|
|
260035
260103
|
groupAutomation: maybeGroupAutomation,
|
|
@@ -276640,7 +276708,7 @@ var init_getIrGenerationSettings = __esm({
|
|
|
276640
276708
|
});
|
|
276641
276709
|
|
|
276642
276710
|
// ../generation/ir-generator/lib/generateIntermediateRepresentation.js
|
|
276643
|
-
function generateIntermediateRepresentation({ workspace, generationLanguage, keywords: keywords3, smartCasing, exampleGeneration, audiences, readme, packageName, userAgentTemplate, organization, version: version7, context: context3, fdrApiDefinitionId, sourceResolver, disableDynamicExamples, dynamicGeneratorConfig, generationMetadata }) {
|
|
276711
|
+
function generateIntermediateRepresentation({ workspace, generationLanguage, keywords: keywords3, smartCasing, exampleGeneration, audiences, readme, packageName, userAgentTemplate, idempotencyKeyGeneration, organization, version: version7, context: context3, fdrApiDefinitionId, sourceResolver, disableDynamicExamples, dynamicGeneratorConfig, generationMetadata }) {
|
|
276644
276712
|
const irSettings = getIrGenerationSettings({ workspace });
|
|
276645
276713
|
const casingsGenerator = constructCasingsGenerator({ generationLanguage, keywords: keywords3, smartCasing });
|
|
276646
276714
|
const irGraph = new IrGraph(audiences);
|
|
@@ -276978,6 +277046,7 @@ function generateIntermediateRepresentation({ workspace, generationLanguage, key
|
|
|
276978
277046
|
hasStreamingEndpoints,
|
|
276979
277047
|
hasPaginatedEndpoints,
|
|
276980
277048
|
hasFileDownloadEndpoints,
|
|
277049
|
+
idempotencyKeyGeneration,
|
|
276981
277050
|
platformHeaders: {
|
|
276982
277051
|
language: "X-Fern-Language",
|
|
276983
277052
|
sdkName: "X-Fern-SDK-Name",
|
|
@@ -342420,6 +342489,7 @@ var init_AbstractSpecConverter = __esm({
|
|
|
342420
342489
|
hasPaginatedEndpoints: false,
|
|
342421
342490
|
hasStreamingEndpoints: false,
|
|
342422
342491
|
isAuthMandatory: true,
|
|
342492
|
+
idempotencyKeyGeneration: void 0,
|
|
342423
342493
|
platformHeaders: {
|
|
342424
342494
|
language: "",
|
|
342425
342495
|
sdkName: "",
|
|
@@ -565816,7 +565886,8 @@ var require_AutoVersionStep = __commonJS({
|
|
|
565816
565886
|
}
|
|
565817
565887
|
async handleNormalFlow(params2) {
|
|
565818
565888
|
const { prepared, service, language, mappedMagicVersion, previousGenerationSha } = params2;
|
|
565819
|
-
const
|
|
565889
|
+
const diffBase = this.resolveReachableGenerationBase(previousGenerationSha, prepared.currentGenerationSha);
|
|
565890
|
+
const rawDiff = diffBase != null ? this.safeGitDiff(diffBase, prepared.currentGenerationSha) : "";
|
|
565820
565891
|
const previousVersion = await this.resolvePreviousVersion({
|
|
565821
565892
|
service,
|
|
565822
565893
|
rawDiff,
|
|
@@ -566213,6 +566284,91 @@ var require_AutoVersionStep = __commonJS({
|
|
|
566213
566284
|
maxBuffer: 256 * 1024 * 1024
|
|
566214
566285
|
});
|
|
566215
566286
|
}
|
|
566287
|
+
/**
|
|
566288
|
+
* Resolves a reachable base commit for the autoversion diff.
|
|
566289
|
+
*
|
|
566290
|
+
* `recordedSha` (the previous generation from replay.lock) is preferred when it exists
|
|
566291
|
+
* in this clone. When it doesn't — e.g. the signed-commit push recreated the
|
|
566292
|
+
* [fern-generated] commit under a new SHA, or the branch was squash-merged — we re-anchor
|
|
566293
|
+
* on the most recent reachable [fern-generated] commit in history. Returns null when no
|
|
566294
|
+
* generation baseline is reachable at all, in which case the caller resolves the previous
|
|
566295
|
+
* version from metadata/git-tags and still rewrites the placeholder.
|
|
566296
|
+
*/
|
|
566297
|
+
resolveReachableGenerationBase(recordedSha, currentGenerationSha) {
|
|
566298
|
+
if (this.commitExists(recordedSha)) {
|
|
566299
|
+
return recordedSha;
|
|
566300
|
+
}
|
|
566301
|
+
this.logger.warn(`AutoVersionStep: recorded previous generation ${recordedSha.slice(0, 7)} is unreachable in this clone; deriving the baseline from history.`);
|
|
566302
|
+
const derived = this.findPreviousGenerationFromHistory(currentGenerationSha);
|
|
566303
|
+
if (derived != null) {
|
|
566304
|
+
this.logger.info(`AutoVersionStep: re-anchored autoversion baseline on ${derived.slice(0, 7)}.`);
|
|
566305
|
+
return derived;
|
|
566306
|
+
}
|
|
566307
|
+
this.logger.warn("AutoVersionStep: no reachable [fern-generated] baseline found; falling back to metadata/git-tags.");
|
|
566308
|
+
return null;
|
|
566309
|
+
}
|
|
566310
|
+
commitExists(sha) {
|
|
566311
|
+
if (!/^[0-9a-f]{7,40}$/.test(sha)) {
|
|
566312
|
+
return false;
|
|
566313
|
+
}
|
|
566314
|
+
try {
|
|
566315
|
+
(0, child_process_1.execFileSync)("git", ["cat-file", "-e", `${sha}^{commit}`], {
|
|
566316
|
+
cwd: this.outputDir,
|
|
566317
|
+
stdio: "pipe"
|
|
566318
|
+
});
|
|
566319
|
+
return true;
|
|
566320
|
+
} catch {
|
|
566321
|
+
return false;
|
|
566322
|
+
}
|
|
566323
|
+
}
|
|
566324
|
+
/**
|
|
566325
|
+
* Walks first-parent history from the current generation commit and returns the most
|
|
566326
|
+
* recent prior [fern-generated] commit — the reachable equivalent of replay.lock's
|
|
566327
|
+
* recorded baseline. Mirrors @fern-api/replay's `findPreviousGenerationFromHistory`.
|
|
566328
|
+
*/
|
|
566329
|
+
findPreviousGenerationFromHistory(currentGenerationSha) {
|
|
566330
|
+
const start2 = this.commitExists(currentGenerationSha) ? currentGenerationSha : "HEAD";
|
|
566331
|
+
let log4;
|
|
566332
|
+
try {
|
|
566333
|
+
log4 = (0, child_process_1.execFileSync)("git", ["log", "--first-parent", "--format=%H%x00%s", start2], {
|
|
566334
|
+
cwd: this.outputDir,
|
|
566335
|
+
encoding: "utf-8",
|
|
566336
|
+
stdio: "pipe",
|
|
566337
|
+
maxBuffer: 64 * 1024 * 1024
|
|
566338
|
+
});
|
|
566339
|
+
} catch (error50) {
|
|
566340
|
+
this.logger.debug(`AutoVersionStep: git log history walk failed (${String(error50)}); no baseline derived.`);
|
|
566341
|
+
return null;
|
|
566342
|
+
}
|
|
566343
|
+
for (const line of log4.split("\n")) {
|
|
566344
|
+
if (line.trim().length === 0) {
|
|
566345
|
+
continue;
|
|
566346
|
+
}
|
|
566347
|
+
const [sha, subject = ""] = line.split("\0");
|
|
566348
|
+
if (sha == null || sha === currentGenerationSha) {
|
|
566349
|
+
continue;
|
|
566350
|
+
}
|
|
566351
|
+
if (subject.startsWith("[fern-generated]")) {
|
|
566352
|
+
return sha;
|
|
566353
|
+
}
|
|
566354
|
+
}
|
|
566355
|
+
return null;
|
|
566356
|
+
}
|
|
566357
|
+
/**
|
|
566358
|
+
* `gitDiff` that degrades to an empty diff instead of throwing. Both endpoints are
|
|
566359
|
+
* expected to be reachable (the base is resolved via resolveReachableGenerationBase and
|
|
566360
|
+
* `to` is this run's freshly-created HEAD), but we never want a `git diff` failure to
|
|
566361
|
+
* abort autoversion and leave the magic placeholder in the shipped SDK — the empty diff
|
|
566362
|
+
* routes version resolution to baseVersion/metadata/git-tags, which still rewrites it.
|
|
566363
|
+
*/
|
|
566364
|
+
safeGitDiff(from4, to2) {
|
|
566365
|
+
try {
|
|
566366
|
+
return this.gitDiff(from4, to2);
|
|
566367
|
+
} catch (error50) {
|
|
566368
|
+
this.logger.warn(`AutoVersionStep: git diff ${from4.slice(0, 7)}..${to2.slice(0, 7)} failed (${error50 instanceof Error ? error50.message : String(error50)}); proceeding with an empty diff.`);
|
|
566369
|
+
return "";
|
|
566370
|
+
}
|
|
566371
|
+
}
|
|
566216
566372
|
gitDiff(from4, to2) {
|
|
566217
566373
|
return (0, child_process_1.execFileSync)("git", ["diff", from4, to2, "--", ".", ":(exclude).fern/metadata.json"], {
|
|
566218
566374
|
cwd: this.outputDir,
|
|
@@ -689087,7 +689243,7 @@ var AccessTokenPosthogManager = class {
|
|
|
689087
689243
|
properties: {
|
|
689088
689244
|
...event,
|
|
689089
689245
|
...event.properties,
|
|
689090
|
-
version: "5.
|
|
689246
|
+
version: "5.69.0",
|
|
689091
689247
|
usingAccessToken: true,
|
|
689092
689248
|
...getRunIdProperties()
|
|
689093
689249
|
}
|
|
@@ -689153,7 +689309,7 @@ var UserPosthogManager = class {
|
|
|
689153
689309
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
689154
689310
|
event: "CLI",
|
|
689155
689311
|
properties: {
|
|
689156
|
-
version: "5.
|
|
689312
|
+
version: "5.69.0",
|
|
689157
689313
|
...event,
|
|
689158
689314
|
...event.properties,
|
|
689159
689315
|
usingAccessToken: false,
|
|
@@ -834249,8 +834405,8 @@ var V67_TO_V66_MIGRATION = {
|
|
|
834249
834405
|
[GeneratorName.TYPESCRIPT_SDK]: "3.70.9-rc.0",
|
|
834250
834406
|
[GeneratorName.TYPESCRIPT_EXPRESS]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834251
834407
|
[GeneratorName.JAVA]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834252
|
-
[GeneratorName.JAVA_MODEL]:
|
|
834253
|
-
[GeneratorName.JAVA_SDK]:
|
|
834408
|
+
[GeneratorName.JAVA_MODEL]: "1.9.0-rc.1",
|
|
834409
|
+
[GeneratorName.JAVA_SDK]: "4.13.3-rc.0",
|
|
834254
834410
|
[GeneratorName.JAVA_SPRING]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834255
834411
|
[GeneratorName.OPENAPI_PYTHON_CLIENT]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834256
834412
|
[GeneratorName.OPENAPI]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
@@ -834261,13 +834417,13 @@ var V67_TO_V66_MIGRATION = {
|
|
|
834261
834417
|
[GeneratorName.POSTMAN]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834262
834418
|
[GeneratorName.GO_MODEL]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834263
834419
|
[GeneratorName.GO_SDK]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834264
|
-
[GeneratorName.RUBY_SDK]:
|
|
834420
|
+
[GeneratorName.RUBY_SDK]: "1.16.0-rc.0",
|
|
834265
834421
|
[GeneratorName.CSHARP_MODEL]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834266
834422
|
[GeneratorName.CSHARP_SDK]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834267
834423
|
[GeneratorName.SWIFT_MODEL]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834268
834424
|
[GeneratorName.SWIFT_SDK]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834269
834425
|
[GeneratorName.PHP_MODEL]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834270
|
-
[GeneratorName.PHP_SDK]:
|
|
834426
|
+
[GeneratorName.PHP_SDK]: "2.11.2-rc.0",
|
|
834271
834427
|
[GeneratorName.RUST_MODEL]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834272
834428
|
[GeneratorName.RUST_SDK]: GeneratorWasNeverUpdatedToConsumeNewIR,
|
|
834273
834429
|
[GeneratorName.CLI]: "0.0.1"
|
|
@@ -870254,7 +870410,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
870254
870410
|
var LOGS_FOLDER_NAME = "logs";
|
|
870255
870411
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
870256
870412
|
function getCliSource() {
|
|
870257
|
-
const version7 = "5.
|
|
870413
|
+
const version7 = "5.69.0";
|
|
870258
870414
|
return `cli@${version7}`;
|
|
870259
870415
|
}
|
|
870260
870416
|
var DebugLogger = class {
|
|
@@ -900060,6 +900216,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
900060
900216
|
}
|
|
900061
900217
|
const effectiveIrVersion = resolvedVersion != null && (0, import_autoversion.isAutoVersion)(resolvedVersion) ? import_autoversion.MAGIC_VERSION : resolvedVersion;
|
|
900062
900218
|
const userAgentTemplate = getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
|
|
900219
|
+
const idempotencyKeyGeneration = getIdempotencyKeyGenerationFromGeneratorConfig(generatorInvocation);
|
|
900063
900220
|
const ir3 = generateIntermediateRepresentation({
|
|
900064
900221
|
workspace,
|
|
900065
900222
|
generationLanguage: generatorInvocation.language,
|
|
@@ -900074,6 +900231,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
900074
900231
|
readme,
|
|
900075
900232
|
packageName,
|
|
900076
900233
|
userAgentTemplate,
|
|
900234
|
+
idempotencyKeyGeneration,
|
|
900077
900235
|
organization,
|
|
900078
900236
|
version: effectiveIrVersion,
|
|
900079
900237
|
context: interactiveTaskContext,
|
|
@@ -902813,7 +902971,7 @@ var LegacyDocsPublisher = class {
|
|
|
902813
902971
|
previewId,
|
|
902814
902972
|
disableTemplates: void 0,
|
|
902815
902973
|
skipUpload,
|
|
902816
|
-
cliVersion: "5.
|
|
902974
|
+
cliVersion: "5.69.0",
|
|
902817
902975
|
loginCommand: "fern auth login"
|
|
902818
902976
|
});
|
|
902819
902977
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -922377,6 +922535,8 @@ var Generation = class {
|
|
|
922377
922535
|
extraDependencies: () => this.customConfig["extra-dependencies"] ?? {},
|
|
922378
922536
|
/** When true, omits Fern platform headers (X-Fern-Language, SDK name/version, User-Agent) from generated SDK requests. Default: false. */
|
|
922379
922537
|
omitFernHeaders: () => this.customConfig["omit-fern-headers"] ?? false,
|
|
922538
|
+
/** When true, emits the platform observability headers (X-Fern-Runtime, X-Fern-Runtime-Version, X-Fern-Platform). Default: false. Still subject to omitFernHeaders. */
|
|
922539
|
+
includePlatformHeaders: () => this.customConfig["include-platform-headers"] ?? false,
|
|
922380
922540
|
/** When true, falls back to `<NuGetPackageId>/<version>` for the `User-Agent` header when the IR doesn't supply one. Default: false. */
|
|
922381
922541
|
userAgentNameFromPackage: () => this.customConfig["user-agent-name-from-package"] ?? false,
|
|
922382
922542
|
/** When true, moves auth params and IR headers into ClientOptions so the constructor takes only named arguments. Default: false. */
|
|
@@ -928964,6 +929124,7 @@ var BaseJavaCustomConfigSchema = external_exports2.object({
|
|
|
928964
929124
|
"output-directory": external_exports2.enum(["source-root", "project-root"]).optional(),
|
|
928965
929125
|
"custom-interceptors": external_exports2.boolean().optional(),
|
|
928966
929126
|
"omit-fern-headers": external_exports2.boolean().optional(),
|
|
929127
|
+
includePlatformHeaders: external_exports2.boolean().optional(),
|
|
928967
929128
|
"retry-status-codes": external_exports2.optional(external_exports2.enum(["legacy", "recommended"])),
|
|
928968
929129
|
// Hidden options (for debugging).
|
|
928969
929130
|
"enable-gradle-profiling": external_exports2.boolean().optional(),
|
|
@@ -938657,6 +938818,19 @@ var DynamicSnippetsGeneratorContext5 = class _DynamicSnippetsGeneratorContext ex
|
|
|
938657
938818
|
}
|
|
938658
938819
|
return name2.snakeCase.safeName;
|
|
938659
938820
|
}
|
|
938821
|
+
/**
|
|
938822
|
+
* Module/subpackage directory name, preserving any leading/trailing underscores
|
|
938823
|
+
* from the original name that the casing functions would otherwise strip. This
|
|
938824
|
+
* keeps snippet accessors and module paths consistent with the generated module
|
|
938825
|
+
* directories (e.g. a group named `_agents` yields `client._agents`). It is scoped
|
|
938826
|
+
* to namespace/module names and intentionally not applied to property or method names.
|
|
938827
|
+
*/
|
|
938828
|
+
getModuleName(name2) {
|
|
938829
|
+
const leading = name2.originalName.match(/^(_+)/)?.[1] ?? "";
|
|
938830
|
+
const core2 = name2.originalName.slice(leading.length);
|
|
938831
|
+
const trailing = core2.match(/(_+)$/)?.[1] ?? "";
|
|
938832
|
+
return `${leading}${name2.snakeCase.safeName}${trailing}`;
|
|
938833
|
+
}
|
|
938660
938834
|
getRootClientClassReference() {
|
|
938661
938835
|
return python_exports.reference({
|
|
938662
938836
|
name: this.getRootClientClassName(),
|
|
@@ -938667,7 +938841,7 @@ var DynamicSnippetsGeneratorContext5 = class _DynamicSnippetsGeneratorContext ex
|
|
|
938667
938841
|
const className = this.getClassName(declaration.name);
|
|
938668
938842
|
const modulePath = [
|
|
938669
938843
|
...this.getRootModulePath(),
|
|
938670
|
-
...declaration.fernFilepath.allParts.map((part) => part
|
|
938844
|
+
...declaration.fernFilepath.allParts.map((part) => this.getModuleName(part))
|
|
938671
938845
|
];
|
|
938672
938846
|
return python_exports.reference({ name: className, modulePath });
|
|
938673
938847
|
}
|
|
@@ -938676,7 +938850,7 @@ var DynamicSnippetsGeneratorContext5 = class _DynamicSnippetsGeneratorContext ex
|
|
|
938676
938850
|
const variantName = discriminantValue.name.pascalCase.safeName;
|
|
938677
938851
|
const modulePath = [
|
|
938678
938852
|
...this.getRootModulePath(),
|
|
938679
|
-
...unionDeclaration.fernFilepath.allParts.map((part) => part
|
|
938853
|
+
...unionDeclaration.fernFilepath.allParts.map((part) => this.getModuleName(part))
|
|
938680
938854
|
];
|
|
938681
938855
|
const name2 = this.customConfig.pydantic_config?.union_naming === "v1" ? `${variantName}${unionClassName}` : `${unionClassName}_${variantName}`;
|
|
938682
938856
|
return python_exports.reference({ name: name2, modulePath });
|
|
@@ -939482,7 +939656,7 @@ var EndpointSnippetGenerator5 = class {
|
|
|
939482
939656
|
}
|
|
939483
939657
|
getMethod({ endpoint: endpoint3 }) {
|
|
939484
939658
|
if (endpoint3.declaration.fernFilepath.allParts.length > 0) {
|
|
939485
|
-
return `${endpoint3.declaration.fernFilepath.allParts.map((val) => this.context.
|
|
939659
|
+
return `${endpoint3.declaration.fernFilepath.allParts.map((val) => this.context.getModuleName(val)).join(".")}.${this.context.getMethodName(endpoint3.declaration.name)}`;
|
|
939486
939660
|
}
|
|
939487
939661
|
return this.context.getMethodName(endpoint3.declaration.name);
|
|
939488
939662
|
}
|
|
@@ -952791,6 +952965,7 @@ var TypescriptCustomConfigSchema = external_exports2.strictObject({
|
|
|
952791
952965
|
fetchSupport: external_exports2.optional(external_exports2.enum(["node-fetch", "native"])),
|
|
952792
952966
|
packagePath: external_exports2.optional(external_exports2.string()),
|
|
952793
952967
|
omitFernHeaders: external_exports2.optional(external_exports2.boolean()),
|
|
952968
|
+
includePlatformHeaders: external_exports2.optional(external_exports2.boolean()),
|
|
952794
952969
|
useDefaultRequestParameterValues: external_exports2.optional(external_exports2.boolean()),
|
|
952795
952970
|
packageManager: external_exports2.optional(external_exports2.enum(["pnpm", "yarn"])),
|
|
952796
952971
|
flattenRequestParameters: external_exports2.optional(external_exports2.boolean()),
|
|
@@ -955667,6 +955842,7 @@ init_lib26();
|
|
|
955667
955842
|
init_lib22();
|
|
955668
955843
|
async function getIntermediateRepresentation({ workspace, audiences, generatorInvocation, context: context3, irVersionOverride, version: version7, packageName, userAgentTemplate, organization, sourceConfig, includeOptionalRequestPropertyExamples, ir: ir3 }) {
|
|
955669
955844
|
const resolvedUserAgentTemplate = userAgentTemplate ?? getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
|
|
955845
|
+
const idempotencyKeyGeneration = getIdempotencyKeyGenerationFromGeneratorConfig(generatorInvocation);
|
|
955670
955846
|
const intermediateRepresentation = ir3 ?? generateIntermediateRepresentation({
|
|
955671
955847
|
workspace,
|
|
955672
955848
|
audiences,
|
|
@@ -955681,6 +955857,7 @@ async function getIntermediateRepresentation({ workspace, audiences, generatorIn
|
|
|
955681
955857
|
version: version7,
|
|
955682
955858
|
packageName,
|
|
955683
955859
|
userAgentTemplate: resolvedUserAgentTemplate,
|
|
955860
|
+
idempotencyKeyGeneration,
|
|
955684
955861
|
organization,
|
|
955685
955862
|
context: context3,
|
|
955686
955863
|
sourceResolver: new SourceResolverImpl(context3, workspace),
|
|
@@ -957005,6 +957182,7 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
957005
957182
|
});
|
|
957006
957183
|
const packageName = getPackageNameFromGeneratorConfig(generatorInvocation);
|
|
957007
957184
|
const userAgentTemplate = getUserAgentTemplateFromGeneratorConfig(generatorInvocation);
|
|
957185
|
+
const idempotencyKeyGeneration = getIdempotencyKeyGenerationFromGeneratorConfig(generatorInvocation);
|
|
957008
957186
|
version7 = version7 ?? await computeSemanticVersion({ packageName, generatorInvocation });
|
|
957009
957187
|
const irLanguage = generatorInvocation.language ?? (0, import_autoversion4.extractLanguageFromGeneratorName)(generatorInvocation.name);
|
|
957010
957188
|
const effectiveIrVersion = version7 != null && (0, import_autoversion4.isAutoVersion)(version7) ? (0, import_autoversion4.mapMagicVersionForLanguage)(import_autoversion4.MAGIC_VERSION, irLanguage) : version7;
|
|
@@ -957022,6 +957200,7 @@ async function runLocalGenerationForWorkspace({ token, projectConfig, workspace,
|
|
|
957022
957200
|
version: effectiveIrVersion,
|
|
957023
957201
|
packageName,
|
|
957024
957202
|
userAgentTemplate,
|
|
957203
|
+
idempotencyKeyGeneration,
|
|
957025
957204
|
organization: projectConfig.organization,
|
|
957026
957205
|
context: context3,
|
|
957027
957206
|
sourceResolver: new SourceResolverImpl(context3, fernWorkspace),
|
|
@@ -957564,6 +957743,7 @@ var GenerationRunner = class {
|
|
|
957564
957743
|
version: outputVersionOverride,
|
|
957565
957744
|
packageName: generators_yml_exports.getPackageName({ generatorInvocation }),
|
|
957566
957745
|
userAgentTemplate: getUserAgentTemplateFromGeneratorConfig(generatorInvocation),
|
|
957746
|
+
idempotencyKeyGeneration: getIdempotencyKeyGenerationFromGeneratorConfig(generatorInvocation),
|
|
957567
957747
|
organization,
|
|
957568
957748
|
context: context3,
|
|
957569
957749
|
sourceResolver: new SourceResolverImpl(context3, workspace),
|
|
@@ -969152,7 +969332,7 @@ function getAutomationContextFromEnv() {
|
|
|
969152
969332
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
969153
969333
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
969154
969334
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
969155
|
-
cli_version: "5.
|
|
969335
|
+
cli_version: "5.69.0"
|
|
969156
969336
|
};
|
|
969157
969337
|
}
|
|
969158
969338
|
function isAutomationMode() {
|
|
@@ -969984,7 +970164,7 @@ var CliContext = class _CliContext {
|
|
|
969984
970164
|
if (false) {
|
|
969985
970165
|
this.logger.error("CLI_VERSION is not defined");
|
|
969986
970166
|
}
|
|
969987
|
-
return "5.
|
|
970167
|
+
return "5.69.0";
|
|
969988
970168
|
}
|
|
969989
970169
|
getCliName() {
|
|
969990
970170
|
if (false) {
|
package/package.json
CHANGED