@fern-api/fern-api-dev 4.67.1 → 4.68.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 +225 -139
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -363248,9 +363248,9 @@ var require_diff3 = __commonJS({
|
|
|
363248
363248
|
}
|
|
363249
363249
|
});
|
|
363250
363250
|
|
|
363251
|
-
// ../../../node_modules/.pnpm/@fern-api+replay@0.10.
|
|
363251
|
+
// ../../../node_modules/.pnpm/@fern-api+replay@0.10.4/node_modules/@fern-api/replay/dist/index.cjs
|
|
363252
363252
|
var require_dist14 = __commonJS({
|
|
363253
|
-
"../../../node_modules/.pnpm/@fern-api+replay@0.10.
|
|
363253
|
+
"../../../node_modules/.pnpm/@fern-api+replay@0.10.4/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
|
|
363254
363254
|
"use strict";
|
|
363255
363255
|
var __defProp4 = Object.defineProperty;
|
|
363256
363256
|
var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
|
|
@@ -363893,6 +363893,7 @@ var require_dist14 = __commonJS({
|
|
|
363893
363893
|
}
|
|
363894
363894
|
const log4 = await this.git.exec([
|
|
363895
363895
|
"log",
|
|
363896
|
+
"--first-parent",
|
|
363896
363897
|
"--format=%H%x00%an%x00%ae%x00%s",
|
|
363897
363898
|
`${lastGen.commit_sha}..HEAD`,
|
|
363898
363899
|
"--",
|
|
@@ -363908,11 +363909,20 @@ var require_dist14 = __commonJS({
|
|
|
363908
363909
|
if (isGenerationCommit(commit)) {
|
|
363909
363910
|
continue;
|
|
363910
363911
|
}
|
|
363911
|
-
|
|
363912
|
-
if (parents.length > 1) {
|
|
363912
|
+
if (lock.patches.find((p10) => p10.original_commit === commit.sha)) {
|
|
363913
363913
|
continue;
|
|
363914
363914
|
}
|
|
363915
|
-
|
|
363915
|
+
const parents = await this.git.getCommitParents(commit.sha);
|
|
363916
|
+
if (parents.length > 1) {
|
|
363917
|
+
const compositePatch = await this.createMergeCompositePatch({
|
|
363918
|
+
mergeCommit: commit,
|
|
363919
|
+
firstParent: parents[0],
|
|
363920
|
+
lastGen,
|
|
363921
|
+
lock
|
|
363922
|
+
});
|
|
363923
|
+
if (compositePatch) {
|
|
363924
|
+
newPatches.push(compositePatch);
|
|
363925
|
+
}
|
|
363916
363926
|
continue;
|
|
363917
363927
|
}
|
|
363918
363928
|
let patchContent;
|
|
@@ -364011,6 +364021,46 @@ var require_dist14 = __commonJS({
|
|
|
364011
364021
|
const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
|
|
364012
364022
|
return `sha256:${(0, import_node_crypto7.createHash)("sha256").update(normalized).digest("hex")}`;
|
|
364013
364023
|
}
|
|
364024
|
+
/**
|
|
364025
|
+
* Create a single composite patch for a merge commit by diffing the merge
|
|
364026
|
+
* commit against its first parent. This captures the net change of the
|
|
364027
|
+
* entire merged branch as one patch, eliminating accumulator chaining and
|
|
364028
|
+
* zero-net-change ghost conflicts.
|
|
364029
|
+
*/
|
|
364030
|
+
async createMergeCompositePatch(input3) {
|
|
364031
|
+
const { mergeCommit, firstParent, lastGen, lock } = input3;
|
|
364032
|
+
const forgottenHashes = new Set(lock.forgotten_hashes ?? []);
|
|
364033
|
+
const filesOutput = await this.git.exec([
|
|
364034
|
+
"diff",
|
|
364035
|
+
"--name-only",
|
|
364036
|
+
firstParent,
|
|
364037
|
+
mergeCommit.sha
|
|
364038
|
+
]);
|
|
364039
|
+
const files = filesOutput.trim().split("\n").filter(Boolean).filter((f10) => !INFRASTRUCTURE_FILES.has(f10)).filter((f10) => !f10.startsWith(".fern/"));
|
|
364040
|
+
if (files.length === 0) return null;
|
|
364041
|
+
const diff2 = await this.git.exec([
|
|
364042
|
+
"diff",
|
|
364043
|
+
firstParent,
|
|
364044
|
+
mergeCommit.sha,
|
|
364045
|
+
"--",
|
|
364046
|
+
...files
|
|
364047
|
+
]);
|
|
364048
|
+
if (!diff2.trim()) return null;
|
|
364049
|
+
const contentHash = this.computeContentHash(diff2);
|
|
364050
|
+
if (lock.patches.some((p10) => p10.content_hash === contentHash) || forgottenHashes.has(contentHash)) {
|
|
364051
|
+
return null;
|
|
364052
|
+
}
|
|
364053
|
+
return {
|
|
364054
|
+
id: `patch-merge-${mergeCommit.sha.slice(0, 8)}`,
|
|
364055
|
+
content_hash: contentHash,
|
|
364056
|
+
original_commit: mergeCommit.sha,
|
|
364057
|
+
original_message: mergeCommit.message,
|
|
364058
|
+
original_author: `${mergeCommit.authorName} <${mergeCommit.authorEmail}>`,
|
|
364059
|
+
base_generation: lastGen.commit_sha,
|
|
364060
|
+
files,
|
|
364061
|
+
patch_content: diff2
|
|
364062
|
+
};
|
|
364063
|
+
}
|
|
364014
364064
|
/**
|
|
364015
364065
|
* Detect patches via tree diff for non-linear history. Returns a composite patch.
|
|
364016
364066
|
* Revert reconciliation is skipped here because tree-diff produces a single composite
|
|
@@ -405313,9 +405363,9 @@ var require_file2 = __commonJS({
|
|
|
405313
405363
|
}
|
|
405314
405364
|
});
|
|
405315
405365
|
|
|
405316
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405366
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseControlResponse.js
|
|
405317
405367
|
var require_parseControlResponse = __commonJS({
|
|
405318
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405368
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseControlResponse.js"(exports2) {
|
|
405319
405369
|
"use strict";
|
|
405320
405370
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
405321
405371
|
exports2.parseControlResponse = parseControlResponse;
|
|
@@ -405365,9 +405415,9 @@ var require_parseControlResponse = __commonJS({
|
|
|
405365
405415
|
}
|
|
405366
405416
|
});
|
|
405367
405417
|
|
|
405368
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405418
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/FtpContext.js
|
|
405369
405419
|
var require_FtpContext = __commonJS({
|
|
405370
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405420
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/FtpContext.js"(exports2) {
|
|
405371
405421
|
"use strict";
|
|
405372
405422
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
405373
405423
|
exports2.FTPContext = exports2.FTPError = void 0;
|
|
@@ -405509,6 +405559,9 @@ var require_FtpContext = __commonJS({
|
|
|
405509
405559
|
* Send an FTP command without waiting for or handling the result.
|
|
405510
405560
|
*/
|
|
405511
405561
|
send(command3) {
|
|
405562
|
+
if (/[\r\n\0]/.test(command3)) {
|
|
405563
|
+
throw new Error(`Invalid command: Contains control characters. (${command3})`);
|
|
405564
|
+
}
|
|
405512
405565
|
const containsPassword = command3.startsWith("PASS");
|
|
405513
405566
|
const message = containsPassword ? "> PASS ###" : `> ${command3}`;
|
|
405514
405567
|
this.log(message);
|
|
@@ -405682,9 +405735,9 @@ Closing reason: ${this._closingError.stack}`;
|
|
|
405682
405735
|
}
|
|
405683
405736
|
});
|
|
405684
405737
|
|
|
405685
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405738
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/FileInfo.js
|
|
405686
405739
|
var require_FileInfo = __commonJS({
|
|
405687
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405740
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/FileInfo.js"(exports2) {
|
|
405688
405741
|
"use strict";
|
|
405689
405742
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
405690
405743
|
exports2.FileInfo = exports2.FileType = void 0;
|
|
@@ -405739,9 +405792,9 @@ var require_FileInfo = __commonJS({
|
|
|
405739
405792
|
}
|
|
405740
405793
|
});
|
|
405741
405794
|
|
|
405742
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405795
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseListDOS.js
|
|
405743
405796
|
var require_parseListDOS = __commonJS({
|
|
405744
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405797
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseListDOS.js"(exports2) {
|
|
405745
405798
|
"use strict";
|
|
405746
405799
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
405747
405800
|
exports2.testLine = testLine;
|
|
@@ -405782,9 +405835,9 @@ var require_parseListDOS = __commonJS({
|
|
|
405782
405835
|
}
|
|
405783
405836
|
});
|
|
405784
405837
|
|
|
405785
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405838
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseListUnix.js
|
|
405786
405839
|
var require_parseListUnix = __commonJS({
|
|
405787
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405840
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseListUnix.js"(exports2) {
|
|
405788
405841
|
"use strict";
|
|
405789
405842
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
405790
405843
|
exports2.testLine = testLine;
|
|
@@ -405868,9 +405921,9 @@ var require_parseListUnix = __commonJS({
|
|
|
405868
405921
|
}
|
|
405869
405922
|
});
|
|
405870
405923
|
|
|
405871
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405924
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseListMLSD.js
|
|
405872
405925
|
var require_parseListMLSD = __commonJS({
|
|
405873
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
405926
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseListMLSD.js"(exports2) {
|
|
405874
405927
|
"use strict";
|
|
405875
405928
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
405876
405929
|
exports2.testLine = testLine;
|
|
@@ -406033,9 +406086,9 @@ var require_parseListMLSD = __commonJS({
|
|
|
406033
406086
|
}
|
|
406034
406087
|
});
|
|
406035
406088
|
|
|
406036
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406089
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseList.js
|
|
406037
406090
|
var require_parseList = __commonJS({
|
|
406038
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406091
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/parseList.js"(exports2) {
|
|
406039
406092
|
"use strict";
|
|
406040
406093
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o14, m11, k19, k23) {
|
|
406041
406094
|
if (k23 === void 0) k23 = k19;
|
|
@@ -406111,9 +406164,9 @@ var require_parseList = __commonJS({
|
|
|
406111
406164
|
}
|
|
406112
406165
|
});
|
|
406113
406166
|
|
|
406114
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406167
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/ProgressTracker.js
|
|
406115
406168
|
var require_ProgressTracker = __commonJS({
|
|
406116
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406169
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/ProgressTracker.js"(exports2) {
|
|
406117
406170
|
"use strict";
|
|
406118
406171
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
406119
406172
|
exports2.ProgressTracker = void 0;
|
|
@@ -406182,9 +406235,9 @@ var require_ProgressTracker = __commonJS({
|
|
|
406182
406235
|
}
|
|
406183
406236
|
});
|
|
406184
406237
|
|
|
406185
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406238
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/StringWriter.js
|
|
406186
406239
|
var require_StringWriter = __commonJS({
|
|
406187
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406240
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/StringWriter.js"(exports2) {
|
|
406188
406241
|
"use strict";
|
|
406189
406242
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
406190
406243
|
exports2.StringWriter = void 0;
|
|
@@ -406210,9 +406263,9 @@ var require_StringWriter = __commonJS({
|
|
|
406210
406263
|
}
|
|
406211
406264
|
});
|
|
406212
406265
|
|
|
406213
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406266
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/netUtils.js
|
|
406214
406267
|
var require_netUtils = __commonJS({
|
|
406215
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406268
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/netUtils.js"(exports2) {
|
|
406216
406269
|
"use strict";
|
|
406217
406270
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
406218
406271
|
exports2.describeTLS = describeTLS;
|
|
@@ -406261,9 +406314,9 @@ var require_netUtils = __commonJS({
|
|
|
406261
406314
|
}
|
|
406262
406315
|
});
|
|
406263
406316
|
|
|
406264
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406317
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/transfer.js
|
|
406265
406318
|
var require_transfer = __commonJS({
|
|
406266
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406319
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/transfer.js"(exports2) {
|
|
406267
406320
|
"use strict";
|
|
406268
406321
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
406269
406322
|
exports2.enterPassiveModeIPv6 = enterPassiveModeIPv6;
|
|
@@ -406513,9 +406566,9 @@ var require_transfer = __commonJS({
|
|
|
406513
406566
|
}
|
|
406514
406567
|
});
|
|
406515
406568
|
|
|
406516
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406569
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/Client.js
|
|
406517
406570
|
var require_Client14 = __commonJS({
|
|
406518
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
406571
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/Client.js"(exports2) {
|
|
406519
406572
|
"use strict";
|
|
406520
406573
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
406521
406574
|
exports2.Client = void 0;
|
|
@@ -407147,9 +407200,6 @@ var require_Client14 = __commonJS({
|
|
|
407147
407200
|
* a given path to fix that issue for most cases.
|
|
407148
407201
|
*/
|
|
407149
407202
|
async protectWhitespace(path97) {
|
|
407150
|
-
if (/[\r\n\0]/.test(path97)) {
|
|
407151
|
-
throw new Error("Invalid path: Contains control characters");
|
|
407152
|
-
}
|
|
407153
407203
|
if (!path97.startsWith(" ")) {
|
|
407154
407204
|
return path97;
|
|
407155
407205
|
}
|
|
@@ -407249,17 +407299,17 @@ var require_Client14 = __commonJS({
|
|
|
407249
407299
|
}
|
|
407250
407300
|
});
|
|
407251
407301
|
|
|
407252
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
407302
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/StringEncoding.js
|
|
407253
407303
|
var require_StringEncoding = __commonJS({
|
|
407254
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
407304
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/StringEncoding.js"(exports2) {
|
|
407255
407305
|
"use strict";
|
|
407256
407306
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
407257
407307
|
}
|
|
407258
407308
|
});
|
|
407259
407309
|
|
|
407260
|
-
// ../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
407310
|
+
// ../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/index.js
|
|
407261
407311
|
var require_dist17 = __commonJS({
|
|
407262
|
-
"../../../node_modules/.pnpm/basic-ftp@5.2.
|
|
407312
|
+
"../../../node_modules/.pnpm/basic-ftp@5.2.2/node_modules/basic-ftp/dist/index.js"(exports2) {
|
|
407263
407313
|
"use strict";
|
|
407264
407314
|
var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o14, m11, k19, k23) {
|
|
407265
407315
|
if (k23 === void 0) k23 = k19;
|
|
@@ -529537,6 +529587,7 @@ var WebsocketMessageOrigin2 = schemas_exports9.enum_(["client", "server"]);
|
|
|
529537
529587
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebsocketMessageSchema.js
|
|
529538
529588
|
var WebsocketMessageSchema = schemas_exports9.objectWithoutOptionalProperties({
|
|
529539
529589
|
name: schemas_exports9.string(),
|
|
529590
|
+
displayName: schemas_exports9.string().optional(),
|
|
529540
529591
|
origin: WebsocketMessageOrigin2,
|
|
529541
529592
|
body: schemas_exports9.lazy(() => Schema2),
|
|
529542
529593
|
methodName: schemas_exports9.string().optional()
|
|
@@ -532790,6 +532841,9 @@ function buildChannel({ channel: channel3, context: context3, declarationFile })
|
|
|
532790
532841
|
declarationDepth: 0
|
|
532791
532842
|
})
|
|
532792
532843
|
};
|
|
532844
|
+
if (message.displayName != null) {
|
|
532845
|
+
messageSchema["display-name"] = message.displayName;
|
|
532846
|
+
}
|
|
532793
532847
|
if (message.methodName != null) {
|
|
532794
532848
|
messageSchema["method-name"] = message.methodName;
|
|
532795
532849
|
}
|
|
@@ -545976,6 +546030,7 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
545976
546030
|
messages2.push({
|
|
545977
546031
|
origin: "client",
|
|
545978
546032
|
name: "publish",
|
|
546033
|
+
displayName: channel3.publish != null ? getExtension(channel3.publish, FernAsyncAPIExtension.FERN_DISPLAY_NAME) : void 0,
|
|
545979
546034
|
body: convertSchemaWithExampleToSchema(publishSchema),
|
|
545980
546035
|
methodName: channel3.publish != null ? getExtension(channel3.publish, FernAsyncAPIExtension.FERN_SDK_METHOD_NAME) : void 0
|
|
545981
546036
|
});
|
|
@@ -545984,6 +546039,7 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
545984
546039
|
messages2.push({
|
|
545985
546040
|
origin: "server",
|
|
545986
546041
|
name: "subscribe",
|
|
546042
|
+
displayName: channel3.subscribe != null ? getExtension(channel3.subscribe, FernAsyncAPIExtension.FERN_DISPLAY_NAME) : void 0,
|
|
545987
546043
|
body: convertSchemaWithExampleToSchema(subscribeSchema),
|
|
545988
546044
|
methodName: channel3.subscribe != null ? getExtension(channel3.subscribe, FernAsyncAPIExtension.FERN_SDK_METHOD_NAME) : void 0
|
|
545989
546045
|
});
|
|
@@ -546277,12 +546333,14 @@ function parseAsyncAPIV3({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
546277
546333
|
channelEvents[channelPath] = { subscribe: [], publish: [], __parsedMessages: [] };
|
|
546278
546334
|
}
|
|
546279
546335
|
const methodName = getExtension(operation, FernAsyncAPIExtension.FERN_SDK_METHOD_NAME);
|
|
546336
|
+
const operationDisplayName = getExtension(operation, FernAsyncAPIExtension.FERN_DISPLAY_NAME);
|
|
546280
546337
|
if (!operation.messages || !Array.isArray(operation.messages)) {
|
|
546281
546338
|
continue;
|
|
546282
546339
|
}
|
|
546283
546340
|
const messagesWithMethodName = operation.messages.filter((ref2) => ref2 != null && ref2.$ref != null).map((ref2) => ({
|
|
546284
546341
|
ref: ref2,
|
|
546285
|
-
methodName
|
|
546342
|
+
methodName,
|
|
546343
|
+
displayName: operationDisplayName
|
|
546286
546344
|
}));
|
|
546287
546345
|
const channelEvent = channelEvents[channelPath];
|
|
546288
546346
|
if (channelEvent == null) {
|
|
@@ -546610,6 +546668,7 @@ function convertMessageReferencesToWebsocketSchemas({ messages: messages2, chann
|
|
|
546610
546668
|
results.push({
|
|
546611
546669
|
origin: origin2,
|
|
546612
546670
|
name: schemaId ?? `${origin2}Message${i11 + 1}`,
|
|
546671
|
+
displayName: message.displayName,
|
|
546613
546672
|
body: convertSchemaWithExampleToSchema(schema2),
|
|
546614
546673
|
methodName: message.methodName
|
|
546615
546674
|
});
|
|
@@ -611807,14 +611866,14 @@ var ChannelAddressExtension = class extends AbstractExtension {
|
|
|
611807
611866
|
|
|
611808
611867
|
// ../api-importers/asyncapi-to-ir/lib/extensions/x-fern-display-name.js
|
|
611809
611868
|
var DisplayNameExtension = class extends AbstractExtension {
|
|
611810
|
-
|
|
611869
|
+
node;
|
|
611811
611870
|
key = "x-fern-display-name";
|
|
611812
|
-
constructor({ breadcrumbs,
|
|
611871
|
+
constructor({ breadcrumbs, node: node4, context: context3 }) {
|
|
611813
611872
|
super({ breadcrumbs, context: context3 });
|
|
611814
|
-
this.
|
|
611873
|
+
this.node = node4;
|
|
611815
611874
|
}
|
|
611816
611875
|
convert() {
|
|
611817
|
-
const extensionValue = this.getExtensionValue(this.
|
|
611876
|
+
const extensionValue = this.getExtensionValue(this.node);
|
|
611818
611877
|
if (extensionValue == null || typeof extensionValue !== "string") {
|
|
611819
611878
|
return void 0;
|
|
611820
611879
|
}
|
|
@@ -611849,12 +611908,12 @@ var ChannelConverter2_X = class extends AbstractChannelConverter {
|
|
|
611849
611908
|
const pathParameters = [];
|
|
611850
611909
|
const queryParameters = [];
|
|
611851
611910
|
const headers2 = [];
|
|
611852
|
-
const
|
|
611911
|
+
const channelDisplayNameExtension = new DisplayNameExtension({
|
|
611853
611912
|
breadcrumbs: this.breadcrumbs,
|
|
611854
|
-
|
|
611913
|
+
node: this.channel,
|
|
611855
611914
|
context: this.context
|
|
611856
611915
|
});
|
|
611857
|
-
const displayName =
|
|
611916
|
+
const displayName = channelDisplayNameExtension.convert() ?? this.websocketGroup?.join(".");
|
|
611858
611917
|
if (this.channel.parameters) {
|
|
611859
611918
|
this.convertPathParameters({
|
|
611860
611919
|
context: this.context,
|
|
@@ -612024,9 +612083,15 @@ var ChannelConverter2_X = class extends AbstractChannelConverter {
|
|
|
612024
612083
|
docs: operation.description
|
|
612025
612084
|
});
|
|
612026
612085
|
const messageType = origin2 === "server" ? "subscribe" : "publish";
|
|
612086
|
+
const operationDisplayNameExtension = new DisplayNameExtension({
|
|
612087
|
+
breadcrumbs: [...this.breadcrumbs, messageType],
|
|
612088
|
+
node: operation,
|
|
612089
|
+
context: this.context
|
|
612090
|
+
});
|
|
612091
|
+
const operationDisplayName = operationDisplayNameExtension.convert() ?? messageType;
|
|
612027
612092
|
return {
|
|
612028
612093
|
type: messageType,
|
|
612029
|
-
displayName:
|
|
612094
|
+
displayName: operationDisplayName,
|
|
612030
612095
|
origin: origin2,
|
|
612031
612096
|
body,
|
|
612032
612097
|
availability: context3.getAvailability({
|
|
@@ -612188,12 +612253,12 @@ var ChannelConverter3_0 = class extends AbstractChannelConverter {
|
|
|
612188
612253
|
const pathParameters = [];
|
|
612189
612254
|
const queryParameters = [];
|
|
612190
612255
|
const headers2 = [];
|
|
612191
|
-
const
|
|
612256
|
+
const channelDisplayNameExtension = new DisplayNameExtension({
|
|
612192
612257
|
breadcrumbs: this.breadcrumbs,
|
|
612193
|
-
|
|
612258
|
+
node: this.channel,
|
|
612194
612259
|
context: this.context
|
|
612195
612260
|
});
|
|
612196
|
-
const displayName =
|
|
612261
|
+
const displayName = channelDisplayNameExtension.convert() ?? this.websocketGroup?.join(".") ?? this.channelPath;
|
|
612197
612262
|
if (this.channel.parameters) {
|
|
612198
612263
|
this.convertChannelParameters({
|
|
612199
612264
|
pathParameters,
|
|
@@ -612213,6 +612278,12 @@ var ChannelConverter3_0 = class extends AbstractChannelConverter {
|
|
|
612213
612278
|
}, {});
|
|
612214
612279
|
const messages2 = [];
|
|
612215
612280
|
for (const [operationId, operation] of Object.entries(channelOperations)) {
|
|
612281
|
+
const operationDisplayNameExtension = new DisplayNameExtension({
|
|
612282
|
+
breadcrumbs: [...this.breadcrumbs, operationId],
|
|
612283
|
+
node: operation,
|
|
612284
|
+
context: this.context
|
|
612285
|
+
});
|
|
612286
|
+
const operationDisplayName = operationDisplayNameExtension.convert() ?? operationId;
|
|
612216
612287
|
for (const message of operation.messages) {
|
|
612217
612288
|
const resolved = this.context.convertReferenceToTypeReference({ reference: message });
|
|
612218
612289
|
if (resolved.ok) {
|
|
@@ -612222,7 +612293,7 @@ var ChannelConverter3_0 = class extends AbstractChannelConverter {
|
|
|
612222
612293
|
});
|
|
612223
612294
|
messages2.push({
|
|
612224
612295
|
type: operationId,
|
|
612225
|
-
displayName:
|
|
612296
|
+
displayName: operationDisplayName,
|
|
612226
612297
|
origin: operation.action === "send" ? "client" : "server",
|
|
612227
612298
|
body: messageBody,
|
|
612228
612299
|
availability: this.context.getAvailability({
|
|
@@ -619399,7 +619470,7 @@ var TaskContextAdapter = class {
|
|
|
619399
619470
|
return false;
|
|
619400
619471
|
}
|
|
619401
619472
|
}
|
|
619402
|
-
|
|
619473
|
+
instrumentPostHogEvent(_event) {
|
|
619403
619474
|
}
|
|
619404
619475
|
formatError(error50) {
|
|
619405
619476
|
if (error50 == null) {
|
|
@@ -627553,7 +627624,7 @@ var AccessTokenPosthogManager = class {
|
|
|
627553
627624
|
properties: {
|
|
627554
627625
|
...event,
|
|
627555
627626
|
...event.properties,
|
|
627556
|
-
version: "4.
|
|
627627
|
+
version: "4.68.0",
|
|
627557
627628
|
usingAccessToken: true
|
|
627558
627629
|
}
|
|
627559
627630
|
});
|
|
@@ -627604,7 +627675,7 @@ var UserPosthogManager = class {
|
|
|
627604
627675
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
627605
627676
|
event: "CLI",
|
|
627606
627677
|
properties: {
|
|
627607
|
-
version: "4.
|
|
627678
|
+
version: "4.68.0",
|
|
627608
627679
|
...event,
|
|
627609
627680
|
...event.properties,
|
|
627610
627681
|
usingAccessToken: false,
|
|
@@ -628683,7 +628754,7 @@ var DASHBOARD_BASE_URL = "https://dashboard-dev.buildwithfern.com";
|
|
|
628683
628754
|
|
|
628684
628755
|
// ../login/lib/login.js
|
|
628685
628756
|
async function login(context3, { useDeviceCodeFlow = false, email: email3 } = {}) {
|
|
628686
|
-
|
|
628757
|
+
context3.instrumentPostHogEvent({
|
|
628687
628758
|
command: "Login initiated"
|
|
628688
628759
|
});
|
|
628689
628760
|
const { accessToken } = await getTokenFromAuth0(context3, { useDeviceCodeFlow, email: email3 });
|
|
@@ -628763,7 +628834,7 @@ async function askForConfirmation(message) {
|
|
|
628763
628834
|
// ../login/lib/logout.js
|
|
628764
628835
|
var import_open3 = __toESM(require_open(), 1);
|
|
628765
628836
|
async function logout(context3) {
|
|
628766
|
-
|
|
628837
|
+
context3.instrumentPostHogEvent({
|
|
628767
628838
|
command: "Logout initiated"
|
|
628768
628839
|
});
|
|
628769
628840
|
const wasLoggedIn = await isLoggedIn();
|
|
@@ -628780,7 +628851,7 @@ async function logout(context3) {
|
|
|
628780
628851
|
} catch (error50) {
|
|
628781
628852
|
context3.logger.warn(source_default.yellow("Could not open browser automatically. Please visit this URL to complete logout:\n" + logoutUrl));
|
|
628782
628853
|
}
|
|
628783
|
-
|
|
628854
|
+
context3.instrumentPostHogEvent({
|
|
628784
628855
|
command: "Logout successful"
|
|
628785
628856
|
});
|
|
628786
628857
|
}
|
|
@@ -631028,13 +631099,18 @@ var import_path46 = require("path");
|
|
|
631028
631099
|
var Version2 = "*";
|
|
631029
631100
|
|
|
631030
631101
|
// ../cli-v2/lib/telemetry/TelemetryClient.js
|
|
631031
|
-
var TelemetryClient = class {
|
|
631102
|
+
var TelemetryClient = class _TelemetryClient {
|
|
631032
631103
|
posthog;
|
|
631033
631104
|
sentry;
|
|
631034
631105
|
baseTags;
|
|
631035
631106
|
accumulatedTags = {};
|
|
631036
|
-
|
|
631037
|
-
|
|
631107
|
+
distinctId;
|
|
631108
|
+
static async create({ isTTY }) {
|
|
631109
|
+
const distinctId = await _TelemetryClient.getDistinctId();
|
|
631110
|
+
return new _TelemetryClient({ isTTY, distinctId });
|
|
631111
|
+
}
|
|
631112
|
+
constructor({ isTTY, distinctId }) {
|
|
631113
|
+
this.distinctId = distinctId;
|
|
631038
631114
|
const isTelemetryEnabled = this.isTelemetryEnabled();
|
|
631039
631115
|
const apiKey = null;
|
|
631040
631116
|
this.baseTags = {
|
|
@@ -631064,13 +631140,13 @@ var TelemetryClient = class {
|
|
|
631064
631140
|
}
|
|
631065
631141
|
}
|
|
631066
631142
|
/** Send a named event that inherits base + accumulated properties. */
|
|
631067
|
-
|
|
631143
|
+
sendEvent(event, tags) {
|
|
631068
631144
|
if (this.posthog == null) {
|
|
631069
631145
|
return;
|
|
631070
631146
|
}
|
|
631071
631147
|
try {
|
|
631072
631148
|
this.posthog.capture({
|
|
631073
|
-
distinctId:
|
|
631149
|
+
distinctId: this.distinctId,
|
|
631074
631150
|
event,
|
|
631075
631151
|
properties: { ...this.baseTags, ...this.accumulatedTags, ...tags }
|
|
631076
631152
|
});
|
|
@@ -631081,13 +631157,13 @@ var TelemetryClient = class {
|
|
|
631081
631157
|
*
|
|
631082
631158
|
* This is not meant to be called directly by command handlers.
|
|
631083
631159
|
*/
|
|
631084
|
-
|
|
631160
|
+
sendLifecycleEvent(event) {
|
|
631085
631161
|
if (this.posthog == null) {
|
|
631086
631162
|
return;
|
|
631087
631163
|
}
|
|
631088
631164
|
try {
|
|
631089
631165
|
this.posthog.capture({
|
|
631090
|
-
distinctId:
|
|
631166
|
+
distinctId: this.distinctId,
|
|
631091
631167
|
event: "cli",
|
|
631092
631168
|
properties: {
|
|
631093
631169
|
...this.baseTags,
|
|
@@ -631108,14 +631184,14 @@ var TelemetryClient = class {
|
|
|
631108
631184
|
* The caller is responsible for deciding which errors are worth reporting
|
|
631109
631185
|
* (see `shouldReportToSentry` in withContext.ts).
|
|
631110
631186
|
*/
|
|
631111
|
-
|
|
631187
|
+
captureException(error50) {
|
|
631112
631188
|
if (this.sentry === void 0) {
|
|
631113
631189
|
return;
|
|
631114
631190
|
}
|
|
631115
631191
|
try {
|
|
631116
631192
|
this.sentry.captureException(error50, {
|
|
631117
631193
|
captureContext: {
|
|
631118
|
-
user: { id:
|
|
631194
|
+
user: { id: this.distinctId },
|
|
631119
631195
|
tags: { ...this.baseTags, ...this.accumulatedTags }
|
|
631120
631196
|
}
|
|
631121
631197
|
});
|
|
@@ -631132,30 +631208,28 @@ var TelemetryClient = class {
|
|
|
631132
631208
|
}
|
|
631133
631209
|
await Promise.all(promises);
|
|
631134
631210
|
}
|
|
631135
|
-
async getDistinctId() {
|
|
631136
|
-
|
|
631137
|
-
|
|
631138
|
-
}
|
|
631139
|
-
const distinctIdFilepath = this.getDistinctIdFilepath();
|
|
631211
|
+
static async getDistinctId() {
|
|
631212
|
+
const distinctIdFilepath = _TelemetryClient.getDistinctIdFilepath();
|
|
631213
|
+
let distinctId = null;
|
|
631140
631214
|
try {
|
|
631141
631215
|
if (!await doesPathExist(distinctIdFilepath)) {
|
|
631142
631216
|
await (0, import_promises49.mkdir)((0, import_path46.dirname)(distinctIdFilepath), { recursive: true });
|
|
631143
631217
|
await (0, import_promises49.writeFile)(distinctIdFilepath, v4_default(), { flag: "wx" });
|
|
631144
631218
|
}
|
|
631145
631219
|
const content5 = (await (0, import_promises49.readFile)(distinctIdFilepath)).toString().trim();
|
|
631146
|
-
|
|
631220
|
+
distinctId = content5;
|
|
631147
631221
|
if (!validate_default(content5)) {
|
|
631148
631222
|
const newId = v4_default();
|
|
631149
631223
|
await (0, import_promises49.writeFile)(distinctIdFilepath, newId);
|
|
631150
|
-
|
|
631224
|
+
distinctId = newId;
|
|
631151
631225
|
}
|
|
631152
631226
|
} catch {
|
|
631153
|
-
|
|
631227
|
+
distinctId = v4_default();
|
|
631154
631228
|
}
|
|
631155
|
-
if (
|
|
631156
|
-
|
|
631229
|
+
if (distinctId == null || distinctId.length === 0) {
|
|
631230
|
+
distinctId = v4_default();
|
|
631157
631231
|
}
|
|
631158
|
-
return
|
|
631232
|
+
return distinctId;
|
|
631159
631233
|
}
|
|
631160
631234
|
/**
|
|
631161
631235
|
* The file that stores the distinct ID for the user (stored in ~/.fern/id).
|
|
@@ -631163,7 +631237,7 @@ var TelemetryClient = class {
|
|
|
631163
631237
|
* Note that all telemetry is anonymous, but we still use a shared distinct ID
|
|
631164
631238
|
* to correlate metrics from the same user/machine across multiple CLI invocations.
|
|
631165
631239
|
*/
|
|
631166
|
-
getDistinctIdFilepath() {
|
|
631240
|
+
static getDistinctIdFilepath() {
|
|
631167
631241
|
return join8(AbsoluteFilePath2.of((0, import_os8.homedir)()), RelativeFilePath2.of(".fern"), RelativeFilePath2.of("id"));
|
|
631168
631242
|
}
|
|
631169
631243
|
/**
|
|
@@ -632011,7 +632085,7 @@ ${"=".repeat(60)}
|
|
|
632011
632085
|
};
|
|
632012
632086
|
|
|
632013
632087
|
// ../cli-v2/lib/context/Context.js
|
|
632014
|
-
var Context = class {
|
|
632088
|
+
var Context = class _Context {
|
|
632015
632089
|
shutdownCallbacks = [];
|
|
632016
632090
|
isShuttingDown = false;
|
|
632017
632091
|
logFilePathPrinted = false;
|
|
@@ -632025,7 +632099,12 @@ var Context = class {
|
|
|
632025
632099
|
telemetry;
|
|
632026
632100
|
tokenService;
|
|
632027
632101
|
ttyAwareLogger;
|
|
632028
|
-
|
|
632102
|
+
static async create({ stdout, stderr, cwd: cwd2, logLevel }) {
|
|
632103
|
+
const ttyAwareLogger = new TtyAwareLogger(stdout, stderr);
|
|
632104
|
+
const telemetry = await TelemetryClient.create({ isTTY: ttyAwareLogger.isTTY });
|
|
632105
|
+
return new _Context({ stdout, stderr, cwd: cwd2, logLevel, ttyAwareLogger, telemetry });
|
|
632106
|
+
}
|
|
632107
|
+
constructor({ cwd: cwd2, logLevel, ttyAwareLogger, telemetry }) {
|
|
632029
632108
|
this.cwd = cwd2 ?? AbsoluteFilePath2.of(process.cwd());
|
|
632030
632109
|
this.logLevel = logLevel ?? LogLevel2.Info;
|
|
632031
632110
|
this.info = parseCommandInfo(process.argv);
|
|
@@ -632033,8 +632112,8 @@ var Context = class {
|
|
|
632033
632112
|
this.stderr = createLogger4((level, ...args) => this.logStderr(level, ...args));
|
|
632034
632113
|
this.cache = new Cache({ logger: this.stderr });
|
|
632035
632114
|
this.logs = new LogFileWriter(this.cache.logs.absoluteFilePath);
|
|
632036
|
-
this.ttyAwareLogger =
|
|
632037
|
-
this.telemetry =
|
|
632115
|
+
this.ttyAwareLogger = ttyAwareLogger;
|
|
632116
|
+
this.telemetry = telemetry;
|
|
632038
632117
|
this.tokenService = new TokenService({ credential: new CredentialStore() });
|
|
632039
632118
|
}
|
|
632040
632119
|
/**
|
|
@@ -632274,12 +632353,12 @@ var SIGINT_EXIT_CODE = SIGNAL_EXIT_CODE_BASE + 2;
|
|
|
632274
632353
|
var SIGTERM_EXIT_CODE = SIGNAL_EXIT_CODE_BASE + 15;
|
|
632275
632354
|
function withContext(handler3) {
|
|
632276
632355
|
return async (args) => {
|
|
632277
|
-
const context3 = createContext(args);
|
|
632356
|
+
const context3 = await createContext(args);
|
|
632278
632357
|
const startTime = Date.now();
|
|
632279
632358
|
setupSignalHandler(context3);
|
|
632280
632359
|
try {
|
|
632281
632360
|
await handler3(context3, args);
|
|
632282
|
-
|
|
632361
|
+
context3.telemetry.sendLifecycleEvent({
|
|
632283
632362
|
command: context3.info.command,
|
|
632284
632363
|
status: "success",
|
|
632285
632364
|
durationMs: Date.now() - startTime
|
|
@@ -632289,9 +632368,9 @@ function withContext(handler3) {
|
|
|
632289
632368
|
await exitGracefully(0);
|
|
632290
632369
|
} catch (error50) {
|
|
632291
632370
|
if (shouldReportToSentry(error50)) {
|
|
632292
|
-
|
|
632371
|
+
context3.telemetry.captureException(error50);
|
|
632293
632372
|
}
|
|
632294
|
-
|
|
632373
|
+
context3.telemetry.sendLifecycleEvent({
|
|
632295
632374
|
command: context3.info.command,
|
|
632296
632375
|
status: "error",
|
|
632297
632376
|
durationMs: Date.now() - startTime,
|
|
@@ -632304,9 +632383,9 @@ function withContext(handler3) {
|
|
|
632304
632383
|
}
|
|
632305
632384
|
};
|
|
632306
632385
|
}
|
|
632307
|
-
function createContext(options2) {
|
|
632386
|
+
async function createContext(options2) {
|
|
632308
632387
|
const logLevel = parseLogLevel(options2["log-level"] ?? "info");
|
|
632309
|
-
return
|
|
632388
|
+
return Context.create({
|
|
632310
632389
|
stdout: process.stdout,
|
|
632311
632390
|
stderr: process.stderr,
|
|
632312
632391
|
logLevel
|
|
@@ -843865,7 +843944,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
843865
843944
|
var LOGS_FOLDER_NAME = "logs";
|
|
843866
843945
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
843867
843946
|
function getCliSource() {
|
|
843868
|
-
const version7 = "4.
|
|
843947
|
+
const version7 = "4.68.0";
|
|
843869
843948
|
return `cli@${version7}`;
|
|
843870
843949
|
}
|
|
843871
843950
|
var DebugLogger = class {
|
|
@@ -854517,7 +854596,7 @@ function convertToFilePathPairs(uploadUrls, docsWorkspacePath, sanitizedToAbsolu
|
|
|
854517
854596
|
return toRet;
|
|
854518
854597
|
}
|
|
854519
854598
|
async function startDocsRegisterFailed(error50, context3, organization, domain3) {
|
|
854520
|
-
|
|
854599
|
+
context3.instrumentPostHogEvent({
|
|
854521
854600
|
command: "docs-generation",
|
|
854522
854601
|
properties: {
|
|
854523
854602
|
error: JSON.stringify(error50)
|
|
@@ -855113,7 +855192,7 @@ var LegacyDocsPublisher = class {
|
|
|
855113
855192
|
previewId,
|
|
855114
855193
|
disableTemplates: void 0,
|
|
855115
855194
|
skipUpload,
|
|
855116
|
-
cliVersion: "4.
|
|
855195
|
+
cliVersion: "4.68.0"
|
|
855117
855196
|
});
|
|
855118
855197
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
855119
855198
|
return { success: false };
|
|
@@ -889247,7 +889326,9 @@ var DynamicTypeLiteralMapper3 = class {
|
|
|
889247
889326
|
object_: named,
|
|
889248
889327
|
value: discriminatedUnionTypeInstance.value
|
|
889249
889328
|
});
|
|
889250
|
-
|
|
889329
|
+
const baseFieldNames = new Set(baseFields.map((f10) => f10.name));
|
|
889330
|
+
const filteredObjectEntries = objectEntries.filter((entry) => !baseFieldNames.has(entry.name));
|
|
889331
|
+
return [...baseFields, ...filteredObjectEntries];
|
|
889251
889332
|
}
|
|
889252
889333
|
case "singleProperty": {
|
|
889253
889334
|
try {
|
|
@@ -928408,8 +928489,8 @@ var TaskContextImpl = class {
|
|
|
928408
928489
|
getResult() {
|
|
928409
928490
|
return this.result;
|
|
928410
928491
|
}
|
|
928411
|
-
|
|
928412
|
-
|
|
928492
|
+
instrumentPostHogEvent(event) {
|
|
928493
|
+
this.instrumentPostHogEventImpl(event);
|
|
928413
928494
|
}
|
|
928414
928495
|
logAtLevel(level, ...parts) {
|
|
928415
928496
|
this.logAtLevelWithOverrides(level, parts);
|
|
@@ -928445,7 +928526,7 @@ var TaskContextImpl = class {
|
|
|
928445
928526
|
takeOverTerminal: this.takeOverTerminal,
|
|
928446
928527
|
onResult: this.onResult,
|
|
928447
928528
|
shouldBufferLogs: this.shouldBufferLogs,
|
|
928448
|
-
instrumentPostHogEvent:
|
|
928529
|
+
instrumentPostHogEvent: (event) => this.instrumentPostHogEventImpl(event)
|
|
928449
928530
|
});
|
|
928450
928531
|
this.subtasks.push(subtask);
|
|
928451
928532
|
return subtask;
|
|
@@ -928811,9 +928892,10 @@ async function getLatestVersionOfCli({
|
|
|
928811
928892
|
|
|
928812
928893
|
// src/cli-context/CliContext.ts
|
|
928813
928894
|
var WORKSPACE_NAME_COLORS = ["#2E86AB", "#A23B72", "#F18F01", "#C73E1D", "#CCE2A3"];
|
|
928814
|
-
var CliContext = class {
|
|
928895
|
+
var CliContext = class _CliContext {
|
|
928815
928896
|
environment;
|
|
928816
928897
|
sentryClient;
|
|
928898
|
+
posthogManager;
|
|
928817
928899
|
didSucceed = true;
|
|
928818
928900
|
numTasks = 0;
|
|
928819
928901
|
ttyAwareLogger;
|
|
@@ -928821,9 +928903,14 @@ var CliContext = class {
|
|
|
928821
928903
|
isLocal;
|
|
928822
928904
|
stdoutRedirector = new StdoutRedirector();
|
|
928823
928905
|
jsonMode = false;
|
|
928824
|
-
|
|
928906
|
+
static async create(stdout, stderr, { isLocal }) {
|
|
928907
|
+
const posthogManager2 = await getPosthogManager();
|
|
928908
|
+
return new _CliContext(stdout, stderr, { isLocal, posthogManager: posthogManager2 });
|
|
928909
|
+
}
|
|
928910
|
+
constructor(stdout, stderr, { isLocal, posthogManager: posthogManager2 }) {
|
|
928825
928911
|
this.ttyAwareLogger = new TtyAwareLogger(stdout, stderr);
|
|
928826
928912
|
this.isLocal = isLocal ?? false;
|
|
928913
|
+
this.posthogManager = posthogManager2;
|
|
928827
928914
|
const packageName = this.getPackageName();
|
|
928828
928915
|
const packageVersion3 = this.getPackageVersion();
|
|
928829
928916
|
const cliName = this.getCliName();
|
|
@@ -928847,7 +928934,7 @@ var CliContext = class {
|
|
|
928847
928934
|
if (false) {
|
|
928848
928935
|
this.logger.error("CLI_VERSION is not defined");
|
|
928849
928936
|
}
|
|
928850
|
-
return "4.
|
|
928937
|
+
return "4.68.0";
|
|
928851
928938
|
}
|
|
928852
928939
|
getCliName() {
|
|
928853
928940
|
if (false) {
|
|
@@ -928903,8 +928990,7 @@ var CliContext = class {
|
|
|
928903
928990
|
await this.nudgeUpgradeIfAvailable();
|
|
928904
928991
|
}
|
|
928905
928992
|
this.ttyAwareLogger.finish();
|
|
928906
|
-
|
|
928907
|
-
await posthogManager2.flush();
|
|
928993
|
+
await this.posthogManager.flush();
|
|
928908
928994
|
await this.sentryClient.flush();
|
|
928909
928995
|
this.exitProgram({ code: code5 });
|
|
928910
928996
|
}
|
|
@@ -928985,9 +929071,9 @@ var CliContext = class {
|
|
|
928985
929071
|
}
|
|
928986
929072
|
return result;
|
|
928987
929073
|
}
|
|
928988
|
-
|
|
929074
|
+
instrumentPostHogEvent(event) {
|
|
928989
929075
|
if (!this.isLocal) {
|
|
928990
|
-
|
|
929076
|
+
this.posthogManager.sendEvent(event);
|
|
928991
929077
|
}
|
|
928992
929078
|
}
|
|
928993
929079
|
async captureException(error50) {
|
|
@@ -929017,8 +929103,8 @@ var CliContext = class {
|
|
|
929017
929103
|
this.didSucceed = false;
|
|
929018
929104
|
}
|
|
929019
929105
|
},
|
|
929020
|
-
instrumentPostHogEvent:
|
|
929021
|
-
|
|
929106
|
+
instrumentPostHogEvent: (event) => {
|
|
929107
|
+
this.instrumentPostHogEvent(event);
|
|
929022
929108
|
},
|
|
929023
929109
|
shouldBufferLogs: false
|
|
929024
929110
|
};
|
|
@@ -930095,7 +930181,7 @@ function addGetOrganizationCommand(cli, cliContext) {
|
|
|
930095
930181
|
description: "The location to output the organization name as a text file, defaults to standard out."
|
|
930096
930182
|
}),
|
|
930097
930183
|
async (argv) => {
|
|
930098
|
-
|
|
930184
|
+
cliContext.instrumentPostHogEvent({
|
|
930099
930185
|
command: "fern organization",
|
|
930100
930186
|
properties: {
|
|
930101
930187
|
outputLocation: argv.output
|
|
@@ -930149,7 +930235,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
930149
930235
|
description: "The generator output modes to exclude within the outputted list."
|
|
930150
930236
|
}),
|
|
930151
930237
|
async (argv) => {
|
|
930152
|
-
|
|
930238
|
+
cliContext.instrumentPostHogEvent({
|
|
930153
930239
|
command: "fern generator list",
|
|
930154
930240
|
properties: {
|
|
930155
930241
|
outputLocation: argv.output
|
|
@@ -930206,7 +930292,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
930206
930292
|
description: "Skip upgrading generators that have autorelease: false set in their configuration."
|
|
930207
930293
|
}),
|
|
930208
930294
|
async (argv) => {
|
|
930209
|
-
|
|
930295
|
+
cliContext.instrumentPostHogEvent({
|
|
930210
930296
|
command: "fern generator upgrade",
|
|
930211
930297
|
properties: {
|
|
930212
930298
|
generator: argv.generator,
|
|
@@ -930289,7 +930375,7 @@ function addGeneratorCommands(cli, cliContext) {
|
|
|
930289
930375
|
}),
|
|
930290
930376
|
async (argv) => {
|
|
930291
930377
|
const correctedGetGenerator = warnAndCorrectIncorrectDockerOrgV2(argv.generator, cliContext);
|
|
930292
|
-
|
|
930378
|
+
cliContext.instrumentPostHogEvent({
|
|
930293
930379
|
command: "fern generator get",
|
|
930294
930380
|
properties: {
|
|
930295
930381
|
generator: correctedGetGenerator,
|
|
@@ -930648,7 +930734,7 @@ async function previewDocsWorkspace({
|
|
|
930648
930734
|
return;
|
|
930649
930735
|
}
|
|
930650
930736
|
if (legacyPreview) {
|
|
930651
|
-
|
|
930737
|
+
cliContext.instrumentPostHogEvent({
|
|
930652
930738
|
orgId: project.config.organization,
|
|
930653
930739
|
command: "fern docs dev --legacy"
|
|
930654
930740
|
});
|
|
@@ -930693,7 +930779,7 @@ async function previewDocsWorkspace({
|
|
|
930693
930779
|
});
|
|
930694
930780
|
});
|
|
930695
930781
|
}
|
|
930696
|
-
|
|
930782
|
+
cliContext.instrumentPostHogEvent({
|
|
930697
930783
|
orgId: project.config.organization,
|
|
930698
930784
|
command: "fern docs dev --beta"
|
|
930699
930785
|
});
|
|
@@ -938400,7 +938486,7 @@ async function generateAPIWorkspaces({
|
|
|
938400
938486
|
}
|
|
938401
938487
|
}
|
|
938402
938488
|
}
|
|
938403
|
-
|
|
938489
|
+
cliContext.instrumentPostHogEvent({
|
|
938404
938490
|
orgId: project.config.organization,
|
|
938405
938491
|
command: "fern generate",
|
|
938406
938492
|
properties: {
|
|
@@ -938651,7 +938737,7 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
|
|
|
938651
938737
|
}
|
|
938652
938738
|
}
|
|
938653
938739
|
}
|
|
938654
|
-
|
|
938740
|
+
cliContext.instrumentPostHogEvent({
|
|
938655
938741
|
orgId: project.config.organization,
|
|
938656
938742
|
command: "fern generate --docs"
|
|
938657
938743
|
});
|
|
@@ -940314,7 +940400,7 @@ async function mockServer({
|
|
|
940314
940400
|
project,
|
|
940315
940401
|
port
|
|
940316
940402
|
}) {
|
|
940317
|
-
|
|
940403
|
+
cliContext.instrumentPostHogEvent({
|
|
940318
940404
|
orgId: project.config.organization,
|
|
940319
940405
|
command: "fern mock"
|
|
940320
940406
|
});
|
|
@@ -941276,7 +941362,7 @@ async function testOutput({
|
|
|
941276
941362
|
testCommand,
|
|
941277
941363
|
generationLanguage
|
|
941278
941364
|
}) {
|
|
941279
|
-
|
|
941365
|
+
cliContext.instrumentPostHogEvent({
|
|
941280
941366
|
orgId: project.config.organization,
|
|
941281
941367
|
command: "fern test"
|
|
941282
941368
|
});
|
|
@@ -947025,7 +947111,7 @@ var USE_NODE_18_OR_ABOVE_MESSAGE = "The Fern CLI requires Node 18+ or above.";
|
|
|
947025
947111
|
async function runCli() {
|
|
947026
947112
|
getOrCreateFernRunId();
|
|
947027
947113
|
const isLocal = process.argv.includes("--local");
|
|
947028
|
-
const cliContext =
|
|
947114
|
+
const cliContext = await CliContext.create(process.stdout, process.stderr, { isLocal });
|
|
947029
947115
|
const exit3 = async () => {
|
|
947030
947116
|
await cliContext.exit();
|
|
947031
947117
|
};
|
|
@@ -947059,7 +947145,7 @@ async function runCli() {
|
|
|
947059
947145
|
});
|
|
947060
947146
|
}
|
|
947061
947147
|
} catch (error50) {
|
|
947062
|
-
|
|
947148
|
+
cliContext.instrumentPostHogEvent({
|
|
947063
947149
|
command: process.argv.join(" "),
|
|
947064
947150
|
properties: {
|
|
947065
947151
|
failed: true,
|
|
@@ -947393,7 +947479,7 @@ function addSdkDiffCommand(cli, cliContext) {
|
|
|
947393
947479
|
description: "Output result as JSON"
|
|
947394
947480
|
}),
|
|
947395
947481
|
async (argv) => {
|
|
947396
|
-
|
|
947482
|
+
cliContext.instrumentPostHogEvent({
|
|
947397
947483
|
command: "fern sdk-diff"
|
|
947398
947484
|
});
|
|
947399
947485
|
const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
@@ -948090,7 +948176,7 @@ function addUpdateApiSpecCommand(cli, cliContext) {
|
|
|
948090
948176
|
default: 2
|
|
948091
948177
|
}),
|
|
948092
948178
|
async (argv) => {
|
|
948093
|
-
|
|
948179
|
+
cliContext.instrumentPostHogEvent({
|
|
948094
948180
|
command: "fern api update"
|
|
948095
948181
|
});
|
|
948096
948182
|
await updateApiSpec({
|
|
@@ -948117,7 +948203,7 @@ function addSelfUpdateCommand(cli, cliContext) {
|
|
|
948117
948203
|
default: false
|
|
948118
948204
|
}),
|
|
948119
948205
|
async (argv) => {
|
|
948120
|
-
|
|
948206
|
+
cliContext.instrumentPostHogEvent({
|
|
948121
948207
|
command: "fern self-update"
|
|
948122
948208
|
});
|
|
948123
948209
|
await selfUpdate({
|
|
@@ -948142,7 +948228,7 @@ function addLoginCommand2(cli, cliContext) {
|
|
|
948142
948228
|
}),
|
|
948143
948229
|
async (argv) => {
|
|
948144
948230
|
await cliContext.runTask(async (context3) => {
|
|
948145
|
-
|
|
948231
|
+
cliContext.instrumentPostHogEvent({
|
|
948146
948232
|
command: "fern login"
|
|
948147
948233
|
});
|
|
948148
948234
|
await login(context3, { useDeviceCodeFlow: argv.deviceCode, email: argv.email });
|
|
@@ -948157,7 +948243,7 @@ function addLogoutCommand2(cli, cliContext) {
|
|
|
948157
948243
|
(yargs) => yargs,
|
|
948158
948244
|
async () => {
|
|
948159
948245
|
await cliContext.runTask(async (context3) => {
|
|
948160
|
-
|
|
948246
|
+
cliContext.instrumentPostHogEvent({
|
|
948161
948247
|
command: "fern logout"
|
|
948162
948248
|
});
|
|
948163
948249
|
await logout(context3);
|
|
@@ -948178,7 +948264,7 @@ function addFormatCommand(cli, cliContext) {
|
|
|
948178
948264
|
description: "Only run the command on the provided API"
|
|
948179
948265
|
}),
|
|
948180
948266
|
async (argv) => {
|
|
948181
|
-
|
|
948267
|
+
cliContext.instrumentPostHogEvent({
|
|
948182
948268
|
command: "fern format"
|
|
948183
948269
|
});
|
|
948184
948270
|
await formatWorkspaces({
|
|
@@ -948207,7 +948293,7 @@ function addTestCommand(cli, cliContext) {
|
|
|
948207
948293
|
description: "Run the tests configured to a specific language"
|
|
948208
948294
|
}),
|
|
948209
948295
|
async (argv) => {
|
|
948210
|
-
|
|
948296
|
+
cliContext.instrumentPostHogEvent({
|
|
948211
948297
|
command: "fern test"
|
|
948212
948298
|
});
|
|
948213
948299
|
await testOutput({
|
|
@@ -948236,7 +948322,7 @@ function addMockCommand(cli, cliContext) {
|
|
|
948236
948322
|
description: "The API to mock."
|
|
948237
948323
|
}),
|
|
948238
948324
|
async (argv) => {
|
|
948239
|
-
|
|
948325
|
+
cliContext.instrumentPostHogEvent({
|
|
948240
948326
|
command: "fern mock"
|
|
948241
948327
|
});
|
|
948242
948328
|
await mockServer({
|
|
@@ -948275,7 +948361,7 @@ function addOverridesCompareCommand(cli, cliContext) {
|
|
|
948275
948361
|
description: "Path to write the overrides file (defaults to <original>-overrides.yml)"
|
|
948276
948362
|
}),
|
|
948277
948363
|
async (argv) => {
|
|
948278
|
-
|
|
948364
|
+
cliContext.instrumentPostHogEvent({
|
|
948279
948365
|
command: "fern overrides compare"
|
|
948280
948366
|
});
|
|
948281
948367
|
const originalPath = resolve6(cwd(), argv.original);
|
|
@@ -948306,7 +948392,7 @@ function addOverridesWriteCommand(cli, cliContext) {
|
|
|
948306
948392
|
})
|
|
948307
948393
|
],
|
|
948308
948394
|
async (argv) => {
|
|
948309
|
-
|
|
948395
|
+
cliContext.instrumentPostHogEvent({
|
|
948310
948396
|
command: "fern overrides write"
|
|
948311
948397
|
});
|
|
948312
948398
|
await writeOverridesForWorkspaces({
|
|
@@ -948338,7 +948424,7 @@ function addWriteOverridesCommand(cli, cliContext) {
|
|
|
948338
948424
|
],
|
|
948339
948425
|
async (argv) => {
|
|
948340
948426
|
cliContext.logger.warn("The 'write-overrides' command is deprecated. Use 'fern overrides write' instead.");
|
|
948341
|
-
|
|
948427
|
+
cliContext.instrumentPostHogEvent({
|
|
948342
948428
|
command: "fern write-overrides"
|
|
948343
948429
|
});
|
|
948344
948430
|
await writeOverridesForWorkspaces({
|
|
@@ -948368,7 +948454,7 @@ function addWriteDefinitionCommand(cli, cliContext) {
|
|
|
948368
948454
|
}),
|
|
948369
948455
|
async (argv) => {
|
|
948370
948456
|
const preserveSchemaIds = argv.preserveSchemas != null;
|
|
948371
|
-
|
|
948457
|
+
cliContext.instrumentPostHogEvent({
|
|
948372
948458
|
command: "fern write-definition"
|
|
948373
948459
|
});
|
|
948374
948460
|
await writeDefinitionForWorkspaces({
|
|
@@ -948411,7 +948497,7 @@ function addDocsMdGenerateCommand(cli, cliContext) {
|
|
|
948411
948497
|
description: "Name of a specific library defined in docs.yml to generate docs for"
|
|
948412
948498
|
}),
|
|
948413
948499
|
async (argv) => {
|
|
948414
|
-
|
|
948500
|
+
cliContext.instrumentPostHogEvent({
|
|
948415
948501
|
command: "fern docs md generate"
|
|
948416
948502
|
});
|
|
948417
948503
|
const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
@@ -948445,7 +948531,7 @@ function addDocsDiffCommand(cli, cliContext) {
|
|
|
948445
948531
|
description: "Output directory for diff images"
|
|
948446
948532
|
}),
|
|
948447
948533
|
async (argv) => {
|
|
948448
|
-
|
|
948534
|
+
cliContext.instrumentPostHogEvent({
|
|
948449
948535
|
command: "fern docs diff"
|
|
948450
948536
|
});
|
|
948451
948537
|
const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
@@ -948482,7 +948568,7 @@ function addDocsPreviewListCommand(cli, cliContext) {
|
|
|
948482
948568
|
description: "Page number for pagination (starts at 1)"
|
|
948483
948569
|
}),
|
|
948484
948570
|
async (argv) => {
|
|
948485
|
-
|
|
948571
|
+
cliContext.instrumentPostHogEvent({
|
|
948486
948572
|
command: "fern docs preview list"
|
|
948487
948573
|
});
|
|
948488
948574
|
await listDocsPreview({
|
|
@@ -948503,7 +948589,7 @@ function addDocsPreviewDeleteCommand(cli, cliContext) {
|
|
|
948503
948589
|
demandOption: true
|
|
948504
948590
|
}),
|
|
948505
948591
|
async (argv) => {
|
|
948506
|
-
|
|
948592
|
+
cliContext.instrumentPostHogEvent({
|
|
948507
948593
|
command: "fern docs preview delete"
|
|
948508
948594
|
});
|
|
948509
948595
|
await deleteDocsPreview({
|
|
@@ -948606,7 +948692,7 @@ function addDocsMdCheckCommand(cli, cliContext) {
|
|
|
948606
948692
|
() => {
|
|
948607
948693
|
},
|
|
948608
948694
|
async () => {
|
|
948609
|
-
|
|
948695
|
+
cliContext.instrumentPostHogEvent({
|
|
948610
948696
|
command: "fern docs md check"
|
|
948611
948697
|
});
|
|
948612
948698
|
const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
@@ -948651,7 +948737,7 @@ function addGenerateJsonschemaCommand(cli, cliContext) {
|
|
|
948651
948737
|
description: "The type to generate JSON Schema for (e.g. 'MySchema' or 'mypackage.MySchema')"
|
|
948652
948738
|
}),
|
|
948653
948739
|
async (argv) => {
|
|
948654
|
-
|
|
948740
|
+
cliContext.instrumentPostHogEvent({
|
|
948655
948741
|
command: "fern jsonschema",
|
|
948656
948742
|
properties: {
|
|
948657
948743
|
output: argv.output
|
|
@@ -948680,7 +948766,7 @@ function addWriteDocsDefinitionCommand(cli, cliContext) {
|
|
|
948680
948766
|
demandOption: true
|
|
948681
948767
|
}),
|
|
948682
948768
|
async (argv) => {
|
|
948683
|
-
|
|
948769
|
+
cliContext.instrumentPostHogEvent({
|
|
948684
948770
|
command: "fern write-docs-definition",
|
|
948685
948771
|
properties: {
|
|
948686
948772
|
outputPath: argv.outputPath
|
|
@@ -948708,7 +948794,7 @@ function addWriteTranslationCommand(cli, cliContext) {
|
|
|
948708
948794
|
description: "Return content as-is without calling the translation service"
|
|
948709
948795
|
}),
|
|
948710
948796
|
async (argv) => {
|
|
948711
|
-
|
|
948797
|
+
cliContext.instrumentPostHogEvent({
|
|
948712
948798
|
command: "fern write-translation"
|
|
948713
948799
|
});
|
|
948714
948800
|
await writeTranslationForProject({
|
|
@@ -948739,7 +948825,7 @@ function addExportCommand(cli, cliContext) {
|
|
|
948739
948825
|
default: 2
|
|
948740
948826
|
}),
|
|
948741
948827
|
async (argv) => {
|
|
948742
|
-
|
|
948828
|
+
cliContext.instrumentPostHogEvent({
|
|
948743
948829
|
command: "fern export",
|
|
948744
948830
|
properties: {
|
|
948745
948831
|
outputPath: argv.outputPath
|
|
@@ -948777,7 +948863,7 @@ function addEnrichCommand(cli, cliContext) {
|
|
|
948777
948863
|
demandOption: true
|
|
948778
948864
|
}),
|
|
948779
948865
|
async (argv) => {
|
|
948780
|
-
|
|
948866
|
+
cliContext.instrumentPostHogEvent({
|
|
948781
948867
|
command: "fern api enrich"
|
|
948782
948868
|
});
|
|
948783
948869
|
const openapiPath = resolve6(cwd(), argv.openapi);
|
|
@@ -948957,7 +949043,7 @@ function addSdkPreviewCommand(cli, cliContext) {
|
|
|
948957
949043
|
description: "Push a preview diff branch (fern-preview-{version}) to the SDK repo in addition to publishing to the preview registry. Requires the generator to have github output configuration and the Fern GitHub App installed on the target repo. Cannot be combined with --local."
|
|
948958
949044
|
}),
|
|
948959
949045
|
async (argv) => {
|
|
948960
|
-
|
|
949046
|
+
cliContext.instrumentPostHogEvent({
|
|
948961
949047
|
command: "fern sdk preview"
|
|
948962
949048
|
});
|
|
948963
949049
|
const generatorFilter = argv.generator != null ? warnAndCorrectIncorrectDockerOrg(argv.generator, cliContext) : void 0;
|
|
@@ -949101,7 +949187,7 @@ function addReplayInitCommand(cli, cliContext) {
|
|
|
949101
949187
|
description: "Overwrite existing lockfile if Replay is already initialized"
|
|
949102
949188
|
}),
|
|
949103
949189
|
async (argv) => {
|
|
949104
|
-
|
|
949190
|
+
cliContext.instrumentPostHogEvent({
|
|
949105
949191
|
command: "fern replay init"
|
|
949106
949192
|
});
|
|
949107
949193
|
let githubRepo = argv.github;
|
|
@@ -949202,7 +949288,7 @@ function addReplayResolveCommand(cli, cliContext) {
|
|
|
949202
949288
|
description: "Skip checking for remaining conflict markers before committing"
|
|
949203
949289
|
}),
|
|
949204
949290
|
async (argv) => {
|
|
949205
|
-
|
|
949291
|
+
cliContext.instrumentPostHogEvent({
|
|
949206
949292
|
command: "fern replay resolve"
|
|
949207
949293
|
});
|
|
949208
949294
|
const outputDir = resolve6(cwd(), argv.directory ?? ".");
|
package/package.json
CHANGED