@fern-api/fern-api-dev 5.27.6 → 5.27.8
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 +57 -76
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -360342,9 +360342,9 @@ var require_diff3 = __commonJS({
|
|
|
360342
360342
|
}
|
|
360343
360343
|
});
|
|
360344
360344
|
|
|
360345
|
-
// ../../../node_modules/.pnpm/@fern-api+replay@0.15.
|
|
360345
|
+
// ../../../node_modules/.pnpm/@fern-api+replay@0.15.2/node_modules/@fern-api/replay/dist/index.cjs
|
|
360346
360346
|
var require_dist14 = __commonJS({
|
|
360347
|
-
"../../../node_modules/.pnpm/@fern-api+replay@0.15.
|
|
360347
|
+
"../../../node_modules/.pnpm/@fern-api+replay@0.15.2/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
|
|
360348
360348
|
"use strict";
|
|
360349
360349
|
var __defProp4 = Object.defineProperty;
|
|
360350
360350
|
var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
@@ -361269,7 +361269,7 @@ var require_dist14 = __commonJS({
|
|
|
361269
361269
|
async detectPatchesInRange(rangeStart, lastGen, lock) {
|
|
361270
361270
|
const log4 = await this.git.exec([
|
|
361271
361271
|
"log",
|
|
361272
|
-
"--
|
|
361272
|
+
"--no-merges",
|
|
361273
361273
|
"--format=%H%x00%an%x00%ae%x00%s",
|
|
361274
361274
|
`${rangeStart}..HEAD`,
|
|
361275
361275
|
"--",
|
|
@@ -361289,18 +361289,6 @@ var require_dist14 = __commonJS({
|
|
|
361289
361289
|
continue;
|
|
361290
361290
|
}
|
|
361291
361291
|
const parents = await this.git.getCommitParents(commit.sha);
|
|
361292
|
-
if (parents.length > 1) {
|
|
361293
|
-
const compositePatch = await this.createMergeCompositePatch({
|
|
361294
|
-
mergeCommit: commit,
|
|
361295
|
-
firstParent: parents[0],
|
|
361296
|
-
lastGen,
|
|
361297
|
-
lock
|
|
361298
|
-
});
|
|
361299
|
-
if (compositePatch) {
|
|
361300
|
-
newPatches.push(compositePatch);
|
|
361301
|
-
}
|
|
361302
|
-
continue;
|
|
361303
|
-
}
|
|
361304
361292
|
let patchContent;
|
|
361305
361293
|
try {
|
|
361306
361294
|
patchContent = await this.git.formatPatch(commit.sha);
|
|
@@ -361438,9 +361426,7 @@ var require_dist14 = __commonJS({
|
|
|
361438
361426
|
* within the current linear detection window, and are absent from
|
|
361439
361427
|
* HEAD at the end of the window.
|
|
361440
361428
|
*
|
|
361441
|
-
* Rationale:
|
|
361442
|
-
* firstParent..mergeCommit so net-zero files never enter the composite. On
|
|
361443
|
-
* linear history each commit becomes its own patch, so a file that was
|
|
361429
|
+
* Rationale: each commit becomes its own patch, so a file that was
|
|
361444
361430
|
* briefly added and later removed survives as a create+delete pair whose
|
|
361445
361431
|
* cumulative diff is empty. We drop such patches before they reach the
|
|
361446
361432
|
* lockfile.
|
|
@@ -361507,54 +361493,6 @@ var require_dist14 = __commonJS({
|
|
|
361507
361493
|
return /* @__PURE__ */ new Set();
|
|
361508
361494
|
}
|
|
361509
361495
|
}
|
|
361510
|
-
/**
|
|
361511
|
-
* Create a single composite patch for a merge commit by diffing the merge
|
|
361512
|
-
* commit against its first parent. This captures the net change of the
|
|
361513
|
-
* entire merged branch as one patch, eliminating accumulator chaining and
|
|
361514
|
-
* zero-net-change ghost conflicts.
|
|
361515
|
-
*/
|
|
361516
|
-
async createMergeCompositePatch(input3) {
|
|
361517
|
-
const { mergeCommit, firstParent, lastGen, lock } = input3;
|
|
361518
|
-
const forgottenHashes = new Set(lock.forgotten_hashes ?? []);
|
|
361519
|
-
const filesOutput = await this.git.exec([
|
|
361520
|
-
"diff",
|
|
361521
|
-
"--name-only",
|
|
361522
|
-
firstParent,
|
|
361523
|
-
mergeCommit.sha
|
|
361524
|
-
]);
|
|
361525
|
-
const { files, sensitiveFiles } = filterInfrastructureAndSensitiveFiles(filesOutput);
|
|
361526
|
-
if (sensitiveFiles.length > 0) {
|
|
361527
|
-
this.warnings.push(
|
|
361528
|
-
`Sensitive file(s) excluded from merge patch for commit ${mergeCommit.sha.slice(0, 7)}: ${sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
|
|
361529
|
-
);
|
|
361530
|
-
}
|
|
361531
|
-
if (files.length === 0) return null;
|
|
361532
|
-
const diff2 = await this.git.exec([
|
|
361533
|
-
"diff",
|
|
361534
|
-
firstParent,
|
|
361535
|
-
mergeCommit.sha,
|
|
361536
|
-
"--",
|
|
361537
|
-
...files
|
|
361538
|
-
]);
|
|
361539
|
-
if (!diff2.trim()) return null;
|
|
361540
|
-
const contentHash = this.computeContentHash(diff2);
|
|
361541
|
-
if (lock.patches.some((p14) => p14.content_hash === contentHash) || forgottenHashes.has(contentHash)) {
|
|
361542
|
-
return null;
|
|
361543
|
-
}
|
|
361544
|
-
const theirsSnapshot = await capturePatchSnapshot(this.git, files, mergeCommit.sha);
|
|
361545
|
-
return {
|
|
361546
|
-
id: `patch-merge-${mergeCommit.sha.slice(0, 8)}`,
|
|
361547
|
-
content_hash: contentHash,
|
|
361548
|
-
original_commit: mergeCommit.sha,
|
|
361549
|
-
original_message: mergeCommit.message,
|
|
361550
|
-
original_author: `${mergeCommit.authorName} <${mergeCommit.authorEmail}>`,
|
|
361551
|
-
base_generation: lastGen.commit_sha,
|
|
361552
|
-
files,
|
|
361553
|
-
patch_content: diff2,
|
|
361554
|
-
...Object.keys(theirsSnapshot).length > 0 ? { theirs_snapshot: theirsSnapshot } : {},
|
|
361555
|
-
...this.isCreationOnlyPatch(diff2) ? { user_owned: true } : {}
|
|
361556
|
-
};
|
|
361557
|
-
}
|
|
361558
361496
|
/**
|
|
361559
361497
|
* Detect patches via tree diff for non-linear history. Returns a composite patch.
|
|
361560
361498
|
* Revert reconciliation is skipped here because tree-diff produces a single composite
|
|
@@ -601583,6 +601521,7 @@ var IrGraph = class {
|
|
|
601583
601521
|
webhooksNeededForAudience = /* @__PURE__ */ new Set();
|
|
601584
601522
|
channelsNeededForAudience = /* @__PURE__ */ new Set();
|
|
601585
601523
|
subpackagesNeededForAudience = /* @__PURE__ */ new Set();
|
|
601524
|
+
schemaIdToGraphTypeId = /* @__PURE__ */ new Map();
|
|
601586
601525
|
constructor(audiences) {
|
|
601587
601526
|
this.audiences = audiencesFromConfig(audiences);
|
|
601588
601527
|
}
|
|
@@ -601595,6 +601534,9 @@ var IrGraph = class {
|
|
|
601595
601534
|
referencedSubpackages: descendantFilepaths
|
|
601596
601535
|
};
|
|
601597
601536
|
this.types[typeId] = typeNode;
|
|
601537
|
+
if (declaredTypeName.typeId != null && declaredTypeName.typeId !== typeId) {
|
|
601538
|
+
this.schemaIdToGraphTypeId.set(declaredTypeName.typeId, typeId);
|
|
601539
|
+
}
|
|
601598
601540
|
if (this.typesReferencedByService[typeId] == null) {
|
|
601599
601541
|
this.typesReferencedByService[typeId] = /* @__PURE__ */ new Set();
|
|
601600
601542
|
}
|
|
@@ -601964,9 +601906,12 @@ var IrGraph = class {
|
|
|
601964
601906
|
types4.add(serviceId);
|
|
601965
601907
|
const typeNode = this.getTypeNode(typeId);
|
|
601966
601908
|
for (const descendantTypeId of typeNode.allDescendants) {
|
|
601967
|
-
this.markTypeForService(descendantTypeId, serviceId);
|
|
601909
|
+
this.markTypeForService(this.resolveTypeId(descendantTypeId), serviceId);
|
|
601968
601910
|
}
|
|
601969
601911
|
}
|
|
601912
|
+
resolveTypeId(id2) {
|
|
601913
|
+
return this.schemaIdToGraphTypeId.get(id2) ?? id2;
|
|
601914
|
+
}
|
|
601970
601915
|
addReferencedTypes(types4, typesToAdd) {
|
|
601971
601916
|
for (const typeId of typesToAdd) {
|
|
601972
601917
|
if (types4.has(typeId)) {
|
|
@@ -601979,18 +601924,18 @@ var IrGraph = class {
|
|
|
601979
601924
|
const descendantsForAudience = typeNode.descendantsByAudience[audienceId];
|
|
601980
601925
|
if (descendantsForAudience != null) {
|
|
601981
601926
|
descendantsForAudience.forEach((descendantTypeId) => {
|
|
601982
|
-
types4.add(descendantTypeId);
|
|
601927
|
+
types4.add(this.resolveTypeId(descendantTypeId));
|
|
601983
601928
|
});
|
|
601984
601929
|
} else {
|
|
601985
601930
|
typeNode.allDescendants.forEach((descendantTypeId) => {
|
|
601986
|
-
types4.add(descendantTypeId);
|
|
601931
|
+
types4.add(this.resolveTypeId(descendantTypeId));
|
|
601987
601932
|
});
|
|
601988
601933
|
break;
|
|
601989
601934
|
}
|
|
601990
601935
|
}
|
|
601991
601936
|
} else {
|
|
601992
601937
|
typeNode.allDescendants.forEach((descendantTypeId) => {
|
|
601993
|
-
types4.add(descendantTypeId);
|
|
601938
|
+
types4.add(this.resolveTypeId(descendantTypeId));
|
|
601994
601939
|
});
|
|
601995
601940
|
}
|
|
601996
601941
|
}
|
|
@@ -649643,6 +649588,7 @@ function convertProperties({ properties: properties7, required: required6, bread
|
|
|
649643
649588
|
referencedTypes.add(type8);
|
|
649644
649589
|
});
|
|
649645
649590
|
}
|
|
649591
|
+
collectNamedTypeIdsFromTypeReference(convertedProperty.type, referencedTypes);
|
|
649646
649592
|
for (const audience of convertedProperty.schema?.audiences ?? []) {
|
|
649647
649593
|
if (propertiesByAudience[audience] == null) {
|
|
649648
649594
|
propertiesByAudience[audience] = /* @__PURE__ */ new Set();
|
|
@@ -649707,6 +649653,41 @@ function maybeGetFernTypeNameExtension(breadcrumbs, schema2, context3) {
|
|
|
649707
649653
|
});
|
|
649708
649654
|
return fernTypeNameConverter.convert();
|
|
649709
649655
|
}
|
|
649656
|
+
function collectNamedTypeIdsFromTypeReference(typeReference2, referencedTypes) {
|
|
649657
|
+
switch (typeReference2.type) {
|
|
649658
|
+
case "named":
|
|
649659
|
+
referencedTypes.add(typeReference2.typeId);
|
|
649660
|
+
return;
|
|
649661
|
+
case "primitive":
|
|
649662
|
+
case "unknown":
|
|
649663
|
+
return;
|
|
649664
|
+
case "container":
|
|
649665
|
+
collectNamedTypeIdsFromContainer(typeReference2.container, referencedTypes);
|
|
649666
|
+
return;
|
|
649667
|
+
}
|
|
649668
|
+
}
|
|
649669
|
+
function collectNamedTypeIdsFromContainer(container, referencedTypes) {
|
|
649670
|
+
switch (container.type) {
|
|
649671
|
+
case "list":
|
|
649672
|
+
collectNamedTypeIdsFromTypeReference(container.list, referencedTypes);
|
|
649673
|
+
return;
|
|
649674
|
+
case "set":
|
|
649675
|
+
collectNamedTypeIdsFromTypeReference(container.set, referencedTypes);
|
|
649676
|
+
return;
|
|
649677
|
+
case "optional":
|
|
649678
|
+
collectNamedTypeIdsFromTypeReference(container.optional, referencedTypes);
|
|
649679
|
+
return;
|
|
649680
|
+
case "nullable":
|
|
649681
|
+
collectNamedTypeIdsFromTypeReference(container.nullable, referencedTypes);
|
|
649682
|
+
return;
|
|
649683
|
+
case "map":
|
|
649684
|
+
collectNamedTypeIdsFromTypeReference(container.keyType, referencedTypes);
|
|
649685
|
+
collectNamedTypeIdsFromTypeReference(container.valueType, referencedTypes);
|
|
649686
|
+
return;
|
|
649687
|
+
case "literal":
|
|
649688
|
+
return;
|
|
649689
|
+
}
|
|
649690
|
+
}
|
|
649710
649691
|
|
|
649711
649692
|
// ../api-importers/v3-importer-commons/lib/converters/schema/ObjectSchemaConverter.js
|
|
649712
649693
|
var ObjectSchemaConverter = class extends AbstractConverter {
|
|
@@ -668132,7 +668113,7 @@ var AccessTokenPosthogManager = class {
|
|
|
668132
668113
|
properties: {
|
|
668133
668114
|
...event,
|
|
668134
668115
|
...event.properties,
|
|
668135
|
-
version: "5.27.
|
|
668116
|
+
version: "5.27.8",
|
|
668136
668117
|
usingAccessToken: true,
|
|
668137
668118
|
...getRunIdProperties()
|
|
668138
668119
|
}
|
|
@@ -668196,7 +668177,7 @@ var UserPosthogManager = class {
|
|
|
668196
668177
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
668197
668178
|
event: "CLI",
|
|
668198
668179
|
properties: {
|
|
668199
|
-
version: "5.27.
|
|
668180
|
+
version: "5.27.8",
|
|
668200
668181
|
...event,
|
|
668201
668182
|
...event.properties,
|
|
668202
668183
|
usingAccessToken: false,
|
|
@@ -859775,7 +859756,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
859775
859756
|
var LOGS_FOLDER_NAME = "logs";
|
|
859776
859757
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
859777
859758
|
function getCliSource() {
|
|
859778
|
-
const version7 = "5.27.
|
|
859759
|
+
const version7 = "5.27.8";
|
|
859779
859760
|
return `cli@${version7}`;
|
|
859780
859761
|
}
|
|
859781
859762
|
var DebugLogger = class {
|
|
@@ -873775,7 +873756,7 @@ var LegacyDocsPublisher = class {
|
|
|
873775
873756
|
previewId,
|
|
873776
873757
|
disableTemplates: void 0,
|
|
873777
873758
|
skipUpload,
|
|
873778
|
-
cliVersion: "5.27.
|
|
873759
|
+
cliVersion: "5.27.8",
|
|
873779
873760
|
loginCommand: "fern auth login"
|
|
873780
873761
|
});
|
|
873781
873762
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -948180,7 +948161,7 @@ function getAutomationContextFromEnv() {
|
|
|
948180
948161
|
config_branch: process.env.FERN_CONFIG_BRANCH,
|
|
948181
948162
|
config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
|
|
948182
948163
|
trigger: process.env.GITHUB_EVENT_NAME,
|
|
948183
|
-
cli_version: "5.27.
|
|
948164
|
+
cli_version: "5.27.8"
|
|
948184
948165
|
};
|
|
948185
948166
|
}
|
|
948186
948167
|
function isAutomationMode() {
|
|
@@ -949006,7 +948987,7 @@ var CliContext = class _CliContext {
|
|
|
949006
948987
|
if (false) {
|
|
949007
948988
|
this.logger.error("CLI_VERSION is not defined");
|
|
949008
948989
|
}
|
|
949009
|
-
return "5.27.
|
|
948990
|
+
return "5.27.8";
|
|
949010
948991
|
}
|
|
949011
948992
|
getCliName() {
|
|
949012
948993
|
if (false) {
|
package/package.json
CHANGED