@fern-api/fern-api-dev 4.67.1 → 4.68.0-2-g6060219ac9f

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.
Files changed (2) hide show
  1. package/cli.cjs +240 -142
  2. 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.3/node_modules/@fern-api/replay/dist/index.cjs
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.3/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
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
- const parents = await this.git.getCommitParents(commit.sha);
363912
- if (parents.length > 1) {
363912
+ if (lock.patches.find((p10) => p10.original_commit === commit.sha)) {
363913
363913
  continue;
363914
363914
  }
363915
- if (lock.patches.find((p10) => p10.original_commit === commit.sha)) {
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.1/node_modules/basic-ftp/dist/parseControlResponse.js
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.1/node_modules/basic-ftp/dist/parseControlResponse.js"(exports2) {
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.1/node_modules/basic-ftp/dist/FtpContext.js
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.1/node_modules/basic-ftp/dist/FtpContext.js"(exports2) {
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.1/node_modules/basic-ftp/dist/FileInfo.js
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.1/node_modules/basic-ftp/dist/FileInfo.js"(exports2) {
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.1/node_modules/basic-ftp/dist/parseListDOS.js
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.1/node_modules/basic-ftp/dist/parseListDOS.js"(exports2) {
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.1/node_modules/basic-ftp/dist/parseListUnix.js
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.1/node_modules/basic-ftp/dist/parseListUnix.js"(exports2) {
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.1/node_modules/basic-ftp/dist/parseListMLSD.js
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.1/node_modules/basic-ftp/dist/parseListMLSD.js"(exports2) {
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.1/node_modules/basic-ftp/dist/parseList.js
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.1/node_modules/basic-ftp/dist/parseList.js"(exports2) {
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.1/node_modules/basic-ftp/dist/ProgressTracker.js
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.1/node_modules/basic-ftp/dist/ProgressTracker.js"(exports2) {
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.1/node_modules/basic-ftp/dist/StringWriter.js
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.1/node_modules/basic-ftp/dist/StringWriter.js"(exports2) {
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.1/node_modules/basic-ftp/dist/netUtils.js
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.1/node_modules/basic-ftp/dist/netUtils.js"(exports2) {
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.1/node_modules/basic-ftp/dist/transfer.js
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.1/node_modules/basic-ftp/dist/transfer.js"(exports2) {
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.1/node_modules/basic-ftp/dist/Client.js
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.1/node_modules/basic-ftp/dist/Client.js"(exports2) {
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.1/node_modules/basic-ftp/dist/StringEncoding.js
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.1/node_modules/basic-ftp/dist/StringEncoding.js"(exports2) {
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.1/node_modules/basic-ftp/dist/index.js
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.1/node_modules/basic-ftp/dist/index.js"(exports2) {
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
- channel;
611869
+ node;
611811
611870
  key = "x-fern-display-name";
611812
- constructor({ breadcrumbs, channel: channel3, context: context3 }) {
611871
+ constructor({ breadcrumbs, node: node4, context: context3 }) {
611813
611872
  super({ breadcrumbs, context: context3 });
611814
- this.channel = channel3;
611873
+ this.node = node4;
611815
611874
  }
611816
611875
  convert() {
611817
- const extensionValue = this.getExtensionValue(this.channel);
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 displayNameExtension = new DisplayNameExtension({
611911
+ const channelDisplayNameExtension = new DisplayNameExtension({
611853
611912
  breadcrumbs: this.breadcrumbs,
611854
- channel: this.channel,
611913
+ node: this.channel,
611855
611914
  context: this.context
611856
611915
  });
611857
- const displayName = displayNameExtension.convert() ?? this.websocketGroup?.join(".");
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: messageType,
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 displayNameExtension = new DisplayNameExtension({
612256
+ const channelDisplayNameExtension = new DisplayNameExtension({
612192
612257
  breadcrumbs: this.breadcrumbs,
612193
- channel: this.channel,
612258
+ node: this.channel,
612194
612259
  context: this.context
612195
612260
  });
612196
- const displayName = displayNameExtension.convert() ?? this.websocketGroup?.join(".") ?? this.channelPath;
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: operationId,
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
- async instrumentPostHogEvent(_event) {
619473
+ instrumentPostHogEvent(_event) {
619403
619474
  }
619404
619475
  formatError(error50) {
619405
619476
  if (error50 == null) {
@@ -627553,14 +627624,17 @@ var AccessTokenPosthogManager = class {
627553
627624
  properties: {
627554
627625
  ...event,
627555
627626
  ...event.properties,
627556
- version: "4.67.1",
627627
+ version: "4.68.0-2-g6060219ac9f",
627557
627628
  usingAccessToken: true
627558
627629
  }
627559
627630
  });
627560
627631
  }
627561
627632
  }
627562
627633
  async flush() {
627563
- await this.posthog.flush();
627634
+ try {
627635
+ await Promise.race([this.posthog.flush(), new Promise((resolve13) => setTimeout(resolve13, 3e3))]);
627636
+ } catch {
627637
+ }
627564
627638
  }
627565
627639
  };
627566
627640
 
@@ -627604,7 +627678,7 @@ var UserPosthogManager = class {
627604
627678
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
627605
627679
  event: "CLI",
627606
627680
  properties: {
627607
- version: "4.67.1",
627681
+ version: "4.68.0-2-g6060219ac9f",
627608
627682
  ...event,
627609
627683
  ...event.properties,
627610
627684
  usingAccessToken: false,
@@ -627613,7 +627687,10 @@ var UserPosthogManager = class {
627613
627687
  });
627614
627688
  }
627615
627689
  async flush() {
627616
- await this.posthog.flush();
627690
+ try {
627691
+ await Promise.race([this.posthog.flush(), new Promise((resolve13) => setTimeout(resolve13, 3e3))]);
627692
+ } catch {
627693
+ }
627617
627694
  }
627618
627695
  userEmail;
627619
627696
  async getUserEmail() {
@@ -628683,7 +628760,7 @@ var DASHBOARD_BASE_URL = "https://dashboard-dev.buildwithfern.com";
628683
628760
 
628684
628761
  // ../login/lib/login.js
628685
628762
  async function login(context3, { useDeviceCodeFlow = false, email: email3 } = {}) {
628686
- await context3.instrumentPostHogEvent({
628763
+ context3.instrumentPostHogEvent({
628687
628764
  command: "Login initiated"
628688
628765
  });
628689
628766
  const { accessToken } = await getTokenFromAuth0(context3, { useDeviceCodeFlow, email: email3 });
@@ -628763,7 +628840,7 @@ async function askForConfirmation(message) {
628763
628840
  // ../login/lib/logout.js
628764
628841
  var import_open3 = __toESM(require_open(), 1);
628765
628842
  async function logout(context3) {
628766
- await context3.instrumentPostHogEvent({
628843
+ context3.instrumentPostHogEvent({
628767
628844
  command: "Logout initiated"
628768
628845
  });
628769
628846
  const wasLoggedIn = await isLoggedIn();
@@ -628780,7 +628857,7 @@ async function logout(context3) {
628780
628857
  } catch (error50) {
628781
628858
  context3.logger.warn(source_default.yellow("Could not open browser automatically. Please visit this URL to complete logout:\n" + logoutUrl));
628782
628859
  }
628783
- await context3.instrumentPostHogEvent({
628860
+ context3.instrumentPostHogEvent({
628784
628861
  command: "Logout successful"
628785
628862
  });
628786
628863
  }
@@ -631028,13 +631105,18 @@ var import_path46 = require("path");
631028
631105
  var Version2 = "*";
631029
631106
 
631030
631107
  // ../cli-v2/lib/telemetry/TelemetryClient.js
631031
- var TelemetryClient = class {
631108
+ var TelemetryClient = class _TelemetryClient {
631032
631109
  posthog;
631033
631110
  sentry;
631034
631111
  baseTags;
631035
631112
  accumulatedTags = {};
631036
- cachedDistinctId;
631037
- constructor({ isTTY }) {
631113
+ distinctId;
631114
+ static async create({ isTTY }) {
631115
+ const distinctId = await _TelemetryClient.getDistinctId();
631116
+ return new _TelemetryClient({ isTTY, distinctId });
631117
+ }
631118
+ constructor({ isTTY, distinctId }) {
631119
+ this.distinctId = distinctId;
631038
631120
  const isTelemetryEnabled = this.isTelemetryEnabled();
631039
631121
  const apiKey = null;
631040
631122
  this.baseTags = {
@@ -631064,13 +631146,13 @@ var TelemetryClient = class {
631064
631146
  }
631065
631147
  }
631066
631148
  /** Send a named event that inherits base + accumulated properties. */
631067
- async sendEvent(event, tags) {
631149
+ sendEvent(event, tags) {
631068
631150
  if (this.posthog == null) {
631069
631151
  return;
631070
631152
  }
631071
631153
  try {
631072
631154
  this.posthog.capture({
631073
- distinctId: await this.getDistinctId(),
631155
+ distinctId: this.distinctId,
631074
631156
  event,
631075
631157
  properties: { ...this.baseTags, ...this.accumulatedTags, ...tags }
631076
631158
  });
@@ -631081,13 +631163,13 @@ var TelemetryClient = class {
631081
631163
  *
631082
631164
  * This is not meant to be called directly by command handlers.
631083
631165
  */
631084
- async sendLifecycleEvent(event) {
631166
+ sendLifecycleEvent(event) {
631085
631167
  if (this.posthog == null) {
631086
631168
  return;
631087
631169
  }
631088
631170
  try {
631089
631171
  this.posthog.capture({
631090
- distinctId: await this.getDistinctId(),
631172
+ distinctId: this.distinctId,
631091
631173
  event: "cli",
631092
631174
  properties: {
631093
631175
  ...this.baseTags,
@@ -631108,14 +631190,14 @@ var TelemetryClient = class {
631108
631190
  * The caller is responsible for deciding which errors are worth reporting
631109
631191
  * (see `shouldReportToSentry` in withContext.ts).
631110
631192
  */
631111
- async captureException(error50) {
631193
+ captureException(error50) {
631112
631194
  if (this.sentry === void 0) {
631113
631195
  return;
631114
631196
  }
631115
631197
  try {
631116
631198
  this.sentry.captureException(error50, {
631117
631199
  captureContext: {
631118
- user: { id: await this.getDistinctId() },
631200
+ user: { id: this.distinctId },
631119
631201
  tags: { ...this.baseTags, ...this.accumulatedTags }
631120
631202
  }
631121
631203
  });
@@ -631125,37 +631207,38 @@ var TelemetryClient = class {
631125
631207
  async flush() {
631126
631208
  const promises = [];
631127
631209
  if (this.posthog != null) {
631128
- promises.push(this.posthog.shutdown().catch(() => void 0));
631210
+ promises.push(Promise.race([
631211
+ this.posthog.shutdown().catch(() => void 0),
631212
+ new Promise((resolve13) => setTimeout(resolve13, 3e3))
631213
+ ]));
631129
631214
  }
631130
631215
  if (this.sentry !== void 0) {
631131
631216
  promises.push(Promise.resolve(this.sentry.flush(2e3)).catch(() => void 0));
631132
631217
  }
631133
631218
  await Promise.all(promises);
631134
631219
  }
631135
- async getDistinctId() {
631136
- if (this.cachedDistinctId != null) {
631137
- return this.cachedDistinctId;
631138
- }
631139
- const distinctIdFilepath = this.getDistinctIdFilepath();
631220
+ static async getDistinctId() {
631221
+ const distinctIdFilepath = _TelemetryClient.getDistinctIdFilepath();
631222
+ let distinctId = null;
631140
631223
  try {
631141
631224
  if (!await doesPathExist(distinctIdFilepath)) {
631142
631225
  await (0, import_promises49.mkdir)((0, import_path46.dirname)(distinctIdFilepath), { recursive: true });
631143
631226
  await (0, import_promises49.writeFile)(distinctIdFilepath, v4_default(), { flag: "wx" });
631144
631227
  }
631145
631228
  const content5 = (await (0, import_promises49.readFile)(distinctIdFilepath)).toString().trim();
631146
- this.cachedDistinctId = content5;
631229
+ distinctId = content5;
631147
631230
  if (!validate_default(content5)) {
631148
631231
  const newId = v4_default();
631149
631232
  await (0, import_promises49.writeFile)(distinctIdFilepath, newId);
631150
- this.cachedDistinctId = newId;
631233
+ distinctId = newId;
631151
631234
  }
631152
631235
  } catch {
631153
- this.cachedDistinctId = v4_default();
631236
+ distinctId = v4_default();
631154
631237
  }
631155
- if (this.cachedDistinctId == null || this.cachedDistinctId.length === 0) {
631156
- this.cachedDistinctId = v4_default();
631238
+ if (distinctId == null || distinctId.length === 0) {
631239
+ distinctId = v4_default();
631157
631240
  }
631158
- return this.cachedDistinctId;
631241
+ return distinctId;
631159
631242
  }
631160
631243
  /**
631161
631244
  * The file that stores the distinct ID for the user (stored in ~/.fern/id).
@@ -631163,7 +631246,7 @@ var TelemetryClient = class {
631163
631246
  * Note that all telemetry is anonymous, but we still use a shared distinct ID
631164
631247
  * to correlate metrics from the same user/machine across multiple CLI invocations.
631165
631248
  */
631166
- getDistinctIdFilepath() {
631249
+ static getDistinctIdFilepath() {
631167
631250
  return join8(AbsoluteFilePath2.of((0, import_os8.homedir)()), RelativeFilePath2.of(".fern"), RelativeFilePath2.of("id"));
631168
631251
  }
631169
631252
  /**
@@ -632011,7 +632094,7 @@ ${"=".repeat(60)}
632011
632094
  };
632012
632095
 
632013
632096
  // ../cli-v2/lib/context/Context.js
632014
- var Context = class {
632097
+ var Context = class _Context {
632015
632098
  shutdownCallbacks = [];
632016
632099
  isShuttingDown = false;
632017
632100
  logFilePathPrinted = false;
@@ -632025,7 +632108,12 @@ var Context = class {
632025
632108
  telemetry;
632026
632109
  tokenService;
632027
632110
  ttyAwareLogger;
632028
- constructor({ stdout, stderr, cwd: cwd2, logLevel }) {
632111
+ static async create({ stdout, stderr, cwd: cwd2, logLevel }) {
632112
+ const ttyAwareLogger = new TtyAwareLogger(stdout, stderr);
632113
+ const telemetry = await TelemetryClient.create({ isTTY: ttyAwareLogger.isTTY });
632114
+ return new _Context({ stdout, stderr, cwd: cwd2, logLevel, ttyAwareLogger, telemetry });
632115
+ }
632116
+ constructor({ cwd: cwd2, logLevel, ttyAwareLogger, telemetry }) {
632029
632117
  this.cwd = cwd2 ?? AbsoluteFilePath2.of(process.cwd());
632030
632118
  this.logLevel = logLevel ?? LogLevel2.Info;
632031
632119
  this.info = parseCommandInfo(process.argv);
@@ -632033,8 +632121,8 @@ var Context = class {
632033
632121
  this.stderr = createLogger4((level, ...args) => this.logStderr(level, ...args));
632034
632122
  this.cache = new Cache({ logger: this.stderr });
632035
632123
  this.logs = new LogFileWriter(this.cache.logs.absoluteFilePath);
632036
- this.ttyAwareLogger = new TtyAwareLogger(stdout, stderr);
632037
- this.telemetry = new TelemetryClient({ isTTY: this.isTTY });
632124
+ this.ttyAwareLogger = ttyAwareLogger;
632125
+ this.telemetry = telemetry;
632038
632126
  this.tokenService = new TokenService({ credential: new CredentialStore() });
632039
632127
  }
632040
632128
  /**
@@ -632274,12 +632362,12 @@ var SIGINT_EXIT_CODE = SIGNAL_EXIT_CODE_BASE + 2;
632274
632362
  var SIGTERM_EXIT_CODE = SIGNAL_EXIT_CODE_BASE + 15;
632275
632363
  function withContext(handler3) {
632276
632364
  return async (args) => {
632277
- const context3 = createContext(args);
632365
+ const context3 = await createContext(args);
632278
632366
  const startTime = Date.now();
632279
632367
  setupSignalHandler(context3);
632280
632368
  try {
632281
632369
  await handler3(context3, args);
632282
- await context3.telemetry.sendLifecycleEvent({
632370
+ context3.telemetry.sendLifecycleEvent({
632283
632371
  command: context3.info.command,
632284
632372
  status: "success",
632285
632373
  durationMs: Date.now() - startTime
@@ -632289,9 +632377,9 @@ function withContext(handler3) {
632289
632377
  await exitGracefully(0);
632290
632378
  } catch (error50) {
632291
632379
  if (shouldReportToSentry(error50)) {
632292
- await context3.telemetry.captureException(error50);
632380
+ context3.telemetry.captureException(error50);
632293
632381
  }
632294
- await context3.telemetry.sendLifecycleEvent({
632382
+ context3.telemetry.sendLifecycleEvent({
632295
632383
  command: context3.info.command,
632296
632384
  status: "error",
632297
632385
  durationMs: Date.now() - startTime,
@@ -632304,9 +632392,9 @@ function withContext(handler3) {
632304
632392
  }
632305
632393
  };
632306
632394
  }
632307
- function createContext(options2) {
632395
+ async function createContext(options2) {
632308
632396
  const logLevel = parseLogLevel(options2["log-level"] ?? "info");
632309
- return new Context({
632397
+ return Context.create({
632310
632398
  stdout: process.stdout,
632311
632399
  stderr: process.stderr,
632312
632400
  logLevel
@@ -843865,7 +843953,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
843865
843953
  var LOGS_FOLDER_NAME = "logs";
843866
843954
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
843867
843955
  function getCliSource() {
843868
- const version7 = "4.67.1";
843956
+ const version7 = "4.68.0-2-g6060219ac9f";
843869
843957
  return `cli@${version7}`;
843870
843958
  }
843871
843959
  var DebugLogger = class {
@@ -854517,7 +854605,7 @@ function convertToFilePathPairs(uploadUrls, docsWorkspacePath, sanitizedToAbsolu
854517
854605
  return toRet;
854518
854606
  }
854519
854607
  async function startDocsRegisterFailed(error50, context3, organization, domain3) {
854520
- await context3.instrumentPostHogEvent({
854608
+ context3.instrumentPostHogEvent({
854521
854609
  command: "docs-generation",
854522
854610
  properties: {
854523
854611
  error: JSON.stringify(error50)
@@ -855113,7 +855201,7 @@ var LegacyDocsPublisher = class {
855113
855201
  previewId,
855114
855202
  disableTemplates: void 0,
855115
855203
  skipUpload,
855116
- cliVersion: "4.67.1"
855204
+ cliVersion: "4.68.0-2-g6060219ac9f"
855117
855205
  });
855118
855206
  if (taskContext.getResult() === TaskResult.Failure) {
855119
855207
  return { success: false };
@@ -889247,7 +889335,9 @@ var DynamicTypeLiteralMapper3 = class {
889247
889335
  object_: named,
889248
889336
  value: discriminatedUnionTypeInstance.value
889249
889337
  });
889250
- return [...baseFields, ...objectEntries];
889338
+ const baseFieldNames = new Set(baseFields.map((f10) => f10.name));
889339
+ const filteredObjectEntries = objectEntries.filter((entry) => !baseFieldNames.has(entry.name));
889340
+ return [...baseFields, ...filteredObjectEntries];
889251
889341
  }
889252
889342
  case "singleProperty": {
889253
889343
  try {
@@ -928408,8 +928498,8 @@ var TaskContextImpl = class {
928408
928498
  getResult() {
928409
928499
  return this.result;
928410
928500
  }
928411
- async instrumentPostHogEvent(event) {
928412
- await this.instrumentPostHogEventImpl(event);
928501
+ instrumentPostHogEvent(event) {
928502
+ this.instrumentPostHogEventImpl(event);
928413
928503
  }
928414
928504
  logAtLevel(level, ...parts) {
928415
928505
  this.logAtLevelWithOverrides(level, parts);
@@ -928445,7 +928535,7 @@ var TaskContextImpl = class {
928445
928535
  takeOverTerminal: this.takeOverTerminal,
928446
928536
  onResult: this.onResult,
928447
928537
  shouldBufferLogs: this.shouldBufferLogs,
928448
- instrumentPostHogEvent: async (event) => await this.instrumentPostHogEventImpl(event)
928538
+ instrumentPostHogEvent: (event) => this.instrumentPostHogEventImpl(event)
928449
928539
  });
928450
928540
  this.subtasks.push(subtask);
928451
928541
  return subtask;
@@ -928811,9 +928901,10 @@ async function getLatestVersionOfCli({
928811
928901
 
928812
928902
  // src/cli-context/CliContext.ts
928813
928903
  var WORKSPACE_NAME_COLORS = ["#2E86AB", "#A23B72", "#F18F01", "#C73E1D", "#CCE2A3"];
928814
- var CliContext = class {
928904
+ var CliContext = class _CliContext {
928815
928905
  environment;
928816
928906
  sentryClient;
928907
+ posthogManager;
928817
928908
  didSucceed = true;
928818
928909
  numTasks = 0;
928819
928910
  ttyAwareLogger;
@@ -928821,9 +928912,14 @@ var CliContext = class {
928821
928912
  isLocal;
928822
928913
  stdoutRedirector = new StdoutRedirector();
928823
928914
  jsonMode = false;
928824
- constructor(stdout, stderr, { isLocal }) {
928915
+ static async create(stdout, stderr, { isLocal }) {
928916
+ const posthogManager2 = await getPosthogManager();
928917
+ return new _CliContext(stdout, stderr, { isLocal, posthogManager: posthogManager2 });
928918
+ }
928919
+ constructor(stdout, stderr, { isLocal, posthogManager: posthogManager2 }) {
928825
928920
  this.ttyAwareLogger = new TtyAwareLogger(stdout, stderr);
928826
928921
  this.isLocal = isLocal ?? false;
928922
+ this.posthogManager = posthogManager2;
928827
928923
  const packageName = this.getPackageName();
928828
928924
  const packageVersion3 = this.getPackageVersion();
928829
928925
  const cliName = this.getCliName();
@@ -928847,7 +928943,7 @@ var CliContext = class {
928847
928943
  if (false) {
928848
928944
  this.logger.error("CLI_VERSION is not defined");
928849
928945
  }
928850
- return "4.67.1";
928946
+ return "4.68.0-2-g6060219ac9f";
928851
928947
  }
928852
928948
  getCliName() {
928853
928949
  if (false) {
@@ -928903,8 +928999,10 @@ var CliContext = class {
928903
928999
  await this.nudgeUpgradeIfAvailable();
928904
929000
  }
928905
929001
  this.ttyAwareLogger.finish();
928906
- const posthogManager2 = await getPosthogManager();
928907
- await posthogManager2.flush();
929002
+ try {
929003
+ await this.posthogManager.flush();
929004
+ } catch {
929005
+ }
928908
929006
  await this.sentryClient.flush();
928909
929007
  this.exitProgram({ code: code5 });
928910
929008
  }
@@ -928985,9 +929083,9 @@ var CliContext = class {
928985
929083
  }
928986
929084
  return result;
928987
929085
  }
928988
- async instrumentPostHogEvent(event) {
929086
+ instrumentPostHogEvent(event) {
928989
929087
  if (!this.isLocal) {
928990
- (await getPosthogManager()).sendEvent(event);
929088
+ this.posthogManager.sendEvent(event);
928991
929089
  }
928992
929090
  }
928993
929091
  async captureException(error50) {
@@ -929017,8 +929115,8 @@ var CliContext = class {
929017
929115
  this.didSucceed = false;
929018
929116
  }
929019
929117
  },
929020
- instrumentPostHogEvent: async (event) => {
929021
- await this.instrumentPostHogEvent(event);
929118
+ instrumentPostHogEvent: (event) => {
929119
+ this.instrumentPostHogEvent(event);
929022
929120
  },
929023
929121
  shouldBufferLogs: false
929024
929122
  };
@@ -930095,7 +930193,7 @@ function addGetOrganizationCommand(cli, cliContext) {
930095
930193
  description: "The location to output the organization name as a text file, defaults to standard out."
930096
930194
  }),
930097
930195
  async (argv) => {
930098
- await cliContext.instrumentPostHogEvent({
930196
+ cliContext.instrumentPostHogEvent({
930099
930197
  command: "fern organization",
930100
930198
  properties: {
930101
930199
  outputLocation: argv.output
@@ -930149,7 +930247,7 @@ function addGeneratorCommands(cli, cliContext) {
930149
930247
  description: "The generator output modes to exclude within the outputted list."
930150
930248
  }),
930151
930249
  async (argv) => {
930152
- await cliContext.instrumentPostHogEvent({
930250
+ cliContext.instrumentPostHogEvent({
930153
930251
  command: "fern generator list",
930154
930252
  properties: {
930155
930253
  outputLocation: argv.output
@@ -930206,7 +930304,7 @@ function addGeneratorCommands(cli, cliContext) {
930206
930304
  description: "Skip upgrading generators that have autorelease: false set in their configuration."
930207
930305
  }),
930208
930306
  async (argv) => {
930209
- await cliContext.instrumentPostHogEvent({
930307
+ cliContext.instrumentPostHogEvent({
930210
930308
  command: "fern generator upgrade",
930211
930309
  properties: {
930212
930310
  generator: argv.generator,
@@ -930289,7 +930387,7 @@ function addGeneratorCommands(cli, cliContext) {
930289
930387
  }),
930290
930388
  async (argv) => {
930291
930389
  const correctedGetGenerator = warnAndCorrectIncorrectDockerOrgV2(argv.generator, cliContext);
930292
- await cliContext.instrumentPostHogEvent({
930390
+ cliContext.instrumentPostHogEvent({
930293
930391
  command: "fern generator get",
930294
930392
  properties: {
930295
930393
  generator: correctedGetGenerator,
@@ -930648,7 +930746,7 @@ async function previewDocsWorkspace({
930648
930746
  return;
930649
930747
  }
930650
930748
  if (legacyPreview) {
930651
- await cliContext.instrumentPostHogEvent({
930749
+ cliContext.instrumentPostHogEvent({
930652
930750
  orgId: project.config.organization,
930653
930751
  command: "fern docs dev --legacy"
930654
930752
  });
@@ -930693,7 +930791,7 @@ async function previewDocsWorkspace({
930693
930791
  });
930694
930792
  });
930695
930793
  }
930696
- await cliContext.instrumentPostHogEvent({
930794
+ cliContext.instrumentPostHogEvent({
930697
930795
  orgId: project.config.organization,
930698
930796
  command: "fern docs dev --beta"
930699
930797
  });
@@ -938400,7 +938498,7 @@ async function generateAPIWorkspaces({
938400
938498
  }
938401
938499
  }
938402
938500
  }
938403
- await cliContext.instrumentPostHogEvent({
938501
+ cliContext.instrumentPostHogEvent({
938404
938502
  orgId: project.config.organization,
938405
938503
  command: "fern generate",
938406
938504
  properties: {
@@ -938651,7 +938749,7 @@ ${source_default.yellow("?")} Are you sure you want to continue?`,
938651
938749
  }
938652
938750
  }
938653
938751
  }
938654
- await cliContext.instrumentPostHogEvent({
938752
+ cliContext.instrumentPostHogEvent({
938655
938753
  orgId: project.config.organization,
938656
938754
  command: "fern generate --docs"
938657
938755
  });
@@ -940314,7 +940412,7 @@ async function mockServer({
940314
940412
  project,
940315
940413
  port
940316
940414
  }) {
940317
- await cliContext.instrumentPostHogEvent({
940415
+ cliContext.instrumentPostHogEvent({
940318
940416
  orgId: project.config.organization,
940319
940417
  command: "fern mock"
940320
940418
  });
@@ -941276,7 +941374,7 @@ async function testOutput({
941276
941374
  testCommand,
941277
941375
  generationLanguage
941278
941376
  }) {
941279
- await cliContext.instrumentPostHogEvent({
941377
+ cliContext.instrumentPostHogEvent({
941280
941378
  orgId: project.config.organization,
941281
941379
  command: "fern test"
941282
941380
  });
@@ -947025,7 +947123,7 @@ var USE_NODE_18_OR_ABOVE_MESSAGE = "The Fern CLI requires Node 18+ or above.";
947025
947123
  async function runCli() {
947026
947124
  getOrCreateFernRunId();
947027
947125
  const isLocal = process.argv.includes("--local");
947028
- const cliContext = new CliContext(process.stdout, process.stderr, { isLocal });
947126
+ const cliContext = await CliContext.create(process.stdout, process.stderr, { isLocal });
947029
947127
  const exit3 = async () => {
947030
947128
  await cliContext.exit();
947031
947129
  };
@@ -947059,7 +947157,7 @@ async function runCli() {
947059
947157
  });
947060
947158
  }
947061
947159
  } catch (error50) {
947062
- await cliContext.instrumentPostHogEvent({
947160
+ cliContext.instrumentPostHogEvent({
947063
947161
  command: process.argv.join(" "),
947064
947162
  properties: {
947065
947163
  failed: true,
@@ -947393,7 +947491,7 @@ function addSdkDiffCommand(cli, cliContext) {
947393
947491
  description: "Output result as JSON"
947394
947492
  }),
947395
947493
  async (argv) => {
947396
- await cliContext.instrumentPostHogEvent({
947494
+ cliContext.instrumentPostHogEvent({
947397
947495
  command: "fern sdk-diff"
947398
947496
  });
947399
947497
  const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
@@ -948090,7 +948188,7 @@ function addUpdateApiSpecCommand(cli, cliContext) {
948090
948188
  default: 2
948091
948189
  }),
948092
948190
  async (argv) => {
948093
- await cliContext.instrumentPostHogEvent({
948191
+ cliContext.instrumentPostHogEvent({
948094
948192
  command: "fern api update"
948095
948193
  });
948096
948194
  await updateApiSpec({
@@ -948117,7 +948215,7 @@ function addSelfUpdateCommand(cli, cliContext) {
948117
948215
  default: false
948118
948216
  }),
948119
948217
  async (argv) => {
948120
- await cliContext.instrumentPostHogEvent({
948218
+ cliContext.instrumentPostHogEvent({
948121
948219
  command: "fern self-update"
948122
948220
  });
948123
948221
  await selfUpdate({
@@ -948142,7 +948240,7 @@ function addLoginCommand2(cli, cliContext) {
948142
948240
  }),
948143
948241
  async (argv) => {
948144
948242
  await cliContext.runTask(async (context3) => {
948145
- await cliContext.instrumentPostHogEvent({
948243
+ cliContext.instrumentPostHogEvent({
948146
948244
  command: "fern login"
948147
948245
  });
948148
948246
  await login(context3, { useDeviceCodeFlow: argv.deviceCode, email: argv.email });
@@ -948157,7 +948255,7 @@ function addLogoutCommand2(cli, cliContext) {
948157
948255
  (yargs) => yargs,
948158
948256
  async () => {
948159
948257
  await cliContext.runTask(async (context3) => {
948160
- await cliContext.instrumentPostHogEvent({
948258
+ cliContext.instrumentPostHogEvent({
948161
948259
  command: "fern logout"
948162
948260
  });
948163
948261
  await logout(context3);
@@ -948178,7 +948276,7 @@ function addFormatCommand(cli, cliContext) {
948178
948276
  description: "Only run the command on the provided API"
948179
948277
  }),
948180
948278
  async (argv) => {
948181
- await cliContext.instrumentPostHogEvent({
948279
+ cliContext.instrumentPostHogEvent({
948182
948280
  command: "fern format"
948183
948281
  });
948184
948282
  await formatWorkspaces({
@@ -948207,7 +948305,7 @@ function addTestCommand(cli, cliContext) {
948207
948305
  description: "Run the tests configured to a specific language"
948208
948306
  }),
948209
948307
  async (argv) => {
948210
- await cliContext.instrumentPostHogEvent({
948308
+ cliContext.instrumentPostHogEvent({
948211
948309
  command: "fern test"
948212
948310
  });
948213
948311
  await testOutput({
@@ -948236,7 +948334,7 @@ function addMockCommand(cli, cliContext) {
948236
948334
  description: "The API to mock."
948237
948335
  }),
948238
948336
  async (argv) => {
948239
- await cliContext.instrumentPostHogEvent({
948337
+ cliContext.instrumentPostHogEvent({
948240
948338
  command: "fern mock"
948241
948339
  });
948242
948340
  await mockServer({
@@ -948275,7 +948373,7 @@ function addOverridesCompareCommand(cli, cliContext) {
948275
948373
  description: "Path to write the overrides file (defaults to <original>-overrides.yml)"
948276
948374
  }),
948277
948375
  async (argv) => {
948278
- await cliContext.instrumentPostHogEvent({
948376
+ cliContext.instrumentPostHogEvent({
948279
948377
  command: "fern overrides compare"
948280
948378
  });
948281
948379
  const originalPath = resolve6(cwd(), argv.original);
@@ -948306,7 +948404,7 @@ function addOverridesWriteCommand(cli, cliContext) {
948306
948404
  })
948307
948405
  ],
948308
948406
  async (argv) => {
948309
- await cliContext.instrumentPostHogEvent({
948407
+ cliContext.instrumentPostHogEvent({
948310
948408
  command: "fern overrides write"
948311
948409
  });
948312
948410
  await writeOverridesForWorkspaces({
@@ -948338,7 +948436,7 @@ function addWriteOverridesCommand(cli, cliContext) {
948338
948436
  ],
948339
948437
  async (argv) => {
948340
948438
  cliContext.logger.warn("The 'write-overrides' command is deprecated. Use 'fern overrides write' instead.");
948341
- await cliContext.instrumentPostHogEvent({
948439
+ cliContext.instrumentPostHogEvent({
948342
948440
  command: "fern write-overrides"
948343
948441
  });
948344
948442
  await writeOverridesForWorkspaces({
@@ -948368,7 +948466,7 @@ function addWriteDefinitionCommand(cli, cliContext) {
948368
948466
  }),
948369
948467
  async (argv) => {
948370
948468
  const preserveSchemaIds = argv.preserveSchemas != null;
948371
- await cliContext.instrumentPostHogEvent({
948469
+ cliContext.instrumentPostHogEvent({
948372
948470
  command: "fern write-definition"
948373
948471
  });
948374
948472
  await writeDefinitionForWorkspaces({
@@ -948411,7 +948509,7 @@ function addDocsMdGenerateCommand(cli, cliContext) {
948411
948509
  description: "Name of a specific library defined in docs.yml to generate docs for"
948412
948510
  }),
948413
948511
  async (argv) => {
948414
- await cliContext.instrumentPostHogEvent({
948512
+ cliContext.instrumentPostHogEvent({
948415
948513
  command: "fern docs md generate"
948416
948514
  });
948417
948515
  const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
@@ -948445,7 +948543,7 @@ function addDocsDiffCommand(cli, cliContext) {
948445
948543
  description: "Output directory for diff images"
948446
948544
  }),
948447
948545
  async (argv) => {
948448
- await cliContext.instrumentPostHogEvent({
948546
+ cliContext.instrumentPostHogEvent({
948449
948547
  command: "fern docs diff"
948450
948548
  });
948451
948549
  const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
@@ -948482,7 +948580,7 @@ function addDocsPreviewListCommand(cli, cliContext) {
948482
948580
  description: "Page number for pagination (starts at 1)"
948483
948581
  }),
948484
948582
  async (argv) => {
948485
- await cliContext.instrumentPostHogEvent({
948583
+ cliContext.instrumentPostHogEvent({
948486
948584
  command: "fern docs preview list"
948487
948585
  });
948488
948586
  await listDocsPreview({
@@ -948503,7 +948601,7 @@ function addDocsPreviewDeleteCommand(cli, cliContext) {
948503
948601
  demandOption: true
948504
948602
  }),
948505
948603
  async (argv) => {
948506
- await cliContext.instrumentPostHogEvent({
948604
+ cliContext.instrumentPostHogEvent({
948507
948605
  command: "fern docs preview delete"
948508
948606
  });
948509
948607
  await deleteDocsPreview({
@@ -948606,7 +948704,7 @@ function addDocsMdCheckCommand(cli, cliContext) {
948606
948704
  () => {
948607
948705
  },
948608
948706
  async () => {
948609
- await cliContext.instrumentPostHogEvent({
948707
+ cliContext.instrumentPostHogEvent({
948610
948708
  command: "fern docs md check"
948611
948709
  });
948612
948710
  const project = await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
@@ -948651,7 +948749,7 @@ function addGenerateJsonschemaCommand(cli, cliContext) {
948651
948749
  description: "The type to generate JSON Schema for (e.g. 'MySchema' or 'mypackage.MySchema')"
948652
948750
  }),
948653
948751
  async (argv) => {
948654
- await cliContext.instrumentPostHogEvent({
948752
+ cliContext.instrumentPostHogEvent({
948655
948753
  command: "fern jsonschema",
948656
948754
  properties: {
948657
948755
  output: argv.output
@@ -948680,7 +948778,7 @@ function addWriteDocsDefinitionCommand(cli, cliContext) {
948680
948778
  demandOption: true
948681
948779
  }),
948682
948780
  async (argv) => {
948683
- await cliContext.instrumentPostHogEvent({
948781
+ cliContext.instrumentPostHogEvent({
948684
948782
  command: "fern write-docs-definition",
948685
948783
  properties: {
948686
948784
  outputPath: argv.outputPath
@@ -948708,7 +948806,7 @@ function addWriteTranslationCommand(cli, cliContext) {
948708
948806
  description: "Return content as-is without calling the translation service"
948709
948807
  }),
948710
948808
  async (argv) => {
948711
- await cliContext.instrumentPostHogEvent({
948809
+ cliContext.instrumentPostHogEvent({
948712
948810
  command: "fern write-translation"
948713
948811
  });
948714
948812
  await writeTranslationForProject({
@@ -948739,7 +948837,7 @@ function addExportCommand(cli, cliContext) {
948739
948837
  default: 2
948740
948838
  }),
948741
948839
  async (argv) => {
948742
- await cliContext.instrumentPostHogEvent({
948840
+ cliContext.instrumentPostHogEvent({
948743
948841
  command: "fern export",
948744
948842
  properties: {
948745
948843
  outputPath: argv.outputPath
@@ -948777,7 +948875,7 @@ function addEnrichCommand(cli, cliContext) {
948777
948875
  demandOption: true
948778
948876
  }),
948779
948877
  async (argv) => {
948780
- await cliContext.instrumentPostHogEvent({
948878
+ cliContext.instrumentPostHogEvent({
948781
948879
  command: "fern api enrich"
948782
948880
  });
948783
948881
  const openapiPath = resolve6(cwd(), argv.openapi);
@@ -948957,7 +949055,7 @@ function addSdkPreviewCommand(cli, cliContext) {
948957
949055
  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
949056
  }),
948959
949057
  async (argv) => {
948960
- await cliContext.instrumentPostHogEvent({
949058
+ cliContext.instrumentPostHogEvent({
948961
949059
  command: "fern sdk preview"
948962
949060
  });
948963
949061
  const generatorFilter = argv.generator != null ? warnAndCorrectIncorrectDockerOrg(argv.generator, cliContext) : void 0;
@@ -949101,7 +949199,7 @@ function addReplayInitCommand(cli, cliContext) {
949101
949199
  description: "Overwrite existing lockfile if Replay is already initialized"
949102
949200
  }),
949103
949201
  async (argv) => {
949104
- await cliContext.instrumentPostHogEvent({
949202
+ cliContext.instrumentPostHogEvent({
949105
949203
  command: "fern replay init"
949106
949204
  });
949107
949205
  let githubRepo = argv.github;
@@ -949202,7 +949300,7 @@ function addReplayResolveCommand(cli, cliContext) {
949202
949300
  description: "Skip checking for remaining conflict markers before committing"
949203
949301
  }),
949204
949302
  async (argv) => {
949205
- await cliContext.instrumentPostHogEvent({
949303
+ cliContext.instrumentPostHogEvent({
949206
949304
  command: "fern replay resolve"
949207
949305
  });
949208
949306
  const outputDir = resolve6(cwd(), argv.directory ?? ".");
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.67.1",
2
+ "version": "4.68.0-2-g6060219ac9f",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",