@fern-api/fern-api-dev 4.48.1 → 4.49.0-6-ge40fb1dc646

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 +306 -76
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -297401,9 +297401,9 @@ var require_array_flatten = __commonJS({
297401
297401
  }
297402
297402
  });
297403
297403
 
297404
- // ../../../node_modules/.pnpm/path-to-regexp@0.1.12/node_modules/path-to-regexp/index.js
297404
+ // ../../../node_modules/.pnpm/path-to-regexp@0.1.13/node_modules/path-to-regexp/index.js
297405
297405
  var require_path_to_regexp = __commonJS({
297406
- "../../../node_modules/.pnpm/path-to-regexp@0.1.12/node_modules/path-to-regexp/index.js"(exports2, module4) {
297406
+ "../../../node_modules/.pnpm/path-to-regexp@0.1.13/node_modules/path-to-regexp/index.js"(exports2, module4) {
297407
297407
  "use strict";
297408
297408
  module4.exports = pathToRegexp2;
297409
297409
  var MATCHING_GROUP_REGEXP = /\\.|\((?:\?<(.*?)>)?(?!\?)/g;
@@ -297462,6 +297462,7 @@ var require_path_to_regexp = __commonJS({
297462
297462
  }
297463
297463
  pos = offset2 + match3.length;
297464
297464
  if (match3 === "*") {
297465
+ backtrack = "";
297465
297466
  extraOffset += 3;
297466
297467
  return "(.*)";
297467
297468
  }
@@ -297482,6 +297483,7 @@ var require_path_to_regexp = __commonJS({
297482
297483
  offset: offset2 + extraOffset
297483
297484
  });
297484
297485
  var result = "(?:" + format3 + slash + capture + (star3 ? "((?:[/" + format3 + "].+?)?)" : "") + ")" + optional20;
297486
+ backtrack = "";
297485
297487
  extraOffset += result.length - match3.length;
297486
297488
  return result;
297487
297489
  }
@@ -363450,9 +363452,9 @@ var require_diff3 = __commonJS({
363450
363452
  }
363451
363453
  });
363452
363454
 
363453
- // ../../../node_modules/.pnpm/@fern-api+replay@0.7.0/node_modules/@fern-api/replay/dist/index.cjs
363455
+ // ../../../node_modules/.pnpm/@fern-api+replay@0.8.0/node_modules/@fern-api/replay/dist/index.cjs
363454
363456
  var require_dist11 = __commonJS({
363455
- "../../../node_modules/.pnpm/@fern-api+replay@0.7.0/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
363457
+ "../../../node_modules/.pnpm/@fern-api+replay@0.8.0/node_modules/@fern-api/replay/dist/index.cjs"(exports2, module4) {
363456
363458
  "use strict";
363457
363459
  var __defProp4 = Object.defineProperty;
363458
363460
  var __getOwnPropDesc4 = Object.getOwnPropertyDescriptor;
@@ -363577,6 +363579,9 @@ var require_dist11 = __commonJS({
363577
363579
  return false;
363578
363580
  }
363579
363581
  }
363582
+ async getCommitBody(commitSha) {
363583
+ return this.exec(["log", "-1", "--format=%B", commitSha]);
363584
+ }
363580
363585
  getRepoPath() {
363581
363586
  return this.repoPath;
363582
363587
  }
@@ -363599,6 +363604,9 @@ var require_dist11 = __commonJS({
363599
363604
  forget: () => forget,
363600
363605
  isGenerationCommit: () => isGenerationCommit,
363601
363606
  isReplayCommit: () => isReplayCommit,
363607
+ isRevertCommit: () => isRevertCommit,
363608
+ parseRevertedMessage: () => parseRevertedMessage,
363609
+ parseRevertedSha: () => parseRevertedSha,
363602
363610
  reset: () => reset2,
363603
363611
  resolve: () => resolve13,
363604
363612
  status: () => status,
@@ -363622,6 +363630,17 @@ var require_dist11 = __commonJS({
363622
363630
  function isReplayCommit(commit) {
363623
363631
  return commit.message.startsWith("[fern-replay]");
363624
363632
  }
363633
+ function isRevertCommit(message) {
363634
+ return message.startsWith('Revert "');
363635
+ }
363636
+ function parseRevertedSha(fullBody) {
363637
+ const match3 = fullBody.match(/This reverts commit ([0-9a-f]{40})\./);
363638
+ return match3?.[1];
363639
+ }
363640
+ function parseRevertedMessage(subject) {
363641
+ const match3 = subject.match(/^Revert "(.+)"$/);
363642
+ return match3?.[1];
363643
+ }
363625
363644
  var import_node_fs32 = require("fs");
363626
363645
  var import_node_path41 = require("path");
363627
363646
  var import_yaml18 = require_dist8();
@@ -363780,14 +363799,14 @@ var require_dist11 = __commonJS({
363780
363799
  const lock = this.lockManager.read();
363781
363800
  const lastGen = this.getLastGeneration(lock);
363782
363801
  if (!lastGen) {
363783
- return [];
363802
+ return { patches: [], revertedPatchIds: [] };
363784
363803
  }
363785
363804
  const exists2 = await this.git.commitExists(lastGen.commit_sha);
363786
363805
  if (!exists2) {
363787
363806
  this.warnings.push(
363788
363807
  `Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Skipping new patch detection. Existing lockfile patches will still be applied.`
363789
363808
  );
363790
- return [];
363809
+ return { patches: [], revertedPatchIds: [] };
363791
363810
  }
363792
363811
  const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
363793
363812
  if (!isAncestor) {
@@ -363801,7 +363820,7 @@ var require_dist11 = __commonJS({
363801
363820
  this.sdkOutputDir
363802
363821
  ]);
363803
363822
  if (!log4.trim()) {
363804
- return [];
363823
+ return { patches: [], revertedPatchIds: [] };
363805
363824
  }
363806
363825
  const commits = this.parseGitLog(log4);
363807
363826
  const newPatches = [];
@@ -363837,7 +363856,60 @@ var require_dist11 = __commonJS({
363837
363856
  patch_content: patchContent
363838
363857
  });
363839
363858
  }
363840
- return newPatches.reverse();
363859
+ newPatches.reverse();
363860
+ const revertedPatchIdSet = /* @__PURE__ */ new Set();
363861
+ const revertIndicesToRemove = /* @__PURE__ */ new Set();
363862
+ for (let i11 = 0; i11 < newPatches.length; i11++) {
363863
+ const patch5 = newPatches[i11];
363864
+ if (!isRevertCommit(patch5.original_message)) continue;
363865
+ let body = "";
363866
+ try {
363867
+ body = await this.git.getCommitBody(patch5.original_commit);
363868
+ } catch {
363869
+ }
363870
+ const revertedSha = parseRevertedSha(body);
363871
+ const revertedMessage = parseRevertedMessage(patch5.original_message);
363872
+ let matchedExisting = false;
363873
+ if (revertedSha) {
363874
+ const existing = lock.patches.find((p10) => p10.original_commit === revertedSha);
363875
+ if (existing) {
363876
+ revertedPatchIdSet.add(existing.id);
363877
+ revertIndicesToRemove.add(i11);
363878
+ matchedExisting = true;
363879
+ }
363880
+ }
363881
+ if (!matchedExisting && revertedMessage) {
363882
+ const existing = lock.patches.find((p10) => p10.original_message === revertedMessage);
363883
+ if (existing) {
363884
+ revertedPatchIdSet.add(existing.id);
363885
+ revertIndicesToRemove.add(i11);
363886
+ matchedExisting = true;
363887
+ }
363888
+ }
363889
+ if (matchedExisting) continue;
363890
+ let matchedNew = false;
363891
+ if (revertedSha) {
363892
+ const idx = newPatches.findIndex(
363893
+ (p10, j16) => j16 !== i11 && !revertIndicesToRemove.has(j16) && p10.original_commit === revertedSha
363894
+ );
363895
+ if (idx !== -1) {
363896
+ revertIndicesToRemove.add(i11);
363897
+ revertIndicesToRemove.add(idx);
363898
+ matchedNew = true;
363899
+ }
363900
+ }
363901
+ if (!matchedNew && revertedMessage) {
363902
+ const idx = newPatches.findIndex(
363903
+ (p10, j16) => j16 !== i11 && !revertIndicesToRemove.has(j16) && p10.original_message === revertedMessage
363904
+ );
363905
+ if (idx !== -1) {
363906
+ revertIndicesToRemove.add(i11);
363907
+ revertIndicesToRemove.add(idx);
363908
+ }
363909
+ }
363910
+ }
363911
+ const filteredPatches = newPatches.filter((_16, i11) => !revertIndicesToRemove.has(i11));
363912
+ return { patches: filteredPatches, revertedPatchIds: [...revertedPatchIdSet] };
363841
363913
  }
363842
363914
  /**
363843
363915
  * Compute content hash for deduplication.
@@ -363848,31 +363920,34 @@ var require_dist11 = __commonJS({
363848
363920
  const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
363849
363921
  return `sha256:${(0, import_node_crypto7.createHash)("sha256").update(normalized).digest("hex")}`;
363850
363922
  }
363851
- /** Detect patches via tree diff for non-linear history. Returns a composite patch. */
363923
+ /**
363924
+ * Detect patches via tree diff for non-linear history. Returns a composite patch.
363925
+ * Revert reconciliation is skipped here because tree-diff produces a single composite
363926
+ * patch from the aggregate diff — individual revert commits are not distinguishable.
363927
+ */
363852
363928
  async detectPatchesViaTreeDiff(lastGen) {
363853
363929
  const filesOutput = await this.git.exec(["diff", "--name-only", lastGen.commit_sha, "HEAD"]);
363854
363930
  const files = filesOutput.trim().split("\n").filter(Boolean).filter((f10) => !INFRASTRUCTURE_FILES.has(f10)).filter((f10) => !f10.startsWith(".fern/"));
363855
- if (files.length === 0) return [];
363931
+ if (files.length === 0) return { patches: [], revertedPatchIds: [] };
363856
363932
  const diff2 = await this.git.exec(["diff", lastGen.commit_sha, "HEAD", "--", ...files]);
363857
- if (!diff2.trim()) return [];
363933
+ if (!diff2.trim()) return { patches: [], revertedPatchIds: [] };
363858
363934
  const contentHash = this.computeContentHash(diff2);
363859
363935
  const lock = this.lockManager.read();
363860
363936
  if (lock.patches.some((p10) => p10.content_hash === contentHash)) {
363861
- return [];
363937
+ return { patches: [], revertedPatchIds: [] };
363862
363938
  }
363863
363939
  const headSha = (await this.git.exec(["rev-parse", "HEAD"])).trim();
363864
- return [
363865
- {
363866
- id: `patch-composite-${headSha.slice(0, 8)}`,
363867
- content_hash: contentHash,
363868
- original_commit: headSha,
363869
- original_message: "Customer customizations (composite)",
363870
- original_author: "composite",
363871
- base_generation: lastGen.commit_sha,
363872
- files,
363873
- patch_content: diff2
363874
- }
363875
- ];
363940
+ const compositePatch = {
363941
+ id: `patch-composite-${headSha.slice(0, 8)}`,
363942
+ content_hash: contentHash,
363943
+ original_commit: headSha,
363944
+ original_message: "Customer customizations (composite)",
363945
+ original_author: "composite",
363946
+ base_generation: lastGen.commit_sha,
363947
+ files,
363948
+ patch_content: diff2
363949
+ };
363950
+ return { patches: [compositePatch], revertedPatchIds: [] };
363876
363951
  }
363877
363952
  parseGitLog(log4) {
363878
363953
  return log4.trim().split("\n").map((line) => {
@@ -364466,6 +364541,32 @@ CLI Version: ${options2.cliVersion}`;
364466
364541
  var import_node_path310 = require("path");
364467
364542
  var import_minimatch22 = require_commonjs3();
364468
364543
  init_GitClient();
364544
+ function stripConflictMarkers(content5) {
364545
+ const lines = content5.split("\n");
364546
+ const result = [];
364547
+ let inConflict = false;
364548
+ let inOurs = false;
364549
+ for (const line of lines) {
364550
+ if (line.startsWith("<<<<<<< ")) {
364551
+ inConflict = true;
364552
+ inOurs = true;
364553
+ continue;
364554
+ }
364555
+ if (inConflict && line === "=======") {
364556
+ inOurs = false;
364557
+ continue;
364558
+ }
364559
+ if (inConflict && line.startsWith(">>>>>>> ")) {
364560
+ inConflict = false;
364561
+ inOurs = false;
364562
+ continue;
364563
+ }
364564
+ if (!inConflict || inOurs) {
364565
+ result.push(line);
364566
+ }
364567
+ }
364568
+ return result.join("\n");
364569
+ }
364469
364570
  var ReplayService = class {
364470
364571
  git;
364471
364572
  detector;
@@ -364533,7 +364634,7 @@ CLI Version: ${options2.cliVersion}`;
364533
364634
  }
364534
364635
  this.lockManager.save();
364535
364636
  try {
364536
- const redetectedPatches = await this.detector.detectNewPatches();
364637
+ const { patches: redetectedPatches } = await this.detector.detectNewPatches();
364537
364638
  if (redetectedPatches.length > 0) {
364538
364639
  const redetectedFiles = new Set(redetectedPatches.flatMap((p10) => p10.files));
364539
364640
  const currentPatches = this.lockManager.getPatches();
@@ -364624,7 +364725,7 @@ CLI Version: ${options2.cliVersion}`;
364624
364725
  };
364625
364726
  }
364626
364727
  async handleNoPatchesRegeneration(options2) {
364627
- const newPatches = await this.detector.detectNewPatches();
364728
+ const { patches: newPatches, revertedPatchIds } = await this.detector.detectNewPatches();
364628
364729
  const warnings = [...this.detector.warnings];
364629
364730
  if (options2?.dryRun) {
364630
364731
  return {
@@ -364633,11 +364734,18 @@ CLI Version: ${options2.cliVersion}`;
364633
364734
  patchesApplied: 0,
364634
364735
  patchesWithConflicts: 0,
364635
364736
  patchesSkipped: 0,
364737
+ patchesReverted: revertedPatchIds.length,
364636
364738
  conflicts: [],
364637
364739
  wouldApply: newPatches,
364638
364740
  warnings: warnings.length > 0 ? warnings : void 0
364639
364741
  };
364640
364742
  }
364743
+ for (const id2 of revertedPatchIds) {
364744
+ try {
364745
+ this.lockManager.removePatch(id2);
364746
+ } catch {
364747
+ }
364748
+ }
364641
364749
  const commitOpts = options2 ? {
364642
364750
  cliVersion: options2.cliVersion ?? "unknown",
364643
364751
  generatorVersions: options2.generatorVersions ?? {},
@@ -364671,12 +364779,12 @@ CLI Version: ${options2.cliVersion}`;
364671
364779
  await this.committer.stageAll();
364672
364780
  }
364673
364781
  }
364674
- return this.buildReport("no-patches", newPatches, results, options2, warnings, rebaseCounts);
364782
+ return this.buildReport("no-patches", newPatches, results, options2, warnings, rebaseCounts, void 0, revertedPatchIds.length);
364675
364783
  }
364676
364784
  async handleNormalRegeneration(options2) {
364677
364785
  if (options2?.dryRun) {
364678
364786
  const existingPatches2 = this.lockManager.getPatches();
364679
- const newPatches2 = await this.detector.detectNewPatches();
364787
+ const { patches: newPatches2, revertedPatchIds: dryRunReverted } = await this.detector.detectNewPatches();
364680
364788
  const warnings2 = [...this.detector.warnings];
364681
364789
  const allPatches2 = [...existingPatches2, ...newPatches2];
364682
364790
  return {
@@ -364685,13 +364793,19 @@ CLI Version: ${options2.cliVersion}`;
364685
364793
  patchesApplied: 0,
364686
364794
  patchesWithConflicts: 0,
364687
364795
  patchesSkipped: 0,
364796
+ patchesReverted: dryRunReverted.length,
364688
364797
  conflicts: [],
364689
364798
  wouldApply: allPatches2,
364690
364799
  warnings: warnings2.length > 0 ? warnings2 : void 0
364691
364800
  };
364692
364801
  }
364693
364802
  let existingPatches = this.lockManager.getPatches();
364803
+ const preRebasePatchIds = new Set(existingPatches.map((p10) => p10.id));
364694
364804
  const preRebaseCounts = await this.preGenerationRebase(existingPatches);
364805
+ const postRebasePatchIds = new Set(this.lockManager.getPatches().map((p10) => p10.id));
364806
+ const removedByPreRebase = existingPatches.filter(
364807
+ (p10) => preRebasePatchIds.has(p10.id) && !postRebasePatchIds.has(p10.id)
364808
+ );
364695
364809
  existingPatches = this.lockManager.getPatches();
364696
364810
  const seenHashes = /* @__PURE__ */ new Set();
364697
364811
  for (const p10 of existingPatches) {
@@ -364702,8 +364816,28 @@ CLI Version: ${options2.cliVersion}`;
364702
364816
  }
364703
364817
  }
364704
364818
  existingPatches = this.lockManager.getPatches();
364705
- const newPatches = await this.detector.detectNewPatches();
364819
+ let { patches: newPatches, revertedPatchIds } = await this.detector.detectNewPatches();
364706
364820
  const warnings = [...this.detector.warnings];
364821
+ if (removedByPreRebase.length > 0) {
364822
+ const removedOriginalCommits = new Set(removedByPreRebase.map((p10) => p10.original_commit));
364823
+ const removedOriginalMessages = new Set(removedByPreRebase.map((p10) => p10.original_message));
364824
+ newPatches = newPatches.filter((p10) => {
364825
+ if (removedOriginalCommits.has(p10.original_commit)) return false;
364826
+ if (isRevertCommit(p10.original_message)) {
364827
+ const revertedMsg = parseRevertedMessage(p10.original_message);
364828
+ if (revertedMsg && removedOriginalMessages.has(revertedMsg)) return false;
364829
+ }
364830
+ return true;
364831
+ });
364832
+ }
364833
+ for (const id2 of revertedPatchIds) {
364834
+ try {
364835
+ this.lockManager.removePatch(id2);
364836
+ } catch {
364837
+ }
364838
+ }
364839
+ const revertedSet = new Set(revertedPatchIds);
364840
+ existingPatches = existingPatches.filter((p10) => !revertedSet.has(p10.id));
364707
364841
  const allPatches = [...existingPatches, ...newPatches];
364708
364842
  const commitOpts = options2 ? {
364709
364843
  cliVersion: options2.cliVersion ?? "unknown",
@@ -364748,7 +364882,8 @@ CLI Version: ${options2.cliVersion}`;
364748
364882
  options2,
364749
364883
  warnings,
364750
364884
  rebaseCounts,
364751
- preRebaseCounts
364885
+ preRebaseCounts,
364886
+ revertedPatchIds.length
364752
364887
  );
364753
364888
  }
364754
364889
  /**
@@ -364941,36 +365076,6 @@ CLI Version: ${options2.cliVersion}`;
364941
365076
  }
364942
365077
  return { conflictResolved, conflictAbsorbed, contentRefreshed };
364943
365078
  }
364944
- /**
364945
- * Strip conflict markers from file content, keeping the OURS (Generated) side.
364946
- * Preserves clean patches' non-conflicting changes on shared files.
364947
- */
364948
- stripConflictMarkers(content5) {
364949
- const lines = content5.split("\n");
364950
- const result = [];
364951
- let inConflict = false;
364952
- let inOurs = false;
364953
- for (const line of lines) {
364954
- if (line.startsWith("<<<<<<< ")) {
364955
- inConflict = true;
364956
- inOurs = true;
364957
- continue;
364958
- }
364959
- if (inConflict && line === "=======") {
364960
- inOurs = false;
364961
- continue;
364962
- }
364963
- if (inConflict && line.startsWith(">>>>>>> ")) {
364964
- inConflict = false;
364965
- inOurs = false;
364966
- continue;
364967
- }
364968
- if (!inConflict || inOurs) {
364969
- result.push(line);
364970
- }
364971
- }
364972
- return result.join("\n");
364973
- }
364974
365079
  /**
364975
365080
  * After applyPatches(), strip conflict markers from conflicting files
364976
365081
  * so only clean content is committed. Keeps the Generated (OURS) side.
@@ -364983,7 +365088,7 @@ CLI Version: ${options2.cliVersion}`;
364983
365088
  const filePath = (0, import_node_path310.join)(this.outputDir, fileResult.file);
364984
365089
  try {
364985
365090
  const content5 = (0, import_node_fs210.readFileSync)(filePath, "utf-8");
364986
- const stripped = this.stripConflictMarkers(content5);
365091
+ const stripped = stripConflictMarkers(content5);
364987
365092
  (0, import_node_fs210.writeFileSync)(filePath, stripped);
364988
365093
  } catch {
364989
365094
  }
@@ -364995,7 +365100,7 @@ CLI Version: ${options2.cliVersion}`;
364995
365100
  if (!(0, import_node_fs210.existsSync)(fernignorePath)) return [];
364996
365101
  return (0, import_node_fs210.readFileSync)(fernignorePath, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
364997
365102
  }
364998
- buildReport(flow4, patches, results, options2, warnings, rebaseCounts, preRebaseCounts) {
365103
+ buildReport(flow4, patches, results, options2, warnings, rebaseCounts, preRebaseCounts, patchesReverted) {
364999
365104
  const conflictResults = results.filter((r23) => r23.status === "conflict");
365000
365105
  const conflictDetails = conflictResults.map((r23) => {
365001
365106
  const conflictFiles = r23.fileResults?.filter((f10) => f10.status === "conflict") ?? [];
@@ -365020,6 +365125,7 @@ CLI Version: ${options2.cliVersion}`;
365020
365125
  patchesRepointed: rebaseCounts && rebaseCounts.repointed > 0 ? rebaseCounts.repointed : void 0,
365021
365126
  patchesContentRebased: rebaseCounts && rebaseCounts.contentRebased > 0 ? rebaseCounts.contentRebased : void 0,
365022
365127
  patchesKeptAsUserOwned: rebaseCounts && rebaseCounts.keptAsUserOwned > 0 ? rebaseCounts.keptAsUserOwned : void 0,
365128
+ patchesReverted: patchesReverted && patchesReverted > 0 ? patchesReverted : void 0,
365023
365129
  patchesConflictResolved: preRebaseCounts && preRebaseCounts.conflictResolved + preRebaseCounts.conflictAbsorbed > 0 ? preRebaseCounts.conflictResolved + preRebaseCounts.conflictAbsorbed : void 0,
365024
365130
  patchesRefreshed: preRebaseCounts && preRebaseCounts.contentRefreshed > 0 ? preRebaseCounts.contentRefreshed : void 0,
365025
365131
  conflicts: conflictResults.flatMap((r23) => r23.fileResults?.filter((f10) => f10.status === "conflict") ?? []),
@@ -365064,7 +365170,7 @@ CLI Version: ${options2.cliVersion}`;
365064
365170
  async analyzeMigration() {
365065
365171
  const patterns = this.readFernignorePatterns();
365066
365172
  const detector = new ReplayDetector(this.git, this.lockManager, this.outputDir);
365067
- const patches = await detector.detectNewPatches();
365173
+ const { patches } = await detector.detectNewPatches();
365068
365174
  const trackedByBoth = [];
365069
365175
  const fernignoreOnly = [];
365070
365176
  const commitsOnly = [];
@@ -365189,7 +365295,7 @@ CLI Version: ${options2.cliVersion}`;
365189
365295
  async migrate() {
365190
365296
  const analysis = await this.analyzeMigration();
365191
365297
  const detector = new ReplayDetector(this.git, this.lockManager, this.outputDir);
365192
- const patches = await detector.detectNewPatches();
365298
+ const { patches } = await detector.detectNewPatches();
365193
365299
  const warnings = [];
365194
365300
  let patchesCreated = 0;
365195
365301
  for (const patch5 of patches) {
@@ -463670,6 +463776,7 @@ __export(schemas_exports2, {
463670
463776
  UnionDiscriminatorContext: () => UnionDiscriminatorContext,
463671
463777
  WebSocketOrigin: () => WebSocketOrigin,
463672
463778
  WebhookMethodSchema: () => WebhookMethodSchema,
463779
+ WebhookPayloadBodySortSchema: () => WebhookPayloadBodySortSchema,
463673
463780
  WebhookPayloadComponentSchema: () => WebhookPayloadComponentSchema,
463674
463781
  WebhookSignatureAlgorithmSchema: () => WebhookSignatureAlgorithmSchema,
463675
463782
  WebhookSignatureEncodingSchema: () => WebhookSignatureEncodingSchema,
@@ -463826,6 +463933,7 @@ var webhooks_exports = {};
463826
463933
  __export(webhooks_exports, {
463827
463934
  AsymmetricAlgorithmSchema: () => AsymmetricAlgorithmSchema,
463828
463935
  WebhookMethodSchema: () => WebhookMethodSchema,
463936
+ WebhookPayloadBodySortSchema: () => WebhookPayloadBodySortSchema,
463829
463937
  WebhookPayloadComponentSchema: () => WebhookPayloadComponentSchema,
463830
463938
  WebhookSignatureAlgorithmSchema: () => WebhookSignatureAlgorithmSchema,
463831
463939
  WebhookSignatureEncodingSchema: () => WebhookSignatureEncodingSchema,
@@ -463849,6 +463957,11 @@ var WebhookMethodSchema = {
463849
463957
  Get: "GET"
463850
463958
  };
463851
463959
 
463960
+ // ../fern-definition/schema/lib/schemas/api/resources/webhooks/types/WebhookPayloadBodySortSchema.js
463961
+ var WebhookPayloadBodySortSchema = {
463962
+ Alphabetical: "alphabetical"
463963
+ };
463964
+
463852
463965
  // ../fern-definition/schema/lib/schemas/api/resources/webhooks/types/WebhookPayloadComponentSchema.js
463853
463966
  var WebhookPayloadComponentSchema = {
463854
463967
  Body: "body",
@@ -464056,6 +464169,7 @@ __export(serialization_exports, {
464056
464169
  WebSocketOrigin: () => WebSocketOrigin2,
464057
464170
  WebhookInlinedPayloadSchema: () => WebhookInlinedPayloadSchema,
464058
464171
  WebhookMethodSchema: () => WebhookMethodSchema2,
464172
+ WebhookPayloadBodySortSchema: () => WebhookPayloadBodySortSchema2,
464059
464173
  WebhookPayloadComponentSchema: () => WebhookPayloadComponentSchema2,
464060
464174
  WebhookPayloadFormatSchema: () => WebhookPayloadFormatSchema,
464061
464175
  WebhookPayloadSchema: () => WebhookPayloadSchema,
@@ -466476,13 +466590,17 @@ var AsymmetricSignatureSchema = schemas_exports.object({
466476
466590
  timestamp: WebhookTimestampSchema.optional()
466477
466591
  });
466478
466592
 
466593
+ // ../fern-definition/schema/lib/schemas/serialization/resources/webhooks/types/WebhookPayloadBodySortSchema.js
466594
+ var WebhookPayloadBodySortSchema2 = schemas_exports.enum_(["alphabetical"]);
466595
+
466479
466596
  // ../fern-definition/schema/lib/schemas/serialization/resources/webhooks/types/WebhookPayloadComponentSchema.js
466480
466597
  var WebhookPayloadComponentSchema2 = schemas_exports.enum_(["body", "timestamp", "notification-url", "message-id"]);
466481
466598
 
466482
466599
  // ../fern-definition/schema/lib/schemas/serialization/resources/webhooks/types/WebhookPayloadFormatSchema.js
466483
466600
  var WebhookPayloadFormatSchema = schemas_exports.object({
466484
466601
  components: schemas_exports.list(WebhookPayloadComponentSchema2),
466485
- delimiter: schemas_exports.string().optional()
466602
+ delimiter: schemas_exports.string().optional(),
466603
+ "body-sort": WebhookPayloadBodySortSchema2.optional()
466486
466604
  });
466487
466605
 
466488
466606
  // ../fern-definition/schema/lib/schemas/serialization/resources/webhooks/types/WebhookSignatureAlgorithmSchema.js
@@ -466824,6 +466942,7 @@ __export(webhooks_exports2, {
466824
466942
  HmacSignatureSchema: () => HmacSignatureSchema,
466825
466943
  WebhookInlinedPayloadSchema: () => WebhookInlinedPayloadSchema,
466826
466944
  WebhookMethodSchema: () => WebhookMethodSchema2,
466945
+ WebhookPayloadBodySortSchema: () => WebhookPayloadBodySortSchema2,
466827
466946
  WebhookPayloadComponentSchema: () => WebhookPayloadComponentSchema2,
466828
466947
  WebhookPayloadFormatSchema: () => WebhookPayloadFormatSchema,
466829
466948
  WebhookPayloadSchema: () => WebhookPayloadSchema,
@@ -467054,6 +467173,7 @@ __export(api_exports, {
467054
467173
  WebSocketMessageOrigin: () => WebSocketMessageOrigin,
467055
467174
  WebhookHttpMethod: () => WebhookHttpMethod,
467056
467175
  WebhookPayload: () => WebhookPayload,
467176
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort,
467057
467177
  WebhookPayloadComponent: () => WebhookPayloadComponent,
467058
467178
  WebhookSignatureEncoding: () => WebhookSignatureEncoding,
467059
467179
  WebhookSignatureVerification: () => WebhookSignatureVerification,
@@ -471312,6 +471432,7 @@ __export(webhooks_exports3, {
471312
471432
  HmacAlgorithm: () => HmacAlgorithm,
471313
471433
  WebhookHttpMethod: () => WebhookHttpMethod,
471314
471434
  WebhookPayload: () => WebhookPayload,
471435
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort,
471315
471436
  WebhookPayloadComponent: () => WebhookPayloadComponent,
471316
471437
  WebhookSignatureEncoding: () => WebhookSignatureEncoding,
471317
471438
  WebhookSignatureVerification: () => WebhookSignatureVerification,
@@ -471460,6 +471581,22 @@ var WebhookPayload = {
471460
471581
  }
471461
471582
  };
471462
471583
 
471584
+ // ../../ir-sdk/lib/sdk/api/resources/webhooks/types/WebhookPayloadBodySort.js
471585
+ var WebhookPayloadBodySortValues = {
471586
+ Alphabetical: "ALPHABETICAL"
471587
+ };
471588
+ var WebhookPayloadBodySort = {
471589
+ ...WebhookPayloadBodySortValues,
471590
+ _visit: (value, visitor) => {
471591
+ switch (value) {
471592
+ case WebhookPayloadBodySort.Alphabetical:
471593
+ return visitor.alphabetical();
471594
+ default:
471595
+ return visitor._other();
471596
+ }
471597
+ }
471598
+ };
471599
+
471463
471600
  // ../../ir-sdk/lib/sdk/api/resources/webhooks/types/WebhookPayloadComponent.js
471464
471601
  var WebhookPayloadComponentValues = {
471465
471602
  /**
@@ -471970,6 +472107,7 @@ __export(serialization_exports2, {
471970
472107
  WebhookId: () => WebhookId,
471971
472108
  WebhookName: () => WebhookName,
471972
472109
  WebhookPayload: () => WebhookPayload2,
472110
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort2,
471973
472111
  WebhookPayloadComponent: () => WebhookPayloadComponent2,
471974
472112
  WebhookPayloadFormat: () => WebhookPayloadFormat,
471975
472113
  WebhookPayloadReference: () => WebhookPayloadReference,
@@ -477373,13 +477511,17 @@ var AsymmetricKeySignatureVerification = schemas_exports3.objectWithoutOptionalP
477373
477511
  // ../../ir-sdk/lib/sdk/serialization/resources/webhooks/types/HmacAlgorithm.js
477374
477512
  var HmacAlgorithm2 = schemas_exports3.enum_(["SHA256", "SHA1", "SHA384", "SHA512"]);
477375
477513
 
477514
+ // ../../ir-sdk/lib/sdk/serialization/resources/webhooks/types/WebhookPayloadBodySort.js
477515
+ var WebhookPayloadBodySort2 = schemas_exports3.enum_(["ALPHABETICAL"]);
477516
+
477376
477517
  // ../../ir-sdk/lib/sdk/serialization/resources/webhooks/types/WebhookPayloadComponent.js
477377
477518
  var WebhookPayloadComponent2 = schemas_exports3.enum_(["BODY", "TIMESTAMP", "NOTIFICATION_URL", "MESSAGE_ID"]);
477378
477519
 
477379
477520
  // ../../ir-sdk/lib/sdk/serialization/resources/webhooks/types/WebhookPayloadFormat.js
477380
477521
  var WebhookPayloadFormat = schemas_exports3.objectWithoutOptionalProperties({
477381
477522
  components: schemas_exports3.list(WebhookPayloadComponent2),
477382
- delimiter: schemas_exports3.string()
477523
+ delimiter: schemas_exports3.string(),
477524
+ bodySort: WebhookPayloadBodySort2.optional()
477383
477525
  });
477384
477526
 
477385
477527
  // ../../ir-sdk/lib/sdk/serialization/resources/webhooks/types/HmacSignatureVerification.js
@@ -478225,6 +478367,7 @@ __export(webhooks_exports4, {
478225
478367
  WebhookHttpMethod: () => WebhookHttpMethod2,
478226
478368
  WebhookName: () => WebhookName,
478227
478369
  WebhookPayload: () => WebhookPayload2,
478370
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort2,
478228
478371
  WebhookPayloadComponent: () => WebhookPayloadComponent2,
478229
478372
  WebhookPayloadFormat: () => WebhookPayloadFormat,
478230
478373
  WebhookPayloadReference: () => WebhookPayloadReference,
@@ -502877,6 +503020,7 @@ __export(finalIr_exports, {
502877
503020
  Schema: () => Schema,
502878
503021
  SupportedSdkLanguage: () => SupportedSdkLanguage3,
502879
503022
  WebhookHttpMethod: () => WebhookHttpMethod3,
503023
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort3,
502880
503024
  WebhookPayloadComponent: () => WebhookPayloadComponent3,
502881
503025
  WebhookSignatureAlgorithm: () => WebhookSignatureAlgorithm,
502882
503026
  WebhookSignatureEncoding: () => WebhookSignatureEncoding3,
@@ -503778,6 +503922,22 @@ var WebhookHttpMethod3 = {
503778
503922
  }
503779
503923
  };
503780
503924
 
503925
+ // ../api-importers/openapi/openapi-ir/lib/sdk/api/resources/finalIr/types/WebhookPayloadBodySort.js
503926
+ var WebhookPayloadBodySortValues2 = {
503927
+ Alphabetical: "alphabetical"
503928
+ };
503929
+ var WebhookPayloadBodySort3 = {
503930
+ ...WebhookPayloadBodySortValues2,
503931
+ _visit: (value, visitor) => {
503932
+ switch (value) {
503933
+ case WebhookPayloadBodySort3.Alphabetical:
503934
+ return visitor.alphabetical();
503935
+ default:
503936
+ return visitor._other();
503937
+ }
503938
+ }
503939
+ };
503940
+
503781
503941
  // ../api-importers/openapi/openapi-ir/lib/sdk/api/resources/finalIr/types/WebhookPayloadComponent.js
503782
503942
  var WebhookPayloadComponentValues2 = {
503783
503943
  Body: "body",
@@ -504525,6 +504685,7 @@ __export(serialization_exports5, {
504525
504685
  Webhook: () => Webhook2,
504526
504686
  WebhookExampleCall: () => WebhookExampleCall,
504527
504687
  WebhookHttpMethod: () => WebhookHttpMethod4,
504688
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort4,
504528
504689
  WebhookPayloadComponent: () => WebhookPayloadComponent4,
504529
504690
  WebhookPayloadFormat: () => WebhookPayloadFormat2,
504530
504691
  WebhookSignatureAlgorithm: () => WebhookSignatureAlgorithm2,
@@ -506532,6 +506693,7 @@ __export(finalIr_exports2, {
506532
506693
  Webhook: () => Webhook2,
506533
506694
  WebhookExampleCall: () => WebhookExampleCall,
506534
506695
  WebhookHttpMethod: () => WebhookHttpMethod4,
506696
+ WebhookPayloadBodySort: () => WebhookPayloadBodySort4,
506535
506697
  WebhookPayloadComponent: () => WebhookPayloadComponent4,
506536
506698
  WebhookPayloadFormat: () => WebhookPayloadFormat2,
506537
506699
  WebhookSignatureAlgorithm: () => WebhookSignatureAlgorithm2,
@@ -507068,13 +507230,17 @@ var GlobalHeader = schemas_exports9.objectWithoutOptionalProperties({
507068
507230
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/GlobalSecurity.js
507069
507231
  var GlobalSecurity = schemas_exports9.list(schemas_exports9.record(SecuritySchemeId, schemas_exports9.list(schemas_exports9.string())));
507070
507232
 
507233
+ // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookPayloadBodySort.js
507234
+ var WebhookPayloadBodySort4 = schemas_exports9.enum_(["alphabetical"]);
507235
+
507071
507236
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookPayloadComponent.js
507072
507237
  var WebhookPayloadComponent4 = schemas_exports9.enum_(["body", "timestamp", "notification-url", "message-id"]);
507073
507238
 
507074
507239
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookPayloadFormat.js
507075
507240
  var WebhookPayloadFormat2 = schemas_exports9.objectWithoutOptionalProperties({
507076
507241
  components: schemas_exports9.list(WebhookPayloadComponent4),
507077
- delimiter: schemas_exports9.string().optional()
507242
+ delimiter: schemas_exports9.string().optional(),
507243
+ bodySort: WebhookPayloadBodySort4.optional()
507078
507244
  });
507079
507245
 
507080
507246
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookSignatureAlgorithm.js
@@ -512777,9 +512943,21 @@ function convertPayloadFormat(payloadFormat) {
512777
512943
  }
512778
512944
  return {
512779
512945
  components: payloadFormat.components.map(convertPayloadComponent),
512780
- delimiter: payloadFormat.delimiter
512946
+ delimiter: payloadFormat.delimiter,
512947
+ "body-sort": convertBodySort(payloadFormat.bodySort)
512781
512948
  };
512782
512949
  }
512950
+ function convertBodySort(bodySort) {
512951
+ if (bodySort == null) {
512952
+ return void 0;
512953
+ }
512954
+ switch (bodySort) {
512955
+ case "alphabetical":
512956
+ return "alphabetical";
512957
+ default:
512958
+ return void 0;
512959
+ }
512960
+ }
512783
512961
  function convertPayloadComponent(component) {
512784
512962
  switch (component) {
512785
512963
  case "body":
@@ -530514,9 +530692,19 @@ function convertPayloadFormat2(payloadFormat) {
530514
530692
  return finalIr_exports.WebhookPayloadComponent.MessageId;
530515
530693
  }
530516
530694
  }),
530517
- delimiter: payloadFormat.delimiter
530695
+ delimiter: payloadFormat.delimiter,
530696
+ bodySort: convertBodySort2(payloadFormat["body-sort"])
530518
530697
  };
530519
530698
  }
530699
+ function convertBodySort2(bodySort) {
530700
+ if (bodySort == null) {
530701
+ return void 0;
530702
+ }
530703
+ switch (bodySort) {
530704
+ case "alphabetical":
530705
+ return finalIr_exports.WebhookPayloadBodySort.Alphabetical;
530706
+ }
530707
+ }
530520
530708
  function convertAlgorithm(algorithm) {
530521
530709
  if (algorithm == null) {
530522
530710
  return void 0;
@@ -547909,14 +548097,24 @@ function convertPayloadFormat3(payloadFormat) {
547909
548097
  if (payloadFormat == null) {
547910
548098
  return {
547911
548099
  components: [WebhookPayloadComponent.Body],
547912
- delimiter: ""
548100
+ delimiter: "",
548101
+ bodySort: void 0
547913
548102
  };
547914
548103
  }
547915
548104
  return {
547916
548105
  components: payloadFormat.components.map(convertPayloadComponent2),
547917
- delimiter: payloadFormat.delimiter ?? ""
548106
+ delimiter: payloadFormat.delimiter ?? "",
548107
+ bodySort: convertBodySort3(payloadFormat["body-sort"])
547918
548108
  };
547919
548109
  }
548110
+ function convertBodySort3(bodySort) {
548111
+ switch (bodySort) {
548112
+ case "alphabetical":
548113
+ return WebhookPayloadBodySort.Alphabetical;
548114
+ case void 0:
548115
+ return void 0;
548116
+ }
548117
+ }
547920
548118
  function convertPayloadComponent2(component) {
547921
548119
  switch (component) {
547922
548120
  case "body":
@@ -574778,6 +574976,12 @@ var definitions2 = {
574778
574976
  "message-id"
574779
574977
  ]
574780
574978
  },
574979
+ "webhooks.WebhookPayloadBodySortSchema": {
574980
+ type: "string",
574981
+ enum: [
574982
+ "alphabetical"
574983
+ ]
574984
+ },
574781
574985
  "webhooks.WebhookPayloadFormatSchema": {
574782
574986
  type: "object",
574783
574987
  properties: {
@@ -574796,6 +575000,16 @@ var definitions2 = {
574796
575000
  type: "null"
574797
575001
  }
574798
575002
  ]
575003
+ },
575004
+ "body-sort": {
575005
+ oneOf: [
575006
+ {
575007
+ $ref: "#/definitions/webhooks.WebhookPayloadBodySortSchema"
575008
+ },
575009
+ {
575010
+ type: "null"
575011
+ }
575012
+ ]
574799
575013
  }
574800
575014
  },
574801
575015
  required: [
@@ -578868,6 +579082,12 @@ var definitions3 = {
578868
579082
  "message-id"
578869
579083
  ]
578870
579084
  },
579085
+ "webhooks.WebhookPayloadBodySortSchema": {
579086
+ type: "string",
579087
+ enum: [
579088
+ "alphabetical"
579089
+ ]
579090
+ },
578871
579091
  "webhooks.WebhookPayloadFormatSchema": {
578872
579092
  type: "object",
578873
579093
  properties: {
@@ -578886,6 +579106,16 @@ var definitions3 = {
578886
579106
  type: "null"
578887
579107
  }
578888
579108
  ]
579109
+ },
579110
+ "body-sort": {
579111
+ oneOf: [
579112
+ {
579113
+ $ref: "#/definitions/webhooks.WebhookPayloadBodySortSchema"
579114
+ },
579115
+ {
579116
+ type: "null"
579117
+ }
579118
+ ]
578889
579119
  }
578890
579120
  },
578891
579121
  required: [
@@ -601952,7 +602182,7 @@ var AccessTokenPosthogManager = class {
601952
602182
  properties: {
601953
602183
  ...event,
601954
602184
  ...event.properties,
601955
- version: "4.48.1",
602185
+ version: "4.49.0-6-ge40fb1dc646",
601956
602186
  usingAccessToken: true
601957
602187
  }
601958
602188
  });
@@ -602003,7 +602233,7 @@ var UserPosthogManager = class {
602003
602233
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
602004
602234
  event: "CLI",
602005
602235
  properties: {
602006
- version: "4.48.1",
602236
+ version: "4.49.0-6-ge40fb1dc646",
602007
602237
  ...event,
602008
602238
  ...event.properties,
602009
602239
  usingAccessToken: false,
@@ -825858,7 +826088,7 @@ var import_path54 = __toESM(require("path"), 1);
825858
826088
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
825859
826089
  var LOGS_FOLDER_NAME = "logs";
825860
826090
  function getCliSource() {
825861
- const version7 = "4.48.1";
826091
+ const version7 = "4.49.0-6-ge40fb1dc646";
825862
826092
  return `cli@${version7}`;
825863
826093
  }
825864
826094
  var DebugLogger = class {
@@ -836860,7 +837090,7 @@ var LegacyDocsPublisher = class {
836860
837090
  previewId: void 0,
836861
837091
  disableTemplates: void 0,
836862
837092
  skipUpload,
836863
- cliVersion: "4.48.1"
837093
+ cliVersion: "4.49.0-6-ge40fb1dc646"
836864
837094
  });
836865
837095
  if (taskContext.getResult() === TaskResult.Failure) {
836866
837096
  return { success: false };
@@ -909975,7 +910205,7 @@ var CliContext = class {
909975
910205
  if (false) {
909976
910206
  this.logger.error("CLI_VERSION is not defined");
909977
910207
  }
909978
- return "4.48.1";
910208
+ return "4.49.0-6-ge40fb1dc646";
909979
910209
  }
909980
910210
  getCliName() {
909981
910211
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.48.1",
2
+ "version": "4.49.0-6-ge40fb1dc646",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",